jducoeur: (0)
jducoeur ([personal profile] jducoeur) wrote 2011-03-17 03:45 am (UTC)

Well, I'm not sure that anybody *actually* implements loops as continuations outside the extremely purist-functional world -- Scala is built on the JVM, so I think that its "ordinary" looking loops are constructed just like Java's. (Its extended form of for loop is a separate beast entirely, but is more a variation of map than a true loop anyway.)

My impression (I haven't really internalized the discussion) is that, from a purist's POV, the "break" statement is problematic -- that's when continuations seem to come up in theoretical discussions. In *practical* discussions, though, continuations mostly seem to get used for really novel control flows that aren't natively supported in the language. To support that, Scala provides CPS continuations at the library level; I don't yet really grok their usage, but that's on my to-learn list...

Post a comment in response:

(will be screened)
(will be screened if not validated)
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting