Re: Pass by Reference
- Posted by jimcbrown (admin) Jan 04, 2015
- 2918 views
dcuny said...
None of these ways seem particular "very easily" done, especially in comparison with other languages. Rather, the solutions seem rather clunky to me.
Not sure I agree with you here. The difference between
ref a = b
and
ram_space[a] = b
is largely just syntax sugar. A good preprocessor can convert the former to the latter, in fact my preprocessor (Dredge) did something just like this. Considering v4's builtin support for hooking into preprocessors, this sort of syntax sugar should be very easy to add to the main language itself - if only someone could find the time to write one....