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

  • SEARCH
  • Home
  • 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 7664657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:21:39+00:00 2026-05-31T14:21:39+00:00

I understand that functions in Scheme/Racket like map, foldr, and filter, can do wonderful

  • 0

I understand that functions in Scheme/Racket like map, foldr, and filter, can do wonderful things like apply a function to a list of elements.

Is it possible to apply a list of functions to a single element?

I would like to generate the values produced by each of the functions, then find their maximum. Thank you.

  • 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-31T14:21:40+00:00Added an answer on May 31, 2026 at 2:21 pm

    For the first part, this procedure will apply a list of functions to a single argument, assuming that all the functions receive only one argument. A list with the results is returned

    (define (apply-function-list flist element)
      (map (lambda (f)
             (f element))
           flist))
    

    For the second part, finding the maximum in the list is simple enough. For example, if the element is 2 and the list of functions is (list sin cos sqr sqrt):

    (apply max
     (apply-function-list (list sin cos sqr sqrt) 2))
    

    EDIT :

    Here’s another possible solution, without using apply and in a single procedure:

    (define (max-list-function flist element)
      (foldr max -inf.0
             (map (lambda (f) (f element))
                  flist)))
    

    Use it like this:

    (max-list-function (list sin cos sqr sqrt) 2)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I understand that Haskell's filter is a high order function (meaning a function that
Which algorithm does the JavaScript Array#sort() function use? I understand that it can take
I understand that functions can have attributes. So I can do the following: def
I'm trying to implement a function in scheme that splits the given list with
If I understand it correctly this means extern void foo(); that the function foo
I understand that I can order a data.frame as such: test = data.frame(A=c(4,2,4), B=c(8,3,2))
I do understand that functions should not return references to automatic variables. However I
I am currently trying to learn Javascript and understand that functions are one of
Imagine you'd like to write a program that tests functions in a c++ dll
I understand that a class that consists of nothing but public static member functions

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.