3 ms·
call/cc. I understand what it is and what it does, but I don't understand how it's actually used in a practical way (all I've ever seen are synthetic/too abstra
by somethingsimple 9y ago
call/cc. I understand what it is and what it does, but I don't understand how it's actually used in a practical way (all I've ever seen are synthetic/too abstract examples).
- Johnny_Brahms 9y agoCheck out srfi-125 and the make-coroutine-generator: https://srfi.schemers.org/srfi-121/srfi-121.html https://srfi.schemers.org/srfi-121/srfi-121.html That is implemented using call/cc, and even though it is mostly a convenience function, it shows how call/cc can be used. It should be noted though, that call/cc is extremely expensive and prone to memory leaks. If you are using racket , scheme48 or guile you should use their delimited continuations instead.