\n(+ 1 (call/cc\n (lambda (k)\n (+ 2 (k 3)))))\n
Which ends up passing (+ 1 []) as the parameter into the lambda method. The lambda method then evaluates (k 3) as (+ 1 3) and returns 4 -- totally ignoring the (+ 2 ) part.
While I understand what it does, I don't understand what it's purpose is other than as a way to escape a function. Does anyone have any real world examples that help explain how call/cc is used?
Thanks,
John