{"size": 1634, "ext": "scrbl", "max_stars_repo_path": "pkgs/racket-doc/syntax/scribblings/modread.scrbl", "max_stars_repo_name": "lkh01/racket", "max_stars_repo_stars_event_min_datetime": "2018-07-29T04:13:52.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-14T16:11:17.000Z", "max_issues_repo_path": "pkgs/racket-doc/syntax/scribblings/modread.scrbl", "max_issues_repo_name": "lkh01/racket", "max_issues_repo_issues_event_min_datetime": "2017-08-25T20:26:37.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T17:48:40.000Z", "max_forks_repo_path": "pkgs/racket-doc/syntax/scribblings/modread.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": 10, "max_issues_count": 15, "max_forks_count": 3, "avg_line_length": 41.8974358974, "max_line_length": 70, "alphanum_fraction": 0.7221542228}
#lang scribble/doc
@(require "common.rkt" (for-label syntax/moddep))

@title[#:tag "modread"]{Reading Module Source Code}

@defmodule[syntax/modread]

@defproc[(with-module-reading-parameterization [thunk (-> any)]) any]{

Calls @racket[thunk] with all reader parameters reset to their default
values.}

@defproc[(check-module-form [stx (or/c syntax? eof-object?)] 
                            [expected-module-sym symbol?]
                            [source-v (or/c string? false/c)])
         (or/c syntax? false/c)]{

Inspects @racket[stx] to check whether evaluating it will declare a
module---at least if @racket[module] is bound in the top-level to
Racket's @racket[module]. The syntax object @racket[stx] can contain a
compiled expression. Also, @racket[stx] can be an end-of-file, on the
grounds that @racket[read-syntax] can produce an end-of-file.

The @racket[expected-module-sym] argument is currently ignored. In
previous versions, the module form @racket[stx] was obliged to declare
a module who name matched @racket[expected-module-sym].

If @racket[stx] can declare a module in an appropriate top-level, then
the @racket[check-module-form] procedure returns a syntax object that
certainly will declare a module (adding explicit context to the
leading @racket[module] if necessary) in any top-level. Otherwise, if
@racket[source-v] is not @racket[#f], a suitable exception is raised
using the @racket[write] form of the source in the message; if
@racket[source-v] is @racket[#f], @racket[#f] is returned.

If @racket[stx] is eof or eof wrapped as a syntax object, then an
error is raised or @racket[#f] is returned.}

