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

Chapter 10: Functions #7

Merged
merged 14 commits into from
Dec 6, 2019
Merged

Chapter 10: Functions #7

merged 14 commits into from
Dec 6, 2019

Conversation

jeschkies
Copy link
Owner

@jeschkies jeschkies commented Nov 26, 2019

This patch implements the chapter on functions.

Instead of using an interface LoxCallable and and anonymous instance for native functions
I opted for an enum with the variants Native and User. Native functions are defined with a
function pointer and user functions are implemented the same way LoxFunctions are
implemented in the book.

The biggest difference is that we use Err and Result to jump back out of a call stack as
we don't have Exceptions.

@jeschkies jeschkies merged commit 0e10d13 into master Dec 6, 2019
@jeschkies jeschkies deleted the karsten/chapter-10 branch December 6, 2019 11:40
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