Re: Pass by Reference
- Posted by dcuny Jan 05, 2015
- 2761 views
By the way, I cannot see any argument based on "we should do it like XXX does it" has a lot of intrinsic merit. Needless to say, Euphoria's syntax should consistently be using the look & feel of Euphoria - I know that this is almost a nothing statement, but the Euphoria style is hard to define though easy to see.
The statement has value, but I usually start with the opposite question: why should I force other people to learn a new syntax? It's not that should never happen, but all things being equal, there should be a good reason for doing so.
I apologize for being "late to the party" on this, but consider the two options:
function foo() return 1, 2, 3, 4 end function a, b, c = foo()
vs.
function foo() return {1, 2, 3} end function {a, b, c, d} = foo()
Obviously, the first can be verified as incorrect by the parser.
The second can only be determined to be wrong at runtime, and will result in a crash.
Unlike indexes, there's no way to check for this error - you can't see how many values a function is returning. So the use of this syntax is intrinsically unsafe, and there's no way that I see to make it safe.
Am I missing something here?
- David