YREA-SLS/v0.3 ideas.md

26 lines
839 B
Markdown

I have a few changes to this to make it match my vision more:
- Every operator defined should have a trait
- Remove `-rot`, `2dup`, `2drop`, `nip`, and `tuck`
- Make `roll` use the top two of the stack as the number of items to rotate and how many times to do so
- Make `rot` do what `roll` currently does
- Change `**` to `^`
Base Traits (Non-Exhaustive):
- `Pushable`
- `ArrayOf`
- `Addable`
- `Number`
- `String`
- `Identifier`
- `Trait`
Trait Examples:
- `{ (TokenString Identifier --) trait: (Identifier TokenString Identifier --) impl: (ArrayOf[Identifier] Identifier --) inher: } ::Implementable trait`
- `{ (Self Self -- Self) +: (Self Self -- Self) -: } ::Addable trait`
Example Implementations:
- `::i32 { (Self Self -- Addable) { code } } ::Addable impl`
Example Inheritance:
- `[ ::Addable ::Multiplyable ] ::Number inher`