6.13 API for Platform Specifications

► |  | raco: Racket Command-Line Tools

1 | raco make: Compiling Source to Bytecode
2 | raco exe: Creating Stand-Alone Executables
3 | raco distribute: Sharing Stand-Alone Executables
4 | raco planet: Automatic Package Distribution
5 | raco pkg: Package Management
6 | raco setup: Installation Management
7 | raco decompile: Decompiling Bytecode
8 | raco demod: Demodularizing Programs
9 | raco link: Library Collection Links
10 | raco pack: Packing Library Collections
11 | raco unpack: Unpacking Library Collections
12 | raco ctool: Working with C Code
13 | raco test: Run tests
14 | raco docs: Documentation Search
15 | raco expand: Macro Expansion
16 | raco read: Reading and Pretty-Printing
17 | raco scribble: Building Documentation
18 | Adding a raco Command
19 | Installation Configuration and Search Paths

▼ | 6 | raco setup: Installation Management

6.1 | Running raco setup
6.2 | Installing ".plt" Archives
6.3 | Controlling raco setup with "info.rkt" Files
6.4 | "info.rkt" File Format
6.5 | Package Dependency Checking
6.6 | API for Setup
6.7 | API for Installing ".plt" Archives
6.8 | API for Finding Installation Directories
6.9 | API for Reading "info.rkt" Files
6.10 | API for Relative Paths
6.11 | API for Collection Names
6.12 | API for Collection Searches
6.13 | API for Platform Specifications
6.14 | API for Cross-Platform Configuration
6.15 | API for Cross-References for Installed Manuals
6.16 | API for Materializing User-Specific Documentation
6.17 | Layered Installations
6.18 | Tethered Installations

On this page:

platform-spec?
matching-platform?

Racket
top contents ← prev up next →

### 6.13 API for Platform Specifications🔗ℹ

(require setup/matching-platform) | package: base

Added in version 6.0.1.13 of package base.

> procedure (platform-spec? v) → boolean?
> v : any/c

Returns #t if v is a symbol, string, or regexp value (in the sense of regexp?), #f otherwise.

> > procedure
> > (matching-platform? |  | spec |
> > | [ | #:cross? cross? |
> > |  | #:system-type sys-type |
> > |  | #:system-library-subpath sys-lib-subpath]) |
> → boolean?
> spec : platform-spec?
> cross? : any/c = #f
> | sys-type |  | : |  | (or/c #f symbol?) |  | = |  |
> (if cross?
> (cross-system-type)
> (system-type))
> | sys-lib-subpath |  | : |  | (or/c #f path-for-some-system?)
> |  |  | = |  |
> (if cross?
> (cross-system-library-subpath #f)
> (system-library-subpath #f))

Reports whether spec matches sys-type or sys-lib-subpath, where #f values for the latter are replaced with the default values.

If spec is a symbol, then the result is #t if sys-type is the same symbol, #f otherwise.

If spec is a string, then the result is #t if (path->string sys-lib-subpath) is the same string, #f otherwise.

If spec is a regexp value, then the result is #t if the regexp matches (path->string sys-lib-subpath), #f otherwise.

Changed in version 6.3 of package base: Added #:cross? argument and changed the contract on sys-lib-subpath to accept path-for-some-system? instead of just path?.

top contents ← prev up next →