[<<][staapl][>>][..]
Thu Apr 30 10:24:31 CEST 2009

levels again..


When I require the module, the rpn-syntax-rule form works, but the
prefix-parsers rule doesn't work.

(define-syntax-rule
  (rpn-syntax-rules (literal ...)
                    ((pattern ...) (template ...)) ...)
  (make-rpn-transformer
   (lambda (w d k)
     (syntax-case w (literal ...)
       ((pattern ... . w+)
        (k (syntax->list #`(template ... . w+))
           d))
       ...))))

(define-syntax-rule (prefix-parsers namespace ((name arg ...) template) ...)
  (ns namespace
      (define-syntaxes (name ...)
        (values (rpn-syntax-rules () ((_ arg ...) template)) ...))))

This is because it is used at compile time.  So 'rpn-syntax-rule will
probably need to be defined in parser-tx.ss

In addittion, the file that defines prefix-parsers needs to (require
(for-syntax "parse-tx.ss"))




[Reply][About]
[<<][staapl][>>][..]