It works either way, or by any valid way of making the List, except that the arguments need to be in a different order [list before position number]....
Command: ( FLOLI 2 sl "D" )
; error: bad argument type: listp 2
Command: ( FLOLI sl 2 "D" )
(("1" "D") ("2" "D"))
It even works if not all the sub-lists have "enough" items in them:
Command: (setq sl '((3 4 5) ("yes" 3 8 pi) (89.2 4 "whatever") (T "this" "that" 4)))
Command: (floli sl 4 4)
((T "this" "that" 4))
But if it matters, I found, in experimenting with the same list, that if pi is the element in a list that you're filtering for, you have to "do it right" with a preceding apostrophe to get what you want:
Command: (floli sl 4 pi)
nil
But:
Command: (floli sl 4 'pi)
(("yes" 3 8 PI))
That's not required with the symbols T or nil as elements in the sub-lists. I'm not sure whether there might be other things that would require some kind of special handling, as pi does.
--
Kent Cooper
stevor wrote...
Seems to work with the input list trewritten to lake lists:
(setq sl ( list (list "1" "X") (list"1" "D") (list "2" "D") ) ) ; input list
(setq rl ( FLOLI 2 sl "D" ) ) ; result list
Kent Cooper, AIA