[nem-en] out / ref

Ivan A Eryshov ivan.eryshov at gmail.com
Wed Sep 27 05:12:22 CEST 2006


Hello Igor,

>> I don't like Foo(out _) and Foo(ref _), that will confuse developers
absolutely.
>I don't think so. Foo(out _)/Foo(ref _) with explicit out/ref is more than
clear.

Yes, this will make using of Foo(out ...)/Foo(ref ...) more clear, but in
this way Foo(_) should mean something the same. But in fact Foo(_) is
absolutely different thing. I would prefer that Foo(out _)/Foo(ref _) will
have the same behaviour, i.e. (x => Foo(out x))/(x => Foo(ref x)).

>> Also how Foo(ref _) should works in such code:
>>
>> Foo(ref t : A)
>> {
>> t.Method();
>> }
>
>How it should work in such case?
>
>def a : A = null;
>Foo(ref a);
>?

In the most of situations I use 'ref' when I expect in 'Foo' more rational
value then a simple 'null'.
Yes your code is mistaken, but this is predictable error. When you will use
Foo(ref _) you will make a potential error.

==
Best regards,
  Ivan A Eryshov

-= RSDN forever! :) =-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /mailman/pipermail/devel-en/attachments/20060927/ddb1105c/attachment.html


More information about the devel-en mailing list