[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Dotted pair call argument
From: |
David Kastrup |
Subject: |
Re: Dotted pair call argument |
Date: |
Tue, 21 Feb 2012 16:59:18 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) |
Mark H Weaver <address@hidden> writes:
> David Kastrup <address@hidden> writes:
>> I guess my "real" problem is that I'd like to do call wrapping by writing
>>
>> (lambda ( . x) (fun . x))
>>
>> instead of having to write
>>
>> (lambda ( . x) (apply fun x))
>>
>> I assume eval is not supposed to try dealing with dotted lists?
>
> The problem is that (f . (g x y)) is equivalent to (f g x y).
> Therefore, while Scheme could in theory support procedure calls with a
> dotted tail that happened to be an atom, it would do something rather
> different and confusing if the dotted tail was itself a procedure/macro
> call.
A list in dotted tail position is evaluated via (map ... eval) rather
than (eval ...). I don't see much of a problem with that.
It works fine for () as one can see:
guile> (+ . ())
0
guile>
So why not for others?
--
David Kastrup
- Dotted pair call argument, David Kastrup, 2012/02/21
- Re: Dotted pair call argument, Mark H Weaver, 2012/02/21
- Re: Dotted pair call argument,
David Kastrup <=
- Re: Dotted pair call argument, David Kastrup, 2012/02/21
- Re: Dotted pair call argument, Mark H Weaver, 2012/02/21
- Re: Dotted pair call argument, David Kastrup, 2012/02/21
- Re: Dotted pair call argument, Mark H Weaver, 2012/02/21
- Re: Dotted pair call argument, David Kastrup, 2012/02/22
- Re: Dotted pair call argument, Neil Jerram, 2012/02/21