Re: Maybe not so stupid a question?
- Posted by Matt Lewis <matthewwalkerlewis at gmail.com> May 21, 2007
- 501 views
CChris wrote: > > Euphoria is a pass by value language and has no pointer to allevuate the > problem. > > Hence, when you pass <dog> as an argument, only the value is passed, possibly > as a pointer. But the target routine has no way to know where the value comes > from. And variable names don't make it to the backend part of the interpreter > anyway. > > Since Matt's OOEu implements pass by reference, you should be able to code > something like: > > procedure test(byref object x) > print(1,var_name(x)) > end procedure > > test(dog) would then print "dog". If you pass an expression, I'd expect "" > to be printed, or "_temp#01A" perhaps. But that is OOEu, not plain Euphoria. Actually, to do this, you'd need to use the var_id() family of routines in ooeu. There's a different pass by reference functionality that does just that, but doesn't allow additional access to any metadata. Matt