December 29, 2005
On Wed, 28 Dec 2005 18:43:54 -0800, Charles wrote:


> 
> Imagine how awesome it would be if BUILD could detect these import conflicts <hint,hint>.  Yea ... and some lint like capabilities too!

Yeah, yeah...I hear ya.

I'd already thought about this and it presents at least two problems. The first is that I'd have to manipulate the source file to insert an 'import' statement and that's no simple thing to do due to D's module naming constraints, and the second is that programs that would compile under Build would fail using other methods and that isn't nice.

A compromise might be to create a 'lint' that picks up these issues so we can manually update our source files.

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
"A learning experience is one of those things that says,
 'You know that thing you just did? Don't do that.'" - D.N. Adams
29/12/2005 1:23:22 PM
December 29, 2005
Derek Parnell says...
>
>On Wed, 28 Dec 2005 22:18:45 +0000 (UTC), Manfred Nowak wrote:
>
>
>> One solution is to import std in every module where you use such a member.
>
>My translation of Manfred's suggestion is that whenever one qualifies a member with a module reference, one must also explicitly import that module into the source file that contains the qualified reference.
>
>That is to say if one codes
>
>       std.stream.File ...
>
>then one also needs to code
>
>       import std.stream
>
>in the same source file.

You know what would be nice, allow a python like import.  In python one could do something like this,

from win32com.client.dynamic import Dispatch

so with the new D import version, one could do,

from std.stream import File

or better yet,

import std.stream.File alias ssFile;

which would import the File function from std.stream and would assign the alias ssFile to that function.  Is this possible?



1 2
Next ›   Last »