Import proposals (Ideas)

jcc7 jcc7_member at pathlink.com
Mon Jul 10 11:26:25 PDT 2006


In article <e8u2s1$1li1$1 at digitaldaemon.com>, Chris Nicholson-Sauls says...
>
>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?

I thought about colon, but people will probably want to do things like this and
I think the colon meaning could get confusing:

With equal symbol...

public:
import fooTooLong.reallyTooLong = fooShort;
import fooTooLong.reallyTooLong2 = fooShort2;


With colon symbol...

public:
import fooTooLong.reallyTooLong : fooShort;
import fooTooLong.reallyTooLong2 : fooShort2;


Okay, now that I look at it, I think it'd work fine.

..
>> "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 know I'm grasping at straws. At this point, D has plenty of keywords, so I'm
trying to encourage recycling. ;)


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

We could do that, but "fqn" and "fqnimport" look very ugly to me. I'm sure we
can find something more elegant than that that makes more sense than "switch
import".

jcc7



More information about the Digitalmars-d mailing list