Re: Pass by Reference
- Posted by jacques_desch Sep 12, 2009
- 2253 views
Things like var_id(), and other reflection like techniques are more likely to surface when we get into dynamically evaluated code. It might be a reasonable workaround for a more native implementation of PBR.
var_id() has a potential problem that routine_id does not have: What if I take a reference to a variable that is allocated on the call stack? The variable disappears after the call, but how is the reference invalidated? Other pass by reference syntaxes do not necessarily have this issue.
True. That's another area that has to be thought out before it could happen, and just for reasons like that.
Matt
Can a variable be on the stack if it is not a procedure argument or local variable? If not so I don't see how this can be a problem. At parse time we know that a variable is on stack and so can forbid reference to it. Please show me an exemple where it's not true.
Jacques