Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Continuations by Example (might.net)
15 points by marvinborner on June 25, 2024 | hide | past | favorite | 2 comments


I don't find the description or the examples here very well explained. What does call/cc do? What does cc do? what is this code, or is it just a comment?

  (continuation of 3 \* (f() + 8))(result) ;
The descriptions are just hard to parse:

  The value passed to the continuation is the return value of the call.
  
  During the execution of the expression body, the variable current-continuation is bound to the current continuation. If invoked, current-continuation immediately returns from the call to call/cc ...
And the initial 'teaser' is explained later, but not demonstrated by showing actuial code for assert and amb.


I’m not super well versed in continuations, is right-now/go-when analogous to reset and shift, or are these different ideas?




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

Search: