Mercurial > hg > ishara
diff sequences/split.m @ 0:672052bd81f8
Initial partial import.
author | samer |
---|---|
date | Wed, 19 Dec 2012 22:38:28 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sequences/split.m Wed Dec 19 22:38:28 2012 +0000 @@ -0,0 +1,11 @@ +function [h,t]=split(dim,n,s) +% split - gather first n elements and return with rest of sequence +% +% split :: D:natural, N:natural, seq A -> [[N]->A], seq A + +h=[]; +for i=1:n, x=head(s); h=cat(dim,h,x); s=next(s); end +t=s; + + +