Re: Pass by Reference
- Posted by Spock Jan 08, 2015
- 2461 views
jaygade said...
To be clear, Euphoria DOES pass by reference but it copies on write. So there is a performance advantage there.
As for manipulating large data structs, in Euphoria you currently have to implement them as file-level or global variables for efficiency.
One thought that I've had for implementing a new language is that functions should be pass by reference/copy on write, but procedures should be pass by reference/modify in place.
Question:
For every write (eg, x[i] = n) does the internal routine check to see if "x" has a refcount [and if it has make a fresh copy] before setting the data?
Spock