> (def zeros (take 10 (repeat 0)))A trivial translation follows. Since it seems that you have plenty of time available for playing with clojure and common-lisp, what about developing a library that implements clojure in common lisp?
> (map-indexed #(if (zero? (mod (inc %1) 3)) (inc %2) %2) zeros)
> --> (0 0 1 0 0 1 0 0 1 0)
(map-indexed ($(i x) (if (zerop (mod (1+ i) 3)) (1+ x) x)) zeros)
given the following definitions:
(defun map-indexed (fun list)
(defun repeat (times val)
(defparameter zeros (repeat 10 0))
(defmacro $ (vars &rest body)
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.