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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:40:26+00:00 2026-05-27T17:40:26+00:00

I am learning Scheme and want to write a recursive procedure which output to

  • 0

I am learning Scheme and want to write a recursive procedure which output to the console in each run level:

(define (dummy count)
    (if (= 0 count)        
        (runtime)
        ((display "test" console-i/o-port) (dummy (- count 1)))))

And then test with:

(dummy 10)

But it appears that only the output of the last procedure called will be printed out.
What should I do to make it happen? Thanks. (I am using Mit-scheme)

  • 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-27T17:40:27+00:00Added an answer on May 27, 2026 at 5:40 pm
    ((display "test" console-i/o-port) (dummy (- count 1)))
    

    This is a function call where (display "test" console-i/o-port) is the function that’s supposed to be called and (dummy (- count 1)) is the argument to that function. Since `(display “test” console-i/o-port) does not actually return a function, this will cause an error (after printing test).

    To do what you actually want to do (first execute (display ...) and then execute (dummy ...)), you can use the begin form like this:

    (begin (display "test" console-i/o-port) (dummy (- count 1)))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am learning Scheme. What is wrong with the code below?I want to write
I'm learning PLT Scheme and I want to know how can I build a
If I want to learn Clojure, should I start by learning Scheme or Common
I'm in the process of learning Scheme. I recently spent (too much!) time trying
Okay so I have started a new language in class. We are learning Scheme
I'm learning R5RS Scheme at the moment (from PocketScheme) and I find that I
I've been learning scheme, and I just realized that I don't really know how
I am learning Python (I have a C/C++ background). I need to write something
I am learning scheme. I know how to use both lambda and let expressions.
I've started learning Scheme, for fun mostly, and because I've never used a functional

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.