clojure.repl/source chokes when reading code with ::auto/resolved keys
Description
Environment
None
Activity
Show:

Michiel Borkent May 6, 2024 at 12:10 PMEdited
Note that the “possible” solution needs a little change as reading this will fail:
as both aliases resolve to ignored
and this will result in duplicate keys.

Michiel Borkent December 24, 2020 at 9:46 PMEdited
Another small issue:
source-fn could probably also skip some columns (this information is also available on the var), so it can parse the source for bar in:
Executing (source bar) will print the source for foo right now.
Details
Details
Assignee
Unassigned
UnassignedReporter

Priority
Created June 13, 2018 at 3:28 AM
Updated May 6, 2024 at 6:06 PM
Reproduction
foo.clj
repl
Problem analysis
source
callsread
, without any underlying binding or notion ofCompiler.currentNS()
, which causes aliased keywords to fail to resolve.Possible solution
Bind *reader-resolver* to the following before reading:
Aside, the logic inside
source-fn
can be simplified withread+string
, modulo CLJ-2358