From: Ivan Shmakov <address@hidden>
Subject: Re: [Chicken-users] list vs dotted-list
To: address@hidden
Unfortunately, we can't distinguish a two element dotted list,
whose second element is, in turn, a dotted list, from a three
(or more) element dotted list.
Thanks for showing me the flat world of dotted pair, ;)
> 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?
We can't spare CONS for LIST, either, as it makes impossible to
build lists step by step. There's a fundamental difference in
these constructs:
I did not mean to somehow make it //impossible// to build a list step by step, in contract, I mean use `cons' for the //sole// purpose of building a list step by step. In other words, give the type obj -> list(obj) -> list(obj) to `cons', and eliminate the possibility of using it to build a dotted pair from the beginning. Because whenever I write a function intended to handle a list, I foresee the disaster caused by passing a dotted-list to it on purpose or not by a user. Thus my question is, if we do so, will we lose something cute of Scheme?