small idea

F i L witte2008 at gmail.com
Wed Jan 9 07:45:26 PST 2013


Yes this has been requested a few times.

I just want to point out that while I like the idea (seeing how 
well it works in C#), I also think it should be optionally how it 
is now. There are times when you want to pass and object as ref 
for optimization only, and aren't actually modifying the value 
(like Matrix Multiplication for example). In these cases, the way 
D works right now is nice, because it hides that detail from the 
end user.

Still, I think 'ref'/'out' should be require at call-site by 
default, to avoid any gotchas.

I also don't see any problem with UFCS really. I mean, using that 
syntax is pseudo-OOP and implies the first parameter might be 
modified in the function.



More information about the Digitalmars-d mailing list