typedef: what's it good for?

2009-11-10 Thread Walter Bright
When I originally worked out ideas for D, there were many requests from the C and C++ community for a 'strong' typedef, and so I put one in D. I didn't think about it too much, just assumed that it was a good idea. Now I'm not so sure. Maybe it should be removed for D2. Does anyone use typedef

Re: typedef: what's it good for?

2009-11-10 Thread BCS
Hello Walter, When I originally worked out ideas for D, there were many requests from the C and C++ community for a 'strong' typedef, and so I put one in D. I didn't think about it too much, just assumed that it was a good idea. Now I'm not so sure. Maybe it should be removed for D2. Does anyo

Re: typedef: what's it good for?

2009-11-10 Thread Justin Johansson
Walter Bright Wrote: > When I originally worked out ideas for D, there were many requests from > the C and C++ community for a 'strong' typedef, and so I put one in D. I > didn't think about it too much, just assumed that it was a good idea. > > Now I'm not so sure. Maybe it should be removed f

Re: typedef: what's it good for?

2009-11-11 Thread rmcguire
Justin Johansson wrote: > Walter Bright Wrote: > >> When I originally worked out ideas for D, there were many requests from >> the C and C++ community for a 'strong' typedef, and so I put one in D. I >> didn't think about it too much, just assumed that it was a good idea. >> >> Now I'm not s

Re: typedef: what's it good for?

2009-11-11 Thread Justin Johansson
rmcguire Wrote: > Justin Johansson wrote: > > > Walter Bright Wrote: > > > >> When I originally worked out ideas for D, there were many requests from > >> the C and C++ community for a 'strong' typedef, and so I put one in D. I > >> didn't think about it too much, just assumed that it was a

Re: typedef: what's it good for?

2009-11-11 Thread Pelle MÃ¥nsson
Walter Bright wrote: When I originally worked out ideas for D, there were many requests from the C and C++ community for a 'strong' typedef, and so I put one in D. I didn't think about it too much, just assumed that it was a good idea. Now I'm not so sure. Maybe it should be removed for D2. D

Re: typedef: what's it good for?

2009-11-11 Thread Simen Kjaeraas
On Wed, 11 Nov 2009 07:45:26 +0100, BCS wrote: Hello Walter, When I originally worked out ideas for D, there were many requests from the C and C++ community for a 'strong' typedef, and so I put one in D. I didn't think about it too much, just assumed that it was a good idea. Now I'm not so s

Re: typedef: what's it good for?

2009-11-11 Thread Andrei Alexandrescu
rmcguire wrote: Justin Johansson wrote: Walter Bright Wrote: When I originally worked out ideas for D, there were many requests from the C and C++ community for a 'strong' typedef, and so I put one in D. I didn't think about it too much, just assumed that it was a good idea. Now I'm not

Re: typedef: what's it good for?

2009-11-11 Thread Andrei Alexandrescu
Walter Bright wrote: When I originally worked out ideas for D, there were many requests from the C and C++ community for a 'strong' typedef, and so I put one in D. I didn't think about it too much, just assumed that it was a good idea. Now I'm not so sure. Maybe it should be removed for D2. D

Re: typedef: what's it good for?

2009-11-11 Thread grauzone
Walter Bright wrote: When I originally worked out ideas for D, there were many requests from the C and C++ community for a 'strong' typedef, and so I put one in D. I didn't think about it too much, just assumed that it was a good idea. Now I'm not so sure. Maybe it should be removed for D2. D

Re: typedef: what's it good for?

2009-11-11 Thread Bill Baxter
On Wed, Nov 11, 2009 at 8:54 AM, Andrei Alexandrescu wrote: > Walter's and my interim conclusion last night was that fixing typedef would > be difficult, and that the usefulness of typedef is too little for its > complexity. It may be a good idea to just remove it from the language. We > already

Re: typedef: what's it good for?

2009-11-11 Thread Bill Baxter
On Wed, Nov 11, 2009 at 9:04 AM, grauzone wrote: > Walter Bright wrote: >> >> When I originally worked out ideas for D, there were many requests from >> the C and C++ community for a 'strong' typedef, and so I put one in D. I >> didn't think about it too much, just assumed that it was a good idea.

Re: typedef: what's it good for?

2009-11-11 Thread Adam D. Ruppe
On Wed, Nov 11, 2009 at 10:54:27AM -0600, Andrei Alexandrescu wrote: > The last point was revealed by a conversation between Walter and me last > night. I pointed out that typedef should create a *subtype* of a type, e.g.: I was thinking about this a while ago and had a half baked proposal, but d

Re: typedef: what's it good for?

2009-11-11 Thread grauzone
Bill Baxter wrote: On Wed, Nov 11, 2009 at 9:04 AM, grauzone wrote: Walter Bright wrote: When I originally worked out ideas for D, there were many requests from the C and C++ community for a 'strong' typedef, and so I put one in D. I didn't think about it too much, just assumed that it was a g

Re: typedef: what's it good for?

2009-11-11 Thread Matti Niemenmaa
Andrei Alexandrescu wrote: * typedef is hopelessly broken in very many ways * nobody noticed (i.e. no bugzilla reports), so probably nobody uses it No Bugzilla reports? Here're just a few: http://d.puremagic.com/issues/show_bug.cgi?id=632 http://d.puremagic.com/issues/show_bug.cgi?id=1335 htt

Re: typedef: what's it good for?

2009-11-11 Thread dsimcha
== Quote from grauzone (n...@example.net)'s article > Walter Bright wrote: > > When I originally worked out ideas for D, there were many requests from > > the C and C++ community for a 'strong' typedef, and so I put one in D. I > > didn't think about it too much, just assumed that it was a good ide

Re: typedef: what's it good for?

2009-11-11 Thread BCS
Hello Simen, [...] suggest that typedef int foo; be kept as it is, and typedef int bar { /* stuffs */ } be sugar for struct bar { int _payload; alias _payload this; /* stuffs */ } One important aspect of what I proposed is that operators that aren't overridden still exist and use the same

Re: typedef: what's it good for?

2009-11-11 Thread Andrei Alexandrescu
Matti Niemenmaa wrote: Andrei Alexandrescu wrote: * typedef is hopelessly broken in very many ways * nobody noticed (i.e. no bugzilla reports), so probably nobody uses it No Bugzilla reports? Here're just a few: http://d.puremagic.com/issues/show_bug.cgi?id=632 http://d.puremagic.com/issues/

Re: typedef: what's it good for?

2009-11-11 Thread bearophile
Andrei Alexandrescu: > Walter's and my interim conclusion last night was that fixing typedef > would be difficult, and that the usefulness of typedef is too little for > its complexity. It may be a good idea to just remove it from the > language. An usage of typedef: alias int[5][20] TyMat; ty

Re: typedef: what's it good for?

2009-11-11 Thread Andrei Alexandrescu
bearophile wrote: Andrei Alexandrescu: Walter's and my interim conclusion last night was that fixing typedef would be difficult, and that the usefulness of typedef is too little for its complexity. It may be a good idea to just remove it from the language. An usage of typedef: alias int[5][

Re: typedef: what's it good for?

2009-11-11 Thread Walter Bright
bearophile wrote: If typedef gets removed from D, will the "typedef" keyword removed from the D language? Eventually, yes, though there will be much time when it exists as a "deprecated" feature.

Re: typedef: what's it good for?

2009-11-11 Thread Simen Kjaeraas
BCS wrote: Hello Simen, [...] suggest that typedef int foo; be kept as it is, and typedef int bar { /* stuffs */ } be sugar for struct bar { int _payload; alias _payload this; /* stuffs */ } One important aspect of what I proposed is that operators that aren't overridden still exist a

Re: typedef: what's it good for?

2009-11-11 Thread BCS
Hello Simen, BCS wrote: One important aspect of what I proposed is that operators that aren't overridden still exist and use the same codegen as the base type (or are guarantied to generate the same machine code in all cases). struct foo { float f; alias f this; } void main( ) { foo f; f =

Re: typedef: what's it good for?

2009-11-11 Thread Chad J
Walter Bright wrote: > When I originally worked out ideas for D, there were many requests from > the C and C++ community for a 'strong' typedef, and so I put one in D. I > didn't think about it too much, just assumed that it was a good idea. > > Now I'm not so sure. Maybe it should be removed for

Re: typedef: what's it good for?

2009-11-11 Thread rmcguire
Andrei Alexandrescu wrote: > rmcguire wrote: >> Justin Johansson wrote: >> >>> Walter Bright Wrote: >>> When I originally worked out ideas for D, there were many requests from the C and C++ community for a 'strong' typedef, and so I put one in D. I didn't think about it too m