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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:14:24+00:00 2026-06-18T01:14:24+00:00

(define test (lambda args (if (= (length args) 1) (display (car args)) (begin (display

  • 0
(define test (lambda args 
  (if (= (length args) 1) (display (car args))
      (begin (display (car args))
      (test (cdr args))))))

I was looking for it on the net and didnt find the answer, I was able to get a variable number of arguments to my func, but how do i pass them not as a single list to the next iteration?

To be more clearer, if i call :

(test (list 1 1) (list 2 2) (list 3 3))

i was exepcting to get :

(1 1) (2 2) (3 3)

but i get :

(1 1) ((2 2) (3 3))

Thanks in advance!

  • 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-18T01:14:25+00:00Added an answer on June 18, 2026 at 1:14 am

    args will be a list of the arguments passed to test. The first time you pass it three lists, so args will be a list of those three lists. Recursively you pass it (cdr args), which is a list of the last two lists, so now args is a list containing the list that has the last two lists. That is, args is (((2 2) (3 3))) where you want ((2 2) (3 3)). You can fix it by applying the test function to the list:

    (apply test (cdr args))
    

    Which, if (cdr args) is ((2 2) (3 3)), is the same as doing:

    (test (2 2) (3 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 dumb test: (define-syntax a (lambda (stx) (syntax-case stx () [(k
Edit: (define leet-helper (lambda (string) (cond [(null? (string->list string)) ] [(equal? (car string)#\e) (cons
Here is my MainView: Ext.define(Test.view.Main, { extend: 'Ext.Panel', config: { cls: 'transp' } });
I have the following code: #include <iostream> #define BOOST_TEST_MODULE my test #include <boost/test/unit_test.hpp> BOOST_AUTO_TEST_CASE(
I have a small sample function: #define VALUE 0 int test(unsigned char x) {
I'm creating test data for a Rails app. How do I define the value
I know that one can define an 'expected' exception in JUnit, doing: @Test(expect=MyException.class) public
When I define this function, template<class A> set<A> test(const set<A>& input) { return input;
Let there be class Example defined as: class Example def initialize(test='hey') self.class.send(:define_method, :say_hello, lambda
I want to define a Lambda Expression with an out parameter. Is it possible

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.