Substrings ............................................................................................ 24
Searching a String ................................................................................. 25
String Concatenation ............................................................................. 25
Mutability of Strings .............................................................................. 26
Special Characters in Strings ................................................................... 27
Parsing Strings ..................................................................................... 27
Converting Expressions to Strings ............................................................ 28
2.6 Using Special Characters ........................................................................ 29
Token Separators .................................................................................. 29
Blank Spaces, New Lines, Comments, and Continuation ............................... 29
Punctuation Marks ................................................................................ 30
Escape Characters ................................................................................. 33
2.7 Types and Operands .............................................................................. 34
DAGs ................................................................................................. 34
Maple Types ........................................................................................ 35
Operands and op ................................................................................... 36
2.8 Avoiding Common Problems ................................................................... 40
Attempting to Assign to a Protected Name ................................................. 40
Invalid Left-Hand Assignment ................................................................. 41
Incorrect Syntax in Parse ........................................................................ 41
White Space Characters within a Token ..................................................... 41
Incorrect Use of Double and Single Quotes ................................................ 41
Avoid Using Maple Keywords as Names ................................................... 42
2.9 Exercises ............................................................................................. 43
3 Maple Expressions ....................................................................................... 45
3.1 In This Chapter ..................................................................................... 45
3.2 Introduction ......................................................................................... 45
Expressions and Statements .................................................................... 45
Automatic Simplication and Evaluation ................................................... 45
Syntax and Constructors ........................................................................ 45
3.3 Names ................................................................................................ 47
Creating Names: Lexical Conventions ....................................................... 48
3.4 Unevaluated Expressions ........................................................................ 52
Protecting Names and Options ................................................................. 53
Generic Expressions .............................................................................. 54
Pass by Reference ................................................................................. 54
Displaying the Original Command ............................................................ 55
Unassigning Names ............................................................................... 55
Evaluation and Automatic Simplication ................................................... 56
Example: Dening a Procedure that Is Returned Unevaluated ........................ 57
3.5 Numbers ............................................................................................. 59
Integers ............................................................................................... 59
Fractions ............................................................................................. 60
iv • Contents