tiancaiamao / cora

Genius programmer should write his own lisp!
52 stars 8 forks source link

runtime: resume continuation should discard handler's stack #45

Closed tiancaiamao closed 2 months ago

tiancaiamao commented 2 months ago
(try (lambda ()
       (let fd (throw 'Accept)
        (begin
         (throw 'Spawn)
         (+ fd 42))))
     (lambda (v k)
       (match v
          'Accept (begin
               (k 666)
               42)
          'Spawn (k ()))))

In (k 666) the stack is not empty. Something like

try -> return 42 ->

The return 42 stack should be discard!