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

defcard-rg without a name causes compilation error #150

Open
green-coder opened this issue Dec 30, 2018 · 2 comments
Open

defcard-rg without a name causes compilation error #150

green-coder opened this issue Dec 30, 2018 · 2 comments

Comments

@green-coder
Copy link

Minimal code to reproduce:

(defn hello []
  [:div "hello"])

(defcard-rg
  [hello])

;; [Figwheel:SEVERE] java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.Associative

I suspect that the problem is related to devcards.core/merge-options and macro expansion.

@green-coder green-coder changed the title defcard-rg without a name causes crash defcard-rg without a name causes compilation error Dec 30, 2018
@green-coder
Copy link
Author

I would like to propose to change the default value 'reagent-card used for the name, as it is likely that the user will use it by luck and run into unexpected behaviour - as I did.

'__reagent-card would be better.

Same remark for 'card -> '__card

@green-coder
Copy link
Author

It appears that the compilation error is happening because of the assoc at https://github.com/bhauman/devcards/blob/master/src/devcards/core.clj#L154 which is applied onto unevaluated code from devcards.core/merge-options.

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