getAttr method

downs default_357-line at yahoo.de
Fri Feb 1 23:07:14 PST 2008


Jarrett Billingsley wrote:
> "downs" <default_357-line at yahoo.de> wrote in message 
> news:fo0i97$1cla$1 at digitalmars.com...
> 
>> auto generator = stackthread = (void delegate(int) yield) ...
> 
> In this code, I'm mostly concerned with your (ab)use of the property syntax 
> to call functions which aren't properties.  This looks like assignment, but 
> sure as heck doesn't have the semantics thereof.
> 
> You do realize that writing obtuse, unreadable code is not something to be 
> proud of? 
> 
> 

Actually, joke's on you - that actually is opAssign. Static opAssign. stackthread is a struct. :p

You're right about the semantics though. The problem is that I don't want to use a function call, because it requires you to place a closing paren far, far away at the other end of the delegate literal, and it is my firm conviction that }); looks butt ugly and should die.
So, if you can recommend a better operator than opAssign, one with better semantics, I'm all ears. :)

 --downs



More information about the Digitalmars-d mailing list