Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Continuations: Ye or Nay?

Name: Anonymous 2014-08-30 1:45

This is what your Scheme compiler/interpreter does to everything you write just to support call/cc which most people rarely use. This is why some Schemes don't implement them.

http://en.wikipedia.org/wiki/Continuation-passing_style

; Your code
(define (pyth x y)
(sqrt (+ (* x x) (* y y))))

; Your Scheme repl shitting out your code
(define (pyth& x y k)
(*& x x (lambda (x2)
(*& y y (lambda (y2)
(+& x2 y2 (lambda (x2py2)
(sqrt& x2py2 k))))))))

Name: Anonymous 2014-08-31 10:38

>>5
You mean call/cc, right? You can't have lambda without having continuations. But you knew that because you read your SICP today, right?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List