[plt-scheme] minor glitch in Lazy Scheme?

From: Eli Barzilay (eli at barzilay.org)
Date: Sat Jan 13 13:15:29 EST 2007

On Jan 13, Robby Findler wrote:
> Note that replacing cons in that manner is also less than optimal,
> since it means that every cons has to have that contract.

I'm not sure I'm following you.  Are you saying that every cons cell
(whether generated by the `cons' function or not) must be following
the same contract?  If this is correct, then this is what I meant when
I said that it uses the fact that this

  (define (list? x)
    (or (null? x) (pair? x)))

is a valid definition of `list?' (uses the same global cons
restriction).


> It is possible to do better (but you have to take over the
> define-struct that generated cons).

Are you suggesting a bit that tells you whether this cons is a proper
list or not?  If so, wouldn't that bit be the same as adding a second
kind of cons?

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!


Posted on the users mailing list.