# [dev-context] \lastxpos and \lastypos should behave like registers

Hans Hagen j.hagen at xs4all.nl
Thu May 23 09:19:29 CEST 2019

```On 5/23/2019 2:05 AM, Henri Menke wrote:
>
>
> On 23/05/19 11:55 AM, Hans Hagen wrote:
>> On 5/23/2019 1:47 AM, Henri Menke wrote:
>>>
>>>
>>> On 23/05/19 11:36 AM, Hans Hagen wrote:
>>>> On 5/23/2019 1:11 AM, Henri Menke wrote:
>>>>> Dear devs,
>>>>>
>>>>> The two macros \lastxpos and \lastypos should behave like registers,
>>>>> because that is what they are in LuaTeX.  The following MWE fails with
>>>>>
>>>>> ! You can't use `the character 0' after \the
>>>>>
>>>>> \starttext
>>>>> \the\lastxpos
>>>>> \the\lastypos
>>>>> \stoptext
>>>>>
>>>>> A simple fix would be to wrap the macro in \numexpr like in the attached
>>>>> patch.
>>>>
>>>> hm, i was actually about to drop them completely ... anyway, i have no
>>>> problem with the fix but then it also need to be \unexpanded
>>>>     (i'm reshuffling some code so probably no beta for a few days)
>>>
>>> Dropping \pdflastxpos and \pdflastypos would break TikZ, so it would be
>>> good if at least the \lastxpos and \lastypos primitives would be
>>> accessible.
>> ok, but i assume that there is no need for the \pdf* ones (because i
>> decided to drop all those specific \pdf* aliases in the next beta ...
>> they were never meant to be persistent part of mkiv) ... i grepped tikz
>> and could not find usage of \pdf... apart from the official luatex ones
>>
>> (actually, tikz is the only package i know that we need to keep an eye
>> on wrt downward compatibility; context modules use different interfaces)
>
> You might be happy to hear that I am the current TikZ maintainer, so I
> can shape it for best interoperability with ConTeXt.

ok, so the abstraction layer can be improved a bit then

> Currently \pdflastpos is only used in one place
> https://github.com/pgf-tikz/pgf/blob/07959624c5e4c50f80ddf31a3b271885237b37cc/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def#L97-L102
> but that can be abstracted.
dvi sounds like pdftex being used (or maybe xetex)
Hans

-----------------------------------------------------------------