context function 1: op-zip
op-zip:
description:
op-zip(seq) input-seq
zip together a sequence of operators with a sequence of superpositions (given by input-seq)
stops at the shorter of the two sequences
NB: it is invoked slightly differently from the python version
where it was: op-zip(seq, seq)
examples:
-- define some for-example operators:
-- but keep it abstract for now:
op1 (*) #=> |op1:> __ |__self>
op2 (*) #=> |op2:> __ |__self>
op3 (*) #=> |op3:> __ |__self>
-- define the corresponding operator sequence:
op |seq> => |op: op1> . |op: op2> . |op: op3>
-- define a for-example sequence, again, just something abstract:
the |input seq> => |a> . |b> . |c> . |d> . |e>
-- now apply it:
op-zip(op |seq>) the |input seq>
|op1: a> . |op2: b> . |op3: c>
see also:
numbers-to-words.sw3
Home