-
Notifications
You must be signed in to change notification settings - Fork 54
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
Implement zero-arg functions in eval.rs
#5
Comments
This should get you started: Comments in code at least intend to point to where this should happen: And here is how it's done in Note that |
I can think of at least two ways of doing it:
Any thoughts? |
I think the most economical thing (both conceptually and in terms of computation) is to use Although the context of the code there may have drifted, I think that (just use |
I am not sure what you have in mind for distinguishing the zero-arg case from the one-arg case when matching on Continuation::Call. |
Sounds like we need to change handling of |
Ah, I think that if it turns out we can use I think this is where we have parsed the input and know we need to handle a zero-arg function. https://github.com/lurk-lang/lurk-rs/blob/master/src/eval.rs#L473 |
We still have two steps: we need to evaluate the |
Right, I agree with that. Am just paging this in. If my previous makes sense as far as it goes, then I think you're on track here. |
Yeah, sorry if it would be faster for you to implement than to explain what you had in mind :D I am not convinced we can do it with one Continuation::Tail because how are we going to get the Thanks. |
I think using the one-arg translation of zero-arg functions might be the most economical, since it's just a syntactic change. |
I think you might be right. I don't have time to trace this all down right now, and I suspect that if I do I will end up with the same conclusion. So… I think it's probably worthwhile for you to go ahead and implement that way. If a viable competitor emerges, we can look at it, but if you have a line on this, feel free to proceed. |
Sounds good, thanks! |
The implementation simply desugars each zero-arg function into a one-argument function taking nil.
No description provided.
The text was updated successfully, but these errors were encountered: