farrellm / scad-clj

OpenSCAD DSL in Clojure

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use with spec

veikman opened this issue · comments

Over in scad-app I’ve run into the problem of how to recognize the intermediate products of scad-clj by their type. I’m currently using seq?. I would like to expand on this. For example, I would like to create Clojure functions that work interchangeably with shapes like (cube 1 2 3) and raw Cartesian coordinates like [0 0], adding translations/transformations to the former while directly replacing the latter using this stuff behind a (spec/conform ...). In general, I would like to be able to use spec/valid? for sanity checks and annotations in all sorts of places as I build upon scad-clj.

Should I be using something other than seq? as a predicate to test for intermediates? Would it be possible to guarantee a more specific spec-able format for all intermediates, or is this considered an unstable implementation detail pending #37?