Import concerns revisited

Lionello Lunesu lio at lunesu.remove.com
Mon Jul 10 23:06:32 PDT 2006


Walter Bright wrote:
> John Reimer wrote:
>> If you can find something
>> equivalent to from/as (which you most certainly haven't), without 
>> adopting new
>> syntax, maybe we'll bite... but so far, I think using 'with' (or from) 
>> and 'as'
>> is an excellent contender.
> 
> I'll repeat myself here, too <g>. The 'static import' combined with 
> 'alias' has
> 
>     *exactly the same semantics*
> 
> as 'with' 'as'. The only difference between the proposals is if there 
> are two statements or one. There is no difference in power or effect. 
> There is nothing that one can do that the other cannot.


Not true. With the static import + alias you'll have two different ways 
to refer to the imported symbol(s), and no restriction as to which one 
is used.

With "as"/"from"/":"/whatever you'll have only 1 way. If you see 
"bar.foo", there's only 1 thing it can mean.

(With the current import + alias you'll have *3* names for the same 
thing. I've read somewhere that this is something people generally have 
problems with, some psychology thing.)

L.



More information about the Digitalmars-d mailing list