•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Legacy and Other Languages section within the Software Development category of DaniWeb, a massive community of 455,962 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,578 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Legacy and Other Languages advertiser: Programming Forums
Views: 2060 | Replies: 15 | Solved
![]() |
•
•
Join Date: Oct 2007
Location: Cherry Hill, NJ
Posts: 1,878
Reputation:
Rep Power: 13
Solved Threads: 193
There are no functions in Scheme, only procedures. That is, the word used in the R5RS specification (and probably R6RS, but I haven't read that) is "procedure". That's why there is a procedure named
procedure? in Scheme, and no procedure named function?.However, your help to the OP is stellar.
•
•
Join Date: Oct 2007
Location: Cherry Hill, NJ
Posts: 1,878
Reputation:
Rep Power: 13
Solved Threads: 193
Thanks. Please keep in mind that the OP (and most other readers here) haven't read (nor will they) the R5RS.
The R5RS committee needed a word for a technical thing. They chose poorly (though, considering the circumstances and the technical issues, I don't blame them).
A "procedure" is a very broad term. In most computing contexts that I am aware of, procedures return value by way of side-effect only, whereas functions explicitly return value.
In Scheme, a combination (a lambda), is a function call: local values are bound to an expression which is evaluated for value. That value then replaces the local context. Please keep in mind that this is a functional operation --hence the term functional languages.
Please understand that I'm not being rude. You are very correct. However, you must be careful not to confuse those reading here with those who care about all the technicalities and terminologies specific to functional languages and Scheme in particular.
To be short: in Scheme it is meaningless to talk about the difference between a procedure and a function. But in the minds of programmers everywhere, unfamiliar with Scheme, the difference is in "how do I then get this value to be passed out of the procedure". The answer is, there are no procedures in scheme (or any other functional language). Only functions (or lambdas) that evaluate to (or "return") a new value. You pass a value out by evaluating to that value.
I hope I've explained my choice in language to everyone's satisfaction. If you are a Scheme junkie, know that I am too (it is my all-time favorite functional language, and I've used it in professional contexts). I know as well as you that in Scheme combinations are called "procedures". I don't take this as an excuse to use terms that confuse rather than help the poor saps struggling to figure this stuff out. By the time they get to the point where they read the R5RS about procedure?, they will already know enough to bridge the gap.
Hope this helps.
The R5RS committee needed a word for a technical thing. They chose poorly (though, considering the circumstances and the technical issues, I don't blame them).
A "procedure" is a very broad term. In most computing contexts that I am aware of, procedures return value by way of side-effect only, whereas functions explicitly return value.
In Scheme, a combination (a lambda), is a function call: local values are bound to an expression which is evaluated for value. That value then replaces the local context. Please keep in mind that this is a functional operation --hence the term functional languages.
Please understand that I'm not being rude. You are very correct. However, you must be careful not to confuse those reading here with those who care about all the technicalities and terminologies specific to functional languages and Scheme in particular.
To be short: in Scheme it is meaningless to talk about the difference between a procedure and a function. But in the minds of programmers everywhere, unfamiliar with Scheme, the difference is in "how do I then get this value to be passed out of the procedure". The answer is, there are no procedures in scheme (or any other functional language). Only functions (or lambdas) that evaluate to (or "return") a new value. You pass a value out by evaluating to that value.
I hope I've explained my choice in language to everyone's satisfaction. If you are a Scheme junkie, know that I am too (it is my all-time favorite functional language, and I've used it in professional contexts). I know as well as you that in Scheme combinations are called "procedures". I don't take this as an excuse to use terms that confuse rather than help the poor saps struggling to figure this stuff out. By the time they get to the point where they read the R5RS about procedure?, they will already know enough to bridge the gap.
Hope this helps.
•
•
•
•
In Scheme, a combination (a lambda), is a function call: local values are bound to an expression which is evaluated for value. That value then replaces the local context. Please keep in mind that this is a functional operation --hence the term functional languages.
Well, yeah. I agree with calling functions (when used functionally in Scheme) functions. And calling procedures (when used procedurally, with side effects) procedures.
Of course, Scheme isn't really a functional language. :-) </haskell troll>
I don't understand why you have "(a lambda)" there, saying that a 'lambda (expression?)' is a synonym for the term 'combination', though.
Last edited by Rashakil Fol : Nov 26th, 2007 at 4:22 pm.
•
•
Join Date: Oct 2007
Location: Cherry Hill, NJ
Posts: 1,878
Reputation:
Rep Power: 13
Solved Threads: 193
I think that's actually part of the reason they called them procedures, because Scheme allows side effects...
The use of the word "combination" is another one of those Scheme goodies... But in an evaluative/transformational way of thinking it makes sense... (as Scheme is all about list transformation).
Are you in to program transformation too? (All the Haskell junkies I know are into that.)
They all worry about me because I like my side effects being transparent. I don't want to have to dink with monads for every function that uses a function that may have side effects... That's what compilers are for IMO.
The use of the word "combination" is another one of those Scheme goodies... But in an evaluative/transformational way of thinking it makes sense... (as Scheme is all about list transformation).
Are you in to program transformation too? (All the Haskell junkies I know are into that.)
They all worry about me because I like my side effects being transparent. I don't want to have to dink with monads for every function that uses a function that may have side effects... That's what compilers are for IMO.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Legacy and Other Languages Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- scheme newbie here!!! (Computer Science and Software Design)
- Dr Scheme Tutorial (Computer Science and Software Design)
- Dr Scheme example (Computer Science and Software Design)
- Change Out Your Pointer Scheme (Windows tips 'n' tweaks)
Other Threads in the Legacy and Other Languages Forum
- Previous Thread: A multilingual coded Hello World! thread
- Next Thread: Matlab code using Genetic Algorithm for a digital images correlation



Linear Mode