june / V2 IR Snippet
0 Favoriten
0 Forks
1 Dateien
Zuletzt aktiv 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 Favoriten
0 Forks
1 Dateien
Zuletzt aktiv 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 Favoriten
0 Forks
1 Dateien
Zuletzt aktiv 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 @ *?| |
june / Tiling WM Draft
0 Favoriten
0 Forks
1 Dateien
Zuletzt aktiv 3 months ago
The start of a tiling WM.
| 1 | |:: focus on node $n :focus: $| |
| 2 | :: ensure node $n exists |
| 3 | :focus: $n |
| 4 | |:: focus on node $n| |
| 5 | :: ensure node $n exists |
| 6 | :focus: $n |
| 7 | |
| 8 | ||:nodes: root horizontal |
| 9 | |:: create a node under root :unique ID: $x?| |
| 10 | :: go to the next unique ID |
june / Stored Tasks
0 Favoriten
0 Forks
1 Dateien
Zuletzt aktiv 6 months ago
Store, recall and execute tasks in Nova.
| 1 | ||:: task foo |
| 2 | :: do something |
| 3 | :: do another thing |
| 4 | :: do yet another thing |
| 5 | :: end task |
| 6 | :: task bar |
| 7 | :: do another thing |
| 8 | :: do something |
| 9 | :: do yet another thing |
| 10 | :: end task |
june / Accounting Mocks
0 Favoriten
0 Forks
1 Dateien
Zuletzt aktiv 6 months ago
An example of turning pseudocode into a functional model.
| 1 | |# First, we need to import conditional statements. #| |
| 2 | ||'@include' https://gist.nouveau.community/june/72f7794abbf64eb3890e2715d7e7789b/raw/HEAD/conditional.nv |
| 3 | |
| 4 | |# Let's try something. #| |
| 5 | ||:: test the happy path |
| 6 | :: log in as june |
| 7 | :: transfer 100 from 1234 to 5678 |
| 8 | :: log out |
| 9 | |
| 10 | ||:: test the sad path |
june / Conditional Logic
0 Favoriten
0 Forks
1 Dateien
Zuletzt aktiv 6 months ago
If/else statements, implemented in Nova.
| 1 | ||:@control.enabled: |
| 2 | |
| 3 | || :@control.if: if |
| 4 | || :@control.then: then |
| 5 | || :@control.end: end |
| 6 | || :@control.else: else |
| 7 | || :@control.fail: fail |
| 8 | | :@control.enabled:? |
| 9 | :@control.fail: $fail? |
| 10 | :@control.then: $then? |
Neuer
Älter