From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: rm@fabula.de Newsgroups: gmane.lisp.guile.devel Subject: Re: make an element last element of a list Date: Tue, 21 Oct 2003 17:50:09 +0200 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <20031021155009.GC18423@www> References: <1066748921.28107.220.camel@MARZULLO-MIS> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1066751752 19759 80.91.224.253 (21 Oct 2003 15:55:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 21 Oct 2003 15:55:52 +0000 (UTC) Cc: "Guile \(Devel\)" Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Oct 21 17:55:50 2003 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 1AByrO-0005hQ-00 for ; Tue, 21 Oct 2003 17:55:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AByoh-0004sA-8X for guile-devel@m.gmane.org; Tue, 21 Oct 2003 11:53:03 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AByo8-0004qg-Fp for guile-devel@gnu.org; Tue, 21 Oct 2003 11:52:28 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1ABynS-0004cE-42 for guile-devel@gnu.org; Tue, 21 Oct 2003 11:52:17 -0400 Original-Received: from [217.22.192.104] (helo=www.elogos.de) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ABym2-00044T-1G for guile-devel@gnu.org; Tue, 21 Oct 2003 11:50:18 -0400 Original-Received: by www.elogos.de (Postfix, from userid 5001) id C52E614078; Tue, 21 Oct 2003 17:50:09 +0200 (CEST) Original-To: Laurent Marzullo Content-Disposition: inline In-Reply-To: <1066748921.28107.220.camel@MARZULLO-MIS> User-Agent: Mutt/1.5.3i X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.2 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:2913 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2913 On Tue, Oct 21, 2003 at 05:08:42PM +0200, Laurent Marzullo wrote: > Hello all, > > I've got a scheme list > > SCM scm_game_list; > > and I want to add, with C API, an elements at the end of > the list. If you want to destrutively modify your list you can do the following: (define my-lst (list 1 2 3 4)) (define new-last (list 5)) (set-cdr! (last my-lst) new-last) using the c functions SCM new_last = scm_cons( new_elem , SCM_EOL ); scm_set_cdr_x ( scm_last_pair (my_lst), new_last ); HTH Ralf Mattes > Is there any function to do this or must I go throw the entire > list and adding a new scm_cons( new_elem , SCM_EOL ) at the end ? > > Thanks > -- > Laurent Marzullo > > > > _______________________________________________ > Guile-devel mailing list > Guile-devel@gnu.org > http://mail.gnu.org/mailman/listinfo/guile-devel _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel