September 27, 2006
Ivan Senji escribió:
> Carlos Santander wrote:
>>
>> What Karen is saying is that your examples should be:
> 
> Ooops, of course they should be without that ".", but are you sure that is what Karen is talking about? Hmm, have to reread...

I suppose. It's the only thing that makes sense (even if it's not the actual point of this conversation).

-- 
Carlos Santander Bernal
September 27, 2006
Ivan Senji wrote:

> No disaster.

Yes because in this case there are no global structures that can capture such an assignment.

But are the opinions of posters, who make jokes on the readability of other coders work, worth considering, if those posters are unable to read their own examples properly?

September 28, 2006
On Wed, 27 Sep 2006 19:05:24 +0200, Ivan Senji wrote:



>> 
>>> What point?
>> 
>> Ever heard of the module scope operator
> 
> I get it now.
> 
>> or the D-style to separate an operator by one space from its operands?
> 
> And now I don't get what this means.
> 
> But I found out where the story about a "." comes from, Derek accidently left if in his example, and if he or anyone else tried to compile it he would get an error from the compiler about something not being a part of global scope. No disaster.

True, no disaster. However I didn't leave the 'dot' in accidentally. I just made up the syntax on the fly because I forgot that D already has a 'with' construct. 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. Sure its fine for the compiler because it can work out which identifiers are effected but for mere humans reading the code it becomes bloody near impossible without lots of effort.

Given ...
  with(Foo)
  {
       a = b;
       c = d;
       e = f;
  }

who'd know that it actually represented ...

       Foo.a = b;
       c = Foo.d;
       Foo.e = Foo.f;

That's why I wrote it as

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

So okay, maybe I should have used a different symbol to represent the 'with' expression, but that doesn't, or shouldn't distract, from the concept that my example was trying to express ... that we can write simpler code that is still readable given the appropriate syntax support.

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Down with mediocrity!"
28/09/2006 11:46:46 AM
September 28, 2006
On Wed, 27 Sep 2006 21:51:49 +0000 (UTC), Karen Lanrap wrote:

> Ivan Senji wrote:
> 
>> No disaster.
> 
> Yes because in this case there are no global structures that can capture such an assignment.
> 
> But are the opinions of posters, who make jokes on the readability of other coders work, worth considering, if those posters are unable to read their own examples properly?

I don't like getting personal, Karen, but you are starting to appear to me to be a 'mean-spirited' person.

I assume the "posters, who make jokes" is referring to myself. If not, I apologize in advance.

I was not making jokes. I was not trying to be mean. I was not trying to criticize you or in any other way give offense.

I was trying to understand your point of view and possibly express an alternative. In other words, I was trying to have a polite conversation. I'm sorry that I failed to appear to be doing that.

My understanding of your original premise is that you feel that opCall() should be able to be used as an overloadable assignment method, which could then be used to simplify writing code while at the same time not losing the potential for complex processing.

While I appreciate the need for such a method, I feel that opCall() is not the best one to use, and that a better 'property' facility would help the D language much more.


-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"Down with mediocrity!"
28/09/2006 11:58:11 AM
September 28, 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;
  }
1 2 3 4 5 6
Next ›   Last »