Reputation: 33581
I have heard the term "universal type" thrown around in the context of programming language type systems, does anybody know what this means? Is is something to do with objects like a String where two instances of "foo" are identical even though ("foo"=="foo") may be false?
Upvotes: 2
Views: 342
Reputation: 202505
Russell's Paradox lurks in the wings. Just as you can break your mathematical system when you start getting into things like "the set of all sets", you can also break your type system if you are a little too blasé about a type of all types. Designing type systems requires a little bit of care.
Upvotes: 2
Reputation: 22116
A quick Wikipedia search turns up: Top Type: "The top type in type theory, commonly abbreviated as top or by the down tack symbol (⊤) is the universal type--that type which contains every possible object in the type system of interest." In other words, it's the "Object" class, which is (directly or indirectly) a superclass of every other class. As the page points out, C++ is unusual among OO languages since it doesn't have a universal type.
Upvotes: 6