Deimos: Consistent structure?

Jacob Carlborg doob at me.com
Mon Nov 21 01:06:56 PST 2011


On 2011-11-21 09:41, Jude Young wrote:
> young at Dan-Laptop:~/bin$ mkdir mytest
> young at Dan-Laptop:~/bin$ cd mytest/
> young at 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 at Dan-Laptop:~/bin/mytest$ l
> ncurses/
> young at Dan-Laptop:~/bin/mytest$ touch test.d
> young at Dan-Laptop:~/bin/mytest$ l
> ncurses/  test.d
> young at Dan-Laptop:~/bin/mytest$ vim test.d
> young at Dan-Laptop:~/bin/mytest$ mkdir otherproject
> young at Dan-Laptop:~/bin/mytest$ touch otherproject/curses.d
> young at Dan-Laptop:~/bin/mytest$ dmd -I/ncurses test.d
> young at Dan-Laptop:~/bin/mytest$ ./test
> I didn't bother to actually use the files compile-time will sort that
> outl.
> young at 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


More information about the Digitalmars-d mailing list