| |
| | [No title] |
 | | local lseq, x lseq := [] every x := !s do if type(x) == "list" then lseq := sflatten(x) else put(lseq, x) return lseq end procedure sground(seq, i) #: ground sequence to i local j /i := 1 j := smin ! |
 | | return lseq while j := get(x) do { lseq := sruns(i, j, 1) pull(lseq) i := j } put(lseq, i) return lseq end procedure sruns(xargs[]) # disconnected runs local lseq, i, j, k, limit, x1, x2, x3 if \node_gen then return node("sruns", xargs) x1 := copy(spromote(xargs[1])) x2 := copy(spromote(xargs[2])) x3 := copy(spromote(xargs[3])) |
 | | end procedure sreplp(x1, x2) local lseq, i x1 := spromote(x1) x2 := spromote(x2) lseq := [] while i := get(x1) do every 1 to get(x2) do put(lseq, i) return lseq end procedure sundulant(x, sw) # get undulant local lseq, i, dir, cdir x := spromote(x) lseq := [x[1]] |
| www.cs.arizona.edu /icon/library/src/procs/seqops.icn (844 words) |
|