functional programming - Do continuation record the PC and register states? -


Currently, when I am using continuation in functional languages, my understanding is that a continuation current program counter Records and registers files, and when a continuation is returned, then the PC and registered files will be restored in the values ​​entered.

So in the following dumb example,

 ; Just now: - & gt; Moment (Define (just now) (call-along-on-continuation (lambda (CC) (CC CC))); Know-When: Moment - & gt; ... (define (later) (then then)); An eternal loop: (let's ((start- (just now)) (show "hello, world!") (New line) (when-beginning); here was continuously released for beginners, when finally A continuation will be applicable for a continuity, which gives a continuity, due to which the program points will start in the states registered in PCs and registers. I do not believe that my understanding Is correct .. please correct me if you think it is not .......  

There are no program counters and register files that have continuity records.

The best way to describe the meaning of call-to-on-continuation is to record this program context for example, suppose you are evaluating the program

  (+ 3 (f (call-to-on-continuation g))   

In this case, call-to-on-continuously expressed Reference will

  (+ 3 (f [hole]))   

That is, around the current expression The accessories of

Currently the call-in-in-intensification captures one of these references. Due to continuation of continuity, replacement is replaced with the one stored in the current reference.

There is a lot of references to the pile , except that there is nothing special about function calls in references.

This is a very brief treatment. I strongly urge you to take a look to see more and more careful on this topic especially in Part 7 of the book of Shri Ram Krishnamurti (free, online). .

Comments