(0) "Value is Class yields true (1) if Value is an instance of Class or false (0) otherwise".
So from the fact that :
(1) (Object is Object) evalutes to 1
we can infer that:
(2) Object is an instance of the class Object
However, the first occurence of "Object" in (2) refers to none other than the class Object, so (2) is equivalent to
(3) the class Object is an instance of the class Object
But how can a class be an instance of itself? Seems to raise a chicken and egg problem. How did this class come into existence in the first place? Since it's an instance of class, don't we have to call that class's, i.e. its own, constructor (as in: Object := Object())? But wait, that would presuppose that this class already exists, in which case what need is there to call the constructor?
(edit: relatedly, it's also possible for 2 classes to be instances of each other, e.g. (Class is Object)==1 && (Object is Class)==1; (Object is Any)==1 && (Any is Object)==1)
How do you wrap your head around this? I'm not saying (Object is Object) shoudn't evalute to 1. I can see one argument it *must* ("Object is a class, and every class is an instance of Class, which is a subclass of Object, and that's why 'Object is Object' has to be true"). But that still doesn't fully explain away the chicken and egg problem.
What are all the other instances where (X is X) evaluates to true? I only found 2 other instances, (Class is Class) and (Any is Any), both of which again kind of makes sense but also raise the chicken and egg problem.
Of course, most other cases of (X is X) (as expected) do not evaluate to true
Code: Select all
Msgbox(String is String) ; 0
Msgbox(Number is Number) ; 0
Msgbox(Map is Map) ; 0
Msgbox(Array is Array) ; 0