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

Recursion not working properly #1

Closed
wiseodd opened this issue Jun 16, 2024 · 1 comment
Closed

Recursion not working properly #1

wiseodd opened this issue Jun 16, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@wiseodd
Copy link
Owner

wiseodd commented Jun 16, 2024

This yields -1:

fn fib(n) {
  if (n <= 1) {
    return n;
  } else {
    return fib(n - 2) + fib(n - 1);
  }
}

print fib(2);
@wiseodd wiseodd added the bug Something isn't working label Jun 16, 2024
@wiseodd wiseodd self-assigned this Jun 16, 2024
@wiseodd
Copy link
Owner Author

wiseodd commented Jul 7, 2024

Fixed by 0b9aa68 --- it was a problem with the environment nesting.

@wiseodd wiseodd closed this as completed Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant