next up previous
Next: 9.3 concatenate Up: 9 シーケンスデータ Previous: 9.1 リストとベクタ


9.2 reduce

reduceという関数もシーケンスを扱える関数の一つです. some, every, notany, noteveryなどというものも用意されています.
<cl> (reduce #'+ '(1 2 3 4))
10 
<cl> (reduce #'+ '#(1 2 3 4))
10 
<cl> (some 'oddp '(1 2 3 4 5 6))
T 
<cl> (every 'oddp '(1 2 3 4 5 6))
NIL 
<cl> (notany 'oddp '(1 2 3 4 5))
NIL 
<cl> (notevery 'oddp '(1 2 3 4 5))
T


generated through LaTeX2HTML. M.Inaba 平成18年5月7日