# Scheme forward declaration

## Recommended Posts

Mulligan    378
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
flangazor    516
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.