44: def add_builtin_definitions
45: deftype(:*) do true end
46: deftype(:null) do |x| x.nil? end
47: deftype(:undefined) do |x| x.nil? end
48: deftype(:Object) do true end
49: deftype(:Array)
50: deftype(:Date)
51: deftype(:RegExp, Regexp)
52: deftype(:Boolean, [false,true,nil])
53: deftype(:String)
54: deftype(:Number, Numeric)
55: deftype(:boolean, [false,true])
56: deftype(:string) do |x| x.is_a?(String) end
57: deftype(:int) do |x| x.is_a?(Integer) end
58: deftype(:uint) do |x| x.is_a?(Integer) and x > 0 end
59: deftype(:double) do |x| x.is_a?(Numeric) end
60: deftype(:decimal) do |x| x.is_a?(Numeric) end
61: deftype :AnyString, union(:string, String)
62: deftype :AnyBoolean, union(:boolean, :Boolean)
63: deftype :AnyNumber, union(:byte, :int, :uint, :double, :decimal,:Number)
64: deftype :FloatNumber, union(:double, :decimal)
65: end