-
Notifications
You must be signed in to change notification settings - Fork 6
Classes
Vihan edited this page Dec 11, 2018
·
2 revisions
In VSL a class represents a type. A group of variables (specifying 'state') and methods to modify that state. VSL's class and inheritance system is Object-Oriented with a few of VSL's own behaviors.
A class is declared using:
class MyClass {
// Class body
}
You can prepend the following modifiers to your class statement to modify access:
Access Modifier | Same File | Same Module | Different Module |
---|---|---|---|
public |
Yes | Yes | Yes |
none | Yes | Yes | No |
private |
Yes | No | No |
VSL specifies that the fields of a class will be generated in-order. This minimizes overhead and allows for easier ABI compatibilities however in cases of dynamic dispatch, certain fields may be appended to quicken dynamic dispatch. The only item that may be prefixed is the V-table. If you which to be sure about the internal ABI specify the @dynamic
attribute. See more about this in the attributes section
- Introduction
- Installation
- VSL By Example
- Usage
- WASM (WebAssembly)
- The Basics
- Your First Program
- Syntax
- Concepts
- Modules
- Advanced Details
- Interop
- VSL Development
- Common Errors