1.8 API for Bytecode Paths

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

▼ | 1 | raco make: Compiling Source to Bytecode

1.1 | Running raco make
1.2 | Bytecode Files
1.3 | Dependency Files
1.4 | API for Making Bytecode
1.5 | API for Parallel Builds
1.6 | Compilation Manager Hook for Syntax Transformers
1.7 | API for Simple Bytecode Creation
1.8 | API for Bytecode Paths
1.9 | Compiling to Raw Bytecode
1.10 | API for Raw Compilation
1.11 | API for Reading Compilation Dependencies

On this page:

get-compilation-dir+ name
get-compilation-dir
get-compilation-bytecode-file

top ← prev up next →

#### 1.8`` API for Bytecode Paths

(require compiler/compilation-path) | package: base

Added in version 6.0.1.10 of package base.

> > procedure
> > (get-compilation-dir+name |  | path |
> > | [ | #:modes modes |
> > |  | #:roots roots |
> > |  | #:default-root default-root]) |
> | → |  |
> path? |  | path?
> path : path-string?
> | modes |  | : |  | (non-empty-listof (and/c path-string? relative-path?))
> |  |  | = |  | (use-compiled-file-paths)
> | roots |  | : |  | (non-empty-listof (or/c path-string? 'same))
> |  |  | = |  | (current-compiled-file-roots)
> default-root : (or/c path-string? 'same) = (car roots)

Determines the directory that holds the bytecode form of path plus the base name of path.

The directory is determined by checking roots in order, and for each element of roots checking modes in order. The first such directory that contains a file whose name matches path with ".zo" added (in the sense of path-add-suffix) is reported as the return directory path. If no such file is found, the result corresponds to the first element of modes combined with default-roots.

Changed in version 7.1.0.9 of package base: Added the #:default-root argument.

> > procedure
> > (get-compilation-dir |  | path |  |  |  |
> > | [ | #:modes modes |  |  |  |
> > |  | #:roots roots |  |  |  |
> > |  | #:default-root default-root]) |  | → |  | path?
> path : path-string?
> | modes |  | : |  | (non-empty-listof (and/c path-string? relative-path?))
> |  |  | = |  | (use-compiled-file-paths)
> | roots |  | : |  | (non-empty-listof (or/c path-string? 'same))
> |  |  | = |  | (current-compiled-file-roots)
> default-root : (or/c path-string? 'same) = (car roots)

The same as get-compilation-dir+name, but returning only the first result.

Changed in version 7.1.0.9 of package base: Added the #:default-root argument.

> > procedure
> > (get-compilation-bytecode-file |  | path |
> > | [ | #:modes modes |
> > |  | #:roots roots |
> > |  | #:default-root default-root]) |
> → path?
> path : path-string?
> | modes |  | : |  | (non-empty-listof (and/c path-string? relative-path?))
> |  |  | = |  | (use-compiled-file-paths)
> | roots |  | : |  | (non-empty-listof (or/c path-string? 'same))
> |  |  | = |  | (current-compiled-file-roots)
> default-root : (or/c path-string? 'same) = (car roots)

The same as get-compilation-dir+name, but combines the results and adds a ".zo" suffix to arrive at a bytecode file path.

Changed in version 7.1.0.9 of package base: Added the #:default-root argument.

top ← prev up next →