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

Add Fruit - Assembler Forth-like #22

Open
kamil-adam opened this issue Jun 28, 2021 · 0 comments
Open

Add Fruit - Assembler Forth-like #22

kamil-adam opened this issue Jun 28, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@kamil-adam
Copy link
Contributor

kamil-adam commented Jun 28, 2021

  while (n > 0) {
        acc *= n;
        n--;
    }
loop 
  if (n > 0) 
    acc *= n;
    n--;
    recur; --next
fix (\rec ->
  if (n > 0) 
    acc *= n;
    n--;
    rec;
)
factorial = fix (\rec n acc -> 
    if n == 0 
    then acc 
    else rec (n - 1) (n * acc)
)

<~

~
=~
&~
|~

@kamil-adam kamil-adam added the enhancement New feature or request label Jun 28, 2021
@kamil-adam kamil-adam changed the title Add Back - Assembler Forth-like Add Fruit - Assembler Forth-like Jul 4, 2021
@kamil-adam kamil-adam added this to the 3.FORTH milestone Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants