Skip to content

Variable ​

A declared variable's domain, starting value and hints, in a Variables option: the domain picks the control a hole showing it gets. Held as written.

Variable(domain, start, options...)a variable ranging over domain, starting at start, with Where and Range hints
Typed signatures
TypePackageApplies
(any*) -> anyformatsalways

Domain: Graphics

Details

Variables -> [_d -> Variable(Integers, -5, Where -> IsSquareFree && !IsSquare, Range -> [-400, 400])] on an element declares _d for everything inside it: an integer starting at −5, stepping only through squarefree non-squares, drawn at random from −400 to 400. A bare starting value, a domain (Integers, Reals, Booleans) or a list of choices declares one without it.

Examples

Basic #

A variable over a domain, with its starting value

live ↗
InVariable(Z,−5)\mathrm{Variable}(ℤ, -5)OutVariable(Z,−5)\mathrm{Variable}(ℤ, -5)
About
Examples1

See also: Show, Labeled