On Wed, Jan 7, 2009 at 3:13 AM, Tom Ayerst <[email protected]> wrote:
> Hi Mark,
>
> I'm afraid I don't like the "big let" style and I found it hard to follow
> some of your code, that may just be a personal thing but a lot of the vars
> defined in let are only used once and could be inlined.
I agree they could be inlined, but I find that style easier to read.
For example, these are equivalent.
(defn make-cookies-1 [flower baking-soda salt button sugar eggs]
; let describes the step-by-step process for making cookies.
(let [bowl (find-bowl :small)
bowl (add-ingredients bowl flower baking-soda salt)
batter (mix bowl)
batter (add-and-beat batter eggs flour)
baking-sheet (find-baking-sheet)
baking-sheet (make-dough-balls baking-sheet batter)]
(bake baking-sheet)))
(def make-cookies-2 [flower baking-soda salt button sugar eggs]
(bake (make-dough-balls
(find-baking-sheet)
(add-and-beat (mix (add-ingredients (find-bowl) flower aking-soda
salt) eggs flour))))
Which of these is easier to understand?
> I do like the state loop approach but I don't see why you need that global.
If you see a way to get rid of it, I'd gladly do that. I just don't
see a way yet.
--
R. Mark Volkmann
Object Computing, Inc.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---