tricu

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

stableSlice.tri (409B)


      1 -- Direct self-recursion. Parameter order follows the public API.
      2 -- No y, worker/wrapper split, lazy branch thunks, or dependency token.
      3 tfSlice start end [] = []
      4 tfSlice start end [char | rest] = (matchBool
      5   (tfSlice (pred start) (pred end) rest)
      6   (matchBool [] (pair char (tfSlice 0 (pred end) rest)) (isZero_? end))
      7   (not? (isZero_? start)))
      8 tfSlice start end input = []
      9 main input = tfSlice 2 5 input