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

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Feb 4 23:00:31 EST 2014

I've finally tracked down this bug in the macro expander and pushed a
repair. Thanks for the (extra) example!

At Tue, 4 Feb 2014 17:57:06 +0100, Jens Axel Søgaard wrote:
> Hi,
> 
> Ah! Okay, with (all-from-out "def.rkt") my example works in racket.
> 
> In DrRacket I get:
> 
>     racket/collects/compiler/cm.rkt:430:6: write: unsealed
> local-definition or module
>     context found in syntax object
> 
> /Jens Axel
> 
> 
> 2014-02-04 Ryan Culpepper <ryanc at ccs.neu.edu>:
> > 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
> >
> 
> 
> 
> -- 
> --
> Jens Axel Søgaard
> 
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users


Posted on the users mailing list.