|
From: Petr M. <mi...@ph...> - 2006-08-14 06:05:34
|
> You are missing my point.
> foo is a variable. It may hold a string ("xxx") or it may hold an integer (9).
> It is legal to call
> if (exists(foo))
> in the first case, and the return code is 1, which tells you that foo contains
> the name of a defined variable.
>
> As I see it, if foo = 9 then exists(foo) should return 0, which tells you that
> foo does _not_ contain the name of a defined variable. That is what it does
> now, and I think it is correct. Daniel's patch would have it error out rather
> than returning.
Ok, you are right.
>> gnuplot> help exists
>> `exists("X")` returns 1 if a variable named X has been defined,
>> otherwise it returns 0.
> ^^^^^^^^^^^^^^^^^^^^^^^
>
> That is exactly what I am saying. If the argument to exists() is not a
> defined variable name (i.e. a string), then exists() should return 0.
> Not error out; return 0.
Could you perhaps add this into "help exists"?
---
PM
|