Deimos: Consistent structure?

Jacob Carlborg doob at me.com
Mon Nov 21 04:21:39 PST 2011


On 2011-11-21 10:30, Jude Young wrote:
> young at Dan-Laptop:~/bin/mytest$ vim otherproject/curses.d
> young at Dan-Laptop:~/bin/mytest$ dmd -I/ncurses -I/otherproject test.d
>
> I made it so that both projects have identical module names.
> "module curses;"
> DMD still works it out fine if you import "ncurses.curses,
> otherproject.curses;"

Does that really work? You would need to do "dmd -I." which I think dmd 
does by default so in this case it actually works.

> The only way that I can see you running into errors is if you insist
> upon using "import curses;".

Yeah, that's what I did.

> Which I do not know how you will get around that anyways, so I think I
> am entirely missing your point.
>
> ...and it appears that there is an error in ncurses about unctrl.d...
> =(
>
>
> I showed you an example, and there were no problems.
> Show me an example where there will be problems, because everything you
> have told me does not seem to apply to the current situation.

jacob at des-051 ~/development/d/foobar$ ls
lib    main.d
jacob at des-051 ~/development/d/foobar$ cat main.d
module main;

import foo.test;
import bar.test;

void main ()
{
	
}jacob at des-051 ~/development/d/foobar$ cd lib/
jacob at des-051 ~/development/d/foobar/lib$ ls
bar foo
jacob at des-051 ~/development/d/foobar/lib$ cd bar/
jacob at des-051 ~/development/d/foobar/lib/bar$ cat test.d
module test;jacob at des-051 ~/development/d/foobar/lib/bar$ cd ../foo/
jacob at des-051 ~/development/d/foobar/lib/foo$ cat test.d
module test;jacob at des-051 ~/development/d/foobar/lib/foo$ cd ../../
jacob at des-051 ~/development/d/foobar$ dmd main.d -I./lib/foo -I./lib/bar
main.d(3): Error: module test is in file 'foo/test.d' which cannot be read
import path[0] = ./lib/foo
import path[1] = ./lib/bar
import path[2] = /Users/jacob/.dvm/compilers/dmd-1.070/bin/../import
jacob at des-051 ~/development/d/foobar$ dmd main.d -I./lib
main.d(4): Error: module test from file ./lib/bar/test.d conflicts with 
another module test from file ./lib/foo/test.d
jacob at des-051 ~/development/d/foobar$

If I change both test files to include the package, e.g. "module 
foo.test;" and "module bar.test;" it works. But in that case I have to 
add the whole "lib" to the include path, which I may not want to. Then I 
have to manually put the projects in their own directories.

> I will fix both Deimos and ZeroMQ (and the projects I'm currently
> working on) if you can give me enough information to duplicate the
> problems.

It's just weird if the module and import declarations doesn't match, 
i.e. "module curses;" and "import ncurses.curses;".

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list