Advanced Symbolic Instruction Language Wiki
A 21st century programming language derived from BASIC
Status: Planning
Brought to you by:
willpittenger
Classes and structures different in several subtle and not so subtle ways.
| Feature | Structures | Classes |
|---|---|---|
| Inheritance | Structures can inherit any type other than classes besides Object | Classes can inherit any type |
| By reference versus by value | Instances of structures are normally by value; to get a By Reference location, use the ref type modification operator | Instances of classes are normally stored in references; to get a By Value location, use the byvalue type modification operator |
| Interface implementation | Structures can't themselves implement interfaces | Classes can implement interfaces as needed |
| Bitfields and unions | Structures can use these as needed | Classes may not declare bitfields or unions; to do that, drive from a structure that does it for you; Classes can, however, use a typed union |