Why are opCall's not implicitely assignable?

Ivan Senji ivan.senji_REMOVE_ at _THIS__gmail.com
Wed Sep 27 22:33:38 PDT 2006


Derek Parnell wrote:
> True, no disaster. However I didn't leave the 'dot' in accidentally. 

Ok, sorry for my wrong assumption.

> I just
> made up the syntax on the fly because I forgot that D already has a 'with'
> construct. 

Yeah, it doesn't seem that it is used that much, I used it maybe only 
15-20 times in real programs (not counting test examples).

> I used the 'dot' to show people reading the code which
> identifiers are effected by the 'with' expression. IMHO, it is a mistake in
> the current D syntax to not avoid showing this. 

I agree with this, your example below shows perfectly what the problem 
is. The 'dot' is not the best solution because it means global scope.

This made me think about the discussions about $ vs. length where one of 
the suggestions was to turn that into "$.length" where $ would mean "the 
thing that is shortened".
This could apply nicely to with too:

   with(foo)
   {
     $.a = b;
     c = $.d;
     $.e = $.f;
   }



More information about the Digitalmars-d-learn mailing list