Skip to content

Instantly share code, notes, and snippets.

@Hendekagon Hendekagon/gta
Last active Apr 16, 2017

Embed
What would you like to do?
Cyclic tag system in Clojure
; t a list of productions, a an initial sequence
; note this halts with a NPE - it should really
; check for (empty? a) and reduced
(defn g [t a]
(reductions
(fn [[g & t] a]
(if (== 1 g) (concat t a) t))
a (cycle t)))
(take 32 (g [[0 1 1] [1 1 1]] [1]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.