ANN: ClojureScript 1.9.14, clojure.spec port

834 views
Skip to first unread message

David Nolen

unread,
Jun 1, 2016, 2:01:58 PM6/1/16
to clojure, clojur...@googlegroups.com
ClojureScript, the Clojure compiler that emits JavaScript source code.


Leiningen dependency information:

    [org.clojure/clojurescript "1.9.14"]

This release includes a complete and faithful port of clojure.spec to
ClojureScript. The functionality resides in the new cljs.spec
namespace. All features present in Clojure 1.9.0-alpha4 are
implemented, including REPL support, testing support and macro
checking.

As always feedback welcome.

## 1.9.14

### Enhancements
* clojure.spec ported to cljs.spec

### Fixes
* CLJS-1649: Possible issue with in cljs.reader or cljs.core/PersistentHashMap
* CLJS-1647: Rethrow exception from parallel-build
* CLJS-1642: cljs.core/reductions does not respect 'reduced'
* CLJS-1635: Var type implements IEquiv but not IHash
* CLJS-1629: Fix warning about duplicate test-pr-str
* CLJS-1637: Missing docstrings for a few vars

Walter van der Laan

unread,
Jun 1, 2016, 5:19:21 PM6/1/16
to Clojure, clojur...@googlegroups.com
It's like magic. I added some specs to cljc namespaces and it just works!

I'm making domain specific error messages with just a few lines of code. This is a huge leap forward.

Thank you, and all involved, so much.

Daniel Compton

unread,
Jun 1, 2016, 10:28:04 PM6/1/16
to clojur...@googlegroups.com, Clojure
Would it be good to change the namespace for spec from cljs.spec to clojure.spec? This will make CLJC files nicer to write as you won’t need to have reader conditionals for requiring cljs.spec in CLJS and clojure.spec in CLJ.

It seems like spec is going to be used by lots of projects, so the choices made now will affect lots of code, and be hard to change later.

More generally, what are the guidelines for deciding if a ClojureScript file gets written as cljs.* or clojure.*?

--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescrip...@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at https://groups.google.com/group/clojurescript.
--
Daniel

David Nolen

unread,
Jun 1, 2016, 10:54:59 PM6/1/16
to clojur...@googlegroups.com, Clojure
Choosing cljs.spec over clojure.spec is out of necessity not preference - Clojure has already taken the namespace and that namespace defines macros.

We are considering aliasing support for cljs.spec. That is rewriting clojure.spec vars in ClojureScript sources to cljs.spec but it will likely cover more than just cljs.spec - cljs.test, cljs.pprint etc.

David

Herwig Hochleitner

unread,
Jun 2, 2016, 12:20:04 AM6/2/16
to clojurescript
2016-06-02 4:54 GMT+02:00 David Nolen <dnolen...@gmail.com>:
We are considering aliasing support for cljs.spec. That is rewriting clojure.spec vars in ClojureScript sources to cljs.spec but it will likely cover more than just cljs.spec - cljs.test, cljs.pprint etc.

Interesting. Is this on the table as a general alternative for supporting .cljc in macros?

David Nolen

unread,
Jun 2, 2016, 7:39:25 AM6/2/16
to clojur...@googlegroups.com
No. This only about the convenience of aliasing core common namespaces that only differ by name between Clojure and ClojureScript.

David

--

Shaun LeBron

unread,
Jun 2, 2016, 9:32:17 AM6/2/16
to ClojureScript, clo...@googlegroups.com
Great stuff, thanks! I'm not familiar, but is the `clojure.spec.gen` namespace going to be ported?

Mike Fikes

unread,
Jun 2, 2016, 9:33:06 AM6/2/16
to clojur...@googlegroups.com
Hey Shaun,

It has been. It is cljs.spec.impl.gen

- Mike

Shaun LeBron

unread,
Jun 2, 2016, 9:41:04 AM6/2/16
to ClojureScript
Oops, I missed that, thanks!

Why is it under `impl`? I'd actually like to read about what the philosophy behind `impl` is since it's been turning up a lot.

David Nolen

unread,
Jun 2, 2016, 9:42:50 AM6/2/16
to clojur...@googlegroups.com
The namespace cljs.spec.gen would clash with the existing var cljs.spec/gen. The ClojureScript compiler will warn about this when it happens.

Leon Grapenthin

unread,
Jun 2, 2016, 11:05:59 AM6/2/16
to ClojureScript
Until now impl was a convention to indicate that the vars the ns is private to the library itself. I belive that the pattern became more common with core.async.

Shaun LeBron

unread,
Jun 3, 2016, 1:06:58 PM6/3/16
to ClojureScript
On Thursday, June 2, 2016 at 10:05:59 AM UTC-5, Leon Grapenthin wrote:
> Until now impl was a convention to indicate that the vars the ns is private to the library itself. I belive that the pattern became more common with core.async.

Thanks for the background context on `impl`, Leon.

Reply all
Reply to author
Forward
0 new messages