1

I am currently learning the concept of continuations. I am struggling with understanding why direct control flow manipulation by e.g. goto command is a bad practice, but doing so using call/cc is just fine. Isn't it the same thing, but achieved by different means?

Why using goto is regarded as a bad practice, but using call/cc is not?

M. Twarog
  • 2,418
  • 3
  • 21
  • 39
  • 1
    It is: [An argument against call/cc](http://okmij.org/ftp/continuations/against-callcc.html) –  Jan 23 '20 at 11:20
  • 1
    Delimited (or composable) continuations are a viable alternative with some desirable traits: [Delimited Continuations for Everyone by Kenichi Asai](https://www.youtube.com/watch?v=QNM-njddhIw) –  Jan 23 '20 at 11:23
  • @bob Oleg Kiselyov article is actually the reason why I asked this question. My reasoning was that if he wrote the article then it must stand in opposition to wide usage of call/cc (therefor not regarded as bad). – M. Twarog Jan 23 '20 at 11:24
  • 1
    Good point. So the question is how many languages actually implement `call/cc` as a core language feature. I think `call/cc` was rather an academic debate and an object of research.. People have barely used it, right? –  Jan 23 '20 at 11:41
  • I'm not sure if one can say that call/cc was only academic concept. According to wikipedia it is implemented in few quite notable languages (e.g. C++, Ruby): https://en.wikipedia.org/wiki/Call-with-current-continuation#Languages_implementing_call/cc If it is actually widely used in people's projects? I'm not sure about that. – M. Twarog Jan 23 '20 at 12:10

0 Answers0