[plt-scheme] Local function definition
At Sun, 11 Jan 2004 20:18:57 -0500 (EST), Guillaume Marceau wrote:
> Does that means there is no define-like special form for local definitions?
Oh, no. Just use internal definitions. Their syntax is a little wierd
-- unlike unit definitions and class definitions, you cannot comingle
definitions and expressions (all definitions must come first), but you
can certainly put definitions inside a lambda and a let (and inside a
definition that hides a lambda):
(define (find-short-path graph red-nodes blue-nodes)
(define (get-siblings loci)
(map (lambda (sibling) (make-loci sibling (loci-stack loci)))
(graph-adjs graph (loci-node loci))))])
...)
Check out r5rs on internal definitions.
Robby