|(require setup/collection-search)||package: base|
Added in version 6.3 of package base.
(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
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.