#clojure logs

2014-08-24

00:27zeebrahis there any plans for a standard document for clojure?
00:35andyfzeebrah: You mean like the Common Lisp HyperSpec and/or standards document? I don't think so
00:36zeebrahandyf: or like C99 yep
00:38andyfLike most recent languages I can think of other than JavaScript, it is defined by its doc strings and implementation
00:48zeebrahandyf: 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
00:49andyfExamples where I'd think it is in good company: Perl, Python, Go, and yes even Ruby
00:50andyfThe main reason for standards are if you have multiple implementations and you want programs to work on all of them that conform to standard
00:54zeebrahi'm not sure the company of perl and ruby inspire confidence though
00:54andyfBecause?
00:56zeebrahif there was a standard you could have multiple competing implementations with different strengths and weaknesses
00:57andyfYou can have that without a standard
00:58zeebrahnot really though because you have to make choices based on implementation quirks
00:58andyfPython and Ruby have several implementations
01:01andyfBut I guess I don't really see multiple competing implementations as an advantage, if the main one is open source and works well enough
01:05zeebrahim sure there are a lot of advantages, better performance, correctness, more use cases where one impl is better suited than another one, etc
01:06zeebrahyou can rest on your laurels less like python did with the GIL thing all those years
01:06zeebrahdocumentation and understand how your code will behave for users too
01:07aravindhHello! Why does (= [1 2 3] (sorted-set 1 2 3)) return false?
01:07andyfSets are never equal to vectors in Clojure
01:08andyfYou would get true if you wrapped seq call around sorted-set exit
01:08andyfReplace "exit" with "expr" there
01:09aravindh@andy - thanks, got it
01:09zeebrahandyf: 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
01:10mthvedtzeebrah: the behavior of collection equality comes over from the java standard
01:11zeebrahmthvedt: not really the point
01:11mthvedtzeebrah: the point is there’s a ‘standard’, if implicit
01:12andyfzeebrah: I can say it if I qualify with "in any Clojure version releases so far, up to 1.6". But I understand your point.
07:46razum2umhi 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
07:50razum2umoh, nevermind, just wonder why default depth of stacktrace is 12
07:51pyrtsa(doc pst)
07:51clojurebot"([] [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."
07:51pyrtsarazum2um: That's why. ^
07:52razum2umpyrtsa: yep, thx but I think in lot of cases it's too small default
07:53pyrtsaAFAICT, 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. :)
08:04razum2umbtw, 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) ?
08:10razum2umfound (clojure.main/repl) will try to use technique like in tools.trace to redefine all functions in a ns
08:10razum2umjust wonder if such attempt exist
08:13justin_smithrazum2um: 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
08:15razum2umjustin_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
08:16justin_smithrazum2um: maybe you want preconditions or assertions on your importing function
08:16razum2umi need some kind of rescue + break
08:16justin_smiththat's what (try ... (catch ...)) is for
08:17justin_smithif it's an exception you think you can work around
08:17razum2umyep, doing so, but ideally want to have smth like tools.trace to redefine functions and automatically doing so
08:18justin_smithI think technomancy 's robert-hooke library can do that. https://github.com/technomancy/robert-hooke/
08:19justin_smithbut do you really have that many different functions you need to wrap in try blocks?
08:19razum2umyep, saw this, but didnt think is this context, thanks!
08:21razum2umcurrently 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
08:22razum2umjust tired of this start->inject try->restart process
08:23justin_smithrazum2um: 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
08:24razum2umjustin_smith: good idea, remembers me of let it fail :)
08:24justin_smithand if not doing so already, you need to be doing all this in a repl for this to work of course
08:24razum2umbtw, inside (clojure.main/repl) how to access the parent binding?
08:24justin_smithparent binding?
08:25razum2um(catch Exception e (clojure.main/repl))))
08:25razum2umhow to access locals in this function
08:25justin_smithI don't think that will let you access locals from inside the form that launched it
08:25justin_smithit's not meant to do so
08:26razum2umcan i pass binding manyally?
08:26justin_smithrazum2um: you could use something like my above failures atom trick to pass the locals up to the namespace level
08:28razum2umhm :| sounds like ugly trick in this context
08:29justin_smithrazum2um: 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.
09:51razum2um1justin_smith: yeah, found this - https://github.com/GeorgeJahad/debug-repl
10:45Chousukespwa tampere population density
10:45Chousukeoops.
12:13luxbockwhen 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:14luxbockdo others have this same problem and is there a solution to it? I quite like the new stacktrace mode
12:15justin_smithyou may want to ask on #clojure-emacs - I think that should work with your own namespaces in cider
13:01annapawlickaDoes 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:33shekiboboanyone in here use expectations for testing?
13:36shekiboboI'm trying to get my first test set up, but don't understand this error:
13:36shekiboboError refreshing environment: java.io.FileNotFoundException: Could not locate test/myproject/core__init.class or test/myproject/core.clj on classpath:
13:37shekibobousing lein-autoexpect
13:39shekibobotest file is in /test/myproject/core.clj
14:11gfredericksshekibobo: what command do you use to start that?
14:12gfredericksmy guess is that you or something is prepending 'test' to a namespace name
14:13justin_smithshekibobo: do your core ns and your core test ns have the same relative path?
14:13justin_smithbecause it looks like they would
14:13justin_smithand that breaks thing
14:13shekiboboI actually switched to speclj
14:14shekibobothat got things working
14:14shekibobobut they probably did
14:14justin_smithjust saying, if you have src/myproject/core.clj and test/myproject/core.clj that is intrinsically broken
14:15shekibobowell, I think it was called test/myproject/core_test.clj
14:15justin_smiththat's not what you said above
14:15justin_smithor maybe the issue is the name of the test ns
14:17gfrederickslol
14:17gfredericks"was having trouble running my tests, so I tried switching test libraries, and that worked."
14:18gfredericks"I kept getting this syntax error, so I switched to python and it went away."
14:19shekibobowell, I came across a site that talked about deprecating expectations
14:20shekibobopretty new to this ecosystem, so I'm just trying things out
14:21gfrederickshuh; I don't *think* it's deprecated
14:21shekibobolooks like it's not deprecated, though
14:21shekibobonow that I check github
14:21shekibobolast update 19 days ago
14:21shekibobo*shrug*
14:30gfredericksshekibobo: was it http://blog.jayfields.com/2012/11/clojure-deprecating-expectationsscenari.html
14:48shekiboboyeah, that was it. just didn't remember exactly what triggered me to switch libs
16:35kqris there a function (fn [f x] (if x (f x))) that I'm missing?
16:36kqror a macro, rather, I suppose
16:36kqror maybe not
16:36kqri'm so used to non-strict evaluation
16:37kqr...I think I mean a function, yeah
16:37justin_smitha macro would not be needed there - since you need to fully evaluate x regardless of the branch taken
16:38justin_smith(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:38justin_smithmaybe?
16:38kqrprobably, but that's not going to be the case in my code
16:38justin_smiththere is fnil to give f a default argument for a nil input
16:38kqri'm just curious if that function exists as part of clojure.core or something like that, and I'm just not finding it
16:39kqri saw fnil, but i want the call to be ignored entirely if the argument is nil
16:39justin_smithbut I don't think there is #(and %2 (% %2))
16:39amalloykqr: it's a bit like one of the things added in 1.5, i think test->?
16:39amalloy,(test-> nil inc)
16:39clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: test-> in this context, compiling:(NO_SOURCE_PATH:0:0)>
16:39amalloyugh, i don't remember what names he settled on
16:40kqrcond->? some->?
16:40amalloycond->
16:40amalloy,(cond-> nil inc)
16:40clojurebot#<AssertionError java.lang.AssertionError: Assert failed: (even? (count clauses))>
16:40justin_smith,(clojure.repl/apropos "->")
16:40clojurebot(cond->> -> as-> some->> ->VecSeq ...)
16:40amalloyman, i give up
16:40kqrhehe
16:40amalloyi don't use those things
16:40kqrsome->
16:40kqrlooks right
16:41kqr,(some-> nil inc)
16:41clojurebotnil
16:41kqr,(some-> 3 inc)
16:41clojurebot4
16:41kqryay
16:41kqrthanks
16:42kqrwhen you say "he", are you talking about hickey or someone else?
16:47amalloyhickey
16:49kqris he like the BDFL of clojure or does he just happen to be very active in development?
16:50mercwithamouth....
16:50caternhe is the creator and BDFL
16:50kqri knew he was the creator, I just wasn't sure about the BDFL part :>
16:53caternhe is King Hickey, first of his line, BKFL, champion of the order of the curved line
16:55kqrhaha
16:55kqrit's so weird coming to a new PL community
16:55clojurebotNo entiendo
16:55kqrand going from knowing a lot to knowing nothing
16:55rpauloKing Hickey, GBE
16:58kqrif 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:04zoldarkqr: maybe try ns-unmap ?
17:04zoldarkqr: http://stackoverflow.com/a/5571144
17:05kqrzoldar, that did the trick
17:06kqrzoldar, 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:06justin_smithkqr: also, if you require :as instead of use this stuff comes up less often (though it's slightly more verbose)
17:06justin_smithkqr: wait, you were getting those warnings without calling use? that's weird
17:07zoldarkqr: I have no idea
17:07justin_smithkqr: if you require or use, the function is not "in" the user ns, but it has a binding there
17:07justin_smiththe error is about the binding, not about where it is defined
17:07kqrjustin_smith, I require :as in all my files
17:08justin_smithOK, what about in the repl?
17:08kqrjustin_smith, I haven't use'd or required anything in the REPL as far as I know
17:08justin_smiththen how the hell is that function even defined?
17:08kqrdoes leiningen do some requiring when I run lein repl?
17:08kqror wait a minute
17:09justin_smithhow are you loading this code into your repl?
17:09kqrI reload the namespaces with (use 'name.space :reload)
17:09justin_smithright
17:09justin_smithand use creates bindings
17:09kqrthat maybe counts
17:09kqryeah
17:09justin_smiththe error says two bindings have the same name
17:09justin_smithwhich they do
17:09justin_smithbecause you are using use
17:09kqrthat makes a lot of sense!
17:09kqrthings making sense makes me happy
17:10zoldarusually, you don't use use
17:10kqris there a better way to reload your project?
17:10justin_smithso, 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:10zoldarsorry, couldn't resist
17:10kqrjustin_smith, ah
17:11kqrjustin_smith, is that what people normally do when they work with their project in the REPL or am I missing something?
17:11justin_smiththat's what I normally do
17:11kqrit feels awkwardly verbose, is all I'm thinking
17:11justin_smithI think most people do a keystroke that makes their editor do some equivalent for them
17:11kqrah
17:11justin_smiththere is also :reload-all
17:11justin_smithfor recursive reloading
17:11kqrthat sounds more like what I want
17:12justin_smiththis still doesn't cover the more subtle problem that reloading can only add things to namespaces
17:12justin_smithit doesn't remove things even if the definition is no longer there
17:12justin_smith(you also have to watch out for defonce, and things like defmulti that have defonce semantics)
17:13justin_smith,(doc ns-unmap)
17:13clojurebot"([ns sym]); Removes the mappings for the symbol from the namespace."
17:13justin_smiththat solves that problem
17:14zoldarkqr: afaik, tools.namespace provides some tooling to make such operations easier
17:14kqrwhere 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:14kqrzoldar, i saw that mentioned somewhere else, yeah
17:14justin_smithkqr: (pst) - then look for calls in your own code
17:14kqrzoldar, i'll have to look at it once I'm slightly more comfortable with just the default system
17:15justin_smithone thing with clojure is we end up with very deep call stacks
17:15kqrjustin_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:16justin_smithkqr: weird, maybe one of your namespaces being recursively reloaded has a broken ns form
17:17justin_smithalias is a function that implements the namespace binding for use / require
17:17justin_smith,(doc alias)
17:17clojurebot"([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:17kqrwhat I'm trying to eval is (require 'my-project.core :as 'my-project :reload-all)
17:17justin_smithok, that's malformed
17:17kqrah
17:18justin_smith(require '[my-project.core :as my-project] :reload-all)
17:18kqroh
17:18kqrI see
17:18kqrI can't believe I missed that – you even typed it correctly before!
17:18kqrthanks
17:18justin_smithnp
17:18kqrclojure certainly feels a lot different from my main work horse – haskell
17:19kqrbut in a sort of "i'm finally coming home" way
17:19kqrit's difficult to put into words
17:19justin_smithyes, the branch between the ml family and the lisp family happened decades ago, and they are hardly a typical ml and typical lisp :)
17:20kqrmy 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:20kqrI'm not sure why that is though
17:20justin_smithI'm glad to hear you're getting to feel comfortable with clojure, it's a great language imho
17:20justin_smith(inc clojure)
17:20lazybot⇒ 18
17:21justin_smithit's not much of a syntax, and it has little to no sugar in it
17:22andyfI 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:22justin_smithresolve
17:22zoldarkqr: 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:24kqrzoldar, 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:24kqrzoldar, I guess I expected that to happen quicker with clojure, but maybe it'll take some time
17:26zoldarkqr: probably, there's still a bit more sugar, like literals for vectors, sets, maps, anonymous fns etc.
17:26kqryeah those things are great though
17:27sveriHi, how can I assert that a function is returned by one of my methods with midje?
17:27kqri should probably be put into rehab for my abuse of maps for all kinds of communication between functions...
17:27amalloythe vector literals aren't actually syntax sugar for anything, though
17:28amalloylike, (defn foo [x] x). how do you "de-sugar" the []s?
17:37andyfkqr: It is hard to go too far with maps :)
17:37kenrestivohas anyone tried using friend-oauth2 with google apps oauth2 login system?
18:09schmeeI 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:24Bronsaschmee: go blocks cannot cross fn boundaries
18:25Bronsaschmee: a >!/<! operation must be in the same lexical scope of the go block, and in the same fn
18:25schmeeBronsa: aha!
18:25schmeeBronsa: do you have any idea how I could rewrite that so that it works?
18:25schmeejust move in the go-block?
18:26Bronsaschmee: I'm no core.async expert, but I think you can just write that as (sloop socket #(put! c %))
18:27schmeeBronsa: I'll try that, thanks!
18:30schmee(inc Bronsa)
18:30lazybot⇒ 46
20:07shekiboboI'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:07shekibobosince everything is immutable, how would I even go about recording those values somewhere?
20:08amalloyshekibobo: loop (or reduce) over a vector of vectors
20:19kristofshekibobo: Are you familiar with the technique of passing state as an explicit argument?
20:19kristofshekibobo: loop and recur with the state explicitly
20:19shekiboboif you mean passing the mutated version of something to a recursive function, yeah
20:19kristofshekibobo: Right, but if you try that in clojure you might blow the stack, so use recur :)
20:20shekibobodoes recur have to be used with loop?
20:20justin_smithrecur also works with functions
20:20shekibobook
20:20justin_smithbut is an error if not in the tail position
20:20shekibobook
20:20justin_smith(unlike scheme where a self call may or may not be a tail call, with no error checking from the compiler)
20:29shekibobowhat does memoize do?
20:29justin_smithshekibobo: 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:30justin_smithshekibobo: so it's great, as long as you don't count on any side effects
20:30shekibobook
20:30justin_smith(and as long as you know you will be getting the same args over and over)
20:30justin_smithso like memoizing + would likely be a waste of ram
20:30shekiboboright
20:30justin_smithbut memoizing fib, and fib being recursive, is a smart plan
20:31shekibobobecause it remembers all the past arguments->return values that it received?
20:31justin_smithbecause then you can implement a naive recursive fib, and still get decent performance after the first call
20:31justin_smithright
20:31shekibobothat might be what I'm looking for, then, thanks
20:31justin_smithso it only needs to recurse the first time it hits a particular arg - after that it just gets the result from cache
20:31justin_smithshekibobo: depending on the flexibility you need, there is also core.cached
20:31justin_smithfor ttl caching etc.
20:32shekibobook, thanks
20:32shekiboboprobably memoize for my purposes
20:33kristofjustin_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:34amalloykristof: 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:34justin_smithkristof: sure, but I mean recur is checked for tail position
20:34kristofgotcha
20:34kristofCarry on
20:55shekiboboahh, good ol' stack overflow...
21:06danielcomptonHeadlining feature of clojure 1.8: dissoc-in
21:06caternoh boy
21:07gtraklol finally
21:07gtrakit's going to break so many codebases
21:07gtrakmake them spew warnings
21:14TimMcdanielcompton: whaaat, really?
21:15amalloyTimMc: i'm pretty sure danielcompton was saying that as some kind of mix of hope and irony
21:19danielcomptonHope and irony, also will come with disco-in, a function that returns you to the 70's
21:20amalloyy'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:24justin_smithdanielcompton: only if we get disco-stu as well
21:24TimMcamalloy: No, no, this is dissco-in
21:25TimMcdiss + disco in
21:25danielcomptonjustin_smith: disco-stuart-halloway
21:26justin_smithlol
21:26TimMcWhat about disco-stuart-sierra?
21:26danielcomptonthe other Stuart
21:27justin_smithsounds like there will need to be a dance-fight to establish the true holder of the disco-stu title
21:31TEttingerthe simpsons marathon is pretty great right now
21:32TimMcWhat mile are they on?
21:34sritchiejust pushed an announcement for om-bootstrap to the mailing list: https://github.com/racehub/om-bootstrap
21:34sritchiedoc site with live examples, if anyone’s interested: http://om-bootstrap.herokuapp.com/
21:35sritchielaunching a project on a sunday night, woohoo!!
21:35justin_smithnice
21:37TEttinger278 hours of one show, wow
21:38justin_smiththat's 151.78053237410072 meters of show per hour
21:38justin_smithpretty slow pace for a marathon
21:39justin_smith#units
21:40caternlol
21:41caterngood ole units
22:19maravillassritchie: that looks incredibly handy
22:19sritchieyeah, it’s been great
22:19sritchiemaravillas: still missing some of the more awesome components, but I should be able to knock those out this week
22:20mynomotosritchie: looks amazing!
22:20sritchiethanks!
22:22sritchieit was fun to write the doc site using the library :)
22:22mynomotosritchie: looks like you have more than react-bootstrap itself.
22:26gtrakis the pedestal lein template out of date? I can't get interactive reload going with run-dev.. other question, is pedestal use growing?
22:30beamsois anyone using schema with clojurescript?
22:32gtrakbeamso: lots of people are
22:33beamsoi'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:38amalloybeamso: that's what a null pointer exception looks like in javascript
22:38amalloyyour schema is undefined, instead of a schema
22:44beamsooh, okay
22:46sritchiebeamso: yeah, I’ve had that
22:46sritchietypo
22:59danielcomptongtrak: Pedestal App has been 'put on ice', Pedestal Service is still being developed
22:59gtrakyes, I knew that already, I figured out the issue with the template.
22:59danielcompton'put on ice' -> taken to the great garbage collector in the sky
22:59gtrakhaha
23:00gtrakwell, I wonder if it'll ever get critical mass, I've been using compojure for a long time already, ready to branch out.
23:00gtrakand the async stuff + transit is appealing.
23:04danielcomptongtrak: is Pedestal using Transit?
23:05gtraki don't think it is, I'm just thinking ahead.
23:05gtraki mean, obviously that's something they'll do eventually
23:05gtrakif not internally already
23:06danielcomptongtrak: do you know how much Cognitect is using Pedestal internally?
23:06sarcherhi anyone around that is familiar with clojure data.xml?
23:06sarcherand is willing to help a newb.
23:06gtrakdanielcompton: I know they use it for some client projects.
23:06gtrakbut that's about it
23:06gtrakthat's about all I know, rather.
23:12amalloy~anyone
23:12clojurebotJust 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:13lpvbevery channel on freenode has this rule lol
23:29arrdem(inc justin_smith)
23:29lazybot⇒ 65
23:32TEttingersarcher, did you have a question?
23:32catern"has anyone ever dealt with people falling prey to the XY problem?"
23:33TEttingerhas anyone seen how ~anyone works?
23:42sarcherTEttinger: http://stackoverflow.com/q/25478704/1310
23:43sarcherTEttinger: I took the time to write it up on stackoverflow.
23:43TEttingercool
23:43sarcherI'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:44sarcherso i'm reimplementing something i've done before in java.
23:44sarcherit didn't take me long to get stuck :)
23:45TEttingerconveniently linked by that stack overflow is http://stackoverflow.com/questions/14333637/how-can-i-lazily-parse-big-xhtml-file-in-clojure?rq=1
23:45kristofI wonder how clojure performs on Zing. :o
23:45TEttingerit's great how stack overflow waits for you to post to suggest stuff that might make you not have to post :P
23:46TEttingerthis first answer here too, sarcher. http://stackoverflow.com/questions/9939844/huge-xml-in-clojure
23:48TEttingerthere'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:50sarcherTEttinger: I actually looked at the suggested answers when i typed up the question.
23:50sarcherI think the links you posted will get me what I need. Thanks!
23:50TEttingerno prob.
23:51TEttingerI can make an answer if I need the karma, I'm at like 13...
23:51TEttingernah
23:51sarcherfeel free to put in an answer
23:51sarcheri'll up vote / accept it haha.
23:51sarcherI wasn't searching for "HUGE XML CLOJURE"
23:51sarcherhehe
23:51sarcherit may help someone in the future
23:51sarcherif not i'll write the answer once I get it working.
23:56arrdemanyone know of a text formatting library in Clojure?
23:57arrdemI'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:58arrdemsay {:op :indent :width 2 :children [:text] :text "my two space indented block"} etc.