[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] list of more than 2 elements is pair?

From: Paul Sika
Subject: Re: [Chicken-users] list of more than 2 elements is pair?
Date: Mon, 10 Dec 2018 12:48:06 +0000

Thank you, Christian.

On Mon, Dec 10, 2018 at 12:36 PM Christian Kellermann <address@hidden> wrote:
* Paul Sika <address@hidden> [181210 13:27]:
> hi Thomas,
> thank you very much. it is indeed clear from your explanation. it is about
> the cons cells.
> But i must say that at the back of the mind it feels like it should not
> satisfy pair? because there are 3 elements in the list.

Well, it satisfies pair? since the first cell *is* a pair. The cdr
of the pair just points to another pair...

pair? makes a nice check for recursive procedures as the empty list
is not a pair: (pair? '()) -> #f

This avoids checking for list? and null?

May you be peaceful, may you live in safety, may you be free from
suffering, and may you live with ease.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]