def nth_word

cswap-bend-cli@0.1.0.0 · daemon/sess.bend:201

import cswap-bend-cli@0.1.0.0/daemon/sess.bend as Sess
import Base

201# Field 22 of /proc/<pid>/stat (counted from the last `)`), the Linux stamp.
202def nth_word(+ws: List<&2, String>, +n: U32) -> Maybe<&2, String>:
203  match ws:
204    case Nil{}:
205      None{}
206    case Con{h, t}:
207      nth_hit(U32.is_eq(n, 0), h, nth_word(t, (n - 1 : U32)))

Uses (7)

Used by (1)