Import proposals (Ideas)

Anders Runesson anders at runesson.info
Wed Jul 12 00:46:08 PDT 2006


mån 2006-07-10 klockan 18:26 +0000 skrev jcc7:
> 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;

perhaps something like this: 

import fooTooLong {
	reallyTooLong: tooShort,    /* alias */
	reallyTooLong2: tooShort2,  /* alias 2
	notReallyTooLongAtAll       /* No alias */
}

to make several aliases from the same module? My 2c.

/Anders




More information about the Digitalmars-d mailing list