DMD 0.177 release

Bruno Medeiros brunodomedeiros+spam at com.gmail
Sun Dec 24 02:41:33 PST 2006


Benji Smith wrote:
> Andrei Alexandrescu (See Website For Email) wrote:
>> Let me illustrate further why ident is important and what solution we 
>> should have for it. Consider C's response to ident:
>>
>> #define IDENT(e) (e)
>>
>  > ...
>  >
>> ...leading to the following implementation of ident:
>>
>> auto ident(auto x) {
>>   return x;
>> }
> 
> I don't get it.
> 
> Why is it necessary (or even desirable) for functions to return lvalues?
> 
> I can see how it'd be an interesting trick, and I can appreciate the 
> experimental curiosity about how the language (and the implementation) 
> should cope with the explicit handling of lvalues.
> 
> But I can't think of a real-world use case.
> 
> Are there languages where this is currently possible? How do they 
> implement it? And, much more importantly, what do people use it for?
> 
> --benji

There have been numerous cases here in the NG of people griping with 
this problem when using property-methods, or operator overloads such as 
opIndex, which both cannot return lvalues and thus have usage limitations.

-- 
Bruno Medeiros - MSc in CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d-announce mailing list