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 8775653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:51:32+00:00 2026-06-13T18:51:32+00:00

is there a function like find in lisp that returns true instead of the

  • 0

is there a function like find in lisp that returns true instead of the element we’re trying to find?

example:

I want it to do

(find 'x '(a c x)) = t

not

(find 'x '(a c x)) = x

Also, the reason I am asking is because I am trying to reach the deepest element in a list. My plan was to flatten the list every time i recursively called it.

I would then stop the recursive call when

(mapcar 'atom list)

would tell me every atom in there is true.

Do you believe this is a good approach to this problem?

  • 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-06-13T18:51:34+00:00Added an answer on June 13, 2026 at 6:51 pm

    There’s no such function, but it can’t be easier to write one:

    (defun find-t (&rest args)
      (when (apply #'find args)
        t))
    

    Also instead of (mapcar 'atom list) you can use (every #`(eql t %) list), i.e. check that every item in list is exactly t. (Here #`() is syntactic sugar for one-argument lambdas, that I use.)

    But overall it’s unclear, what you’re trying to achieve with all this. Can you elaborate on what you’re trying to do?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a function in that uses binary search, like lower_bound but that returns
I would like to find out if there is a function that can generate
Are there any opencv function like cvHoughCircles() that can use for square detection programming
Is there a function that tells what class you are extending? Like function_exists? I
Is there a POSIX function that works like the which command? That is, I
Is there a function that can round a float in Fsharp? Something like round(3.21156,3)
I'm trying to find a xml-interpret function (like the simplexml_load_string) in Python, but with
I want an idiomatic way to find the first element in a list that
Is there a function like GETDATE() in Sql Server 2005 that let's you get
is there such thing in oracle like listunagg function? For example, if I have

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.