digitalmars.D.bugs - DMD looks in the wrong place for imports in the same tree
- Sam McCall (4/4) Jul 05 2004 module tunah.a;
- Walter (4/7) Jul 06 2004 That's the way it's designed to work, imports always work off the curren...
- Stewart Gordon (8/18) Jul 07 2004 Is there some hidden advantage to this?
- Arcane Jill (11/12) Jul 07 2004 Gotcha. So if DMD encounters a line like:
- Sam McCall (32/48) Jul 08 2004 Moved (hope i got the crosspost/followup-to right).
module tunah.a; import tunah.b; DMD will look for ./tunah/b.d, rather than ./b.d Sam
Jul 05 2004
"Sam McCall" <tunah.d tunah.net> wrote in message news:ccbd38$1lla$1 digitaldaemon.com...module tunah.a; import tunah.b; DMD will look for ./tunah/b.d, rather than ./b.dThat's the way it's designed to work, imports always work off the current directory, unless you specify a different one with the -I switch.
Jul 06 2004
Walter wrote:"Sam McCall" <tunah.d tunah.net> wrote in message news:ccbd38$1lla$1 digitaldaemon.com...Is there some hidden advantage to this? http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D.bugs/586 Stewart. -- My e-mail is valid but not my primary mailbox, aside from its being the unfortunate victim of intensive mail-bombing at the moment. Please keep replies on the 'group where everyone may benefit.module tunah.a; import tunah.b; DMD will look for ./tunah/b.d, rather than ./b.dThat's the way it's designed to work, imports always work off the current directory, unless you specify a different one with the -I switch.
Jul 07 2004
In article <ccgeqh$428$1 digitaldaemon.com>, Stewart Gordon says...http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D.bugs/586Gotcha. So if DMD encounters a line like: it should implicitly add -I../.. to the include path, on the assumption that that MUST be the module root or the module declaration couldn't possibly be correct. Like it. Of course, if DMD is working the way it's designed to work, this isn't a bug. What you're talking about here is a feature-request (and a good one, too). Maybe this should be talked about over on the main forum? Arcane Jill
Jul 07 2004
(inverted post for my convenience ;) Arcane Jill wrote:Of course, if DMD is working the way it's designed to work, this isn't a bug. What you're talking about here is a feature-request (and a good one, too). Maybe this should be talked about over on the main forum?Moved (hope i got the crosspost/followup-to right). I posted it there when I was frustrated with various things, and annoyed that it didn't work in the obvious (to me) way.In article <ccgeqh$428$1 digitaldaemon.com>, Stewart Gordon says...I'd prefer a slightly different behaviour: only traverse back up the tree as long as module names and directory names coincide. For example, consider the file /path/tunah/package/foo.d containing each of the following: module foo; import bar.baz; // look in /path/tunah/package/bar/baz.d, // then in phobos/src/bar/baz.d module tunah.example.foo; import tunah.bar.baz; // look in /path/tunah/bar/baz.d, // then in phobos/src/bar/baz.d module contrib.tunah.example.foo; import contrib.tunah.bar.baz; // look in /path/tunah/bar/baz.d, // then in phobos/src/bar/baz.d Lastly, I think either a) these behaviours should be independent of the current working directory you compile from; or b) the current working directory should be searched in the same manner as phobos, before phobos but after module-specific imports. (BTW when I say "phobos" I mean "all global imports", including those given by -I) What are people's thoughts on this? Walter, does this sound like something that'd be suitable if it was popular and someone wrote a non-intrusive, simple patch? I'd be happy to try at some point, though someone else might be better. Samhttp://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D.bugs/586Gotcha. So if DMD encounters a line like: it should implicitly add -I../.. to the include path, on the assumption that that MUST be the module root or the module declaration couldn't possibly be correct.
Jul 08 2004