On this page:
top
up

3.23Blocks: block πŸ”— i

(require racket/block ) package: base
The bindings documented in this section are provided by the racket/block library, not racket/base or racket.

syntax

( block defn-or-expr...)

Supports a mixture of expressions and mutually recursive definitions, as in a module body. Unlike an internal-definition context, the last defn-or-expr need not be an expression.

The result of the block form is the result of the last defn-or-expr if it is an expression, #<void> otherwise. If no defn-or-expr is provided (after flattening begin forms), the result is #<void>.

The final defn-or-expr is executed in tail position, if it is an expression.

Examples:
> (define (fx)
(define y(add1 x))
(define z(* 2y))
(+ 3z)))
> (f12)

13

29

top
up

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /