6.4 "info.rkt" File Format

► |  | 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

top ← prev up next →

#### 6.4`` "info.rkt" File Format

#lang info | package: base
#lang setup/infotab

In each collection, a special module file "info.rkt" provides general information about a collection for use by various tools. For example, an "info.rkt" file specifies how to build the documentation for a collection, and it lists plug-in tools for DrRacket or commands for raco that the collection provides.

> > > The fields specified in an "info.rkt" file are documented in Package Metadata for packages and in Controlling raco setup with "info.rkt" Files for collections.

Although an "info.rkt" file contains a module declaration, the declaration has a highly constrained form. It must match the following grammar of info-module:

info-module |  | = |  |
(module info info-mod-path
decl
...)
info-mod-path |  | = |  | info
|  | | |  | setup/infotab
|  | | |  | (lib "info/main.rkt")
|  | | |  | (lib "setup/infotab.ss")
|  | | |  | (lib "setup/infotab.rkt")
|  | | |  | (lib "main.rkt" "info")
|  | | |  | (lib "infotab.rkt" "setup")
|  | | |  | (lib "infotab.ss" "setup")
decl |  | = |  | (define id info-expr)
info-expr |  | = |  | (quote datum)
|  | | |  | (quasiquote datum)
|  | | |  | (if info-expr info-expr info-expr)
|  | | |  | (info-primitive info-expr ...)
|  | | |  | id
|  | | |  | string
|  | | |  | number
|  | | |  | boolean
info-primitive |  | = |  | cons
|  | | |  | car
|  | | |  | cdr
|  | | |  | list
|  | | |  | list*
|  | | |  | reverse
|  | | |  | append
|  | | |  | equal?
|  | | |  | string-append
|  | | |  | make-immutable-hash
|  | | |  | hash
|  | | |  | hash-set
|  | | |  | hash-set*
|  | | |  | hash-remove
|  | | |  | hash-clear
|  | | |  | hash-update
|  | | |  | path->string
|  | | |  | build-path
|  | | |  | collection-path
|  | | |  | system-library-subpath
|  | | |  | getenv

For example, the following declaration could be the "info.rkt" library of the "games" collection. It contains definitions for three info tags, name, gracket-launcher-libraries, and gracket-launcher-names.

> #lang info
> (define name "Games")
> (define gracket-launcher-libraries '("main.rkt"))
> (define gracket-launcher-names '("PLT Games"))

As illustrated in this example, an "info.rkt" file can use #lang notation, but only with the info (or setup/infotab) language.

Although getenv is allowed in an info module, the get-info function loads the module with an environment that prunes any variable not listed in the PLT_INFO_ALLOW_VARS environment variable, which holds a list of ;-separated variable names. By default, the set of allowed environment variables is empty.

See also get-info from setup/getinfo.

Changed in version 6.5.0.2 of package base: Added if, equal?, and getenv.

top ← prev up next →