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-30 6:06

Undelimited continuations are shit.

Name: Anonymous 2014-08-30 6:17

>>1
some Schemes don't implement them
Hahaha fucking LOL'd. Scheme retards constantly brag about how minimalistic their language standard is, yet half of what purports to be a Scheme can't even implement it!

Name: Anonymous 2014-08-30 22:16

>>3

Continuations are easy to implement, yet hard to implement efficiently.

Anyone can learn Lisp in a few minutes, but nobody could master lisping in a thousand years.

Name: Anonymous 2014-08-30 22:32

>>4
Are they part of the fucking standard or not? Are. They. Part. Of. The. Standard.

Nobody cares about how hard continuations are to implement. If it's Scheme, it must have continuations. If it doesn't, then it's not a Scheme.

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?

Name: Anonymous 2014-08-31 21:13

>>6
Sure you can, you still do the CPS transformation into tail calls, but then you inline everything and don't bother with allocating GC frames to capture the continuation and arguments.

Name: Anonymous 2014-08-31 23:48

>>7
No, I mean having lambda gives you continuations. They're not some special function of the environment. To wit, you can do the CPS transform yourself, in Scheme, using what a normal human would use: lambda.

Name: Anonymous 2014-09-01 16:08

>>7

you inline everything and don't bother with allocating GC frames to capture the continuation and arguments.
This already requires optimizing compiler with a lot of analyzing, making any efficient Scheme implementation non-trivial.

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