{"size": 2163, "ext": "scrbl", "max_stars_repo_path": "pkgs/racket-doc/scribblings/reference/enter.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/scribblings/reference/enter.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/scribblings/reference/enter.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": 38.625, "max_line_length": 99, "alphanum_fraction": 0.6601941748}
#lang scribble/doc
@(require "mz.rkt"
          (for-label racket/enter
                     racket/rerequire))

@title[#:tag "enter"]{Entering Modules}

@note-init-lib[racket/enter]

@defform*/subs[[(enter! module-path)
                (enter! #f)
                (enter! module-path flag ...+)]
               ([flag #:quiet
                      #:verbose-reload
                      #:verbose
                      #:dont-re-require-enter])]{

Intended for use in a @tech{REPL}, such as when @exec{racket} is
started in interactive mode. When a @racket[module-path] is provided
(in the same sense as for @racket[require]), the corresponding module
is loaded or invoked via @racket[dynamic-rerequire], and the current @tech{namespace} is changed to
the body of the module via @racket[module->namespace]. When
@racket[#f] is provided, then the current @tech{namespace} is restored
to the original one.

Additional @racket[flag]s can customize aspects of @racket[enter!]:
@itemize[

 @item{The @racket[#:verbose], @racket[#:verbose-reload], and
  @racket[#:quiet] flags correspond to @racket['all],
  @racket['reload], and @racket['none] verbosity for
  @racket[dynamic-rerequire]. The default corresponds to
  @racket[#:verbose-reload].}

 @item{After switching namespaces to the designated module,
  @racket[enter!] automatically requires @racket[racket/enter] into the
  namespace, so that @racket[enter!] can be used to switch namespaces
  again.  In some cases, requiring @racket[racket/enter] 
  might not be desirable (e.g., in a tool
  that uses @racket[racket/enter]); use the
  @racket[#:dont-re-require-enter] flag to disable the require.}]
}

@defproc[(dynamic-enter! [mod (or/c module-path? #f)]
                         [#:verbosity verbosity (or/c 'all 'reload 'none) 'reload]
                         [#:re-require-enter? re-require-enter? any/c #t])
         void?]{

Procedure variant of @racket[enter!], where @racket[verbosity] is
passed along to @racket[dynamic-rerequire] and
@racket[re-require-enter?]  determines whether @racket[dynamic-enter!]
requires @racket[racket/enter] in a newly entered namespace.

@history[#:added "6.0.0.1"]}

