From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stephen Compall Newsgroups: gmane.lisp.guile.devel Subject: Re: make an element last element of a list Date: 21 Oct 2003 16:42:56 +0100 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: 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 1066751800 19856 80.91.224.253 (21 Oct 2003 15:56:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 21 Oct 2003 15:56:40 +0000 (UTC) Cc: "Guile \(Devel\)" Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Oct 21 17:56:35 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 1ABys7-0005kw-00 for ; Tue, 21 Oct 2003 17:56:35 +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 1ABypA-0005En-Q3 for guile-devel@m.gmane.org; Tue, 21 Oct 2003 11:53:32 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1ABykM-0003Vq-Rv for guile-devel@gnu.org; Tue, 21 Oct 2003 11:48:34 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AByjg-0003Gt-Iq for guile-devel@gnu.org; Tue, 21 Oct 2003 11:48:23 -0400 Original-Received: from [192.195.228.35] (helo=csserver.evansville.edu) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1AByjf-0003G3-RP for guile-devel@gnu.org; Tue, 21 Oct 2003 11:47:51 -0400 Original-Received: from csserver.evansville.edu (localhost.localdomain [127.0.0.1]) by csserver.evansville.edu (8.12.8/8.12.8) with ESMTP id h9LFguBT030931; Tue, 21 Oct 2003 10:42:56 -0500 Original-Received: (from sc87@localhost) by csserver.evansville.edu (8.12.8/8.12.8/Submit) id h9LFgu6C030927; Tue, 21 Oct 2003 16:42:56 +0100 X-Authentication-Warning: csserver.evansville.edu: sc87 set sender to s11@member.fsf.org using -f Original-To: Laurent Marzullo In-Reply-To: <1066748921.28107.220.camel@MARZULLO-MIS> Original-Lines: 33 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 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:2914 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2914 Laurent Marzullo writes: > 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. > > 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 ? #ifdef HUMBLE_OPINION Maybe you don't want to hear this, but how are you building the list? If you must have access to the list in the order in which you seem to be working on it above *before* you add elements to the list, then you ought to keep track of the last cell, as well as scm_game_list. If you are building the list first, then using it, but still need the order, then it would be best to cons new elements onto the front, then use scm_reverse_x (saving the return value). If you don't care about the order at all, just cons new items onto the beginning. #endif -- Stephen Compall or s11 or sirian I'm not proud. asset Freeh TELINT ANC Baranyi MD4 Lon Horiuchi cryptanalysis PGP bomb LLNL quiche halcon SRI colonel _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel