Import proposals (Ideas)

Chris Nicholson-Sauls ibisbasenji at gmail.com
Mon Jul 10 10:31:43 PDT 2006


jcc7 wrote:
> In article <optcf2eoqc23k2f5 at nrage>, Regan Heath says...
> 
>>Sub-thread for ideas.
> 
> 
> I'm not thrilled about the prospect of reusing static for yet another purpose,
> but I don't think that we need to add "from" or "as" to the keyword list either.
> 
> Instead of 
> "import fooTooLong.reallyTooLong as fooShort;"
> 
> we could re-use an operator:
> "import fooTooLong.reallyTooLong = fooShort;"
> 
> I like it, but it could just be me.

I think its a pretty neat idea, actually.  Although, maybe it should be the colon instead?

# import fooTooLong .reallyTooLong : fooShort ;

> I think someone else suggested this already, but I like it, too:
> "import fooTooLong.reallyTooLong alias fooShort;"

The placement of the 'alias' keyword throws me off pretty bad...  I can't help thinking it 
should be somewhere at the beginning, but then I don't like whitespace in my 'import' 
statement either.  I'm too picky!

> Now, I'm really brainstorming...
> 
> Or one of these might work:
> "import fooTooLong.reallyTooLong fooShort;" (no keyword needed at all)
> "import fooTooLong.reallyTooLong for fooShort;"
> "import fooTooLong.reallyTooLong out fooShort;"
> "import fooTooLong.reallyTooLong in fooShort;"

The 'in' case makes some sense, but the other ones... erm...

> 
> Or maybe even use one of these to force FQN (static is already used for enough
> different things):
> "import final fooTooLong.reallyTooLong;"
> "import do fooTooLong.reallyTooLong;"
> "import void fooTooLong.reallyTooLong;"

Do? Do?? Do?!  ;)  Why not 'default'?  Or 'typedef'?  (Actually, that'd be cute.)

I still think we need something like an 'fqn' keyword to accomplish this.  Or possibly the 
elsewhere-proposed 'fqnimport' statement.

-- Chris Nicholson-Sauls



More information about the Digitalmars-d mailing list