Import conflict resoultion
Dave
Dave_member at pathlink.com
Wed Jul 12 20:13:02 PDT 2006
In article <e94d1g$9o3$1 at digitaldaemon.com>, kris says...
>
>Suspect we've already flogged this to death a number of times, but
>selective-imports don't appear to give you much functional power above
>and beyond the prefix-import. Thus it would be entirely optional, IMO. I
>know Dave has noted this in a prior post, as have others.
>
>Dave wrote:
>> Given your rational and proposal, the _need_ for "specific symbol
>> import" functionality will probably disappear too, keeping the language
>> that much simpler to implement and less to learn and remember in order
>> to maintain code.
>>
>> import a.popular.db.lib dblib;
>> alias dblib.open dbopen;
>> alias dblib.close dbclose;
>>
>> would be used instead of something like:
>>
>> import a.popular.db.lib dblib
>> {
>> open dbopen;
>> close dbclose;
>> }
>>
>> Not much difference in lines of code or effort to write or scan, the one
>> advantage being that it would tend to keep aliased symbols close to the
>> import (that's still a big advantage though, IMHO).
>
>egad! :)
>
>Would perhaps be simpler to avoid that, and just do this instead:
>
>import a.popular.db.lib db;
>
>db.open ();
>db.close ();
>
You're right - I was getting carried away with matching the C# 'using alias =
specific_symbol;' functionality because I like it. But, I haven't seen it used
by others that much for specific symbols probably for the same reasons your
examples just pointed out. I'd be very happy just to get the prefix-import
change pretty much like Regan just described.
More information about the Digitalmars-d
mailing list