[racket] module-level definitions vs. local definitions and how binding works

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Jul 28 02:06:05 EDT 2014

The result for the local-binding case looks like a bug to me, and it
looks like the kind of bug that will take a while to fix. (I think it's
a problem with the current representation of syntax objects and the way
that module-level lexical information interacts with local-binding
information.)

Meanwhile, for the reasons discussed in the other thread, I agree that
"reader extensions not be used this way" is the operative answer, at
least for now.

At Sun, 27 Jul 2014 20:10:48 -0400, "Alexander D. Knauth" wrote:
> It seems like “hygienic reader extensions” still work when a module-level 
> definition conflicts with it, but it seems like if it’s a local binding the 
> local binding overrides the one in the reader extension.  
> 
> For example:
> #lang rackjure
> ;; this works:
> (define lambda "module-level-whatever")
> #λ(void %1) ; #<procedure>
> ;; this doesn't work
> (let ([lambda "local-whatever"]
>       [%1 void]
>       [define-syntax void]
>       [% void])
>   #λ(void %1)) ; application: not a procedure;
> ;              ;   expected a procedure that can be applied to arguments
> ;              ;   given: "local-whatever"
> ;              ;   arguments…:
> 
> Why does it work at the module-level and not within a let? 
> 
> Is this a bug, or should reader extensions not be used this way, or what?  
> 
> What’s going on here?
> 
> 
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users


Posted on the users mailing list.