Module level variable shadowing

Meta via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 27 14:23:10 PDT 2014


On Friday, 27 June 2014 at 20:40:24 UTC, Walter Bright wrote:
> On 6/27/2014 1:38 PM, Tofu Ninja wrote:
>> On Friday, 27 June 2014 at 08:24:16 UTC, dennis luehring wrote:
>>> what i don't understand - why on earth should someone want to 
>>> shadow a(or
>>> better any) variable at all?
>>
>> It can be useful if you are using mixins where you don't know 
>> what is going to
>> be in the destination scope.
>
> Is true. People who do metaprogramming with C macros have all 
> kinds of problems with the lack of scoping of temp variable 
> names within the macros.

But keep in mind that we can also name mixins. Or is that only 
possible when you're mixing in a template/mixin template?


More information about the Digitalmars-d mailing list