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

wdte: no-argument lambdas don't work anymore #202

Open
DeedleFake opened this issue Jun 12, 2020 · 1 comment
Open

wdte: no-argument lambdas don't work anymore #202

DeedleFake opened this issue Jun 12, 2020 · 1 comment
Assignees
Labels

Comments

@DeedleFake
Copy link
Owner

Due to the removal of global lazy evaluation, in-line lambda definitions with no arguments, such as (@ f => ...) no longer work when passed as an argument to something, as they are just evaluated immediately. This is, obviously, not how it's supposed to work, but not evaluating them as a side-effect of the lazy evaluation seems like a potentially buggy solution, too. The best solution would probably be to hardcode argument evaluation to only be performed on specific types, thus avoiding the problem.

@DeedleFake DeedleFake added the bug label Jun 12, 2020
@DeedleFake DeedleFake self-assigned this Jun 12, 2020
@DeedleFake
Copy link
Owner Author

Purposefully not evaluating them won't work. The only way to call a function in the language is to simply use it. If a function has no arguments, it will get called immediately.

Alternative solution: Add a funcmod for denoting that a function is not functional and must be explicitly called. Calling the function then would require a separate function, maybe something like call. It might also make sense to apply the funcmod automatically to a lambda with one argument, since that isn't usually going to be useful. Or maybe just make a no-argument lambda a syntax error as the only thing you can really do with it that you can't do with just a normal compound is an infinite recursion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant