3

Is it possible to do a Call-with-current-continuation in Google's new Language Go?

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
hawkeye
  • 34,745
  • 30
  • 150
  • 304
  • 1
    Which use do you want an equiv for? For yielding, or for coroutines, or? – Will Nov 11 '09 at 09:01
  • 2
    Can we `give Go a rest`, and/or seek Go-related info `at the source`, until the language has a broader community of effective practitioners? – mjv Nov 11 '09 at 09:05
  • Replace **go-language** with **go**, which seems to have won (and makes more sense) – Jed Smith Nov 11 '09 at 17:38
  • call/cc! What a feature! IMHO `call/cc` is to gorotines/closures as `goto` is to `for`/function calls. see [Call/CC considered harmful](http://okmij.org/ftp/continuations/against-callcc.html) – deft_code Jun 10 '14 at 20:19

1 Answers1

5

According to one of the go contributors, no it's not possible.

wulong
  • 2,657
  • 1
  • 20
  • 19
  • 1
    Good call. Two points from that thread: (i) go closures are heap allocated (not trampolined or anything), and (ii) "Goroutines are equivalent to one-shot (use and forget) continuations". – Charles Stewart Dec 04 '09 at 19:18