Re: [Chicken-users] list vs dotted-list

2010-11-14 Thread Jim Pryor
On Sun, Nov 14, 2010 at 01:02:36PM -0500, John Cowan wrote: > > Conceptually, a list is type-homogeneous, > > I don't agree here: see below. > > > If you map some function that accepts either ints or bools as arguments > > over your list, then the list can be regarded as homogeneously having > >

Re: [Chicken-users] list vs dotted-list

2010-11-14 Thread John Cowan
Jim Pryor scripsit: > Lists are *a* basic functional programming structure. Yes, of course. What I meant was, "As between lists and pairs, it is lists that are the fundamental data structure." As you say, pairs are just a special case of tuples which happen to be used to implement lists in Lisp

Re: [Chicken-users] list vs dotted-list

2010-11-14 Thread Jim Pryor
On Thu, Nov 11, 2010 at 12:25:02PM -0500, John Cowan wrote: > Yi DAI scripsit: > > > 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? > > Conceptually, lists are the basic function

Re: [Chicken-users] list vs dotted-list

2010-11-11 Thread John Cowan
Yi DAI scripsit: > 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? Conceptually, lists are the basic functional programming data structure: sequential with O(n) access and shareable (

Re: [Chicken-users] list vs dotted-list

2010-11-11 Thread Ivan Shmakov
> Yi DAI writes: > 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 eas

Re: [Chicken-users] list vs dotted-list

2010-11-11 Thread Christian Kellermann
* Yi DAI [10 16:40]: > 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? Well the

[Chicken-users] list vs dotted-list

2010-11-11 Thread Yi DAI
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 procedure