chicken-users
[Top][All Lists]
Advanced

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

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


From: Christian Kellermann
Subject: Re: [Chicken-users] list of more than 2 elements is pair?
Date: Mon, 10 Dec 2018 13:36:49 +0100
User-agent: Mutt/1.9.1 (2017-09-22)

* 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.

Attachment: signature.asc
Description: PGP signature


reply via email to

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