Continuation, callcc method is not defined
-
26-02-2021 - |
Question
I wanted to learn something about Continuation, type several examples from some articles with callcc method and I've got the error:
NoMethodError: undefined method `callcc' for main:Object
from (pry):2:in `<main>'
None of articles have mentioned to include continuation library. So how to fix this problem? Thanks
EDIT: ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
Solution
From the fine manual:
Continuation objects are generated by Kernel#callcc, after having required continuation.
OTHER TIPS
You need to require 'continuation'.
require 'continuation'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow