API - LeFreq/Singularity GitHub Wiki
STUB: this has been revised. Every object derives from about 5 base objects.
There is a single API for every object exercising three dimensions of interaction:
- Lateral, data-passing dimension:
- message flow: send/receive; >>, <<
- identity: object NAME/get state (single word limit...?); CamelCase, ??Object or ?Object.
- A high-level, control-flow dimension and syntax, which could possibly replace exception handling, going up and down:
- swear: tells environment that result will be within expectations
- implore: checks all inputs against object/method constraints (can be turned off when trust builds from application)
- A low-level system-control dimension:
- run (or call): 1, or RUN
- clone object: %
STUB: regarding object APIs: Functions can have naked RETURNs, but objects should have SWEARs, giving close-ended documentation on the object's limits. The ecosystem also creates a programmer economy with needs/requires statements. These statements can be refined, much like pair programming can be used to build an application by erecting test harnesses that go up and down the architecture.
NOTES:
- Needs: these could be runnable tests, telling other programmers what kind of object in the ecosystem is desired.
- Requires: These could also be runnable tests, or some kind of syntax for type testing, range testing, what else?