evhub / evhub/coconut

Add back an @recursive decorator

Open
#272 2 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
Python
Stars
4.4k
Forks
142
PR merge metrics
No merged PRs in 30d

Description

The new version of `@recursive` would:

1. enable TRE even when `--no-tco` is in effect, and
2. disable the "if function is still function" check in the rewritten code.

Thus, `@recursive` would make TRE much faster for functions that rely on it, as well as allow it to work without TCO.

Since `@recursive` would effectively be a compiler flag, not a real decorator, the only thing added to the header would be:
```python
def recursive(*args, **kwargs);
raise _coconut.RuntimeError("recursive is not a real function and should only be used to decorate tail recursive functions")
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.