[phobos] phobos commit, revision 1837

Jacob doob at me.com
Thu Aug 12 04:11:13 PDT 2010


Or the template mixin could use fully qualified names.

On 12 aug 2010, at 13:04, Michel Fortin wrote:

> Le 2010-08-12 à 4:37, dsource.org a écrit :
> 
>> phobos commit, revision 1837
>> 
>> 
>> user: Don Clugston
>> 
>> msg:
>> Some functions need to be public. Revealed by patch to bug 314.
>> 
>> http://www.dsource.org/projects/phobos/changeset/1837
> 
> From the changelog:
> 
> ---
> public // These functions are accessed by mixed-in code
> {
> 	import std.c.stdlib : calloc, realloc, free;
> 	import core.exception : onOutOfMemoryError;
> }
> ---
> 
> Is it reasonable to have to import publicly everything you need for every mixin in every module? Won't this pollute the global namespace? And won't this break a selective import like this one?
> 
> ---
> import std.signal : Signal;
> ---
> 
> Perhaps import could be added directly in the template instead:
> 
> ---
> template Signal(T1...)
> {
> 	import std.c.stdlib : calloc, realloc, free;
> 	import core.exception : onOutOfMemoryError;
> 	...
> }
> ---
> 
> This is a working but undocumented feature (perhaps it's an accident that it works), see:
> <http://d.puremagic.com/issues/show_bug.cgi?id=2179>
> 
> From my limited testing however, it seems that this import always import the symbols publicly. :-(
> 
> -- 
> Michel Fortin
> michel.fortin at michelf.com
> http://michelf.com/
> 
> 
> 
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos



More information about the phobos mailing list