[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: srfi-1 circular-list
From: |
Paul Jarc |
Subject: |
Re: srfi-1 circular-list |
Date: |
Fri, 19 Mar 2004 17:24:07 -0500 |
User-agent: |
Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) |
Kevin Ryde <address@hidden> wrote:
> +(define (circular-list . lst)
> + (if (not (null? lst))
> + (set-cdr! (last-pair lst) lst))
> + lst)
Or, if we want to preserve the error when no elements are given:
(define (circular-list elt1 . rest)
(define lst (cons elt1 rest))
(set-cdr! (last-pair lst) lst)
lst)
paul