summaryrefslogtreecommitdiffstats
path: root/tests/012/except.tl
blob: 7fe9dad26c4308cb879617273b1dff6dd20a6dec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
(load "../common")

(defex d c b a)

(defmacro cont (. forms)
  ^(catch (progn ,*forms) (cont (arg) arg)))

(test
  (handle (list (cont (throw 'd 1))
                (cont (throw 'c 2)))
    (a (arg)
      (let ((cont (find-frame 'cont)))
        (if cont
          (progn
            (prinl arg)
            (invoke-catch cont 'cont (+ 100 arg)))))))
  (101 102))