[nem-en] out / ref
Ivan A Eryshov
ivan.eryshov at gmail.com
Wed Sep 27 07:42:49 CEST 2006
On 27/09/06, Igor Tkachev <it at rsdn.ru> wrote:
> > Yes, this will make using of Foo(out ...)/Foo(ref ...) more
> > clear, but in this way Foo(_) should mean something the same. But in
> > factFoo(_) is absolutely different thing. I would
> > preferthatFoo(out _)/Foo(ref _) will have the same behaviour, i.e.
> > (x => Foo(out x))/(x => Foo(ref x)).
>
> Good point. Fortunately, compiler does not support ref/out partial
> substitution. But finally, by this example, you made me 100% sure that
> the explicit ref/out is the right way. Thank you.
Not at all ;)
> > Yes your code is mistaken, but this is predictable error. When
> > you will use Foo(ref _) you willmake apotential error.
>
> However we still have to deal with some third party stuff like the
following:
>
> VsShell.OpenDocument(Site, loc.File, NativeMethods.LOGVIEWID_Code, out _,
out _, out _, out textView);
>
> A little bit shorter and more readable, isn't it? And what is even
> more important, it does not have any garbage local variables. So I do
> not have to waste my time to check if they are used somewhere or not.
Yes, this is more clearly, but I insist that using same syntax for
absolutely different things - Foo(_) and Foo(out _).
I'll like this idea if these different things will have different syntax.
For example Foo(?) and Foo(out _) and vice versa.
--
Best Regards,
Ivan A Eryshov.
-= RSDN forever! =-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /mailman/pipermail/devel-en/attachments/20060927/eeeaa911/attachment.html
More information about the devel-en
mailing list