Arc Forumnew | comments | leaders | submitlogin
3 points by cooldude127 6110 days ago | link | parent

i would have to disagree about how common the single variable thing is. at least in my own code, i have many more withs than i have let's with multiple statements. but then, i try to do functional programming whenever i can.

and also, arc is at least a little geared toward functional style. in my other comment i brought up that one of the things pg liked about his if version is that the explicit 'do' makes non-functional code more obvious.



1 point by kennytilton 6110 days ago | link

But the more functional the programmer the less likely they are to need temporary variables, so the count 1 should be more frequent! <g> In my CL experience it comes up often enough that I have a policy where the let will be at the toplevel in a function: I use &aux (to repeat, a CL hack):

  (def my-fun (x y z &aux (temp (other-fun x y)))
     ...etc...)
Why? Yes I have a twenty-inch flat panel but I am still an almost obsessive indentation miser, and it just kills me to add a level of parens and indentation just to get one lousy temp variable. :)

-----