Return Statement



next up previous contents index
Next: Yield Statement Up: Statements Previous: Store Statement

Return Statement

The form of the return statement is
return ["(" <expr> ["," <expr>]* ")"]
The return statement terminates execution of the containing procedure or iterator. There must be the same number of expressions as there are return result types listed in the routine's header, and their types must be subtypes of the corresponding listed types. (If return is used in an iterator, no results can be given; iterators do not have return result types.) The expressions (if any) are evaluated in an unspecified order, and the objects obtained become the results of the procedure.



theta-questions@lcs.mit.edu