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

The Archive Base Latest Questions

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

I am flying blind on scheme, and I feel like once I answer this

  • 0

I am flying blind on scheme, and I feel like once I answer this question the rest of my homework should progress smoothly.

I’m defining a function that takes a list as its sole argument, then returns the same list with the first element added to the rest. For instance:

(addFirst ‘(4 3 2 1))   =>   (8 7 6 5)

I have a feeling that I should be using the map and car functions here… but I just can’t seem to get it exactly right. My current version of this code looks like:

(define (addlist x) ;adds the first element of a list to all other elements
  (define a (car x)) ;a is definitely the first part of the list
  (map (+ a) x)
)

How can I make the addition function work this way? Obviously I can’t provide a list as a parameter, but should I be using car again or recursion?

Okay, for posterity, here’s the completed, correct, formatted code:

(define (addlist x) ;adds the first element of a list to all other elements
  (define a (car x)) ;a is definitely the first part of the list
  (map (lambda (y) (+ a y)) x)
)
  • 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-31T16:39:19+00:00Added an answer on May 31, 2026 at 4:39 pm

    Map takes a function and n lists. So you need to transform (+ a) into a function that takes one argument (as you want to map over one list).

    (map (lambda (item) ... do something to add a to item ...) x)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some homework that I was flying through until I got to this
I've got to edit an XSLT stylesheet, but I'm flying blind because the XML
I came across this link flying twitter bird , was just wondering , how
I've been introduced to this wonderful project, xhtmlrenderer; the flying saucer project . Problem
I have an object model like this: class Car { public string Manufacturer; public
I will be flying to Australia (~15 hr. flight) and I'd like to continue
I have some NSLog calls that I do to keep myself from flying blind
Consider this code (based entirely on flying saucer's getting started code, their rights reserved):
In Clojure programming language, why this code passes with flying colors? (let [r (range
I am flying blind and could use some help. I am a long time

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.