Skip to content

Add return statement #17

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add return statement #17

wants to merge 3 commits into from

Conversation

HyperCodec
Copy link
Owner

No description provided.

@HyperCodec HyperCodec added the enhancement New feature or request label Sep 12, 2024
@HyperCodec HyperCodec self-assigned this Sep 12, 2024
@HyperCodec HyperCodec linked an issue Sep 12, 2024 that may be closed by this pull request
@HyperCodec
Copy link
Owner Author

It appears that fibonacci may be breaking due to stack overflow (should probably add an error message for that) because return doesn't exit the function when it's inside an if statement.

@HyperCodec
Copy link
Owner Author

I think to solve this I'll just change the Fibonacci example bc this would take a pretty large refactor to fix. I kind of like the idea of context-specific returns anyway.

@HyperCodec
Copy link
Owner Author

I think to solve this I'll just change the Fibonacci example bc this would take a pretty large refactor to fix. I kind of like the idea of context-specific returns anyway.

nvm need the complex solution either way

@HyperCodec
Copy link
Owner Author

Fibonacci now doesn't error, but still buggy because it doesn't produce the intended results. I'm gonna try to rewrite without memoization to see if that does anything

@HyperCodec
Copy link
Owner Author

I implemented factorial too and it's also broken, but I did the same algorithm and it worked. Looks like recursive functions are doing weird stuff with math rn.

@HyperCodec
Copy link
Owner Author

I think what's happening is it's not properly modifying the values of the return statements but I don't really know why or how.

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

Successfully merging this pull request may close these issues.

Return statement
1 participant