Expose function abs (issue 402) and cljs.core/Cons in SCI config by adding entries to core.cljs' clojure.core namespace map#403
Merged
borkdude merged 1 commit intobabashka:mainfrom Dec 9, 2025
Conversation
- Add 'abs (sci/copy-var abs core-ns) for math absolute value function - Add 'Cons cljs.core/Cons for type checking with instance? This allows (abs -42) and (instance? cljs.core/Cons x) to work in nbb. Libraries like Trove need Cons for type checking in their const-form? function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows
(abs -42)and(instance? cljs.core/Cons x)to work in nbb. Libraries like Trove need Cons for type checking in theirconst-form?function.Tested with code in gist "https://gist.github.com/franks42/345be2b3baebc1bb0848ce2ffa7e16cf" - tests fail with currently released nbb "1.3.204", and tests succeed with nbb compiled with proposed changes.
Regards, Frank.
Please answer the following questions and leave the below in as part of your PR.
[ x] I have read the developer documentation.
[ x] This PR corresponds to an issue with a clear problem statement.
Issue 402 is resolved with this fix.
Cons fix does not have issue associated with it but was discussed in slack's trove channel.
This PR contains a test to prevent against future regressions
I have updated the CHANGELOG.md file with a description of the addressed issue.