Should out/ref parameters require the caller to specify out/ref like in C#?

WebFreak001 via Digitalmars-d digitalmars-d at puremagic.com
Mon May 29 08:31:26 PDT 2017


On Monday, 29 May 2017 at 07:39:40 UTC, Dukc wrote:
> I think it's mostly about good taste on what you define 
> functions to take as ref input. I have a feeling the present 
> way is not a big problem in practice because it is intuitive 
> somehow. Besides, member functions mutate their class/struct 
> anyway, and we don't want to lose our ability to call extension 
> funcions with same syntax as member ones.

well for the extension functions I wrote that if the ref 
parameter is the first argument and it's called with ufcs syntax, 
it could implicitly add the ref probably. I don't think there are 
any big issues with that, it does look like a member function and 
the programmer could easily read it as "this modifies it"


More information about the Digitalmars-d mailing list