Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔨 implement adverbs #5

Merged
merged 7 commits into from
Nov 15, 2023
Merged

🔨 implement adverbs #5

merged 7 commits into from
Nov 15, 2023

Conversation

cratelyn
Copy link
Owner

@cratelyn cratelyn commented Nov 8, 2023

this branch implements the / and \ adverbs.

for the corresponding reference pages in the J wiki, see:


✨ examples

monadic / "insert" adverb

; cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.09s
     Running `target/debug/j`
  + / 1 2 3
6

  + / 1 2 3 4
10

  * / 1 2 3
6

  * / 1 2 3 4
24

dyadic / "table" adverb

; cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.09s
     Running `target/debug/j`
  1 2 3 4 5 * / 1 2 3 4 5
1 2 3 4 5
2 4 6 8 10
3 6 9 12 15
4 8 12 16 20
5 10 15 20 25

  1 2 3 4 5 + / 1 2 3 4 5
2 3 4 5 6
3 4 5 6 7
4 5 6 7 8
5 6 7 8 9
6 7 8 9 10

monadic \ "prefix" adverb

; cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.09s
     Running `target/debug/j`
  ] \ 1 2 3
1 0 0
1 2 0
1 2 3

  ] \ 1 2 3 4 5
1 0 0 0 0
1 2 0 0 0
1 2 3 0 0
1 2 3 4 0
1 2 3 4 5

dyadic \ "infix" adverb

; cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.09s
     Running `target/debug/j`
  3 ] \ 1 2 3 4
1 2 3
2 3 4

  3 ] \ 1 2 3 4 5
1 2 3
2 3 4
3 4 5

@cratelyn cratelyn added the example-pulls example pull requests referenced in README.md label Nov 8, 2023
@cratelyn cratelyn self-assigned this Nov 8, 2023
@cratelyn cratelyn force-pushed the adverbs branch 2 times, most recently from 5d77851 to 4c04766 Compare November 15, 2023 15:31
@cratelyn cratelyn mentioned this pull request Nov 15, 2023
@cratelyn cratelyn marked this pull request as ready for review November 15, 2023 16:05
@cratelyn cratelyn changed the title 🔨 wip: implement adverbs 🔨 implement adverbs Nov 15, 2023
@cratelyn cratelyn merged commit c98657b into main Nov 15, 2023
1 check passed
@cratelyn cratelyn removed the example-pulls example pull requests referenced in README.md label Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant