Common Lisp has a uhh.. recursive(?) version of /do/ that defines its variables in a manner similar to /let*/, in the sense that they're defined sequentially: later variables can refer to those previous.

Example:

(do* ((a '(1 2 3 4 5) (cdr a))
      (b (car a) (car a)))
     ((eq '() a))
     (print b))
; 1
; 2
; 3
; 4
; 5

Is there an egg that provides /do* /or does anyone have an implementation that they could share?

I thought about writing my own, but I'm a bit rusty with scheme atm and I couldn't figure out where /do/ is defined in Chicken's source code, so I don't think I'd be able to implement it efficiently.
_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to