Re: Pass by Reference
- Posted by petelomax Jan 05, 2015
- 2810 views
dcuny said...
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.
It would probably not be difficult to collect min/max/unknown lengths of returned sequences, so as long as you don't build return values using append() etc, it should be just as easy to check (at parse time).
dcuny said...
you can't see how many values a function is returning.
You can do this:
function foo() return {1, 2, 3} end function sequence check = foo() if length(check)>=4 then {a, b, c, d} = check end if
Pete