#clojure log - Feb 08 2008

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

3:57 jay: thanks

3:57 for some reason that didnt seem to work before

3:57 goodnight

8:55 scramflot: directory walker, version 0.5.9.73: http://pastebin.com/m6c86ef4b

8:56 it's output is prettier, but it terminates after completing one full branch depth

8:56 the other branches aren't reached

8:58 rhickey: calling def at other than the top-level is almost always a mistake - why not use let?

9:00 what language(s) have you used before? how would you write it in that?

9:00 scramflot: rhickey: I'd tried using a let, but I continue to get errors

9:01 lemme brew the let version back up right quick.. sec.

9:04 well, actually, this time using let didn't break the code.. http://pastebin.com/m13861f4a

9:05 but, previously, I was using a map function inside the let, which was screwing with things I think, but I could easily be wrong

9:09 but this let version still terminates after the first branch, whereas I would expect the (map dw s) to continue on ever item in s... instead it executes dw on the first item in s, which returns a new s inside the new sub-instance of dw.. the new s though doesn't contain any directories so running dw on the new s's items doesn't return any sub-sub-instance s's

9:10 rhickey: what language(s) have you used before? how would you write it in that?

9:13 scramflot: so i map in the original dw isn't regaining control of the process. I've dabbled in java, python and ruby... I'd probably want to use a for loop.. but in the docs I was thinking filter might be appropriate. But I'm unsure how to construct a the predicate form

9:16 rhickey: Your difficulties seem to be with the logic of the problem itself rather than Clojure. You should write it first in the language you know best. If you can do that without using assignment, translating the logic into Clojure should be straightforward.

9:20 scramflot: it's weird cause in this one: http://pastebin.com/m5c4eb9f9 the root dw seems to regain control.. and continue to map the the other directory

9:21 rhickey: I can't help you anymore with this, sorry.

9:21 scramflot: I'm just talking out loud man.. You don't have to waste your time.. I'll get it eventually

Logging service provided by n01se.net