slang-users mailing list

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

Re: [slang-users] is_defined


On 28.11.20 21:27, Morten Bo Johansen wrote:
Hi

If I do

   if (is_defined ("foo"))
     foo ();
and "foo" is not defined, then this notwithstanding, an error
is thrown: "foo is undefined".

This shouldn't happen, IMO, since the condition was not met,
and then the statement should be silently ignored and no error
thrown.

Morten,

I think the compiler is right: In the last statement, foo(), foo is a (syntactically) undefined name. This is an error, no matter if you check it later (at run time). Apparently there is no pre-processor here.

Regards,
Bernd


_______________________________________________
For list information, visit <http://jedsoft.org/slang/mailinglists.html>.


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