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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:02:49+00:00 2026-06-14T04:02:49+00:00

I have to write a Scheme procedure named ‘proc3’ which takes 2 numbers as

  • 0

I have to write a Scheme procedure named ‘proc3’ which takes 2 numbers as arguments
(x,y) and returns a procedure which takes a list as an argument and returns a new
list which is the same as the input list but with x added as the first element
and y added as the second element.

I have so far
(define proc3
(lambda ( x y)
(lambda (list a b c)
(list x y c)
)
)
)

The interpreter compiles it fine, but when I give arguments
i.e proc3( 1 2), it says: cannot reference an identifier before definition.
What does that mean?

  • 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-14T04:02:50+00:00Added an answer on June 14, 2026 at 4:02 am

    The code in the question won’t work. Use this as a template for your solution, noticing that a list is just another parameter (I called it lst) e.g., you don’t have to write list and enumerate its elements as you did:

    (define proc3
      (lambda (x y)
        (lambda (lst)
          <add x y at head of lst>)))
    

    I’ll let you figure out the details of how to add x and y at the beginning of lst. For testing it, try something like this:

    ((proc3 1 2) '(3 4 5))
    => '(1 2 3 4 5)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to create the following: A Scheme procedure named 'proc2' which takes 4
I need to write a Scheme function that takes a list as an argument
I am trying to write a scheme function that takes a list of the
I have write my own view Bar, which extends LinearLayout . My bar has
I'm working on an application so i have write an dll which contain a
I have to write a SNMP module which monitor a certain server application that
I have to write 3 functions which accepts a parameter of BaseClass type and
I am trying to write a scheme script for GIMP 2.8, which will resize
I have been trying to write Scheme code to get the date and store
I need to write a procedure where I have to sum an unknown column

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.