Enable JavaScript to interact with content and submit forms on Wolfram websites. Learn how

Legacy Documentation

Mathematica 8 (2010)

This is documentation for Mathematica 8, which was
based on an earlier version of Wolfram Language.
View current documentation (Version 14.3)
Defining Variables and Functions
The symbolic language paradigm of Mathematica takes the concept of variables and functions to a new level. In Mathematica a variable can not only stand for a value, but can also be used purely symbolically. And building on Mathematica's powerful pattern language, "functions" can be defined not just to take arguments, but to transform a pattern with any structure.
x = ... set a variable
f [ x _ ] := ... define a function that takes any single argument
Set (= ) immediate assignment (right-hand side evaluated immediately)
SetDelayed (:= ) delayed assignment (right-hand side evaluated only when used)
Unset (=. ) unset a variable
Clear clear a function definition
__ (BlankSequence p | p (Alternatives p : e (Optional )
Module , ... scope local variables
e ; e ; e (CompoundExpression ) execute expressions in sequence
Attributes   Flat   Orderless   Listable   HoldFirst   Protected
TUTORIALS
MORE ABOUT


ja zh

AltStyle によって変換されたページ (->オリジナル) /