#clojure log - Aug 24 2014

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

0:27 zeebrah: is there any plans for a standard document for clojure?

0:35 andyf: zeebrah: You mean like the Common Lisp HyperSpec and/or standards document? I don't think so

0:36 zeebrah: andyf: or like C99 yep

0:38 andyf: Like most recent languages I can think of other than JavaScript, it is defined by its doc strings and implementation

0:48 zeebrah: andyf: yeah but you'd rather be in the C/Java/Scheme/CL camp than Ruby/bf/etc in terms of being a legitimate language with a standard imho

0:49 andyf: Examples where I'd think it is in good company: Perl, Python, Go, and yes even Ruby

0:50 The main reason for standards are if you have multiple implementations and you want programs to work on all of them that conform to standard

0:54 zeebrah: i'm not sure the company of perl and ruby inspire confidence though

0:54 andyf: Because?

0:56 zeebrah: if there was a standard you could have multiple competing implementations with different strengths and weaknesses

0:57 andyf: You can have that without a standard

0:58 zeebrah: not really though because you have to make choices based on implementation quirks

0:58 andyf: Python and Ruby have several implementations

1:01 But I guess I don't really see multiple competing implementations as an advantage, if the main one is open source and works well enough

1:05 zeebrah: im sure there are a lot of advantages, better performance, correctness, more use cases where one impl is better suited than another one, etc

1:06 you can rest on your laurels less like python did with the GIL thing all those years

1:06 documentation and understand how your code will behave for users too

1:07 aravindh: Hello! Why does (= [1 2 3] (sorted-set 1 2 3)) return false?

1:07 andyf: Sets are never equal to vectors in Clojure

1:08 You would get true if you wrapped seq call around sorted-set exit

1:08 Replace "exit" with "expr" there

1:09 aravindh: @andy - thanks, got it

1:09 zeebrah: andyf: you can't really say 'never equal to vectors in clojure' without having a standard either :P that could change in the next release hah

1:10 mthvedt: zeebrah: the behavior of collection equality comes over from the java standard

1:11 zeebrah: mthvedt: not really the point

1:11 mthvedt: zeebrah: the point is there’s a ‘standard’, if implicit

1:12 andyf: zeebrah: I can say it if I qualify with "in any Clojure version releases so far, up to 1.6". But I understand your point.

7:46 razum2um: hi folks, could be a newbie q, but why cannot I get a full stacktrace with my lines of code? https://gist.github.com/razum2um/497e677f44e9e693688c

7:50 oh, nevermind, just wonder why default depth of stacktrace is 12

7:51 pyrtsa: (doc pst)

7:51 clojurebot: "([] [e-or-depth] [e depth]); Prints a stack trace of the exception, to the depth requested. If none supplied, uses the root cause of the most recent repl exception (*e), and a depth of 12."

7:51 pyrtsa: razum2um: That's why. ^

7:52 razum2um: pyrtsa: yep, thx but I think in lot of cases it's too small default

7:53 pyrtsa: AFAICT, pst was intended to be used manually on the REPL so if it isn't long enough for you, just give another number. Otherwise, you can always dig out the full stack trace from the exception yourself. :)

8:04 razum2um: btw, is there an automatic way to start a repl in a repl? and subsequently - rescue all the expections and start a repl it that context (i.e. get the best debugger ever thought) ?

8:10 found (clojure.main/repl) will try to use technique like in tools.trace to redefine all functions in a ns

8:10 just wonder if such attempt exist

8:13 justin_smith: razum2um: there is ritz, which kind of fits that bill. But in my experience better than the best debugger is to write stateless functions and verify their behavior with the sort of input and output they will get. Exceptions should be for things that are out of your control at runtime (user or hardware problems), and not for buggy code

8:15 razum2um: justin_smith: it's a beautiful theory. i'm importing db records and some of them fail importing, besides, this code is not mine, but inherited, i need to dig in why it's happening on some rear data

8:16 justin_smith: razum2um: maybe you want preconditions or assertions on your importing function

8:16 razum2um: i need some kind of rescue + break

8:16 justin_smith: that's what (try ... (catch ...)) is for

8:17 if it's an exception you think you can work around

8:17 razum2um: yep, doing so, but ideally want to have smth like tools.trace to redefine functions and automatically doing so

8:18 justin_smith: I think technomancy 's robert-hooke library can do that. https://github.com/technomancy/robert-hooke/

8:19 but do you really have that many different functions you need to wrap in try blocks?

8:19 razum2um: yep, saw this, but didnt think is this context, thanks!

8:21 currently my data has changed dramatically and failures are happening in many places at random rows, besides some attempts took 5min to reach the point of failure

8:22 just tired of this start->inject try->restart process

8:23 justin_smith: razum2um: another technique I like is (def failures (atom [])) ... and then inside the function (try .... (catch Exception e (swap! failures conj args))) - then inside the repl, make unit tests or assertions based on the the data that provokes errors

8:24 razum2um: justin_smith: good idea, remembers me of let it fail :)

8:24 justin_smith: and if not doing so already, you need to be doing all this in a repl for this to work of course

8:24 razum2um: btw, inside (clojure.main/repl) how to access the parent binding?

8:24 justin_smith: parent binding?

8:25 razum2um: (catch Exception e (clojure.main/repl))))

8:25 how to access locals in this function

8:25 justin_smith: I don't think that will let you access locals from inside the form that launched it

8:25 it's not meant to do so

8:26 razum2um: can i pass binding manyally?

8:26 justin_smith: razum2um: you could use something like my above failures atom trick to pass the locals up to the namespace level

8:28 razum2um: hm :| sounds like ugly trick in this context

8:29 justin_smith: razum2um: it seems like you want recoverable conditions like common lisp has. This isn't really a clojure feature, and I suspect any emulation of it will be an ugly trick.

9:51 razum2um1: justin_smith: yeah, found this - https://github.com/GeorgeJahad/debug-repl

10:45 Chousuke: spwa tampere population density

10:45 oops.

12:13 luxbock: when using cider-stacktrace, cider-stacktrace-jump works in clojure.core files, i.e. it pops up the buffer with the relevant source and line number, but for some reason it's not working with my own source files

12:14 do others have this same problem and is there a solution to it? I quite like the new stacktrace mode

12:15 justin_smith: you may want to ask on #clojure-emacs - I think that should work with your own namespaces in cider

13:01 annapawlicka: Does anyone have any esperience with accessing Clojars data feeds? (https://github.com/ato/clojars-web/wiki/Data) I'm seeing Access-Control-Allow-Origin error on my GET requests, no matter whether I request json or jsonp or the default.

13:33 shekibobo: anyone in here use expectations for testing?

13:36 I'm trying to get my first test set up, but don't understand this error:

13:36 Error refreshing environment: java.io.FileNotFoundException: Could not locate test/myproject/core__init.class or test/myproject/core.clj on classpath:

13:37 using lein-autoexpect

13:39 test file is in /test/myproject/core.clj

14:11 gfredericks: shekibobo: what command do you use to start that?

14:12 my guess is that you or something is prepending 'test' to a namespace name

14:13 justin_smith: shekibobo: do your core ns and your core test ns have the same relative path?

14:13 because it looks like they would

14:13 and that breaks thing

14:13 shekibobo: I actually switched to speclj

14:14 that got things working

14:14 but they probably did

14:14 justin_smith: just saying, if you have src/myproject/core.clj and test/myproject/core.clj that is intrinsically broken

14:15 shekibobo: well, I think it was called test/myproject/core_test.clj

14:15 justin_smith: that's not what you said above

14:15 or maybe the issue is the name of the test ns

14:17 gfredericks: lol

14:17 "was having trouble running my tests, so I tried switching test libraries, and that worked."

14:18 "I kept getting this syntax error, so I switched to python and it went away."

14:19 shekibobo: well, I came across a site that talked about deprecating expectations

14:20 pretty new to this ecosystem, so I'm just trying things out

14:21 gfredericks: huh; I don't *think* it's deprecated

14:21 shekibobo: looks like it's not deprecated, though

14:21 now that I check github

14:21 last update 19 days ago

14:21 *shrug*

14:30 gfredericks: shekibobo: was it http://blog.jayfields.com/2012/11/clojure-deprecating-expectationsscenari.html

14:48 shekibobo: yeah, that was it. just didn't remember exactly what triggered me to switch libs

16:35 kqr: is there a function (fn [f x] (if x (f x))) that I'm missing?

16:36 or a macro, rather, I suppose

16:36 or maybe not

16:36 i'm so used to non-strict evaluation

16:37 ...I think I mean a function, yeah

16:37 justin_smith: a macro would not be needed there - since you need to fully evaluate x regardless of the branch taken

16:38 (I guess you could have a version where x is nil and f is not a valid function, and avoid that error with a macro...)

16:38 maybe?

16:38 kqr: probably, but that's not going to be the case in my code

16:38 justin_smith: there is fnil to give f a default argument for a nil input

16:38 kqr: i'm just curious if that function exists as part of clojure.core or something like that, and I'm just not finding it

16:39 i saw fnil, but i want the call to be ignored entirely if the argument is nil

16:39 justin_smith: but I don't think there is #(and %2 (% %2))

16:39 amalloy: kqr: it's a bit like one of the things added in 1.5, i think test->?

16:39 ,(test-> nil inc)

16:39 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: test-> in this context, compiling:(NO_SOURCE_PATH:0:0)>

16:39 amalloy: ugh, i don't remember what names he settled on

16:40 kqr: cond->? some->?

16:40 amalloy: cond->

16:40 ,(cond-> nil inc)

16:40 clojurebot: #<AssertionError java.lang.AssertionError: Assert failed: (even? (count clauses))>

16:40 justin_smith: ,(clojure.repl/apropos "->")

16:40 clojurebot: (cond->> -> as-> some->> ->VecSeq ...)

16:40 amalloy: man, i give up

16:40 kqr: hehe

16:40 amalloy: i don't use those things

16:40 kqr: some->

16:40 looks right

16:41 ,(some-> nil inc)

16:41 clojurebot: nil

16:41 kqr: ,(some-> 3 inc)

16:41 clojurebot: 4

16:41 kqr: yay

16:41 thanks

16:42 when you say "he", are you talking about hickey or someone else?

16:47 amalloy: hickey

16:49 kqr: is he like the BDFL of clojure or does he just happen to be very active in development?

16:50 mercwithamouth: ....

16:50 catern: he is the creator and BDFL

16:50 kqr: i knew he was the creator, I just wasn't sure about the BDFL part :>

16:53 catern: he is King Hickey, first of his line, BKFL, champion of the order of the curved line

16:55 kqr: haha

16:55 it's so weird coming to a new PL community

16:55 clojurebot: No entiendo

16:55 kqr: and going from knowing a lot to knowing nothing

16:55 rpaulo: King Hickey, GBE

16:58 kqr: if I have moved a function from one namespace to another, and try to reload the namespace that now has the function in it, the REPL complains about "f already refers to <old-namespace>/f" even though that's been removed. how do I fix that without restarting the REPL?

17:04 zoldar: kqr: maybe try ns-unmap ?

17:04 kqr: http://stackoverflow.com/a/5571144

17:05 kqr: zoldar, that did the trick

17:06 zoldar, do you happen to know why f was in the user namespace, even though I, as far as I know, never imported it to there?

17:06 justin_smith: kqr: also, if you require :as instead of use this stuff comes up less often (though it's slightly more verbose)

17:06 kqr: wait, you were getting those warnings without calling use? that's weird

17:07 zoldar: kqr: I have no idea

17:07 justin_smith: kqr: if you require or use, the function is not "in" the user ns, but it has a binding there

17:07 the error is about the binding, not about where it is defined

17:07 kqr: justin_smith, I require :as in all my files

17:08 justin_smith: OK, what about in the repl?

17:08 kqr: justin_smith, I haven't use'd or required anything in the REPL as far as I know

17:08 justin_smith: then how the hell is that function even defined?

17:08 kqr: does leiningen do some requiring when I run lein repl?

17:08 or wait a minute

17:09 justin_smith: how are you loading this code into your repl?

17:09 kqr: I reload the namespaces with (use 'name.space :reload)

17:09 justin_smith: right

17:09 and use creates bindings

17:09 kqr: that maybe counts

17:09 yeah

17:09 justin_smith: the error says two bindings have the same name

17:09 which they do

17:09 because you are using use

17:09 kqr: that makes a lot of sense!

17:09 things making sense makes me happy

17:10 zoldar: usually, you don't use use

17:10 kqr: is there a better way to reload your project?

17:10 justin_smith: so, going back to my first comment on this subject, if you (require '[foo.bar :as bar] :reload) instead of (use 'foo.bar :reload), this problem disappears

17:10 zoldar: sorry, couldn't resist

17:10 kqr: justin_smith, ah

17:11 justin_smith, is that what people normally do when they work with their project in the REPL or am I missing something?

17:11 justin_smith: that's what I normally do

17:11 kqr: it feels awkwardly verbose, is all I'm thinking

17:11 justin_smith: I think most people do a keystroke that makes their editor do some equivalent for them

17:11 kqr: ah

17:11 justin_smith: there is also :reload-all

17:11 for recursive reloading

17:11 kqr: that sounds more like what I want

17:12 justin_smith: this still doesn't cover the more subtle problem that reloading can only add things to namespaces

17:12 it doesn't remove things even if the definition is no longer there

17:12 (you also have to watch out for defonce, and things like defmulti that have defonce semantics)

17:13 ,(doc ns-unmap)

17:13 clojurebot: "([ns sym]); Removes the mappings for the symbol from the namespace."

17:13 justin_smith: that solves that problem

17:14 zoldar: kqr: afaik, tools.namespace provides some tooling to make such operations easier

17:14 kqr: where do I start looking when I get error messages like "ClassCastException java.lang.Boolean cannot be cast to clojure.lang.Symbol clojure.core/alias (core.clj:3940)"?

17:14 zoldar, i saw that mentioned somewhere else, yeah

17:14 justin_smith: kqr: (pst) - then look for calls in your own code

17:14 kqr: zoldar, i'll have to look at it once I'm slightly more comfortable with just the default system

17:15 justin_smith: one thing with clojure is we end up with very deep call stacks

17:15 kqr: justin_smith, that's a good idea for future errors, thanks. in this case, it happens when I try to :reload-all, so there are no calls that are mine hehe

17:16 justin_smith: kqr: weird, maybe one of your namespaces being recursively reloaded has a broken ns form

17:17 alias is a function that implements the namespace binding for use / require

17:17 ,(doc alias)

17:17 clojurebot: "([alias namespace-sym]); Add an alias in the current namespace to another namespace. Arguments are two symbols: the alias to be used, and the symbolic name of the target namespace. Use :as in the ns macro in preference to calling this directly."

17:17 kqr: what I'm trying to eval is (require 'my-project.core :as 'my-project :reload-all)

17:17 justin_smith: ok, that's malformed

17:17 kqr: ah

17:18 justin_smith: (require '[my-project.core :as my-project] :reload-all)

17:18 kqr: oh

17:18 I see

17:18 I can't believe I missed that – you even typed it correctly before!

17:18 thanks

17:18 justin_smith: np

17:18 kqr: clojure certainly feels a lot different from my main work horse – haskell

17:19 but in a sort of "i'm finally coming home" way

17:19 it's difficult to put into words

17:19 justin_smith: yes, the branch between the ml family and the lisp family happened decades ago, and they are hardly a typical ml and typical lisp :)

17:20 kqr: my main problem so far (beyond the normal beginner ones, such as getting lost in the ecosystem) is that the syntax looks sort of...messy

17:20 I'm not sure why that is though

17:20 justin_smith: I'm glad to hear you're getting to feel comfortable with clojure, it's a great language imho

17:20 (inc clojure)

17:20 lazybot: ⇒ 18

17:21 justin_smith: it's not much of a syntax, and it has little to no sugar in it

17:22 andyf: I know I've seen examples of this before, but I can't recall where right now. I want to require or use a namespace conditionally at a certain point in my code, and then call functions inside of it after that. And I want the file to compile. Examples you can point me at?

17:22 justin_smith: resolve

17:22 zoldar: kqr: end of the comment for the example antlr grammar for clojure by parr describes it well ;) https://github.com/antlr/grammars-v4/blob/master/clojure/Clojure.g4

17:24 kqr: zoldar, hehe. what's weird is that when I did a little common lisp a few years ago, I remember the syntax not being a problem at all. the parens disappeared after a few days and so on

17:24 zoldar, I guess I expected that to happen quicker with clojure, but maybe it'll take some time

17:26 zoldar: kqr: probably, there's still a bit more sugar, like literals for vectors, sets, maps, anonymous fns etc.

17:26 kqr: yeah those things are great though

17:27 sveri: Hi, how can I assert that a function is returned by one of my methods with midje?

17:27 kqr: i should probably be put into rehab for my abuse of maps for all kinds of communication between functions...

17:27 amalloy: the vector literals aren't actually syntax sugar for anything, though

17:28 like, (defn foo [x] x). how do you "de-sugar" the []s?

17:37 andyf: kqr: It is hard to go too far with maps :)

17:37 kenrestivo: has anyone tried using friend-oauth2 with google apps oauth2 login system?

18:09 schmee: I get a strange error with core.async, "No method in multimethod '-item-to-ssa' for dispatch value: :fn", from this code: https://gist.github.com/schmee/6d6bbeff46a40c28a7ac (<15 LOC)

18:24 Bronsa: schmee: go blocks cannot cross fn boundaries

18:25 schmee: a >!/<! operation must be in the same lexical scope of the go block, and in the same fn

18:25 schmee: Bronsa: aha!

18:25 Bronsa: do you have any idea how I could rewrite that so that it works?

18:25 just move in the go-block?

18:26 Bronsa: schmee: I'm no core.async expert, but I think you can just write that as (sloop socket #(put! c %))

18:27 schmee: Bronsa: I'll try that, thanks!

18:30 (inc Bronsa)

18:30 lazybot: ⇒ 46

20:07 shekibobo: I'm trying to understand and solve the 0-1 knapsack problem, which seems to depend on maintaining a matrix of values that can be updated over the process of running a recursive function

20:07 since everything is immutable, how would I even go about recording those values somewhere?

20:08 amalloy: shekibobo: loop (or reduce) over a vector of vectors

20:19 kristof: shekibobo: Are you familiar with the technique of passing state as an explicit argument?

20:19 shekibobo: loop and recur with the state explicitly

20:19 shekibobo: if you mean passing the mutated version of something to a recursive function, yeah

20:19 kristof: shekibobo: Right, but if you try that in clojure you might blow the stack, so use recur :)

20:20 shekibobo: does recur have to be used with loop?

20:20 justin_smith: recur also works with functions

20:20 shekibobo: ok

20:20 justin_smith: but is an error if not in the tail position

20:20 shekibobo: ok

20:20 justin_smith: (unlike scheme where a self call may or may not be a tail call, with no error checking from the compiler)

20:29 shekibobo: what does memoize do?

20:29 justin_smith: shekibobo: it remembers the return value it got with a particular set of arguments, with the same args in the future it returns the same result again, from the cache

20:30 shekibobo: so it's great, as long as you don't count on any side effects

20:30 shekibobo: ok

20:30 justin_smith: (and as long as you know you will be getting the same args over and over)

20:30 so like memoizing + would likely be a waste of ram

20:30 shekibobo: right

20:30 justin_smith: but memoizing fib, and fib being recursive, is a smart plan

20:31 shekibobo: because it remembers all the past arguments->return values that it received?

20:31 justin_smith: because then you can implement a naive recursive fib, and still get decent performance after the first call

20:31 right

20:31 shekibobo: that might be what I'm looking for, then, thanks

20:31 justin_smith: so it only needs to recurse the first time it hits a particular arg - after that it just gets the result from cache

20:31 shekibobo: depending on the flexibility you need, there is also core.cached

20:31 for ttl caching etc.

20:32 shekibobo: ok, thanks

20:32 probably memoize for my purposes

20:33 kristof: justin_smith: "with no error checking from the compiler" What's wrong with a self call that isn't in tail position? A lot of functions on trees look like that.

20:34 amalloy: kristof: nothing is wrong with it. justin_smith's point is that you don't want to write something that you *think* is tail recursive if it actually isn't

20:34 justin_smith: kristof: sure, but I mean recur is checked for tail position

20:34 kristof: gotcha

20:34 Carry on

20:55 shekibobo: ahh, good ol' stack overflow...

21:06 danielcompton: Headlining feature of clojure 1.8: dissoc-in

21:06 catern: oh boy

21:07 gtrak: lol finally

21:07 it's going to break so many codebases

21:07 make them spew warnings

21:14 TimMc: danielcompton: whaaat, really?

21:15 amalloy: TimMc: i'm pretty sure danielcompton was saying that as some kind of mix of hope and irony

21:18 * TimMc submits a patch to add dissco-in, a function that will dec a nested value while printing a field of asterisks to stderr

21:19 danielcompton: Hope and irony, also will come with disco-in, a function that returns you to the 70's

21:20 amalloy: y'know, TimMc, i'm always complaining that the behavior of dissoc-in wouldn't be obvious, but you've come up with a behavior so intuitive i can't object

21:24 justin_smith: danielcompton: only if we get disco-stu as well

21:24 TimMc: amalloy: No, no, this is dissco-in

21:25 diss + disco in

21:25 * TimMc adjusts glasses. "Allow me to explain the joke."

21:25 danielcompton: justin_smith: disco-stuart-halloway

21:26 justin_smith: lol

21:26 TimMc: What about disco-stuart-sierra?

21:26 danielcompton: the other Stuart

21:27 justin_smith: sounds like there will need to be a dance-fight to establish the true holder of the disco-stu title

21:31 TEttinger: the simpsons marathon is pretty great right now

21:32 TimMc: What mile are they on?

21:34 sritchie: just pushed an announcement for om-bootstrap to the mailing list: https://github.com/racehub/om-bootstrap

21:34 doc site with live examples, if anyone’s interested: http://om-bootstrap.herokuapp.com/

21:35 launching a project on a sunday night, woohoo!!

21:35 justin_smith: nice

21:37 TEttinger: 278 hours of one show, wow

21:38 justin_smith: that's 151.78053237410072 meters of show per hour

21:38 pretty slow pace for a marathon

21:39 #units

21:40 catern: lol

21:41 good ole units

22:19 maravillas: sritchie: that looks incredibly handy

22:19 sritchie: yeah, it’s been great

22:19 maravillas: still missing some of the more awesome components, but I should be able to knock those out this week

22:20 mynomoto: sritchie: looks amazing!

22:20 sritchie: thanks!

22:22 it was fun to write the doc site using the library :)

22:22 mynomoto: sritchie: looks like you have more than react-bootstrap itself.

22:26 gtrak: is the pedestal lein template out of date? I can't get interactive reload going with run-dev.. other question, is pedestal use growing?

22:30 beamso: is anyone using schema with clojurescript?

22:32 gtrak: beamso: lots of people are

22:33 beamso: i'm having an issue where my attempt to check/validate data against a schema gives me a 'No protocol method Schema.walker defined for type undefined:' message in the console of my web browser. any ideas?

22:38 amalloy: beamso: that's what a null pointer exception looks like in javascript

22:38 your schema is undefined, instead of a schema

22:44 beamso: oh, okay

22:46 sritchie: beamso: yeah, I’ve had that

22:46 typo

22:59 danielcompton: gtrak: Pedestal App has been 'put on ice', Pedestal Service is still being developed

22:59 gtrak: yes, I knew that already, I figured out the issue with the template.

22:59 danielcompton: 'put on ice' -> taken to the great garbage collector in the sky

22:59 gtrak: haha

23:00 well, I wonder if it'll ever get critical mass, I've been using compojure for a long time already, ready to branch out.

23:00 and the async stuff + transit is appealing.

23:04 danielcompton: gtrak: is Pedestal using Transit?

23:05 gtrak: i don't think it is, I'm just thinking ahead.

23:05 i mean, obviously that's something they'll do eventually

23:05 if not internally already

23:06 danielcompton: gtrak: do you know how much Cognitect is using Pedestal internally?

23:06 sarcher: hi anyone around that is familiar with clojure data.xml?

23:06 and is willing to help a newb.

23:06 gtrak: danielcompton: I know they use it for some client projects.

23:06 but that's about it

23:06 that's about all I know, rather.

23:12 amalloy: ~anyone

23:12 clojurebot: Just a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."

23:13 lpvb: every channel on freenode has this rule lol

23:14 * justin_smith is off to found #anyone, where "has anyone..." is the only way of starting a question that is allowed.

23:17 * beamso tried just asking the questions in #clojurescript, but got a response here with the 'is anyone' leading question

23:29 arrdem: (inc justin_smith)

23:29 lazybot: ⇒ 65

23:32 TEttinger: sarcher, did you have a question?

23:32 catern: "has anyone ever dealt with people falling prey to the XY problem?"

23:33 TEttinger: has anyone seen how ~anyone works?

23:42 sarcher: TEttinger: http://stackoverflow.com/q/25478704/1310

23:43 TEttinger: I took the time to write it up on stackoverflow.

23:43 TEttinger: cool

23:43 sarcher: I'm trying to learn clojure and the first thing I know I'll need to do is parse xml and do something with it.

23:44 so i'm reimplementing something i've done before in java.

23:44 it didn't take me long to get stuck :)

23:45 TEttinger: conveniently linked by that stack overflow is http://stackoverflow.com/questions/14333637/how-can-i-lazily-parse-big-xhtml-file-in-clojure?rq=1

23:45 kristof: I wonder how clojure performs on Zing. :o

23:45 TEttinger: it's great how stack overflow waits for you to post to suggest stuff that might make you not have to post :P

23:46 this first answer here too, sarcher. http://stackoverflow.com/questions/9939844/huge-xml-in-clojure

23:48 there's a hidden comment there that could be helpful: Got this working with wikipedia dumps - nice. You'll want to wrap it in with-open and dorun to get it to lazily work through a large list: (with-open [rdr (fn-that-opens-a-reader)] (dorun (->> ...as above...

23:50 sarcher: TEttinger: I actually looked at the suggested answers when i typed up the question.

23:50 I think the links you posted will get me what I need. Thanks!

23:50 TEttinger: no prob.

23:51 I can make an answer if I need the karma, I'm at like 13...

23:51 nah

23:51 sarcher: feel free to put in an answer

23:51 i'll up vote / accept it haha.

23:51 I wasn't searching for "HUGE XML CLOJURE"

23:51 hehe

23:51 it may help someone in the future

23:51 if not i'll write the answer once I get it working.

23:56 arrdem: anyone know of a text formatting library in Clojure?

23:57 I'm toying with the idea of a "document" as a sequence of nodes describing plain text formatting operations, and transformers to and from raw strings to enable restructuring/reformatting by blocks.

23:58 say {:op :indent :width 2 :children [:text] :text "my two space indented block"} etc.

Logging service provided by n01se.net