unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Stephen Compall <s11@member.fsf.org>
Cc: "Guile \(Devel\)" <guile-devel@gnu.org>
Subject: Re: make an element last element of a list
Date: 21 Oct 2003 16:42:56 +0100	[thread overview]
Message-ID: <xfyhe22bnr3.fsf@csserver.evansville.edu> (raw)
In-Reply-To: <1066748921.28107.220.camel@MARZULLO-MIS>

Laurent Marzullo <marzullo@la-defense.oilfield.slb.com> 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


  reply	other threads:[~2003-10-21 15:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-21 15:08 make an element last element of a list Laurent Marzullo
2003-10-21 15:42 ` Stephen Compall [this message]
2003-10-21 15:50 ` rm
2003-10-22 10:22   ` tomas
2003-10-22 10:40     ` rm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xfyhe22bnr3.fsf@csserver.evansville.edu \
    --to=s11@member.fsf.org \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).