[plt-scheme] Local function definition
At Sun, 11 Jan 2004 19:28:24 -0500 (EST), Guillaume Marceau wrote:
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>
> What is the prefered way to define a local function in pretty-big?
>
> For now, my code is using the long winded form let/name/lambda. For example:
>
> (define (find-short-path graph red-nodes blue-nodes)
> ...
> (let ([get-siblings
> (lambda (loci)
> (map (lambda (sibling) (make-loci sibling (loci-stack loci)))
> (graph-adjs graph (loci-node loci))))])
> body ... )
> ...)
That indentation is wrong. When I put that code into drscheme and hit
tab, I get this:
(define (find-short-path graph red-nodes blue-nodes)
...
(let ([get-siblings
(lambda (loci)
(map (lambda (sibling) (make-loci sibling (loci-stack loci)))
(graph-adjs graph (loci-node loci))))])
body ... )
...)
The lambda behind get-siblings is lined up properly in the code above,
but not in yours. If you can make it line up wrong (as above) when
hitting tab, please submit a bug report with the code.
Robby