[plt-scheme] define-literal-set errors

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Fri Sep 25 14:45:22 EDT 2009

One day Matthew will revise PLT so that we can do these kind of  
experiments (and this kind of programming) in one file. For now, you  
have to split these 'things' into separate files so that the phases  
work out. -- Matthias






On Sep 25, 2009, at 2:33 PM, Neil Toronto wrote:

> Version 4.2.1.8-svn14sep2009
>
> First error:
>
> (require (for-syntax syntax/parse))
> (define-literal-set bars (bar))
> ; expand: unbound identifier in module in: define-literal-set
>
>
> Fix:
>
> (require syntax/parse)
> (define-literal-set bars (bar))
>
>
> But I have to (require (for-syntax syntax/parse)) because I'm using  
> it within define-syntax. Is it typical to have to require a module  
> for-syntax and not for-syntax?
>
>
> Second error:
>
> (require syntax/parse
>         (for-syntax syntax/parse))
>
> (define-literal-set bars (bar))
>
> (syntax-parse #'bar #:literal-sets (bars)
>  [bar  #'0]
>  [x    #'1])
> ; = #'0
>
> (define-syntax (foo stx)
>  (syntax-parse stx #:literal-sets (bars)
>    [(_ bar)  #'0]
>    [(_ x)    #'1]))
> ; syntax-parse: expected identifier defined as a literal-set in: bars
>
>
> If I comment out the definition of (foo stx), the macro stepper says  
> that "bars" is unbound in the transformer phase. I'm fairly sure  
> this is not my error. In the meantime, is there a way to copy the  
> definition of "bars" into the transformer phase?
>
> Is the problem that the people making the library aren't using it  
> like they intend other people to use it? Or am I using it wrong? I  
> *could* make a separate module where my macros are all defined in  
> the standard phase and require it for-syntax, but I'd rather keep  
> one-off experiments like the one I'm doing in a single file.
>
> Neil
> _________________________________________________
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.