june / V2 IR Snippet
0 beğeniler
0 çatallar
1 dosyalar
Son aktivite 1 week ago
An example of V2's intermediate representation.
| 1 | { |
| 2 | "foo": [ |
| 3 | { |
| 4 | "conditions": [ |
| 5 | { |
| 6 | "stack": "bar", |
| 7 | "pattern": [ |
| 8 | { |
| 9 | "type": "variable", |
| 10 | "symbol": "baz" |
june / Deck of Cards
0 beğeniler
0 çatallar
1 dosyalar
Son aktivite 2 months ago
Generate a deck of cards.
| 1 | ||:: form a deck :suits: (spades hearts diamonds clubs) |
| 2 | :ranks: (2 3 4 5 6 7 8 9 jack queen king ace) |
| 3 | |
| 4 | |:: form a deck? :suits: $suit| |
| 5 | :: match $suit to a rank |
| 6 | :used suits: $suit |
| 7 | |:: form a deck| |
| 8 | :: reset suits |
| 9 | |
| 10 | |:: match $suit to a rank? :ranks: $rank| |
june / Quad Store w/ Arrays
0 beğeniler
0 çatallar
1 dosyalar
Son aktivite 2 months ago
A definition of a quad store, and an example defining arrays.
| 1 | ||:: foo @ 0 = 10 |
| 2 | :: foo @ 1 = 20 |
| 3 | :: foo @ 2 = 30 |
| 4 | :: foo @ 0 |
| 5 | :: foo @ * |
| 6 | |
| 7 | |:: $name @ *? :found: array $name $index $value| |
| 8 | :values: $value |
| 9 | |:: $name @ * :empty:| |
| 10 | |:: $name @ *?| |
Daha yeni
Daha eski