|
|
|
|
|
|
|
|
|
Named Patterns in (lhs->rhs), (lhs=rhs), (lhs^=rhs), (f/:lhs=rhs)
|
|
|
|
|
|
Organization: | Naval Air Warfare Center, Aircraft Division |
|
|
|
|
|
|
0210-609
|
|
|
|
|
|
2004-05-14
|
|
|
|
|
|
The functions Rule, Set, UpSet, TagSet each evaluate their right side immediately. If these functions have named patterns on the left side and the symbols used to name the patterns are needed on the right side then the global values of these symbols are used on the right side. To get the intended result you must ensure these symbols have no global values. This is demonstrated in the (LocalPatterns.nb) notebook. The package (LocalPatterns.m) defines functions that work like Rule, Set, UpSet, TagSet but don't have the problem described above. All functions in the package are demonstrated and explained in the notebook (LocalPatterns.m). LocalPatterns.m uses four special characters. A modified version of the BasicInput palette is provided to assist with entering the special characters. The modified palette is also explained in the (LocalPatterns.nb) package.
|
|
|
|
|
|
|
|
|
|
|
|
Set, Rule, UpSet, TagSet, scope
|
|
|
|
|
|
| BasicInput2.nb (14.3 KB) - Mathematica palette [for Mathematica 5.0] | | LocalPatterns.m (6.1 KB) - Mathematica package [for Mathematica 5.0] | | LocalPatterns.nb (30.2 KB) - Mathematica notebook [for Mathematica 5.0] |
|
|
|
|
|
|
|
| | | | | |
|