-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from daddinuz/spike
Refactor
- Loading branch information
Showing
36 changed files
with
610 additions
and
1,632 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[env] | ||
CARGO_WORKSPACE_DIR = { value = "", relative = true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Rust | ||
|
||
on: | ||
push: | ||
branches: [ "main", "dev" ] | ||
pull_request: | ||
branches: [ "main", "dev" ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build | ||
run: cargo build --verbose | ||
- name: Run tests | ||
run: cargo test --verbose |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
: make-adder = [$x add] bind ; | ||
40 2 make-adder i say |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
: fact ← [dup zero?] [incr] [dup decr] [mul] linrec ; | ||
: fact = [dup zero?] [incr] [dup decr] [mul] linrec ; | ||
5 fact say |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
: fib ← [dup 3 lt] [pop 1] [decr dup decr] [add] binrec ; | ||
: fib = [dup 3 lt?] [pop 1] [decr dup decr] [add] binrec ; | ||
30 fib say |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
: ^new = [$first-name $last-name $age] bind ; | ||
: ^first-name = 0 at ; | ||
: ^last-name = 1 at ; | ||
: ^age = 2 at ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
: std @ rat\std ; | ||
|
||
: small? ← 1 lt ; | ||
: small? = 1 lt? ; | ||
|
||
# with recursion | ||
: f ← std\over small? [pop] [[dup decr] dip dup i] if-else ; | ||
: f = std\over small? [pop] [[dup decr] dip dup i] if-else ; | ||
10 [f] f | ||
|
||
# with combinators | ||
: f ← [dup small?] [] [dup decr] [] linrec ; | ||
: f = [dup small?] [] [dup decr] [] linrec ; | ||
10 f | ||
|
||
show |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.