[racket] Using make-provide-transformer

From: Sam Vervaeck (vervaeck.sam at skynet.be)
Date: Fri Nov 23 15:55:05 EST 2012

Hi,

 

I have a question relating to syntax-transformers.

 

I'm trying to implement my own provide-syntax using
make-provide-transformer. The documentation says that it should be possible
to use syntax-local-lift-expression to dynamically insert new variables into
the module and then export them (see link below), but I really don't seem to
get it working. A somewhat trivial example:

 

(define-syntax one-two-three

  (make-provide-transformer

    (lambda (stx modes)

      (list (make-export (syntax-lift-expression #'1) 'one #f #f stx)

              (make-export (syntax-lift-expression #'2) 'two #f #f stx) 

              (make-export (syntax-lift-expression #'3) 'three #f #f
stx)))))

 

(povide (one-two-three))

 

Could you by any chance provide me with an example of how the two procedures
can be used to achieve this?

 

Greetings,

 

Sam

PS: I'm referring to paragraph two of
http://docs.racket-lang.org/reference/stxtrans.html#(tech._provide._transfor
mer) 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20121123/2676da81/attachment-0001.html>

Posted on the users mailing list.