destructuring code review: https://gist.github.com/gdeer81/6848b0a8cd5505804063
@gary: For me this is more about having 3 regex vs one regex and readability of the regexes in question. Regarding that, I'd prefer te first one as I find it always hard to parse regex generally.
that's true, if I were to come back to this in a week I'd probably be squinting really hard to parse it in my head
don't use last
, it is O(n)
peek
is O(1) on a vector
totally a generalization ^, only applies if you know the code is hot
gary: IMO the latter is nicer
@arrdem: I also like it but I am biased because I spent all that time writing the long regex string
@gary: my reasoning is that it's easier to write a single regexp that matches the entire interesting language and then select the interesting subterms than to write N regexps that match only the interesting substrings.
In the one case you write a single grammar
in the other you write three smaller grammars
which in my mind is just more potential failure points
Any particular reason you don't parse the URI and query-string using dedicated objects/fns?
java.net.URI. and ring.util.codec/decode-form
because I'm translating poorly written java into naively written clojure
also, I'm not parsing in a web server or anything like that
I'm getting a big blob of text and having to parse through it to get the urls