Review of Jose Armando Garcia Sancio's std.log
Sean Kelly
sean at invisibleduck.org
Tue Mar 6 19:10:14 PST 2012
Sorry. For some reason I thought info was callable directly without the leading log portion.
On Mar 6, 2012, at 1:37 PM, Jose Armando Garcia <jsancio at gmail.com> wrote:
> On Tue, Mar 6, 2012 at 12:43 PM, Sean Kelly <sean at invisibleduck.org> wrote:
>> On Mar 6, 2012, at 11:39 AM, Jose Armando Garcia wrote:
>>
>>> Seriously everyone. What are we spending some much effort on this?
>>> What is wrong with:
>>>
>>> import log = std.log;
>>> log.info("cool");
>>
>> Why should the default be unqualified names? Is this simply a desire to not change std.log so we can just get it in already?
>
> What are you proposing?
>
> struct Log {
> static alias log!Severity.info info;
> ...
> }
>
> I am not exactly sure when this idiom became popular. I don't know if
> this is an C++ idiom or a Java idiom but I do know that it is a broken
> hack. C++ developers use it because the name-spacing facility is
> limiting. Java uses it because everything is a class and they don't
> have the concept of compile time objects. We don't need this hack in
> D. D's module mechanism make this C++/Java idiom unnecessary.
>
>
> Thanks,
> -Jose
More information about the Digitalmars-d
mailing list