Fork me on GitHub
#clojure-spec
<
2020-04-14
>
Jim Newton10:04:06

I've never used spec before. Can someone help me with a recipe ? for a given integer `n`  and a given sequence, possibly heterogeneous, whether the sequence is of the form `n` many optional integers followed by exactly `n` integers?   some analogous expression to "a?^8a^8" which I can substitute any fixed integer for 8 ?

gfredericks11:04:16

is that the same thing as "between 8 and 16 integers"?

😄 4
zane18:04:36

How common is it to use spec (specifically s/or + conform + (`case` / multimethod / …)) to define polymorphic functions, and when would / wouldn't doing so be appropriate?

Alex Miller (Clojure team)18:04:34

I have no way to judge frequency, but seems ok to me. It’s probably not the fastest option.