> Hi Brad,
>
> (3) is a very good point. While I don't see (1) and (2) as a major
> objection, they do point out that for "undefined" to be useful in the
> common case, an undefined variable should be assignable.  This essentially
> means that a variable may have two values (it's actual value and
> "undefined") which is absurd so I'll concede.
>
> As it stands, if you want to be able to omit an argument to a function then
> it needs to be given a default value.  This does not help much with my
> motivating example (error propagation) because the error state must be
> passed by reference, and so the default variable must be an lvalue.

Rather than changing the language, how about simply doing:

        proc foo(ref err = new errorstate());

This gives you the l-value you want, in a task-safe manner, and also 
addresses the issue of requiring a type to be specified?

-Brad

------------------------------------------------------------------------------
Sponsored by Intel(R) XDK 
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers

Reply via email to