[racket] Style guide and inner definitions

From: Greg Hendershott (greghendershott at gmail.com)
Date: Thu Jul 3 13:30:47 EDT 2014

Good point. I've come to prefer explicit args, usually.
On Jul 2, 2014 7:56 PM, "Ryan Davis" <zenspider at gmail.com> wrote:

>
> On Jun 26, 2014, at 20:43, Greg Hendershott <greghendershott at gmail.com>
> wrote:
>
> > With something that big, I will often:
> >
> > - Move that function to its own new .rkt file.
> > - Move the inner functions out to the module level, too (as "siblings"
> > not "kids").
> > - Provide only the main one, e.g. `(provide process-elements)`.
> >
> > As a bonus, now it's easier to exercise the helper functions in the REPL.
>
> I usually nest my functions for two reasons: encapsulation (which you
> addressed) and scoping via closure.
>
> Your process explicitly breaks the latter. How does that affect the way
> you design? Do you prefer having explict args and passing everything down
> (perhaps to be more self-documenting?)?
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140703/91f67e7f/attachment.html>

Posted on the users mailing list.