packages feed

funcons-simple-0.1.0.3: tests/Advanced/Advanced1.fct

initialise-binding initialise-storing initialise-giving finalise-failing finalise-throwing scope
  (collateral (bind
    ("main",
     allocate-variable (functions
       (tuples ((values)*),
        values))),
  bind
    ("fact",
     allocate-variable (functions
       (tuples ((values)*),
        values)))),
   sequential (assign
     (bound ("main"),
      function closure (scope
        (match
          (given,
           tuple ()),
         handle-return (print (apply
           (assigned (bound ("fact")),
            tuple (decimal-natural ("5")))))))),
   assign
     (bound ("fact"),
      function closure (scope
        (match
          (given,
           tuple (pattern closure (bind
             ("n",
              allocate-initialised-variable
                (values,
                 given))))),
         handle-return (if-else
           (is-equal
             (assigned (bound ("n")),
              decimal-natural ("1")),
            return (decimal-natural ("1")),
            return (integer-multiply
              (assigned (bound ("n")),
               apply
                 (assigned (bound ("fact")),
                  tuple (integer-subtract
                    (assigned (bound ("n")),
                     decimal-natural ("1"))))))))))),
   apply
     (assigned (bound ("main")),
      tuple ())))