Re: [racket-users] simple question about call/cc

2020-12-08 Thread Laurent
Tim, if you paste your code in the definitions in DrRacket (with the #lang racket line), and run it (as a module, thus), you obtain this in the interactions window: 3 10 6 The `3` is because of the `(add1 (call/cc ... 2)))` expression, which is reduced to `(add1 2)` with the side effect of recordi

Re: [racket-users] simple question about call/cc

2020-12-07 Thread Justin Zamora
The duplication is because you're evaluating the expression at top level, so the repl is part of the continuation. The continuation isn't (lambda (c) (c e2); it's actually something like (lambda (c) (evaluate-in-repl (c e2)). So when you run (ret 9), you're actually re-running the repl you had when