#clojure logs

2011-10-02

00:00amalloyyou are never going to get that from clojure
00:00Arafangionamalloy: I find that hard to believe.
00:01amalloyit is a hosted language, and C isn't really a "host" so much as "someone who, if you're polite, won't murder you"
00:01jlihaha
00:01amalloyand java lacks the capability to talk to hardware except through native libraries which have to be written in C (or something else native) anyway
00:01Arafangionamalloy: I'm very comfortable with such bindings.
00:02Arafangionamalloy: As comfortable as one can be, anyway...
00:02S11001001Arafangion: why not require mono on mac?
00:02ArafangionS11001001: It's a large, unusual download.
00:02amalloygreat, then deploy your clojure app with the jvm or .net dependency and your native libraries
00:02ibdknoxfwiw
00:02ArafangionOn windows I use .net, so that's fine there.
00:02ibdknoxI think there are at most a handful of people doing gui's in clojure
00:03ArafangionOh, I'm not doing the gui in this!
00:03ArafangionI'm doing the GUI natively on each platform. (For better or for worse)
00:03amalloynobody will ever write a clojure->C compiler because clojure depends on the host to do all kinds of things that C just doesn't do. if you wrote such a thing, it wouldn't be at all like clojure by the time you were done
00:04Arafangionamalloy: How so?
00:04amalloy(or, you would realize that what you wrote turned out to be the jvm)
00:04Arafangionamalloy: Actually, I suspect that what the 'C target' ends up writing could well be a javascript host.
00:05amalloymemory management, for example
00:05miwillhitehey all…what are people using for clojure and mysql?
00:05Arafangionmemory management is a minor point.
00:07ibdknoxmiwillhite: you have a few options: clojureql, clj-record, or writing against clojure.java.jdbc
00:07S11001001Arafangion: you might consider common lisp or scheme; some implementations have great C binding support and compile to standalone binaries
00:08jliArafangion: hm, what do you mean it's a minor point?
00:08ibdknoxhaha, could you imagine clojure with explicit memory management? *shudders*
00:08amalloy(inc S11001001)
00:08lazybot⟹ 2
00:09amalloyibdknox: i actually read about a lisp someone had written without garbage collection
00:09miwillhitethanks ibdknox
00:10S11001001you can still turn off the gc in some lisps
00:10Arafangionibdknox: There are a number of ways to manage memory in C, including adding a garbage collector.
00:10S11001001then it's your fault if you don't turn it back on :)
00:10ibdknoxhaha
00:10ArafangionThe best non-GC way of managing memory I've seen is probably that with the ObjC legacy runtime, but ugh, it still falls massively short of true GC.
00:10ibdknoxArafangion: I really hope you do use Clojure, but based on what you've described so far, I don't think Clojure is currently the right tool to solve your problem
00:10ArafangionNSAutoreleasePools are awesome.
00:11jliArafangion: I wonder if trying to use clojure for your problem is really the best solution :(
00:11Arafangionibdknox: Actually, it's not the right tool - I'm mostly exploring and learning for my own education.
00:11jlihaha
00:11ibdknoxArafangion: party on then :D
00:11amalloybut yes. lisp was the first language do to a lot of things, including garbage collection. there's a reason this is the case, and also a reason why gc is the lisp-innovation most commonly used by mainstream languages
00:11ArafangionThe rest of the people I'm working with are still learning Python, pushing yet *another* language isn't going to work. :(
00:13ibdknoxlol
00:13ibdknoxespecially one this different
00:14ArafangionI'm basically the languages geek, it seems. :(
00:14ArafangionDespite never using erlang, or haskell. (Both are on my TODO list!)
00:14jliArafangion: what's the program, if you can discuss any more detail?
00:15Arafangionjli: I can't really discuss, and it's not really relevant save that it requires the GUI to be written in the native toolkit (whatever that means), and that it interacts with hardware.
00:16jliArafangion: what does interacting with hardware entail?
00:16Arafangionjli: From my perspective, it entails interacting with a C++ library.
00:16sridin enlive, can I select all <p> nodes that come after a <h2> node?
00:17Arafangionjli: Which I tend to handle by wrapping it, badly, into a more convenient library.
00:18amalloy$google java compute md5
00:18lazybot[Java simple class to compute MD5 hash] http://www.anyexample.com/programming/java/java_simple_class_to_compute_md5_hash.xml
00:18amalloyugh. someone have a link to a real library?
00:18Arafangionhttp://stackoverflow.com/questions/415953/generate-md5-hash-in-java
00:19Arafangionamalloy: Despite SO's poor reputation on this network, they are remarkably good at answering dumb questions. :)
00:19ibdknoxamalloy: it's relatively simple with MessageDigest
00:19jlisrid: you mean the equivalent of the CSS selector "h2 + p" ?
00:19sridjli: yup
00:19jlishould be. let's see.
00:19sridenlive docs are sadly insufficient
00:19sridhttp://enlive.cgrand.net/syntax.html is terrible to understand for humans
00:20ibdknoxsrid: https://github.com/marick/enlive-tutorial
00:20ibdknoxsrid: https://github.com/swannodette/enlive-tutorial
00:20ibdknoxmuuuuuch better intros
00:20sridi read them
00:21amalloyah, excellent. i'm already depending on commons-codec for base64; i might as well use their md5
00:21jlisrid: seems like there's no "+" in enlive, but you could just use seq processing I think
00:21ibdknoxI don't think you need +
00:22ibdknox:h2 :p should work?
00:22ArafangionWhat kind of lisp is Clojure? Is it feasible to write "lisp code" that happens to be run by different lisp implementations? (Eg, Clojure, ChickenScheme, etcetera)
00:22jliibdknox: wouldn't that only match <p>'s inside <h2>'s?
00:22khaliGibdknox, curious, why are there only a handful?
00:23sridjli: seq processing? you mean tree processing? what is the simplest way to select <p>'s that come after the <h2>?
00:23ibdknoxjli: oh, whoops, it helps if I read what he wants
00:23jli:)
00:23scottjArafangion: any clojure code more than a simple like (+ 2 2) isn't going to run on scheme w/o changes
00:23ibdknoxkhaliG: swing sucks, and I don't know that Clojure makes it particularly easy to write GUI code
00:24amalloyArafangion: clojure picked different keywords for a lot of the low-level primitives, so there will be issues with a "direct transplant" even on the most common lisps
00:24amalloyeg, fn instead of lambda
00:25amalloydef and defn instead of define or defun
00:25ibdknoxmakes things so much easier to read
00:25Arafangionamalloy: That sucks - but I suppose that is a minor point? The more serious concern is probably the object system?
00:25khaliGibdknox, hmm i think it does - miglayout + swing + clojure is pretty nice if you ask me as far as lisps go. Then again, I haven't tried for example lispworks CAPI so that might be better
00:26amalloy*shrug* the host interop, the standard libraries, the data types...
00:26jliArafangion: I think it'd be a headache to try to compile clojure to another lisp
00:26Arafangionjli: What about compiling "another lisp" to clojure?
00:26amalloylivingstone was writing a scheme->clojure translator to help him learn clojure
00:27jlischeme is easy though :)
00:27amalloydon't know how that turned out
00:27Arafangionjli: Yeah, infact, scheme is the lisp I'm thinking of.
00:27amalloyjli: it's the most similar, i think, but there are plenty of pitfalls
00:27jliwell, maybe modulo continuations
00:27ArafangionBusiness logic isn't exactly that damanding.
00:27Arafangion*demanding
00:27khaliGArafangion, btw CAPI might be a good fit for your problem (native look and feel GUI on different platforms)
00:28amalloycontinuations, tail calls, reified environments, "real" cons cells...
00:28ArafangionkhaliG: The GUI isn't that difficult to do on the native platforms, honestly.
00:28jliamalloy: yeah. hmm, I wonder how macro -> macro compilation would work out. seems hairy.
00:28ArafangionkhaliG: Modern toolkits more or less let you just click-click-click and you have the UI done.
00:29jliArafangion: the GUIs can self-replicate now? it is truly the end of days
00:29Arafangionjli: Consider - it's also a good way to ensure separation of UI from business logic.
00:30sridjli: (drop-while #(= :p (:tag %)) (select dom [#{:h2 :p}])) does it.
00:30khaliGbtw offtopic question perhaps - but what are some warm and fuzzy things about using the JVM for you guys?
00:30sridthanks to 4clojure, i didn't reinvent drop-while
00:31miwillhiteexit
00:31scottjkhaliG: very few bugs in my experience compared to common lisp and smalltalk environments I've used.
00:31ArafangionkhaliG: It's generally easy to use anywhere, except perhaps, most smartphones.
00:32S11001001khaliG: it made our language of choice sound enterprisey when akamai bought us :)
00:33jlisrid: it seems like that would select all <p>'s?
00:34amalloysrid: fwiw, (comp #{:p} :tag) is a prettier way to write #(= :p (:tag %))
00:34khaliGscottj, true, it's easy to take the extensive work that has gone into the JVM for granted but it's quite impressive if you reflect on it! S11001001 nice! :)
00:34sridjli: yes, but only those that come after <h2>
00:34sridamalloy: thanks
00:35sridi tend to forget the comp way of doing things
00:35jliamalloy is just a comp fanboy
00:35jli:)
00:35amalloyin a fight between comp and juxt, on the MOON, who would win?
00:35srid,(doc juxt)
00:35clojurebot"([f] [f g] [f g h] [f g h & fs]); Alpha - name subject to change. Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable number of args, and returns a vector containing the result of applying each fn to the args (left-to-right). ((juxt a b c) x) => [(a x) (b x) (c x)]"
00:35jlisrid: hm, I thought #{:h2 :p} would match all h2 and p elements, without regard for ordering.
00:36jliamalloy: juxt
00:36khaliGyea i follow amalloy on 4clojure and noticed his use of comp a few times.. made me use it myself since :P
00:36sridjli: seems like the ordering is top to bottom (no nested <p>'s in the HTML here)
00:36amalloyjli: i know, it's a no-brainer. i just put it out there so i could /ignore anyone who thinks comp would win
00:37jlimy 4clojure solutions have a hideous amount of partial, apply, comp, and generally pointlessness. just getting it out of my system, I hope.
00:37amalloyjli: he's getting a list of all the h2s and ps; then he throws them away until he gets an h2
00:37khaliGjli, i think that's the point, to learn the language better imho
00:39jliamalloy: oh, I see now. srid: so there's only 1 h2?
00:40sridjli: yes.
00:40sridthis webpage was created in frontpage
00:40sridi'm trying to convert it to to epub for reading on the phone
00:41sridspecifically - Microsoft FrontPage 4.0
00:41brehautsrid: thats what, Mesozoic?
00:41brehautor cretaceous. i never can remember
00:41sridlate 1990's I think
00:42ArafangionAncient! I was 5!
00:42Arafangion(And still learning to talk)
00:43amalloyso was frontpage
00:43ArafangionThat's depressing.
00:43ibdknoxthat was back when frontpage would overwrite any html changes you made
00:43ArafangionMaybe that was why my speech was delayed.
00:45scbanybody doing anything serious on the web using clojure?
00:45amalloywww.4clojure.com
00:45amalloyfor certain values of "serious"
00:46jliis there anything that does this? https://gist.github.com/1257064
00:46jlibasically, partition but overlapping groups
00:46amalloy&(partition 3 1 (range 1 9))
00:46lazybot⇒ ((1 2 3) (2 3 4) (3 4 5) (4 5 6) (5 6 7) (6 7 8))
00:46jlioh, darn.
00:47jlihaha
00:47cark=)
00:48sridhow this made any more concise?
00:48srid(filter #(not (empty? (select % [:span :a :> text-node]))) nodes)
00:48jlisrid: anyway. so, you could also use partition. (filter #(= (:tag (first %)) :h2) (partition 2 1 dom))
00:49jliI think at least.
00:49jlithat would get you all (h2, p) pairs
00:49amalloysrid: (filter seq (...))?
00:49scottjsrid: filter not is remove
00:50amalloyscottj: and empty is not seq...
00:50S11001001Arafangion: so you mean like bigloo, which compiles to C, java, and .net?
00:50sridfilter seq works for enlive returning ()
00:50ArafangionS11001001: Yes.
00:50sridmy filter must always return one result.
00:50sridi wish there was something like pick-first
00:51jlisrid: I think some contrib library defines filter-first
00:51jlisrid: I find myself using destructing for this a lot. (let [[result1] (filter ...)] ...)
00:51ArafangionS11001001: Although bigloo gives me low confidence, I'd trust 'C# generation' more than 'Experimental bytecode generation'.
00:53ArafangionHmm, also, #bigloo is practically empty.
00:53sridok, in actuality it turns out that i don't need filter
00:53srid(take-while #(not (seq (select % [:span :a :> text-node]))) (drop-while (comp #{:p} :tag) (select x [#{:h2 :p}])))
00:53S11001001a moment ago, you were considering starting your own such project, Arafangion
00:53sridthat gets all paras after <h2> but stops at the para with a <span><a> link (which is the footer)
00:53sridthis becomes a chapter in epub
00:54ArafangionS11001001: Considering, yes, but I'm not planning on actually using it professionally.
00:54ArafangionS11001001: Because the rest of the team would probably move to get me fired. ;)
00:55S11001001as I understand, you only are interested in the C part though
00:55ArafangionC is one of my targets.
00:55ArafangionObjC and .NET are my primary targets.
00:56ibdknoxI target awesome.
00:56ibdknox*rimshot*
00:56scbibdknox: how ready do you think clojure is for the web? Like in comparisson to other solutions like Django, Rails, Lift, ..., that seem to come with batteries included? I mean I have been using Clojure for a while but I am still not decided whether to pursue working with it on webapps.
00:57jliscb: you should probably just do it :)
00:57brehautis there any point specifically targeting objc? doesn't it all come down to c + objcMsgSend anyway
00:57ibdknoxbrehaut: he likely means cocoa :)
00:58scbjli: you think?
00:58ibdknoxscb: yeah, I'd say just try it: http://www.webnoir.org
00:58ArafangionThere are a lot of nice things provided by Cocoa.
00:58brehautibdknox: not that you have an oar in the game :P
00:58ibdknoxnot at all!
00:58ibdknox:D
00:58S11001001I believe the gnustep people put a message-sending thing in guile
00:58brehautscb: clojure's web story is very compelling
00:58scbibdknox: just when i thought that compojure was the way to go...
00:58scbbrehaut: is it? how so?
00:59ibdknoxit's beautifully succinct
00:59brehautscb: toot toot http://brehaut.net/blog/2011/ring_introduction
01:00brehaut(does not include any noir stuff; sorry chris)
01:00ibdknox!
01:00brehautibdknox: noir was either very new or not on my radar when i wrote that. its had already gotten way out of control :P
01:01S11001001I hope clojure is ready for the web
01:01ibdknoxbrehaut: haha :)
01:01ibdknoxS11001001: it is
01:01brehautibdknox: would you believe i cut stuff from that blog?
01:01ibdknoxlol
01:01scbWell, heh, this is arguably the most biased place to ask :)
01:01ibdknoxit's a great post
01:02scottjscb: according to state of clojure survey 62% of clojurians are using it for web dev
01:02brehautscb: i do django for a day job. django is great, but its also very 2005
01:02brehautibdknox: thanks
01:02ibdknoxscb: I've done web dev in all the common languages
01:02ibdknoxscb: I may be biased, but that's because I know from experience that Clojure is beautiful
01:03brehautscb: in terms of breadth closures web ecosystem is not as complete as python or ruby frinstance, but the tools that are there of a very high quality
01:03ibdknoxwe're missing a solid ORM
01:03ibdknoxwhich I started earlier :)
01:03brehautibdknox: in lets call it a data mapping layer ;)
01:03brehauts/in//
01:03lazybot<brehaut> ibdknox: lets call it a data mappg layer ;)
01:03ibdknoxyes
01:03scottjibdknox: oh so by database layer do you mean only sql?
01:03ibdknoxnot really an ORM
01:04brehautibdknox: clojureql is very promising though
01:04scbbrehaut: was just about to ask that. for example i always check for pre-made stuff for common tasks (like authing, users, stuff that has been made over and over and you just reconfigure, you know)
01:05ibdknoxscottj: it's hard for me to imagine what a database layer that covers more than SQL would look like
01:05ibdknoxscottj: maybe I'm misunderstanding though
01:05brehautscb: the ring layer provides a lot of commonality
01:06brehautscb: however, very few of the tools prescribe particular data 'types'
01:06scottjibdknox: nosql dbs. see clojurize I think it supported sql and mongo or maybe couch
01:07ibdknoxscottj: the semantics of something like redis are totally different than SQL
01:07ibdknoxI would use them in entirely different ways
01:08scottjhttp://anvil.io/posts/clojurize-the-data-not-the-database
01:09ibdknoxthat doesn't appear to solve the thing that's annoying to me
01:09ibdknoxwhich is managing relations between tables
01:09ArafangionAbstracting the database has other advantages, anyway.
01:10justinushi, I need to consume messages from a JMS Queue….. is there any idiomatic clojure code which uses the standard javax.jms interface ?
01:10sridwhat is the alternative for (for [item items]) that doesn't return the values?
01:10sridmore like loop
01:10amalloydoseq
01:14jliibdknox: well-known fact, clojurians are only biased by truth and beauty :)
01:15ibdknoxjli: truth
01:16brehautjli: it helps that clojure is young enough that most people who are interested in it have come from at least one other language (and its a broad range of other langues)
01:17ArafangionAnd that such people aren't terrified of lisps.
01:19scbWell I guess I'll have to check Clojure for the web eventually. the no solid orm point raised by ibdknox is kind of a put off.
01:19amalloyscb: it's hard to have a standard orm when your standard is to not have objects
01:20ibdknoxyeah, sorry I shouldn't have said ORM
01:21jliwhat's an orm? something that takes SQL queries and returns language-native data structures?
01:21carki think functional programming works well with databases
01:21brehautjli:it stands for object/relational mapping
01:21ibdknoxfrom object to table back to object
01:21companion_cubejli: objects map to some database table row
01:22ibdknoxthe advantage is primarily that it handles relations for you
01:22carkinstead of thinking in a object/single row fashion, you think in termns of streams of data
01:22brehautibdknox, jli: via insurmountable impedance mismatch
01:22ibdknoxyes
01:22ibdknoxI firmly believe that ORM is an anti-pattern
01:22ibdknoxrelation management isn't
01:22jliibdknox: how does it handle the relations? do you feed it a schema?
01:23carkibdknox: i agree, but then again i might have given up on these before finding the right one
01:23ArafangionYes - I think ORM gives programmers an excuse NOT to separate the layers.
01:24ibdknoxfor those interested: http://seldo.com/weblog/2011/08/11/orm_is_an_antipattern
01:24ibdknoxjli: yeah simple relation definitions
01:25carkthis post was severly flammed on /r/programming
01:25jlihum, interesting
01:25scbibdknox: what do you use for databases in clojure?
01:25ibdknoxhttps://gist.github.com/1257094
01:25ibdknoxcark: sure
01:25ibdknoxcark: some points he brings up are true though
01:26ibdknoxscb: I screwed around with clj-record
01:26ibdknoxit works, sort of
01:26ibdknoxclojureql is neat
01:26ibdknoxbut is missing a lot and tries to be like clojure instead of accurately representing what it is
01:26ibdknoxI used redis a lot
01:26carki'd love to have a clojureql with a more "functional" interface
01:27brehautibdknox: thats a good summary of the problems with clojureql.
01:27carki use postgres and sqlite
01:27ibdknoxcark: what would that look like?
01:27ibdknoxsince I'm starting on this..
01:27ibdknoxlol
01:27brehautibdknox: also, the ordering of operations matters sometimes and i inevitably get confused by it
01:27carkwell
01:27ibdknoxbrehaut: yeah. it could be cleaner
01:28ArafangionThat said, some ORM's are really useful in providing database abstraction.
01:28ArafangionIn theory, the code does not depend on the database provider.
01:28carkwhat i'm always doing an half-assed implementation to is this : query building
01:28ibdknoxcark: so something like this gist? https://gist.github.com/1257094
01:28ArafangionIn practice, I find writing SQL to be simple enough.
01:28carki would love to have a well thought out way to compose parts of queries
01:29kevinburkeHey, have a quick question about http-agent. I can't seem to get it to return properly
01:29kevinburkeI posted most of the details here http://stackoverflow.com/questions/7624686/get-body-of-http-response-in-clojure
01:29brehautArafangion: the advantage of a layer like clojureql is that it can make your queries composable
01:29carkibdknox: if these are not macros, then yes
01:29brehautArafangion: e.g. this the select, where, from etc clauses could all come from different functions, and without string bashng
01:29Arafangionbrehaut: That's pretty cool.
01:30carkibdknox: i don't care about the defentity stuff, i want to make a function that will return a "select object" then use it as part of another select
01:31carkibdknox: or maybe construct the where parts in several functions, then put it all together later
01:31Arafangionbrehaut: Personally, I think the biggest problem with ORM's is that they try to return instances of dynamically generated *classes*.
01:32carklast time i checked, clojureql was documenting a mostly macro oriented , static queries oriented, interface
01:32brehautArafangion: its the giant awkwardness of expression that grinds my gears
01:32carkit was a while back tho
01:32brehautArafangion: easy things are easy, hard things are maddenning
01:32ibdknoxcark: that is the intent of what I'm building
01:33brehautcark: they did scrap the entire thing and rebuild from scratch onto of relational algebra
01:33ibdknoxcark: select is a macro of convenience, but it has a function behind it to do the same thing
01:33carkbrehaut: ok well i was "away" for a while, i might have to look back into it
01:33amalloyibdknox: do you actually need sql? i've been using mongodb for all my clojure projects and it's been much simpler
01:33Arafangionbrehaut: I can agree with that, too.
01:33carkibdknox: make sure to document the functional interface as well as the macro interface
01:34ibdknoxcark: of course :)
01:34carkibdknox: for any serious work you'll want to fall back to it anyways
01:34ibdknoxamalloy: result of history, not choice
01:34ArafangionOO databases are a fad. :(
01:35carki won't start again on the sql vs nosql stuff, siuffice it to say that sql isn't hard at all, and eliminate most book keeping
01:35ibdknoxcark: both have their uses :)
01:35carkthe world is big enough for both, yes
01:36ArafangionOO databases are a poor reinvention of heirchical databases.
01:36carkoo databases aren't a bad concept
01:36carkthere is none which is both free and good that i know of
01:38carkibdknox: so what's behind the scene of this syntax you showed us on your gist ?
01:38ibdknoxa map :)
01:38carkyes
01:38ibdknoxhttps://gist.github.com/1257106
01:40carki think the defentity stuff shoudl be a completely different layer than the query building stuff
01:42ibdknoxit's not dependent on it
01:42carkbrehaut: indeed clojureql is nothing like it was oO
01:43brehautcark: I still use raw SQL for inserts because I've found cql a bit quirky with its insert and update fns
01:43carkwhich raises the question, why doesn't it fit ibdknox' needs ?
01:43brehaut(in particular returning last index etc)
01:43carkbrehaut: ah yes
01:44carkdoes clojureql work with different kind of databases ?
01:44ibdknoxcark: because it doesn't handle relations, and tries to be clever
01:44carklike sqlite/mysql/postgres?
01:44ibdknoxcark: yes
01:45brehautcark: some crappy clojureql code i wrote: https://github.com/brehaut/burningbot/blob/master/src/burningbot/db.clj
01:50carkbrehaut: i see your ql/where clause in query-logmarks-for-day
01:51carkand i'm wondering how i could compose two of these in a single one
01:51carklet's say i would have the start-date and end-date part coming from one function
01:51carkthen the channel part from another function
01:54brehautcark: i stopped when i got it working
01:54carkhehe ok
01:54brehauti agree that it should be nicer ;)
01:55carksee a common use case for a query builder is for providing a filtering option to your end-user
01:55brehautto be clear, i got the SQL running quickly in the DB, but porting it to clojureql took some time
01:55carkso you want to compose those where clauses in a nice way
01:56carkbrehaut: well that's to be expected for any dsl, should be easier once you know what you're doing
01:57carkthink about the common lisp loop macro ... takes a while to know much about it, bu once you do it's very powerfull
01:57ibdknoxcark: eh, I think cql didn't get to the right level of prettiness
01:57brehautyeah, although, part of the promise of clojureql is that if you can write the SQL, its a straight forward mapping because its the same conceptual model
01:57ArafangionThen again, you could do an sql->clojure transformation to give you a hint.
01:57ArafangionThat involves parsing sql, though.
01:58carkhehe yes, the whole problem is with the sql language itself, it's horrible for computer generation
01:58brehautand human generation (unless the human is willing to devote their life to typing)
01:59carkwhy couldn't they choose a lisp syntax, it's beyond me !
01:59brehautcark: committee, lisp doesn't have enough syntax to let everyone get their own fillip in
01:59ArafangionPerhaps the problem with SQL is that people use too much of it on the client side.
02:00carkArafangion: what do you mean ?
02:00ArafangionRather than defining views, and other convenient routines on the server side.
02:00brehautviews are (historically) out for performance reasons on many smaller SQL DB imps
02:01carkthink again about my use case, providing filtering options to your end-user ...there is no way around building the sql on the client side
02:01brehauta lot of people went to stored procs but thats a different can of horror
02:01Arafangionbrehaut: Is performance really a primary consideration for smaller SQL DB's?
02:01Arafangionbrehaut: If it's an issue, surely, the right place to improve that is in the database implementation?
02:02brehautArafangion: not everyone can afford a MSQL or oracle license
02:02ArafangionThere are other alternatives.
02:02carkpostgres is fast enough, and free
02:02brehautyeah postgres is good
02:02ArafangionExactly.
02:02brehautbut if you are using mysql (because for whatever reason you can't get or install pg) you were screwed
02:03ArafangionI've never had a good opinion for mySQL, though - although I am using sqlite3, but not because I want a "real" database.
02:03carki never had to use mysql ... that's living a happy life isn't it ?
02:03ArafangionAnd yeah, mySql has never been reputable.
02:04ArafangionIt's probably a good implementation, but how can you trust a database implementation that claims 'ACID is crap', along with other relational database theories... Without justifying it!?"
02:04ArafangionI mean, there's arguably good reasons to avoid ACID, but dammit, *justify it*!
02:04brehautArafangion: if you are just building this months hot new blog engine, does it matter? :P
02:04Arafangionbrehaut: You could use flat files, even.
02:05carki thought there was a mysql backend which is acid complient ? innodb or some such ?
02:05Arafangionbrehaut: Does it matter? ;)
02:05Arafangioncark: There are, but that's besides the point.
02:05brehautArafangion: yes, relational querying is much easier than multiple flat files when you want to cross cut your data :P
02:05Arafangionbrehaut: Frankly, I'd probably use sqlite3. :)
02:06carkmy current project is serverless application, and i'm using sqlite
02:07carklol
02:07Arafangioncark: Yeah, sqlite's pretty impressive for what it is.
02:07carkArafangion: do you know if its query planner is any good
02:07cark?
02:08Arafangioncark: I have no idea, to be honest, I only use it for small databases.
02:08michaelr525 hey
02:08Arafangioncark: It's too implicit for my liking for large stuff.
02:09carkwhat other embedded database is there which are a good fit for clojure ?
02:09Arafangion(Heck, it can generate tables on-the-fly without a CREATE TABLE)
02:10Arafangioncark: sqlite3's pretty much the choice, these days. There are other alternatives, but while sqlite3 exists, there isn't any point.
02:11carkthat was my conclusion, but you never know, might have missed something =P
02:12ArafangionKeep in mind that I've yet to use or learn clojure... But I think this is a fairly language-agnostic discussion.
02:12carkwell you have to consider the runtime, we're ont he jvm
02:13ArafangionEven so.
02:13ArafangionThen again, I'm probably too happy with doing native binding, but that said, I'm sure sqlite3's well supported on the jvm.
02:13ArafangionI'm off for some crappy "thai".
02:14carkhave a good meal
02:14ArafangionThanks. It's "thai" because it does'nt have much fish sauce, soy sauce, chilli, herbs, or other spices.
02:14ArafangionIt's all... westernised.
02:15carkyuk =/
02:15ArafangionBut at least they don't make the sauce gummy, it's otherwise good. (Although they *do* add too much sugar)
02:15carkit's 8am here, i'm more looking at some croissants =)
02:15ArafangionIt's 5:15pm here. :)
03:18justinusanybody here used clamq?
03:40michaelr525justinus: what's that?
04:04jliwhoo hoo, I'm in the top 100 on 4clojure
04:19justinushttps://github.com/sbtourist/clamq
04:20BlafaselIs clojure-clr a reality (i.e. usable, at least for exploration and tests) or more of an experiment?
04:22amalloyjli: congrats dude. now go sign up for a gravatar! we just added that feature
05:05Blafaselamalloy: Any plans to increase the session timeout? I often end up doing real work *cough*, get back, submit something and get the 'please log in to record that' message. The header is still showing my username, so no way to see that I'm logged out before that
05:06amalloyBlafasel: it's not actually a session timeout; as far as i know we only break sessions when we deploy a new version
05:06amalloywhich we did tonight
05:08BlafaselNope, happened just now.
05:08amalloyyep
05:09amalloyit's 2am here; that counts as tonight to me :P
05:09BlafaselOh. Right :)
05:09BlafaselSorry
05:10amalloywell, i'm sorry our deploy involves breaking sessions. if you know how to fix that, let us know with a pull request :)
05:11carkamalloy: you should have a bit of advertisement on this web site
05:11amalloynever
05:11carksomething not too intrusive would not be any trouble to your users
05:12carkthis work is usefull and deserve some reward
05:13amalloythere are much less annoying ways to generate revenue than ads. eg, if someone designs some t-shirts for us, we can sell them on zazzle
05:13carkwell then you still need to advertise them on your site, that's the same thing really
05:14carkanyways i don't care, that just popped into my head when visiting the site
05:14amalloywell, thanks for your interest
05:25jliamalloy: yeah, I noticed. are gravatars keyed on email?
05:25amalloyjli: yeah. if you've registered, with gravatar.com, the email address you use on 4clojure, you get an image
05:26amalloythey have a nice scheme which enables us to get your image from them without ever sending your email address over a public channel, in case you're worried about that
05:29jliamalloy: no, I was just trying to figure out why my gravatar wasn't already showing up.
05:54thorwilroot-cause is in both clojure.stacktrace and clojure.repl?!
05:54BlafaselHuh?
05:55BlafaselLooks like I scored _good_ this time in the golf ranking?
06:05jlihurray, #70
07:03BlafaselHmm.. :) 183. But makes "work" bearable at least.
07:22fliebelHow would you write a webmail client in Clojure?
07:23fliebelI see 3 routes. One is to talk over SMTP and IMAP to a server, the other option is to interact with the datastore used by the server, the last is to *be* the server.
07:27Arafangion(Not all routes are practical!)
07:30carkis there a predicate that will tell is a value is Seqable ?
07:31cark,((supers (type [])) clojure.lang.Seqable)
07:31clojurebotclojure.lang.Seqable
07:31carksomething that does what i just did
07:32kzarWhat would be the Enlive selector for the last script tag inside the head? I've got [:head :> :script (last-of-type)] but it's not working
07:35cark,(sequential? [1 2 3])
07:35clojurebottrue
07:35cark,(coll? [1 2 3])
07:35clojurebottrue
07:38kzaroh, got it [:head [:script last-of-type]]
07:44fliebelArafangion: Which one are (not) in your opinion?
07:46kzarfliebel: I would take the "talk over SMTP and IMAP" option, make an RESTful API that let you do things like send mail and list messages. Then I would make the webmail interface with Javascript
07:46krlwhat is the cleanest way to get a list of a form repeated n times?
07:47kzarfliebel: But on the otherhand who am I to decide
07:48fliebelkzar: One way to look at it is that HTTP and IMAP are both a V in MVC. Which is how I came to the talk to the datastore option.
07:49fliebelkraft: Like... ##(repeat 3 4) ?
07:49lazybot⇒ (4 4 4)
07:49fliebel*krl
07:51fliebelI think writing a custo mail server in Clojure is to painful to even consider.
08:14Arafangionfliebel: Bingo.
08:14Arafangionfliebel: Actually, the writing of the custom mail server isn't that big a deal.
08:14Arafangionfliebel: But running it is.
08:15fliebelArafangion: Why? I imagined the building to be the problem. Esp. IMAP.
08:15ArafangionFar from it. :)
08:16ArafangionIt's the spammers that are - and how the email infrastructure has had to cope with it.
08:22joelehmannHello
08:44kzarIs there a way to do a regexp replace of a string, the replace value being a call to a function that takes the matching sub-string?
08:49dabdI expected ,(/ 47.8486 100) to return 0.478486
08:49dabd,(/ 47,8486 100)
08:49clojurebot47/848600
08:50dabd,(/ 47,8486 100.0)
08:50clojurebot5.538534056092387E-5
08:50dabdwell the clojurebot returns the result in scientific notation but my repl returns 0.47848599999999997
08:51dabdwhy is it that clojure does not return the exact value 0.478486?
08:51opqdonut0.478486 is not representable as a floating point number
08:51carkhttp://download.oracle.com/docs/cd/E19957-01/806-3568/ncg_goldberg.html
08:51carkoops
08:51opqdonutand btw, you shouldn't use , as the separator
08:52opqdonut,(/ 1,100 10)
08:52clojurebot1/1000
08:52opqdonut,(/ 1 100 10)
08:52clojurebot1/1000
08:52opqdonut"," is just whitespace in clojure
08:52stoneghi, how can I ref to a object in clojure (like I want to create a db connection, then do operations using that connection, how can I do this in clojure)?
08:52carkstoneg: do you mena a java object ?
08:52dabdopqdonut: is there some way I can obtain the exact value?
08:53cark,(/ (rationalize 47.8486) 100)
08:53clojurebot239243/500000
08:53opqdonutdabd: depends very much on what you mean by "exact value", but for example clojure's rational numbers are exact
08:53stonegno, I come from oo background, not that familiar with functional way of doing this kind of things.
08:54dabdwell I just wanted to get 0.478486 not a fraction
08:54opqdonutrepresenting and printing a number are quite different
08:54cark(let [a (String. "hello")] (.toString a))
08:54carknow that's a silly example
08:55carkbut you have the value a, which is bound to the string object
08:55carkand you can work with it
08:55carki'm not quite sure that's what you're saking
08:55carkasking*
08:55Chousukestoneg: the standard way is to have your procedures take a db connection object as the argument and work on that
08:56Chousukethen you just create a db connection and call your procedures
08:56stonegso you mean it's like first set the connection to a var, and then using it like : (operation conn params) ?
08:56Chousukeor just use let
08:57carkstoneg : yes juste like in java or c#
08:57carkbut chousuke's way is the most important
08:57dabdopqdonut: but shouldn't this return the true? (= (Float/parseFloat "0.478486") (/ (Float/parseFloat "47.8486") 100))
08:57opqdonutno
08:57opqdonutwait a sec, I'll give you a link
08:58stonegChousuke: let is for def local bindings , right?
08:58carkdabd: you really need to learn about the pitfalls of floating point arithmetics
08:58opqdonutdabd: http://download.oracle.com/docs/cd/E19957-01/806-3568/ncg_goldberg.html
08:58Chousukestoneg: local binding, yes
08:58opqdonutoh, cark pasted that above
08:58stonegChousuke: But a connection acts as a global thing.
08:58Chousukeyou can also bind the connection to a global dynamic *db* variable that is used in procedures
08:58carkstoneg: gloal things are evil
08:58carkglobal*
08:59dabdopqdonut: looks heavy I'll read it thx
08:59opqdonut,(= (float 1.0) (* (/ (float 1.0) (float 3.0)) (float 3.0)))
08:59clojurebottrue
08:59Chousukeor you can use some database library :) clojure has a couple
08:59carkfirst you learn to do without globals, then you break the rule when needed
08:59opqdonut,(= (float 1.0) (* (/ (float 1.0) (float 11.0)) (float 11.0)))
08:59clojurebottrue
08:59stonegcark: Is it ok using curring ?
08:59opqdonuthmm, I could've sworn those weren't true
08:59carkstoneg: what has currying got to do with that ?
09:00carkopqdonut: that's the point, you never know with floating point numbers
09:01stonegcark: sorry, I mean some techniques like using currying to memorize the initialized connection, and do operations against the conn later.
09:01opqdonutcark: indeed
09:02Chousukestoneg: what matters is how well you can keep the stateful thing (the connection) separate from the rest of the code
09:02Chousukeif the db connection is always an explicit parameter to procedures then it's easier to follow what happens to it
09:02carkstoneg: for what it's worth, i'm using clojure.java.jdbc for connections and database interactions, and it is setting a dynamic var up for connections and transactions
09:03carkthen the actual queries do not require a connection parameter
09:03carkas it is in the dynamic scope
09:03carkis defined*
09:03carkor bound really
09:03carkohwell
09:06stonegcark: http://clojure.org/vars , says Functions defined with defn are stored in Vars, and Vars are global like thing, so is functions evil ?
09:06stonegcark: http://clojure.org/vars , says Functions defined with defn are stored in Vars, and Vars are global like thing, so are functions evil ?
09:06carkso in practice : (sql/with-connection db-settings (sql/transaction (with-query-results rs ["select * from blah"] (do-something rs)))
09:07carkstoneg: at some point you need some form of global state
09:07carkbut you're trolling now =)
09:10stonegcark: In the example, it has many level of nesting, will it affect code readability ?
09:10carksorry couldn't properly indent on irc
09:13carkhttps://gist.github.com/1257440
09:13carkthere you go, see that's not that bad =P
09:15stonegcark: thanks.
09:15stonegcark: but for real code, I saw many nestings that that, like : https://github.com/nathanmarz/storm/blob/master/src/clj/zilch/virtual_port.clj
09:16stonegcark: and this: https://github.com/nathanmarz/storm/blob/master/src/clj/backtype/storm/clojure.clj
09:16carkit's not so bad
09:16carkyou may clean that up a bit by decomposing a bit more
09:17stonegcark: I am learning clojure and reading some real code. But it looks to messy (sorry just the feeling as a new functional guy). :-(
09:17carki'm guessing it's all still very alien to you
09:18stonegcark: yes. kinda of.
09:18carkto me it's weirder reading java code =)
09:19stonegcark: Actually, I learned lot of FP languages(haskell, erlang, clojure, scala), but not wrote a lot using it in production and real project.
09:19carki've been using common lisp and clojure almost exclusively for 10 years now
09:20stonegcark: Maybe I need use it more, think in functional style, and read more fp code.
09:20carkthe good way to learn is start a project
09:20carkand suck it up until you're done with it =)
09:20carkand ask advice
09:20stonegcark: that's cool. I started fp from 2008. first is erlang.
09:21stonegcark: Thanks! very good advice.
12:08sridhow do I refer java static methods as first class object? this doesn't work: ((comp Integer/valueOf trim) "12 ")
12:09TimMcsrid: memfn is the old way, but #() is the current idiom
12:09sridso this code can't be improved to use comp instead of #() http://stackoverflow.com/questions/7623633/how-do-i-convert-a-string-into-two-integers-in-clojure/7624355#7624355
12:09TimMcInteger/valueOf becomes #(Integer/valueOf %)
12:10TimMcRight, there's not much you can do.
13:14mister_roboto,(seq? [:x])
13:14clojurebotfalse
13:14mister_roboto,(seq? '(:x))
13:14clojurebottrue
13:15mister_robotoI thought from reading the docs that a vector is an ISeq. Can someone tell me what I'm not understanding ? Why does the first return false?
13:16mister_roboto,(coll? [:x])
13:16clojurebottrue
13:21TimMcmister_roboto: All the collection types as well as seqs are coll? -> true.
13:22TimMcVectors are seqable: ##(seq [1 2 3])
13:22lazybot⇒ (1 2 3)
13:23TimMcand the reason (seq? '(:x)) is true is that lists are implemented as seqs
13:23mister_robotoTimMc: but why does (seq [:x]) for example return false? vectors are not seqs i guess?
13:24mister_robotojust seqable?
13:24TimMcright
13:24mister_robotook thx
13:24TimMc"seqable" is a confusing topic, though
13:24TimMc,(seq? "foo")
13:24clojurebotfalse
13:24TimMc,(seq "foo")
13:24clojurebot(\f \o \o)
13:26TimMc,(seqable? "foo")
13:26clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: seqable? in this context, compiling:(NO_SOURCE_PATH:0)>
13:27TimMc,(use 'clojure.contrib.core)
13:27clojurebot#<RuntimeException java.lang.RuntimeException: java.io.FileNotFoundException: Could not locate clojure/contrib/core__init.class or clojure/contrib/core.clj on classpath: >
13:27TimMc,(use 'clojure.contrib)
13:27clojurebot#<RuntimeException java.lang.RuntimeException: java.io.FileNotFoundException: Could not locate clojure/contrib__init.class or clojure/contrib.clj on classpath: >
13:27TimMcbah
13:27mister_robotoTimMc: is it safe to say that you should use (coll?) to determine if you have a seqable thing? and not seq?
13:27TimMc&(clojure.contrib.core/seqable? "foo")
13:27lazybot⇒ true
13:27TimMcUse seq: (if (seq foo) ... ...)
13:28TimMcOr even better, (if-let [sfoo (seq foo)] ... ...)
13:28mister_robotoTimMc: why not just (coll? foo) is there a downsie?
13:28mister_robotoif i just want to test it, that is
13:29TimMcUsually you want to *do* something with it.
13:29mister_roboto,(coll? '(:x))
13:29clojurebottrue
13:29mister_roboto,(coll? [:x])
13:29clojurebottrue
13:29TimMcIf you want to test... well, I'd have to go back and look at the intricacies of seq, seqable, coll?, seq? and ISeq
13:30TimMc,(if (seq 5) 'seq 'not-seq)
13:30clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>
13:30mister_robotoTimMc: sure. np. i need to read up more
13:30TimMcRight, so seq blows up on non-seqables.
13:30TimMcOne of the Clojure experts needs to write a blog post explaining this once and for all. (Or maybe there is a book chapter?)
13:33TimMc,(seqable? nil)
13:33clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: seqable? in this context, compiling:(NO_SOURCE_PATH:0)>
13:33TimMc&(clojure.contrib.core/seqable? nil)
13:33lazybot⇒ true
13:56dabdwhy there is not function to extract a subsequence between two elements. afaik there is only subvec for vectors but there is nothing for lists
13:56dnolenhuzzah match uses efficient backtracking except in the presence of recur (still efficient in time, just possibly more code for certains kinds of patterns)
13:58dabdof course it is trivial to implement with drop/take
13:59dnolendabd: because subvec has a constant time guarantee
13:59dnolen,(doc subvec)
13:59clojurebot"([v start] [v start end]); Returns a persistent vector of the items in vector from start (inclusive) to end (exclusive). If end is not supplied, defaults to (count vector). This operation is O(1) and very fast, as the resulting vector shares structure with the original and no trimming is done."
14:00dabddnolen: yes but sometimes you are working with vectors but when you use a seq function it becomes a list
14:00Blktgood evening everyone
14:01jeremyheilerBlkt: good afternoon :-)
14:01Blkt:)
14:01dabdfor example ,(map identity [1 2 3]) transforms the vector into a list
14:02dabdthen you cannot use subvec unless you turn it into a vector with into []. Does 'into' run in constant time or O(n)?
14:03dnolendabd: if you want to keep working w/ vectors put it back into vector. O(n)
14:03dabdThen this is somewhat cumbersome
14:03dnolendabd: not saying that the functionality you're talking about is not useful, but it shouldn't be called subvec
14:03dabdBut why clojure changes the types of objects like this
14:04dabdIt goes against the referential transparency of functional languages imho
14:04dnolendabd: it doesn't change types, the map is lazy.
14:04dabdbut map turns the vector into a list
14:05dnolendabd: not a list, a lazy sequence.
14:05dabdbut a lazy sequence is not a vector
14:06dabdso i guess the original type changed
14:06dnolendabd: consider why map has to be lazy - Clojure doesn't have TCO
14:07pbiggarhi folks, quick question: from within noir/defpage, how can I get access to a user's session id?
14:07glob157seven programming languages in seven weeks is the best book on clojure ive read (im new) ... do you guys agree ?
14:08glob157\
14:08dabdwell at least a map-vec would be useful to avoid the O(n) into [] every time you use map on a vector and need a vector afterwards
14:08dnolendabd: if map wasn't lazy, you would still need to construct the new vector - O(n)
14:08dnolenif you wrote a loop/recur that updated vector in place, stlll O(n)
14:09dnolendabd: so you either want subvec, or you want something new for sequences that does something similar which doesn't have O(1) guarantee
14:10dabddnolen: but if the mapping function preserved the type you would traverse the structure once not twice, once for the 'map' and another one for 'into'
14:10dnolendabd: *lazy* sequences
14:10dnolendabd: there is only one traversal.
14:12dabddnolen: ok thx
14:13zerokarmaleftglob157: i haven't read that book, but i imagine the coverage is pretty light
14:14chouserdnolen: in the abstract, backtracking is sometimes less fast, right?
14:14zerokarmaleftglob157: Joy of Clojure is great if you're looking to go deeper
14:15dnolenchouser: a backtrack is equal to longjmp, I haven't seen any discernible performance difference. And for complex pattern, there's a massive performance gain, since JVM refuses to inlining magic on large methods.
14:15chouserdnolen: very interesting!
14:16chouserI assumed backtracking would mean checking the same input element multiple times. Hard to see how that's not slower.
14:18dnolenchouser: the algorithm groups as many patterns as possible for testing them together.
14:18dnolen[1 2 3] [1 3 4] [1 & r] grouped together for testing, if that fails, we backtrack like to something completely different.
14:19chouserso tries to fail fast on each group
14:19dnolenchouser: it's tougher with guards (arbitrary tests), where grouping is less clear. I need to work that out still.
14:19clojurebotOk.
14:20dnolenbut mostly likely guards will involve retesting a element.
14:21chousersounds great. We've got a project at work that I think might benefit a lot from match. Hoping to try it this week or next.
14:23dnolenchouser: cool! would love to hear your input. There's still a lot of details left, but I think the big picture stuff is falling into place.
14:24TimMcShouldn't (vec (seq some-vector)) be O(1)?
14:25TimMcI would assume that vec could peek at the seq's implementation and see that it is backed by a vec.
14:26ChousukeI don't think that's really an issua :/
14:26Chousukehow often will you seq a vector and then immediately make it a vector again?
14:26chouserTimMc: it potentially could be, and I wouldn't be shocked if someday Clojure has that kind of thing built in. But not today.
14:27TimMcChousuke: I'll get back to you on that. :-)
14:27chouserHm, actually, maybe Chousuke's right.
14:27chouserI was thinking it might happen across different function-call boundaries.
14:28Chousukeyes, it might happen, but I don't think it's very likely
14:28chouserbut to happen would require something to call seq (but nothing else -- not map, take, drop, anything) and return that.
14:28TimMchmm
14:28chousermaybe (drop-while odd? [2 3 4])
14:29TimMcWould it be bad for (drop (seq some-vector)) to maintain the backing vector?
14:29Chousukemaybe clojure will some day have lazyvectors :P
14:30TimMcI guess the feasabiity would depend on how much the implementing seq is asked to do.
14:30Chousukeso when you do (vecmap foo somevector) you get back a vector instantly but the calculation only happens when you index the vector
14:30chouserTimMc: what if the first element in the vector is a really large object that you're specifically trying to GC?
14:30gtrak``didn't it have lazy vecs at some point? or a placeholder at least?
14:30TimMcRight, that's what I'm worried about.
14:30chousertoday you could say (vec (next the-vec))
14:31TimMcWhereas subvec would not allow GC of out-of-range portions of the backing vec.
14:31chousergtrak``: no, it had a thing that would act like a vector while holding a backing array, and then if you used assoc or conj it would then create a real vector.
14:31chousernot really lazy in the lazy-seq sense.
14:32gtrak``ah
14:32TimMcIt would be cute if a vector could know just how much of itself was accessible and could wipe the out-of-range portions.
14:33TimMcI guess then you'd be getting into the GC business.
14:35dnolenpushing match-0.2.0-alpha1 out the door
15:02kencauseydnolen: yay!
15:43Bronsadnolen: wouldn't it be better if clojure.core.match.core was clojure.core.match?
15:43dnolenBronsa: hmm not a bad idea
15:44Bronsai find it annoying to write core twice in a ns
15:45Bronsaanyway, i'd like to thank you for your excellent work :)
15:55ibdknox+1 for removing the extra core :)
16:02ibdknoxdnolen: awesome! :D
16:07sridhas anyone used core.match with enlive?
16:15srid(first (.getBytes "’")) returns -43. to convert that to a byte, I do this: (apply str (reverse (take 8 (reverse (Integer/toBinaryString -43)))))
16:15sridis that too much?
16:18TimMcWhat does that get you?
16:19raek_srid: you want it in binary form?
16:19sridthat gets me "11010101"
16:19sridi'm playing with char encoding conversions in clojure/java
16:20sridenlive has a bug where it always reads a URL as utf-8
16:20sridbut a webpage is encoded in ISO/IEC 8859-2
16:20S11001001getBytes takes an encoding arg, and String has a bytes[], encoding constructor
16:20raek_,(Byte/toString -43 2)
16:20clojurebot#<CompilerException java.lang.IllegalArgumentException: No matching method: toString, compiling:(NO_SOURCE_PATH:0)>
16:20raek_,(Byte/toString (byte -43) (int 2))
16:20clojurebot#<CompilerException java.lang.IllegalArgumentException: No matching method: toString, compiling:(NO_SOURCE_PATH:0)>
16:21duck1123toString only takse 1 param according to the javadoc I'm looking at
16:21S11001001,(String. (byte-array [-43]) "ISO-8859-2")
16:21clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Byte>
16:21raek_srid: aren't URLs always suposed to be in UTF-8?
16:21S11001001cute
16:21sridS11001001: ok, am I right in thinking that the java String also 'remembers' the original encoding of the string?
16:21S11001001srid: no.
16:21sridIOW, is the constant inside the form, and the value returned by it different? (String. (.getBytes "’" "UTF-8") "UTF-8")
16:21S11001001a string is an array of codepoints, encoded in UTF-16
16:22S11001001(not the same as ucs2, by the way)
16:22duck1123,(Byte/parseByte "-43")
16:22clojurebot-43
16:22raek_,(Integer/toBinaryString -43)
16:22clojurebot"11111111111111111111111111010101"
16:22S11001001so some codepoints actually take two chars
16:22S11001001maybe 3, I forget
16:22sridraek_: i was referring the page content, not page url
16:22raek_,(subs (Integer/toBinaryString -43) 24 32)
16:22clojurebot"11010101"
16:23S11001001,42b
16:23clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.NumberFormatException: Invalid number: 42b>
16:23S11001001haven't used 1.3 enough yet
16:23raek_srid: enlive uses some "magic" to recognize the coding of the page. I think you can give it a reader with the correct encoding specified manually
16:24raek_,11010101r2
16:24clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.NumberFormatException: Invalid number: 11010101r2>
16:24raek_,2r11010101
16:24clojurebot213
16:24S11001001,(String. (to-array Byte/TYPE [-43]) "ISO-8859-2")
16:24clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core$to-array>
16:24srid,(seq (.getBytes "’" "UTF-16"))
16:24clojurebot(-2 -1 32 25)
16:24srid(seq (.getBytes "’" "ISO 8859-2"))
16:25S11001001missed a hyphen and a comma
16:25srid(seq (.getBytes "’" "ISO-8859-2"))
16:25sridworks for me in repl. what comma?
16:25sridit returns (63)
16:25S11001001,(seq (.getBytes "’" "ISO-8859-2"))
16:25clojurebot(63)
16:25sridoh
16:25kij,(clojure-version)
16:25clojurebot"1.3.0-master-SNAPSHOT"
16:25raek_,(seq "åäö")
16:25clojurebot(\å \ä \ö)
16:26S11001001uri, incidentally, doesn't proscribe your charset choices
16:26S11001001though even at the character it must be aware of the encoding you intend to use so it can urlencode/decode correctly
16:26S11001001s,character,character level,
16:27sridso how do I read a file encoded in "ISO-8859-2" into a string that uses utf-8/16 codepoints??
16:27lazybotsrid: Definitely not.
16:27sridi didn't enter the second ?
16:27raek_srid: ideally, a string is not in any coding
16:27S11001001srid: clojure.java.io/reader lets you specify the input encoding
16:27TimMcsrid: InputReader or somesuch allows an encoding
16:27raek_it is just a sequence of characters
16:28raek_in java/clojure, this is true for characters in the Basic Multilingual Plane (code points below 65536)
16:28sridhttps://github.com/cgrand/enlive/blob/master/src/net/cgrand/enlive_html.clj#L36 is hardcoding utf-8
16:29S11001001yeah, people tend to do that
16:29sridi need to pass a stream that is encoded in utf8, not some other encoding
16:29raek_srid: where you write the filename, you should be able to pass something like (io/reader "filename" :encoding "ISO-8859-2")
16:30sridok, this is how I am using enlive's html-resource: (html-resource (InputStreamReader. (FileInputStream. url) "ISO-8859-2"))
16:30sridbut that doesn't help at all.
16:31sriddoes InputStreamReader "decode" the url content and stream a sequence of characters to html-resource?
16:31raek_yes
16:31raek_InputStream = bytes
16:31raek_Readerr = chars
16:31S11001001do you mean the %things?
16:32raek_InputStreamReader = bridge between the two
16:32raek_srid: your row should be equivalent to (html-resource (io/reader (io/as-file url) :encoding "ISO-8859-2")
16:33raek_but since the argument is called "url", I'm gettings suspicious that it's actually not a filename but a url... :-)
16:33sridits file:// url for now
16:34sridhtml-resources returns a map that contains strings. when I copy paste the subset of that string in to repl, i see the .getBytes on that character returns -43
16:34raek_you might need to pass it as (io/reader (io/as-url url) ...) then
16:34sridwhich means, .getBytes somehow "knows" that it is supposed to return bytes encoded in "ISO-8859-2"
16:34raek_srid: what did you pass as the encoding argument to .getBytes?
16:35sridnothing
16:35raek_if you did not pass any encoding argument, it guesses
16:35raek_and defaults to whatever is the "default encoding" of your platform
16:35sridwhy should it guess at all when getBytes is passed a string (character stream) as opposed to bytes?
16:35raek_you should never use this "default encoding"
16:35sriddefault encoding is certainly not "ISO-8859-2" which is the file's encoding
16:36raek_imho, that method (without the encoding parameter) is broken and should be deprecated
16:36raek_srid: to see what characters are in a string, use 'seq' to look at them individually, or (map int ...) to see their codepoints
16:36srid(System/getProperty "file.encoding") returns "MacRoman", btw
16:37raek_in this case, no encoding of the string is done. all you see is the characters.
16:37raek_,(map int "abcåäö")
16:37clojurebot(97 98 99 229 228 ...)
16:38raek_,(.getBytes "abcåäö" "UTF-8")
16:38clojurebot#<byte[] [B@9f2146>
16:38raek_,(seq (.getBytes "abcåäö" "UTF-8"))
16:38clojurebot(97 98 99 -61 -91 ...)
16:38srid,(map int "’")
16:38clojurebot(8217)
16:39sridi'll write a simple program with data file to reproduce my problem.
16:43sridhow do I find the default encoding used by InputStreamReader?
16:43srid(System/getProperty "file.encoding"). yup. MacRoman is it. and it is screwing up files that are utf8 encoded as well
16:46ibdknoxNoir 1.2.0 is out :D
16:46ibdknoxhttps://github.com/ibdknox/noir/blob/master/history.md
16:48cgrozaI see you have a pretty big community...
16:49cgrozaclojurebot:
16:49clojurebot#<ClassCastException java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.String;>
16:56dnolenwow throw is cheap in JS if you don't construct an error
16:58ibdknoxHelp me get the word out about Clojure web stuff and comment/vote: http://news.ycombinator.com/item?id=3063973 :)
16:58dnolendone
16:58brehautdone
16:59ibdknoxThanks gentlemen :)
17:00dnolenreleasing core.match 0.2.0-alpha2, ClojureScript support in
17:01brehautdnolen: excellent :)
17:02ibdknoxHappy release day haha
17:10ibdknoxhaving a server agnostic framework is pretty damn cool
17:10ibdknoxhere's noir running on aleph (and thus Netty)
17:10ibdknoxhttps://gist.github.com/1257857
17:17winkcool. upvoted :)
17:21ibdknoxnow time to work on korma
17:25brehautdnolen: would i be right in assuming that predicate dispatch would make a url routing library (eg moustache) trivial to write?
17:27dnolenbrehaut: probably haven't really dug into that use case.
17:33brehautibdknox: re your common on the HN thread, has noir overtaken compojure for community activity?
17:34brehauts/common/comment/
17:34lazybot<brehaut> ibdknox: re your comment on the HN thread, has noir overtaken compojure for community activity?
17:34brehautamalloy: how can i get added to the regexp exclusion list for lazybot?
17:34amalloybrehaut: ask me or Raynes nicely; there's no user-facing way atm. i'll make it so
17:35Raynesamalloy: Call it the whiner-list.
17:35RaynesSo that we can be polite and snarky at the same time.
17:35amalloygood call
17:36amalloy$login
17:36lazybotYou've been logged in.
17:36amalloy$reload
17:36lazybotReloaded successfully.
17:36amalloy$logout
17:36lazybotYou've been logged out.
17:36amalloybrehaut: fire away
17:36brehautfoobar
17:36brehauts/foo/baz/
17:36ibdknoxbrehaut: I think they're about equal, I've been getting messages a tad bit more frequently on the noir group than compojure lately, but I don't think there's a clear winner
17:36brehautawesome, thanks
17:37amalloywait, now i'm confused. should i spam the noir group to make it more popular than compojure, or because i want to annoy people reading it?
17:38ibdknoxreadies*
17:47amalloyibdknox: accidentally ban yourself from #clojure?
17:47brehautdropped the ban hammer on his foot
17:47ibdknoxamalloy: got a little overzealous with the hammer ;)
17:48ibdknoxor I forgot to plug my computer in... turns out it *will* shutoff if you don't
17:49brehautibdknox: #2 on the HN front page
17:50ibdknoxI was #1 until just a couple minutes ago
17:50ibdknox:)
17:50brehautsorry to be the bearer of bad news then
17:50ibdknoxMore exposure for Clojure! :D
17:50ibdknoxwow
17:50ibdknoxI hate the way that sounds
17:50brehautha
17:58TweyExpojure
17:58TweyThat's going to be a library at some point…
17:59ibdknoxI think leiningen actually prevents you from creating projects that are *jure
17:59ibdknox:D
17:59TimMcyep
17:59TimMcI think I approve of that.
18:00Zolrathibdknox: There's something wrong with the pinot on clojars methinks
18:00ibdknoxoh?
18:00Zolrathwhenever I try to compile with it it tells me that pinot.dom was never provided
18:00TweyNice.
18:00TweySo how did Compojure happen? :þ
18:00TimMcGrandfathered in.
18:00Zolrathbut I downloaded the source and compiled it myself earlier and if I use that copy it works
18:00ibdknoxZolrath: yes it is screwed up
18:00TweyHaha.
18:01TimMchttp://clojars.org/jrill <- I'm ashamed to admit that I'm responsible for this name
18:01ibdknoxhaha
18:01TimMcIt was a throwaway joke when someone asked for a name, but no one else had any suggestions..
18:01ibdknoxtsk tsk :p
18:02ibdknoxI can't say much, I just keep picking food names
18:02TweyPinot is food now?
18:02TimMcI'm going to start using species names.
18:02TimMc(and variants on them)
18:03ibdknoxZolrath: should be fixed
18:03TimMcI picked "chelydra" (snapping turtle) for a personal bookmarking site.
18:03ibdknoxTwey: Pinot noir
18:03TweyYes
18:03TweyDrink ≠ food
18:03TweyFood substitute, sometimes, but not food :þ
18:03ibdknoxlol
18:04ibdknoxTwey: http://en.wikipedia.org/wiki/Food
18:04ibdknoxincorrect ;)
18:04ibdknoxthe internets says so
18:05TweyHaha.Haha
18:06winkibdknox: some caveat? I just noticed, maybe it's documented or intended, but I forgot to do a models.clj (like in noir_blog) but :require'ing the models and the result (FileNotFoundException for resources\public (Access Denied)) left me very clueless
18:07ibdknoxwink: hm? those two things don't sound related
18:07ibdknoxwink: the resources/public issues is usually the result of not having any routes defined
18:07ibdknoxI should fix that in compojure
18:07amalloyTimMc: jrill? i don't get it
18:07TimMcdrill
18:07TimMcIt's an XPath wrapper.
18:08TimMcBreaking out of the standard s->j transform.
18:08winkibdknox: basically the same code you looked at yesterday, just with another :require to a file in the models namespace
18:09winkthen I put a models.clj next to server.clj with just (ns x.models (:require [x.models.y :as y])) and it worked
18:09ibdknoxhm
18:09ibdknoxthat shouldn't be necessary
18:13ibdknoxwink: what you just described would be an issue at the Clojure level, I don't do any special stuff with require. If you come up with a small repro for it, I'll gladly look into it
18:13winkibdknox: yup, trying just now
18:22ibdknoxwoah, what happened ther?
18:22ibdknoxthere*
18:24TimMcNetsplit?
18:25Zolrathibdknox: the pinot snapshot it pulls still gives the same pinot.dom error
18:25ibdknoxZolrath: did you remove the cached copy in ~/.m2/
18:25ibdknox?
18:25ibdknoxZolrath: it only checks for updates once a day
18:25Zolrathyeah
18:25ibdknoxhm
18:25ibdknoxok
18:26ibdknoxZolrath: which version of pinot?
18:27ZolrathDownloading: pinot/pinot/0.1.0-SNAPSHOT/pinot-0.1.0-20110809.143608-17.jar from clojars
18:27ibdknoxyou need 0.1.1
18:27ibdknoxZolrath: fixing readme now
18:28ZolrathAh, thanks
18:28Zolrath0.1.1, no snapshot?
18:28ibdknoxZolrath: sorry, 0.1.1-SNAPSHOT
18:29ZolrathAnd all is well again, working great.
18:54winkibdknox: gah, ofc it was just me bein stupid, there was a ] missing after the last require. But why creating the models.cls with that missing import inside it fixed it instead of still erroring out due to syntax error.. no clue
18:55ibdknoxlol
18:55ibdknoxwink: those sorts of errors are really, really finicky
18:55winkon the plus side, I've read the noir_blog source from top to bottom now
18:56ibdknoxhehe
21:30brehautjust watched brenton ashworth's browser repl intro video (http://vimeo.com/29535884) thats fantastic stuff
21:43sjlIs Marginalia supposed to pick up docstrings and comments inside functions?
21:47amalloydocstrings inside functions?
21:47sjlamalloy: yep
21:48amalloy...what would that look like?
21:48sjlamalloy: looks like it's not just me being dumb for a change :) https://github.com/fogus/marginalia/issues/57
21:49sjlamalloy: like this: http://fogus.me/fun/marginalia/ for this: https://github.com/fogus/marginalia/blob/master/src/marginalia/core.clj#L92
21:52amalloyi would just describe those as docstrings. docstrings inside functions sound like they must be something else. but anyway, sounds like a bug; go fix it! :)
21:54sjlamalloy: ahh, heh, "... pick up (docstrings) and (comments inside functions)"
21:54sjlstupid english language
22:15scottjreading a cljs article says using namespace name as function or param name is a problem. if your ns is foo.bar.tar what can't you use, foo or tar?
22:16amalloyscottj: tar, i think
22:16amalloyer, maybe not. i have no experience, don't listen to me
22:17amalloyask Raynes, in fact
22:18Raynesscottj: I don't know exactly how it works, but I had a project called 'portal' and my namespaces were 'portal.foo', wherein I had a 'portal' function that made the word explode.
22:18RaynesTherefore, I say that amalloy is likely incorrect here.
23:12dzdericis there any way I can run a compojure from a shared hosting account with only JSP enabled?
23:13dzdericsorry if it's a stupid question but I know nothing about JSP
23:14brehautdzderic: im going to be guessing here, but i believe that JSP is ontop of / compiles to servlets. Servlets is the most basic requirement you need to host a ring based app (which a compojure site is)
23:14brehautJSPs themselves dont really feature in the clojure web stack
23:15dzdericI know that much, it's just that I'm doing work for a client and it must be hosted on their shared hosting account
23:15dzdericI found a script which starts swank (here: http://paste.lisp.org/display/71209), but I'm not sure if I can do something similar to run the actual webapp
23:15ibdknoxthere's a good chance that they will have locked down a bunch of stuff
23:17ibdknoxdzderic: can you upload a war to it?
23:17clojurebotCool story bro.
23:17ibdknoxclojurebot: shutup
23:17clojurebotHuh?
23:17ibdknoxclojurebot: smack
23:17clojurebotIt's greek to me.
23:17ibdknoxhm
23:17amalloy~botsmack
23:17clojurebotOwww!
23:17dzdericibdknox: I'm not sure because the account hasn't been set up yet
23:17ibdknoxah
23:17dzdericibdknox: how does this sort of thing normally work?
23:18ibdknoxwhich sort of thing? hosting a clojure website?
23:18dzdericJSP
23:18dzdericI've used compojure with jetty and tomcat
23:18ibdknoxI have no idea, I stayed as far away from JSP as I possibly could
23:19dzdericfair enough
23:19dzdericI'll ask the hosting company
23:20mrh0057If you want to do hosting on the JVM you probably want to have a vertical dedicated server.
23:20dzdericunfortunately the client wants it done on their shared hosting
23:21dzdericif I can't get compojure working, I guess I'll have to go with (shudder) PHP
23:21brehautwee bit of a step down there
23:21mrh0057There can be problems that can cause the container to crash then you have to wait for the hosting company to reset it.
23:21dzderic:S that doesn't sound pleasant
23:21ibdknoxin general, shared hosting is scary with something as memory intensive as java
23:22gtrak``dzderic, if they have a servlet hosting, you can most likely aot-compile stuff and build a WAR
23:22dzdericI just sent them an email asking if I can just upload a war (I really hope the answer is yes :)
23:22amalloybrehaut: linode ftw
23:23dzdericbrehaut: good luck finding something as good in australia
23:23brehautdzderic: im in new zealand
23:23gtrak``i mess around with virpus, it's hella cheap
23:23dzdericthen have fun with the latency
23:23gtrak``512MB at $4/month
23:24brehautthe entire internet has latency for me, and this way the majority of the visitors to my site dont experience any :P
23:24mrh0057dzderic: The most import thing is being able to restart the container yourself.
23:24brehautgtrak``: thats cheap
23:24gtrak``hells yea it is
23:24amalloybrehaut: maybe he means disk space. only 640k of RAM
23:24brehautamalloy: i looked at linode, i understand that its better than prgmr (faster io in particular) but its not as cheap
23:24ibdknoxlol
23:24dzdericgtrak11: but does it work?
23:24gtrak``I wouldn't use it for anything serious, but I use it for a personal site
23:24gtrak``dzderic, sure
23:25gtrak``i think like 40GB of disk and you have root access
23:25dzdericmrh0057: I'll ask and see how much access I can get
23:25mrh0057dzderic: If you deploy multiple time in tomcat, the jvm can run out of permspace.
23:25brehautamalloy: 640k should be enough for anyone
23:25amalloybrehaut: yeah, linode is charging a premium. mostly for reliability and customer service, i thought
23:25brehautamalloy: im sure; prgmr is bare bones. although their customer service has been completely adequate for my needs
23:25gtrak``like i said... if you just want to mess around with something virpus is totally cheap, or heroku if you don't care about disk
23:26amalloymy linode is almost a year old now. crashed once, brief network outages maybe three times
23:26brehautamalloy: thats about the same as my prgmr
23:26amalloyand it's hosting lazybot, 4clojure, tryclojure, and a few personal websites without breaking a sweat
23:26ibdknoxI've only had one issue on EC2
23:26brehautnice. mines only hosting my site and burningbot
23:27amalloybrehaut: what is this "burningbot"?
23:27brehautamalloy: i pay about $9/mo for 512mb ram, 12gig of disk
23:27brehautamalloy: its an irc bot for the burning wheel rpg channel on a different server
23:27brehautamalloy: built on raynes irclj
23:28ibdknoxI was surprised how easy it was to build and IRC bot from scratch
23:28brehautlikewise
23:28ibdknoxan*
23:28amalloywe have 1.5gb ram, 60gb disk. $60/mo but who cares, right
23:28brehaut(at least if you leave the arrows out of it ;)
23:28ibdknoxthe protocol is stupid simple
23:28Raynesibdknox: Mostly just stupid.
23:29brehautRaynes: lol
23:29ibdknoxRaynes: haha, true
23:29gtrak``if i'm expecting to make money off of something, obviously i'll pay more than $4 a month :-)
23:29RaynesA million and one edge cases.
23:29brehautgtrak``: likewise :)
23:29brehautRaynes: whats with you trying to implement libs for shitty protocols? irc, xmlrpc
23:30RaynesJust wanted 'em.
23:30brehautRaynes: for your own sake, dont try to write a soap lib
23:30RaynesLuckily, somebody else write an xmlrpc lib that deprecated mine.
23:30brehautso not a masochist then
23:30brehauthaha what a tool
23:31brehaut(him, not you)
23:32brehautRaynes: ironically when i search for clojure xmlrpc your lib is ranked higher by google
23:33RaynesThat's because he opted for a clever name while I recognize that the inherent boringness of the protocol isn't worthy of a clever name.
23:33jlioh noes, 4clojure problems?
23:34jligetting "502 Bad Gateway". amalloy: friendly ping :)
23:34amalloyjli: yeah, thanks. i actually had noticed already, but usually i don't
23:35Raynesbrehaut: I am a masochist.
23:35Raynesbrehaut: I do not, under any circumstances, know any Python. That said, I've spent the last 4 hours writing a sublime text 2 plugin for Clojure (it supports highlighting, but I'm adding fun stuff like evaluation).
23:35amalloywe have several components that probably consume memory without bound. would love to see some of those replaced :P. anyway jli, back up
23:36brehautRaynes: huh? whats hard about python?
23:36RaynesNothing. The problem is that sublime text's API is utter undocumented.
23:36jlibrehaut: you have to remember to type "return" at the end of all your functions
23:36Raynesutterly*
23:37jliamalloy: woot, thanks
23:37brehautjli: i have to remember to put the paren after the first identifier :P
23:37amalloybrehaut: i don't think he said it was hard. he just said he didn't know any
23:37amalloyi think remembering return is trickier
23:38technomancyexplicit return is such a goof
23:38brehautRaynes: that sounds like most python except for some of django
23:38technomancynewbie mistake among language designers
23:38brehauttechnomancy: not as much of a goof as non anon functions
23:38ibdknoxhashmaps in JS are what always screw me up, stupid trailing colon
23:38brehauts/non/no/
23:39jliamalloy: I seriously blow between 30 seconds to 10 minutes on that every time I do anything in python, because I've forgotten it by the time I have to write python again
23:39amalloytechnomancy: more important feature for imperative language, right?
23:39brehauttechnomancy: and mutable iterators.
23:39technomancybrehaut: I dunno; explicit return is usually caused by a statement/value distinction
23:39technomancywhich really betrays a lack of exposure to good languages
23:40jliibdknox: trailing colon, hmm? you mean trailing commas?
23:40ibdknox{mykey: "hey"}
23:40ibdknoxinstead of {:mykey "hey"}
23:40amalloyjli: {foo: 1} vs {:foo 1}
23:40technomancyit's actually more work to introduce a statement/value distinction
23:40technomancyyou have to actively screw it up
23:40jlioh, haha
23:41technomancylack of λ is a simple omission
23:41brehauttechnomancy: i'll give you that, but the iterators are still busted
23:42technomancybrehaut: sure... I haven't actually used iterators.
23:42ibdknoxthere are a number of things busted in python, ever try to make a decorator that takes a parameter?
23:42ibdknoxlol
23:42jliseems like people are done with messing up scoping
23:42brehautibdknox: hahaha
23:42jlioh, except for js :(:(:(:(:(
23:44brehauttechnomancy: to get a value out of the iterator you have to call next, theres no current value, and the iterator throws an exception to indicate that its done. your fine if you can use a comprehension, for… or itertools, but you are hosed otherwise.
23:44brehautits a perfect storm of bad mutation
23:45technomancybrehaut: people actually do this?
23:45nappingsounds like Java Iterators
23:46brehauttechnomancy: yes :(
23:48jlitruly excellent: http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html
23:49ibdknoxbrehaut: they want the lowest possible barrier to entry. For many rails turned into that
23:49Raynesbrehaut: Also, if you set something to read-only, apparently not even your own plugin code can write to it.
23:49RaynesSomething that I just spent about 30 minutes debugging.
23:50brehautibdknox: rails is a low barrier to entry‽
23:50ibdknoxRaynes: I was playing with sublime text 2 today
23:50ibdknoxbrehaut: It was, but less so now
23:51Raynesibdknox: This has been editorweek for me. I've learned to use Vim, gotten bored, and now I'm screwing with Sublime Text.
23:51brehautibdknox: ive never learnt rails; more ceremony than a church
23:51ibdknoxbrehaut: Rails popularized scaffolding, which was a site in a box :)
23:51brehautibdknox: yeah, djangos similar with its models + admin magics
23:51Raynesibdknox: I'd use Sublime Text, but no paredit makes me cringe. I no longer understand how to write Clojure code without it.
23:51ibdknoxRaynes: I couldn't deal with the fact that it indented incorrectly
23:51RaynesMy finger don't work this way.
23:51ibdknoxlol
23:52RaynesWhat doesn't it indent properly?
23:52RaynesIt doesn't seem to do much in the way of auto-indent at all.
23:52ibdknoxpretty much anything
23:52brehauttechnomancy: does emacs easily support having scoped modes within a file yet?
23:53Raynesbrehaut: What editor do you use?
23:53brehautRaynes: i hate emacs and textmate in equal quantities; i hate all other editors in larger quantities
23:53RaynesThat is wonderfully vague.
23:53ibdknoxvim is still my favorite :D
23:53RaynesBut I'm guessing that means you use Emacs and/or textmate?
23:54brehautRaynes: both
23:54ibdknoxthat's mostly because I can't convince myself to be at 10% efficiency for a couple weeks to learn emacs
23:54brehautemacs for clojure, textmate for python + js
23:54cemerickbrehaut: I'm stealing that answer, and just replacing the particulars. :-)
23:54brehautcemerick: hah awesome :)
23:54brehautcemerick: which one becomes eclipse?
23:55Raynesibdknox: My experiments with Vim have led me to not hate it. That said, editing Clojure with it is as much of a pain as doing it with Sublime for me, because I have to switch to command-mode to do paredit commands, and I always forget where my leader character is on my blank keyboard.
23:55RaynesI'm giving it all time though.
23:55RaynesI'm just happy that I don't care about swank anymore and don't have to deal with that crap.
23:55ibdknoxRaynes: you could map those commands to something in insert mode
23:56cemerickthat wasn't supposed to happen
23:56RaynesYeah, but I might have to learn VimScript.
23:56cemerick,(format "i hate %s and %s in equal quantities; i hate all other editors in larger quantities" "eclipse" "sublime text")
23:56clojurebot"i hate eclipse and sublime text in equal quantities; i hate all other editors in larger quantities"
23:57cemerickjrabbit: it's the duplo of string interpolation in clojure :-)
23:57cemerick(just FYI)
23:57ibdknoxspeaking of... you performance people, should I resort to a stringbuilder to get efficient string concatenation?
23:57jrabbitcemerick: I don't know what that is but it works like python string formatting which is nice
23:57brehautcemerick: the giant brightly colored blocks of string interpolation?
23:58cemerickibdknox: StringBuilder
23:58ibdknoxk, that's what I figured :(
23:58cemerickoooh, I'm tired enough that I thought ibdknox wrote 'StringBuffer"
23:58ibdknoxlol :p
23:59cemerickbrehaut: the not-very-powerful, not-very-flexible, but anyone-can-understand-it approach.
23:59brehautcemerick: aha, whats the technic version?