April 28, 20169 yr The function filter-first lets us select the first N items from a list (sublists too). The current behaviour is to raise an error when N is greater than the length of the list. For example, it is an error to say: (filter-first 4 '(a b c)) This definitely acceptable behaviour, but I am wondering if it is OK to ask for more than what the list has, in which case it will return only what it can (i.e., based on length of list). In other words, if I say: (filter-first 4 '(a b c)) it will return (a b c) without error. What do you feel? This applies to filter-last also. -Rangarajan
April 28, 20169 yr If N is greater than the length of the list we should get an error and we do :-) The N is what we are looking for.
April 28, 20169 yr We could add a keyword and return only what it can. If this would be useful for your work I can make the change.
April 28, 20169 yr Author Thanks, but unless it is useful to others as well, I would not suggest it. Besides, it is easy to get the behaviour I want by wrapping up some condition on filter-first. -Rangarajan
Create an account or sign in to comment