This PR ports all Automat namespaces to ClojureScript except for automat.viz and automat.compiler.eval. Also, the test.check tests still need to be ported to ClojureScript. Fortunately, test.check now supports ClojureScript, so this shouldn't be too difficult.
A few notes:
I defined an InputStream protocol in automat.stream that is roughly equivalent to the automat.utils.InputStream Java interface. It might be nice to move the automat.utils.* Java files to automat.stream.* so that InputStream shares the same namespace in Clojure and ClojureScript.
I had to monkey patch cljs.compiler/emit-constant to be able to emit automat.fsm/IAutomaton since we want Clojure macros to be able to return precompiled automata for use from ClojureScript. This can be removed when automat.viz supports rendering precompiled automata.
It would be nice if precompiled automata were records instead of maps. This would (slightly) improve performance and convey the additional meaning that a type provides over a map. However, I ran into a bug in ClojureScript when implementing this. Records emitted from Clojure macros are read in as maps by ClojureScript. I'll put some work into diagnosing this but, as long as precompiled automata remain maps, it's not blocking the ClojureScript port.
This PR ports all Automat namespaces to ClojureScript except for
automat.viz
andautomat.compiler.eval
. Also, thetest.check
tests still need to be ported to ClojureScript. Fortunately,test.check
now supports ClojureScript, so this shouldn't be too difficult.A few notes:
InputStream
protocol inautomat.stream
that is roughly equivalent to theautomat.utils.InputStream
Java interface. It might be nice to move theautomat.utils.*
Java files toautomat.stream.*
so thatInputStream
shares the same namespace in Clojure and ClojureScript.cljs.compiler/emit-constant
to be able to emitautomat.fsm/IAutomaton
since we want Clojure macros to be able to return precompiled automata for use from ClojureScript. This can be removed whenautomat.viz
supports rendering precompiled automata.