DMD 0.163 release
Chris Nicholson-Sauls
ibisbasenji at gmail.com
Tue Jul 18 19:02:45 PDT 2006
Walter Bright wrote:
>
> http://www.digitalmars.com/d/changelog.html
>
> This has all the new import changes in it. That breaks a lot of existing
> code (like dmdscript), the fixes are simple (adding more import
> declarations) but tedious.
>
> I couldn't find a better keyword choice than "static import".
>
> The renaming uses '=' instead of 'as', 'from', or 'alias' for the reasons:
>
> 1) didn't want to add new keywords, especially ones like 'as' as I use
> that as a variable name
>
> 2) didn't need to add new keywords - adding them should be done only if
> using punctuation is completely unappealing
>
> 3) using '=' and ':' is visually more distinct than embedded keywords.
Default private imports are a fantastic thing long in coming! Thank you Walter.
Also, while I still have some minor reservations on using the 'static' keyword in this
way, I very much love the new additions to the import system. I look forward to
collapsing some long names down to something more feasible, and to yoinking one or two
functions from a utility module without further polluting my namespace (and without having
to resort to qualified names when they aren't the summit of elegance). I am intrigued by
the exact syntax you settled on, in particular the use of ':' to do selective importing.
There are just a couple things that I wonder about.
Is it possible to do a static selective import? In other words:
# static import foo : bar ; // must use 'foo.bar' to refer to it
Or to do a static renamed selective import, even:
# static import abc = foo : def = bar ; // must use 'abc.def', which defers to 'foo.bar'
And I assume there is no way to import more than one module selectively in one module
declaration, since there is no syntax to terminate the symbol list after the ':' terminal,
aside from ending the declaration altogether.
One last time: hooray for default private imports! ;) You are an amazing individual, Mr.
Bright. And D is an amazing language.
-- Chris Nicholson-Sauls
More information about the Digitalmars-d-announce
mailing list