#clojure logs

2008-05-24

10:03asbjxrnIs there a more idiomatic version of (concat foo (list 5)) ?
10:04rhickeywhat is foo?
10:04asbjxrna list.
10:04rhickey(concat foo [5])
10:05rhickeybut if you find it consistently needs to grow at the end, perhaps a vector is a better choice for foo
10:06asbjxrnIt's actually something like (fn [foo] (call-something-else-with-an-additional-parameter (concat foo [5]))
10:11asbjxrnref-set and alter fulfill pretty much the same functionality(?) Any guidelines for when to use either one?
10:11asbjxrnUh.
10:11rhickeyalter
10:11rhickeyis preferred if the new state is in any way a function of the old
10:12asbjxrnOk, I need some refactoring tool :) I've got ref-set all over, and all I do is reset one element in a map...
10:15asbjxrnLooks nicer as well. Shorter at least.
10:16rhickeyclearer too
10:19asbjxrnThat I'm not sure about. I find ref-set pretty clear. The way alter changes the function call by putting the ref as the first argument to the function automatically isn't as clear to me.
10:20asbjxrnunfamiliar is perhaps a better word for it than unclear.
10:20rhickeysee how you feel after using it a while
10:20rhickeyheh