12.07.2015 Views

Learning Guide Learning Guide

Learning Guide Learning Guide

Learning Guide Learning 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.

196 • Chapter 5: Evaluation and Simplification> x := y;> y := z;> z := 5;> x;> end proc:> test();yCompare this evaluation with the similar interactive example in thissection on page 191. Full evaluation within a procedure is rarely necessaryand can lead to inefficiency. If you require full evaluation within aprocedure, use eval.Commands with Special Evaluation RulesThe assigned and evaln Commands The functions assigned andevaln evaluate their arguments only to the level at which they becomenames.> x := y;x := y> y := z;y := z> evaln(x);xThe assigned command checks if a name has a value assigned to it.> assigned( x );trueThe seq Command The seq command for creating expression sequencesdoes not evaluate its arguments, so that even if a variable has an assignedvalue, seq can use it as a counting variable.

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

Saved successfully!

Ooh no, something went wrong!