30 ms·
At the moment, most of the things that are spec'ed in the box are the gnarly macro "languages" like destructuring, defn, ns, etc. These spec'ed macros do catch
by puredanger 9y ago
At the moment, most of the things that are spec'ed in the box are the gnarly macro "languages" like destructuring, defn, ns, etc. These spec'ed macros do catch a far more complete set of error messages than the macro did with custom error handling. However, those error messages are in many case more challenging to read than before. This is an area of ongoing research - the reasons for the complexity are varied. In general, specs for core functions are much simpler and provide much better errors, but we have not focused on adding those yet. This is why some of this stuff is still alpha!
- misterbowfinger 9y agoDo you have an idea of how far along clojure.spec is for a stable, non-alpha/beta release? clojure.spec is by far the most interesting and compelling reason for me to check out Clojure. I would also love for it to apply to ClojureScript as well, although I understand that's a separate project.
- simongray 9y agoSpec is also available for ClojueScript: http://cljs.github.io/api/cljs.spec.alpha/ http://cljs.github.io/api/cljs.spec.alpha/
- puredanger 9y agoYou should try it now - the API has been out and stable for over a year. While it may change slightly, there is no reason not to use it now. https://clojure.org/guides/spec https://clojure.org/guides/spec The ClojureScript version of spec is largely API-compatible as well so the same specs should work in both.