On this page:
syntax-source-planet-package
syntax-source-planet-package-owner
syntax-source-planet-package-name
syntax-source-planet-package-major
syntax-source-planet-package-minor
syntax-source-planet-package-symbol
make-planet-path
Version: 5.0.1

28 Planet Package Macros

Carl Eastlund <cce@racket-lang.org>

 (require unstable/planet-syntax)

This library is unstable; compatibility will not be maintained. See Unstable for more information.

(syntax-source-planet-package stx)
  
(or/c (list/c string?
              string?
              exact-nonnegative-integer?
              exact-nonnegative-integer?)
       #f)
  stx : syntax?
(syntax-source-planet-package-owner stx)  (or/c string? #f)
  stx : syntax?
(syntax-source-planet-package-name stx)  (or/c string? #f)
  stx : syntax?
(syntax-source-planet-package-major stx)
  (or/c exact-nonnegative-integer? #f)
  stx : syntax?
(syntax-source-planet-package-minor stx)
  (or/c exact-nonnegative-integer? #f)
  stx : syntax?
(syntax-source-planet-package-symbol stx    
  [text])  (or/c symbol? #f)
  stx : syntax?
  text : (or/c text? #f) = #f
These functions extract the planet package with which stx is associated, if any, based on its source location information and the currently installed set of planet packages. They produce, respectively, the planet package s-expression, its owner, name, major version number, minor version number, or a symbol corresponding to a planet module path. They each produce #f if stx is not associated with a planet package.

Examples:

  (define loc
    (list (build-path (current-directory) "file.ss")
          #f #f #f #f))
  (define stx (datum->syntax #f 'stx loc))
  > (syntax-source-planet-package stx)

  #f

  > (syntax-source-planet-package-owner stx)

  #f

  > (syntax-source-planet-package-name stx)

  #f

  > (syntax-source-planet-package-major stx)

  #f

  > (syntax-source-planet-package-minor stx)

  #f

  > (syntax-source-planet-package-symbol stx)

  #f

  > (syntax-source-planet-package-symbol stx "there")

  #f

(make-planet-path stx id)  syntax?
  stx : syntax?
  id : (or/c identifier? #f)
Constructs a syntax object representing a require spec for the planet package from which stx arises, with suffix id (if any).

Examples:

  (define loc
    (list (build-path (current-directory) "file.ss")
          #f #f #f #f))
  (define stx (datum->syntax #f 'stx loc))
  > (make-planet-path stx #f)

  #<syntax (planet #f)>

  > (make-planet-path stx #'there)

  #<syntax:5:0 (planet #f)>