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 an explicit recur special #171

Open
obriencj opened this issue Apr 22, 2018 · 0 comments
Open

Add an explicit recur special #171

obriencj opened this issue Apr 22, 2018 · 0 comments

Comments

@obriencj
Copy link
Owner

Currently, with tail-call-recursion enabled, a function will check if a call in a tail position is invoking itself. This relies on functions having a self-reference, which is provided by a closure generated around all functions with a name of "", to which the invocation can do an identity test.

Recursion in this fashion relies on the function having a name as well.

Add a form named recur which will explicitly act to restart the function.

Recur should raise a compile-time exception if used in a non-tail-call position.

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

No branches or pull requests

1 participant