Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .

Audience
Worksheet Graphical Interface
Manual Set
Conventions
The Maple Programming Language
Using This Book
Customer Feedback
In This Chapter
Getting Started
Maple Statements
Getting Help
Displaying a Text String
Performing an Arithmetic Operation
Assigning to a Name
Using Maple Library Routines
Deﬁning a Simple Procedure
1.7 Conclusion
2 Maple Language Elements
2.1 Character Set
2.2 Tokens
Reserved Words
Programming-Language Operators
Names
Strings
Natural Integers
2.3 Using Special Characters
Token Separators
Punctuation Marks
Escape Characters
2.4 Types and Operands
Integers
Concatenations
2.5 Troubleshooting
Attempting to Assign to a Protected Name
Invalid Left-Hand Assignment
Incorrect Syntax in Parse
White Space Characters within a Token
Incorrect Use of Double and Single Quotes
2.6 Exercises
2.7 Conclusion
3 Maple Expressions and Statements
3.1 Syntax and Semantics
Syntax
Semantics
3.2 Expressions
Constants
Operators
Data Structures
Functions
3.3 Using Expressions
Investigating the Parts of an Expression
Evaluating and Simplifying Expressions
Unevaluated Expressions
Substituting Subexpressions
Displaying Large Expressions: Labels
Structured Types
3.4 Statements
The Assignment Statement
Selection Statements
Repetition Statements
The break and next Statements
The error and return Statements
The use Statement
The quit Statement
3.5 Troubleshooting
Syntax Errors
Reserved Word Unexpected
Break or Next Not in Loop
3.6 Exercises
3.7 Conclusion
4 Basic Data Structures
4.1 Sets
Manipulating a List
4.3 Tables
An Alternate Method for Generating a Table
Table Evaluation Rules
Manipulating a Table
4.4 arrays and Arrays
Evaluation Rules for arrays
Manipulating arrays and Arrays
4.5 Selecting Elements from a Data Structure
The Selection Operation []
The op Command
The select, remove, and selectremove Commands
4.6 Converting Between Data Structures
Converting a Sequence to a Set or a List
Converting Other Data Structures
4.7 Other Maple Data Structures
Stacks
Queues
4.8 Troubleshooting
Wrong Number of Parameters in Function
Invalid Subscript Selector
Requires Range or Initialization List for Building arrays
Error in array Bound or Array Index out of Range
4.9 Exercises
4.10 Conclusion
5 Flow Control
5.1 Selection and Conditional Execution
The if Statement
The ‘if‘ Operator
5.2 Repetition
The for Loop
The while Loop
Control within Loops
5.3 Looping Commands
The map Command
The zip Command
The seq, add, and mul Commands
Using Specialized Looping Commands
6.1 Deﬁning a Procedure
Naming a Procedure
Executing a Procedure
6.2 Procedure Components
Formal Parameters
Variables
Procedure Options
Procedure Description
Procedure Body Statements
6.3 Procedure Interpretation
6.4 Procedure Return Values
Explicit Returns
Error Returns
Returning Values through Parameters
Returning Unevaluated
Including a Procedure Description
Creating Help Pages
6.6 Saving and Retrieving Procedures
6.7 Viewing Maple Library Source Code
the evaluation rules for procedures.28
Special Evaluation Rules for Procedures
Displaying Maple Library Source Code
6.8 Alternate Methods for Deﬁning a Procedure
Functional Operators: Mapping Notation
The unapply Command
Unnamed Procedures and the map Command
Building a List of Arguments
6.9 The Procedure Object
The procedure Type
Procedure Operands
6.10 Using Data Structures to Solve Problems
Computing an Average
Testing for Membership
Performing a Binary Search
Plotting the Roots of a Polynomial
Connected Graphs
6.11 Troubleshooting
Missing Argument
Incorrect Argument Type
Implicitly Declared Local Variable
Understanding Names, Functions, and Remember Tables
6.12 Exercises
6.13 Conclusion
7 Input and Output
7.1 Screen and Keyboard I/O
Printing Output to the Screen
Interactive Input
7.2 Standard Disk I/O
Using Filenames in Maple Statements
Reading and Saving Data in Maple
Importing Data from Files
Exporting Data to Files
7.3 Troubleshooting
Extra Characters at End of Parsed String
7.4 Exercises
7.5 Conclusion
8 Debugging and Eﬃciency
8.1 A Tutorial Example
Numbering the Procedure Statements I
Invoking the Debugger I
Invoking the Debugger II
8.2 Maple Debugger Commands
Numbering the Procedure Statements II
Invoking the Debugger III
Changing the State of a Procedure During Debugging
Examining the State of a Procedure During Debugging
Using Top-Level Commands at the Debugger Prompt
Restrictions
8.3 Detecting Errors
Tracing a Procedure
Using Assertions
Handling Exceptions
Checking Syntax
8.4 Creating Eﬃcient Programs
Displaying Time and Memory Statistics
Proﬁling a Procedure
8.5 Managing Resources
Setting a Time Limit on Computations
Garbage Collection
Communicating with the Kernel
8.6 Exercises
8.7 Conclusion
9.1 Uses of Maplet Applications
Custom Maple Calculators
Interfaces to Maple Packages and Routines
Queries
Messages
9.2 The Maplets Package
Elements
Examples
Tools
Display
9.3 Terminology
9.4 Elements
Window Body Elements
Layout Elements
ToolBar Elements
toolbar elements:
Command Elements
Dialog Elements
Other Elements
Reference Options
9.5 Example Maplet Applications
Linear Algebra Subpackage
0 of .
Results for:
P. 1
Introductory Programming Guide

# Introductory Programming Guide

Ratings: (0)|Views: 21|Likes:

### Availability:

See more
See less

11/08/2011

pdf

text

original

Pages 8 to 24 are not shown in this preview.
Pages 32 to 36 are not shown in this preview.