annotate sequences/@seq/span.m @ 8:f0a3d7d7a0e3
Renamed cat_sep function to catsep
author |
samer |
date |
Mon, 14 Jan 2013 14:54:10 +0000 |
parents |
3f77126f7b5f |
children |
|
rev |
line source |
samer@3
|
1 function [h,x]=span(f,x)
|
samer@3
|
2 % span - divide sequence using a test function
|
samer@3
|
3 %
|
samer@3
|
4 % span :: (A->bool), seq(A) -> seq(A), seq(A).
|
samer@3
|
5 %
|
samer@3
|
6 % span(f,x) = takeWhile(f,x), dropWhile(f,x)
|
samer@3
|
7 % Will not terminate if head segments turns out to be infinite.
|
samer@3
|
8 [Y,x]=spanc(f,x);
|
samer@3
|
9 h=cellseq(Y);
|