digitalmars.D - Alias question ( 1.0 )
- Edward Diener (9/9) Apr 12 2008 I am trying to understand the difference between and alias type and an
- Walter Bright (7/14) Apr 13 2008 An alias type works analogously to C's typedef. An alias declaration
- Edward Diener (5/25) Apr 13 2008 OK, so an alias creates a compile-time symbol which stands for another
- Walter Bright (3/20) Apr 14 2008 Right. You can alias any symbol - other aliases, variable names, module
- Edward Diener (2/23) Apr 14 2008 Got it now. Thanks !
I am trying to understand the difference between and alias type and an alias declaration. Is the distinction such that if the next token after 'alias' is a type, then the alias always refers to the full type including that token before the final alias name, but if the next token after 'alias' is not a type then the alias always refers to the complete declaration before the final alias name ? Or is there some other rule that determines whether or not an alias is an alias for a type as opposed to an alias for a declaration ?
Apr 12 2008
Edward Diener wrote:I am trying to understand the difference between and alias type and an alias declaration.An alias type works analogously to C's typedef. An alias declaration gives an alternate name for any other name, like: alias foo.bar baz; is sort of equivalent to the C: #define baz foo.barIs the distinction such that if the next token after 'alias' is a type, then the alias always refers to the full type including that token before the final alias name, but if the next token after 'alias' is not a type then the alias always refers to the complete declaration before the final alias name ?Right.
Apr 13 2008
Walter Bright wrote:Edward Diener wrote:OK, so an alias creates a compile-time symbol which stands for another symbol, as long as the symbol it stands for is not an expression but a declaration instead.I am trying to understand the difference between and alias type and an alias declaration.An alias type works analogously to C's typedef. An alias declaration gives an alternate name for any other name, like: alias foo.bar baz; is sort of equivalent to the C: #define baz foo.barThanks ! Appreciated !Is the distinction such that if the next token after 'alias' is a type, then the alias always refers to the full type including that token before the final alias name, but if the next token after 'alias' is not a type then the alias always refers to the complete declaration before the final alias name ?Right.
Apr 13 2008
Edward Diener wrote:Walter Bright wrote:Right. You can alias any symbol - other aliases, variable names, module names, function names, template names, struct names, etc.Edward Diener wrote:OK, so an alias creates a compile-time symbol which stands for another symbol, as long as the symbol it stands for is not an expression but a declaration instead.I am trying to understand the difference between and alias type and an alias declaration.An alias type works analogously to C's typedef. An alias declaration gives an alternate name for any other name, like: alias foo.bar baz; is sort of equivalent to the C: #define baz foo.bar
Apr 14 2008
Walter Bright wrote:Edward Diener wrote:Got it now. Thanks !Walter Bright wrote:Right. You can alias any symbol - other aliases, variable names, module names, function names, template names, struct names, etc.Edward Diener wrote:OK, so an alias creates a compile-time symbol which stands for another symbol, as long as the symbol it stands for is not an expression but a declaration instead.I am trying to understand the difference between and alias type and an alias declaration.An alias type works analogously to C's typedef. An alias declaration gives an alternate name for any other name, like: alias foo.bar baz; is sort of equivalent to the C: #define baz foo.bar
Apr 14 2008