Jump to content

filter-first Function


Recommended Posts

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy