Re: Pass by Reference
- Posted by petelomax Jan 15, 2015
- 1992 views
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:
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