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.

2.5 Extending Maple • 29The parse command does not evaluate the expression it returns. Youmust use eval to evaluate the expression explicitly. In the following output,the variable a is not evaluted to its value, 2, until you explicitly usethe eval command.> a := 2;a := 2> z := parse( s );z := a x 2 + 1> eval(z);2 x 2 + 1For more details about the parse command, see sec-Information:tion 4.7.Summary The techniques in this section are very simple, but you canuse them to create useful applications such as Maple tutorials, proceduresthat test students, or interactive lessons.2.5 Extending MapleAlthough it may be useful to write your own procedures to perform newtasks, sometimes extending the abilities of Maple commands is most beneficial.This section familiarizes you with:• Defining your own types and operators• Modifying how Maple displays expressions• Extending commands such as simplify and expand.Defining New TypesIf you are using a complicated structured type, it is recommended thatyou assign the structured type to a variable of the form ‘type/name‘.

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

Saved successfully!

Ooh no, something went wrong!