{"size": 1155, "ext": "scrbl", "max_stars_repo_path": "pkgs/racket-doc/syntax/scribblings/wrap-modbeg.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/wrap-modbeg.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/wrap-modbeg.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": 39.8275862069, "max_line_length": 88, "alphanum_fraction": 0.7324675325}
#lang scribble/doc
@(require "common.rkt" (for-label syntax/wrap-modbeg))

@title[#:tag "wrap-modbeg"]{Wrapping Module-Body Expressions}

@defmodule[syntax/wrap-modbeg]

@history[#:added "6.0.0.1"]

@defproc[(make-wrapping-module-begin [wrap-form syntax?]
                                     [module-begin-form syntax? #'#%plain-module-begin])
         (syntax? . -> . syntax?)]{

Provided @racket[for-syntax].

Constructs a function that is suitable for use as a
@racket[#%module-begin] replacement, particularly to replace the
facet of @racket[#%module-begin] that wraps each top-level
expression to print the expression's result(s).

The function takes a syntax object and returns a syntax object using
@racket[module-begin-form].  Assuming that @racket[module-begin-form]
resembles @racket[#%plain-module-begin], each top-level expression
@racket[_expr] will be wrapped as @racket[(wrap-form _expr)], while
top-level declarations (such as @racket[define-values] and
@racket[require] forms) are left as-is. Expressions are detected after
macro expansion and @racket[begin] splicing, and expansion is
interleaved with declaration processing as usual.}
