[plt-scheme] How to utilize the time-apply function

From: Eli Barzilay (eli at barzilay.org)
Date: Thu May 10 12:00:46 EDT 2007

On May 10, Grant Rettke wrote:
> (car (time-apply + '(1 2 3)))
> Error: context expected 1 value, received 4 values: (6) 0 0 0

(let-values ([(vals cpu real gc) (time-apply + '(1 2 3))])

> On close reading, I found that the documentation doesn't say that a
> list of values is returned, just that 4 values are returned. Perhaps
> it would be more obvious if it said "there are multiple return
> values from this function".

Saying that N values are returned is a conventional way to say that
multiple values are returned.

> Remembering that mzscheme can do multiple return values, I went back
> to this:
> http://www.cs.rice.edu/CS/PLT/packages/doc/mzscheme/node7.htm

The Rice pages are ancient!

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

Posted on the users mailing list.