On 2011-11-21 09:41, Jude Young wrote:
young@Dan-Laptop:~/bin$ mkdir mytest
young@Dan-Laptop:~/bin$ cd mytest/
young@Dan-Laptop:~/bin/mytest$ git clone
git://github.com/D-Programming-Deimos/ncurses
Cloning into 'ncurses'...
remote: Counting objects: 99, done.
remote: Compressing objects: 100% (66/66), done.
remote: Total 99 (delta 44), reused 86 (delta 31)
Receiving objects: 100% (99/99), 73.24 KiB, done.
Resolving deltas: 100% (44/44), done.
young@Dan-Laptop:~/bin/mytest$ l
ncurses/
young@Dan-Laptop:~/bin/mytest$ touch test.d
young@Dan-Laptop:~/bin/mytest$ l
ncurses/  test.d
young@Dan-Laptop:~/bin/mytest$ vim test.d
young@Dan-Laptop:~/bin/mytest$ mkdir otherproject
young@Dan-Laptop:~/bin/mytest$ touch otherproject/curses.d
young@Dan-Laptop:~/bin/mytest$ dmd -I/ncurses test.d
young@Dan-Laptop:~/bin/mytest$ ./test
I didn't bother to actually use the files compile-time will sort that
outl.
young@Dan-Laptop:~/bin/mytest$



Yes DMD will try to compile blank files, yes 'test.d' had the exact
phrase "import ncurses.curses;"

since git will automatically create the folder 'ncurses' when you clone
the project, that acts as the root package.
What is wrong with this?

If I'm missing something, please tell me.

That assumes ncurses/curses.d contains "module ncurses.curses;" and otherproject/curses.d contains "module otherproject.curses;" otherwise there will be a conflict:

"main.d(73): Error: module test from file foo/test.d conflicts with another module test from file bar/test.d"

This is not the case with the current ncurses bindings: https://github.com/D-Programming-Deimos/ncurses/blob/master/curses.d

It will look weird if top level modules contain something like "module foo.bar;" and I don't think the modules should depend on the name of the repository.

--
/Jacob Carlborg

Reply via email to