Unevaluated Expressions, 'expr' - Maple Programming Help

Home : Support : Online Help : Programming : Evaluation : uneval

Unevaluated Expressions, 'expr'

Description

 • Enclosing an expression with right single quotes ' ' will delay the evaluation of the expression.
 • As another example, help(Digits); returns a message stating that the argument to the help function was not a name --- because Digits evaluates to an integer value. To get the desired help description, use instead the quoted form: help('Digits');.
 • Enclosing an expression in unevaluation quotes produces a new expression of type uneval. It evaluates to the original expression.
 • After each evaluation, one level of single quotes is stripped off.
 • Note that evaluation is different from simplification.
 • A special case of unevaluation is used to unassign a name. In some cases, the evaln function is required to unassign a name, such as: $\mathrm{for}i\mathrm{to}n\mathrm{do}{a}_{i}:=\mathrm{evaln}\left({a}_{i}\right)\mathrm{end}\mathrm{do};$ where i must be evaluated but ${a}_{i}$ must not be fully evaluated.
 • It is important to quote name arguments passed to procedures, such as type names, or options to other procedures.
 • There is also a procedure parameter modifier, uneval, which declares that an argument to a procedure is automatically left unevaluated.

Examples

 > $x≔2:$
 > $y≔3:$
 > $f≔'x+y'$
 ${f}{≔}{x}{+}{y}$ (1)
 > 
 ${5}$ (2)

After each evaluation, one level of single quotes is stripped off.

 > $a≔1$
 ${a}{≔}{1}$ (3)
 > $''a''$
 $'{a}'$ (4)
 > $'a'$
 ${a}$ (5)
 > $a$
 ${1}$ (6)
 > $'2'$
 ${2}$ (7)

Name arguments passed to procedures must be in quotes.

 > $\mathrm{dependent}≔2:$
 > $\mathrm{type}\left(s,'\mathrm{dependent}\left(\left\{s,t\right\}\right)'\right)$
 ${\mathrm{true}}$ (8)
 > $\mathrm{type}\left(s,\mathrm{dependent}\left(\left\{s,t\right\}\right)\right)$
 ${\mathrm{false}}$ (9)

A special case of unevaluation is used to unassign a name.

 > $x≔5$
 ${x}{≔}{5}$ (10)
 > $x≔'x'$
 ${x}{≔}{x}$ (11)
 > $x$
 ${x}$ (12)