#clojure logs

2012-07-24

00:30kauschovar/q/uit
01:45mtmhow do I type hint a method return type (say, in a deftype) when the method returns a non-primitive array? (for example an array of Foo)
01:45aduhi mtm
01:46mtmhowdy adu
01:47aphyrmtm: array types don't actually exist in the JVM.
01:47aphyrIt's just an Array.
01:48aphyr(covariant types are only enforced by javac and stripped due to type erasure)
01:50mtmhmm. okay, let me see if that makes the compiler happy
02:02mtm(^"[LFoo;" bar [this])
02:03aphyrSeriously? I've always hinted mine as ^ArrayList, etc.
02:03aphyrHuh, new trick I guess. :)
02:05mtmI'm deftypeing an interface that has an overloaded method that only varies in the type of the arg and return type (same arrity). compiler kept barfing when I said the return type was an Array. But, hey, at least there's a way to do it :)
02:15craigbroawooo
02:17yankovare there any data structure servers in clojure (something similar to redis) ?
02:22amalloyaphyr: you're thinking of generic types like ArrayList; actual raw arrays do exist on the jvm
02:48wingyim using "lein cljsbuild auto" and the browser gives me error: GET http://localhost:3000/deps.js 404 (Not Found)
02:48wingydoes anyone know what the issue is?
03:06wingythe compiled js file is working as expected, the only issue is that i get that error message above
03:16ro_sthow do i get enlive to put a seq of content items (strings and nodes produced by defsnippet) into a node?
03:16ro_st(content) is ignoring everything past the first value in the seq, and (apply content seq) also only uses the first value
03:18kralnamaste
03:22ro_stah i was trying to use a string as a sequence.
03:22ro_stand it was trying to use the first element as a fn
03:39ro_stwhat's the right way to un-lazy a sequence?
03:40ro_sti guess (vec) will do
04:12wingylein-cljsbuild rocks
04:12wingyso simple to use
04:17ro_styup
04:27wingyand cljs works really smooth
04:29ro_stis it possible to use enlive's defsnippet without any transformations?
04:39ro_stgood old (identity) does the trick
04:39wingyhaha
04:40wingycool fn
05:04ro_stwingy, did you grab the advanced example for cljsbuild and use that as a template?
05:04ro_stif not, i recommend doing so. phantomjs unit testing ftw
05:04wingyro_st: no the simple one
05:04wingyill look into that right now
05:04wingyi tried :advanced compiling but it broke my app
05:04wingyhttps://github.com/emezeske/lein-cljsbuild/blob/0.2.4/sample.project.clj
05:04ro_stwe already have phantomjs set up on our CI mac mini so it was a no brainer to use
05:06ro_sthttps://github.com/emezeske/lein-cljsbuild/blob/master/example-projects/advanced/project.clj
05:06wingyro_st: phantomjs is using node.js?
05:06ro_stso with this i'm developing with lein ring server, and lein cljsbuild auto dev
05:06ro_stand every now and then i lein cljsbuild once prod
05:07ro_stno, it's a headless webkit wrapper
05:07ro_sthttp://phantomjs.org/
05:08wingyreminds me about http://zombie.labnotes.org/
05:08wingywhich is on node.js
05:09ro_styeah
05:09ro_stnice thing about phantom is being able to do stuff like svg rendering
05:09wingyro_st: your app still works on advanced compilation?
05:09ro_stbecause it's a full webkit, rather than a simulated js dom
05:09wingyi c
05:10ro_styep, works
05:12ro_stit's about 90% crossover code (clj copied to cljs and then compiled)
05:12ro_stand the crossover code is well tested
05:15wingyro_st: so you are using clj code in the browser?
05:16ro_styup
05:16ro_stfor the 'model' stuff
05:16ro_stwhere there's no dependency on external io
05:16wingycool
05:21ro_stproduction js with gzip comes in at around 50kb
05:21ro_stnot bad
05:21ro_stgiven that 100% of the page's code is in there
05:22ro_stdebug js is 1.2mb :-)
05:22ro_stbut only 200kb with gzip
05:24otfrommorning all
05:25otfromanyone on who knows their way around counterclockwise?
05:26alexyakushevSomething specific you are interested in?
05:28otfrommy teammate is trying to start up ccw and he's getting "Error: Could not find or load main class clojure.main" after it working all day yesterday
05:29otfromI'm digging through google as well, but just wondering if it was an obvious thing
05:33alexyakushevIs it the same project he worked on yesterday?
05:34otfromyes
05:34cemerickotfrom: Is this when running a project, or some error related to the functioning of the actual IDE/plugin?
05:38alexyakushevOh, hi Chas! Any chance you can take a look at NREPL-22? I would just like to know if this could be expected in nREPL some day or making a special Android fork is better
05:41ro_stemezeske: how do i stop `lein ring server` from (or "destroying main-debug.js" "building main-debug.js as well as main.js")?
05:41ro_stit's a pain to have to poke the dev auto builder after restarting ring (due to fiddling with views.clj, for example)
05:47cemerickalex_baranosky: Yeah, I'll knock that out next time I'm in nREPL. Will probably parameterize the stack size so people can choose what to use on a per-app basis.
05:53cemerickalexyakushev: oh, I highlighted the wrong Alex. See above. ^^ Also, track http://dev.clojure.org/jira/browse/NREPL-8 instead.
05:55otfromcemerick: got it fixed now. Getting our new intern to write up what he did. He did a re-install as a part of trying to fix it and came across some issues
05:55otfromI've been running around so haven't had time to complete track it down
05:55cemerickotfrom: Sure, glad it's humming now. Definitely have him post to the ccw users ML. Laurent is on the ball.
05:56cemerickThe latest ccw betas have been sublime. :-P
05:59otfromthey look quite good
06:00ro_stcemerick: when do you sleep? :-)
06:02cemerickro_st: Nearly every night. ;-)
06:02alexyakushevcemerick: Thank you! I wasn't paying attention to NREPL-8.
06:06sayyestolifeHello.
06:08Raynesro_st: He just gets up early.
06:09Raynescemerick: The Emacs situation is getting much better thanks to nrepl and nrepl.el.
06:09cemerickRaynes: That's good.
06:09sayyestolifeI'm using hiccup and I'm trying to create a form, with form-to, in which when I press submit I'd (with GET) the URL changes to localhost/?text=some_text and I'd like to have a url like localhost/some_text, instead. Is this possible?
06:10cemerickRaynes: better than SLIME yet?
06:11Raynescemerick: In different ways. nrepl.el is not a hack, has actual releases, and is based on nrepl which is not a hack, and has actual releases. It'll get SLIME's features over time, and is already building up quite an arsenal. Like one patch away from everyone recommending SLIME users switch.
06:11Raynescemerick: What I'm saying here is that you should use Emacs. k?
06:11cemerickheh :-D
06:11cemerickSounds awesome.
06:12cemerickIf you and technomancy start recommending the switch, then I will call nREPL a success and retire.
06:12RaynesHaha
06:12RaynesI'm already using it in place of SLIME. :D
06:13cemerickEmacs + viper + not-SLIME. Sacrilege. ;-)
06:13Raynesevil, dude.
06:13RaynesPeople who use viper need to get with the program.
06:13cemerickoh, sorry
06:13cemerickheh
06:13Raynes:P
06:13RaynesAnyways, I should probably sleep, given that I have a job and stuff.
06:13RaynesLater.
06:13cemerickHopefully this means someone other than me will put together an nrepl-friendly cljs browser repl thingie.
06:27ro_stRaynes: did they manage a new release of nrepl.el earlier?
06:29antoineBhello how to reduce a list of ref?
06:29antoineB@(reduce #(ref (* @%1 @%2)) a)
06:30antoineBwhere it seems more natural to write (reduce #(* @%1 @%2) a)
06:32stainwell, think oif every step of the reduce replacing %1 with the previous result
06:32stainand so if you call (deref) every time, you have to make a new ref
06:33stainwell, think oif every step of the reduce replacing %1 with the previous result
06:33stain@(reduce #(ref (* @%1 @%2)) a)
06:33stainwould work
06:33antoineBit works
06:33stainno
06:33stain(reduce #(* %1 %2) (map deref a))
06:34stainmap is lazy, so it won't deref early
06:34antoineBthanks you
06:37stainalternatively, deref the first element of the list to get started:
06:37stain(reduce #(* %1 @%2) (cons @(first a) (rest a)))
06:37stainbut that is old-skool lisp
06:39antoineBthanks
06:41ro_stanyone using shoreleave?
06:46augustlcan I read out leiningen profile values from my application? The use case is for different API URLs in dev and production.
06:47ro_staugustl: 12factor.net/config
06:47augustlro_st: what about it?
06:47ro_stbetter to set env vars and use System/getenv to pull them into a your.app.config namespace (def CONFIG-VALUE (System/getenv "CONFIG_VALUE"))
06:48augustlI'm currently using env vars
06:48ro_stsorry, (def ^:dynamic CONFIG-VALUE (System/getenv "CONFIG_VALUE")), dynamic so you can rebind them in tests
06:50augustlro_st: I'm currently using refs, I'll look up dynamic, never used that before
06:51augustlhmm it's not documented on http://clojure.org/special_forms#def
06:51ro_sthttp://clojure.org/vars
06:51ro_stso in my midje test ns's i have
06:52ro_st(background (around :contents (binding [config/CONFIG-VALUE "some-testing-value"] ?form)))
06:52ro_stcausing midje's facts to run against a different config… new mysql/mongo databases, a testing git repo, paths to test files, etc
06:53ro_stleaving the production code entirely unaffected, and no production or staging configuration in the versioned codebase
07:04ro_stwith enlive, is there a simpler way to define a static snippet with no transformations than this?
07:04ro_st(em/defsnippet s "file.html" ["div#thing div"] [] ["div"] identity)
07:16sayyestolifeUsing hiccup, how can one make form-to create a form action such that it contains values from other fields in the form? For example a text field with the value of foo should become a url of localhost/foo?
07:16ambrosebsIs there a HOF that takes any number of arguments and returns the first? Like (fn [a & rest] a)
07:17ambrosebsA normal function, rather
07:35sayyestolifeUsing noir, how can I match defpages which matches urls such as localhost/?foo=bar
07:35sayyestolife?
07:37stain(comp first list)
07:38ro_sti don't think the url matcher considers querystring values, sayyestolife. those should appear in the params hash that your page handler receives
07:39sayyestolifeokay
07:40sayyestolifewhere can I get that then ro_st?
07:41ro_sti have no idea :-) i've never used noir
07:42sayyestolifehmm ok! thanks anyway
07:42ro_st(defpage [:post "/todos"] {:keys [title due]}
07:42ro_st:keys [foo]
07:42ro_stthen use foo in your defpage body
07:43ro_sthttp://webnoir.org/, 3rd getting started section
07:43sayyestolifehmmm okay
07:47sayyestolifethe thing is though, I'm not using post, I'm using get
07:47ro_st"You just pass it a "route" and supply a destructuring form for the parameters of the request (basically, the GET or POST values)."
07:47ro_stso
07:47ro_st(defpage [:get "/woohoo"] {:keys [foo]} (print foo))
07:48ro_stlocalhost/woohoo?foo=bar
07:48ro_st; => "bar"
07:48stainsayyestolife: j just to check - any reason for query string? (like form submit?)
07:50sayyestolifestain: I don't mind either way, my issue is that I want the user to be able to enter a url in a text-input and then be able to share that url with other people (while I present some stuff on that url)
07:50sayyestolifeperhaps query strings are a bad fit for this?
07:51ro_stfor a single url, no
07:51stainno, query string are perfect for URLs
07:51ro_stunless you expect stupidly long urls
07:51sayyestolifeok, then my problem remains
07:51stainif you did /aboutPage/http://example.com/ instead then you would get trouble with /aboutPage/http://example.com/?fred=1337
07:52stainas a query parameter it is easy to escape
07:53sayyestolifethat is true, I'll stick with a query parameter
07:53stainI have a similar problem as my app navigates a REST resource, but I need different local resources depending on the remote resource
07:54stainlike http://example.com/runs/inputs/?url=http://example.org/server/
07:54sayyestolifeok, however I still have a problem on how to do a defpage which will "catch" this
07:55stainsomething strictly hierarchical like http://example.com/,http://example.org/server/,/runs/inputs got very silly
08:02sayyestolifenevermind I got it now
08:03sayyestolife(defpage [:get "/"] params) <- params is the query string map
08:05ro_stboom chicka wow
08:09ro_stholy crap i'm enjoying cljs
08:09ro_stcompared to google closure javascript it's a dream come true
08:10ro_sti've got the core ui interaction of our app stitched together with enfocus actions and snippets and, like, 80 lines of glue
08:12ro_st1414 lines of code all-in, including tests. simply amazing how expressive clojure is
08:13ro_stprevious codebase is over 10kloc, excluding the tests
08:21gfredericksro_st: I don't think I could go back
08:29CheironHi, what would be a good way to append many lists/vectors together?
08:30gfredericksconcat
08:30gfredericksif you have a list of lists/vectors you'll probably want (apply concat my-lists-and-vectors)
08:32CheironI have this scala code : (left ++ right ++ top) toArray . wondering how to map this to clojure
08:32gfredericksI suspect (concat left right top)
08:32Cheiron(.toArray (concat left right top)) ?
08:33gfredericks&(.toArray (concat [1] [2] [3]))
08:33lazybot⇒ #<Object[] [Ljava.lang.Object;@dbb9b9>
08:33gfredericksoh wow I guess so
08:34gfredericksthere's a clojure function for that though
08:34gfredericks&(apropos "array")
08:34lazybotjava.lang.RuntimeException: Unable to resolve symbol: apropos in this context
08:34gfredericks&(clojure.repl/apropos "array")
08:34lazybot⇒ (parse-array object-array boolean-array long-array short-array char-array into-array float-array int-array double-array to-array-2d byte-array array-map make-array to-array emit-array-impls)
08:34gfredericks&(doc to-array)
08:34lazybot⇒ "([coll]); Returns an array of Objects containing the contents of coll, which can be any Collection. Maps to java.util.Collection.toArray()."
08:35gfredericksso to-array would probably be more idiomatic than .toArray
08:35Cheironthat is great, thanks!
08:40magopianguys, i'm kinda stuck on the problem 28 of 4clojure: http://www.4clojure.com/problem/28#prob-title (here's my attempt : https://friendpaste.com/63zwTYPpT5tkRxxxMWf412)
08:41magopiani'm pretty sure my attempt is not complete yet, but for the moment i'm trying to figure why the error, what it means
08:46goodieboywhat's the recommended library for dealing with dates? I need to get the current time, minus 1 day etc..
08:47goodieboyoh, clj-time looks nice
08:49Frozenlockgoodieboy: That's what I use; works really well.
08:50goodieboyFrozenlock: yeah works nicely. How do you format dates? I want to extract just the yyyy-mm-dd from (now)
08:53goodieboyFrozenlock: ahh, the formatters namespace, nice
09:03wingynot easy to use external libs with cljs
09:03wingysomeone here with experience in including jquery into the compliation set?
09:03wingyis that possible?
09:19no7hingam i right with my assumption that a not initialized var (def my-var) and a change at some later point, makes that same change thread-local?
09:25ro_stwingy: you use externs. and add it with its own script tag
09:25ro_stsee https://github.com/shoreleave/demo-shoreleave-solr/blob/master/project.clj
09:26ro_stthen you can do ($ "selector")
09:26wingyro_st: im doing it atm with angularjs, bootstrap and jquery
09:26wingyits taking forever to parse
09:27ro_styou mean compile?
09:27wingyyeah
09:27ro_st:whitespace or :advanced?
09:27wingyadvanced
09:27wingy:)
09:27ro_stadvanced will take long. lots of static analysis and ast rewriting going on
09:27wingyyeah
09:28ro_sthighly suggest using cljsbuild auto with a :whitespace config by default, and only working through :advanced prior to commit
09:28wingyyeah
09:28wingyi have to see if advanced works if i have all libs as externs
09:29ro_sttry :simple ?
09:29wingywanna use dead code elimination
09:29ro_stit's not as aggresive as advanced, but it does still do renaming, which will trigger externs
09:30wingyisn't that a must do with cljs since its using a lot of code underneath?
09:30wingyyeah but i think that the production code will have to use advanced compilation
09:30wingyso im testing it now
09:31ro_stonly if you're dealing with performance issues. for developing new logic, whitespace only for sure
09:34wingyi hope it wont take 1 hour :)
09:40ro_stmy advanced builds take 20 seconds from cold boot, 3 seconds when hot
09:40ro_stno externs, though.
09:45djcoinI have a sceptic question: why does Leiningen seems so simple in Clojure as opposed to Scala build tools (eg: sbt, buildr etc.) ?
09:46sh10151well buildr is multilanguage
09:46dgrnbrgHello clojurians, I'm seeing my lein freeze up while trying to collect dependencies--it seems that it can't access clojars over https through my proxy. Is there a non-https mirror of clojars?
09:48S11001001dgrnbrg: same url
09:48S11001001notwithstanding scheme :)
09:49dgrnbrgS11001001: my lein command times out, complaing that it could not transfer the artifacts for several deps, such as org.clojure/clojure 1.4.0, slingshot/slingshot 0.10.2, or org.clojure/core.logic 0.7.5
09:49dgrnbrgwhich are all on clojars
09:52S11001001dgrnbrg: yeah. Anyway, same url
09:52dgrnbrgS11001001: should this url exist? http://clojars.org/repo/org/clojure/clojure/1.+/clojure-1.+.pom
09:52duck11231djcoin: leiningen was designed to *seem* simple (yet allowing power if you need it)
09:53S11001001dgrnbrg: no
09:54S11001001dgrnbrg: incidentally, you'll get spurious reports of failure if you couldn't retrieve from the proper location
09:55dgrnbrgS11001001: i'm only seeing lein try to fetch the clojure-1.+.pom urls--i never even see any other dependency urls get hit by lein2
09:55S11001001dgrnbrg: clojure is not hosted at clojars; you get it from maven central
09:55dgrnbrg(i'm watching the proxy logs)
09:55djcoinduck11231: yeah I guess so and that's great - but I don't understand why other build tool in scala, namely sbt, seems so complicated and daring
09:55djcoinI know I should rather go and ask :]
09:55dgrnbrgS11001001: but i don't see mvn central gitting hit for 1.4.0
09:56wingyro_st: im realized that externs is not what i want since the lib code is not compiled .. not much to gain for waiting for an hour or so :)
09:56S11001001dgrnbrg: do you mean these +s literally or as some placeholder?
09:56wingywish that jquery would work with advanced mode
09:56pepijndevosFor the Python users in here: https://github.com/HackerSchool12/perper Clojure is fast.
09:57ro_stwingy: it does. externs tells the compiler that all the symbols in this externs files must not be renamed
09:57ro_stthereby allowing compiled code to call out to uncompiled code in the same page
09:57ro_steg, jquery
09:58dgrnbrgS11001001: I actually see "+" in the fetched urls
09:58S11001001dgrnbrg: look in your ~/.m2 to see what you have already
09:58wingyro_st: i know .. but the jquery file itself is outside the compilation and not compiled
09:58ro_stcorrect
09:58ro_stwere you trying to compile it in?
09:58wingyno
09:59wingyjust using externs .. but then i thought maybe that is not what i want
09:59wingymaybe it would be better if i could compile jquery with my code
09:59wingyso there would be dead code elimination
09:59dgrnbrgS11001001: good call--that got it to hit
09:59scriptorwingy: jquery by itself isn't google closure compatible, I think
09:59scriptorso you might not be able to use advanced optimizations on it
09:59wingyscriptor: yeah doesn't seem to be
10:00wingyok so my only bet is using externs
10:00ro_styes
10:00wingyor whitespace :)
10:00ro_styou don't want to subject end users to whitespace
10:00ro_stmine is 1.2mb
10:01wingyscriptor ro_st : but even if jquery could be compiled would that be a good thing to do? i am thinking about caching
10:01wingyand CDNs
10:01dgrnbrgS11001001: apparently, it's able to fetch all the dependencies, but then it appears to choke and say that it couldn't find the deps after it times out
10:01dgrnbrgso it never actually launches
10:01ro_stfor jquery specifically, i'd say keep it out
10:01wingyyeah .. lets not compile libs
10:02ro_stsome libraries would benefit from compilation, which is what projects like c2 are about
10:02scriptoryea, ideally you'd just need closure's framework anyway
10:02wingyscriptor: im using bootstrap and it's using jquery :(
10:02wingyor i would have used google closure instead now when im on cljs
10:02S11001001dgrnbrg: poms aren't jars?
10:03dgrnbrgS11001001: sorry, it fetchs the poms & the jars--i just realized that it might be another component that i need to investigate
10:03scriptorwingy: yea, then just using jquery as an extern might be the way to go
10:03nDuffwingy: Huh? You can still use the Closure Compiler with jQuery.
10:03nDuffwingy: ...it just has to be an extern.
10:03ro_stjquery has been hand optimised. closure compiler is just going to wreck it
10:04nDuffwingy: ...jayq will pretty much automate that, and is the sane thing to be using anyhow.
10:04scriptornDuff: right, he was asking about actually compiling jquery so you wouldn't need to use it as an extern
10:04wingynDuff: i know but having jquery already loaded makes me wanna use it instead since bootstrap and angularjs is using it
10:04nDuffro_st: yes, but you don't run the jQuery library through the compiler; that's silly.
10:04nDuffwingy: ...so use it!
10:04nDuffwingy: I'm using jqayq as an accessor to an already-loaded external jQuery library and it works perfectly fine.
10:05nDuffwingy: ..._with_ my code being compiled with advanced optimizations.
10:05wingyok then .. externs it is .. tonight when im sleeping .. will take like 2 hours to extern jquery, angularjs and bootstrap :)
10:05nDuffwingy: jQuery already has an externs file available.
10:05nDuffwingy: ...as part of jayq, which is part of why folks have been advising that you use it.
10:06ro_sti'm not getting what's taking 2 hours
10:06ro_stit should be a couple seconds difference bringing externs in
10:06ro_stunless you're keeping a 286 busy
10:07nDuffro_st: ...well, I gather it's actually writing the externs file being discussed
10:07ro_sthow? externs have to be hand written afaik
10:07nDuffExactly.
10:07wingy:externs [
10:07wingy "resources/public/app/lib/jquery/jquery.min.js"
10:07wingy "resources/public/app/lib/angular/angular.min.js"
10:07wingy "resources/public/app/lib/angular/angular.resource.min.js"
10:07wingy "resources/public/app/lib/bootstrap/bootstrap.min.js"
10:07wingy]
10:07ro_stnooo. externs are not the libraries themselves
10:07wingyis that correct?
10:07nDuffThere's metadata expected to exist in the externs.
10:07wingyro_st: it could be
10:08nDuffwingy: no, it's not correct.
10:08ro_stthey are stub lists of the public api of same
10:08nDuffwingy: ...the jQuery externs file, in particular, has a lot of typing metadata for use by the compiler.
10:09ro_stfor example: http://code.google.com/p/closure-compiler/source/browse/trunk/contrib/externs/jquery-1.3.2.externs.js?r=66
10:09hcastrocan someone help me understand how to convert a map to a variable number of arguments? https://gist.github.com/3170082
10:09S11001001hcastro: apply hash-map
10:09ro_sthcastro: (fn 1 2 3) = (apply fn [1 2 3])
10:10ro_stwingy: this need for externs is one of the big reasons people don't use gclosure. it's a bloody pain in the ass to use 3rd party javascript
10:10nDuffhcastro: ...or do you mean you want them destructured for you?
10:10nDuffhcastro: it's not clear to me what you're asking.
10:11hcastronDuff: line 15 and 16 of the gist is what i'd like to accomplish
10:11wingyro_st nDuff : "You can either create an externs file manually, or if you're willing to put up with some warnings, you can use the library as its own externs file, as is demonstrated below."
10:11wingyfrom http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html
10:11nDuffwingy: it's only sometimes just "some warnings"
10:11hcastronDuff: line 12 is how it expects arguments, 7 and up is accepting function
10:11nDuffwingy: ...not at all a safe thing to assume.
10:11ro_styeah
10:12wingythen it seems externs is a tedious way to make it work
10:12wingy:(
10:12wingyill try it later tonight though
10:12nDuffwingy: ...but if someone else has already done the tedious work, why are you complaining?
10:12wingysince im using angularjs and bootstrap as well
10:14wingyand tedious work is tediuos work is always bad .. not a winner no matter who is doign the boring job
10:14nDuff*shrug*.
10:15nDuffwingy: If you dig to the bottom of the huge pile of hardware and software you're using right now, there's no end of tedious work other people have done involved in it.
10:15nDuffhcastro: (apply your-fn (apply concat {:a 1 :b 2}))
10:16wingyso we need to know the boring parts and make it fun
10:16wingydoesn't mean complaining
10:16wingyjust not ignoring
10:18nDuffwingy: It's not my problem to worry about whether it's boring to optimize the bus line routes in the hardware. Why is it your problem to avoid using tools where other people have had to do tedious work to enable them?
10:18wingynDuff: didn't i just mention that am using other libs as well?
10:18nDuffSure.
10:18nDuffSo, the tedious work for those might have to be done -- but if you share the results, it has to be done _once_.
10:18wingyill check on jayq but i think i still need to extern the other ones
10:19nDuff*nod*.
10:20ro_stwingy: angular for its bindings?
10:20ro_stthere's this
10:20ro_sthttp://shoreleave.github.com/shoreleave-pubsub/
10:21ro_stwhich allows you to create topics (publishers) and subscribe damn near anything to it
10:21ro_stperfect for modelling the flow of data around a js app without writing loads of cruddy boilerplate
10:21wingyill check it out
10:22nDuffHmm.
10:22wingyi like angularjs's doc and ease of use .. good to have a pattern to follow as well
10:23wingyand pretty cool concept to extend the html with dynamic features
10:23wingyin just 2 days i have a really professional website .. and i don't even know that much still :)
10:23wingyalso its using bootstrap .. perfect match
10:24wingyalso really good integration testing
10:24ro_stunfortunately ohpauleez released it right before becoming ludicrously busy at work
10:25wingyan example: http://angular.github.com/angular-phonecat/step-8/test/e2e/runner.html
10:25wingynever used such great browser testing framework before
10:25sh10151style question for you guys... regarding "optional" arguments...
10:26sh10151which is better, (func :opt1 "thing" :opt2 "other") or (func {:opt1 "thing" :opt2 "other"})
10:26sh10151i tend to think the first but it could be my CL bias
10:27S11001001sh10151: perhaps you should exploit the fact that a map cannot possibly be confused at runtime for a keyword
10:28sh10151What do you mean?
10:29sh10151the other wrinkle is that some values in the optional arguments are themselves going to be maps
10:31ro_sti like the former
10:31dgrnbrgI've isolated a problem w/ lein2, my proxy, and seesaw. If I include any version of seesaw in my project.clj, it only fetches the seesaw pom and never actually gets the jars, so lein just hangs. If I omit seesaw, lein can fetch every other dependency from clojars and maven central. Any idea why seesaw would cause this behavior as a dep?
10:32wmealingis your project on github ?
10:33dgrnbrgwmealing: it's proprietary :(
10:33wmealingcan you reproduce on a smaller project ?
10:33S11001001sh10151: (fn self ([] (self {})) ([{:keys [...]}] real-impl) ([k v & o] (self (apply hash-map k v o))))
10:33dgrnbrgif i change the seesaw version to 1.4.{0,1,2,3} i can see it fetch the pom in lein's output, but then it pauses
10:34dgrnbrgcould it perhaps be that seesaw depends on an unrearchable package/
10:34sh10151S11001001: ah, I see, so both can be supported
10:34sh10151S11001001: i like it
10:34hcastronDuff: thank you
10:34wmealingit may be
10:34wmealingif you can put it on git
10:35wmealingi'll test
10:35wmealinghow about that
10:35dgrnbrgthat's not possible because of the proxy at my workplace
10:35dgrnbrgor at least, it's a pia
10:36S11001001dgrnbrg: you could tar a sample project, base64-encode it, and paste that on a paste service
10:36dgrnbrglet me see if i can repro
10:36S11001001can't promise that wmealing will be willing to do the reverse
10:36S11001001can promise I'm not :)
10:37dgrnbrgit fails if i just do lein2 new, then add [seesaw "1.4.0"] as a dep
10:37wmealingheh
10:37wmealingthat was what i wanted to know, but im lazy
10:37wmealingand a github clone would b equicker
10:37wmealinggive me a moment
10:39wmealingok, i have confirmed it works for new projects
10:39wmealinghttp://pastebin.com/cCiU0JAA
10:39wmealingso, why would your work proxy block a package
10:39nDuffwmealing: ...in the future, would you mind using a pastebin w/o all the ads? gist.github.com is a great one; pastebin.com is really awful to anyone not running an adblocker.
10:39wmealingthats odd
10:40wmealingnDuff, sure.. i'll remember that
10:40dgrnbrgwmealing: i am crossing an ntlm proxy w/ cntlm, which works for everything else
10:40dgrnbrgand i see that all the deps you got were from clojars and central, which work for me
10:40wmealingi keep forgetting as i do run one
10:40wmealingdgrnbrg, hmm..
10:40wmealingtcpdump can you find anything timing out ?
10:41dgrnbrgwmealing: i can watch my proxy log, but i don't have sudo
10:41wmealingthat sounds horrible
10:42dgrnbrgwmealing: i can see it connecting to clojars and centrol
10:42wmealingnothing "times out"
10:42clojurebot@ has nothing to do with whether sth is evaluated or not
10:43dgrnbrgwmealing: nothing is timing out
10:58locojayhi i m getting No protocol method ISeqable.-seq defined for type object: [object NodeList] when tring to acces first elem of a Nodelist. what lib should which define's these
11:00elliottwwhat's the easiest way to get the middle items in a list? is there something equiv to last-1?
11:01hyPiRionelliottw: middle items?
11:02hyPiRionlike, all items but the last one?
11:02elliottwhyPiRion so i want to do something with the first item, the last item, and then put them back in teh list
11:02elliottwsomething like (join (first foo) (middle foo) (last foo))
11:03elliottwbut if i don't know the length of foo, i thought maybe there was something really simple i'm just missing
11:03hyPiRionWhat kind of structure is foo? Is it a list or a vector?
11:04tmciverelliottw: for last-1: (last (butlast your-list))
11:04locojayc2 seems to have all of this
11:04elliottwtmciver butlast is what i was looking for… thanks man(er woman)
11:05hyPiRionIf it's a vector, then I'd do something like this:
11:05tmciverelliottw: ha! you're welcome . . . man.
11:06hyPiRion(let [n (dec (count foo))] (assoc foo 0 (f1 (foo 0)) n (f2 (foo n))))
11:07hyPiRionWhere foo is the vector, f1 is the operation on the first element, f2 is the operation on the last element.
11:09hashpuppyI posted this in here late last night and got a few responses. I thought I'd try again once more, this morning. If you could, I've created a very brief productivity poll that aims to query members of the Scala, Haskell, and Clojure community: https://docs.google.com/spreadsheet/viewform?pli=1&amp;formkey=dGZpbHExdHZteXY4VkpaRnBQUzRPRHc6MQ#gid=0
11:12hyPiRionhashpuppy: I drink a lot of tea, you should consider other kinds of caffeine next time you do this survey ;)
11:12hyPiRionI'll convert it into cups of coffee.
11:12hashpuppythank you
11:13hyPiRionMay I ask what it is for? Is it of pure interest?
11:14stainI can tell you, in 27 degrees productivity drops!
11:14stainhashpuppy: I don't exercise per day, but per week, I am not sure what to reply
11:15_nmmni dont meditate, now sure if 5+ means, i dont do it
11:15wingydoes anyone know why i get: GET http://localhost:3000/deps.js 404 (Not Found) in the browser
11:15wingyim using "lein-cljsbuild"
11:15wingywith whitespace compilation
11:16hashpuppyhyPiRion: pure interest. stain: i should have put more thought into that question for that situation.
11:16mtkoanwingy: no optimzations, right?
11:17wingymtkoan: only removing whitespace and comments
11:17stainI went for the first option.. but I do 75 minutes once or twice a week
11:17mtkoanwingy: https://www.refheap.com/paste/3764
11:18mtkoanyou need to set CLOSURE_NO_DEPS = true; when not using optimzations
11:18hyPiRionhashpuppy: Cool. If you get an interesting result, you should write about it. :)
11:18hashpuppydefinitely
11:19mtkoanexcercise is so important for my programming ;)
11:20wingymtkoan: cool it worked
11:20wingydo you guys prefer using jQuery or GClosure?
11:21wingyseems that knowing your way around GClosure could be great when using cljs
11:21mtkoanI use both, *shrug*
11:22dhklwingy: without the closure compiler, the generated js is kind of huge :-)
11:22wingymtkoan: what do you think about each of them?
11:23wingydhkl: yepp
11:23Bronsahttp://blog.datomic.com/2012/07/datomic-free-edition.html
11:23mtkoanwingy: I like jq because there are tons of ready-made plugins for me to use, and fancy UI effects
11:23mtkoanalso jayq: https://github.com/ibdknox/jayq
11:25wingymtkoan: why are you using GClosure?
11:25wingywith that i mean the library part
11:31mtkoanwingy: the goog.net namespace, listening for history state changes (goog.history)
11:33mtkoanhttp://closure-library.googlecode.com/svn/docs/class_goog_net_XhrIo.html for ajax
11:34gtrakanyone know a clojure hadoop dfs wrapper?
11:40llasramgtrak: Most people -- including myself -- do most of our hadoopery via Cascalog. Raw HDFS access all I've seen is pure interop w/ the Java API. Which honestly isn't all that bad
11:40llasrams,do,seem to do, he qualified
11:56cljrdoes anyone here have experience deploying clojure on heroku?
11:58mknoszligcljr: does their tutorial not work for you?
11:59cljrmknoszlig: unfortunately no. when I try to run foreman start I get "exited with code 0" as an error
11:59cljrI'm running a pretty basic compujure stack
11:59mknoszligcljr: lein 2?
11:59cljrand i can do lein run -m app.core and it works fine...
12:00cljrmknoszlig: lein 1.7.1
12:00mknoszligcljr: ok, by the book :)
12:01mknoszligcljr: and lein run -m ... works while lein trampoline run -m ... doesn't?
12:03ro_stwhere's the right place to see what's coming up in clojure 1.5?
12:04cljrmknoszlig: both run fine from command line, neither work via foreman start
12:04stuarthallowayro_st: featurewise, if it isn't done (in JIRA) or designed (in Confluence) already, unlikely to be in 1.5
12:04stuarthallowaythe big thing is reducers
12:05wingyi have this project.clj https://www.refheap.com/paste/3765 and im following https://github.com/emezeske/lein-cljsbuild/blob/0.2.4/doc/CROSSOVERS.md but i get: WARNING: Unable to find crossover: yobistore.crossover
12:05CheironHi, i'm facing this situation: extract some code into private functions (defn-) or define them as closures inside let form . the method that contains this let form is going to be called many many times
12:06Cheironclosures inside let form are really neat but since the function is going to be called many many times, am i going to face memory issues?
12:07mknoszligcljr: hm, i have no experience with foreman unfortunately, but i'm guessing there should be a way to get more information on what went wrong inside foreman...
12:07cljrmknoszlig: yeah, its gotta be something small, thanks for the attempt
12:07mknoszligcljr: sorry i couldn't really help, good luck though :)
12:10technomancycljr: are you seeing it fail when deployed, or just locally with foreman?
12:11technomancythere's honestly not much point to using foreman locally
12:18cljrtechnomancy: sorry, its failing at both places
12:19cljrtechnomancy: figured that it might not matter failing locally so I went straight to heroku like you are suggesting and it gives me a message when I check the process that it "starting for 24s...", etc
12:19technomancycljr: if you /msg me the app name I can take a closer look
12:27wingyregarding why i got: WARNING: Unable to find crossover: yobistore.crossover was because i changed "src" folder to "src-clj"
12:27wingyjust switched it back and it works great
12:27wingycrossover is so cool
12:59gtrakllasram: yes, that's what I've settled on I think
12:59gtrakthanks
12:59emezeskewingy: When you changed src to src-clj, did you update the :source-path (or :source-paths) option in your project.clj?
12:59wingyemezeske: i did
13:00wingyweird it still didn't work
13:01emezeskeHmm.. lein-cljsbuild looks for crossovers anywhere in the classpath, and the main :source-path should always be in the classpath. That's weird.
13:01emezeskeI use src-clj in my own projects, and it works there.
13:15dnolenDatomic free edition looks pretty sweet, anybody played around with it yet?
13:23goodieboyhow do you go through each line from a stream reader?
13:25sisciaemezeske, mk, this help me figure out http://www.mrgunnar.net/ap.cfm?subpage=348270
13:26sisciaemezeske, mk, this help me figure out (I mean this other one...dammed clipboard) http://david-mcneil.com/post/16535755677/clojure-custom-map
13:26cemerickdnolen: FD looks pretty killer. Great work. :-)
13:29ToxicFroggoodieboy: line-seq?
13:29goodieboyToxicFrog: ok gotcha!
13:29gerunddevgoodieboy: Wrap your stream in a BufferedReader then do line-seq
13:30goodieboygerunddev: is that io/reader ?
13:30gerunddevgoodieboy: Yes
13:30goodieboycool ok thanks!
13:30gerunddev,(doc line-seq)
13:30clojurebot"([rdr]); Returns the lines of text from rdr as a lazy sequence of strings. rdr must implement java.io.BufferedReader."
13:31goodieboygerunddev: so i could be able to (for example) call (take 1 (line-seq rdr)) lazily?
13:32gerunddevgoodieboy: Yeah I did that the other day to skip the first line of a csv :)
13:32gerunddevsorry (drop 1 (line-seq rdr)) is what I did, but yeah both work
13:32goodieboygerunddev: ok perfect
13:40dnolencemerick: thanks! yes I think it makes core.logic applicable to a much larger set of problems. It's also pretty extensible - possible to add new solvers, new constraint types
13:42dnolencemerick: 0.8 will probably also be followed by a considerable amount of documentation.
13:46goodieboygerunddev: weird, do you know what would cause with-open to never return?
13:57goodieboythis never returns, why? (with-open [rdr (io/reader my-stream)] (doseq [l (take 10 rdr)))
13:57goodieboyoops sorry, i meant to wrap the rdr with line-seq in the take
13:58goodieboy(with-open [rdr (io/reader my-stream)] (doseq [l (take 10 (line-seq rdr))))
14:02ro_stdnolen: enjoyed your talk! def going to give core.logic a gander
14:02ro_stanother reason to put some time into The Little Schemer, as well
14:02clojurebotlearning a new runtime is much harder than learning a new language.
14:02ro_stamen to that
14:04dnolenro_st: thanks! it's fun stuff. I have some new ambitious optimization ideas floating around post-0.8 which I'm looking forward to exploring.
14:04ro_stand the wedding seating planner is actually a really good example
14:06dnolenro_st: heh yes :) I think there's a lot of stuff like that actually. You kind of have to get your head into the declarative mindset to see the applications.
14:07ro_stis there some sort of koan style exercise that one can work with to get one's feet wet?
14:07ro_stthe core.logic TodoMVC
14:08dnolenro_st: there is a unfinished core.logic koans thing, but nothing really comprehensive. I hope to address some of that w/ 0.8 documentation push.
14:08ro_stawesome
14:09ro_sti'm well into cljs now. really enjoying it. being able to actually read and debug the whitespace-mode js is quite helpful
14:10ro_stdnolen: how do you code in black and white?!
14:10ro_stor was that for the preso
14:10dnolenro_st: just for presentation
14:10duck11232Which is less optimization, whitespace or simple? I thought it was whitespace, but simple seemed more readable in my tests
14:10dnolenduck11232: whitespace is less optimization.
14:10ro_stwhitespace
14:11ro_stwhich is really just a concatenation of the generated cljs->js source
14:11ro_stsimple does renaming and some other things, and advanced does the full monty with static analysis, inlining, dead-code removal, etc
14:12ro_stso nice to do gclosure without having any deps.js hopscotchery
14:17dgrnbrgwhat does the :repo-manager key do in repositories in leiningen?
14:18technomancydgrnbrg: not entirely sure what the effect is, but it's intended to be set for things like nexus and archiva where a single repo proxies to a bunch of others
14:18duck1123ok, comparing the 2 outputs, simple outputs varialbe names like 'a' as opposed to 'temp__3971__auto___7041'. I think I'll stick with simple
14:18pandeirohow would i access functions from one of my project's namespaces using light table & lein-light? it doesn't seem to work with namespaced symbols ie (foo.core/my-func 1 2 3)
14:18dgrnbrgtechnomancy: i am trying to set up nexus locally, but i find that when i add it as a mirror w/ or w/o the repo-manage key, lein just hangs. If i remove it as a mirror, all is well. Any idea?
14:20technomancythat kind of stuff is handled deep inside aether, so I don't think we have much control over it unfortunately
14:20technomancydgrnbrg: cemerick might know though
14:21dgrnbrgtechnomancy: thanks! i'm trying to figure out this whole deployment thing, but it's tricky
14:21cemerickdnolen: that it's all available in cljs makes things even more interesting :-)
14:22technomancydgrnbrg: yeah, supposedly switching to something like nexus should be transparent
14:22dnolencemerick: haha well not yet :) but soon
14:23cemerickdnolen: oh? I thought you were keeping it ambivalent re: clj v. cljs all along?
14:23cemerickdgrnbrg, technomancy: know what?
14:23dnolencemerick: no, they are slightly different for now.
14:24cemerickNoted.
14:24cemerickplv8 has prompted me to noodle on all sorts of potential cljs database insanity.
14:25technomancyI was wondering how long it would take for that to happen =)
14:26dgrnbrgcemerick: maybe you know what :repo-manager does when passed to a mirror in lein?
14:26cemericktechnomancy: Just noodling, still. Heroku postgres doesn't support plv8 yet. ;-)
14:27cemerickdgrnbrg: I'm not entirely clear, myself. IIRC, I left it undocumented for that reason in pomegranate.
14:27dgrnbrglol
14:27dgrnbrg:)
14:27dgrnbrgwell, i hope to get something mostly working soon
14:27cemerickdgrnbrg: what are you trying to do?
14:28dgrnbrgcemerick: i'm trying to set up an internal nexus, and get lein to push to it, and also get the nexus to proxy central & clojars, and i have to do everything through cntlm, which is an ntlm->http proxy bridge
14:28dgrnbrgugh
14:29dnolenCLJS users- we have a big REPL enhancement patch - http://dev.clojure.org/jira/browse/CLJS-138 - would like to hear if this works for folks.
14:29cemerickdgrnbrg: I had the exact same setup until recently, modulo the HTTP proxy. Stuff "just worked".
14:29ro_sti haven't quite gotten to using the repl in cljs yet
14:30dgrnbrgcemerick: i have never used nexus
14:30dgrnbrgi think nexus can walk the proxy
14:30ro_stis it possible to cljs repl from within emacs?
14:30dgrnbrgbut when I add the nexus as a :mirror, it hangs
14:30ro_sti don't think i could live without all the clojure-mode and paredit toys
14:30dgrnbrgit == lein
14:30dgrnbrgIs there a way to have lein deploy not require a gpg key?
14:30cemerickdgrnbrg: are you using the proxy, or is the nexus?
14:31hiredmanspeaking of clojurescript, how do people distribute clojurescript libraries, as jars?
14:31dnolenhiredman: yes
14:31dgrnbrgcemerick: i have set up lein to..ooh
14:31dgrnbrgi need to have lein not proxy to that host
14:31dgrnbrghmm
14:31pandeiroro_st: yes it's possible
14:32dgrnbrghow do i communicate proxy host exclusions to aether through lein?
14:32hiredmanI have a clojurescript drawbridge client (nrepl over http) but I need to remove the use of jquery and get it working with the google closure ajax bits
14:32pandeiroi use dnolen's method of setting the inferior lisp program to the cljs repl invocation and voila
14:32ro_stpandeiro: got a link?
14:33ro_stand, (probably asking for a lot now), is it possible to have both a jvm repl and a cljs repl running in emacs at the same time?
14:33ro_stor does it not make sense to do so
14:33mtkoanro_st: sure
14:33hiredmanthat and my also unreleased cljs compiling middleware for nrepl make embedding clojure and cljs code evaluation in a browser pretty nice
14:33jweissis there another way to test if a symbol resolves to a var other than (try (resolve sym) (catch Exception _ nil)) ?
14:34mtkoanrun the jvm repl with swank, and the cljs one as inferior-lisp process
14:34pandeiroro_st: yes it's possible, and the cljs repl is in my-clojure.el here: https://github.com/pandeiro/dotemacs
14:34pandeirowhat mtkoan said
14:35duck1123ro_st: if you run the cljs repl using inferior-lisp, you should get most of the functionality you want
14:35ro_styummy
14:35ro_stthanks guys
14:35ro_stthis shit is NINJA
14:35ro_st:-)
14:36mtkoanpandeiro: wow I think my .emacs.d is a mess now
14:36ro_stbrb, re-putting 2year old to bed :-/
14:36duck1123I haven't found the cljs repl all that useful IMO. I prefer the firebug repl for most things
14:36pandeiromtkoan: mine is totally outdated looking at it now...
14:36pandeiroduck1123: it's nice w/ a tiling wm that you can set up so the repl is right under the browser where firebug/chrome inspector would be
14:39hiredmanduck1123: in theory you could write an extension that added a clojurescript repl to firebug, you would just need to run the compiler as a service
14:39cemerickexcept that in-browser tools are, almost by definition, bad
14:40duck1123hiredman: I've been trying to get the reverse working well for me. (pulling firebug/js console into emacs)
14:40pandeirocemerick: even chromium's inspector? i find it pretty good
14:40dnolenduck1123: I'd prefer that people help wrap up source maps :)
14:41technomancyduck1123: via mozrepl?
14:42cemerickpandeiro: Well, I was fundamentally talking about tools for interacting with code (editors/REPLs/debuggers/etc). Inspectors are occasionally handy, but definitely auxiliary for me.
14:42duck1123technomancy: That's what I tried. I got it working a little bit, but then my attentions went elsewhere.
14:42cemerickpandeiro: Critical for the DOM and such though, that's for sure.
14:43pandeirocemerick: yeah i find the autocomplete essential as the browser APIs have become too enormous for me to keep track of
14:43technomancyI have fond memories of mozrepl, but that was in 07 or so
14:45duck1123technomancy: the newer version seems pretty good. I intend to delve into it deeper when I have time
15:00daniel__1anyone know of a clojuredocs for kindle?
15:00daniel__1clojuredocs.org that is
15:08ro_st(repeatedly (inc #'source-maps))
15:08ro_stdnolen: how far along are sourcemaps?
15:08dnolenro_st: http://dev.clojure.org/display/design/Source+Maps
15:09dnolenro_st: not very, but it's also not a ton of work - we need to be able to read a source map and generate one.
15:09ro_stgreat
15:09ro_stso at least we can get advanced js back to whitespace-ish js
15:10ro_stthat already is a huge help
15:11dnolenro_st: looking at the Mozilla JS version looks like ~550 lines of code, I'd be surprised if more than that was involved. we can already vlq64 encode/decode.
15:11dnolenro_st: I think sensibly augmenting the analyzer will be trickier.
15:12ro_sti believe line and column numbers are tricky?
15:14gfredericksdnolen: do you have a sec for a high-level core.logic impl question?
15:15gfredericks(not real involved, just didn't want to type it out needlessly)
15:16dnolengfredericks: what's up?
15:18gfredericksdnolen: when reading TRS, my impression was that a lot of effort was going in to essentially implementing lazy seqs; so when I see the core.logic impl, my main question is why that effort was mirrored rather than using clojure's lazy seqs directly. Am I misunderstanding something?
15:18dnolengfredericks: lazy seqs don't work.
15:18amalloygfredericks: i don't think that's true
15:18gfredericksamalloy: which part?
15:20dnolengfredericks: http://clj-me.cgrand.net/2012/01/30/the-reasoned-scheduler/
15:21gfredericksdnolen: this looks interesting, thanks
15:21dnolengfredericks: core.logic tried to use lazy sequences - failed miserably.
15:21gfredericksoh very nice he brings up my question directly :D
15:22amalloygfredericks: i think what's untrue is that TRS is trying to implement lazy seqs
15:22amalloylazy seqs are one-way, lcons-es are two-way
15:25dnolenamalloy: gfredericks is actually talking about something different. as you say lcons are there so we can get Scheme-like pairs for relational ops. but the implmentation around the stream of *solutions* is lazy sequence like.
15:25dsppim trying to generate a .mobi version of clojuredocs.org, has anyone seen one before?
15:25dsppso i dont waste my time
15:25gfredericksaw man amalloy's comment sounded like it was going to be quite insightful :D :(
15:26amalloyoh. i don't remember seeing lazy streaming of solutions in TRS
15:26gfredericksamalloy: inc & friends
15:26dnolenamalloy: it's not in the actual book - it's in those 2 pages of cryptic macro code at the end.
15:26gfredericksthey must have at least touched on it. I couldn't have read the cryptic stuff too closely
15:27gfredericksI also read it in the paper but I remember it being familiar at that point
15:27amalloyi read the chapter on unification, but i think i skipped/skimmed the pile of impl details after that
15:27dnolengfredericks: they don't really, there's a one page cryptic description by Chung-chieh Shan at the end.
15:28dnolengfredericks: it's actually lucidly written but if you're not familiar with monadic style code it's pretty hard to understand.
15:29dnolenamalloy: TRS only really covers substitution map & unification - it doesn't get into how goals actually work.
15:29dnolenwell it does but in 1 page of text and 2 pages of macros.
15:59mtkoanhow does one create a jar of a clojurescript library?
16:00triyoHey Clojurians! A bit OT; can anyone recommend a good book on subject matter of `Distributed computing'?
16:00emezeskemtkoan: One way is to use lein-cljsbuild, and set ":jar true" in your config options
16:01emezeskemtkoan: https://github.com/emezeske/lein-cljsbuild/blob/master/sample.project.clj#L68
16:01mtkoanemezeske: thank you
16:02antares_triyo: http://my.safaribooksonline.com/book/software-engineering-and-development/9780321312839 is pretty great
16:02antares_triyo: it is only in part about distributed parts but those are helpful and well written
16:04gerunddevtriyo: Are you already familiar with parallel computing and just looking for distributed?
16:04triyoantares_: Thanks for the link and recommendation. I'll have a look.
16:09triyogerunddev: I haven't mastered parallel computing but I have made greater headway than in the distributed computing space
16:09triyoAnd the two are quite distance of course (share memory, etc.)
16:09triyo*shared
16:11hiredmanhttps://github.com/hiredman/nrepl-cljs-middleware
16:12gerunddevtriyo: I found Concurrent Programmin in Java by Doug Lea to have good constructs. The fact that he then went on to build them in java.util.concurrent is secondary :)
16:13gerunddevtriyo: Concurrent in different theads, processes, and machines have needed similiar abstractions from my experience.
16:16technomancyclojurebot: jcip?
16:16clojurebotjcip is Java Concurrency in Practice
16:16technomancywait
16:16technomancyclojurebot: java concurrency in practice?
16:16clojurebotjava generics are http://en.wikipedia.org/wiki/Generics_in_Java
16:16cemerickhiredman: sweet
16:16cemerickThe sample doc is borked though
16:16technomancyclojurebooooooooot
16:16technomancyoh
16:16technomancyclojurebot: j.u.c.?
16:16clojurebotIt's greek to me.
16:16hiredmancemerick: yeah, well, as you have noted many times the org-mode renderer on github is lame
16:17technomancyclojurebot: juc?
16:17clojurebotCool story bro.
16:17technomancyclojurebot: java.util.concurrent?
16:17clojurebotjava.util.concurrent is "When I find myself in times of trouble / Prof. Doug Lea comes to me / Coding lines of wisdom / j.u.c."
16:17cemerickhiredman: yup, I gave up on them for non-markdown content a while ago.
16:17hiredman:/
16:18technomancyjoke ruined
16:21gtrakRaynes: ever thought about porting lazybot to xmpp?
16:22Raynes gtrak: Thought about it, yes.
16:23antares_Raynes: Y U NO REVIEW monger's CODE
16:24Raynesantares_: I thought I told you I'd investigate some this weekend? Or was that last weekend?
16:24antares_Raynes: I don't remember weekends being mentioned by ok :)
16:24antares_*but
16:27cpineraHi. I'm trying to write a test and I want to fake a function that does some I/O. I've read that I can use binding to re-bind the function to my fake, but I'm getting an exception that says "Can't dynamically bind non-dynamic var".
16:28RaynesIn clojure 1.3+, vars are not dynamic unless explicitly declared so.
16:28emezeskecpinera: Are you using binding, or with-redefs?
16:29Raynes(def ^:dynamic foo 0)
16:29technomancycpinera: you probably want with-redefs
16:29technomancyyour reading material is unfortunately outdated
16:30cpineraemezeske: I'm using binding. I'll use with-redefs :)
16:31cpineratechnomancy: Excellent, I'll do that. Where can I find some more up to date documentation on unit testing with Clojure?
16:33technomancycpinera: unfortunately I don't know of any good free resource. the oreilly book probably has the best coverage. if you need something free, maybe Mark Volkmann's article
16:33technomancyI mean I don't know of a free resource that focuses on testing
16:34triyoJoe Armstrong PhD thesis `Making reliable distributed systems in the presence of software errors'. Seems to be very much what I'm after.
16:34triyohttp://www.sics.se/~joe/thesis/armstrong_thesis_2003.pdf
16:35cpineratechnomancy: Perfect. Problem solved. I'm really thankful!
16:39gtrakRaynes: should it be pretty easy to do (xmpp) ? I looked at the code briefly
16:40Raynesgtrak: It probably wouldn't be that difficult with a good xmpp library.
16:41duck11231it's a shame that library is Smack
16:42hiredmanxmpp is *streaming* xml, the start of a xmpp connection is an open tag and the end is an end tag
16:42hiredmancrazy
16:42hiredmanabsolutely nuts
16:43gtrakjeez
16:43gtrakand here i was thinking gtalk was superior to aim for 9 years
16:43nDuff...
16:44brehautgtrak: all IM protocols are rubbish, just in different ways
16:44duck11231even with the XML, XMPP is still better than aim
16:44duck11231I'll defend that one
16:44nDuffXML namespaces are a beautiful, beautiful thing to have in a messaging protocol
16:45nDuffgives you the ability to embed content of different types, add local extensions without breaking other parsers...
16:45hiredmanyour entire connection to an xmpp server, for however long the single connection lasts, is a single valid xml document
16:45nDuffYep.
16:45technomancyminus the closing tag though?
16:46hiredmantechnomancy: well, once the connection is over, it includes the closing tag
16:46hiredmanso it is a valid xml doc
16:46hiredmansure
16:46brehautnDuff: the biggest problem is that most XML parsers that validly handle namespaces dont handly the madness of streaming, and while XML is easy, NS'ed xml parsing is not so easy
16:47technomancyit's not a whole lot crazier than having every file loaded by the clojure compiler be wrapped in an implicit (do ...)
16:47hiredmantechnomancy: a source file, and a connection stream are two different things
16:48duck11231I think most engines ignore the inital <steram> tag and just parse each packet
16:48nDuffbrehaut: Eh? There are _lots_ of XML parsers that handle streaming gracefully -- heck, there are API standards (ie. SAX) that have multitudes of compliant parsers that require it.
16:49brehautthings i do not want to have to do: write an real application that consumes XML using only SAX
16:49nDuff*nod* -- that's fair 'nuff.
16:50duck11231Openfire uses XPP and Tigase has their own XML lib
16:50brehautnDuff: the thing i dont understand with xmpp is what the streaming buys. if it was a series of xml documents over the connection, you'd get all the namespacing gains, without all the weirdness
16:51hiredmanhttp://telehash.org/ seems like it could be the basis for something more sane
16:51technomancyI really hope that goes places
16:51nDuffMmm. Couldn't tell you that myself, actually -- it's over half a decade before I was actually following closely (was using XMPP as a message bus), and there's a lot that's leaked out of my head in that time.
17:17technomancyvery interesting: http://wiki.eclipse.org/Jetty/Feature/Continuations
17:23gtrakyou're not supposed to be able to M-. code with a remote swank connection are you?
17:23gtrakbecause if I am, it's broken
17:23technomancygtrak: not out of the box
17:23technomancyyou can make it happen with tramp though
17:24gtrakoh ya?
17:24technomancythe details elude me at the moment
17:24yediany of you guys try out go yet?
17:24gtraki'm actually editing local files here
17:24gtrakI just want it to send forms to the server
17:25technomancygoogle's go is too mainstream; I'm picking up the original one: https://code.google.com/p/go/issues/detail?id=9
17:26arohnergtrak: you can eval forms remotely w/ C-x C-e
17:26gtrakyea, that part works
17:26gtrakif I could M-. I'd be in heaven
17:27technomancygtrak: tavis rudd implemented that in swank, but I don't think it's documented
17:27technomancyI think the config all happens on the slime side though
17:51semperoswriting custom relations with core.logic, using records I've defined in my API
17:52semperoshere's an example: https://gist.github.com/3172908
17:53semperoswhen I run this via run*, instead of getting back Element records (which is what wd/find-elements returns), I get back simple clojure.lang.PersistentArrayMap's
17:54semperosso if I then want to do something with elements that satisfy conditions in my run* statements, I have to do a hacky map->Element on what get's bound before using it
17:55semperosam I missing something fundamental about using Clojure records with core.logic? is this intentional?
17:55semperosdnolen: any thoughts? if you have a sec ^^^
18:52lynaghkcemerick: ping
18:55mdeboardI'm interested in LINQ-like functionality for Clojure, and have worked some with Cascalog, but I'm looking for a Cascalog that doesn't require Hadoop. In other words I Just want the cascalog DSL. Are tehre any projects out there like this?
18:55lynaghkmdeboard: you might want to look into the newly released Datomic free edition, which gives you Datalog querying on native Clojure collections.
18:56mdeboardSeems like a ton of additional overhead for the segment of functionality I want
18:56brehautmdeboard: LINQ-like is quite broad… do you want linq in general, or a specific linq implementation?
18:57mdeboardbrehaut: declarative querying a la cascalog. Forget I said anything about LINQ, I want Cascalog without requiring hadoop
18:57brehautmdeboard: because in the general case, clojure.algo.monads and linq are equivalent
18:57lynaghkmdeboard: I'd actually try it out and benchmark it re: additional memory usage. I wouldn't be surprised if it's negligable.
18:57lynaghkmdeboard: you can also try rolling your own using core.logic.
18:57brehautmdeboard: declarative querying of what exactly; SQL DBs ?
18:57mdeboardlynaghk: By overhead I mean setup & configuration
18:57brehautin memory records?
18:58mdeboardbrehaut: XML, i.e. System.Xml.Linq in C#
18:58mdeboardI need to quit mentioning Linq
18:58brehautright
18:59mdeboardI saw a Cascalog mailing list post where sritchie said he'd like to see an XML tap but I don' ttihnk anything came of it
18:59brehautmdeboard: i had good luck with clojure.zip, clojure.xml and clojure.data.zip
18:59brehautdoesnt handle NS's though
18:59mdeboardGood call, I think I've used each of those separately
19:00brehautxml-> is magic
19:00mdeboardbrehaut: Not much of a worry thankfully, it's pretty simple XML
19:00brehautthe other possibility might be enlive's xml support (which is equivalently limited)
19:00mdeboardI'll look into that
19:00mdeboardI'm rewriting a C# library at work in Clojure, bit by bit
19:01brehautor you could port System.Xml.Linq to clojure.algo.monads ;)
19:01mdeboardHa, I don't know enough C# (almost none) to be of any use there
19:01mdeboardalso the word monad scares me
19:01brehautits just a monoid in the category of endofunctors, whats the problem?
19:02hiredman~endofunctor
19:02clojurebotendofunctors are functors that map a category to itself.
19:02mdeboardbrehaut: lol
19:02hiredman~shrimp
19:02clojurebotshrimp must be the new gotos
19:02hiredman~shrimp
19:02clojurebotshrimp are small
19:02brehautmdeboard: really though, its jsut an interface. happens that its quite abstract is all
19:02hiredmanclojurebot: jerk
19:02clojurebotyou cut me deep, man.
19:02brehaut~shrimp
19:02clojurebotshrimp must be http://okmij.org/ftp/Scheme/monad-in-Scheme.html
19:03brehaut~botsnack
19:03clojurebotThanks, but I prefer chocolate
19:03brehauthiredman: does clojurebot still have the inference stuff?
19:03hiredmanI think so
19:04hiredmanI don't recall removing it
19:04mdeboardbrehaut: I'll keep that in mind :P
19:05brehautmdeboard: the trick is to start off not worrying about monads in general, and just worrying aobut specific implementations
19:07aphyrIs there an idiomatic way to do exit handling in clojure? A callback before VM shutdown? Signal handlers?
19:08ahkurtzis a continuation a monad, if the continuation only returns things in the same type at every iteration?
19:08brehautthere is a continuation monad yes
19:08hiredmancontinuations don't return
19:08brehautnot sure if its advisable in clojure
19:09ahkurtzcontinuations return eventually ... even if it's nothing?
19:09brehautisnt the point of continuations that they continue rather than return?
19:10ahkurtzyou can't use them if they never return ... I guess I'm just too stupid
19:10ahkurtzthere is some point where execution stops?
19:11hiredmana lot of times the term continuation is used to describe things that are not continuations, callbacks, etc
19:12brehautahkurtz: ive heard of continuations described as dynamic goto
19:12hiredmana continuation is a jump, jumps don't return
19:12ahkurtzhow does a continuation exit once entered?
19:13brehautahkurtz: perhaps the implemenation details of continuations as functions is causing confusion?
19:13hiredman"Lambda: The Ultimate GOTO" http://repository.readscheme.org/ftp/papers/ai-lab-pubs/AIM-443.pdf
19:13ahkurtzty
19:13brehauts/as functions/model with functions/
19:15ahkurtzso, if execution ceases it's not a continuation?
19:15ahkurtzI have a recursive function that passes it's previous work to it's next iteration, then returns at base case
19:15ahkurtznot a continuation?
19:15ahkurtz*its
19:15hiredmannope
19:16hiredmanthe continuation is implicit, hidden
19:16ahkurtzdo you happen to have an example of clojure code that is a continuation? or is this a theoretical mathematical thing that I'm conflating with programming?
19:16hiredmanclojure doesn't have continuations
19:18hiredmanI guess continuation that returns a value would be a coroutine
19:18hiredmanguess a
19:20ahkurtzmy problem is that I'm calling CPS and continuation the same
19:47cemericklynaghk: hallo
20:25gertI'm working on a library that needs to throw exceptions... should I use `ex-info` and `ex-data`? Or create my own exception classes? I like Slingshot, but have a feeling ex-info and ex-data might replace its functionality. is that correct?
20:26technomancygert: I'd say throw with ex-info and catch with slingshot
20:26hiredmanslingshot uses ex-data and ex-info on versions of clojure that have them
20:26gertoh cool!
20:27hiredmanhttps://github.com/scgilardi/slingshot/blob/master/src/slingshot/support.clj#L22
20:28gerthiredman: that's clever, ta for the link.
20:29technomancyis Stone gone for good now?
20:30hiredmantechnomancy: well, it isn't called Stone anymore, it was reworked to look as much like the ExceptionInfo class that made it in to clojure as possible
20:31technomancycool
20:32technomancyIMO Stone was a tiny bit too cute for situations where people would be seeing it without knowing anything about slingshot
20:43brehauthi gert
20:43gertbrehaut: hi!
20:44gertwe're the only kiwis on here I suppose? :)
20:44brehauttalios too sometimes
20:44brehautand arbscht
20:44brehautand rbarraud
20:45brehautbut they are aucklanders, so i dont know if they count
20:45gerthaha
20:45rbarraud<ears_burning> huh? :)
20:45gertI didn't know we had so many clojurians in nz.
20:45gertwe should start a club
20:45brehautim going to call it #clojure
20:45rbarraudradical! ;-)
20:45rbarraud1,2,3... Yep, I count
20:46rbarraudhiya WLG! :)
20:46gertonly local clj people I know are my employee and myself
20:47rbarraudI could disguise myself as a Greenhithean ... probably wouldn't fool you though eh? :)
20:47gertnah it's all AKL to me. but I kinda like akl, so it's all good
20:47rbarraud'onya matey ;-)
20:48rbarraudI am a WnTronGisAckler anyway
20:48brehautall at once?
20:48rbarraudgeographic version of MPD i suppose ;-)
20:49brehautjuxt or comp i guess
20:49rbarraudTime division Multiplexed
20:49gertand I'm dutch import, so not so precious about inter-city rivalry. working full-time (and then some) on a clojure project here.
20:49brehauthow often are you in the tron?
20:50rbarraudnot very these days but can be persuaded if there are beer/chili/motorcycles/Linux involved :)
20:50brehautha
20:50rbarraudI have a delivery trip to make soonish... as soon as my M/C is properly legal again
20:50rbarraudAmateur Radio gear (1296MHz convertor and IC202)
20:51rbarraudlong overdue loan :-/
20:51brehautoops
20:51rbarraudhow bout u? up in AKL much?
20:52brehautnot particuarlly often; i hate dealing with getting anywhere when i do
20:52rbarraudi haven't checked with arbscht lately - his server was down - but he was hosting some LISPy/Clojureish stuff
20:52brehautmostly only for the occasional show or conf thing
20:52brehautlisp.geek.nz?
20:52rbarraudperhaps we should start a Clojure meetup? or is that fragmentation? The JVM languages one covers it anyway
20:52rbarraudyup
20:53brehautit might fragment too much eh
20:53gertthere's a functional programming meetup in Welly but it's not overly active I think
20:54brehauti kinda think an FP meetup would be better than a JVM meetup…
20:54rbarraudIIRC SharkBrain may have some interest in Clojure
20:54brehautbbs, need to get some kai
20:55rbarraudthere are a few of us functionally-minded on the Shore wh ohave been thru all of the MIT SICP lecture videos (and loved them :) ) - check out #sicp here on freenode.net
20:55rbarraudwe usually hang out most days casually
20:56rbarraudwe have been meeting Friday nights when we can get a quorum
20:56rbarraudF2F that is
20:56rbarraudpizza etc usually involved
20:56rbarraudit's gone OT a lot onto things like LLVM
20:56gertsounds like all the fun is happening up north
20:56rbarraudand Harvard Legal Philosophy lectures ;-)
20:57rbarraudgert: i may be down in WN quite soon to visit my Dad and Bro+family
20:57rbarraudmight be nice to catch up for a beer or something
20:57gertchur!
20:58rbarraudkinda trying to persuade some fellow #sicp -ers to make a road trip of it too ... not a lot of success so far though
20:59gertrbarraud: get in touch with me when you know more about your plans
20:59rbarraudwhats best way ? I'm @rbarraud on Twitter
21:00gertI'm @gertalot
21:00rbarraudkewl
21:00rbarraudif we follow ea other we can DM email addrs etc
21:00gertdone. :)
21:01rbarraudkewl me doing that too
21:01rbarraudgotta afk now sorry - lunch Must Be Attended ;-)
21:01rbarraudnice chatting
21:01gertyeah same! catch you later!
21:20gfredericks$mail dnolen that cgrand blog post was quite enlightening; thanks again
21:20lazybotMessage saved.
21:28steveo_anybody using mahout with cascalog?
21:34gfredericks&(read-string ":p'")
21:34lazybot⇒ :p'
21:35jeremyheiler /join #compojure
21:36jeremyheilermeh
22:03mattmossIs there a doc/web page that documents generally accepted identifier conventions? IE, that *ident* is for dynamic vars, or that -ident is blah blah blah..., etc.?
22:03hiredmanhttps://github.com/hiredman/drawbridge-cljs huzzah
22:08gfredericksdoes turning off clojure.core/*assert* turn off assertions in clojurescript?
22:08amalloymattmoss: there's http://dev.clojure.org/display/design/Library+Coding+Standards, which isn't really what you want but is sorta related
22:08duck1123that's it. I was going to do other things tonight... I'm setting up my server for nrepl
22:09mattmossamalloy: Thanks, good reference.
22:13hiredmanhttp://s8.postimage.org/hm262cozp/Screen_Shot_2012_07_24_at_7_09_58_PM.png plotting data using jplot with clojurescript in browser using nrepl for compilation
22:14hiredmanjqplot I guess? jquery plotting plugin thing
22:26KyleBrodieHello hello how are all the clojurians?
22:27gertwhat authentication framework do people use in production? Sandbar? Friend? a Java solution?
22:43enoch2038i'm in brisbane, AU
22:45brehautgert: i think friend looks like it makes more sense going forward
22:49gfrederickshow do I do foo[bar] in cljs?
22:49acagle /join #compojure
22:49RaynesYou should never foo your bar.
22:49RaynesThat got me in trouble once.
22:49gertcan I define a protocol that inherits from another protocol? Or am I thinking to java-interface-y?
22:49gfredericksgert: nope
22:50gfredericksso I guess yep?
22:50Raynesgert: No and you're a bad person for wanting to.
22:50gertRaynes: sorry :)
22:50Raynes:P
22:50brehautgfredericks: http://himera.herokuapp.com/synonym.html is your friend
22:51sprocgfredericks: (nth bar foo)
22:51gfrederickssproc: where bar is a string
22:51brehautgfredericks: get
22:52gfredericksbrehaut: that can't be true
22:52gfredericksbrehaut: I think you're taking that page more literally than it was intended
22:53brehautah
22:53gfredericksthe "Accessing Values" section is not about interop
22:53gfredericksI want interop
22:53brehautdoes (.-bar foo) work ?
22:53clsimonsgfredericks: (get {"hi" "there"} "hi") ; => "there"
22:53gfrederickswell what I really want is x[0]
22:53gfredericksand (.-0 x) does not work
22:54brehautgfredericks: you are talking about a js obj rather than a map right?
22:54gfredericksclsimons: that's a cljs map not a primitive js object
22:54gfredericksbrehaut: yes
23:02gertRaynes: I see the error of my ways now re protocols. I blame lack of sleep.
23:03gfrederickssurely jayq must address this issue
23:05amalloygfredericks: (get x 0), right?
23:06gfredericksamalloy: if that did native js property access I would thing x being a map would break
23:06gfredericksbeing a cljs-map I mean
23:06amalloyokay, i didn't understand any of that, but i'd still like to point out get != aget
23:06gfredericksah nope
23:06gfredericksdoesn't satisfy the ILookup protocol
23:07gfredericksoh aget looks promising
23:07amalloyaget will emit x[0]
23:07gfredericksI want that
23:07amalloywell then
23:07amalloydo i have good news for you
23:08gfredericksthank you sir for your good tidings
23:11craigbroawoo
23:12Hodappwerewolves
23:12craigbroof london
23:12HodappON THE HIIIIIIIIIIIIIIIIGHWAY TO HELLLLLLLLLLLLLLLLLLLLL
23:12Hodapp...wrong song?