2008-02-19
| 00:01 | jonathan_ | Yeah, but a good architect can make up for a lot, Word 5.0 on the Mac was fantastic, Excel was great ... MS are pretty sad now, I remember being so excited over VC++ 1.0 and Access |
| 00:02 | Chouser | I worked for a guy who refused to upgrade to Word 5 for Mac, because he didn't think the features were worth the bloat over Word 4. |
| 00:03 | Chouser | well, refused for a while anyway. I suppose he may have upgraded by now. |
| 00:04 | jonathan_ | this was like 89, about 3 years pre-dating wndows |
| 00:05 | Chouser | yep, I was in high school. Before Macs stagnated for a decade. |
| 00:06 | jonathan_ | yeah, I had a Performa 6100, it was just terrible |
| 00:06 | jonathan_ | freeze, bong |
| 00:07 | Chouser | I think the SE/30 was the last I dealt with directly. Then I went to college and found unix, and haven't really left. |
| 00:08 | Chouser | I did buy my wife a MacBook a year ago, but I wasn't as impressed with the software as I assumed I would be. |
| 00:08 | jonathan_ | Really? I love mine ... Leper is awesome |
| 00:08 | jonathan_ | Beats tiger |
| 00:09 | jonathan_ | Having svn pre-installed is just one of the many cool things |
| 00:09 | Chouser | She's still on Tiger. |
| 00:09 | Chouser | Heh. She'd have no use for svn. ;-) |
| 00:09 | jonathan_ | If you upgrade, wipe it out |
| 00:10 | Chouser | oh, yeah? back up user files and do a clean install? |
| 00:10 | jonathan_ | totally, I upgraded and it was terrible, needs a clean slate, same with my wifes machine, and my MBP |
| 00:15 | Chouser | I'm surprised (seq? []) is false |
| 00:15 | jonathan_ | I've been wrestling with that |
| 00:16 | jonathan_ | (defn empty ([s] (or (= s []) (= s {}) (=s ()))) |
| 00:16 | jonathan_ | is the yukky solution |
| 00:16 | Chouser | hm. yeah. |
| 00:17 | jonathan_ | I tend to test (nil? (first seq)) |
| 00:17 | jonathan_ | now, which works |
| 00:17 | Chouser | (= nil (list* x)) |
| 00:17 | Chouser | still rather icky |
| 00:18 | jonathan_ | is there a built-in that does what you need? |
| 00:19 | Chouser | I'm not acutally sure that [] not being a seq in my problem. |
| 00:20 | Chouser | eh. I need to take a step back. Each angle I've tried so far ends up with a messy solution, even the ones I get working. |
| 00:20 | jonathan_ | yeah, I know what you mean, Rich is good at helping out with fixing stuff up like that |
| 00:20 | jonathan_ | Lisp has a definite 'nap' |
| 00:21 | Chouser | heh, that's a good description. |
| 00:21 | Chouser | Actually, I found Scala to be that way too. I think it may be a property of sufficiently well designed functional languages. |
| 00:21 | jonathan_ | I spent two hours today refactoring some crappy code, just because I was too lazy to parse an int |
| 00:22 | jonathan_ | nil <> "" <> "0" etc etc |
| 00:22 | Chouser | you *can* do it whatever way you want, but it's all so clumsy until you're doing it the right way. |
| 00:22 | Chouser | ah. hm. |
| 00:22 | jonathan_ | yep exactly |
| 00:23 | Chouser | well, I'm trying to build an API for filtering the vector/map tress the xml.clj produces. |
| 00:24 | Chouser | I want something as powerful and succint as xpath, but I want it in "native" clojure (not a parsed string) so I can drop into regular lisp expressions at any moment. |
| 00:24 | Chouser | Anyway, I've got 2 or 3 working solutions that are sufficiently flexible but *so* *wordy*. |
| 00:24 | jonathan_ | *consults Haskell bookmarks* |
| 00:25 | Chouser | And then I've got a couple sufficiently succinct solutions that I've abandoned because of the amount of special-case code I end up building into the framework. |
| 00:25 | jonathan_ | this sort of thing? http://www.cs.vu.nl/Strafunski/gmap/#paradise |
| 00:27 | Chouser | Hm, maybe. |
| 00:28 | jonathan_ | I wrote a tree based filter query tool once. It was 90% boilerplate |
| 00:28 | Chouser | Like if I want to take an atom blog feed and list the titles of all entries with author "agriffis", in XPath I can say: /feed/entry[ author/name = "agriffis" ]/title/node() |
| 00:29 | jonathan_ | cool |
| 00:30 | Chouser | After xml.clj has parsed something, it seems I should be able to store it's parsed tree in var "feed", and do something like: (xml-filter feed :entry [:author :name #(= % "agriffis")] :title :*node) |
| 00:31 | jonathan_ | cool |
| 00:32 | Chouser | right. But I can't get it to work. For instance, in that example xml-filter is assuming a lot about each level, and it's hard to see how to get the flexibility you need. Mainly I'm tripped up over when to assume we're going into a child's content, and when we're just filtering at the current level. |
| 00:33 | Chouser | Anyway, if it were easy, it would be done already. Or at least it wouldn't be as much fun to poke at. |
| 00:33 | jonathan_ | yeah, I find XPath kinda confusing |
| 00:34 | Chouser | oh, really? I kinda love it, at least compared with the rest of the XML world. :-) |
| 00:34 | jonathan_ | I'd write my own content handler |
| 00:34 | Chouser | what does that mean? |
| 00:34 | jonathan_ | rather than using Rich's |
| 00:34 | Chouser | ah. |
| 00:34 | Chouser | parse it into a different tree? |
| 00:35 | jonathan_ | you could just throw it away |
| 00:35 | jonathan_ | keep the filtered stuff |
| 00:35 | jonathan_ | pas in a callback |
| 00:35 | Chouser | yeah. I don't know that I want to require a re-parse every time you want to look for something different. |
| 00:36 | Chouser | But I am beginning to wonder if a different tree structure wouldn't be easier to work with. |
| 00:36 | jonathan_ | You can always tie it down later |
| 00:38 | Chouser | well, I ought be sleeping. Thanks for your help. |
| 00:39 | jonathan_ | k, ttyl |
| 15:42 | NarayanS | I have "docType" string and want to convert into the symbol :docType for lookup in the map. how do i convert it? |
| 15:42 | rhickey | (keyword "docType") |
| 15:42 | NarayanS | thx |
| 22:00 | NarayanS | clojure=>(< 1 3 10 2 1) |
| 22:00 | NarayanS | nil |
| 22:00 | NarayanS | clojure=>(< 1 3 10 2) |
| 22:00 | NarayanS | false |
| 22:01 | NarayanS | I should get false for both, right? |
| 22:04 | rhickey | probably, but does it matter? |
| 22:05 | NarayanS | may be not |
| 22:15 | MarkJP | (= (< 1 3 10 2) (< 1 3 10 2 1)) |
| 22:32 | rhickey | ok fixed |
| 22:47 | Chouser | *whew* barely got it in under a half hour |
| 22:52 | rhickey | Basic relational algebra is 64 lines of Clojure |
| 22:54 | rhickey | union/difference/intersection/project/select/rename/index/join |
| 23:15 | Chouser | (defmacro seq-test [& exprs] `#(and (seq-filter % ~@exprs) %)) |
| 23:15 | Chouser | Can't use qualified name as parameter |
| 23:17 | Chouser | any ideas? |