tricu

An interpreted language for exploring Tree Calculus
Log | Files | Refs | README | LICENSE

stagedFormatterSlice.tri (369B)


      1 -- Replacement fragment, not a standalone unit. Bounds remain outer captures;
      2 -- the compiler owns input inspection, the original tail and the fixed point.
      3 tfSlice start end input = (stageList input 0
      4   (_ : [])
      5   (char index : stageIf (lt_? index start)
      6     (stageNext (succ index))
      7     (stageIf (lt_? index end)
      8       (pair char (stageNext (succ index)))
      9       [])))