#clojure logs

2013-01-06

00:41TimMcWow, who knew that the JavaMail API could be so terrible?
00:41technomancyI knew.
00:42TimMcI mean, I can't say I'm *terribly* surprised.
00:42technomancyhave you got to the part where you have to deal with multi-part messages that could be nested at an arbitrary depth yet?
00:42TimMcOh, luckily I don't have to deal with that for this app.
00:42RaynesTimMc: Me.
00:43TimMcThis is an autoresponder for SMS<->email gateways, and anyone whose provider makes multipart emails from that can go write their own app.
00:43technomancyif it weren't for bouncy castle, javamail would be the canonical "can't be arsed to write an API that provides what people actually want; just going to code against the RFC instead" example
00:43TimMcheh
00:44TimMcIt looks like there's no way to retain a permanent reference to a message without holding the folder open.
00:46TimMcHmm, might not be a problem, since the Message carries around a reference to the Folder...
00:46TimMcEh, I'll just go to bed.
00:56RaynesTimMc: I tried to write a wrapper around javamail once.
00:56RaynesI have scars.
01:09arrdem,(seq {:a 'b :c 'd})
01:09clojurebot([:a b] [:c d])
01:21Raynesarrdem: You can use mine!
01:22djwonkAm I the only one that thinks http://clojuredocs.org/clojure_core/clojure.core/declare (forward declarations) are strange to have in a high-level language?
01:22arrdemmost kind of you Raynes!
01:22Raynesdjwonk: Why?
01:22djwonkI'm loving Clojure, but the order of defining functions is a pain
01:23arrdemdjwonk: no, not with the way clojure considers compilation..
01:23djwonkI'm no compiler writer, but with several passes, I wouldn't have to worry about it
01:24djwonkI'm just saying, for a high-level language, it seems out of place. I don't have a lot to complain about otherwise
01:24arrdemidk. Raynes this is a foible I'm over. thoughts?
01:24RaynesI think chicken fingers taste good.
01:24arrdemthat's a damn good thought for midnignt..
01:24RaynesI don't know how the Clojure compiler works.
01:25RaynesPerhaps it would be significantly slower to do what is necessary for unordered definitions?
01:25Raynes*shrug*
01:25Raynesamalloy?
01:25clojurebotamalloy is <amalloy> just use juxt, it'll be great
01:25RaynesWell, yes, but not what I was after.
01:25arrdem,(doc juxt)
01:25bbloomdjwonk: it's completely intentional
01:25clojurebot"([f] [f g] [f g h] [f g h & fs]); 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)]"
01:25bbloomdjwonk: it makes circular dependencies an explicit decision
01:25Raynesbbloom to the rescue, learning us stuff.
01:26RaynesI very much liked unordered definitions in Haskell.
01:26bbloomRaynes: that's what i'm here for: learning you of stuffs
01:26arrdembbloom: having taken a few stabs at compilers myself, why did rich see this as a behavior to be discouraged?
01:26amalloyclojure's compilation unit is the function, not the file. what if you typed (defn foo [] (bra 10)) into a repl, planning to define bar later? the compiler couldn't tell you about your spelling error until you ran foo
01:26RaynesI liked being able to put high level API at the top.
01:26bbloomwhat amalloy said too
01:27djwonkbbloom: I'm looking over http://news.ycombinator.com/item?id=2467359
01:27RaynesUgh, don't look over hacker news.
01:27RaynesPlease.
01:27arrdemyay hipster news!
01:27bbloomheh
01:27bbloomRaynes: you're way too young to be so cynical :-)
01:27RaynesOr at least please ignore everything anyone says on that place.
01:27RaynesI've been burned far too many times in my youth by HN.
01:27bbloomheh
01:28arrdemRaynes: it's more inteligent than /r/programming at least...
01:28bbloomdjwonk: so yeah, rich explains it pretty well there
01:28bbloomyou should listen to rich anywhere, even if it's HN :-)
01:28djwonkRaynes: re: "I very much liked unordered definitions in Haskell" me too
01:28djwonkamalloy: ah, good point about the unit of compilation
01:29bbloomdjwonk: you get used to not having them pretty quickly, and then you grow to appreciate the fact that you can read your code from bottom to top
01:29bbloomyou start at the top of the file, read the 'ns form, then you skim down the file making some mental notes of what functions are there
01:29bbloomand then when you get to the bottom
01:29bbloomyou reverse direction and start reading up again
01:30djwonkbloom: haha, that sounds like a coping mechanism … but considering what I understand, I don't see any obvious way to satisfy all concerns
01:30bbloomyou stop when you no longer care about the details
01:30amalloytop to bottom, man. my brain can't handle the UnsatisfiedLinkError
01:30bbloomamalloy: that's why you read top to bottom and then back to the top :-)
01:30bbloomyou don't need to read the bodies when reading top to bottom
01:30bbloomyou just skim the signatures
01:31bbloomeither way, the code is linear in terms of dependencies
01:31bbloommodulo a few declare statments if you actually need mutual recusion
01:31bbloomwhich, sometimes you do!
01:32djwonkbloom: thanks for explaining
01:34bbloomi just grepped all the clojure code i have ever written from scratch
01:34bbloomexactly two uses of declare
01:34bbloomand both of them are for tree expansion algorithms :-)
01:34RaynesI don't think I have any.
01:34arrdemI can remember three...
01:35bbloomRaynes: well then you clearly need to implement a macro expansion like system :-)
01:35arrdemtwo if which aren't called for
01:35bbloomboth of mine are actually exactly this: (declare expand)
01:35bbloomhaha
01:35djwonkfor fun, could I write a macro that flipped the ordering of subsequent forms? I know, I know. The horror.
01:36djwonkI like big picture at the top.
01:36bbloomdjwonk: no. top level forms can have side effects
01:36bbloommay i suggest putting the big picture in a comment at the top? :-)
01:37bbloomdjwonk: maybe a doc string? heh
01:37djwonkyeow!
01:38bbloomi had a friend who was an expert C++ and C# developer at msft. he was doing javascript for the first time and was using the function NameHere() { } syntax pretty much for the sole reason that it let him write the big picture at the top
01:38bbloomi taught him the basics of clojure and he played with a bit, then went back and changed all his javascript to be declare-before-use ord
01:38bbloomorder*
01:38arrdemhaha
01:38bbloomyou get used to it :-)
01:40arrdemcould you do a traversal of (source) to generate a (declare) given a symbol?
01:40bbloomarrdem: if you're gonna learn clojure, you might as well learn idiomatic clojure
01:41arrdembbloom: it's midnight here and I'm being silly
01:41arrdemwow that came out snippy... T_T
01:42bbloomarrdem: don't worry, my ego is far too big to be harmed by a potentially snippy sounding comment from a stranger on IRC
01:43Raynesbbloom: Actually, 87 uses of declare in my code folder.
01:43bbloomjust ask Raynes
01:43RaynesLooks like most of that is not my code though
01:43Raynestallyho is mine, so that's one use against me.
01:43arrdem.... does clojurebot have a roflcopter feature? because I could use one right now.
01:44arrdem,(use 'clj-http.client)
01:44clojurebot#<RuntimeException java.lang.RuntimeException: java.io.FileNotFoundException: Could not locate clj_http/client__init.class or clj_http/client.clj on classpath: >
01:46jonasenkovas_: Thanks for the merge! Is everything working ok?
01:46bbloomRaynes: i used this bash snippet to figure out which projects were mine or my forks:
01:46bbloomfor proj in $(ls); do; (cd $proj; git remote -v 2>&1 | grep brandonbloom > /dev/null && echo $proj); done
01:46bbloomer might be zsh
01:47Raynesbbloom: find . -name "*.clj" | xargs grep "(declare " | wc -l
01:47RaynesIs what I did.
01:48bbloomRaynes: replace that with find $(my code snippet here)
01:48bbloomand it will only check your own projects :-)
01:48Raynesbbloom: That doesn't account for forks.
01:48bbloomsub your name for mine, of course
01:48bbloomah, you keep them separate?
01:48RaynesNo, I mean forks are not my projects.
01:48RaynesBut this will think that they are.
01:48bbloomi just have 1 giant flat directory of projects including other peoples
01:49RaynesFor example, lib-noir uses declare in several places but I did not write that particular code.
01:49RaynesI do as well
01:49bbloom$ ls ~/Projects/ | wc -l # 205
01:49bbloomw00t, i broke 200
01:49Raynespenumbra:code raynes$ ls | wc -l
01:49Raynes 225
01:49Raynesbbloom: I win.
01:49bbloomdammit.
01:49bbloomlol
01:50bbloomi blame the fact that i worked for a living and had many many many other abandoned projects on company hardware :-)
01:50bbloomget a job.
01:50bbloom(says the unemployed guy)
01:51SgeoWhat's wrong with declare?
01:51bbloomSgeo: nothing
01:51bbloomwell, nothing in this discussion
01:53arrdem`find ~/doc/projects -maxdepth 2 -type d | wc -l` == 162 # I sort by language
01:53bbloomarrdem: what do you do with multi-language projects ?
01:54arrdem~/doc/etc
01:54clojurebotI don't understand.
01:54arrdem ~/doc/projects/etc
01:54bbloom(dec clojurebot)
01:54lazybot⇒ 14
01:54SgeoIf Racket didn't allow for arbitrary ordering of definitions, it could be comfortably added, because every module has an implicit redefinable (by changing the "language") macro surrounding the entire module called #%module-begin
01:55bbloomSgeo: yeah, racket's implementation is significantly more mature than clojure's....
01:55bbloomthere's nothing inherent preventing clojure from having something like that
01:55arrdemMESSAGE arrdem hello!
01:59Sgeobbloom, although I _think_ Racket might be a bit static for my taste
01:59SgeoTrying to imagine Qoppa as a Racket language, and currently stumbling on whether it's possible to add new definitions to a module
02:42arrdemin case you haven't seen it, http://stackoverflow.com/a/1732454/615234
03:04Raynesarrdem: Mhm.
06:56AimHereIs there an obvious way of constructing records from arguments that aren't the underlying objects that the record wants to store? I want to feed a constructor a string, and have it be a record containing numbers (or other things) in that string?
06:56AimHereIt's not hard to do, but I'm just thinking there might be an idiom I've missed
06:57bbloomAimHere: I believe that's called a function.
06:58AimHereWell I could write a function that constructs the object from the different-looking thing I'm constructing it from, but then it's not bundled with the record itself
06:58bbloomwhy does it need to be?
06:59AimHereI thought that was kindof the point of managing complexity with all this OO (or pseudo-OO) stuff
06:59AimHereSuddenly I've got to look in two places for functions that deal solely with one type of record
06:59AimHereAs I say, I can do it that way, I just get a hunch that it's a bit unidiomatic
07:00bbloomboth deftype and defrecord produce dumb field assignment constructors
07:00AimHereI'd rather define a macro that replaces defrecord instead for that reason
07:00bbloomyou'd have to gen your own class with your own constructors
07:00bbloomthe dumb field assignment constructors are intentional
07:01bbloomrecords and types should be able to achieve the underlying platforms maximum allocation performance
07:01AimHereFair enough. I know they're dumb, I was just wondering if there was an idiom I'd missed
07:01bbloomwhich means that you need to be able to just blast down fields without a constructor call
07:01bbloomdumb constructors that assign all fields in order can be mem copies when jitted
07:02AimHererolling my own defrecord it is, then!
07:02bbloomlol that seems like overkill for what can be solved with defn
07:03AimHereYour way I've got ten constructors where five will do
07:03bbloomdo you just want a special reader behavior? b/c in that case you can use tagged literals
07:03bbloomwell constructors aren't functions
07:03bbloomyou can't do higher order ops with them, etc
07:04bbloomnot without wrapping them in a function first
07:04bbloomwhich is why defrecord produces ->Foo functions
07:04AimHereWell that's kindof the idea
07:04bbloomand map->Foo
07:04bbloomin theory, you could just call it Blah->Foo and then it would be pretty easy to find by searching for "->Foo"
07:04bbloom(doc defrecord)
07:04clojurebot"([name [& fields] & opts+specs]); Alpha - subject to change (defrecord name [fields*] options* specs*) Currently there are no options. Each spec consists of a protocol or interface name followed by zero or more method bodies: protocol-or-interface-or-Object (methodName [args*] body)* Dynamically generates compiled bytecode for class with the given name, in a package with the same name as the current namespace, the given fie
07:05bbloom~(doc defrecord)
07:05clojurebotdefmulti doc is "I think dropping filter() and map() is pretty uncontroversial…" — GvR
07:05bbloom,(doc defrecord)
07:05clojurebot"([name [& fields] & opts+specs]); Alpha - subject to change (defrecord name [fields*] options* specs*) Currently there are no options. Each spec consists of a protocol or interface name followed by zero or more method bodies: protocol-or-interface-or-Object (methodName [args*] body)* Dynamically generates compiled bytecode for class with the given name, in a package with the same name as the curr...
07:05bbloomdammit bots
07:05bbloom$doc defrecord
07:05bbloom"Given (defrecord TypeName ...), two factory functions will be defined: ->TypeName, taking positional parameters for the fields, and map->TypeName, taking a map of keywords to field values."
07:05bbloomwhat harm does one more factory function do?
07:07AimHereIt's not one more function though, it's one for each record I'm defining
07:07bbloomhow many record types are you defining?
07:08AimHereNot quite sure. At least 5 or so
07:08bbloomand they are all similar in the same way that they can have an auto generated special factory function each?
07:09bblooma macro that delegates to defrecord and then defines an extra factory function wouldn't be unreasonable
07:09AimHereThat's my plan
07:09bbloomthat's a lot more sane than "roll my own defrecord" sounded like lol
07:09AimHereHeh, yeah
07:10bbloomanyway, it's way past my non-existent bed time
07:12tomojjust curious, why are you defining record types? :)
07:15AimHereI've a bunch of objects that I'm doing similar things on, in different ways
07:16bbloomAimHere: in my experience, a multimethod and a type-like key is more pleasant
07:16AimHereSo I figure I want that record/protocol type stuff going on
07:17bbloomrather than have (defrecord Rectangle [left top right bottom]) just have {:shape :rectangle :left ... :right .......)
07:18AimHereThat's definitely an option. I've already done a whole protocol-> multimethod change elsewhere in this program
07:18AimHereI don't think I need quite that much polymorphism here though
07:20tomojthat sounds reasonable enough for me to stop interrogating you
08:41klris clojure a lisp variant of java?
08:42daimrodno, it's a different language even though it runs on the JVM.
08:42ejacksonno its a lisp on the jvm
08:42klris jvm big download?
08:42SgeoYes, but there's a good chance you already have it
08:42daimrodyes, but why do you care?
08:42klrbtw, is Clojure a lot like Scheme( i studied scheme recently)
08:43klrI dont have it install, i dont use java software
08:43Sgeo(note: I believe klr is looking for a first language)
08:43klrdaimrod: cause i considering learning Clojure since i want to learn programming and i got some basic knowledge of scheme so i thought it would be eaiser thatn for example starting with python
08:43klrSgeo: yes
08:44daimrodklr: why don't you learn Scheme first?
08:44klrdaimrod: i cant seem to find a good scheme book, SICP isent intended for kids and HTDP is just annoying
08:45Sgeoklr, you did see that how lists display in BSL can be changed?
08:45daimrodSICP is for kids?
08:45klrno
08:45klrit's for MIT students
08:46klrtoo advanced math in the exercises and examples for me, and lots of new words
08:47klrback to question, is JVM big download?
08:48SgeoAround 30-50MB looking at the download page. That sounds small though
08:48klrindeed
08:48klrgonna check if it's my distributions repo
08:48arcatanmost likely
08:48klrnope, guess i have to compile from source
08:49Bronsawhat's your distribution?
08:49klrCRUX
08:49klris it the JDK or the JRE i want to install?
08:49hyPiRionjdk
08:50hyPiRionto compile and build stuff, at least
08:50klrok
08:54clojure-newbcemerick: Hi, I can't find a form login example for friend… is there one ?
09:32clojure-newbthorwil: hi… I just found your tlog friend integration example… did you ever try plain old ring session for the authentication etc ?
09:53magnarswhat's better than (vec (concat v1 v2)) ?
09:55thorwilclojure-newb: no, i really couldn't be bothered to handle redirecting to/from a login page and stuff like that myself
09:56clojure-newbthorwil: I saw your question on getting the 'Sorry, you do not have access to this resource.', what was the fix in your case ?
09:57thorwilclojure-newb: i don't recall the full context or the precise question
09:58clojure-newbthorwil: I'm getting the same thing using middleware memory session
09:58thorwilclojure-newb: but i think it was all about using the right middleware (in the right nesting)
09:58clojure-newbthorwil: pretty brittle in some ways then ?
10:00thorwilclojure-newb: just a bit lacking regarding documentation on that
10:00thorwilclojure-newb: https://github.com/thorwil/tlog/blob/master/src/immutant/init.clj#L15
10:00clojure-newbthorwil: I'm tempted to just pretty much clone your project (using immutant instead of ring-jetty etc) to see if I can get an in memory session authentication setup working
10:00clojure-newbthorwil: thanks, thats what I was just looking at
10:01thorwilclojure-newb: it works in that order, but i had been told wrap-nested-params should also be there. it works without, for everything i tried so far
10:01clojure-newblosing too much time on the ring, jetty etc setup
10:01thorwilwhich is not much, as i have a single account and role
10:01thorwilcoffee break, bbl
10:01TimMcdjwonk: Rich's HN explanation about compilation units doesn't satisfy me. We *do* have a compilation unit; it's called the namespace. All that discussion is about impl tradeoffs. The only *semantic* problem I can see with multi-pass compilation is what to do about macros.
10:12TimMcdjwonk: I think clojure/core.clj is the *one* source file that needs to be handled in a single-pass fashion, and that can be special-cased by the compiler, since it already is.
10:19clojure-newbits not going my way today… immutant install gives sha1 checksum validation failed… any ideas ?
10:32thorwilclojure-newb: known problem. though perhaps of interest to tcrawley that it still exists
10:33thorwildang
10:44SgeoAn implementation of Clojure in Racket wouldn't suffer from the single-pass issue :p
10:47tcrawleythorwil: thanks for passing along the report. it's probably time to move our artifacts to a new provider
10:49jasonbraysilly question for paredit/nrepl users - if you have paredit on in the repl and want a soft break (i.e. move the closing paren down to the next line without executing the expression), how do you do it?
10:49xeqitcrawley: that clojars thing is just no good
10:49Sgeojasonbray, guessing C-j (Ctrl-J). Not sure though
10:50jasonbraythanks Sgeo, that seems to work
10:51tcrawleyxeqi: heh - this is the immutant zip - it's hosted by cloudbees currently
11:00milos_cohagenhey guys/gals.. is there a clojure function which translates a java object graph to clojures map, seq abstractions? sort of like recursive clojure bean function?
11:13seangroveDamn, storm is lein1-only
11:13seangroveJust wasted 10 minutes
11:31TimMcmilos_cohagen: Not that I know of. How would you recognize which fields to bean-ify?
11:49TimMc,(* -1 0.0)
11:49clojurebot-0.0
11:52milos_cohagenthx tim, good q, will think about it
11:57djwonkTimMc: ah, you are still thinking about that! why is clojure/core.clj the one file that needs to be handled in a single pass?
12:02djwonkseangrove: I'm going to be using storm soon and just found #storm-user
12:03seangrovedjwonk: Thanks, will join it
12:07tpopebbloom: what, like, you want it to quickly error out if you attempt to evaluate something?
12:07tomoj&(.equals 0.0 -0.0)
12:07lazybot⇒ false
12:10tomoj&(doto (java.util.HashMap.) (.put 0.0 1) (.put -0.0 2))
12:10lazybot⇒ #<HashMap {-0.0=2, 0.0=1}>
12:10tomojgood thing clojure saves us from this..
12:11tomoj&{0.0 1 -0.0 2}
12:11lazybotjava.lang.IllegalArgumentException: Duplicate key: 0.0
12:11TimMcdjwonk: Hmm, maybe it doesn't.
12:11TimMcI wonder what's with this? (. (var defn) (setMacro))
12:11tomojI guess doubles as hash map keys is always sorta weird anyway
12:12tomojTimMc: defmacro doesn't exist at that point
12:12TimMctomoj: Sure, but you see ^{:macro true} on vars above it.
12:12tomojnote the defmacro's start right after (. (var defmacro) (setMacro))
12:13tomojinteresting
12:13tomojonly on let/loop/fn, which are redefined
12:14TimMcloop is declared that way and never has setMacro used on it.
12:14TimMcI see. Most curious.
12:15tomojsetMacro just sets that metadata
12:16TimMcMust be a leftover.
12:16tomojcurious indeed
12:16TimMcWell, there's an easy way to check this...
12:17TimMcEh, I don't feel like rebuilding core.clj. I thought for a moment I could just edit the jar, but it's all AOT'd.
12:27arrdemmorning all
12:40antoineBhello, can i have access to the current namespace from a clojurescript macro?
12:40antoineBthere is some hidden var in macro, if i remmember well
13:02cjfriszAnybody run into "Unable to resolve symbol: with-redefs in this context" errors when using compojure and markdown-clj together?
13:03cjfriszCuz I think I just ran into a load-order problem with them
13:04TimMccjfrisz: That's a bad sign -- with-redefs isn't meant to be used in production code.
13:05cjfriszTimMc: I didn't do it! I swear!
13:05cjfriszTimMc: But really, I was getting that exception until I switched the load order
13:07cjfriszTimMc: And I'm not using with-redefs in my own code
13:11TimMcRight, it's probably in one of those libraries.
13:12cjfriszThat was a really nasty bug to track down
13:12cjfriszLuckily it pretty much got me to find all the actual bugs in my code
13:13TimMcyogthos: Argh, you're using with-redefs in markdown-clj!
13:18ziltiWhat could be the reason for "CompilerException java.lang.RuntimeException: Can't embed object in code, maybe print-dup not defined: clojure.lang.Atom@69dc323b" ?
13:25TimMczilti: Bad macro, maybe?
13:26TimMcSounds like a macro is returning an atom instead of the syntax for creating one.
13:28ziltiTimMc: Hmm I don't have a macro that has anything to do with atoms.
13:41pepijndevosHow is fair conjunction as explored by cgrand different from conde? Conde is interleaved, so if one goal is infinite, and the other fails, it will still fail, right?
13:50gfrederickspepijndevos: conde is disjunction
13:50pepijndevosah shit...
13:50ambrosebsLOL just made the same mistake.
13:50pepijndevosok, thanks
13:51pepijndevosawww, this is complicated
13:52gfrederickscomputers?
13:52pepijndevosI keep thinking there are like 5 people in the entier world who understand relational programming well enough to implement it
13:53pepijndevosI aspire to be the sixth, but I'm faaar from it, and not making a huge effort either....
13:53ejacksonand maybe 6 good enough to program with it :)
13:53gfredericksI understand it well enough to find bugs for dnolen
13:54pepijndevosgfredericks: oh yea, me too :P
14:16TimMctechnomancy: ISWYM now about javax.mail just implementing the RFC and no more. "The application is responsible for folding and unfolding headers as appropriate."
14:18yogthosTimMc: yeah I need to overwrite stuff between clj and cljs
14:19yogthosTimMc: well strictly I don't have to, but it makes sense to use the native .substring for java strings if it's running server side
14:23TimMcyogthos: Do macros know what runtime they're expanding for?
14:23yogthosTimMc: not sure
14:24yogthosTimMc: so what is so bad about that particular redef? :)
14:25TimMcIt's not thread-safe.
14:25yogthosTimMc: ah
14:25TimMcwhich may not matter here, but still...
14:26TimMcyogthos: cjfrisz was getting some weird errors that might be related to it.
14:26yogthosTimMc: yeah it's highly unlikely that would be a problem in this case
14:26TimMcI'm imagining a macro that returns the appropriate syntax for your runtime.
14:26yogthosTimMc: I could just use the hand rolled substring which works in both, but then it's a performance penalty with little justification
14:27yogthosTimMc: yeah if a macro could do it, that would be a bit cleaner
14:27gfrederickswhy does `lein repl` give me this long list of commands I can't use?
14:27TimMc((->substring) foo bar baz) -> (substring-clj foo bar baz)
14:27TimMcand the ->substring macro could check the environment.
14:27TimMcI know there was some discussion recently about conditional compilation.
14:28TimMcgfredericks: lein2?
14:28gfredericksTimMc: yeah
14:28yogthosTimMc: there might be a way around it with using a dynamic too
14:28yogthosTimMc: I could declare substring and then inject the actual implementation at runtime
14:29TimMcThat might not work so well with CLJS.
14:29yogthosTimMc: I'll take a look if I can come up with something :)
14:32TimMcgfredericks: clojure.repl isn't getting included, or what?
14:32gfredericksTimMc: that would explain it; I just don't know why the thing expects it to be included
14:49yogthosTimMc: switched to using binding instead
14:49yogthosin v0.9.15
14:55ziltiIs there a way to force spit to pprint its stuff into the file?
14:55TimMcI thought spit already worked with strings.
14:56TimMcI guess not.
14:57ziltiTimMc: It works with data structures as well, but I'd like it to pprint that stuff.
15:00bprisn't there a var you can rebind with a pretty-printing writer to get pprinting behavior from spit, et. al.?
15:00ziltiOh pprint accepts a writer as second argument...
15:09bprzilti: the vars i was thinking of exist in clojure.pprint, fyi
15:17ravsterhello all
16:00yediis overtone the go to library for all things music related
16:01pepijndevosyedi: for some kinds of music...
16:01pepijndevosthere is also some music stuff in Java and big libs like JFuge
16:02pepijndevosis :arglists on functions a documentation thing, or a reliable source for argument count?
16:17pepijndevoscan a function have metadata, or only its var?
16:21bprpepijndevos: any value can have meta-data
16:22ToxicFrogpepijndevos: metadata is tied to the value, not the name(s) bound to it. And yes, functions can have metadata.
16:23bprpepijndevos: note: defn applies metadata to the var
16:23bpr,(doc defn)
16:23clojurebot"([name doc-string? attr-map? [params*] prepost-map? ...] [name doc-string? attr-map? ([params*] prepost-map? body) + ...]); Same as (def name (fn [params* ] exprs*)) or (def name (fn ([params* ] exprs*)+)) with any doc-string or attrs added to the var metadata. prepost-map defines a map with optional keys :pre and :post that contain collections of pre or post conditions."
16:26djwonkIs there a convention for naming params so that it is clear if an atom or ref is expected, as opposed to, say, something more primitive? I'm finding that my code (granted, an early project) has both and it feels messy.
16:30gnarmisHi, I was looking for clojure-clr's 1.5 RC1 binary. Are all the available ones on github?
16:31ghengisi usually just append -atom or -ref
16:56djwonkghengis: thanks
16:58djwonkI want to apply a function over a seq. The function calls swap!. When Clojure docs talk about side-effects, does `swap!` count as a side effect? I'm searching around and learning which functions are appropriate.
17:00AimHereswap! changes whatever it is you're pointing it at, which is pretty hefty as far as clojure side-effects is concerned
17:02ghengisdjwonk: "I want to apply a function over a seq".. swap! only works if the seq is in an atom.. it sounds like you're looking for 'apply' or 'map' or 'reduce'
17:03magnarsconcat'ing two vectors and getting a vector back - any better way than taking a detour to linked lists with (vec (concat v1 v2)) ?
17:04AimHereIf you're doing a lot of concatenating, maybe you should be keeping your data in list form
17:05Raynesmagnars: (into v1 v2)
17:07magnarsAimHere: concatenating is more efficient for linked lists than vectors? does it not have to traverse the entirety of the list to find the end?
17:07magnarsRaynes: thanks!
17:07djwonkghengis: probably. I was doing something that didn't make sense now that I look at it again
17:08AimHeremagnars > once it gets there, it only has to do one little change
17:08AimHeremagnars > and yes, more efficient, by a factor of about 10, if my quick experiment just now is to be believed
17:08magnarsAimHere: nice, thanks for the info
17:09AimHereWell all I did was a few (time (def c (concat ...))) and similar to see which was faster
17:09AimHereSo don't take it as anything other than a quick handwave
17:09djwonkgnarmis: all I know are the downloads here: http://clojure.org/downloads -- I'm personally still using 1.4 via homebrew
17:12djwonkRaynes: I didn't see `into` mentioned on http://clojure.org/data_structures -- how would one go about suggesting that it be added?
17:14RaynesI guess posting on the mailing list. Going to church and praying for a while probably wouldn't hurt.
17:15djwonkRaynes: I was hoping that https://github.com/clojure/clojure.github.com might be the place to suggest edits, but it is autogenerated
17:18amalloyAimHere: (time (def c (concat ...))) doesn't time anything at all
17:18RaynesLaziness.
17:18AimHereDamn you and your lazy data structures!
17:19Raynesamalloy is always around to make someone feel stupid
17:19Rayneso/
17:21ravsterCan I nest sexp-as-element calls (From clojure.data.xml)?
17:23amalloyuhhh, it's just a function, so you can do whatever you want; however i can't see that ending well
17:23ravsteramalloy: :) hehe, yeah
17:23ravster*sigh*
17:24amalloywhatever problem you're trying to solve either isn't a real problem, or has a better solution than that
17:27ravsteryeah, I'm trying to build up xml piece-by-piece ,and then put it into higher-level xml
17:27ravsterI need to find the command that allows that. I'm sure there must be something like that provided by the lib
17:29ravsteror I'll just have to start concatenating strings, which feels wrong on so many levels
17:31djwonkIs ending functions with a bang `!` recommended if they have side effects? I read somewhere that they are recommended for functions that should be called inside a transaction. (But the latter advice would seem to be already broken w.r.t. swap! -- it needs no transaction)
17:32ravsterokay, I'm just going to use the 'element' command since that seems to be able to do what I want.
17:32tmciverdjwonk: I believe that's the convention for functions that mutate one or more of their args.
17:33ziltitools.trace would be enormously awesome if it wouldn't break almost everything it touches...
17:34tomojproject.clj: https://www.refheap.com/paste/baddf9acdb9b5fd7184457697 , pom.xml: https://www.refheap.com/paste/cf6dde0462c77c73eda0c41d9 . bug?
17:34tomojnote the stanford-corenlp dep is only listen once with no classifier in pom.xml
17:34tomojthis seems to result in it not being included for transitive deps
17:34tomoj(it being the dep with the classifier)
17:35tomojwarning to anyone testing, that "models" jar is pretty big
17:37djwonktmciver: thanks
17:39bbloomtpope: yeah, i want a "only do something useful if there is a repl-port file, otherwise immediately tell me there's an error"
17:39tomojhmm https://github.com/technomancy/leiningen/issues/483
17:39tomoj9 months ago? I hope my version isn't >9mo old
17:40tomojnope
17:41TimMcdjwonk: should *not* be called inside a transaction
17:42tpopebbloom: I'm going to extract the classpath stuff to a separate plugin. if it's not installed, things will fail fast
17:42bbloomtpope: what is the class path used for right now?
17:43tpopebbloom: the one off runner is the main thing
17:43bbloomtpope: yeah, i don't need that :-)
17:43tpopebbloom: it's also used to find the current namespace, if a regex can't to the job
17:47djwonkTimMc: ok, I see that in the Library Coding Standards. Does the "functions named with a ! should not be called inside a transaction" advice agree / disagree / neither with what tmciver said ("the convention for functions that mutate one or more of their args")
17:48TimMcagree
17:48TimMcTransactions may repeat.
17:48TimMcIt's not really about mutating args, though.
17:48TimMcany sort of side effect
17:49djwonkok, I think I've got it
17:49tomojprintln! ?
17:50tomoj:P
17:50hyPiRionpr!
17:51hyPiRionI kind of disagree with one thing in the clojure style guide: "Limit the use of commas in collection literals."
17:51RaynesI disagree with the abuse of the word 'syntax'.
17:52hyPiRionobviously it depends, but [1 2 3 4] is not the same as [1 2, 3 4], which implies 1 and 2 is grouped together.
17:52tpopehyPiRion: he says "limit", but he clearly means "never ever ever ever use them" :/
17:52tpopehe/she/they
17:53tomojalways found that kind of odd
17:53tomojoh, vectors at least don't print with commas
17:53tomojbut &{1 2 3 4 5 6 7 8}
17:53tomojwell, trust me, there are commas :)
17:53hyPiRionyeah: {foo x y zap bar gank frob} is more unreadable than {foo x, zap bar, gank frob}
17:54hyPiRionWell, they're not equal, but you get my point.
17:54Raynes&{1 2 3 4 5 6 7 8}
17:54lazybot⇒ {1 2, 3 4, 5 6, 7 8}
17:54tomojwhich seems great, much more readable. so how come I never put commas in the maps I write..?
17:55tomojI guess maybe because I can use newlines instead
17:55amalloytomoj: commas generally just get in the way if your keys are keywords; the pairing is then already obvious
17:55tomojgood point
17:55djwonkhyPiRion you think you have it bad with a syntax disagreement? I have it worse. I think semicolons are just hideous. Clojure had to pick ; and ;; for comments. Ug!
17:56tpopedjwonk: lisp made that decision 50 years ago
17:56djwonkI think my loathing of ; now means I don't like writing comments. Maybe that is good, since I'd rather put everything in a docstring or markdown file.
17:57djwonktpope: hola. fair point. doesn't mean I have to like how they look. they haven't aged well.
17:57hyPiRiondjwonk: use #! isntead
17:57tpopedon't encourage him :)
17:57hyPiRion,(+ 1 2) #! we will never see this
17:57clojurebot3
17:58tomojhmm, I suppose it would be rude to push a 212M jar which is already available in maven central to clojars?
17:58djwonkhyPiRion: thanks, now I can trade ugly for hideous
17:58hyPiRiondjwonk: you're welcome
17:58hyPiRionYou could do #_ instead, that would be even better
17:59tomojoh wait, I have to uberjar anyway, so no need to push to clojars. :'(
17:59hyPiRion,(+ 1 2) #_ just #_ have #_ to #_ do #_ it #_ for #_ every #_ word
17:59clojurebot3
18:01djwonkhyPiRion: a problem easily solved with a proper text editor, no doubt
18:10tpopebbloom: try :let g:no_foreplay_classpath = 1 with the latest
18:41ppppaullein ring server reloads on code changes, right?
18:41weavejesterppppaul: Yep.
18:41weavejesterppppaul: At least, that's the idea :)
18:44ppppauli have a (println) in core.clj, when i change and save the (println) it's not being logged
18:44hyPiRionppppaul: might happen in another thread
18:44ppppaulhmm
18:44weavejesterppppaul: Which version are you using? Is core.clj under src?
18:45ppppaulcore.clj is under src/
18:46ppppaulany ideas?
18:46weavejesterIt should reload it then… What happens when your restart it? Does the println show up then?
18:46weavejesterAlso, which version?
18:46ppppaulyes
18:46weavejesterThere were bugs in previous versions
18:46ppppaulversion of ring plugin?
18:46weavejesterMight be a few still there, but certainly a lot less
18:46weavejesterYep
18:47ppppaul[lein-ring "0.7.5"]
18:47bbloomtpope: oh so much better :-)
18:47bbloomthanks!
18:47weavejesterThat's the latest version
18:47weavejesterWhat happens when you keep making changes?
18:48bbloomtpope: it felt like i was booting visual studio every time i wanted to look at a piece of clj code. i felt myself resist the urge to open vim and was like "WHOA! THAT IS WRONG", hence complaining to you :-) much better now
18:48ppppaulweavejester, nothing
18:49weavejesterppppaul: Odd. I don't think I've ever seen it fail completely before. I can't think what could cause that.
18:49ppppaulweavejester, i just tried without headless and i'm getting an NPE... so maybe that's the problem
18:50weavejesterCertainly it wouldn't reload if the source file has a syntax error
18:50weavejesterOr some sort of error that occurs on load
18:53brainproxyppppaul: what versino of clojure?
18:54ppppaul1.4
18:54ppppauli solved my problem (i think).... NPE was caused by datomic not being started
18:56ppppaulfixing the NPE error didn't solve my ring plugin issue, though
18:56weavejesterppppaul: Let me see if I can put together a short debug code snippet to try
18:59weavejesterppppaul: https://gist.github.com/4471115
18:59ppppaulhow do i get ring error/dehub output?
18:59weavejesterppppaul: The wrap-stacktrace middleware turned on by default in lein-ring should print exceptions to STDERR
19:01ppppaultracker seems to be working
19:02weavejesterppppaul: Hm… I'm not sure what to suggest next. Wrap-reload just reloads all files returned by the ns tracker.
19:02ppppaulturned on by default... hmmm i'm not getting any stack traces
19:02weavejesterppppaul: Is this an open source project?
19:02weavejesterppppaul: In the terminal?
19:02ppppaulit's not an OSS :(
19:02ppppaulyes in the terminal
19:02weavejesterppppaul: What OS are you using?
19:05weavejesterppppaul: You could try a "lein clean" and then restarting. Maybe something's gone wrong somehow
19:06weavejesterIt seems odd that wrap-stacktrace and wrap-reload are not working
19:06weavejesterPresumably you're executing this through "lein ring server"
19:06weavejesterAnd do not have ":stacktraces? false" and ":auto-reload? false" in your project.clj file
19:07ppppaulusing ubuntu
19:07ppppauli'm getting stacktraces
19:07ppppaulnot getting reloading
19:07ppppauli don't have params for ring and i'm doing 'lien ring server-headless'
19:08weavejesterI thought you said the error wasn't showing up?
19:08weavejesterI guess you have a :ring {:handler blah} section at least
19:10ppppaulseems like it's reloading, but it's being lazy
19:10ppppauli have to hit the server for it to reload
19:10weavejesterOhhhhh!
19:11weavejesterYou were expecting it to reload instantly?
19:11weavejesterIt only checks for reloads each request. It's not a continuous background process.
19:11hyPiRionheh
19:12tpopetufflax: someone added python support to foreplay. you should see if that fixes your second delay issue
19:12weavejesterBTW, by adding a ":open-browser? false" in your :ring section, you can just use "lein ring server"
19:12tufflaxtpope: ok
19:16bbloom,(clojure.string/split "x|y|" #"\|")
19:16clojurebot["x" "y"]
19:16bbloom:-(
19:16bbloom,(clojure.string/split "x|y|" #"\|" -1)
19:16clojurebot["x" "y" ""]
19:16bbloomstupid java split function.
19:17bbloomthat introduced a crazy subtle bug
19:20a|iwhich clojure ide has the best support for the language? something like what eclipse is to java.
19:20weavejesterThe Java regex functions have all sorts of subtle gotchas :/
19:20weavejestera|i: Does emacs could as an IDE? ;)
19:20a|iweavejester: NO.
19:20weavejesterHaha
19:21bbloomi hear that eclipse people use counter-clockwise
19:21cshella|i: I use IntelliJ - the La Clojure plugin is nice
19:21mrowea|i: what do you expect an IDE to do for you that emacs doesn't?
19:21hyPiRionmrowe: I suppose the keybindings would be a bit different.
19:22a|imrowe: passing the emacs learning curve. I'm already trying to market clojure to my team, they asked if it comes with an ide helping newbies. now you want me to also ask them to learn emacs?
19:22mrowea|i: fair enough. then what cshell said. :)
19:23mrowebut fwiw, learning emacs is totally worth it
19:23a|icshell: is it well maintained, or is it like a hobby project? is it buggy?
19:23cshella|i: JetBrains maintains it and I haven't come across a bug
19:24cshella|i it also has a Leiningen plugin if you use that as your build/dependency manager
19:25seancorfieldFWIW, my team used a mix of Eclipse and Sublime Text 2 so I let them work that way with Clojure for a while and then showed them what my workflow with Emacs looked like... One has switched already, the other is switching soon...
19:25hyPiRionseancorfield: Yeah, I think that's nice. Try to learn them one thing at a time. Clojure first, then let them see how you'd work in emacs
19:26hyPiRionif a|i uses emacs of course.
19:26seancorfieldSo my recommendation is to continue using whatever they're comfortable with today, add a Clojure plugin, teach them the REPL-driven approach and once they're happy with Clojure but frustrated by IDE + REPL limitations, show them Emacs :)
19:26a|icshell: I don't know why chas elerick recommended cc over la clojure in his video: http://www.youtube.com/watch?v=VVd4ow-ZcX0
19:26seancorfieldali because chas is a contributor to CCW?
19:27a|iI didn't know that :)
19:27seancorfieldand my understanding is CCW is more actively maintained than La Clojure and more feature rich at this point
19:27seancorfieldso it really depends whether you're already using Eclipse or IntelliJ
19:28a|iseancorfield: which ccw feature is important that la clojure lacks?
19:28bosieare private functions really used?
19:28seancorfieldpersonally I can't stand IntelliJ... I've tried it several times... JetBrains even comp'd me a license, and then an upgrade, but I still couldn't get used to it...
19:28seancorfieldali: i don't really know, i haven't use La Clojure enough...
19:29hyPiRionbosie: Private functions is nice if you have some utility function within a namespace you don't want to show to people using the library
19:29seancorfieldbosie: i use private functions a lot - so my public functions don't get too big
19:29bosieseancorfield: ok
19:29seancorfieldi'll often refactor a public function into several private functions if i feel it is too complex
19:29bosiehyPiRion: sure, i know why one would use a private function (in an oop language), just wondering how clojurians look at them
19:29seancorfieldi find that easier to read than a let with local functions
19:31bosieseancorfield: thats a given, even for a newbie like me ;)
19:31djwonkam I doing this wrong? (using @ inside swap!) https://gist.github.com/4471273
19:31hyPiRionbosie: well, as seancorfield said: To provide a nice face to the outside world, and to provide a nice face internally as well
19:31bosieok
19:32hyPiRiondjwonk: You might want to have a look at update-in
19:32bosieanother question that bothered me today. is it possible that midje's provided only works for functions called on the last line?
19:33djwonkhyPiRion: thanks, will do
19:33hyPiRion(swap! game-atom assoc :players (kill-players (:players @game-atom))) could be written as (swap! game-atom update-in [:players] kill-players)
19:34seancorfieldbosie: about half our functions are private in our production code base
19:34djwonkhyPiRion: that is much cleaner thanks. but is it *wrong* to use the deref (@) inside the swap? does that break rules of atoms? I mean, it seems to work fine when i tried it
19:34seancorfieldClojure source 53 files 8300 total loc, 664 fns, 368 of which are private, 97 vars, 2 macros
19:34bosieseancorfield: you are using clojure in production?
19:35seancorfieldyes, since 1.3.0-alpha7 in spring 2011
19:35bosieseancorfield: want to share your company? ;)
19:35seancorfieldWorld Singles
19:36seancorfieldin addition to the 8,300 lines of production code, we have ~1,800 lines of unit tests (Expectations) and ~400 lines of WebDriver Clojure code (using clojure.test)
19:36bosieinteresting
19:36hyPiRiondjwonk: With multiple threading, it may once a blue moon give you wrong answer. However, with single threading, this should be fine.
19:37djwonkhyPiRion: oh fun, I like those kinds of errors. I'll stick to update-in!!
19:38hyPiRionheh, smart
20:03xeqiRaynes: why laser no have dependency info in readme?
20:03brehautthe only dependancy raynes believes in is monster energy drink
20:04Raynesxeqi: Because the same info is in the project.clj and it I'll just forget to update it in the README.
20:04xeqihow bout a link to the clojars page at the top?
20:04RaynesBut whyyyyyyyy?
20:05xeqiI suppose if you don't bump to a -SNAPSHOT immediatly after release then reading the project.clj is sufficent
20:05RaynesI don't do snapshots.
20:05TimMcxeqi: You mean the lein dep string for laser.
20:06xeqiTimMc: correct
20:06TimMck
20:06TimMcFor a moment I thought you wanted Raynes to list out all the dependencies.
20:06Raynesxeqi: I'd like for clojars to give me a image or something I can include in my README that always shows the latest version.
20:07TimMcHey Raynes, you're working on that CSS selector syntax for Laser, right? :-P
20:07xeqiRaynes: I was just thinking about if there was a good way to do that
20:07TimMcah, like Travis does
20:07RaynesTimMc: I am not, but it is something that could happen in the future.
20:07TimMcOh, I thought you were morally opposed to it.
20:07RaynesI'm morally opposed to faux css selector vector keyword nonsense.
20:07TimMcOK
20:07RaynesIf I implement CSS selectors, I'll implement CSS selectors.
20:08RaynesNot the weird keyword vector version of it
20:08bosieanother question that bothered me today. is it possible that midje's provided only works for functions called on the last line?
20:08xeqiI also notice the "don't use the global namespace" crowd got to you
20:08Raynesxeqi: No, I just really like my name.
20:08xeqioooh, and no .core
20:12TimMcxeqi: I'm proud to say that I contributed a patch to lein-newnew that eliminates core.clj when you specify a multi-segment namespace.
20:12amalloyi had to stop him from using raynes.raynes.laser.by.raynes.core
20:12brehautTimMc: high five
20:12brehaut(inc timmc)
20:12lazybot⇒ 31
20:13TimMcI don't know when or how it will make it into a shell near you, though.
20:14RaynesWhenever you add it to your :plugins
20:14TimMcAh, and that overrides whatever version leiningen itself brings along, or what?
20:14RaynesYep.
20:24muhooit looks like it's already merged in? https://github.com/Raynes/lein-newnew/commit/4fe7a9011c8466fabf9e6708291b06b659a89483
20:30TimMcmuhoo: Merged, but not released.
20:31hyPiRionAnd lein uses an older version
20:48technomancyhyPiRion: fwiw the "clojure style guide" is just the opinions of one guy who hasn't even published any code, so don't take it too seriously
20:49lsdafjklsd_Hey all!
20:49lsdafjklsd_I'm doing clojure koans, and this recursive function is blowing my mind
20:49lsdafjklsd_(defn is-even? [n]
20:49lsdafjklsd_ (if (= n 0)
20:49lsdafjklsd_ true
20:49lsdafjklsd_ (not (is-even? (dec n)))))
20:49technomancylsdafjklsd_: you should see the version with pattern matching
20:49lsdafjklsd_how does it get to false? if it isn't true wouldn't it be nil?
20:49xeqipaste
20:50lsdafjklsd_technomancy: where is that version? btw your clojure contributions are amazing, thank you!
20:50TimMclsdafjklsd_: Walk through it (by hand, or just by looking at it) with 0, and then with 1.
20:51TimMcAlso read up on proof by induction. :-)
20:51lsdafjklsd_TimMc: yea I get lost when it goes from (not (is-even? dec 5)
20:51technomancylsdafjklsd_: thanks. I don't have any particular implementation in mind; just pointing out that it's much shorter that way
20:52brainproxylsdafjklsd_: the trick is all the "nots" piling up
20:53TimMclsdafjklsd_: If I tell you that is-even? is correct for n from 1..x, then you don't need to recurse past x. I then ask you how to find out if x+1 is even. What's a way of finding out using the tools at hand?
20:56lsdafjklsd_brainproxy: ahhh so it ends up being like (not (not (not (not true))))
20:57hyPiRionexactly :)
20:57lsdafjklsd_that is amazing
20:59hyPiRion,(let [even? (partial nth (iterate not true))] (map even? (range)))
20:59clojurebot(true false true false true ...)
21:11dcbtpope: I asked you a couple days ago about getting an ABRT signal in VIM with foreplay. I am reasonably sure I narrowed it down to https://github.com/kien/ctrlp.vim, the weird thing is that plugin doesn't have any ruby
21:12tpopedcb: I only vaguely remember. is this a consistently reproducible problem?
21:12dcbKind of. It only happens rarely, I
21:12dcbtpope: I'd estimate once in about 25 :Eval
21:12tpopeI have ctrlp installed don't really use it
21:13a|ihow fast is clojure xml parser, compared to other jvm xml libs?
21:14tpopedcb: someone sent in a patch today to add support for the python interface. you could try that (you'll have to delete the if has('ruby') stuff from the nrepl adapter in order for it to kick in)
21:16dcbtpope: OK, I'll try that. Thanks
21:16tpopedcb: report back after you've put it through its paces. I'm willing to consider giving it priority over the ruby one
21:17dcbjust to be clear your talking about the block starting line 198 here: https://github.com/tpope/vim-foreplay/blob/master/autoload/nrepl/foreplay_connection.vim
21:18tpopedcb: yeah, delete from that through the endif
21:18dcbtpope: OK, will do
21:21a|iwhy would clojur ebe 10x slower than java? http://benchmarksgame.alioth.debian.org/u64q/clojure.php
21:23technomancya|i: because the alioth benchmarks are not accurate?
21:23technomancyit's just a game
21:23a|itechnomancy: what do you mean not accurate? the code is there, you can run it on your machine.
21:23technomancythey measure who has had the most time to waste playing the game and are completely unrelated to real-world issues
21:24technomancya|i: "which language is faster?" is a stupid question
21:24technomancyspeed is not a property of a language but of a program
21:24a|itechnomancy: well, the charts say c is the fastest, and it's true in most of applications.
21:24technomancy"which program makes it easier to write fast programs" is a more interesting question, but it's not the question that the alioth benchmarks ask
21:24a|iit doesn't have to be 100% accurate, but it gives to the big picture.
21:25technomancyit gives *a* big picture
21:25technomancybut not one that is helpful in making actual decisions
21:25a|iback to my question, clojure compiles to jvm bytecode, why would it be slower than java?
21:26technomancybecause clojure people have better things to do with their time than waste it on games?
21:26technomancyor if they do, they'll waste it on games that are actually fun =)
21:26mjcif you spent several hours expanding out what exactly "it" means in that question, you might be able to answer it
21:27technomancymaybe if Alioth added boss battles and experience points they'd get better submissions =)
21:27clojurebotexcusez-moi
21:27a|itechnomancy: would you say the same as what you just sais, if clojure results were faster than java in shootout?
21:28technomancyI don't care about the shootout
21:28technomancyOCaml is my second-favourite language, and it usually beats nearly everything but C
21:28technomancyall that means is it's possible to write fast code in it
21:29technomancydoesn't mean it's easy or worthwhile
21:29technomancyand the lack of a fast alioth entry has nothing to do with whether it's possible
21:51bpra|i: fyi, i have looked at some of the alioth clojure code... much of it is *horrendous* from a perf point of view
21:51a|ibpr: aren't those codes maintained by community? don't people submit changes?
21:52bpra|i: and, as technomancy was saying, i have no interest in write code that's "better" for alioth
21:52bprwriting*
21:53a|iwhy not.
21:53xeqinothing wrong with games, keep meaning to pickup xenoblade again since I paused halfway through it
21:53bprI can make $$ doing other things is one reason. I'm not interested is another.
21:54bprFurther, technomancy's point that performance is a property of a program and not a language is valid
21:58djwonkperformance is a combination of expectations, program, language, hardware, and space-time.
21:58djwonki was joking about space-time but there is the usual space vs. time tradeoff
22:04bbloomis there a trick to getting reduced to produce a lazy sequence? is it just cons and lazy-seq ?
22:05bblooms/reduced/reduce
22:12TimMcbbloom: I'm trying to imagine what that would look like.
22:12TimMcYou don't mean reductions, do you?
22:12bbloomTimMc: i'm staring at reductions right now trying to see if that makes any sense to me :-P
22:13bbloomi know what the reductions function does, but it's not what i need precisely
22:13bbloomconsider implementing filter in terms of reduce
22:14bbloomi think i just want manual recursion with lazy-seq instead of reduce
22:14TimMcYes.
22:14TimMcDefinitely.
22:14TimMcPut down the stick and back slowly away from reduce.
22:14bbloomhaha
22:22TimMcOh dammit, "°" doesn't transmit well over SMS...
22:34djwonkare macros generally required (instead of functions) if I have behavior that involves not evaluating an expression based on a condition? currently, I'm doing a lot of if … throw that feels like boilerplate.
22:34muhooreducers are pretty cool
22:35TimMcdjwonk: Control flow, delayed eval, etc. Yeah.
22:35TimMcBoilerplate.
22:36djwonkTimMc ok, I was trying to put off writing my own macros until I felt the pain . now I do
22:36TimMcDo you have experience with them in some other lisp?
22:37djwonkTimMc nope. I've read the O'Reilly book and the PragProg book, so I think I'll do ok
22:37TimMcJust repeat this mantra: "Macros are syntax transformers; they do not see runtime values." and you'll be OK. :-P
22:38TimMcIt's surprisingly hard to keep that in mind.
22:38djwonkthanks
22:40djwonkhmm, I may not need one yet after all. though I look forward to
22:40bjathis happens to me at least once a day: "that seems stupid, why doesn't core just do [partial solution to problem]?" *goes to ask in IRC* .... maybe I should think this through one more time ... *enlightenment*
22:43TimMc~#19
22:43clojurebot19. A language that doesn't affect the way you think about programming, is not worth knowing. -- Alan J. Perlis
22:44djwonk~#42
22:44clojurebot42. You can measure a programmer's perspective by noting his attitude on the continuing vitality of FORTRAN. -- Alan J. Perlis
22:55djwonk,(->> "FORTRAN" (map int) (map str) (clojure.string/join) read-string)
22:55clojurebot70798284826578
22:55djwonk~#70798284826578
22:55clojurebot#<RuntimeException java.lang.RuntimeException: java.lang.NumberFormatException: For input string: "70798284826578">
22:56gtrakre cljs: is there a better way to inspect js objects than the js console log?
22:57ibdknoxgtrak: browser or node?
22:57gtrakbrowser
22:57ibdknoxno
22:57bjaalert?
22:58gtrakjust finally playing around with it :-D, I feel a bit naked without code-follow and introspection.
22:58gtrakbut browser-repl is mostly fun
23:00muhoowasnt' a new version of fortram what guy steele was working on?
23:00muhoo*fortran
23:01muhoothe project got shut down, iirc, but not before he made that presentation that inspired rhickey to write reducers
23:01brehautfortress
23:01brehauthttp://en.wikipedia.org/wiki/Fortress_(programming_language)
23:06gtrakmuhoo: from what I gather, fortran sucks as a language, but there was a lot of work later on into parallelizing it. It's used for heavy numerical code.
23:09djwonkI'm glad to see http://www.infoq.com/presentations/What-Sucks-about-Clojure-and-Why-You-ll-Love-It-Anyway mentioning Clojure's unintuitive compilation units
23:10gtrakwhat's unintuitive about it?
23:10TimMcI don't find it unintuitive, per se... just overly restrictive.
23:11djwonkok, well, most programmers 'intuitively' read top to bottom.
23:11djwonkas do most people
23:11gtrakah, yea. I guess so. I learned on C first, so it made sense to me.
23:12TimMcHmm, my program has either learned Chinese or has a bug.
23:12TimMcI'm going with the former. :-D
23:12ppppaulhey guys, i'm having issues with ring responses
23:12djwonknot to start another round (we chatted yesterday about it) but it is cool to see someone with way more experience than I still admitting that it is painful. many people just bury the pain and/or rationalize it away
23:13djwonkand there are some cool ideas in that section; for example, transactional code loading
23:13ppppaul (-> (response {:conflict key})(status ,, :409)) is returning a body that contains :body :status :headers...
23:13gtrakdjwonk: I find it more weird to deal with watching the error count go down from 1000's to zero when java compiles in eclipse, then sometimes it just gives up and trashes your project.
23:14gtrakI think most folks just complain about the early-binding aspect of it.
23:14jonasenkovas: {:op :interrupt} is broken, but I'm working on it :)
23:15djwonkgtrak: what do you mean by complaints about early binding?
23:16gtrakI think python's got a similar top-to-bottom read strategy, but you can call functions defined below without an error, because the names are resolved at runtime
23:16gtrakclojure opts to be fast and doesn't do that
23:17gtrakI don't mind so much, because I think it adds some consistency
23:17tmciverppppaul: (-> (response {:conflict :key}) (status 409)) works for me.
23:18tmciverppppaul: gives: {:status 409, :headers {}, :body {:conflict :key}}
23:18djwonkgtrak: yeah, I think there are good reasons for the way compilation happens. still, when it comes to reading a library (with my eyes) I want the high level at the top
23:18djwonkwith more experience, I might have some ideas on how to do both, but as of now, I got nothing
23:19ppppauloh, i misunderstood how try/catch was working and i was doing (response (response))
23:21kovasjonasen: cool
23:22kovasjonasen: I'm also thinking of writing the UI in some form of AngularJS
23:22jonasenkovas: that would be interesting
23:22kovasjonasen: seems like a good way of representing components
23:22gtrak(defmacro erujolc [& body] `(do ~@(reverse body)))
23:23jonasenkovas: would we switch to JSON on the wire?
23:23jonasenor still use EDN
23:23kovasjonasen: edn still
23:24jonasenkovas: cool
23:24kovasjonasen: but it should be possible to simplify the loading and communications process
23:26jonasenkovas: Would you still be using ClojureScript?
23:26kovasjonasen: definitely
23:27jonasencool, I haven't seen any AngularJS/ClojureScript examples.. Have you tried anything yet?
23:27kovasI've found 2 examples
23:27kovasbut none of them introduce any higher level abstractions
23:27kovasjust js interop
23:27kovasi think introducing a custom reference type will get the job done
23:28djwonkgtrak: my 'ideal' macro would extract all def's and pre-declare them so order did not matter
23:29kovasjonasen: https://gist.github.com/3856153
23:29TimMcdjwonk: You could probably do that with little effort.
23:29djwonkTimMc: that would be cool. I will try.
23:29kovassome macros can also help clean things up
23:30tomoj(defmacro foo [] `(def ~'foo 3)) (foo)
23:30tomoj?
23:30TimMcIt could bail out if it sees any non-defn top-level forms.
23:30jonasenkovas: Could you give a quick overview of session terminology, specifically the difference between Session/Subsession/Loop?
23:30djwonkTimMc: is there any way to keep current indentation -- everything would need to be nested, right?
23:31kovasjonasen: the subsession was intended to accommodate multiple evaluators, for instance both clj and cljs at the same time
23:31gtrakdjwonk: doubtful without some sort of mutable stack on a reader
23:31jonasenkovas: I'd like to know which of these map closest to a nrepl session (unfortunate clash of terminology)
23:31TimMcdjwonk: Oh, you want to print out a new version of the source? That's not going to do what you want.
23:32kovasjonasen: we are gonna get rid of the subsession
23:32TimMcYou'd need a reader-sugar-preserving syntax transformer.
23:32jonasenkovas: ok.
23:32kovasjonasen: its just a historical artifact, from porting my original document-based session to datomic
23:32jonasenkovas: Maybe we could make Session Session == Nrepl Session?
23:32djwonkTimMc: that would be cool, but Clojure doesn't allow that, does it?
23:33TimMcNope. Some folks are working on libs for tha, I think.
23:33kovasjonasen: yeah thats an issue also on my mind
23:33kovasjonasen: the way i look at it now
23:33kovasjonasen: session is a computational model currently with 3 interfaces
23:34kovasjonasen: datomic, nrepl, and human UI
23:34kovasjonasen: if you speak any of those things, you can participate in session
23:34kovasjonasen: but I don't want to close the door on other APIs
23:35kovasjonasen: the main question right now is, should nrepl be hidden behind a more general interface/schema, or exist on its own as a top-level thing
23:35kovasjonasen: and I'm not sure yet
23:36jonasenkovas: ok.
23:36kovasjonasen: it would be interesting to see what other interfaces would look like. For instance to S3, or a seesaw UI
23:37kovasjonasen: in any case, positioning session as a kind of nrepl serialization middleware would be appealing to a lot of people i think
23:38kovasjonasen: they can just continue using emacs for now, and have stuff logged in the background, and then later graduate to the web UI for plotting etc
23:39jonasenkovas: yes, I think a solid web interface to nrepl would be useful thing
23:40kovasjonasen: I'm pretty close to being able to use session at my job
23:40kovasjonasen: which would be great since then i'll have more time to work on it :)
23:40jonasenkovas: awesome!
23:41tomoj"session"...?
23:41kovastomoj: https://github.com/kovasb/session
23:41tomojthat was a complaint, but an unjustified one, since google found that repo for "clojure session"
23:41tomojsurprisingly..
23:41kovashaha
23:42kovasyeah jonasen and i have been hacking the last couple of weeks
23:43jonasenkovas: I gotta run... christmas vacation is now officially over :(
23:43kovasjonasen: same here :/
23:43kovasadios!
23:58TimMcHey, I can't find -?> in 1.4.0 -- did it get removed?
23:58gtrakin incubator?
23:59TimMcI don't see incubator.
23:59TimMcOh, it's a contrib? Bleh.
23:59tpopeyou mean 1.5.0?
23:59tpopeoh
23:59dog_cat11&(reduce + [1 2 3 4 5])
23:59lazybot⇒ 15