Re: Hints on recursion
- From: "Geoffrey Summerhayes" <sumrnot@xxxxxxxxxxx>
- Date: 29 Nov 2005 12:21:41 -0800
matteo d'addio 81 wrote:
>Pascal Bourguignon ha scritto:
>>
>> For (twice 'e '(e . rest)) = (once 'e . rest)
>> and (once 'e '(e . rest)) = (none 'e . rest)
>
> Hi, I'm a CL beginner too.
>
>> (once 'e . rest)
> ^
> What this point stand for?
Prolog [Head | Tail], [A, B | Tail]
Lisp (car . cdr), (first second . rest)
A list, e.g. '(1 2 3), is essentially shorthand for the dotted
equivalent,
in this case: '(1 . (2 . (3 . nil)))
So if we substitute a list, for example '(g h i), for rest into
Pascal's
(twice 'e '(e . rest)) = (once 'e . rest)
we get
(twice 'e '(e g h i)) = (once 'e '(g h i))
See http://www.lispworks.com/documentation/HyperSpec/Body/02_da.htm
--
Geoff
.
- Follow-Ups:
- Re: Hints on recursion
- From: matteo d'addio 81
- Re: Hints on recursion
- References:
- Hints on recursion
- From: zion_zii
- Re: Hints on recursion
- From: Pascal Bourguignon
- Re: Hints on recursion
- From: matteo d'addio 81
- Hints on recursion
- Prev by Date: Re: FORMAT ~<...~:@> PUZZLE
- Next by Date: Re: OT to the extreme
- Previous by thread: Re: Hints on recursion
- Next by thread: Re: Hints on recursion
- Index(es):
Relevant Pages
|