[racket] Using make-provide-transformer

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Sat Nov 24 20:20:31 EST 2012

Sam,

The paragraph about syntax-local-lift-expression is referring to provide
_pre_-transformers, not normal provide transformers.  You need to use
make-provide-pre-transformer, not make-provide-transformer.

--Carl

Carl Eastlund


On Fri, Nov 23, 2012 at 3:55 PM, Sam Vervaeck <vervaeck.sam at skynet.be>wrote:

> 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._transformer)
> ****
>
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20121124/ae97b585/attachment.html>

Posted on the users mailing list.