babashka / sci

Configurable Clojure/Script interpreter suitable for scripting and Clojure DSLs
Eclipse Public License 1.0
1.21k stars 85 forks source link

Record meta+ext constructor cannot set meta #928

Open frenchy64 opened 2 weeks ago

frenchy64 commented 2 weeks ago

version

Babashka v1.3.191

platform

mac

problem

The record constructor taking a meta and ext ignores the meta.

repro

Babashka v1.3.191 REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.

user=> (defrecord A [])
user.A
user=> (meta (A. {:foo 1} nil))
nil

expected behavior

user=> (defrecord A [])
user.A
user=> (meta (A. {:foo 1} nil))
{:foo 1}
user=> (clojure-version)
"1.8.0"
borkdude commented 2 weeks ago

Never knew! Is this only with the constructor? In which real Clojure program did you discover this incompatibility?

frenchy64 commented 1 week ago

See the comment in this PR where I use a workaround https://github.com/plumatic/schema/pull/457/files