[plt-scheme] Local function definition

From: Guillaume Marceau (gmarceau at cs.brown.edu)
Date: Sun Jan 11 20:18:57 EST 2004

On Sun, 11 Jan 2004, Robby Findler wrote:

> 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.

In my source, I've got the same indentation as you do. I guess my mailer
broke the indentation without me noticing.

Does that means there is no define-like special form for local definitions?


-- 
"The thing I remember most about America is that it's silly.
 That can be quite a relief at times."  -- Thom Yorke, Radiohead

- Guillaume



Posted on the users mailing list.