Any
Any
Verse has a special type, any, that is the supertype of all types (all other types are subtypes of any). Because of this, any supports very few operations, as all other types must be able to provide the same functionality that any provides.
Verse has a special type, any, that is the supertype of all types (all other types are subtypes of any). Because of this, any supports very few operations, as all other types must be able to provide the same functionality that any provides.
For example, if any were to define a comparison operation (which it doesn't), then all other types would also have to define a comparison operation (which they don't).
There is very little that you can do with an any type. but it's good to be aware of this type as it may come up when writing code that produces an error.
But there are ways that you can use any:
| | Letters := enum: |
| --- | --- |
| | A |
| | B |
| | C |
| | |
| | letter := class: |
| | Value : char |
| | |
| | Main(Arg : int) : void = |
| | X := if (Arg > 0) |
| | Letters.A |
| | else |
| | letter{Value := 'D'} |
You're reading a preview
The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.
Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.