Re: RFC: Breaking existing Euphoria functionality
Pete Lomax wrote:
>
> 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:
> }}}
<eucode>
> if (a=b) = (c=d) then
> </eucode>
{{{
>
> 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.
Haha, I'm sorry, I'm sorry. I agree wholeheartedly with you and I take back
everything I said in that post. I was just very tired at the time and my brain
was messed up by 23 hours of travelling by train. It seemed a good idea at that
time.... but well, of course it isn't.
Regards, Alexander Toresson
PS Of course, comparison operators do always return atoms in Orac.
|
Not Categorized, Please Help
|
|