Internal define is awesome.

On Fri, Nov 2, 2012 at 4:17 PM, Matthias Felleisen <[email protected]>wrote:

>
> I guess we should take this also as a confirmation of the style guide :-)
>
>
> On Nov 2, 2012, at 5:05 PM, Danny Yoo wrote:
>
> > I was just looking at exercise 2.64 of SICP, one that creates a BST out
> of an ordered list of elements:
> >
> >
> http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-16.html#%_thm_2.64
> >
> > However, because of all the nested lets, I have to admit that I was
> having a hard time reading it!
> >
> > So I rewrote it with the Racket style guidelines in mind
> http://www.ccs.neu.edu/home/matthias/Style/style/Choosing_the_Right_Construct.html#(part._.Definitions)
> >
> >
> > The rewritten code is:
> >
> >     https://gist.github.com/4004224
> >
> > with the following changes:
> >
> >   1. Rewrote the packing/unpacking of 2-tuple lists in partial-tree with
> multiple values.
> >
> >   2. Replaced nested lets with defines.
> >
> >   3. Reordered some of the variables definitions to highlight
> relationships.
> >
> >
> > I thought the function itself was neat, and just wanted to share.
> > ____________________
> >  Racket Users list:
> >  http://lists.racket-lang.org/users
>
>
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
>
>


-- 
Grant Rettke | ACM, AMA, COG, IEEE
[email protected] | http://www.wisdomandwonder.com/
Wisdom begins in wonder.
((λ (x) (x x)) (λ (x) (x x)))
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to