Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Maybe my brain just isn't functioning right now but I don't think writing in CPS is the same as having access to first class continuations? But as previously noted I think that was a misplaced request on my part to begin with.


It should be! e.g. if every function takes a continuation as its final argument, then:

  call/cc& = \f. \k. f k k
Then in f you can invoke the continuation k as many times as you want, but that does involve a whole program transformation to CPS.


My line of thought had been that doing so doesn't restore execution context. But it dawns on me that without the ability to mutate variables that doesn't have the same relevance.

Still, doesn't it throw the de bruijn indexes off? Or am I wrong about that as well?

Lambda calculus makes my head hurt.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: