[racket-dev] Release for v5.2.1 has begun

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Jan 9 12:33:52 EST 2012

At Mon, 9 Jan 2012 12:16:15 -0500, Danny Yoo wrote:
> Is there a test module whose source compiles to a use of
> inline-variant?  I'm trying to make sure Whalesong is doing the right
> thing with regards to the recent bytecode change to def-values, but
> haven't yet been able to construct a module that generates the
> appropriate inline-variant structure.

This one will have an inline-variant, since `f' is simple:

 #lang racket/base
 (provide f)
 (define (f x) x)

The `provide' isn't actually needed, but it may help with testing.

Running `raco make' followed by `raco dec' produces the following
output on my machine:

 (begin
   (module f ....
     (define-values
      (_f)
      (begin
        '%%inline-variant%%
        (#%closed
         f9
         (lambda (arg0-10)
           '#(f #<path:/private/tmp/f.rkt> 3 0 31 16 #f)
           '(flags: preserves-marks single-result)
           arg0-10))
        (#%closed
         f8
         (lambda (arg0-11)
           '#(f #<path:/private/tmp/f.rkt> 3 0 31 16 #f)
           '(flags: preserves-marks single-result)
           arg0-11))))))

If you want the variants to be different, try

 (define (f x) (f (add1 x)))



Posted on the dev mailing list.