Skip to content

Comments

Move everything under package dcd#417

Merged
dlang-bot merged 4 commits intodlang-community:masterfrom
LaurentTreguier:master
Nov 2, 2017
Merged

Move everything under package dcd#417
dlang-bot merged 4 commits intodlang-community:masterfrom
LaurentTreguier:master

Conversation

@LaurentTreguier
Copy link
Contributor

This PR just moves every module from foo to dcd.foo. As DCD can be used as a library, importing something with a generic name like server.foo isn't optimal to avoid name clashes. Making everything start with dcd. (like dfmt already does) would seem a lot more natural.

Now obviously, if this change was pulled, it would break absolutely every single package currently using DCD as a library, and thus would require at least a new minor version; but it's not like it would be very hard to adapt to this change.

@skl131313 skl131313 requested review from WebFreak001 and removed request for WebFreak001 October 31, 2017 22:24
@rikkimax
Copy link
Contributor

rikkimax commented Nov 1, 2017

It needs to be moved under a dcd directory for importing. Otherwise dmd won't be able to see it quite right.

So:

  • src/dcd/server/main.d

@rikkimax
Copy link
Contributor

rikkimax commented Nov 1, 2017

@Hackerpilot if you're happy with this resonably small refactor, I'll turn on auto-merge-squash when these other issues are dealt with.

@LaurentTreguier
Copy link
Contributor Author

Technically it does compile without packages corresponding to directories... However DCD completion stops working (how ironic). I'll do the change later today when I have access to my PC

@Hackerpilot
Copy link
Collaborator

However DCD completion stops working (how ironic).

The language specification says

The packages correspond to directory names in the source file path.

I don't think that DCD is under any obligation to work for code that does not comply with the language specification.

@Hackerpilot
Copy link
Collaborator

Hackerpilot commented Nov 1, 2017

You'll need to fix the CLIENT_SRC and SERVER_SRC declarations in the makefile to get the CI build to pass.

@LaurentTreguier
Copy link
Contributor Author

LaurentTreguier commented Nov 2, 2017

The packages correspond to directory names in the source file path.

That was unexpected... DMD stills compiles the code without complaining even if packages and directories don't correspond 😕
But if the specification says so, then so be it... And it makes the organization easier anyway.

You'll need to fix the CLIENT_SRC and SERVER_SRC declarations in the makefile to get the CI build to pass.

Ugh, I forgot about the Makefile and build.bat...

@Hackerpilot
Copy link
Collaborator

That was unexpected... DMD stills compiles the code without complaining even if packages and directories don't correspond 😕

This is often the case with DMD.

In case you haven't found it, the relevant part of the spec is under point 2 in https://dlang.org/spec/module.html#module_declaration

@LaurentTreguier
Copy link
Contributor Author

I didn't look for it, I trusted you on that, you must know the specs a lot better than I do after all the work on DCD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants