Nested CPS "reset"

using the Scala 2.8 CPS compiler plugin, there are two magic controls reset and shift . Reset limits the continuation, and a shift captures the continuation.

There is an example of using CPS with NIO, using nested drops as a type of "forking" ...? I do not quite understand the purpose of nesting dumps, what is the effect?

+4
source share
1 answer

There is nothing magical about the reset wizard. A shift is applied to the innermost reset that spans it. The pseudo-formatting comment you see is just a description of the effective behavior from callbacks registered in the NIO selector.

+1
source

Source: https://habr.com/ru/post/1308290/


All Articles