Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Namespace/find is not implemented by Babashka; switch to clojure.core/find-ns for compatibility #96

Merged
merged 1 commit into from
Aug 7, 2023

Conversation

nha
Copy link
Contributor

@nha nha commented Aug 7, 2023

This change proposes to replace Namespace/find with clojure.core/find-ns.

Attempting to run pretty 2.0.1 in babashka yields an error:

   (Namespace/find sym)
    ^--- No matching method find found taking 1 args

This is introduced in a recent change (#95), the previous version 2.0 works fine. This is because Namespace/find is not compiled (probably considered an implementation detail).
But clojure.core/find-ns is included and is equivalent

https://github.com/clojure/clojure/blob/38bafca9e76cd6625d8dce5fb6d16b87845c8b9d/src/clj/clojure/core.clj#L4126-L4130

…hka/babashka) yields an error:

```
   (Namespace/find sym)
    ^--- No matching method find found taking 1 args
```

This has been introduced in a [recent change](clj-commons#95).
Previous versions (I checked 2.0) are usable from babashka.

This is because `Namespace/find` is not compiled in babashka (probably considered an implementation detail).
But `clojure.core/find-ns` is included and is equivalent

https://github.com/clojure/clojure/blob/38bafca9e76cd6625d8dce5fb6d16b87845c8b9d/src/clj/clojure/core.clj#L4126-L4130

This change proposes to replace `Namespace/find` with `clojure.core/find-ns`.
@nha nha requested a review from hlship as a code owner August 7, 2023 16:04
@hlship hlship added the bug label Aug 7, 2023
@hlship hlship added this to the 2.0.2 milestone Aug 7, 2023
@hlship
Copy link
Collaborator

hlship commented Aug 7, 2023

Thanks for this fix!

@hlship hlship merged commit a560215 into clj-commons:main Aug 7, 2023
@hlship hlship changed the title Keep babashka compatibility Namespace/find is not implemented by Babashka; switch to clojure.core/find-ns for compatibility Aug 7, 2023
@nha nha deleted the nha/babashka-compatibility branch August 8, 2023 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants