packages feed

funcons-simple-0.1.0.3: tests/Kexceptions/Kexceptions04.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
                (scope
                  (bind
                    ("x",
                     allocate-initialised-variable
                       (values,
                        decimal-natural ("5"))),
                   sequential
                     (throw (assigned (bound ("x"))),
                      effect (bind
                        ("y",
                         allocate-initialised-variable
                           (values,
                            checked integer-divide
                              (assigned (bound ("x")),
                               decimal-natural ("0"))))))),
                 scope
                   (bind
                     ("y",
                      allocate-initialised-variable
                        (values,
                         given)),
                    sequential
                      (effect (give
                        (integer-add
                          (assigned (bound ("y")),
                           decimal-natural ("2")),
                         sequential
                           (assign
                             (bound ("y"),
                              given),
                            given))),
                       print (assigned (bound ("y")),
                       " ")))),
               print (assigned (bound ("x")),
               "\n"))))))),
   apply
     (assigned (bound ("main")),
      tuple ())))