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

On this page:

collection-search
normalized-lib-module-path?

top ← prev up next →

#### 6.12`` API for Collection Searches

(require setup/collection-search) | package: base

Added in version 6.3 of package base.

> > procedure

> > (collection-search |  | mod-path |
> > | [ | #:init result |
> > |  | #:combine combine |
> > |  | #:break? break? |
> > |  | #:all-possible-roots? all-possible-roots?]) |

> → any/c
> mod-path : normalized-lib-module-path?
> result : any/c = #f

> | combine |  | : |  | (any/c (and/c path? complete-path?) . -> . any/c)
> |  |  | = |  | (lambda (r v) v)

> break? : (any/c . -> . any/c) = (lambda (r) #f)
> all-possible-roots? : any/c = #f

Generalizes collection-file-path to support folding over all possible locations of a collection-based file in the current configuration. Unlike collection-file-path, collection-search takes the file to location in module-path form, but always as a 'lib path.

Each possible path for the file (not counting a ".ss" to/from ".rkt" conversion) is provided as a second argument to the combine function, where the first argument is the current result, and the value produced by combine becomes the new result. The #:init argument provides the initial result.

The break? function short-circuits a search based on the current value. For example, it could be used to short-circuit a search after a suitable path is found.

If all-possible-roots? is #f, then combine is called only on paths within "collects"-like directories (for the current configuration) where at least a matching collection directory exists.

> > procedure

> > (normalized-lib-module-path? v) → boolean?

> v : any/c

Returns #t if v is a module path (in the sense of module-path?) of the form '(lib str) where str contains at least one slash. The collapse-module-path function produces such module paths for collection-based module references.
top ← prev up next →