Namespaces with `*` can't be found.

Open
#376 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
clojure, node.js
Domain
backend, cli

Research direction

Reproduce the failure with bb repl-clj and bb repl-cljs using the test-nbb-ns repository and compare the working namespace files with the test_cljc.cljc and test_cljs.cljs files under .nbb/.cache/.../nbb-deps. Trace how those generated files are discovered and loaded. Done means namespace symbols containing * can be required and called in both REPL modes, matching Clojure behavior.

Written by the indexing model from the issue text.

Description

version

v1.3.196

platform

macOS Sequoia 15.3.2

problem

Namespace symbols with * don't seem to work.

$ bb repl-clj
Clojure 1.12.0

user=> (require '[test-nbb-ns.test-cljc :as test-cljc])
nil

user=> (test-cljc/hello)
"Hello from test-nbb-ns.test-cljc!"
nil

user=> (require '[test-nbb-ns.*test-cljc* :as *test-cljc*])
nil

user=> (*test-cljc*/hello)
"Hello from test-nbb-ns.*test-cljc*!"
nil
$ bb repl-cljs
Welcome to nbb v1.3.196!

user=> (require '[test-nbb-ns.test-cljc :as test-cljc])
nil

user=> (test-cljc/hello)
"Hello from test-nbb-ns.test-cljc!"
nil

user=> (require '[test-nbb-ns.*test-cljc* :as *test-cljc*])
"Error: Could not find namespace: test-nbb-ns.*test-cljc*"

user=> (require '[test-nbb-ns.test-cljs :as test-cljs])
nil

user=> (test-cljs/hello)
"Hello from test-nbb-ns.test-cljs!"
nil

user=> (require '[test-nbb-ns.*test-cljs* :as *test-cljs*])
"Error: Could not find namespace: test-nbb-ns.*test-cljs*"

There may be other characters which are allowed in symbols that don't work, but I haven't tested those.

https://clojure.org/reference/reader#_symbols

repro

https://github.com/commiterate/test-nbb-ns

This is using :local/root "." in nbb.edn to defer to deps.edn.

The generated .nbb has files for all the namespaces.

.nbb
└── .cache
    └── 234d643b78573b567a783af269377ad0cd729227
        ├── deps.edn
        ├── nbb-deps
        │   ├── META-INF
        │   │   └── MANIFEST.MF
        │   └── test_nbb_ns
        │       ├── *test_cljc*.cljc
        │       ├── *test_cljs*.cljs
        │       ├── test_cljc.cljc
        │       └── test_cljs.cljs
        └── nbb-deps.jar

expected behavior

Namespaces with * work like in Clojure (Java).

Dominant language
Clojure
Stars
972
Forks
56
Avg merge
1m
Merged PRs (30d)
6

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from babashka/nbb

All issues in babashka/nbb

Similar issues

More Clojure issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.