Mercurial > hg > ishara
view 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 source
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;