You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My process of understanding did involve tinkering with some code, and it seemed to me that the code for the various combinators was at times less simple than it could have been.
I do understand the interest of presenting the first one, it does help with understanding the classical approach based on lambda-calculus which enables recursion without names (the real mind-bender here), but I'd much rather have the second one in my actual code!
In fact, I found it easier to understand the anonymous version by working backward from the version that uses the wrapper binding.
You do say that of a combinator that "It cannot create a named function expression." and "It cannot declare any bindings other than via parameters." But since you relax some other requirements for the idiomatic version, surely those could be relaxed too in practice.
The difference is even more dramatic regarding the long-tailed widowbird/trampoline:
Finally, a question, just to be sure I understood correctly. You write:
Let’s begin our cleanup by moving Thunk inside our function. This has certain technical advantages if we ever create a recursive program that itself returns thunks.
Do you mean that we want to distinguish the thunks returned by a why-form function passed to to the trampoline from the thunk that the trampoline uses internally?
Thanks again, and cheers!
The text was updated successfully, but these errors were encountered:
Hey Reginald!
I've been reading "Why Y? Deriving the Y Combinator in JavaScript" with great pleasure. I was somewhat familiar with the concepts, but following through really helped them click. Thank you!
My process of understanding did involve tinkering with some code, and it seemed to me that the code for the various combinators was at times less simple than it could have been.
For instance, your formulate the why bird as:
Why not opt for the more intuitive:
I do understand the interest of presenting the first one, it does help with understanding the classical approach based on lambda-calculus which enables recursion without names (the real mind-bender here), but I'd much rather have the second one in my actual code!
In fact, I found it easier to understand the anonymous version by working backward from the version that uses the
wrapper
binding.You do say that of a combinator that "It cannot create a named function expression." and "It cannot declare any bindings other than via parameters." But since you relax some other requirements for the idiomatic version, surely those could be relaxed too in practice.
The difference is even more dramatic regarding the long-tailed widowbird/trampoline:
My simplified version:
Finally, a question, just to be sure I understood correctly. You write:
Do you mean that we want to distinguish the thunks returned by a why-form function passed to to the trampoline from the thunk that the trampoline uses internally?
Thanks again, and cheers!
The text was updated successfully, but these errors were encountered: