unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Marius Vollmer <mvo@zagadka.de>
Subject: Re: list versus apply
Date: Mon, 06 Jun 2005 00:11:35 +0300	[thread overview]
Message-ID: <87u0kcjypk.fsf@zagadka.de> (raw)
In-Reply-To: <87hdgck0an.fsf@zip.com.au> (Kevin Ryde's message of "Mon, 06 Jun 2005 06:37:20 +1000")

Kevin Ryde <user42@zip.com.au> writes:

> Marius Vollmer <mvo@zagadka.de> writes:
>>
>>   (define (list . args) args)
>>
>> is an acceptable definition of list.  Is it not?
>
> Yep, because args is of course a fresh list when calling a lambda, but
> it looks like primitives (C code) aren't called with a copied list
> like that.

Ahh, I see.  R5RS says: "The value stored in the binding of the last
variable will be a newly allocated list of the actual arguments..."  I
think I was confusing this with Common Lisp, which says: "The value of
a rest parameter is permitted, but not required, to share structure
with the last argument to apply."

> (I guess having primitives like that makes some sense, only a few are
> interested in modifying or re-using their input "rest" list.)

We need to document this difference between Scheme functions and C
primitives, I'd say.

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


  reply	other threads:[~2005-06-05 21:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-20 22:22 list versus apply Kevin Ryde
2005-04-22 23:45 ` Kevin Ryde
2005-06-05 17:30 ` Marius Vollmer
2005-06-05 20:37   ` Kevin Ryde
2005-06-05 21:11     ` Marius Vollmer [this message]
2005-06-05 21:21       ` Kevin Ryde

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=87u0kcjypk.fsf@zagadka.de \
    --to=mvo@zagadka.de \
    /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).