next up previous contents index
Next: Sequence Reordering Functions Up: Sequence Functions Previous: Simple Sequence Functions

Scans and Reduces

plus_scan(a) {[a] tex2html_wrap_inline10113 [a] :: (a in number)}
  Given a sequence of numbers, plus_scan returns to each position of a new equal-length sequence, the sum of all previous positions in the source. For example:

4pt

tabular7694

max_scan(a) {[a] tex2html_wrap_inline10115 [a] :: (a in ordinal)}
  Given a sequence of ordinals, max_scan returns to each position of a new equal-length sequence, the maximum of all previous positions in the source. For example:

4pt

tabular7706

min_scan(a) {[a] tex2html_wrap_inline10119 [a] :: (a in ordinal)}
  Given a sequence of ordinals, min_scan returns to each position of a new equal-length sequence, the minimum of all previous positions in the source.

or_scan(a) {[a] tex2html_wrap_inline10121 [a] :: (a in logical)}
  A scan using logical-or on a sequence of logicals.

and_scan(a) {[a] tex2html_wrap_inline10123 [a] :: (a in logical)}
  A scan using logical-and on a sequence of logicals.

iseq(s, d, e) {(int, int, int) tex2html_wrap_inline10125 [int]}
  Returns a set of indices starting at s, increasing by d, and finishing before e. For example:

4pt

tabular7727

sum(v) {[a] tex2html_wrap_inline10127 a :: (a in number)}
  Given a sequence of numbers, sum returns their sum. For example:

4pt

tabular7743

max_val(v) {[a] tex2html_wrap_inline10129 a :: (a in ordinal)}
  Given a sequence of ordinals, max_val returns their maximum.

min_val(v) {[a] tex2html_wrap_inline10131 a :: (a in ordinal)}
  See max_val.

any(v) {[a] tex2html_wrap_inline10133 a :: (a in logical)}
  Given a sequence of booleans, any returns t iff any of them are t.

all(v) {[a] tex2html_wrap_inline10135 a :: (a in logical)}
  Given a sequence of booleans, all returns t iff all of them are t.

count(v) {[bool] tex2html_wrap_inline10137 int}
  Counts the number of t flags in a boolean sequence. For example:

4pt

tabular7767

max_index(v) {[a] tex2html_wrap_inline10139 int :: (a in ordinal)}
  Given a sequence of ordinals, max_index returns the index of the maximum value. If several values are equal, it returns the leftmost index. For example:

4pt

tabular7779

min_index(v) {[a] tex2html_wrap_inline10141 int :: (a in ordinal)}
  Given a sequence of ordinals, min_index returns the index of the minimum value. If several values are equal, it returns the leftmost index.



next up previous contents index
Next: Sequence Reordering Functions Up: Sequence Functions Previous: Simple Sequence Functions



Jonathan Hardwick
Tue Nov 28 13:57:00 EST 1995