▼ |  | Unstable

1 | Guidelines for developing unstable libraries
2 | Bytes
3 | Classes and Objects
4 | Contracts
5 | Definitions
6 | Dictionaries
7 | Directories
8 | Exceptions
9 | Filesystem
10 | Functions
11 | Lists
12 | Net
13 | Path
14 | PLane T Packages
15 | Ports
16 | Pretty-Printing
17 | Regular Expressions
18 | Requiring Modules
19 | Sandboxed Evaluation
20 | Scribble Documentation
21 | Sets
22 | S-Expression Diff
23 | Source Locations
24 | Strings
25 | Structs
26 | Syntax
27 | Planet Package Macros
28 | Text Representations
29 | Multiple Values
30 | XML and CSS
31 | Polymorphic Contracts
32 | Finding Mutated Variables
33 | Find
34 | Interface-Oriented Programming for Classes
35 | Sequences
36 | Hash Tables
37 | Match
38 | Generics
39 | Mark Parameters
40 | Debugging
41 | Contracts for macro subexpressions
42 | Contracts for struct type properties
43 | GUI libraries

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.2
top ← prev up next →

### 27`` 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)>

top ← prev up next →