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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:35:25+00:00 2026-05-30T05:35:25+00:00

(define (even-odd x) (if ( ==(% x 2 ) 0) (1) (0))) when i

  • 0
(define (even-odd x)
(if ( ==(% x 2 ) 0) (1) (0)))

when i call( even-odd 5 )
i get this message

;Unbound variable: %
;To continue, call RESTART with an option number:
; (RESTART 11) => Specify a value to use instead of %.
; (RESTART 10) => Define % to a given value.
; (RESTART 9) => Return to read-eval-print level 9.
; (RESTART 8) => Return to read-eval-print level 8.
; (RESTART 7) => Return to read-eval-print level 7.
; (RESTART 6) => Return to read-eval-print level 6.
; (RESTART 5) => Return to read-eval-print level 5.
; (RESTART 4) => Return to read-eval-print level 4.
; (RESTART 3) => Return to read-eval-print level 3.
; (RESTART 2) => Return to read-eval-print level 2.
; (RESTART 1) => Return to read-eval-print level 1.

;Start debugger? (y or n):

Am i doing something wrong ?Also let me know how to select text in edwin.

  • 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-30T05:35:27+00:00Added an answer on May 30, 2026 at 5:35 am

    You have a few problems here; namely that you’re mistaken in the names of the procedures you’re trying to call.

    • % should be modulo
    • == should be eqv?
    • As zvrba noted, remove parenthesis surrounding 0 and 1

    or, if you’re simply trying to tell whether a number is even or odd, a simpler and cleaner way to do this is to simply use the builtin even?.

    (even? 5)
    > #f
    

    or if you actually want 0 and 1 as a result, a cleaner expression could be

    (if (even? x) 1 0)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do you define a method of verification? The example: include? even? odd? >>
How do you write a macro with variable number of arguments to define a
In C# you can define delegates anonymously (even though they are nothing more than
When trying to define an array such this: $array = new SPLFixedArray(256); for ($i
When I define this CSS in HTML I found that they not show me
F# has a feature enabling users to extend pattern matching: let (|Even|Odd|) n =
Should we define a static const member outside of the class definition even if
Is there a way to define a different (or even better, an additional )
I use macros to code unrolled loops like this: (silly example) #define foreach_small_prime(p, instr)
(define a 42) (set! 'a 10) (define a 42) (define (symbol) 'a) (set! (symbol)

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.