## Slide V08_page 33_Continuations example

vikumar
Neuling
Beiträge: 4
Registriert: 16. Mai 2016 16:07

### Slide V08_page 33_Continuations example

In the code given in the slide:

Code: Alles auswählen

println(reset {shift { k: (Int=>Int) => k(k(k(7))); "done" } + 1})
How would the instruction "done" affect the answer of the computation? I could reason the answers of other questions in the slide, but having difficulty with this one. Any help would be appreciated.

MrGumby
Mausschubser
Beiträge: 65
Registriert: 16. Apr 2013 15:07

### Re: Slide V08_page 33_Continuations example

I think it doesn't at all. At least I wrote in my slides, that the result is just 'done'.

vikumar
Neuling
Beiträge: 4
Registriert: 16. Mai 2016 16:07

### Re: Slide V08_page 33_Continuations example

Thanks for the response. Could you explain your reasoning a bit.

prabhjot
Erstie
Beiträge: 11
Registriert: 5. Aug 2016 16:30

### Re: Slide V08_page 33_Continuations example

"done" being the last statement after the computation, so result evaluated till then (i.e. 10) is thrown away and just a string is returned.