Routines (procedures and iterators) are immutable. They have only "equal", "similar", "copy", and "unparse" methods. The "equal" and "similar" methods have weak definitions (see below); they are provided mainly so that structure and collection types that contain them can have these methods. E.g., "record"s of type
record[i: int, p: proc(int) returns(int)]will have "equal" and "similar" methods, since both field types have these methods.
Methods for routine type "rt"
equal (p: rt) returns (bool)
similar (p: rt) returns (bool)
% effects if a call returns true, then self and p are guaranteed to be
% indistinguishable: they return the same results for calls with
% equal arguments and have the same side \tex{effects} for those calls.
% if the call of equal or similar returns false, there are no
% guarantees: self and p might or might not be indistinguishable.
copy ( ) returns (rt)
% effects returns self.
unparse ( ) returns (string)
% effects Returns a string that indicates whether this routine is a procedure or an
% iterator. The implementation is free to put more information about the
% routine (for example the routine signature) in the returned string.