[racket] values primitive blocks future execution

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Feb 21 17:10:21 EST 2013

At Fri, 22 Feb 2013 00:50:27 +0300, Dmitry Cherkassov wrote:
> I don't use ``pair?'' though.
> Is there a simple method to find out what function calls (or macroexpands
> to) it?

You could try the macro stepper or `raco expand' to see expanded code.
You might even resort to `raco decompile' to see more precisely the
code that runs.

The culprit might be `for' on a list without `in-list'. For example,

 (for ([i '(1 2 3)]) i)

triggers to a higher-order use of `pair?', while

 (for ([i (in-list '(1 2 3))]) i)

doesn't. Unfortunately, though, `pair?' doesn't actually show up in the
former expansion, since it comes back from `make-sequence'.

Similarly, `for' on an integer without `in-range' triggers a
higher-order use of `values' via `make-sequence'.

Posted on the users mailing list.