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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:44:45+00:00 2026-06-11T17:44:45+00:00

I’m using DrRacket as scheme compiler. When I’m trying to use the fold-right function,

  • 0

I’m using DrRacket as scheme compiler. When I’m trying to use the fold-right function, I got “fold-right: unbound identifier in module in: fold-right.” Do I need to include some library before calling this function?

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-11T17:44:46+00:00Added an answer on June 11, 2026 at 5:44 pm

    I think you are looking for foldr. foldr is the racket implementation of fold-right.

    From the documentation:

    Like map, foldl applies a procedure to the elements of one or more
    lists. Whereas map combines the return values into a list, foldl
    combines the return values in an arbitrary way that is determined by
    proc.

    […]

    [foldr is ] like foldl, but the lists are traversed from right to
    left. Unlike foldl, foldr processes the lsts in space proportional
    to the length of lsts (plus the space for each call to proc).

    Edit:

    You may also want to use the srfi/1 library as suggested by Chris, particularily if you are expecting fold-right to work like the srfi/1 recommendation. There are some subtle differences:

    #lang racket
    (require srfi/1)
    (foldr list* '() '(a b c) '(1 2 3))
    (fold-right list* '() '(a b c) '(1 2 3 4))
    (foldr list* '() '(a b c) '(1 2 3 4))
    

    Output:

    Welcome to DrRacket, version 5.3 [3m].
    Language: racket; memory limit: 128 MB.
    '{a 1 b 2 c 3}
    '{a 1 b 2 c 3}
    [ERROR] foldr: given list does not have the same size as the first list: '{1 2 3 4}
    

    Note: fold-right does not error on different size lists, but you still only get the 1, 2, 3 atoms from the second list. This matches the srfi/1 spec:

    The fold operation terminates when the shortest list runs out of
    values

    foldr does error.

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I need a function that will clean a strings' special characters. I do NOT
I have thousands of HTML files to process using Groovy/Java and I need to
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am reading a book about Javascript and jQuery and using one of the
this is what i have right now Drawing an RSS feed into the php,

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.