Hi - 

I'd like to create a new provide syntax that essentially turns this:

  (provide (my-out name))

into this:

  (provide name make-name)

where 'name' and 'make-name' are defined in the surrounding context. It looks 
like define-provide-syntax isn't up to the task, so I used 
'make-provide-transformer' directly, like so:

(define-syntax my-out
  (make-provide-transformer
   (lambda (stx modes)
     (syntax-parse stx
       ((_ name:id)
        (let ([nt #'name]
              [c (format-id #'name "make-~a" (syntax-e #'name))])
          (list (make-export nt (syntax-e nt) 0 #f nt)
                (make-export c (syntax-e c) 0 #f c)
                                )))))))


Is there a more concise way of doing this?

Thanks,
Dan

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to