Hi, A numexpr either ends with a \relax or is delimited by () So, the following works as expected: \number\numexpr(1) test but ... the following gives an error message: \number\numexpr(1) /test so, the expr parser looks beyond the ) which is rather strange; bug or feature? (those expr are behaving a bit strange anyway) Hans PS. for those using etex primitives, recently i ran into a bug in \lastnodetype (resulting in incorrect return values or funny side effects), this is already corrected (by fabrice/olaf) in the yet to come versions. ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE/POD/CTS Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------
Thursday, February 12, 2004 Hans Hagen wrote:
Hi,
A numexpr either ends with a \relax or is delimited by ()
So, the following works as expected:
\number\numexpr(1) test
but ... the following gives an error message:
\number\numexpr(1) /test
so, the expr parser looks beyond the ) which is rather strange; bug or feature?
It's WAD (Working As Desgined). I.e., it's a feature. The manual clearly states that an expression is "initiated by one of the commands \numexpr, \dimexpr, \glueexpr, or \muexpr and optionally terminated by one \relax (that will be absorbed by the scanning mechanism)". () are only used to limit *sub*expression. Observe that this is congruent with the TeX way of scanning for assignments. So always put a \relax after an expression :)
(those expr are behaving a bit strange anyway)
What other problems are you having? Keep in mind the limited precision TeX works with. -- Giuseppe "Oblomov" Bilotta
At 12:59 14/02/2004, you wrote:
Observe that this is congruent with the TeX way of scanning for assignments.
not entirely since the space is not seen as a delimiter \count0=123 4 \count0=\numexpr(123) 4
So always put a \relax after an expression :)
yes, but i'm occasionally surpised when a \relax is pushed back in the list (and for instance acrobat does not like "/Whatever 12\relax"
What other problems are you having? Keep in mind the limited precision TeX works with.
Many ... we can get depressed on that at the dante meeting ... but then get cheered up by a few new nice things that tex can do with pdf (more later) Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE/POD/CTS Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------
Saturday, February 14, 2004 Hans Hagen wrote:
So always put a \relax after an expression :)
yes, but i'm occasionally surpised when a \relax is pushed back in the list (and for instance acrobat does not like "/Whatever 12\relax"
Well, that's not a \relax that comes from an \..expr command for sure. -- Giuseppe "Oblomov" Bilotta
participants (2)
-
Giuseppe Bilotta
-
Hans Hagen