www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: dst = src rather than src dst

reply "Janice Caron" <caron serenityfirefly.com> writes:
-----Original Message-----
From: digitalmars-d-bounces puremagic.com 
[mailto:digitalmars-d-bounces puremagic.com] On Behalf Of Kirk McDonald
Sent: 06 September 2007 09:14
To: digitalmars-d puremagic.com
Subject: Re: dst = src rather than src dst

 I just don't particularly like it very much. This is primarily because
 it's merely a syntax change.

D is an evolving language. It's had lots of syntax changes in the past.
 If the old syntax is retained, we have redundant syntaxes, which is annoying 
 and not a good thing.

Hmmm.... char[] x; char x[]; Double Hmmm.... void f(static int x) {...} void f(int x)() {...} template f(int x) { void f() {...} } Hmmm again... find(s,'\n'); s.find('\n');
 Before removing the current syntax, we have to of course consider
 the existing body of code which would have to be changed.

No one is suggesting making the old syntax illegal.
 Remember when implicit .ptr conversion was removed?

No one is suggesting making the old syntax illegal.
 Removing the existing syntax is Not An Option

No one is suggesting making the old syntax illegal.
Sep 06 2007
parent Kirk McDonald <kirklin.mcdonald gmail.com> writes:
Janice Caron wrote:
 -----Original Message-----
 From: digitalmars-d-bounces puremagic.com 
 [mailto:digitalmars-d-bounces puremagic.com] On Behalf Of Kirk McDonald
 Sent: 06 September 2007 09:14
 To: digitalmars-d puremagic.com
 Subject: Re: dst = src rather than src dst
 
 I just don't particularly like it very much. This is primarily because
 it's merely a syntax change.

D is an evolving language. It's had lots of syntax changes in the past.
 If the old syntax is retained, we have redundant syntaxes, which is 
 annoying and not a good thing.

Hmmm.... char[] x; char x[];

This is precisely the sort of thing I'm talking about. I'd list this as a case where the increased clarity of the new syntax is absolutely worth it, but these redundant syntaxes are still annoying and I don't like the fact we have to have 'em.
 Double Hmmm....
 
 void f(static int x) {...}
 void f(int x)() {...}
 template f(int x) { void f() {...} }
 

The second and third forms you have here aren't so much redundant syntax as the full syntax and the shorthand syntactic sugar for same. The first syntax is different, in that you call it differently: f(1); // vs f!(2);
 Hmmm again...
 
 find(s,'\n');
 s.find('\n');
 

This I'll grant you. However, when this gets working for all types, it will be less a syntactic redundancy and more of an orginizational nicety. (You'll be able to split some methods out of a class, and perhaps into a seperate module, or even extend an existing class with your own "methods.") I've already spent more time in this thread than I intended to. Despise this, /I don't care that much/ about whether this syntax is added. If it were put to a vote, I would abstain. I'm merely pointing out that adding new syntax which does not actually do anything new should on principle be avoided. -- Kirk McDonald http://kirkmcdonald.blogspot.com Pyd: Connecting D and Python http://pyd.dsource.org
Sep 06 2007