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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:24:55+00:00 2026-06-07T10:24:55+00:00

New to scheme here. I’m trying to compile a scheme function, range . It’s

  • 0

New to scheme here. I’m trying to compile a scheme function, range. It’s very simple – it takes a start, step and stop list L and makes a new list where every element = stepAmt + curStep.

For example: (range ‘(0 2 7)) => (0 2 4 6), (range ‘(2 2 0)) => ()

When I try to compile

(define (helper2(start stepAmt stop curStep newList)
(if (> start stop)
    '()
    (if (> (+ stepAmt curStep) stop)
        newList
        (helper2 (start stepAmt stop (+ stepAmt curStep) (concat newList (+stepAmt curStep))))))))

I get the error

Ill-formed special form: (define helper2 (start stepamt stop curstep newlist) (if … … …))

I’m not sure what it means. I’ve double checked my logic and parentheses and can’t figure it out.

This is the function that will call that function:

(define (example L)
(let (
    (start (car L))
    (curStep (car (cdr L)))
    (step (car (cdr L)))
    (stop (car (cdr (cdr L))))
    )
    (helper2 (start step stop curStep '()))
)

)

Any pointers would be great. I’m not sure if it’s a typo or a logical error. 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-06-07T10:24:58+00:00Added an answer on June 7, 2026 at 10:24 am

    You need not

    (define helper2 (some arguments go here)
       definition goes here)
    

    but

    (define (helper2 some arguments go here)
      definition goes here)
    

    The way to remember this is that what goes after define looks just like a call to the function you’re defining. “Here’s how to deal with a call like (helper2 some arguments go here): …”

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

Sidebar

Related Questions

I'm new to scheme and I'm trying to do a small very straight forward
Here's the response I keep getting when trying to create a new activity: {error:{errors:[{message:Unknown
I'm pretty new to Scheme and I'm having trouble writing a function as part
I'm setting up a new database scheme for an auction website and trying to
New to scheme here and I'm having some trouble learning do loops. I am
Here is the deal: My link: <li><% =Html.ActionLink(Scheme, null, null, null, new { @id
I am new to scheme. This is code sample from SICP course of MIT.
Okay this is my 4th question today on Scheme, still pretty new to Scheme,
I am currently designing a Membership/Profile scheme for a new project I am working
I'll be starting a new job soon where Scheme is heavily used. I currently

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.