User Guide

8 Basic Programming
You have used Maple interactively in the previous chapters, sequentially
performing operations such as executing a single command. Because Maple
has a complete programming language, you can also use sophisticated pro-
gramming constructs.
Important: It is strongly recommended that you use the Worksheet mode
and 1-D Math input when programming or using programming commands.
Hence, all input in this chapter is entered as 1-D Math.
8.1 In This Chapter
TopicsSection
Conditional Execution (if Statement)
Repetition (for Statement)
Flow Control - Basic programming con-
structs
Creating a sequence
Adding and Multiplying Expressions
Selecting Expression Operands
Mapping a Command over a Set or List
Mapping a Binary Command over Two Lists
or Vectors
Iterative Commands - Specialized, effi-
cient iterative commands
Defining and Running Simple Procedures
Procedures with Inputs
Procedure Return Values
Displaying Procedure Definitions
Displaying Maple Library Procedure
Definitions
Modules
Procedures - Maple programs
321