Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Question about Scala continuation

As I understand shift and reset are just library functions. Is it correct that all continuation stuff is implemented as a library and Scala compiler does not do any special work to transform the code inside the reset block?

like image 211
Michael Avatar asked Jan 20 '23 17:01

Michael


1 Answers

No, that's not the case. Part of that support is in library and the other part in a compiler plugin. The compiler plugin transforms the code inside reset to continuation-passing form. You need to have this compiler plugin in your build process. In the runtime, scala standard library is sufficient.

like image 142
Przemek Pokrywka Avatar answered Jan 30 '23 06:01

Przemek Pokrywka