jed-users mailing list

[2005 Date Index] [2005 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: problem with preparsing and #ifeval


G. Milde <g.milde@xxxxxx> wrote:
>#if (_slang_version > 2000)

  [I think you meant '20000']

>message("SLang 2");
>#else
>message("Slang 1");
>#endif
>
>While without preparsing, everything works fine, the preparsed version leaves 
>'^A' on the stack when evaluated during startup (via autoload). This leads

If you were able to preparse this, then there must have already been
something on the stack because the preparsed files do not support
these constructs.  The reason is that during preparsing, the
expression (_slang_version>20000) does not get evaluated, leaving
nothing for #if to test.  As a result, a syntax error should have been
generated.

I will have to think more about whether or not "#if (expr)" should get
evaluated during this stage (naively, yes).  Otherwise a more
informative error message about the use of such constructs would be
better. 

If the behavior is changed for slang 2, that would not help you in
this case because you want this to also work with slang 1.  I would use
this test for slang2:

   #ifexists _slang_utf8_ok
     <slang-2 code>
   #else
     <slang-1 code>
   #endif

Thanks,
--John

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2005 date index] [2005 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]