-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
type should return something else than PersistentMap for defrecord? #492
Comments
For our use case, it would be sufficient, if we had some way, of getting to the fully-qualified class name. In Clojure this works: (ns user)
(defrecord R [foo])
(-> "bar" ->R type .getCanonicalName) ;; => "user.R" In sci: (ns user)
(defrecord R [foo])
(-> "bar" ->R meta :sci.impl/type str) ;; => "R" |
I've added a failing test in #493 but haven't been able to get it working yet. |
@mk Thanks. I'll have a look during the weekend, hopefully. |
@mk How would you tackle this for normal CLJS? |
@mk I found in clara rules how they solve this for CLJS: (ns foo)
(defrecord Foo [])
(derive Foo ::system-type)
(isa? (type (Foo.)) ::system-type) I think that could be a useful way to not rely on the specifics of the return value of |
@mk With the changes just merged to master it should now be possible to do what you want. |
In Clojure a
Class
is returned:In ClojureScript a function is returned:
I'm not sure what to return in sci, because it does not define classes like Clojure.
The text was updated successfully, but these errors were encountered: