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

Records produced by data readers are returned as maps #386

Closed
borkdude opened this issue Aug 24, 2020 · 0 comments
Closed

Records produced by data readers are returned as maps #386

borkdude opened this issue Aug 24, 2020 · 0 comments

Comments

@borkdude
Copy link
Collaborator

Repro:

(defrecord Error [type message])
cljs.user=> (type (sci/eval-string "#example.Error{:type \"SomeError\", :message \"A Message\"}" {:readers {'example.Error map->Error}}))
cljs.core/PersistentArrayMap

I think the problem is similar to this:

user=> (set! *data-readers* {'foo (fn [_] '(+ 1 2 3))})
{foo #object[user$eval1$fn__137 0x51ec2df1 "user$eval1$fn__137@51ec2df1"]}
user=> #foo []

Sci evaluates objects returned from data readers, which it should, but records are probably evaluated and re-constructed as hash-maps. So maybe we should not do that for records.

cc @mauricioszabo

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

1 participant