Skip to content

Add Fruit - Assembler Forth-like #22

@kamil-adam

Description

@kamil-adam
  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)
)

<~

~
=~
&~
|~

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions