D - alias, typedef => typedef, typename
- Walter (7/7) Sep 02 2002 typedef's being strong in D and mere aliases in C has caused some confus...
- Mark Evans (6/6) Sep 02 2002 I might suggest eliminating the term "typedef" completely because of its...
- Matthew Wilson (6/13) Sep 02 2002 Like the names
- Patrick Down (5/11) Sep 02 2002 I like the current names. As far as I'm concerned typedef finally
- Pavel Minayev (4/12) Sep 02 2002 I like the old version better (probably because "alias" makes it clear
- Mac Reiter (12/19) Sep 03 2002 My vote goes for ditching typedef if it is a problem. I really like ali...
- Juarez Rudsatz (11/13) Sep 03 2002 1. I think this confusion must be corrected.
- Pavel Minayev (7/8) Sep 03 2002 I also think that "type" would be the best choice. But then,
- Mac Reiter (2/5) Sep 03 2002 I like that. Does it cause any parsing problems?
- Pavel Minayev (5/12) Sep 03 2002 Don't think so. What we have is a keyword (type/alias),
- Sandor Hojtsy (9/21) Sep 04 2002 The "=" sign has the meaning "value assignment" for me.
- Hanhua Feng (5/35) Sep 04 2002 I think we can use ":=".
- Joe Battelle (2/4) Sep 04 2002 Wow, we're really far a field here. My vote is to keep alias and typede...
- Luigi (7/7) Sep 08 2002 I think that Alias and Typedef are already the best name to represent th...
- Walter (5/9) Sep 08 2002 their
- Pavel Minayev (2/4) Sep 09 2002 Function aliases? C++-like references?
- Walter (6/10) Sep 09 2002 Being able to alias any symbol, such as:
- Pavel Minayev (9/16) Sep 09 2002 What about local variables? Will I be able to write something like this?
- Walter (4/17) Sep 09 2002 An alias is an alias for another symbol, looked up at compile time, not ...
typedef's being strong in D and mere aliases in C has caused some confusion. Any interest in changing the keywords to: alias => typedef // bonus being it's compatible with C's typedef typedef => typename The downside is existing code must change (not too bad with a global file search/replace). If this change was to be made, sooner is certainly better. -Walter
Sep 02 2002
I might suggest eliminating the term "typedef" completely because of its C baggage. If D semantics are significantly different, then use new names altogether. (If you do use tyepdef then it should mean exactly what it does in C.) I vote for simply "type" and "typealias". Mark
Sep 02 2002
Like the names "Walter" <walter digitalmars.com> wrote in message news:al0p32$1jva$2 digitaldaemon.com...typedef's being strong in D and mere aliases in C has caused someconfusion.Any interest in changing the keywords to: alias => typedef // bonus being it's compatible with C'stypedeftypedef => typename The downside is existing code must change (not too bad with a global file search/replace). If this change was to be made, sooner is certainlybetter.-Walter
Sep 02 2002
"Walter" <walter digitalmars.com> wrote in news:al0p32$1jva$2 digitaldaemon.com:typedef's being strong in D and mere aliases in C has caused some confusion. Any interest in changing the keywords to: alias => typedef // bonus being it's compatible with C's typedef typedef => typenameI like the current names. As far as I'm concerned typedef finally does what it should have all along. However if you must change I would keep alias and choose a different name for typedef.
Sep 02 2002
Walter wrote:typedef's being strong in D and mere aliases in C has caused some confusion. Any interest in changing the keywords to: alias => typedef // bonus being it's compatible with C's typedef typedef => typename The downside is existing code must change (not too bad with a global file search/replace). If this change was to be made, sooner is certainly better.I like the old version better (probably because "alias" makes it clear that it is an alias), but it is a cosmetic change actually, so no problem with the new syntax either... but wait, it's more to type! =)
Sep 02 2002
My vote goes for ditching typedef if it is a problem. I really like alias, because it is clear and explicit. I also like the new typedef behavior, but I understand that it could confuse C/C++ programmers. Personally typedef sounds like exactly the right word for what it does, but it will cause problems for people having to switch languages... 'type' would work for me. 'typename' sounds a little too much like 'make up a new name for this type', which is more like aliasing... 'maketype' might work, if it didn't look so odd. I don't have a strong preference for particular words to take over 'typedef's job, but I have no particular interest in maintaining C compatibility. Kill typedef and pick any word that sounds right... Just keep alias the way it is. Mac In article <al0p32$1jva$2 digitaldaemon.com>, Walter says...typedef's being strong in D and mere aliases in C has caused some confusion. Any interest in changing the keywords to: alias => typedef // bonus being it's compatible with C's typedef typedef => typename The downside is existing code must change (not too bad with a global file search/replace). If this change was to be made, sooner is certainly better. -Walter
Sep 03 2002
"Walter" <walter digitalmars.com> wrote in news:al0p32$1jva$2 digitaldaemon.com:alias => typedef // bonus being it's compatible with C's typedef typedef => typename1. I think this confusion must be corrected. 2. If all must be changed, why not use two new keywords not present in C ? "alias" and "type" will not confuse the C/C++ programmer. But all declaration must be reevaluated for a conversion to "alias" or "type" and keeping "typedef" could make the programmers not evaluate correctly what need be done. They will ignore the concepts and adopt all as "typedef". C -> D typedef type alias
Sep 03 2002
Juarez Rudsatz wrote:"alias" and "type" will not confuse the C/C++ programmer.I also think that "type" would be the best choice. But then, it just looks somewhat weird to type something like: type void* HANDLE; Maybe it's better to adopt Pascal syntax? type HANDLE = void*; alias LPINT = int*;
Sep 03 2002
Maybe it's better to adopt Pascal syntax? type HANDLE = void*; alias LPINT = int*;I like that. Does it cause any parsing problems? Mac
Sep 03 2002
Mac Reiter wrote:Don't think so. What we have is a keyword (type/alias), followed by an identifier, then equality sign, and then everything until the first semicolon is a type description.Maybe it's better to adopt Pascal syntax? type HANDLE = void*; alias LPINT = int*;I like that. Does it cause any parsing problems?
Sep 03 2002
"Pavel Minayev" <evilone omen.ru> wrote in message news:al3dqt$229p$1 digitaldaemon.com...Mac Reiter wrote:The "=" sign has the meaning "value assignment" for me. But we already have a syntax : see the template parameters. They use the colon ":" for very similar purpose. So if you really need something after the name of the new type, I suggest: type HANDLE : void*; alias LPINT : int*; SandorDon't think so. What we have is a keyword (type/alias), followed by an identifier, then equality sign, and then everything until the first semicolon is a type description.Maybe it's better to adopt Pascal syntax? type HANDLE = void*; alias LPINT = int*;I like that. Does it cause any parsing problems?
Sep 04 2002
Sandor Hojtsy wrote:"Pavel Minayev" <evilone omen.ru> wrote in message news:al3dqt$229p$1 digitaldaemon.com...I think we can use ":=". Or, without any keyword, HANDLE ::= void *; LPINT := int *;Mac Reiter wrote:The "=" sign has the meaning "value assignment" for me. But we already have a syntax : see the template parameters. They use the colon ":" for very similar purpose. So if you really need something after the name of the new type, I suggest: type HANDLE : void*; alias LPINT : int*; SandorDon't think so. What we have is a keyword (type/alias), followed by an identifier, then equality sign, and then everything until the first semicolon is a type description.Maybe it's better to adopt Pascal syntax? type HANDLE = void*; alias LPINT = int*;I like that. Does it cause any parsing problems?
Sep 04 2002
type HANDLE : void*; alias LPINT : int*;Wow, we're really far a field here. My vote is to keep alias and typedef as they are.
Sep 04 2002
I think that Alias and Typedef are already the best name to represent their meaning. I don't believe that C and C++ programmers will have too many problems to conform... the concept is very simple to be understood. Bye -- Luigi
Sep 08 2002
"Luigi" <igiul.reverse email.it> wrote in message news:alfkre$117h$1 digitaldaemon.com...I think that Alias and Typedef are already the best name to representtheirmeaning. I don't believe that C and C++ programmers will have too many problems to conform... the concept is very simple to be understood.Yeah, it looks best to keep it the way it is. I have further plans for 'alias', too, based on some great suggestions here!
Sep 08 2002
Walter wrote:Yeah, it looks best to keep it the way it is. I have further plans for 'alias', too, based on some great suggestions here!Function aliases? C++-like references?
Sep 09 2002
"Pavel Minayev" <evilone omen.ru> wrote in message news:alice3$aou$2 digitaldaemon.com...Walter wrote:Being able to alias any symbol, such as: alias foo.bar.abc myname; It would take the place of the C practice of: #define myname foo.bar.abcYeah, it looks best to keep it the way it is. I have further plans for 'alias', too, based on some great suggestions here!Function aliases? C++-like references?
Sep 09 2002
Walter wrote:Being able to alias any symbol, such as: alias foo.bar.abc myname; It would take the place of the C practice of: #define myname foo.bar.abcWhat about local variables? Will I be able to write something like this? void do_smth(Foo obj) { alias obj.list[obj.choice].bar.baz().blah blah; ... } Another question is, will it be calculated just once, or every time alias is used?
Sep 09 2002
"Pavel Minayev" <evilone omen.ru> wrote in message news:aliqec$1vev$2 digitaldaemon.com...Walter wrote:An alias is an alias for another symbol, looked up at compile time, not an alias for an expression. I never thought about using it for an expression.Being able to alias any symbol, such as: alias foo.bar.abc myname; It would take the place of the C practice of: #define myname foo.bar.abcWhat about local variables? Will I be able to write something like this? void do_smth(Foo obj) { alias obj.list[obj.choice].bar.baz().blah blah; ... } Another question is, will it be calculated just once, or every time alias is used?
Sep 09 2002