I have a table like this:
(setq lst '(("header1" "header2" "header3") ( "11" "12" "13") ("21" "22" "23") ("31" "32" "33") ("41" "42" "43" )))
I want to get some continueous lines e.g. from the first line to the third line by this:
(filter (and (>= $idx 1) (<= $idx 3)) lst) ;; '(( "11" "12" "13") ("21" "22" "23") ("31" "32" "33") ) wanted.
But I find the function "filter" does not support "$idx".
So, is there a better way to achieve this?
> (slice lst 1 3)
(("11" "12" "13") ("21" "22" "23") ("31" "32" "33"))
>
http://www.newlisp.org/downloads/newlisp_manual.html#slice
Or shorter:
> (1 3 lst)
(("11" "12" "13") ("21" "22" "23") ("31" "32" "33"))
See here:
http://www.newlisp.org/downloads/newlisp_manual.html#implicit_rest_slice