{"size": 1338, "ext": "scrbl", "max_stars_repo_path": "pkgs/racket-doc/scribblings/guide/void-and-undef.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/guide/void-and-undef.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/guide/void-and-undef.scrbl", "max_forks_repo_name": "lkh01/racket", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 10, "max_issues_count": 15, "max_forks_count": null, "avg_line_length": 32.6341463415, "max_line_length": 73, "alphanum_fraction": 0.7406576981}
#lang scribble/doc
@(require scribble/manual scribble/eval "guide-utils.rkt"
          (for-label racket/undefined
                     racket/shared))

@title[#:tag "void+undefined"]{Void and Undefined}

Some procedures or expression forms have no need for a result
value. For example, the @racket[display] procedure is called only for
the side-effect of writing output. In such cases the result value is
normally a special constant that prints as @|void-const|.  When the
result of an expression is simply @|void-const|, the @tech{REPL} does not
print anything.

The @racket[void] procedure takes any number of arguments and returns
@|void-const|. (That is, the identifier @racketidfont{void} is bound
to a procedure that returns @|void-const|, instead of being bound
directly to @|void-const|.)

@examples[
(void)
(void 1 2 3)
(list (void))
]

The @racket[undefined] constant, which prints as @|undefined-const|, is
sometimes used as the result of a reference whose value is not yet
available. In previous versions of Racket (before version 6.1),
referencing a local binding too early produced @|undefined-const|;
too-early references now raise an exception, instead.

@margin-note{The @racket[undefined] result can still be produced
in some cases by the @racket[shared] form.}

@def+int[
(define (fails)
  (define x x)
  x)
(fails)
]
