11.07.2015 Views

Advanced Programming Guide

Advanced Programming Guide

Advanced Programming Guide

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

A.2 Internal Representations of Data Types • 349FOR ∧ name ∧ in − expr ∧ cond − expr ∧ stat − seqMaple syntax:Maple syntax:Length: 7 or 5for name from fromExpr by byExpr to toExprwhile condExpr dostatSeqodfor name in inExprwhile condExpr dostatSeqodThe name follows the same rules as in ASSIGN, except that it canalso be the empty expression sequence (NULL), indicating that there is nocontrolling variable for the loop.The from-expr, by-expr, to-expr, and cond-expr entries are generalexpressions. All are optional in the syntax of for loops and can thus befilled in with default values (1, 1, NULL, and true respectively) by theparser.The stat-seq entry can be a single Maple statement or expression, aSTATSEQ structure, or NULL indicating an empty loop body. An additionalbit in the FOR structure’s header is used to indicate whether the stat-seqcontains any break or next statements.Foreign DataMaple syntax: noneLength: 1 or moreFOREIGN . . .This is similar to the BINARY structure, except that it is for use bycomponents of Maple outside the kernel, such as the user interface. AFOREIGN structure is exempt from garbage collection, and it is the responsibilityof the external component to free it when it is finished usingit.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!