[racket] make-rename-transformer and all-defined-out

From: Ryan Culpepper (ryanc at ccs.neu.edu)
Date: Tue Feb 4 11:50:17 EST 2014

On 02/04/2014 11:45 AM, Jens Axel Søgaard wrote:
> Hi All,
>
> I have attempted to define a shorthand for define like this:
>
>      (define-syntax def  (make-rename-transformer #'define))
>
> For most purposes it seems to work, but I have problems with all-defined-out.
>
> soegaard$ cat def.rkt
> #lang racket
> (provide (all-defined-out) def)
> (define-syntax def  (make-rename-transformer #'define))
>
> soegaard$ cat bug.rkt
> #lang racket
> (require "def.rkt")
> (provide (all-defined-out))
>
> soegaard$ ~/racket-jan-30/racket/racket/bin/racket
> Welcome to Racket v6.0.0.1.
>> (require "bug.rkt")
>> (def x 42)
> def: undefined;
>   cannot reference undefined identifier
>    context...:
>     /Users/soegaard/racket-jan-30/racket/racket/collects/racket/private/misc.rkt:87:7
>
> Am I misusing make-rename-transformer or is this supposed to work?

In bug.rkt: (all-defined-out) only includes names defined in that 
module. You probably want (all-from-out "def.rkt") instead.

Ryan



Posted on the users mailing list.