| | |
Help With Scheme Procedure
Please support our Legacy and Other Languages advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Feb 2008
Posts: 65
Reputation:
Solved Threads: 0
Hello, and thank you for taking the time to help me! I am working on a Scheme procedure right now, which is supposed to read in integers until 0 is entered, and display the minimum of the integers (0 included). I have a question about the procedure, which is below. Keep in mind, I have only written ONE Scheme procedure thus far, which displayed the minimum of two integers, so it was much easier. So here is my question:
In the header, what do I put for the conditions after lambda? How do I tell the procedure that it needs to read in ints until 0 is entered?
Thank you for any help you can provide!
In the header, what do I put for the conditions after lambda? How do I tell the procedure that it needs to read in ints until 0 is entered?
Thank you for any help you can provide!
•
•
Join Date: Feb 2008
Posts: 65
Reputation:
Solved Threads: 0
0
#2 Oct 25th, 2009
Okay, I don't know if anyone on here programs in scheme really, but I am going to post my updated code anyway in hopes that someone can help me. I will be so appreciative to anyone who can help me out with this!
Here is what I have right now:
But I have a feeling this is not right, because I get an error when I run the procedure. The error says this:
min: expects argument of type <real number>; given (1)
So I think that args is not what I really want after lambda. I want integers, not just arguments, so is there a way to do that? Otherwise, does this look somewhat right for finding the minimum of the ints entered?
Thank you, again!
Here is what I have right now:
(define find_min (lambda args
(display (min args))
)
)
(display (find_min (read)))But I have a feeling this is not right, because I get an error when I run the procedure. The error says this:
min: expects argument of type <real number>; given (1)
So I think that args is not what I really want after lambda. I want integers, not just arguments, so is there a way to do that? Otherwise, does this look somewhat right for finding the minimum of the ints entered?
Thank you, again!
![]() |
Similar Threads
- Scheme Help (Legacy and Other Languages)
- Scheme to Python (Computer Science)
- Begin Expression in Scheme (Computer Science)
- Scheme Newbie (Legacy and Other Languages)
- Dr Scheme Tutorial (Computer Science)
- Code Snippet: Dr Scheme example (Legacy and Other Languages)
Other Threads in the Legacy and Other Languages Forum
- Previous Thread: MATLAB.. with Access?!!
- Next Thread: Matlab problem
Views: 725 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for Legacy and Other Languages





