|
Posted by rlee0001 on 03/12/06 12:55
Gary,
One thing about that is that it is counter-intuitive to read. For
example you are not asking "if 'fred' equals your name..." but rather
"if your name equals fred'...".
That said, your method is a very practical solution to a common
problem.
In a way I kinda wish that the '=' operator worked like the ECHO
construct in that you wouldn't be able to use it as a function. That
way if your source tried to actually look at the result of an '='
assignment a syntax error would occur (like the distinction between
echo and print). The only side effect would be that you would be unable
to chain assignments like this:
a = b = c = d = 0;
But an alternate method could be added to the language such as:
(a, b, c, d) = 0;
Which I think is actually used by LISP if I recall correctly.
But of course I'm just dreaming/thinking out loud here. :o)
-Robert
Navigation:
[Reply to this message]
|