WeakRef updated to support Tango, too

Bill Baxter dnewsgroup at billbaxter.com
Thu Feb 14 07:41:03 PST 2008


Tomas Lindquist Olsen wrote:
> Bill Baxter wrote:
>> Tomas Lindquist Olsen wrote:
>>> Minor issue, the 'string' alias should be private, or it may conflict 
>>> with aliases made by the user.
>>
>> As far as I know, private aliases conflict just like public ones, not so?
> 
> The problem is in the modules that import your weakref module. When the 
> alias is public it becomes part of the global symbol table (of the 
> importing module) and conflicts with ones own alias. If you make it 
> private, imports will not see the alias and you thus wont cause 
> conflicts. Hope that makes more sense.

Oh I see.  So it doesn't help avoid conflicts in the module importing 
weakref, but it helps avoid them in the modules that import the modules 
that import weakref.

Well anyway, the code probably needs big changes to be a good WeakRef 
class for D2 anyway, so I might as well just ditch the alias and use 
char[] directly.

But anyway, no one has given me access to scrapple.

Thanks for the feedback.

--bb



More information about the Digitalmars-d mailing list