I have read carefully the etex manual to understand the syntax of dimexpr and numexpr but my limited comprehension remains limited... The expression "\dimexpr" appears only 3 times in the mentioned manual and nowhere is a formal definition (I mean: that answers my question).
So, in the detail, one can find this macro on the net:
\newcommand\dimtomm[1]{%
\strip@pt\dimexpr 0.352777778\dimexpr#1\relax\relax
}
to convert a dimension in mm. The thing is that it doesn't seem to take into account the initial unit of #1... ? Indeed, I use this newcommand with a position issued from zsavepos which is in sp, and it works as if I had given the newcommand a dimension in pt!
There is so a more general question about dimensions, for which I can't find answer among the litteracy (source book, ...) and internet: when a variable is defined to contain a dimension, is there a unit attached to it, or is just a number but with a label "dimension"? I guess... no! because of the \strip@pt, but this is in contradiction with the behavior of \dimtomm above (according to me, of course).
Who could make a clear topo about dimension, about coordinate (zsavepos...), about how add a zsavepos in sp with a dimension in pt, about the dimexpr functioning, and so on?
EDIT To be more precise about my questioning, in order the answers not to be too general: I get the zsavepos of a point and I can access to x and y which are lenghts in sp. Then I want to draw locate an object in a draw using something like:
$(current page.north west) + (0cm,\xcoordtodim{\zposy{pointA}})$
So I face two problems of different types:
1) I want \xcoordtodim returns a dim, and apparently, I can't do that with my current knowledge...
2) \xcoordtodim adds the zposy of a point (in sp) with a given length generally expressed in pt: this is the question of "mixing" units linked to \dimtomm and \dimexpr...
\dimexprbehavior”, what do you want to know? If you are wondering about the double\dimexpr, I guess that the author of the macro did so in order to make a call like\dimtomm{.5\baselineskip}work too. – GuM Apr 29 '17 at 19:51\dimexprstarts a 〈dimen expr〉 that is optionally closed with a\relax; the real explanations are given in the production for 〈dimen expr〉, and those it invokes, which you can find, as I said in my other comment, on p. 18. – GuM Apr 30 '17 at 22:09