[plt-scheme] macro keyword conflicting with other imports?

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Wed Nov 10 15:59:39 EST 2004

Export fun as a keyword that blows up when used in an improper context. 
-- Matthias


On Nov 10, 2004, at 3:34 PM, ian barland (penguin flight instructor) 
wrote:

>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>
> Hi --
> Is the following a bug?, and if not does anybody want to try to
> explain it to me?  I'm puzzled...
>
>
> (module my-macros mzscheme
>   (provide run)
>
>   ; A straightforward macro, expecting a keyword "fun":
>   ;
>   (define-syntax run
>     (syntax-rules (fun)
>       [(run fun n)
>        (format "It's fun to run ~v." n)]))
>   )
>
> (require my-macros)
> (run fun 7)    ; As expected, => "It's fun to run 7."
>
>
> ; Now, a module that happens to export an identifier "fun":
> ;
> (module some-lib mzscheme
>   (provide fun)
>   (define (fun) 'whee))
>
> (require some-lib)
> (run fun 8)    ; Unexpectedly (to me), => Error: run: bad syntax
>
>
>
> (I'm using v208.)  Thanks in advance,
> ian
>
>



Posted on the users mailing list.