User loginNavigation |
Call-by-reference decided by callerI wonder if it makes any sense if the caller of a function decides weither a parameter is passed by reference or value. Often when I look at code (C++ mostly) I ask myself "Is this one changed by the function?" and I have to look up the function declaration. Does anyone know of a language implementing such abstraction? Edit: I just realized, that the caller can control how an argument is passed by either making a deep copy before passing it (call-by-value) or not (call-by-ref). Only thing is, the function needs to define this argument as ref. Also this does not work well together with manual memory management, because if you create deep copies of stuff on the fly they do not get cleaned up afterwards, because the function receiving the arg does not know it has been copied before. By tkirchner at 2013-03-27 22:18 | LtU Forum | previous forum topic | next forum topic | other blogs | 5707 reads
|
Browse archives
Active forum topics |
Recent comments
1 week 6 days ago
42 weeks 1 day ago
42 weeks 1 day ago
42 weeks 1 day ago
1 year 12 weeks ago
1 year 16 weeks ago
1 year 18 weeks ago
1 year 18 weeks ago
1 year 20 weeks ago
1 year 25 weeks ago