2 ms·
well technically they aren't aware of it, just like literals aren't necessarily aware. But when you write the code, that resolution happens. So when I write:
by rtpg 12y ago
well technically they aren't aware of it, just like literals aren't necessarily aware.
But when you write the code, that resolution happens. So when I write:
f x = if x=0 then 1 else f (x-1)
it looks at the definition and resolves the naming of f at that moment. Just like it does for x.
The idea that the identifier f is referring to "whatever f is bound to at the moment this function is run" seems extremely scary: the obvious alternative is to simply pass in a continuation!
Given the simple alternative, I can't see anyone defending the behaviour described in the article.