[plt-scheme] Local function definition

From: Robby Findler (robby at cs.uchicago.edu)
Date: Sun Jan 11 19:42:53 EST 2004

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


Posted on the users mailing list.