note description: "[ Project-wide universal properties. This class is an ancestor to all developer-written classes. ANY may be customized for individual projects or teams. ]" library: "Free implementation of ELKS library" status: "See notice at
end of class." legal: "See notice at end of class." date: "$Date: 2013-01-25 11:49:00 -0800 (Fri, 25 Jan 2013) $" revision: "$Revision: 712 $" class ANY feature
other /= Void external "built_in" ensure definition: Result = (conforms_to (other) and other.conforms_to (Current)) end feature
current object? require other_not_void: other /= Void external "built_in" ensure symmetric: Result implies other ~ Current consistent: standard_is_equal (other) implies Result end frozen standard_is_equal (other: like Current): BOOLEAN
Is `other' attached to an object of the same type -- as current object, and field-by-field identical to it? require other_not_void: other /= Void external "built_in" ensure same_type: Result implies same_type (other) symmetric: Result implies
other.standard_is_equal (Current) end frozen equal (a: detachable ANY; b: like a): BOOLEAN -- Are `a' and `b' either both void or attached -- to objects considered equal? do if a = Void then Result := b = Void else Result := b /= Void and
then a.is_equal (b) end ensure definition: Result = (a = Void and b = Void) or else ((a /= Void and b /= Void) and then a.is_equal (b)) end frozen standard_equal (a: detachable ANY; b: like a): BOOLEAN -- Are `a' and `b' either both void or
attached to -- field-by-field identical objects of the same type? -- Always uses default object comparison criterion. do if a = Void then Result := b = Void else Result := b /= Void and then a.standard_is_equal (b) end ensure definition: Result
= (a = Void and b = Void) or else ((a /= Void and b /= Void) and then a.standard_is_equal (b)) end frozen is_deep_equal (other: like Current): BOOLEAN -- Are `Current' and `other' attached to isomorphic object structures? require other_not_void:
other /= Void external "built_in" ensure shallow_implies_deep: standard_is_equal (other) implies Result same_type: Result implies same_type (other) symmetric: Result implies other.is_deep_equal (Current) end frozen deep_equal (a: detachable
ANY; b: like a): BOOLEAN -- Are `a' and `b' either both void -- or attached to isomorphic object structures? do if a = Void then Result := b = Void else Result := b /= Void and then a.is_deep_equal (b) end ensure shallow_implies_deep: standard_equal
(a, b) implies Result both_or_none_void: (a = Void) implies (Result = (b = Void)) same_type: (Result and (a /= Void)) implies (b /= Void and then a.same_type (b)) symmetric: Result implies deep_equal (b, a) end feature -- Duplication frozen
twin: like Current -- New object equal to `Current'
end frozen clone (other: detachable ANY): like other
`twin' instead." do if other /= Void then Result := other.twin end ensure equal: Result ~ other end frozen standard_clone (other: detachable ANY): like other -- Void if `other' is void; otherwise new object
field-by-field identical to `other'. -- Always uses default copying semantics. external "built_in" ensure standard_twin_not_void: Result /= Void equal: standard_equal (Result, Current) end frozen deep_twin: like Current -- New object structure
recursively duplicated from Current. external "built_in" ensure deep_twin_not_void: Result /= Void deep_equal: deep_equal (Current, Result) end frozen deep_clone (other: detachable ANY): like other -- Void if `other' is void: otherwise, new
else create l_msg.make_from_string ("Mismatch: ") create l_exc l_msg.append (generating_type.name) l_exc.raise_retrieval_exception (l_msg) end end feature
ensure io_not_void: Result /= Void end out: STRING
terse printable representation
of type `POINTER'.) do ensure -- Result = Result.default end frozen as_attached: attached like Current -- Attached version of Current -- (Can be used during transitional period to convert -- non-void-safe classes to void-safe ones.) do Result
:= Current end invariant reflexive_equality: standard_is_equal (Current) reflexive_conformance: conforms_to (Current) note copyright: "Copyright (c) 1984-2012, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[ Eiffel Software 5949 Hollister Ave., Goleta, CA 93117 USA Telephone 805-685-1006, Fax 805-685-6869 Website http://www.eiffel.com Customer support http://support.eiffel.com ]" end