Actions
Useful list functions » History » Revision 1
Revision 1/2
| Next »
iri, 12/17/2011 10:51 PM
Useful list functions¶
- Returns the part of a list between two given indexes.
fun extractList2 (l, start, end, counter)=
if (counter > end) || (l == nil) then
nil
else
if counter < start then
extractList2 tl l start end counter+1
else
(hd l) :: extractList2 tl l start end counter+1;;
fun extractList(l, start, end)=
extractList2 l start end 0;;
Author : iri
Date : december 2011
Return to Examples
Updated by iri almost 14 years ago · 2 revisions