any.spad line 125 [edit on github]
AnyFunctions1 implements several utility functions for working with Any. These functions are used to go back and forth between objects of Any and objects of other types.
coerce(s)
creates an object of Any from the object s
of type S
.
retract(a)
tries to convert a
into an object of type S
. If possible, it returns the object. Error: if no such retraction is possible.
retractIfCan(a)
tries change a
into an object of type S
. If it can, then such an object is returned. Otherwise, "failed" is returned.
retractable?(a)
tests if a
can be converted into an object of type S
.