well (rnrs mutable-pairs) already is some separate library for
constructing lists out of mutable cells...

On Tue, May 19, 2009 at 12:34 PM, Eduardo Cavazos
<[email protected]> wrote:
> Hello,
>
> Here's a simple demonstration of how to achive a "trails" effect in demo
> code:
>
>    http://github.com/dharmatech/agave/raw/master/demos/trails.scm
>
> It's the coolest application of circular lists I've seen. :-) I'm using a
> circular list as circular queue. Perhaps I should use a macro like this:
>
> (define-syntax enqueue-circular
>
>  (syntax-rules ()
>
>    ( (enqueue-circular lis elt)
>
>      (begin
>
>        (set-car! lis elt)
>
>        (set! lis (cdr lis))) )))
>
> Then again, I'm having to pull in the (rnrs mutable-pairs) library;
> Moreover, I've heard talk of perhaps eventually moving away from mutable
> pairs in Scheme. I wonder what the idiomatic approach to my circular queue
> would be in that case? I guess there'd be some separate library for
> constructing lists made out of mutable cells?
>
> Ed
>

Reply via email to