| OCR Text |
Show - ; ■ 33 The AsGunte Statement Syntax lyylable-|--»^g)-^8tatement] <variable> as <8tatement> Semantics This is a generalization of the assignment statement in that the <variable> "takes on" or "assumes" values indicated by the <statement> one at a time if a loop is indicated by an interative while statement. Outside of a while only the first possible value is assumed and execution continues. .The value of the assume statement is boolean: -being true if the variable has just assumed a value and false when there are no more possible values which may be assumed. Pragmatics The as operator has a value for its right operand and a name for its left operand. After all possible assignments are done, the value in the stack is replaced by a boolean value, Justificatidn This particularly general form is most useful in iteration .and applies itself well to all kinds of operands. Examples Will be given in the section on the while statement. |