#clojure logs

2013-05-04

01:27tomojambrosebs: btw, ##(:tag (meta #'*out*))
01:27lazybot⇒ java.io.Writer
01:28ambrosebstomoj: whoops.
01:28ambrosebstomoj: sorry *out* :)
01:29ambrosebstomoj: I realised I was trying to get to .write, and I needed to pass a tagged ^chars as a first argument to resolve the method.
01:39muhoois cljx the current state of the art until feature expressions get implmented? or is lein-cljsbuild crossovers recommended instead?
02:10muhoough, on another note: https://www.refheap.com/paste/14193
02:10muhoothanks, jdbc, for telling me there's a syntax error, but not showing the actual (generated, i guess) syntax that has the error in it.
04:06muhoowow, finally got an sql insert working with jdbc/postgres/clojure. unbelievable.
04:07muhoojdbs sure hates the inet datatype in postgres though :-(
04:27avishaihi
04:28avishaii'm trying to use doseq to iterate over a vector of functions
04:28avishaie.g. (doseq [m [function1 function2 ....]]
04:29avishaithen inside i do (:name (meta m))
04:29avishaiand i get nothing
04:29avishaiso i guess when doseq binds it doesn't copy metadata?
04:30avishaior do i need (var m) ?
04:34pyrhi guys, is there any reducer based sort implementation to look at anywhere ?
04:49pyrfold seems to be a candidate
04:56noidiavishai, when you create a function using defn, the metadata is attached to the var and not the function object
04:56noidi,(meta +)
04:56clojurebotnil
04:56noidi,(meta #'+)
04:56clojurebot{:arglists ([] [x] [x y] [x y & more]), :ns #<Namespace clojure.core>, :name +, :column 1, :added "1.2", ...}
05:29thm_proverwhen building a gui in clojure
05:29thm_proverwhat are the tradeoffs vs using eclipse vs netbeans gui elements?
05:34thm_proveris there anyway to use netbeans components from within clojure?
10:56learner_Hello fellow Clojurians. I have a quick question, hope you guys can help. I am running a loop on a number of combinations (loop runs for 24hours), and for every run it updates an atom (which is tracking the run count). I executed the program using lein run. Now in the middle of the process, would it be possible to get the run count without killing the program? Any hints, help is much appreciated. cheers
10:57bbloomlearner_: is the atom in a var? or in a local variable?
10:58axle_512learner_: I believe that if you run the expensive looping code as a future from the repl, you can then use the repl to display the value of the atom whenever you want.
11:04learner_bbloom: atom is a variable (global level)
11:05learner_axle_512: I see what you mean, but unfortunately the loop is running now (triggred using lein run) and breaking it a bit of pain!
11:07axle_512learner_: I've never tried this, but it _might_ work for you. https://github.com/djpowell/liverepl
11:08axle_512learner_: If you could somehow attach a repl to your running JVM, then you may be able to inspect variable, etc.
11:08learner_axle_512: Good resource. I will give a try. Thanks for your time mate.
11:09tomojwow
11:10axle_512learner_: no problem, hope it works for you.
11:10tomojno deps at all required for liverepl?
11:10tomojthat is pretty impressive
11:10Okasulearner_: Can you report back your experience with liverepl, please?
11:11learner_Okasu: Will do definitely
11:11OkasuThanks, it'll be interesting.
11:12axle_512I don't know for sure, but I have a hunch the liverepl uses java's attach api
11:13axle_512there's a similar "groovy" tool that connects to a running java (or JVM) process, called "crash". http://www.crashub.org/ http://www.infoq.com/news/2012/06/crash-shell-1
11:13axle_512crash definitely uses the java attach api.
11:18axle_512ok, I think I confirmed that liverepl is using the attach api (com.sun.tools.attach) here https://github.com/djpowell/liverepl/blob/master/liverepl-agent/src/net/djpowell/liverepl/client/Main.java
11:31learneraxle_512: Your guess is correct live REPL using java attach API ref https://groups.google.com/forum/?fromgroups=#!topic/clojure/2Oh-XRXp1Qg
11:32axle_512learner: ah, very cool!
12:00learnerHow come nobody is discussing anything? is everybody using private chat?
12:01axle_512learner: I guess its quiet because it's the weekend?
12:02learneraxle_512: Oops. I forgot that for a minute! Sorry
12:03axle_512learner: Honestly I'd think weekend chat would be quite active, really. Not sure why it's so quiet.
12:03axle_512learner: any luck with the live repl?
12:03learneraxle_512: I see
12:04learneraxle_512: Didn't try yet mate. Just preparing for a PROD release (sorry, it's a trouble for all Londoners). Will try sometime tomorrow
12:07learneraxle_512: I am off now. I will come back to update you about liverepl. Meanwhile enjoy your time
12:07axle_512learner: thanks, you too
12:07learneraxle_512: Cheers
12:35nkozawhy this destructuring works: (let [{:keys [x z]} '(:x 3 :z 9)] [x z]) ;=> [3 9] ... but this doesnt? (let [{:keys [x z]} [:x 3 :z 9]] [x z]) ;=> [nil nil]
12:39nkozaok, I got it, the vector is associative, nevermind :)
13:16ppppaulany of you smart people have experience with mapping?
13:16hyPiRionmapping?
13:16hyPiRion,(map inc (range 10)) ; you mean?
13:16clojurebot(1 2 3 4 5 ...)
13:16hyPiRionor from one domain to another?
13:17TimMcOr GIS?
13:17ejacksonit requires only 4 colours - so I'm told ;)
13:18ppppaulGIS
13:18ppppauli'm trying to convert coords and i'm really lost
13:18TimMcejackson: Unfortunately, not true for real geography.
13:18ppppauli have NAD27 data for canada, and i want to convert that to lat/lon
13:18ppppauli found some converters in JS, but they were a mess
13:25nkozathere is some kind of let that you can use inside a thread macro? I mean, something like (-> 3 (mylet myvar (+ myvar 4))) ;=> 7 , where mylet expands to (let [myvar 3] ....)
13:29ppppaul(when-let
13:29ppppaul(if-let
13:29gdev(out-let
13:29ppppaul,(doc out-let)
13:29clojurebotI don't understand.
13:29TimMcejackson: https://en.wikipedia.org/wiki/Enclave_and_exclave
13:29gdevmust've only been in contrib then
13:30ppppaulnkoza, that looks hard to understand
13:31gdevnkoza:) still having a hard time seeing why it couldn't just be a function
13:31ppppaulare you going to keep threading the let?
13:31nkozaI want to thread a let
13:32gdev,(doc thread-let)
13:32clojurebotNo entiendo
13:32ppppaulmake it a fn
13:33nkoza(-> 3 (mylet x (/ (+ 1 x) x) str) will expand to (str (let [x 3] (/ (+ 1 x) x))
13:34nkozaI see a mylet macro is possible to do, but I want to know if there is something equivalent in the standard lib
13:34ppppaul not that i know of
13:34gdevme neither
13:35hyPiRion,(as-> x 3 (/ (+ 1 x) x) (str x)) ;?
13:35clojurebot#<Exception java.lang.Exception: Unsupported binding form: 3>
13:35hyPiRion,(as-> 3 x (/ (+ 1 x) x) (str x)) ;?
13:35clojurebot"4/3"
13:35ppppauloh wow
13:35ppppaulthat is new
13:35TimMcgfredericks: Proposal: rename `if` to `iff`.
13:36ppppaulneeds more f's
13:36ppppaulwhy iff?
13:36gdevif and only if
13:36ppppauli know that
13:36gdevppppaul:) k, can never be too sure
13:37ppppauli forget the meaning though..
13:37ppppaulbeen a while since school
13:37gdev$google iff
13:37lazybot[International Flavors and Fragrances] http://www.iff.com/
13:38gdevlol nope
13:38gdev$google logical iff
13:38lazybot[If and only if - Wikipedia, the free encyclopedia] http://en.wikipedia.org/wiki/If_and_only_if
13:43gdevTimMc:) is that to say that in Clojure "if" statements are more constrained than a normal logical if?
13:45hyPiRion,(if true (print "foo") (print "foo"));?
13:45clojurebotfoo
13:46hyPiRionIf and only if true is truthy, print "foo".
13:46hyPiRionDoesn't make sense, as I read it
13:47gdevthe truth table for that statement is just all ones
13:50gdevhyPiRion:) point taken though
13:51hyPiRionyeah, replace true with x or something
13:52gdev,(let [x true] (if x (print "false") (print "false")))
13:52clojurebotfalse
13:58TimMcgdev: Yeah, here I am, just knowing some basic logic... how am I to know that (if foo? a b) won't sometimes eval a even if foo? is false.
14:03Chousukeiff doesn't work like that does it
14:04Chousukeiff x y means that y is only true if x is true and x is only true if y is true.
14:04gdev,(= *)
14:04clojurebottrue
14:05axle_512,(inc chousuke)
14:05clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: chousuke in this context, compiling:(NO_SOURCE_PATH:0:0)>
14:05Chousuke:P
14:05gdev(inc Chousuke)
14:05lazybot⇒ 2
14:05axle_512thanks gdev
14:06Chousukegdev: that behaviour of = is to enable eg. (apply = somevector) for checking if all elements are equal
14:07gdevChousuke:) I know I was just printing true to agree with your statement aboot iff
14:07Chousukeheh
14:07Chousuke,(=)
14:07clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: core$-EQ->
14:08Chousukehm, it might make sense for that to return true as well :P
14:15gdevChousuke:) = will only return a result if and only if it has an argument passed to it
14:16gdevChousuke:) see Swearjure for more crazy forms like that
14:18TimMcIf I were godking of Clojure, more of these basic functions would have nullary and unary base cases defined.
14:19hyPiRion,(-> = =)
14:19clojurebottrue
14:22gdev,(#(`[~@%&] 1) 1 true 3 4)
14:22clojurebottrue
14:23xeqiare there any guides for how clojure's class generation works?
14:24gdevxeqi:) they're compiled at different times based on what form you use
14:25hyPiRion,((-> [+ *] #(*)) 1 true)
14:25clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: �# in this context, compiling:(NO_SOURCE_PATH:0:0)>
14:26hyPiRion,((-> [+ *] #(*)) 1 true)
14:26clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Boolean cannot be cast to clojure.lang.IFn>
14:26hyPiRionboo, right
14:26hyPiRion,((-> [+ *] #(-> *)) 1 true)
14:26clojurebottrue
14:27xeqiheh, I suppose I was thinking about :aot class generation, but I do need to better collect my thoughts
14:28gdev,(let [^ = _ 1] (-> ( ^ _^)))
14:28clojurebot#<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>
14:28gdev,(let [^ = _ 1] (-> ( ^ _ ^ ) ) )
14:28clojurebot#<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>
14:29gfredericksgdev: I don't think ^ is a valid symbol
14:29gdev,(let [^ - _ 1] (-> ( - _ - ) ) )
14:30clojurebot#<NoClassDefFoundError java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT>
14:30hyPiRion^ never is
14:30hyPiRion,\^
14:30clojurebot#<NoClassDefFoundError java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT>
14:30hyPiRion,1
14:30clojurebot#<NoClassDefFoundError java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT>
14:31gdev,(let [- = _ 1] (-> ( - _ - ) ) )
14:31clojurebot#<NoClassDefFoundError java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT>
14:31gfrederickscan anybody explain why on earth this commit does anything? https://github.com/clojure/java.jdbc/commit/d7e77cce67e6b07bf7a4ad20385b58960fd6bbe0
14:34gdevgfredericks:) looks like its just an aesthetical change for clarity, since the word connection gets tossed around in DB libs, this makes it clear where this one is coming from
14:35gfredericksin the context of the project it was the entirety of a patch release
14:35gfredericksso it must mean something to somebody
14:35gdevgfredericks:) does the "connection" in [:keys [connection factory connection-uri] refer to the sql.connection or a java.jdbc.connection?
14:36gfredericksseancorfield describes it as "a small but critical flaw"
14:37gdevgfredericks:) that's what leads me to believe it might have been some sort of shadowing or clobbering or something like that
14:37gfredericksthe commit message mentions macros, which suggests that somehow the typehint could be compiled in another namespace and get interpreted differently
14:38gfredericksbut that would be a surprising possibility I think
15:51gdevis there a way to reload dependencies in the repl? i'm in emacs i updated my project.clj file and I don't want to shut down nrepl and restart it
15:54gfredericksI believe not.
15:54gfredericksI don't think the classpath is mutable that way
15:54gdevmkay, thanks
15:54ShawnMcCoolhow long did it take you to start seeing things clearly when working with clojure?
15:55n_bgdev: There's pomegranate https://github.com/cemerick/pomegranate
15:55n_bit's apparently not great, but it does exist. YMMV
15:56ShawnMcCooli'm having to really spend a lot of time looking at my code to make sure that there's the appropriate number of parens and really even to understand it. i'm new to lispy style parens and i'm just curious. at some point in time do you develop the eye to just 'see' the code as i might see java or c#?
15:56gfredericksShawnMcCool: you can definitely expect that yes
15:56n_bShawnMcCool: Ignore the parens, look at indendation. And get Paredit/some sort of structural editor
15:56gfredericksI don't remember how long that took for me. I think I was comfortable for a while before I was confident (which came after a couple years)
15:57hyPiRionIt didn't take that long for me
15:57n_bIt took me about ~1.5mo to ignore the syntax, 4clojure helped learn many idioms
15:57n_bIRC taught me even more, and continues to show me new stuff every day
15:58gfredericks(inc #clojure)
15:58lazybot⇒ 2
15:58ShawnMcCoolthanks everyone, appreciate the feedback
15:58n_bWhat books have you read, if any?
15:59gdevn_b:) thanks, pomegranate was exactly what I was looking for
15:59ShawnMcCooli'm working on Clojure Programming by Chas Emerick
15:59ShawnMcCoolit's a very big departure for me
15:59n_bThat's the best for beginners. I read that, played with Clojure heavily for a month, then read JoC
15:59hyPiRionGood choice at least.
15:59gdevShawnMcCool:) what's your native language(s)
16:00ShawnMcCoolI'm most familiar with C#, Python, and PHP these days
16:00ShawnMcCooloccupationally
16:00gfredericksit's a proven fact that nobody has ever learned clojure and regretted it
16:01ShawnMcCoolI'm finding it very compelling.
16:01ShawnMcCooli'm at a snack bar and my old lady and my frites are ready. better get home. but thanks very much for the feedback. I'll be back.
16:01akhudekgfredericks: except that one guy on hacker news who is upset it is not CL
16:02n_bakhudek: and posts in every thread about Clojure not being a proper lisp?
16:02akhudekyes
16:03n_bmy roommate and I call him Clojure's mchurch
16:03gdevmy only regret is I'm the only one in my shop that took the red pill, everyone else is still in java land...it's so lonely =(
16:03n_bI regret learning clojure because I now loathe working on older Ruby code
16:03PupnikI wonder... if you wanted to script Unity with Clojure... would you be better using Clojure on mono or Clojurescript!?
16:03gdevthen there are those who tried to take the purple pill, scala, but choked on it and threw it up
16:04n_bMy problem with Scala is that the community seems split between people who want a slightly nicer Java, and those who want Perl8
16:04Jambatowhat is perl 7?
16:05gdev$google perl7
16:05lazybot[Perl 7 | Ovid [blogs.perl.org]] http://blogs.perl.org/users/ovid/2013/02/perl-7.html
16:06JambatoI thought it was a joke
16:07Jambatooh wait
16:07Jambatoit is
16:07n_bwhich part?
16:08Jambatothe paerl 7 part
16:10n_bI actually believe that was a serious consideration, the Perl release cycle has been rather convoluted
16:16gdevugh, database programming on sunny saturday afternoon. clojure...not even once
16:28gdevtdd database application, what could go wrong?
16:29gdevlazybot:) fortune
16:35shadow_princesomeone can write macros with body like (first arg)? can't get trought it
16:36gdev$google trought
16:36lazybot[trought - Traducción al español – Linguee] http://www.linguee.es/ingles-espanol/traduccion/trought.html
16:37gfredericksit takes a lot of self control to at least google something before asking a question here
16:38shadow_princeI google three guides, but can't write this
16:38gfredericksshadow_prince: I don't think your question was very clear. (defmacro foo [arg] (first arg)) is a valid macro.
16:40shadow_princeThanks, I shall read about quoting in lisp /o
16:49gdevgfredericks:) ermahgerd that meta dash dash is nice
16:52amalloygfredericks: why M--? as far as i can tell that's calling it with a prefix-arg of -1, right? it looks like it doesn't care what the prefix arg is, so C-u would be the traditional way to do that
16:52gdevokay, i did M-- c-x c-e on (print (range)) is that bad?
16:52amalloygdev: no, as long as you have infinite RAM you should be okay
16:52gdevamalloy:) how do I make it stop???
16:52lazybotgdev: How could that be wrong?
16:53amalloytry C-g, like anything else in emacs
16:53amalloyif not that, i dunno, shut off emacs or the computer
16:55gdevcrisis averted
16:58gdevi was wondering if it would do elipsing for infinite sets, the answer is nein
16:58amalloyif you set *print-length* it would
17:01gdevthis is one of those i should've had emacs running in daemon mode
17:06gfredericksamalloy: I don't know enough about emacs to know that C-u did that
17:06gfredericksC-u is much easier
17:07gfredericksthis is why I announce to #clojure whenever I think I know something
17:07amalloyhaha
17:07amalloy(inc gfredericks)
17:07lazybot⇒ 21
17:08gfrederickswhen I saw the number 21 the first thing I thought of was mentioning it was a semiprime. The second thing was that it's the american drinking age.
17:50msull92Would anyone like to give me some feedback on my newish library? https://github.com/msull92/wiggle
17:52amalloymsull92: it looks like a version of hiccup that is painful to use and much less performant
17:52amalloyand the README is belligerent for no particular reason
17:54msull92Thank you
17:54learneraxle_512: Okasu: bbloom: liverepl is working well guys. Thanks for all your help
17:54amalloyseriously though, if this is the kind of interface you want, msull92, check out hiccup. you'll probably like it
17:57msull92I did see hiccup, but I wanted I was attempting to teach myself more about Clojure by making my own library
17:58justin_smithlooks like the entire library consists of one four line function
18:00justin_smith(apply str (for [chunk content] chunk)) = (doall (apply str content)) yes?
18:00Bronsano need for the doall
18:01justin_smithok, so (apply str (for [chunk content] chunk)) = (apply str content)
18:01justin_smithI have seen str turn my lazy seqs into "lazy seq blah", but maybe apply takes care of that
18:02Bronsa,(str (take 3 (range)))
18:02clojurebot"clojure.lang.LazySeq@7480"
18:02Bronsa,(apply str (take 3 (range)))
18:02clojurebot"012"
18:03justin_smithanyway, beyond the fact that so much was shoved into one line of code, that is all there is I see to comment on
18:03Bronsa,(str (list* (take 3 (range))))
18:03clojurebot"(0 1 2)"
18:06justin_smithso yeah that second for is a noop
19:03lynaghkdnolen: ping
19:05amalloyjustin_smith: it occurs to me that in a functional language, every function is a no-op: perhaps we ought to call (for [x xs] x) an identity instead?
19:05justin_smiththat would be better stated, yes
19:05arrdemamalloy: how so a no-op? without a decent optimizer computation will still be performed.
19:06arrdemamalloy: identity certainly
19:06justin_smithI was the one who called it a no-op
19:06justin_smithbut I meant identity operation
19:07arrdemjustin_smith: ok cool
19:07amalloyarrdem: it's all just philosophical faffery, really
19:10arrdemfrick I can't spell
19:11justin_smithfattery is when you are very bad at flattery
19:11arrdemamalloy: understood I'm just being nitpicky about ops due to writing a compiler ATM
19:11arrdemjustin_smith: well played sir
19:15justin_smithI am trying to remember, which core function is basically #(filter nil? %)
19:16shadow_princeunderstanding lisp features blow my mind. again
19:16shadow_princetime to sleep
19:17justin_smithsorry, I meant #(remove nil? %)
19:17shadow_princewhere-not nil?
19:18shadow_princeoh, nope
19:18justin_smithI think you mean when-not - and not quite
19:19justin_smithno big deal, I can do a remove nil, I was vaguely remembering another function that basically did that though
19:21dnolenlynaghk: pong
19:41lynaghkdnolen: ping ping!
19:41lynaghkman, have too many emacsen going on
19:41dnolenlynaghk: hey
19:41lynaghkdnolen: this is a shot in the dark, but I just tried the latest cljs build and it looks like key destructuring of JavaScript objects is broken in adv. compilation
19:42lynaghkthought I'd ask you if you had any ideas
19:42lynaghk(i.e., if I implement ILookup on js object and then destructure)
19:42lynaghkthe object itself has the correct property names, so my guess is that cljs is generating non-string-based accessors from the destructuring form and those are getting optimized away
19:43dnolenlynaghk: hrm, are implement ILookup on js objects by extending to default?
19:43lynaghkdnolen: https://github.com/lynaghk/todoFRP/blob/master/todo/angular-cljs/src/cljs/todo/util.cljs#L89
19:45dnolenlynaghk: that really should be default, but yeah I may have screwed things up.
19:45lynaghkdnolen: why default vs object?
19:46dnolenlynaghk: oh hmm, I didn't think there was an object case, only default
19:47lynaghkdnolen: this just came up a few hours ago, so I haven't had time to put together a minimal case to look at all of the generated code and figure it out
19:47lynaghkdnolen: I just thought I'd run it by you in case it was something obvious
19:48dnolenlynaghk: nope I messed things up when I was optimizing code size things
19:48dnolenlynaghk: fixing now and will push to master, add tests and ping clojure-dev for another CLJS release
19:48lynaghkdnolen: thanks!
19:49lynaghkdnolen: I'm going to be in your neighborhood in August for Hacker School---I'll have to get you a drink
19:50dnolenlynaghk: I heard! will be fun!
19:50tomojis angular in there as a non-FRP baseline? :P
19:50lynaghkdnolen: yeah, I'm really looking forward to this summer. We're finishing up some client work this month and I'm taking a sabbatical to explore a lot of fun stuff
19:50dnolenlynaghk: awesome
19:51lynaghktomoj: I'm not sure how all of this FRP stuff will turn out in the long run, but for now Angular.js is pretty much the best framework I've used, ClojureScript or JavaScript
19:58tomojlynaghk: that's probably true of me too (angular is probably the best I've used). but that doesn't make it functional
20:19dnolenlynaghk: try master
20:21dnolenlynaghk: email sent out to clojure-dev
20:33tomoj"All notions of value are about being able to directly perceive something and compare it to something else"
20:33tomojwhat does "directly" mean here?
20:33tomoj(that's from The Value of Values)
20:34gfredericksno hidden state?
20:34gfredericksor hidden identity material
20:34justin_smithwould an indirect perception be a speculation? (one speculates)
20:37tomoj"There can't be any operational interface over a value that tries to encapsulate what it means"
20:37tomojsame point?
20:37tomoji.e. operational interface <=> direct perception impossible?
20:38tomojgfredericks: ok, so what's "hidden"..
20:38justin_smithdoes <=> mean xor?
20:38tomojI mean iff
20:39justin_smithoperational interface would imply direct perception is what I would take out of those to lemmas together
20:40tomojhuh?
20:41tomojI think when I heard "directly perceive" the first time, I took it to mean basically "if you have a reference to a value, you can print a complete representation of its meaning, now"
20:41tomojwhere "directly" mostly corresponds to "now"
20:41justin_smithif a) one cannot use the concept of a value without direct perception, and b) there is no operational interface to encapsulation then c) operational interface implies direct perception
20:42justin_smith(assuming encapsulation is the absence of direct perception)
20:42gfredericksactually I never know what rich hickey is talking about
20:43dnolenlook like some Clojure async is brewing - http://github.com/relevance/clojure/compare/master...core-futures
20:43arkhis there a way to find out what a given Class implements / inherits from?
20:44dnolenarkh: at the REPL?
20:44arkhe.g. creating a connection in datomic returns a datomic.peer.LocalConnection, but I'm wondering what things it implements
20:44arkhdnolen: yes
20:44dnolen,(supers (class []))
20:44clojurebot#{clojure.lang.Sequential java.util.List clojure.lang.Counted java.io.Serializable java.lang.Iterable ...}
20:44dnolen,(bases (class []))
20:44clojurebot(clojure.lang.APersistentVector clojure.lang.IObj clojure.lang.IEditableCollection)
20:45arkhdnolen: awesome - thank you
20:49arkhand the async stuff looks nice
20:51n_b,(doc bases)
20:51clojurebot"([c]); Returns the immediate superclass and direct interfaces of c, if any"
20:52tomojwhat the heck is core_async?
20:53dnolentomoj: looks like Scala / C# style async support
20:56tomojoh, I found the tests. nice
20:58tomojbit worried whether it will be possible to get deterministic semantics on top of that foundation, but SSA is better than nothing :)
20:59tomojI guess you get deterministic semantics as long as you always only care about 'what' and never 'when'
21:02tomoj..so you can't use any?
21:11justin_smithssa?
21:11clojurebotssa is http://wingolog.org/archives/2011/07/12/static-single-assignment-for-functional-programmers
21:12justin_smith(inc clojurebot)
21:12lazybot⇒ 22
21:17tomojso an INotify is not a value, why?
21:18tomojbecause -attend is an operational interface?
21:18tomoj(alternatively, is an INotify a value?)
21:24justin_smiththat is interesting, and trying to work it out makes me realize I didn't actually understand what you were saying earlier
21:25tomojI guess if the f! and the executor don't make it operational, then I have no clue what "operational" means
21:25tomojbut what if you pretend the interface is then, instead of -attend?
21:25tomojthen-call I mean
21:25tomojstill an executor but..
21:39justin_smithhas anyone implemented a tail-call function/macro that would error like recur if not in the tail position, and implement general tail recursion?
21:39justin_smithie. n functions that each call one of the others from a tail position
21:40justin_smith*implement general optimization of tail calls
21:42Apage43a trampoline generator?
21:44gfredericksit is really weird to read "The phrase was coined by X in 1975..." and then think, "ah yes, X, he's keynoting at the conference this summer."
21:45justin_smithApage43: I guess so?
21:48akhudekgfredericks: who are you talking about?
21:49gfredericksMr. Sussman
21:49gfredericks1975 was 45 years before I was born
21:50s4muel...you're from the future?
21:50gfrederickswell I will be
21:51tieTYTsup guys
21:54justin_smithfrom the future, and admits it in the one place people are most likely to know how to use cancel-future? thems some gonads
21:54dnolenjustin_smith: https://github.com/cjfrisz/clojure-tco
21:55justin_smithdnolen: cool!
21:57justin_smithlooks in-progress and currently fairly limited though
21:57justin_smithit figures that that would be a huge infrastructural change to the language, it may be easier to just try to hack something up with trampoline
21:58justin_smithwe have a code base that really loves small functions as abstractions, and our call stacks get rediculous, to the point where it may start to be a problem soon
21:58justin_smith(if not already performance wise)
22:00dnolenjustin_smith: in what language?
22:00justin_smithclojure!
22:00justin_smithour heap usage is kind of crazy
22:01tieTYThow would I get rid of the dry violation here, ideally without involving a (let): (if (= "<Unset>" (config destination-button :text)) (:shortcut.dir filechooser-props) (config destination-button :text))
22:01justin_smitha bit part of that, I am speculating, is call stack with the nested environments waiting to return
22:01tieTYTI don't like how (config destination-button :text) is copied twice
22:01justin_smithif-let?
22:02tieTYTjustin_smith: can you show me how to use it that way?
22:02dnolenjustin_smith: well Clojure is filled w/ small functions itself and people don't complain too much if they have realistic expectations ...
22:02tieTYT(=) returns true or false, so I don't know how to use if-let like this
22:02justin_smithI could be on the wrong track
22:03justin_smithit is not just that there are lots of small functions, but that they call each other deeply (core clojure tends to use its primitives frequently, not build a high stack and keep building on the top ones)
22:06dnolenjustin_smith: I would use a profiler like YourKit to figure out what's going on
22:07justin_smithyeah
22:07justin_smithtieTYT: maybe some prettier version of this? (-> (config destination-button :text) (#(if-not (= % "<Unset>") % (:shortcut.dir filechooser-props))))
22:11redline6`I'm getting a FileNotFoundException trying to import some cljs from another cljs file. Can anyone tell me what I'm doing wrong? https://github.com/redline6561/cljs-6502/blob/master/src/cljs/addressing.cljs
22:14tomoj(extend-protocol IEquiv Promise (-equiv [o other] (and (instance? Promise other) (= @o @other))))
22:14tomoj(pretend it's some weird hybrid of clj cljs)
22:14tomojwhat is wrong with this?
22:14tomojother than that it might surprise the programmer
22:16muhoowhat's the convention for naming functions that cal functions that call functions that eventually have side effects? should they all have bangs in them, or only the one at the end of the chain?
22:17tieTYTjustin_smith: i don't think that's the same logic, but I could be wrong
22:17tomojone bang per nesting level :P
22:17tieTYTjustin_smith: oh nm, i see it now
22:17muhooin other words, if foo calls baz which call quuz, and only quux actually hits the db, should they be foo! baz! quuz! or just foo, baz quux! ?
22:18tomojhard to say there's actually a convention
22:18tomojconsider alter/commute
22:18tomojdeliver
22:19muhootomoj: i'm not familiar with that convention
22:20tomojI mean that even clojure core itself has some missing bangs
22:20tomojunless there's some more subtle convention I just don't see..
22:21muhoooh, wow, good point. alter should totally be alter! in that system
22:21justin_smithmaybe since alter only works in dosync?
22:22justin_smithon the other hand, dosync should definitely be dosync! by that convention
22:22muhooi dislike bangs, my code is alarming! enough! without! them! but i'm trying to do the right thing.
22:22justin_smithmaybe do* implies *!
22:24hyPiRionjustin_smith: no
22:24hyPiRiondosync by itself doesn't mutate anything
22:24hyPiRion,(dosync (+ 1 2))
22:24clojurebot3
22:26hyPiRionconsider set! and other functions ending with a bang as mutation without the need of perfoming such action within a transaction
22:27tomojjustin_smith: aha!
22:28tomojmaybe that's it
22:28tomojand deliver sort of isn't mutating anything
22:28tomojsince you can only do it once
22:29Apage43Mhm, promises are considered to have only one value, just one that may not yet be accessible
22:31tomojuh, wat. I realized a while back that lazy seqs are IPending
22:31tomojbut I didn't realize that this means the state of a lazy seq leaks out through realized?
22:31tomojso a promise isn't any less of a value than the rest of a lazy seq?
22:31tomojassuming a suitable interface..?
22:34tomojbbloom: dunno if you remember arguing that realized? makes promises less than values - got any other arguments?
22:39muhoo,(-> 1 ((partial str 3 2)))
22:39clojurebot"321"
22:40muhooa hack for dealing with a chain of -> when you need only one of the functions in the chain to accept the arg at the end
22:41xeqi&(-> 1 (->> (str 3 2)))
22:41lazybot⇒ "321"
22:43justin_smithmuhoo: yeah, I do that quite a bit, I pick ->> or -> based on which case is more common in the code, then use double parens and anon fns to match it all up
22:43gfredericks&(as-> 1 <> (str 3 2 <>))
22:43lazybotjava.lang.RuntimeException: Unable to resolve symbol: as-> in this context
22:43gfredericks,(as-> 1 <> (str 3 2 <>))
22:43clojurebot"321"
22:46justin_smithgfredericks: is as-> clojure 1.5?
22:48muhooreally?
22:49muhoofantastic! that's like swiss-arrows, integrated into clj core, thanks gfredericks
22:50seancorfieldSegFaultAX: yes, ppl do still use CFML (although in decreasing numbers these days) and i'm giving three talks at a 300 attendee CFML conference in MN in two weeks! :)
22:50s4muelSo. Hi all. I am very new to Clojure. I come from a background of... well, curiosity, and system admin / Ruby / Python, etc. When I learned Ruby someone smarter than me said 'you can get a lot done if you master the Array and Hash APIs' -- they were right. So I am curious, what constructs or 'features' of Clojure in particular are the equivalent, e.g. 'get to know "foo" really well, and you'll have a lot of power in your
22:50s4muel hands'? I realize this is a broad and somewhat loaded question, but any insight is appreciated.
22:51muhoowasn't linode hacked recently, and peple discovered they use CFML still?
22:51gfredericksjustin_smith: yes
22:51gfredericksmuhoo: you're welcome :)
22:52muhoos4muel: maps
22:52seancorfieldgfredericks: java.jdbc patch was indeed due to macro expansion problem reported by a user where the expansion could cause Connection to be referenced 'bare' in another ns which (obviously) had not imported java.sql.Connection... i was surprised too but i've had a few equally weird things happen with macros so i just qualified the type hint name
22:52seancorfieldnext time you see gdev you can tell them more detail :)
22:53tomojgfredericks: nice. how about %? too confusing?
22:53justin_smiths4muel: I would say {:key "value"} map conventions, and the various ways of building and using anonymous functions
22:53muhoos4muel: maps seem to be the center of clojure to me. i also am a linux sysadmin by training/temperament who is attempting to make the transition from ops to developer
22:53justin_smiths4muel: http://clojure.org/cheatsheet <- the stuff on this page is a very usable subset of the language.
22:53gfredericksseancorfield: so macros and typehints don't go well together?
22:53gfrederickstomoj: oh that's a nice suggestion; now I'm torn
22:54seancorfieldmuhoo: adobe coldfusion had a security flaw - but some folks use a free open source cfml engine which does not have that flaw
22:54seancorfielda jboss community project called railo, out of switzerland
22:54s4muelthank you muhoo, justin_smith :)
22:55seancorfieldgfredericks: apparently with-connection expands to a bare reference to Connection which causes problems
22:55tomojgfredericks: yeah, the consistency with #() seems both good and bad..
22:55seancorfieldi've seen that happen with macros that call private functions and the expansion can fail because it expands to code that isn't accessible
22:55gfredericksseancorfield: I can't think of how that wouldn't cause problems almost all the time rather than weird edge cases
22:56gfredericksyeah that phenomenon I'm well familiar with
22:56seancorfieldgfredericks: I guess none of my test cases, and none of my production code(!), uses java.jdbc in such a way as to expand with-connection in the same way the bug reporter hit?
22:57gfredericksI would think that you couldn't even use with-connection unless you had happened to import Connection for some odd reason
22:57seancorfieldbut, yes, I would have expected to trip over it myself... but didn't :(
22:57gfrederickswhich would be 99% of uses
22:57gfredericksso I'm clearly missing something. languages are difficult :(
22:58seancorfieldyeah, when the error was reported i was like "duh! that's an obvious mistake" but then i couldn't figure out why i hadn't found it in testing etc :(
22:58gfredericksseancorfield: unrelated question -- does the new API have anything for setting statement options? ForwardOnly and that sort of thing?
22:58gfredericksI _think_ that's the only feature we're still using a patched version for
22:59seancorfieldyou set that on... what? a PreparedStatement?
22:59gfredericksI think so
22:59seancorfielda ResultSet?
22:59gfredericksno the statement
22:59seancorfieldi remember seeing the option described somewhere...
22:59seancorfieldlet me have a look in the source
23:01gfredericksooh
23:02gfredericksI think I misremembered what our issue was
23:02gfredericksI think java.jdbc already supported this
23:02gfredericksit was korma that made things awkward
23:02gfredericksso I added a dynamic var (always the best solution) in java.jdbc to allow reaching around korma
23:02gfrederickshttps://github.com/fredericksgary/java.jdbc/commit/3a8ba77d82777a755eeae31c552bfc4ab5f1d6b8
23:03seancorfieldthe new query API still supports a PreparedStatement being passed in
23:03gfredericksprobably not the sort of thing that really belongs in java.jdbc
23:03seancorfieldalthough it's no longer properly documented ... i'll have to fix that (and add a atest for it!0
23:05seancorfieldah, you were using the *dynamic-var* and binding to get around how korma called prepare-statement? yeah, definitely not something java.jdbc should support
23:05seancorfieldthat's a "bug" in korma if it doesn't let you pass thru stuff
23:06gfredericksthe bugfix was not using korma the next time we had to make that decision :)
23:06gfredericksdiscovered honeysql and wished I'd been using that all along. Though I saw java.jdbc now has something similar?
23:07seancorfieldhoneysql is much more sophisticated and should be compatible with java.jdbc
23:07gfredericksI couldn't tell at a glance if you were attempting to render honeysql unnecessary
23:08seancorfieldi chatted with the honeysql author at clojure/conj and we agreed to maintain compatibility
23:08seancorfieldno, java.jdbc.sql is meant to be a very slim convenience
23:08seancorfieldthe docs even recommend honeysql :)
23:08gfredericksokay, good to know. I'll continue being a fan of the combination
23:09gfredericksthanks for pushing the project forward
23:10gfredericks(inc seancorfield)
23:10lazybot⇒ 4
23:10seancorfieldor maybe i only mentioned it on the mailing list that honeysql is recommended if you need more than java.jdbc.sql provides? i'm sure i mentioned it _somewhere_ semi-official :)
23:10seancorfieldthanx... it definitely needs more work and i've been so swamped lately at world singles
23:11seancorfieldwe're just about to tranistion to using the new api ...
23:12seancorfieldgetting dark... i need to go feed kitties... back in a while
23:29lazybotseancorfield is Catman!
23:44arrdem(inc lazybot)
23:44lazybot⇒ 19
23:45arrdem&(print "(inc lazybot)")
23:45lazybot⇒ (inc lazybot)nil
23:46metellus,(print "&(inc lazybot)")
23:46clojurebot&(inc lazybot)
23:47metellus,(print "(inc lazybot)")
23:47clojurebot(inc lazybot)
23:47arrdemmetellus: the bots ignore each other
23:47arrdemmetellus: I tried to do a trans-bot quine once :p
23:48metellusthat's probably for the best
23:48metelluseven one bot in a channel of programmers is asking for trouble
23:49arrdemheh I run the bot for my local 2600 chan and have almost gotten rooted through it a few times :/
23:50TimMcarrdem: hyPiRion once got one going. That's why lazybot ignores clojurebot now. :-P
23:50arrdemTimMc: haha not surprised at all...
23:50uvtcAbout how far along is ClojureC? Anyone taken it out for a spin?
23:51uvtc(re: https://news.ycombinator.com/item?id=5656603 )
23:51pppaulwhat be clojureC?
23:51uvtcAhoy!
23:52uvtcpppaul: Clojure->C compiler
23:52pppauli C
23:52arrdempppaul: i c wut u did ther
23:52pppaulsi
23:52uvtcAvast, on the high C's!
23:53arrdemyo dawg I heard you like cc so I threw some clojure around cc so you can cc while you cc
23:53pppaulclojure to C sounds hard
23:53uvtcThe README says it's still experimental. Has a number of tests.
23:53uvtcThis would be https://github.com/schani/clojurec .