Re: Pass by Reference
- Posted by dcuny Jan 15, 2015
- 2010 views
I'd only been considering the case
<MULTIPLE_ASSIGNMENT> = FUNCTION()
If FUNCTION() doesn't return multiple values, the compiler knows it's an error.
Of course, there's a nasty exception to this:
<MULTIPLE_ASSIGNMENT> = call_func()
This obviously can't be caught at compile time, so would need some sort of runtime check to make sure things are balanced.
Anything of the more general form:
<MULTIPLE_ASSIGNMENT> = <EXPRESSION>
is illegal at compile time, because there's no <EXPRESSION> that can return multiple values (yet).
Am I misunderstanding something here?
- David