[nem-en] out / ref

Ivan A Eryshov ivan.eryshov at gmail.com
Wed Sep 27 16:55:49 CEST 2006


> On Behalf Of Igor Tkachev
>
> > 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.
> 
> Wait a second! What about:
> 
> Foo(_ : int) : void
> {
>   _ = "".Length;
> 
>   match(some_list)
>   {
>     | [1, _]      => ()
>     | h :: _ :: t => ()
>     | _           => ()
>   }
> }
> 
> All of this is different syntax. And BTW meaning of this is much
> closer to Foo(out _) than to Foo(_). 

That is why I wrote in exactly such sequence: Foo(?) and Foo(out _).

> Actually, that's the reason why I
> thought this syntax will be quite natural and very logical for
> Nemerle.

I agree, that Foo(_) uses '_' which means much differ that in all other
situations. But the same syntax for Foo(_) and Foo(out _) expressions is a
bad idea.
I just thought, if Foo(_) will be replaced by Foo(?) or something else, we
can give to Foo(_) meaning the similar to Foo(out _). Compiler should
replace '_' to null for reference types and to default value for value
types.  




More information about the devel-en mailing list