I just discovered this rather cute property of the type system:
_typeof(0);
(11) Result: zero
_typeof(_typeof(0));
(12) Result: type(zero)
_typeof(_typeof(_typeof(0)));
(13) Result: type(type(zero))
_typeof(_typeof(_typeof(_typeof(0))));
(14) Result: type(type(type(zero)))
_typeof(_typeof(_typeof(_typeof(_typeof(0)))));
(15) Result: type(type(type(type(zero))))
I wonder if this can be used to implement integer arithmetic by just using the type system? :-)
Unfortunately, typeof() doesn't seem to be as clever:
typeof(0);
(16) Result: zero
typeof(typeof(0));
(17) Result: type(mixed)
typeof(typeof(typeof(0)));
(18) Result: type(mixed)
typeof(typeof(typeof(typeof(0))));
(19) Result: type(mixed)