WOLFRAM
Products
Wolfram|One
Mathematica
Wolfram Notebook Assistant + LLM Kit
Wolfram|Alpha Notebook Edition
System Modeler
All Products
Consulting & Solutions
Wolfram Consulting
Industry Solutions
Solutions for Education
Learning & Support
Wolfram U Courses
Wolfram Language Resources
Wolfram Community
Support FAQs
Contact Support
Company
About Wolfram
Careers
Events
Educational Programs
All Sites and Resources
Wolfram|Alpha
Wolfram Cloud
Your Account
Your Account
User Portal
Search
Close
Enable JavaScript to interact with content and submit forms on Wolfram websites.
Learn how
Legacy Documentation
The Mathematical Explorer
TM
(2001)
This is documentation for an obsolete product.
Current products and services
Rule
lhs
->
rhs
or
lhs
rhs
represents a rule that transforms
lhs
to
rhs
.
The character
can be entered as
->
or \
[Rule]
.
lhs
->
rhs
evaluates
rhs
immediately.
You can apply rules using
Replace
.
The assignment
lhs
=
rhs
specifies that the rule
lhs
->
rhs
should be used whenever it applies.
lhs
rhs
can be entered as
lhs
\
[Rule]
rhs
or
lhs
->
rhs
.
In
StandardForm
,
Rule
is printed usingĀ
.
Rule
is a scoping construct (see
Section A.3.8
).
Symbols that occur as pattern names in
lhs
are treated as local to the rule. This is true when the symbols appear on the right-hand side of
/;
conditions in
lhs
, and when the symbols appear anywhere in
rhs
, even inside other scoping constructs.
See
The Mathematica Book
on the web:
Section 2.4.1
andĀ
Section A.5.5
.
Implementation Notes on the web: see
Section A.9.3
.
See also:
RuleDelayed
.
Further Examples