-
Notifications
You must be signed in to change notification settings - Fork 6
Inheritance
Vihan edited this page Nov 25, 2018
·
1 revision
Inheritance is the idea that one type can do all that another can and even more. To learn more about Object-Oriented Programming a tutorial will probably be better as this page specifies some of the inheritance behaviors specific to VSL.
Most programming languages have a 'root class' from which all others inherit, for example, Java's Object
. VSL also has a 'hidden' root class named Object
. All types technically inherit from Object
however the 'Object' contains no fields nor any methods. Object
only exists for semantic purposes, it does not result in any overhead on your classes however it does allow you to cast all objects to this type.
That said, casts to Object must be explicit.
Casts to object look like:
struct vsl.Object {
void* metatype;
void* value;
}
- Introduction
- Installation
- VSL By Example
- Usage
- WASM (WebAssembly)
- The Basics
- Your First Program
- Syntax
- Concepts
- Modules
- Advanced Details
- Interop
- VSL Development
- Common Errors