[iterate-devel] if-first-iteration
hi! thanks for iterate, it's coool! :) i'm new to lisp, and while hacking i was missing if-first-iteration which is enclosed in the mail. sorry for a simple paste, but learning arch seems to be a bigger task then writing the actual feature. it was fun looking at a complex macro lib. bear with me if the code is naive, i'm way too new to lisp for patches like this. i think the clause name tells it all, feel free to include. happy coding, - attila lendvai (def-special-clause IF-FIRST-ITERATION (then &optional else) (setf then (list (walk-expr then))) (setf else (list (walk-expr else))) (let ((var (make-var-and-binding 'first-iteration t :type 'boolean))) (return-code :body (list (if else `(cond (,var ,@then) (t ,@else)) `(when ,var ,@then))) :step (list `(setf ,var nil)))))
participants (1)
-
Attila Lendvai