Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7533741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:48:46+00:00 2026-05-30T05:48:46+00:00

I have the following filter function that filters out a list, x, that doesn’t

  • 0

I have the following filter function that filters out a list, x, that doesn’t satisfy the function f.

For example, I call (filter 'evenp '(0 1 2 3)) and get back (NIL 1 NIL 3). But this is exactly my problem. How do I make it so that I just get back (1 3) ?

(defun filter (f x)
    (setq h (mapcar #'(lambda (x1)
                        (funcall f x1))
                    x))
    (mapcar #'(lambda (a b)
                (cond ((null a) b)))
            h x))

i.e. the problem is right here: (lambda (a b) (cond ( (null a) b) ) ) In my cond I don’t have a t , or else statement, so shouldn’t it just stop right there and not return nil ? How do I make it “return” nothing, not even nil, if the (cond ( (null a) b) ) isn’t satisfied?

Much appreciated. 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T05:48:49+00:00Added an answer on May 30, 2026 at 5:48 am

    Based on this question it would be:

    (remove-if #'evenp '(0 1 2 3))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following function that fades each line of an unordered-list in and
I have a function that looks similar to the following. I'd like to modify
I have the following situation: A user will define a certain filter on a
I have the following sql query and I want to filter the results where
I have the following code in my index view. latest_entry_list = Entry.objects.filter(is_published=True).order_by('-date_published')[:10] for entry
In my django views i have the following def create(request): query=header.objects.filter(id=a)[0] a=query.criteria_set.all() logging.debug(a.details) I
i have the following code in an asp.net mvc view. <% = Html.DropDownList(Filter, new
I have tried the following: <%= image_tag '...path_to_img', :filter => alpha(opacity=50) %> But it
I have defined a boolean Jess function that accepts a lambda, as follows: (deffunction
I currently have the following JavaScript/jQuery script that gets an external html page using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.