out/inout/lazy at call site

renoX renosky at free.fr
Sat Jan 6 08:03:06 PST 2007


As often, it is a matter of 'easy to write' vs 'easy to read'.

Myself, I wonder why we don't use more often function call like this: 
f(x=1,y=2) instead of f(1,2): this would reduce the number of mistakes 
in the assignment of values to parameters..

For the lazy function call, I think that instead of using f(lazy x++), 
it is better to use {} instead: f({x++}).

After all, this is what happens when you call a function with a lazy 
parameter: in fact you're passing a chunk of code.

Regards,
renoX



More information about the Digitalmars-d mailing list