@dfehrenbach04 more of a question for a vscode/calva forum I would think. Whatever tells it how to resolve macro definied symbols.
Thanks a bunch tony! I’ll ask over there.
@tony.kay One more thing. How do I include an s/def
into the inline >defn
?
What I’d like to write is something along the lines of:
(>defn some-penguin-function [some-large-map]
[::spec-of-that-large-map => ::spec-of-that-large-map]
(assoc some-large-map :key new-val))
@dfehrenbach04 you can say (s/keys ...)
in there, but otherwise you still need to declare it and give it a name
(via s/def
, or in 0.4.0-SNAPSHOT via gw/>def
, the latter of which will elide the def when ghostwheel is disabled, which is useful for smaller runtime builds in cljs)
Ah, Yes. Okay. So, I’ve been going at it all wrong for the last hours. My errors were coming from the fact that I failed to make my specs generator friendly (this is the first time I’m used spec). The generators were suggesting values that the specs (defined with s/def
) were then rejecting. I pointed my finger at s/def
, but that was misplaced.
For example, using numbers, instead of:
(s/def ::some-val (s/and int? #(and (>= % 0) (<= % 5)))) ; number between 0 and 5 inclusive
I needed to do:
(s/def ::some-val (s/int-in 0 6))
Not to mention this was much simpler and made it generator friendly