why are Assign Expressions r-values?

BCS ao at pathlink.com
Sat Apr 28 14:23:56 PDT 2007


Reply to Manfred,

> BCS wrote
> 
>> In that case there is no named symbol to use for the outer call.
>> 
> Why is there a riquirement for names?
> 
> -manfred
> 

Their isn't really, It just seemed to be a good way to separate them from 
temporaries. The real distinction is that it is something that will persist 
(and be accessible) after the expression/function call. That also brings 
up a point that has been floated a time or two before. What would be a good 
way to call a function with an out arg and say "stuff something here and 
discard it when your done", the same goes for inout but with the added "give 
it an initial value of ---"


void fo(out int i, inout int j);


fo(void, 1);  // call fo with a temporary variable for i and a temp initialized 
to 1 for i.




More information about the Digitalmars-d-learn mailing list