Re: RFC: Breaking existing Euphoria functionality
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Feb 25, 2007
- 557 views
Alexander Toresson wrote: > Basically, if the result of a comparison between two objects or sequences > would need to be an atom or integer, make the operation return an integer > instead. NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!!!! > Thus all of the following snippets would work: <snip> > }}} <eucode> > if (a = b) and (c = d) then > </eucode> {{{ But I just gave this example:
if (a=b) = (c=d) then
You are stuffed. STUFFED. UP S**T CREEK WITHOUT A PADDLE. You ask to make the middle "=" behave different to the outers. What you said was the "middle" "=" must yield atom, but it is clear that neither the "(a=b)" nor the "(c=d)" need to. Horrid. And ambiguous. Give it up. Make "=" ALWAYS return an atom, and add "sq_eq()" for the rare cases, or don't even try. KISS. Let me be very clear on this: I really WANT "a=b" to ALWAYS return an atom. I think that would be an excellent improvement to the language. Making "a=b" SOMETIMES return a sequence, for the same a and b, is utter madness, when "sq_eq(a,b)" is a much better way forward, for the rare cases that need it. YOU CANNOT DO THIS HALF-HEARTEDLY. Regards, Pete PS Andy Serpa seems to say replace the operator inside if statements, which imao is clearly wrong. PPS Naturally no real care/claim for "sq_eq" over "eq", "EQ" or whatever.