DMD 0.177 release

Benji Smith dlanguage at benjismith.net
Wed Dec 20 12:19:47 PST 2006


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



More information about the Digitalmars-d-announce mailing list