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

The Archive Base Latest Questions

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

Okay, so i have recently posted a question regarding create a recursive function in

  • 0

Okay, so i have recently posted a question regarding create a recursive function in Scheme that would generate even functions called from the defined list below:

(define list0 (list 'j 'k 'l 'm 'n 'o 'j) )
(define list1 (list 'a 'b 'c 'd 'e 'f 'g) )
(define list2 (list 's 't 'u 'v 'w 'x 'y 'z) )
(define list3 (list 'j 'k 'l 'm 'l 'k 'j) )
(define list4 (list 'n 'o 'p 'q 'q 'p 'o 'n) )
(define list5 '((a b) c (d e d) c (a b) )
(define list6 '((h i) (j k) l (m n)) )
(define list7 (f (a b) c (d e d) (b a) f) )

which for my evens function i created this recursive function:

(define mylist '(1 2 3 4 5 6 7))
(define (evens lst)
(define (do-evens lst odd)
    (if (null? lst)
        lst
    (if odd
        (do-evens (cdr lst) #f)
        (cons (car lst) (do-evens (cdr lst) #t)))))
        (do-evens lst #t))

but now i am trying to create a ‘oddrev’ function that does as such:
(oddrev 1st) which should return a new list, formed from the odd-numbered elements taken from 1st, but in the reverse of their original order. That is if i typed in:

(oddrev '(a b c d e f g))

which would/should return:
(g e c a)

(oddrev (LIST 's 't 'u 'v 'w 'x 'y 'z))

which would/should return:
(y w u s)

(oddrev '((h i) (j k) l (m n)))

which would/should return:

(l (h i))

and

(oddrev '())

which would/should return a empty list, etc.

I am wondering if someone could show me how this might look. I am trying to just learn scheme for future references and i hear that is a cool programming language but as of right now i am hitting a few bumps in the road. Any help for a new person would be greatly appreciated. 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-14T08:05:25+00:00Added an answer on June 14, 2026 at 8:05 am

    Ok break it down into parts, firstly get every odd element.

    Well since you already have this nice little function to get evens how can we get odds using it? Well what if we were to tell it that it really started on an even number, so instead of (do-evens lst #t) we said (do-evens lst #f). Now we’ll get all the odd elements! For clarity perhaps we want to change even => odd in this body of this function (a simple find-substitute will work just fine)

    Next we have to reverse it. There are 2 ways to do this, either by hand or via the Scheme libraries. If you want to do it by hand I’ll let you work out that challenge. Otherwise reverse will do that work for us.

    I’ll let you figure out how to combine these 2 steps. It’s not too hard! Happy Scheming

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

Sidebar

Related Questions

Okay I have a large CRUD app that uses tabs with Forms embedded in
I have recently read an article that said, that you should never trust user
void foo() { } That's what I get. I only recently have ventured into
I recently downloaded Xcode 4.5 (Developer Preview) and have noticed that when you drag
Okay I have three tables that all communicate with each other. ForumTopic t ForumMessage
Okay I have a project that is using the android-rss library (org.mcsoxford.rss). I created
I have a application that unfortunately uses legacy mysql_* functions with MyISAM tables (bleagh...),
I have a hybrid asp.net web forms / mvc application that I recently converted
Okay I have a csv file that gets parsed and displayed. I want to
Okay - I have a dilemma. So far my script converts page titles into

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.