[plt-scheme] The infamous "no #%app syntax transformer is bound" error

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Sat Jun 24 11:47:08 EDT 2006

Jens Axel Søgaard skrev:

> Now let's put this pattern in a module embodied by plambda:
> 
>  > (module plambda mzscheme
>   (provide plambda)
>   (define-syntax plambda
>     (lambda (so)
>       (syntax-case so ()
>         [(_ (id ...) b)
>          #'(lambda (stx)
>              (datum->syntax-object #'here
>                                    (syntax-case stx ()
>                                      [(_ id ...)
>                                       b])))])))
>   )

Ah! I need a require-for-template ...

(module plambda mzscheme
   (provide plambda)

   (require-for-template mzscheme)

   (define-syntax plambda
     (lambda (so)
       (syntax-case so ()
         [(_ (id ...) b)
          #'(lambda (stx)
              (datum->syntax-object #'here
                                    (syntax-case stx ()
                                      [(_ id ...)
                                       b])))])))
   )

-- 
Jens Axel Søgaard



Posted on the users mailing list.