Re: Pass by Reference

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

In Phix, you get a fatal error if there aren't enough values, whereas OpenEuphoria just quietly leaves some values as-is, and on both, no messages if there are too many.

Not true (about openeuphoria) unless I'm misunderstanding you:

Ah, I based that comment on:

DerekParnell said...

Firstly, it is not intrinsically (sorry - that word again) an error or mistake to ignore some returned function values. It is also not necessarily a mistake to present more variables for assignment than are needed. The parser cannot guess the intention of the code writer.

Euphoria's implementation does this ...

  • When given more right-hand-side (RHS) values than there are LHS variables, the extra values are silently ignored.
  • When given more LHS variables than there are RHS values, the extra variables are silently ignored.
  • It allows omitted variables in the LHS set, which permits the coder to ignore selected returned values.

This implementation gives capabilities and responsibility to the coder. We are on our way to avoid treating coders as children, in need of protection from themselves.

Pete

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

Search



Quick Links

User menu

Not signed in.

Misc Menu