Any TypeΒΆ

Any implements a type that packages up objects and their types in objects of Any. Roughly speaking that means that if s : S then when converted to Any, the new object will include both the original object and its type. This is a way of converting arbitrary objects into a single type without losing any of the original information. Any object can be converted to one of Any.

So we can convert a list to type Any

a:Any := [1,2]
   [1,2]

and another list to type Any

b:Any := [1,2]
   [1,2]

Equality works

(a = b)@Boolean
   true

We can compare the Any type with other types:

c := [1,2]

typeOf a

typeOf c

(a = c)@Boolean

If the values are differennt than we see the difference:

b := [1,3]
   [1,3]

(a = b)@Boolean
  false

The Any type works with many types:

a := "A"
    "A"

(a = b)@Boolean
    false

b := "A"
    "A"

(a = b)@Boolean
   true

This is true for more complex types:

Sae := SAE(FRAC INT, UP(x, FRAC INT), x^2-3)

a := generator()$Sae
   x

b := generator()$Sae
   x

(a = b)@Boolean
   true

See Also:

  • )show Any

Table Of Contents

This Page