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

Improper expansion of Foo. record constructor in syntax quote #1339

Closed
frenchy64 opened this issue Aug 15, 2022 · 5 comments
Closed

Improper expansion of Foo. record constructor in syntax quote #1339

frenchy64 opened this issue Aug 15, 2022 · 5 comments

Comments

@frenchy64
Copy link

version

babashka v0.9.161

platform

Intel macOS 12.4

problem

If (defrecord Foo []) then

`Foo.

should expand to 'user.Foo., instead bb expands to just 'Foo.
repro

$ bb
Babashka v0.9.161 REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.

user=> (defrecord Foo [])
user.Foo
user=> `Foo.
Foo.

expected behavior

$ clj
Clojure 1.11.1
user=> (defrecord Foo [])
user.Foo
user=> `Foo.
user.Foo.
@borkdude
Copy link
Collaborator

Thanks! Yes, we should fix this. Did you run into a bug with this in a real program?

@borkdude borkdude mentioned this issue Aug 15, 2022
2 tasks
@frenchy64
Copy link
Author

Yes, basically this:

(defrecord Foo [])
(deftest my-test
  (is (eval `(Foo.))))

@borkdude
Copy link
Collaborator

borkdude commented Sep 4, 2022

The relevant bits in clojure.tools.reader seems to be here:

https://github.com/clojure/tools.reader/blob/master/src/main/clojure/clojure/tools/reader.clj#L653

Note that tools.reader also resolves Foo... while LispReader only resolves Foo. (one single dot).

borkdude added a commit that referenced this issue Sep 4, 2022
borkdude added a commit that referenced this issue Sep 4, 2022
borkdude added a commit that referenced this issue Sep 6, 2022
borkdude added a commit that referenced this issue Sep 6, 2022
@frenchy64
Copy link
Author

frenchy64 commented Oct 11, 2022 via email

@borkdude
Copy link
Collaborator

OK, thanks for following up. Should be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants