the point of selective importing

Rioshin an'Harthen rharth75 at hotmail.com
Wed Jul 12 11:55:46 PDT 2006


"jcc7" <jcc7_member at pathlink.com> wrote:
> In article <1wb7225zjf13v.1n8u9dwecz2a8$.dlg at 40tude.net>, Derek Parnell 
> says...
>> import std.string alias str;
>> import std.regexp alias re;
>> import util.str alias utl;
>
> I really like that proposed syntax. (We don't /need/ new keywords, so we
> shouldn't need to add new ones.) I can't believe that syntax would be hard 
> for
> Walter to add, so it should be added. It would be incredibly useful.

The version I wrote (note that I did not like the distinction between 
'alias' and 'as', which is why the 'as' was mentioned as optional) with 
selective imports is what I would like to have - not that I'm that likely to 
use selective imports, but the idea of having the option is alluring. But 
I'm willing to settle for aliased imports (implicitly static, mind), for 
which the approximate grammar would be:

ImportDeclaration:
    'import' ModuleList ';'

ModuleList:
    ModuleDeclaration
    ModuleDeclaration ',' ModuleList

ModuleDeclaration:
    ModuleName 'alias' AliasedName
    ModuleName





More information about the Digitalmars-d mailing list