From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: prj@po.cwru.edu (Paul Jarc) Newsgroups: gmane.lisp.guile.devel Subject: Re: srfi-1 circular-list Date: Fri, 19 Mar 2004 17:24:07 -0500 Organization: What did you have in mind? A short, blunt, human pyramid? Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: References: <87fzc4h4hc.fsf@zip.com.au> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1079735145 26558 80.91.224.253 (19 Mar 2004 22:25:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 19 Mar 2004 22:25:45 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Mar 19 23:25:37 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1B4SQl-0007ii-00 for ; Fri, 19 Mar 2004 23:25:37 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B4SQh-0006Cl-Ed for guile-devel@m.gmane.org; Fri, 19 Mar 2004 17:25:27 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B4SQS-0006BE-VM for guile-devel@gnu.org; Fri, 19 Mar 2004 17:25:12 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B4SPw-0005uR-Iw for guile-devel@gnu.org; Fri, 19 Mar 2004 17:25:11 -0500 Original-Received: from [129.22.104.46] (helo=mirapoint1.tis.cwru.edu) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.30) id 1B4SPv-0005tB-Sb for guile-devel@gnu.org; Fri, 19 Mar 2004 17:24:39 -0500 Original-Received: from multivac.cwru.edu (multivac.ITS.CWRU.Edu [129.22.114.26]) by mirapoint1.tis.cwru.edu (MOS 3.4.3-CR) with SMTP id AZC00750; Fri, 19 Mar 2004 17:24:07 -0500 (EST) Original-Received: (qmail 18736 invoked by uid 500); 19 Mar 2004 22:24:29 -0000 Original-To: guile-devel@gnu.org In-Reply-To: <87fzc4h4hc.fsf@zip.com.au> (Kevin Ryde's message of "Sat, 20 Mar 2004 08:11:27 +1000") Mail-Copies-To: nobody Mail-Followup-To: guile-devel@gnu.org Original-Lines: 14 User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:3533 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:3533 Kevin Ryde 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 _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel