www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

with-identifiers.rkt (527B)


      1 #lang racket
      2 
      3 (require syntax/parse/define
      4          racket/syntax)
      5 
      6 (provide with-formatted-ids
      7          with-derived-ids)
      8 
      9 (define-simple-macro (with-formatted-ids ([pat-id:id format base-id-stx] ...) stx-expr)
     10   (with-syntax ([pat-id
     11                  (format-id base-id-stx
     12                             format
     13                             base-id-stx)] ...)
     14     stx-expr))
     15 
     16 (define-simple-macro (with-derived-ids base-id-stx ([pat-id:id format] ...) stx-expr)
     17   (with-formatted-ids ([pat-id format base-id-stx] ...) stx-expr))