Up |
listextr
Extract a sublist from a list between two indices
Prototype :
fun [[u0 r1] I I] [u0 r1]
- [u0 r1] : any list (level 1)
- I : first indice. Can be negative.
- I : second indice. Can be negative.
Return : the sub list, or nil if error
Example :
fun main ()=
_showconsole;
_fooIList listextr 0::1::2::3::4::5::6::7::nil (-5) 4; // 2:3:4:NIL
_fooSList listextr "0"::"1"::"2"::"3"::"4"::"5"::"6"::"7"::nil 2 4; // 2:3:4:NIL
0;;