Skip to content

Commit

Permalink
Adding implementation for PRecurify/recurify for Do record type.
Browse files Browse the repository at this point in the history
  • Loading branch information
cfrisz committed Nov 5, 2012
1 parent c8b32d6 commit f4552e1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ctco/expr/do.clj
Expand Up @@ -3,7 +3,7 @@
;; Written by Chris Frisz
;;
;; Created 16 Apr 2012
;; Last modified 18 Oct 2012
;; Last modified 5 Nov 2012
;;
;; Defines the Do record type and operations for 'do' expressions in the
;; Clojure TCO compiler.
Expand Down Expand Up @@ -40,6 +40,12 @@
(load-tramp [this tramp]
(proto/walk-expr this #(proto/load-tramp % tramp) nil))

proto/PRecurify
(recurify [this name arity tail?]
(let [expr* (:expr* this)]
(Do. (conj (mapv #(proto/recurify % nil nil false) (butlast expr*))
(proto/recurify (last expr*) name arity tail?)))))

proto/PThunkify
(thunkify [this] (proto/walk-expr this proto/thunkify nil))

Expand Down

0 comments on commit f4552e1

Please sign in to comment.