chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] list vs dotted-list


From: Yi DAI
Subject: [Chicken-users] list vs dotted-list
Date: Thu, 11 Nov 2010 16:39:51 +0100

Hi,


On a recent consideration of the design of Scheme, a question comes to my mind:

Why do we have both list and dotted-list, given that the former is just a special case (terminated by nil) of the latter? Can we simply live with the latter? I see it is fairly easy to write common list procedures, like `length', `map', `append' etc that could handle dotted-list very well, with the predicate `pair?'. Is there some special consideration for the 'terminating a list by nil' convention? (I see one maybe from the recursive data structure view, but it does not convince me.) If 'terminating a list by nil' is considered good, can we live without `dot', having `cons' build a true list (conforming to the definition of list in recursive data structure)? In other words, is it a good idea to have everything be a list or dotted-list?


--
DAI Yi
(代 毅)

reply via email to

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