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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:07:03+00:00 2026-06-12T02:07:03+00:00

For example ((fn-stringappend string-append) a b c) I know how to handle this (f

  • 0

For example ((fn-stringappend string-append) "a" "b" "c") I know how to handle this (f x y z). But what if there’s an unknown number of parameters? Is there any way to handle this kind of 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-12T02:07:04+00:00Added an answer on June 12, 2026 at 2:07 am

    In Scheme you can use the dot notation for declaring a procedure that receives a variable number of arguments (also known as varargs or variadic function):

    (define (procedure . args)
      ...)
    

    Inside procedure, args will be a list with the zero or more arguments passed; call it like this:

    (procedure "a" "b" "c")
    

    As pointed out by @Arafinwe, here’s the equivalent notation for an anonymous procedure:

    (lambda args ...)
    

    Call it like this:

    ((lambda args ...) "a" "b" "c")
    

    Remember that if you need to pass the parameters in a list of unknown size to a variadic function you can write it like this:

    (apply procedure '("a" "b" "c"))
    (apply (lambda args ...) '("a" "b" "c"))
    

    UPDATE:

    Regarding the code in the comments, this won’t work as you intend:

    (define (fp f)
      (lambda (.z)
        (f .z)))
    

    I believe you meant this:

    (define (fp f)
      (lambda z
        (apply f z)))
    

    With a bit of syntactic sugar the above procedure can be further simplified to this:

    (define ((fp f) . z)
      (apply f z))
    

    But that’s just a long way for simply writing:

    (apply f z)
    

    Is this what you need?

    (apply string-append '("a" "b" "c"))
    

    Because anyway that’s equivalent to the following:

    (string-append "a" "b" "c")
    

    string-append already receives zero or more arguments (at least, that’s the case in Racket)

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

Sidebar

Related Questions

example: NSString *day = [[NSString stringWithFormat:@السبت];and i think the representation of this string in
Example: there are 3 different number values: 1 2 3 I delete the 2
Example: print max(chain_length(i) for i in xrange(1,10001)) This returns the maximum/biggest chain_length (an arbitrary
Example: the user fills in everything but the product name. I need to search
Example I have this line of code in PHP, and I want to pass
Example Outlook: its only one process but can have multiple windows (user can double
Example program: list links This example program demonstrates how to fetch a page from
Example model: public class Thing { [JsonProperty(foo)] public string Foo {get;set;} [JsonProperty(bars)] public Dictionary<string,string>
example String : /gasg/string expected result : string Characters to to remove: all characters
Example: puts <<BLOCK ... BLOCK with BLOCK being any other identifier that doesn't clash

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.