`in` parameters made useful

Araq rumpf_a at web.de
Thu Aug 20 20:29:31 UTC 2020


On Thursday, 20 August 2020 at 17:31:17 UTC, IGotD- wrote:
> This is interesting on a general level as well and true for 
> several programming languages. Let the compiler optimize the 
> parameter passing unless the programmer explicitly ask for a 
> certain way (copy object, pointer/reference etc.). This is very 
> unusual and if you have a language that optimizes the parameter 
> passing by default, please mention it because it would be 
> interesting.
>

Nim does this and I took the feature from Ada. You can override 
the behavior with pragmas but I've only seen that done for C 
interop, not for optimizations as the compiler always seems to 
get it right.


More information about the Digitalmars-d mailing list