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

Re: [Scheme-reports] Multiple values

50 minutes ago, John Cowan wrote:
> Eli Barzilay scripsit:
> > And BTW, as long as I gave the above example, and was dragged to
> > quote the relevant part of R5RS, I can just as well continue the
> > quote:
> >
> >   Except for continuations created by the call-with-values
> >   procedure, all continuations take exactly one value.
> >
> > and it should be clear now why Chibi's implementation is just
> > plain broken:
> You know that is not true.  How dare you say such a thing?

I gave the code that needs to work according to r5rs:

  > (define (v . xs)
      (call-with-current-continuation (lambda (k) (apply k xs))))
  > (call-with-values (lambda () (v 1 2 3)) list)
  ERROR on line 64 of file ./lib/init.scm: too many args
      #<procedure #f>

Furthermore, R5RS explicitly says:

  `values' might be defined as follows:

  (define (values . things)
      (lambda (cont) (apply cont things))))

but that doesn't work in Chibi either.

> > If you want to get pickier, then all implementations that don't barf
> > at
> >
> >   (list 1 (values 2 3 4) 5)
> >
> > are broken because according to R5RS:
> >
> >   (values obj ...)
> >
> >   Delivers all of its arguments to its continuation.  Except for
> >   continuations created by the call-with-values procedure, all
> >   continuations take exactly one value.
> If R5RS said "Except for [...], all continuations must signal an
> error if they do not receive exactly one value", then you'd be
> right.  It doesn't and you aren't.

So the question is what happens when, for example, a continuation that
takes two values is used with one value, and the lack of an explicit
"signal an error"...

> I suppose next you will inform me that (car #f) and (cons 1 2 3) are
> also compelled to signal errors?

...not by that language, but yes, I would consider a scheme that
doesn't to be broken...

> > | Chibi's use cases just aren't anything like Racket's.
> >
> > was just irrelevant nonsense,
> You are entitled to consider it irrelevant to your concerns.

...and I would consider such implementations broken regardless of what
racket does, and more than that, how regardless of how close their use
cases are to Racket's.

> > (And yes, "Ultimately, if you want R6RS, you know where to find it."
> > is wrong too, but who's counting?)
> And I'm done with you.  It's a pity, because I've learned things
> from you, but you are going out of your way to make yourself
> offensive, and I see no reason to stand for it.

I'm getting out of my way to point something that should be considered
broken.  I don't consider that offensive.  It's a pity that you do.

> I adopt this harsh and public mode of denunciation to make my
> intentions unmistakably clear.
> *plonk*

And that's a fine example for how r7rs goes so far.

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

Scheme-reports mailing list