Wolfram ResearchProductsPurchasingServices & ResourcesAbout UsOur Sites
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.

Block

Usage

Block[{x, y, ... }, expr] specifies that expr is to be evaluated with local values for the symbols x, y, ... .
Block[{x =  , ... }, expr] defines initial local values for x, ... .


Notes

Block allows you to set up an environment in which the values of variables can temporarily be changed.
• When you execute a block, values assigned to x, y, ... are cleared. When the execution of the block is finished, the original values of these symbols are restored.
Block affects only the values of symbols, not their names.
• Initial values specified for x, y, ... are evaluated before x, y, ... are cleared.
• You can use Block[{vars}, body /; cond] as the right-hand side of a transformation rule with a condition attached.
Block has attribute HoldAll.
Block implements dynamic scoping of variables.
Block is automatically used to localize values of iterators in iteration constructs such as Do, Sum and Table.
• See Section 2.7.6.
• See also: Module, With, CompoundExpression.
• New in Version 1.


Any questions about topics on this page? Click here to get an individual response.Buy NowFree TrialMore Information



 © 2008 Wolfram Research, Inc.  Terms of Use  Privacy Policy |
Sign up for our newsletter: