Re: questions, questions; always questions :)
Hawke wrote:
>*ponder*... how to explain this... hrmmmmmm
>
>take Carl's code to do abs for example:
> return x * (x>0) - (x<0)
>
>it's the part where (x>0) is actually looking at the
>==whole== sequence. but you cannot do that here:
> if (x>0) then blah end if
>because at that point, x must be an atom or the resultant
>expression must be an atom to be more precise...
>so why can you make a comparison that involves an entire
>sequence or an operation that involves an entire
>sequence in a return line but cannot do the same thing
>in a ==real== comparison statement???
Hawke, the same or a very similar question already surfaced several
times on this list, and I am still not sure what you want. The problem
is not in the comparison itself, it is probably even happily performed
(unless the compiler is more intelligent than I think it is), but the
simpleton conditional does not know which way to jump when faced with
a sequence. What is your advice it should do? - I hope this is not
just another attempt to smuggle a case statement into Euphoria through
the back door
.
My dislike of the compare() function is purely superficial: a
comparison test should logically return TRUE when the objects are the
same ('comparable') and FALSE when they are not. I suspect the actual
function's real name is IsNotSame(), and the unexpected bonus of the
doubled truth (-1 and 1) is a legacy from another language from a very
forgettable era. jiri
|
Not Categorized, Please Help
|
|