Public Group

# Scheme forward declaration

This topic is 4668 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm attempting to learn Scheme, but I'm running into a basic problem of not being able to call a function that appears lower in the file than the function calling it. What is the syntax for forward declarations of function in scheme?

##### Share on other sites
You should only get a warning at the most if you define a function using a symbol that wasn't defined yet. If you want to make the warning go away, you can do the following, but I've never seen anyone bother.
(define blah #f) ; forward decl of sorts.(define (bloo x y z) (blah 1 2 3)) ; using the forwardly decled function.(set! blah (lambda (x y z) (+ x y z))) ; define the function.

1. 1
Rutin
23
2. 2
3. 3
JoeJ
20
4. 4
5. 5

• 29
• 40
• 23
• 13
• 13
• ### Forum Statistics

• Total Topics
631740
• Total Posts
3001965
×