clojure-spec

About: http://clojure.org/about/spec Guide: http://clojure.org/guides/spec API: https://clojure.github.io/spec.alpha/clojure.spec.alpha-api.html
Jim Newton 2020-04-14T10:00:06.104Z

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 ?

2020-04-14T11:29:16.104400Z

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

😄 1
zane 2020-04-14T18:15:36.109Z

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?

alexmiller 2020-04-14T18:31:34.110Z

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