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 | 5499 reads
|
Browse archives
Active forum topics
|
Recent comments
9 weeks 5 days ago
14 weeks 8 hours ago
15 weeks 4 days ago
15 weeks 4 days ago
18 weeks 2 days ago
22 weeks 6 days ago
22 weeks 6 days ago
23 weeks 2 days ago
23 weeks 2 days ago
26 weeks 1 day ago