Is DMD 0.166 RC 1.0?

Ivan Senji ivan.senji_REMOVE_ at _THIS__gmail.com
Mon Sep 4 23:00:52 PDT 2006


Walter Bright wrote:
> 
> I'd ask "why is f(x) returning a value in x?" That would normally be an 
> essential part of the behavior of the function, so:
>     f(3)
> should return an error, shouldn't it? 

Sure.

> If modifying its argument is an 
> essential behavior of the function, and the argument is not modifiable, 
> probably the programmer made a mistake and the compiler should not paper 
> it over. 

Sure, but properties can be modifiable.

> And the same for every other argument that isn't an lvalue (and 
> so cannot be set).
> 
> If you find yourself writing:
> 
>    auto x=a.prop; f(x); a.prop=x;
> 
> I would seriously question what is going on with f(). It's a big flag 
> that something is wrong either with f() or with the usage of f(). I 
> would not want the compiler papering it over.

I don't really understand why this should be a flag that something is 
wrong with f. There are probably good reasons why f isn't a member 
function, it is a generic algorithm.



More information about the Digitalmars-d-announce mailing list