Module
Evaluates an expression with local variables, fresh on every call.
✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram Language
Module✓Module({x, y = y0, ...}, body), evaluated with , , ... as fresh local variables (each initialized, or left unbound, per its own binding) invisible outside the call.Typed signatures
| Type | Package | Applies |
|---|---|---|
(any, any) -> any | combinatorics | always |
Details
- Each call gets its own scope, so a recursive or repeated call never has its locals collide with an outer binding — or another call's — of the same name.
- An initializer's value (the in ) is computed in the OUTER context, before any local shadows it, same as With — a later binding cannot read an earlier one's local value.
- A binding with no
= value(a bare ) declares an uninitialized local; referencing it before assigning gives an unevaluated symbol, not an error.
Examples
About
| Examples | 2 |
|---|---|
| Checked against | Wolfram Language 1 agree |
| Crosswalk | Wolfram Language |
See also: With