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

:refer doesn't allow to override existing vars #527

Closed
mk opened this issue Feb 8, 2021 · 2 comments
Closed

:refer doesn't allow to override existing vars #527

mk opened this issue Feb 8, 2021 · 2 comments
Projects

Comments

@mk
Copy link
Collaborator

mk commented Feb 8, 2021

version
git dep at 4c920c0.

platform
OS X
problem
Screen Shot 2021-02-08 at 20 40 31

Since upgrading from 0.2.1 to 4c920c0 I noticed the following change: in 0.2.1 :refer :all would overwrite + from clojure.core, in the latest master it would not.

I've bisected and found f8f4268 as the commit that introduced the change in behavior.

repro
Evaluating

(ns test.repro)
(def + str)
(require '[test.repro :refer [+]])

followed by

(+ 1 2)

Should return "12", not 3.

@mk mk changed the title :refer :all doesn't allow to override existing vars :refer doesn't allow to override existing vars Feb 8, 2021
@borkdude borkdude added this to To do in Sci Feb 8, 2021
@borkdude
Copy link
Collaborator

borkdude commented Feb 9, 2021

Small repro:

(sci/eval-string "(defn join []) (refer 'clojure.string) (ns-name (:ns (meta #'join)))")

This should return clojure.string instead of user.

@borkdude
Copy link
Collaborator

borkdude commented Feb 9, 2021

@mk Fixed with 55b9f55

@borkdude borkdude closed this as completed Feb 9, 2021
@borkdude borkdude moved this from To do to Done in Sci Mar 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Sci
Done
Development

No branches or pull requests

2 participants