CS 3304: Comparative Languages
FP Foundations, Scheme
[
Course Documents
] : [
FP Foundations, Scheme
]
Previous
Contents
Next
Keyword Index
A Function for Constructing Functions
DEFINE
has two forms:
1. To bind a symbol to an expression:
(define pi 3.141593) (define two_pi (* 2 pi))
2. To bind names to lambda expressions
(define (cube x) (* x x x) )
Example use:
(cube 4)