chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] do* implementation


From: Alexej Magura
Subject: [Chicken-users] do* implementation
Date: Tue, 28 Apr 2015 02:06:09 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]