Changes http://wiki.axiom-developer.org/DuckTyping/diff
--
In Axiom duck typing is implemented by the domain 'Any'.
++added:
+\begin{axiom}
+)sh Any
+\end{axiom}
+
+First lets set Axiom to display the actual Type of members of Any.
+\begin{axiom}
+)set message any off
+showTypeInOutput true;
+\end{axiom}
+
+For example:
+\begin{axiom}
+a:Any := [-1,"xxx"]
+a.1
+\end{axiom}
+
+Reflection
+
+ In the package !AnyFunctions1
+\begin{axiom}
+)show AnyFunctions1
+\end{axiom}
+
+the function 'retractable?' implements Reflection. It can be
+used to test whether a value is a member of some domain.
+'retract' will return the original value and domain.
+
+\begin{axiom}
+retractable?(a.1)$ANY1(Integer)
+-- function to return 0 if not an integer
+N:Any->Integer
+N(x:Any):Integer ==
+ if retractable?(x)$ANY1(Integer) then
+ retract(x)$ANY1(Integer)
+ else
+ 0$Integer
+-- test
+n:Integer:=N(a.2)
+\end{axiom}
+
+'retractIfCan' returns a union of the original type or "failed".
+\begin{axiom}
+retractIfCan(a.1)$ANY1(Integer)
+\end{axiom}
+
--
forwarded from http://wiki.axiom-developer.org/[EMAIL PROTECTED]