Lazy eval

Derek Parnell derek at psyc.ward
Mon Aug 21 15:09:42 PDT 2006


On Mon, 21 Aug 2006 14:18:04 -0700, Walter Bright wrote:

> Frank Benoit wrote:
>> I think the lazy eval is a great feature, but in this form it has also
>> great drawbacks.
>> 
>> The code isn't that much readable as it was before. You don't know what
>> will happen. Will that expression be evaluated or not? Or will it be
>> evaluated more than once?
> 
> It's true there is no clue from the user's side which it is. But there 
> also isn't a clue whether the arguments are in, out, or inout. There 
> also is no syntactic clue what the function *does*. One must look at the 
> function interface and documentation to use it successfully anyway.
> 
> It's going to take some caution to use this capability in a productive way.
> 
>> There is no possibility to choose between
>> 
>> func( char[] a ) vs. func( char[] delegate() dg )

Would it possible to use ...

   func ( cast(char[]) "abc" );

to force the compiler to chose 'func( char[] a)' instead of the delgated
version?


-- 
Derek Parnell
Melbourne, Australia
"Down with mediocrity!"



More information about the Digitalmars-d mailing list