ela
Contents

ManualAgents

A list's procs and a map's

In the terminalela --spec a-list-s-procs-and-a-map-s

A proc for one kind of value is in its package: a list's in list., a map's in map., text's in str.. The top level holds what works on any value or on numbers: len, has, type_of, int, float, range, min, max.

hosts = list.append($hosts, "db")names = list.sort(map.keys($config), fold = true)total = list.sum($sizes)last  = list.tail(str.lines($out), 60)part  = str.tail($out, 3000)
  • append(…), sort(…), sum(…), keys(…), values(…) and get(…) are no procs: a call stops before line 1 with no proc named 'append'; ela's list procs are in list.: list.append(xs, item).
  • A slice past the end is an error. For "up to n", all of it when there are fewer, use list.head, list.tail, str.head or str.tail, never $xs[-60:].

(ela --spec list, ela --spec head)