
2.2.2 Getting information about symbols.................................................................................35
2.2.3 "Proper" variables and OwnValues.................................................................................36
2.2.4 Indexed variables and DownValues................................................................................36
2.2.5 Composite variables and SubValues..............................................................................37
2.2.6 Clearing variables...........................................................................................................37
2.2.7 Does a variable have a value? ValueQ.......................................................................39
2.2.8 Assignments attach rules to Symbol-s...........................................................................39
2.2.9 Summary........................................................................................................................40
2.3 Dynamic data typing.......................................................................................................40
2.4 Assignments...................................................................................................................41
2.4.1 Immediate and delayed assignments: Set and SetDelayed...........................................41
2.4.2 The difference between Set and SetDelayed : an example...........................................41
2.4.3 Chain assignments.........................................................................................................42
2.4.4 Don’ t use SetDelayed with more than two arguments...................................................43
2.4.5 Set and SetDelayed : when which one is used...............................................................44
2.5 Equality checks............................................................................................................ ..44
2.5.1 Equal...............................................................................................................................44
2.5.2 Beware: Equal may return "unevaluated".......................................................................44
2.5.3 Equal is used by built-in solvers to build equations..........................................................45
2.5.4 Assigning the result of Equal to a variable, and more on evaluation..............................45
2.5.5 The role of side effects...................................................................................................46
2.5.6 A digression: standard and non-standard evaluation........................................................46
2.5.7 Pass by reference semantics - possible to imitate..........................................................47
2.5.8 SameQ............................................................................................................................47
2.5.9 TrueQ..............................................................................................................................48
2.6 Logical operators..........................................................................................................49
2.7 Conditionals...................................................................................................................50
2.7.1 The If operator................................................................................................................50
2.7.2 If may return "unevaluated"............................................................................................50
评论0