[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: list versus apply
From: |
Marius Vollmer |
Subject: |
Re: list versus apply |
Date: |
Mon, 06 Jun 2005 00:11:35 +0300 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Kevin Ryde <address@hidden> writes:
> Marius Vollmer <address@hidden> 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