racket/collects/planet/version.rkt
Robby Findler fbccf38d50 completed the planet library documentation and, in the process,
cleaned up various dependencies and exports from some of the libraries
2011-07-08 15:51:05 -05:00

35 lines
931 B
Racket

#lang racket/base
(provide this-package-version
this-package-version-name
this-package-version-owner
this-package-version-maj
this-package-version-min
this-package-version-symbol
this-package-in
make-planet-symbol
package-version->symbol)
(require
"private/version.rkt"
(for-syntax
racket/base
racket/require-transform
syntax/parse
planet/syntax))
(define-syntax this-package-in
(make-require-transformer
(lambda (stx)
(define-syntax-class suffix
#:description "module suffix identifier"
(pattern (~datum main) #:attr suf #f)
(pattern suf:id))
(syntax-parse stx
[(_ s:suffix ...)
(expand-import
#`(combine-in
#,@(for/list ([src (in-list (attribute s))]
[suf (in-list (attribute s.suf))])
(make-planet-require-spec src suf))))]))))