Re: = vs := and = vs ==

new topic     » goto parent     » topic index » view thread      » older message » newer message
_tom said...

What would it take to allow := in an assignment statement? (Phix by Lomax already does this.)

I do not think this is necessary. I don't think many people get confused by assignment vs comparison.

_tom said...

What would it take to allow = to compare atoms and == to compare objects?

What is confusing, however, is why = cannot compare objects while equal() can. (Can't = just be shorthand for equal()?) IIRC, allowing = to compare objects in if/while statements is relatively trivial. I believe it's a simple matter of changing the op (opEQUAL?) routine in the interpreter. At least, this was true in Euphoria 2.x and 3.x. I haven't spent much time in the Euphoria 4.x source code, but I would welcome this change.

-Greg

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu