Carp icon indicating copy to clipboard operation
Carp copied to clipboard

Project.config

Open Vertmo opened this issue 4 years ago • 2 comments

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 ?

Vertmo avatar Jun 29 '20 06:06 Vertmo

I don't know if it matters, but you can also set it via --eval-preload '(Project.config "title" "xxx")' and via profile.carp.

jacereda avatar Jul 01 '20 10:07 jacereda

I've definitely run into this before but I'm not sure about the best way to fix it yet.

scolsen avatar Oct 18 '22 18:10 scolsen