12345678910111213141516171819202122232425 |
- { A selection of generally-useful functions. Each much be defined
- with only primitives, since variables might be expanded after being
- redefined be users. }
- [[!][12012]@[#]++*+[!]_?][#]: { while }
- [[])]N: { newstack }
- [[%]_]p: { popd }
- [%%]P: { pop2 }
- [[0101]@]D: { dup2 }
- [[210]@]r: { rot }
- [[120]@]b: { bury2 }
- [[201]@]d: { dig2 }
- [25*,]n: { newline }
- [48*,]s: { space }
- { [[[25*][%]]
- [[48*][%]]
- [$]]c;! "case"}
- [$[]=$~\
- [[%]_]? { if empty, consume input and do nothing }
- [$0[[[]=~]_][1+[-\%]_]# { get length of input }
- 2<$~
- [[-[--%[![$]_=]_?]_c;!]?]_ { compare, execute, and recurse }
- [-%!]? { if singleton then default case }
- ]?]c: { case }
|