{"size": 1868, "ext": "scrbl", "max_stars_repo_path": "pkgs/racket-doc/syntax/scribblings/modresolve.scrbl", "max_stars_repo_name": "lkh01/racket", "max_stars_repo_stars_event_min_datetime": "2018-07-05T21:18:24.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-04T14:48:37.000Z", "max_issues_repo_path": "pkgs/racket-doc/syntax/scribblings/modresolve.scrbl", "max_issues_repo_name": "lkh01/racket", "max_issues_repo_issues_event_min_datetime": "2017-05-10T07:33:20.000Z", "max_issues_repo_issues_event_max_datetime": "2018-07-19T15:49:46.000Z", "max_forks_repo_path": "pkgs/racket-doc/syntax/scribblings/modresolve.scrbl", "max_forks_repo_name": "lkh01/racket", "max_forks_repo_forks_event_min_datetime": "2016-04-25T11:47:57.000Z", "max_forks_repo_forks_event_max_datetime": "2017-05-09T14:52:48.000Z"}
{"max_stars_count": 4, "max_issues_count": 9, "max_forks_count": 3, "avg_line_length": 38.9166666667, "max_line_length": 87, "alphanum_fraction": 0.6359743041}
#lang scribble/doc
@(require "common.rkt" scribble/eval
          (for-label syntax/modresolve))

@(define (new-evaluator)
   (let* ([e (make-base-eval)])
     (e '(require (for-syntax racket/base) syntax/modresolve))
     e))

@(define evaluator (new-evaluator))

@title{Resolving Module Paths to File Paths}

@defmodule[syntax/modresolve]

@defproc[(resolve-module-path [module-path-v module-path?] 
                              [rel-to-path-v (or/c #f path-string? (-> any)) #f])
         (or/c path? symbol?
               (cons/c 'submod (cons/c (or/c path? symbol?) (listof symbol?))))]{

Resolves a module path to filename path. The module path is resolved
relative to @racket[rel-to-path-v] if it is a path string (assumed to
be for a file), to the directory result of calling the thunk if it is
a thunk, or to the current directory otherwise.}

@defproc[(resolve-module-path-index [module-path-index module-path-index?] 
                                    [rel-to-path-v (or/c #f path-string? (-> any)) #f])
         (or/c path? symbol?
               (cons/c 'submod (cons/c (or/c path? symbol?) (listof symbol?))))]{

Like @racket[resolve-module-path] but the input is a @techlink[#:doc
refman]{module path index}; in this case, the @racket[rel-to-path-v]
base is used where the module path index contains the ``self'' index.
If @racket[module-path-index] depends on the ``self'' module path
index, then an exception is raised unless @racket[rel-to-path-v] is a
path string.

See @racket[module-path-index-resolve].

@examples[#:eval evaluator
          (resolve-module-path-index
           (module-path-index-join 'racket #f))
          (resolve-module-path-index
           (module-path-index-join "apple.rkt" #f))
          (resolve-module-path-index
           (module-path-index-join '(submod "." test) #f)
           (string->path "banana.rkt"))]
}