packages feed

funcons-simple-0.1.0.3: tests/Kexceptions/Kexceptions03.fct

initialise-binding initialise-storing initialise-giving finalise-failing finalise-throwing scope
  (collateral (bind
    ("main",
     allocate-variable (functions
       (tuples ((values)*),
        values)))),
   sequential (assign
     (bound ("main"),
      function closure (scope
        (match
          (given,
           tuple ()),
         handle-return (scope
           (bind
             ("x",
              allocate-initialised-variable
                (values,
                 decimal-natural ("1"))),
            sequential
              (handle-thrown
                (sequential
                  (effect (give
                    (integer-add
                      (assigned (bound ("x")),
                       decimal-natural ("1")),
                     sequential
                       (assign
                         (bound ("x"),
                          given),
                        given))),
                   throw (assigned (bound ("x"))),
                   effect (give
                     (checked integer-divide
                       (assigned (bound ("x")),
                        decimal-natural ("0")),
                      sequential
                        (assign
                          (bound ("x"),
                           given),
                         given)))),
                 scope
                   (bind
                     ("y",
                      allocate-initialised-variable
                        (values,
                         given)),
                    effect (give
                      (integer-add
                        (assigned (bound ("y")),
                         decimal-natural ("1")),
                       sequential
                         (assign
                           (bound ("x"),
                            given),
                          given))))),
               print (assigned (bound ("x")),
               "\n"))))))),
   apply
     (assigned (bound ("main")),
      tuple ())))