ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* numexpr in etex / bug ?
@ 2004-02-12 20:26 Hans Hagen
  2004-02-14 11:59 ` Giuseppe Bilotta
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2004-02-12 20:26 UTC (permalink / raw)
  Cc: Fabrice Popineau

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
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: numexpr in etex / bug ?
  2004-02-12 20:26 numexpr in etex / bug ? Hans Hagen
@ 2004-02-14 11:59 ` Giuseppe Bilotta
  2004-02-14 15:04   ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Giuseppe Bilotta @ 2004-02-14 11:59 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: numexpr in etex / bug ?
  2004-02-14 11:59 ` Giuseppe Bilotta
@ 2004-02-14 15:04   ` Hans Hagen
  2004-02-14 18:18     ` Re[2]: " Giuseppe Bilotta
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2004-02-14 15:04 UTC (permalink / raw)


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
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re[2]: numexpr in etex / bug ?
  2004-02-14 15:04   ` Hans Hagen
@ 2004-02-14 18:18     ` Giuseppe Bilotta
  0 siblings, 0 replies; 4+ messages in thread
From: Giuseppe Bilotta @ 2004-02-14 18:18 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-02-14 18:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-12 20:26 numexpr in etex / bug ? Hans Hagen
2004-02-14 11:59 ` Giuseppe Bilotta
2004-02-14 15:04   ` Hans Hagen
2004-02-14 18:18     ` Re[2]: " Giuseppe Bilotta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).