Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About package modules #22

Closed
ghost opened this issue Apr 4, 2018 · 4 comments
Closed

About package modules #22

ghost opened this issue Apr 4, 2018 · 4 comments

Comments

@ghost
Copy link

ghost commented Apr 4, 2018

In nim you can just use export/import together to achieve the same, for example main .nim file from Arraymancer, and then you can just use "import arraymancer" and it's done (and you can import different files (packages?) from subfolders too
https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer.nim

@timotheecour
Copy link
Owner

timotheecour commented Apr 4, 2018

in D:

#before:
std/foo.d
#after breakup:
std/foo/package.d
std/foo/mod1.d
std/foo/mod2.d

in Nim:

#before:
std/foo.nim
#after breakup:
std/foo.nim
std/foo/mod1.d
std/foo/mod2.d

so it's not quite as clean as in D because std/foo.nim remains on top-level instead of all the foo stuff being inside foo/

Admittedly, it's not that huge of a difference

@marler8997
Copy link

I think I actually prefer Nims solution here :)

@marler8997
Copy link

marler8997 commented Apr 4, 2018

But...Nim's solution is a subset of D's. You can do the same thing in D. It's just that D also supports more functionality, which in my opinion doesn't add much value while adding complexity to the module system.

@timotheecour
Copy link
Owner

right, definitely not a big point; i mentioned this issue in the readme for reference, closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants