September 04, 2002 Re: alias, typedef => typedef, typename | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | "Pavel Minayev" <evilone@omen.ru> wrote in message news:al3dqt$229p$1@digitaldaemon.com... > Mac Reiter wrote: > >>Maybe it's better to adopt Pascal syntax? > >> > >> type HANDLE = void*; > >> alias LPINT = int*; > > > > > > I like that. Does it cause any parsing problems? > > 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. 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*; Sandor |
September 04, 2002 Re: alias, typedef => typedef, typename | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sandor Hojtsy | Sandor Hojtsy wrote:
> "Pavel Minayev" <evilone@omen.ru> wrote in message
> news:al3dqt$229p$1@digitaldaemon.com...
>
>>Mac Reiter wrote:
>>
>>>>Maybe it's better to adopt Pascal syntax?
>>>>
>>>>type HANDLE = void*;
>>>>alias LPINT = int*;
>>>
>>>
>>>I like that. Does it cause any parsing problems?
>>
>>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.
>
>
> 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*;
>
> Sandor
>
>
I think we can use ":=".
Or, without any keyword,
HANDLE ::= void *;
LPINT := int *;
|
September 04, 2002 Re: alias, typedef => typedef, typename | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sandor Hojtsy | >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.
|
September 08, 2002 Re: alias, typedef => typedef, typename | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | 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 |
September 09, 2002 Re: alias, typedef => typedef, typename | ||||
---|---|---|---|---|
| ||||
Posted in reply to Luigi | "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 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. Yeah, it looks best to keep it the way it is. I have further plans for 'alias', too, based on some great suggestions here! |
September 09, 2002 Re: alias, typedef => typedef, typename | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | 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?
|
September 09, 2002 Re: alias, typedef => typedef, typename | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | "Pavel Minayev" <evilone@omen.ru> wrote in message news:alice3$aou$2@digitaldaemon.com... > 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? 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.abc |
September 09, 2002 Re: alias, typedef => typedef, typename | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | 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.abc What 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? |
September 10, 2002 Re: alias, typedef => typedef, typename | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pavel Minayev | "Pavel Minayev" <evilone@omen.ru> wrote in message news:aliqec$1vev$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.abc > What 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? 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. |
Copyright © 1999-2021 by the D Language Foundation