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

Recursive functions need to be made lazy #28

Closed
paf31 opened this issue Oct 22, 2013 · 1 comment
Closed

Recursive functions need to be made lazy #28

paf31 opened this issue Oct 22, 2013 · 1 comment

Comments

@paf31
Copy link
Contributor

paf31 commented Oct 22, 2013

foo = foo compiles but gives a runtime error foo is not defined

@paf31
Copy link
Contributor Author

paf31 commented Oct 26, 2013

Potential solution: for function types at the top level, generate code of the form:

function foo(args) {
    return body;
}

instead of

foo = function(args) {
    return body;
};

For all other types, do not allow recursion. The user can add explicit laziness in the form of \ -> ... if other types need to be made recursive.

@paf31 paf31 closed this as completed Oct 27, 2013
dunhamsteve pushed a commit to dunhamsteve/purescript that referenced this issue Jul 11, 2021
dunhamsteve pushed a commit to dunhamsteve/purescript that referenced this issue Jul 11, 2021
Search with and without parentheses. Fixes purescript#28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant