Carp
Carp copied to clipboard
Project.config
While tinkering with the compiler (related to #889) I've run into a problem : when giving a title to the core library project via
(Project.config "title" "core")
, the config is propagated to any code loading it (that is any code compiled without the *--no-core" option. It means that any project that does not set it's own project title would end up named "core" instead of "Untitled". In particular, this is a problem for the compiler test suite, which fails because the executable that are ran are not the one expected.
Now, this last issue is not that big, as the fix is simply to not title "core", as was done previously. However this behavior also means that any titled library that is loaded by a user after calling Project.title
would override the name of the user's project, which may be counter-intuitive.
What I propose is that some or all of a project's config should only be changeable in the project's "main" file (that is the one on which carp is called first when compiling in batch mode, or in the REPL when using it. What do you think ?
I don't know if it matters, but you can also set it via --eval-preload '(Project.config "title" "xxx")'
and via profile.carp
.
I've definitely run into this before but I'm not sure about the best way to fix it yet.