#clojure logs

2013-01-28

00:00rationalrevoltIn compojure are the routes (GET "/:id" [id] ...) and (GET "/:id" {{id "id"} :params} ...) the same? In the latter form, does id map to the form parameters or the request uri?
00:08xeqirationalrevolt: yes, they are the same. It will match either, with the route-params having preference
00:08xeqiwell, almost the same
00:09xeqi{{id :id} :params} instead of {{id "id"} :params}
00:10rationalrevolthmm
00:14rationalrevolti'm not understanding how this is working: https://github.com/weavejester/compojure/blob/1.1.3/src/compojure/core.clj#L81 seems to say that is we are not a vector bindind then the bindings are done with the request itself - which would explain the :params usage in the map destructuring.. but then, the id was part of the uri and not the form parameter - i'm confused as to how this is actually working
00:16technomancyTimMc: I actually used that (symbol "") trick in Leiningen once
00:17technomancywhen we were using the Ant stuff to do subprocesses, I couldn't figure out how to suppress the fact that Clojure printed the value of the form in eval-in-project
00:17amalloyrationalrevolt: there's probably a wrap-params middleware wrapped around somewhere
00:17brehautwait a minute, java.jdbc has an sql generation dsl‽
00:19xeqirationalrevolt: there is a call chain of make-route -> if-route -> assoc-route-params, which the result of gets passed as the request to let-request
00:22callenbotyogthos|away: luminus is looking pretty great. :)
00:23technomancycallenbot: come up to seattle
00:23callenbottechnomancy: is there countryside that is accessible to Seattle?
00:23technomancybest clojure group per capita
00:23callenbottechnomancy: I'm seriously considering Seattle.
00:23callenbottechnomancy: what's the contracting environment like there?
00:24technomancycallenbot: couldn't tell you re: contracting
00:24rationalrevoltxeqi: thanks
00:24technomancycountry really isn't far though
00:24callenbotI was looking at google maps, trying to figure out where I could snag a homestead in riding distance of seattle
00:24technomancywe have a couple irregular attendees to seajure that come from bainbridge island even (other side of the water)
00:24technomancypublic transit is a joke unfortunately, but slowly improving
00:25callenbottechnomancy: I ride a motorcycle, don't care.
00:25technomancyah, gotcha
00:26callenbotconvinced my friend to let me use Clojure for our portfolio site :)
00:26technomancyI'm just across the city limits to the north; I like it a lot. tons of parks and the mountains aren't far away.
00:26callenbotthat sounds pleasant.
00:27xeqibut what if you hate coffee
00:27technomancyxeqi: dunno, you'd have to ask hiredman
00:27callenbotxeqi: I love coffee
00:28technomancywhen we first moved up here every other weekend we were exploring a new park
00:29technomancyduring the summer it's the best place ever for working remotely: https://secure.flickr.com/photos/technomancy/tags/remoteoffice/
00:29xeqido you have a lightbox?
00:30callenbottechnomancy: d'awww, family.
00:31technomancyheh. most of those are old; kids are 3 and 5 now.
00:33technomancyfeel free to pm if you want to know more about seattle without boring the channel
01:05magnarsYou've got a basic git log output in one long list with each commit headed by a line "commit 38a8c3..." - now you want to partition the list into sublists - one for each commit. I've got my solution, that I am decidedly unhappy with. How would you do it?
01:12magnarsHere's my solution, if that triggers any thoughts: (mapv #(apply concat) (partition-all 2 (partition-by is-commit-header lines)))
01:52francisI'm having an exception occur ONLY when I'm runnning code in the REPL https://gist.github.com/4653543
01:52francisI'm not sure why that would happen and would appriciate some direction.
02:07brehautdoes clojure.java.jdbc have any diagnostics support?
02:08Raynesbrehaut: It's awfully late for you to be around.
02:08RaynesHow rare.
02:08brehautRaynes: woo public holiday
02:09brehautRaynes: and who doesnt like beating their head against an (apparently) obtuse SQL error of their own divising
03:10nurettinhi, is there an RSS or atom feed for newest clojure related libraries ?
03:37noidinurettin, it's not quite what you asked for, but there's https://twitter.com/planetclojure
03:38noidiit lists new of clojure-related blog posts, which often are about new libraries
03:39michaelr525hello
03:48nurettinnoidi: great source, thanks
04:00nurettinnoidi: here's how I made an rss out of it:
04:00nurettinhttp://api.twitter.com/1/statuses/user_timeline.rss?screen_name=planetclojure
04:00noidicool
04:00nurettinnow it relays to my old phone :-)
04:34josteink //Get the current status from the DB
04:34josteink DocumentRow docRow = DocumentRow.GetFromIdxDocumentId(incomingInfo.DocumentId);
04:34josteink DocumentLockSemantics currentStatus = docRow.LockSemantics;
04:34josteink DocumentLockSemantics newStatus = incomingInfo.LockSemantics;
04:34josteink if ((int)currentStatus < (int)newStatus)
04:34josteink {
04:34josteink docRow.LockSemantics = newStatus;
04:34josteink docRow.Save();
04:34josteink if (currentStatus != DocumentLockSemantics.None)
04:34josteink {
04:34josteink _helper.EnsureDirectoryExists(new DirectoryInfo(_helper.GetVersionHistoryFolderPath(docRow, string.Empty)));
04:34josteink }
04:35josteink }
04:35josteinkthat's definitely not clojure and definite not intended for this channel
04:35josteinker. sorry
04:48nurettinjosteink: looks very C#
04:48josteinkit is
04:49clgvjosteink: you should use pasting sites for other channels as well ;)
04:49josteinkit was a very accidental paste :P
04:49josteinkI was supposed to copy a URL and paste
04:49josteinkinstead I Ctrl-v'ed in the URL bar (instead of CTRL-c) without noticing ;)
04:56clgvjosteink: so you are a ClojureCLR user? ;)
04:57josteinknah
04:57josteinkI tried starting out there. figured it would be better/easier whatever
04:58josteinkbut I found much less support for it around than for plain, mainline JVM clojure
04:58josteinkit's not like anyone will allow me to intermix F#-code, even less clojure-code, into our company's codebase
04:58josteinkand if its not work
04:59josteinkwell. I just do plain jvm ;)
04:59josteinkcan you even use lein with clojureclr?
05:00josteinkif you cant use leiningen, whatever clojure-related you are selling me, you will fail :P
05:17clgvjosteink: there is a lein plugin for clojureclr, afair on the ML
05:23josteinkstill
05:23josteinkI dont see enough benefits to going CLR
05:24josteinkif nothing else, I see value in poking my nose in new stuff, stuff Im not exposed to 24/7 anyway
06:02clgvjosteink: I'd only use it if I needed it in a .Net application
06:20zbycemerick - what is the signature of the function needed for :credential-fn?
06:20zbyI deduced #(if(= (% :username) (% :password)) {:roles #{::admin}} nil) - as a simple example
06:21zbyin the session there still seems that something is not set:
06:21zby{:cemerick.friend/identity {:current nil, :authentications {nil {:identity nil, :roles #{:friend-testing.core/admin}}}}}
07:09michaelr525hey
07:10michaelr525i've created a number of different workers where each blocks on a rabbitmq message queue
07:11michaelr525what would be a good way to manage/organize them?
07:11michaelr525they all belong to a single web app
07:11michaelr525should i run one jvm process and spawn multiple threads or maybe run one jvm per worker?
07:21bosie_https://www.refheap.com/paste/9018
07:21bosie_why would this give me a runtimeexception?
07:21cemerickzby: see https://github.com/cemerick/friend/#credential-functions-and-authentication-maps
07:23clgvbosie_: because you try to use a java function as higher order function. and thus the compile thinks you specify a static field there
07:23clgv*compiler
07:23bosie_clgv: i see
07:23clgv,(doc mem.fn)
07:23clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: mem.fn>
07:23clgv,(doc mem-fn)
07:23clojurebotIt's greek to me.
07:23clgv,(doc memfn)
07:23clojurebot"([name & args]); Expands into code that creates a fn that expects to be passed an object and any args and calls the named instance method on the object passing the args. Use when you want to treat a Java method as a first-class fn."
07:24clgvbosie_: you can either construct that function composition explicitely or use memfn
07:25bosie_clgv: i just tried and re-read the doc. sounds like it wouldn't work on static functions
07:26clgv,((memfn Float/parseFloat) "0.12")
07:26clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: parseFloat for class java.lang.String>
07:26clgvoh right^^
07:26bosie_just asked out of curiosity, will use read-strings instead ;)
07:27cgrandTheBubsy: here
07:27TheBusbycgrand: hey there
07:27cgrandI don't understand your last msg
07:27TheBusbycgrand: how much data are you dealing with?
07:28cgrandTheBusby: not much, in my example it was between 1e6 and 1e7
07:28TheBusbycgrand: it wasn't related to your frequencies example, but if you could operate over the "reducer's chunk", which is 512 by default, you could simplify things
07:29TheBusbyin profiling I didn't see the reduce step as being too expensive, but the combine was consuming the bulk of the time
07:29cgrandTheBusby: ok you meant have the ability to pass a random function f who takes the reducer-chunk and yield the value
07:29TheBusbyyes,
07:30cgrandno questions aced about how it (this function) performed its job
07:30TheBusbyso instead of reducef, something like reduce-chunk-f
07:30cgrandI thought about that but it doesn't compose well
07:30TheBusbyno it doesn't and it kind of breaks the model of ignoring the storage format
07:30cgrandif the coll is the result of a r/map for example it won't work
07:30TheBusby:(
07:31tomojare you talking about clojure.core.reducers/fold or something new I'd like to see? :)
07:31TheBusbytomoj: fold
07:31tomojoh, ok
07:31TheBusbyreducers are *great*, until you try and output a map
07:32cgrandTheBusby: hence my proposal of having a "cleanup" function called on the same thread as reduce before combine get to see the result
07:32cgrandTheBubsy, how does fold-in-map works?
07:33tomojfor map output, the combinef is merge?
07:33TheBusbycgrand: old way was this, https://gist.github.com/4655172
07:34TheBusbytomoj: that's the big issue, the combinef has to be merge.
07:34TheBusbyand the bulk of the time will be spent in the combine step
07:34TheBusbyuntil at the very end, you have one core pegged as merge handles two giant maps
07:35tomojinteresting
07:35tomojhave you thought about how reduce-kv could help if you could use it composably?
07:35tomojhow/whether
07:35TheBusbythe problem is there isn't an efficient way to generate large maps
07:36tomojright, guess it wouldn't help
07:36TheBusbyjust today I had to cut/paste half the PersistentHashMap.java source code to produce my own map
07:37TheBusbycgrand: try some quick profiling, I'd be surprised if too much of your time is in reducef and not combinef
07:37cgrandTheBubsy: it depends, in my case, the number of keys is capped/small and the merge phase is not too expensive. I agree that if your key set is somewhat proportional to the size of the input, merge s the hotspot
07:38TheBusbycgrand: you're right, excellent point
07:38cgrandwhen you only need to perform lookups into the resulting map there's a possible cheap workaround
07:38TheBusbyeven with a small percentage of keys though, how much of your time is spent in reducef?
07:39cgrandTheBusby: switching from naive reduce to naive fold -> nearly halved the runtime (about -45%) on a 2core CPU
07:40cgrandgoing from naive reduce to transient reduce -> about -75%
07:40cgrandso I conclude that merge is not my current hotspot
07:41TheBusbycgrand: fair enough. Apologize for hijacking your thread, but the merge issues has been dogging me too long. :(
07:42cgrandTheBubsy however I could use a faster merge on another project
07:43tomojthe cleanup function seems familiar
07:44TheBusbycgrand: the problem is it needs to be done in PersistentHashMap to be clean
07:44TheBusbyit's so easy to divide and concur with the BitmapIndexedNode as you know all similiar keys are already grouped together
07:44TheBusbys/concur/conquer/
07:46arcatanare let bindings guaranteed to be evaluated in the order they're in source?
07:46TheBusbycgrand: you can do the transient persist! trick now if you use reflection?
07:47cgrandarcatan: yes
07:47arcatancgrand: thanks.
07:48TheBusbycgrand: in your combinef just have something like (if (isa? foo ATransientMap)(persist! foo) foo)) no?
07:48cgrandTheBusby: no, transient have same-thread policy you can't call persistent! from the combining thread
07:49TheBusbycgrand: ah, I see
07:50TheBusbycgrand: gotta crash for the night, but it was good talking to you and I hope to hear progress regarding reducers+transients
07:53tomojwhy put the cleanup in the combinef and not the reducef?
07:53cgrandTheBusby: https://gist.github.com/4655215 /cc tomoj
07:54cgrandit only works when you can get by with only needing lookup on the merge map
07:54tomojcool, a fn sentinel
07:56tomoj(fn ([] (transient! [])) ([ret] (persistent! ret)) ([ret v] (conj! ret v)))
07:56TheBusbycgrand: also curious why foldcat is 3x slower than (r/fold (r/monoid into vector) conj coll) ...
07:56cgrandtomoj: two reasons. #1 is combined provides the init value which is already "tainted". #2 is reduced is called for each item and you want to clean up after the whole reduce only (before combine) not after each item
07:57tomojyeah, the suggestion would be to have r/reduce call the cleanup function after reduce
07:57tomojalthough not sure how to do that without breaking everyone and now requiring an extra arity..
07:57cgrandTheBusby: no idea have never looked into it
07:58cgrandtomoj: it feels asymmetric to ask r/reduce to do that or then you also need to tell fold how to turn the clean init value provided by cominef into a "dirty" one (e.g. transient) to be passed to r/reduce
07:58tomojhttp://squing.blogspot.com/2008/11/beautiful-folding.html
08:00cgrandTheBusby, tomoj: gotta run, thanks
08:00TheBusbycgrand: have a great day
08:01cgrandTheBusby: good night
08:01tomojhmm, agreed that is weird
08:24tickingI was wondering, is it already possible and if not could it be to attach datastructures to one another. Say I have a string sorting function, which takes strings, but I wanted to associate a position with each. One could attach the positions to the strings, sort them and then retrieve the positions. Thoughts?
08:25S11001001,[1 "hi"] ;ticking
08:25clojurebot[1 "hi"]
08:25S11001001,(doc sort-by)
08:25clojurebot"([keyfn coll] [keyfn comp coll]); Returns a sorted sequence of the items in coll, where the sort order is determined by comparing (keyfn item). If no comparator is supplied, uses compare. comparator must implement java.util.Comparator."
08:26S11001001ticking: `map' is the other ingredient, bake for 30min at 350 degrees, let cool for 10min, enjoy
08:26tomoj&(->> ["foo" "bar" "baz"] (map-indexed vector) (sort-by second (comp - compare)))
08:26lazybot⇒ ([0 "foo"] [2 "baz"] [1 "bar"])
08:27tickingS11001001 tomoj, the string sorting was an example, there are many other cases where one cannot provide a special comparator function
08:28tomojwhat you're asking for is like metadata. 1) strings can't take metadata 2) positions aren't metadata
08:28nurettintomoj: what is the meaning of second (comp - compare) ?
08:28magnarsdependency inversion on database access: pass in a function that closes over the database atoms, or something else entirely?
08:28tomoj(comp - compare) is the reverse of the default compare
08:29tomoj&(sort (comp - compare) (range 10))
08:29lazybot⇒ (9 8 7 6 5 4 3 2 1 0)
08:29nurettinoh I see
08:29nurettinsecond is the values
08:29nurettincool thanks
08:29tomojsecond pulls out the strings from the pairs, then the comparator is applied on the strings
08:29tickingtomoj, exactly. the metadata system basically does this, but it using it this way would be pretty bad style as it is not intendet for this
08:30S11001001ticking: what cases?
08:30tickingmagnars reading of OCR xml files, there are a lot of string manipulation functions that work on the text, I'd like to keep them as clean as possible and only annotate the positions on the words
08:31magnarsticking: I think that was posted to the wrong person. I'm mostly thinking about dependency inversion in clojure now. :-)
08:31tickingmagnars: ah sorry :D
08:32nurettin&(->> ["foo" "bar" "baz"] (map-indexed vector) (sort-by second(comp compare)))
08:32lazybot⇒ ([1 "bar"] [2 "baz"] [0 "foo"])
08:32S11001001ticking: I'd suggest that, because you can't do what you're asking for and maintain referential transparency, that there's nothing "clean" about such a result.
08:32nurettintomoj: why does it require the whitespace after - ? is it just the rule or does it have an explanation ?
08:33tomojthere comp, function composition, is applied to two arguments
08:33tomojthe first is -, the minus function
08:33nurettinso I have to put whitespace between function components
08:33tomojif you try to write -compare it will think you're looking for a function called '-compare
08:33tickingS11001001 why would that loose referantial transparency, if I pass a hashmap into a function that works on only one of its elements, then it's still referential transparent
08:33nurettinawesome thanks
08:34S11001001ticking: "I dare you to tell me which which which points to in this sentence."
08:34tomojyou don't always need whitespace though
08:34tickingS11001001 what I want is the same only that there is one canonical element on which all operations are performed by default
08:34tomoj&((comp {:foo :bar}[:foo]) 0)
08:34lazybot⇒ :bar
08:35tomojbut no good reason not to have a space between arguments..
08:35tickingS11001001 sorry non native is a habbit I picked up some time ago and it's hard ot get rid of ^^
08:35nurettin{:foo :bar} is that a hash with one key and [:foo] an array ?
08:35tickingnurettin: yes
08:35nurettinticking: cool
08:35tomoja vector
08:36nurettinah ok I call it vector
08:36tickingnurettin [] denotes vectors though
08:36nurettin[:teh :vectorz]
08:36hyPiRion,(vector 1 2 3)
08:36clojurebot[1 2 3]
08:36tomojwhich is maybe analogous to what other languages call an array
08:36hyPiRion,(hash-map 1 2 3 4)
08:36clojurebot{1 2, 3 4}
08:36tomojbut much better :)
08:36nurettin:this :looks :weird "why" "not" "like" "this" ?
08:37nurettinis it like strings and symbols in ruby ?
08:37tomojwell, there is at least one incidental reason, Strings can't be made functions (yet)
08:37hyPiRionIt's keywords. They stand out more than strings usually, and are used for different purposes.
08:37tomoj&(:foo {:foo 3})
08:37lazybot⇒ 3
08:37tickingS11001001 I still don't see the loss of referential transparency though. As the functions themselves never see the annotation you always get the same result for the same input.
08:38S11001001ticking: assuming all "which"s are interchangable, then it's fine
08:40nurettinthanks everyone now I'm not a complete stranger to clojure :-)
08:46nurettinare there awesome mysql/postgres ORMs written for clojure ?
08:48nurettinmapping sql databases to clojure data structures
08:49tomojno
08:50tomoj:P
08:50nurettinheh that would be nice
08:50tomojthere are sql libraries
08:51nurettinaccording to this clojure seems to perform much better on their machine http://benchmarksgame.alioth.debian.org/u32q/benchmark.php?test=all&amp;lang=clojure&amp;lang2=jruby
08:51nurettinexcept for regexes :D
08:53nurettinI use jruby in production, but I have to cache like crazy
08:54michaelr525nurettin: korma sql is half way to an "ORM"
08:54michaelr525maps database records to clojure maps :)
08:54tomojthen that's, what 40% of the way? :P
08:54p_la lot of ORMs are doing it wrong. And in a language like clojure you don't need what is typically shown as ORM
08:54p_lnow, something akin to Sequel (a Ruby ORM), yes
08:55nurettin(has-many address {:fk :userID})) <- I like it
08:55nurettinnow if it has some left and inner joins it would be nice :D
08:55michaelr525it has
08:58nurettinlein looks interesting
08:58nurettinleiningen
09:00tickingnurettin don't do clojure without it
09:00tickingnurettin it makes up 50% of the grase that lets clojure run so smooth ^^
09:08nurettinsooo noir korma and jboss let's see how long this takes
09:20michaelr525nurettin: last i heard noir was deprecated and became a library which is supposed to be used together with ring/compojure..
09:20michaelr525nurettin: what's the jboss part in all of this?
09:23kristian-michaelr525: ....and in Luminus, ref http://www.luminusweb.net
09:26nurettinmichaelr525: it is what we use for web application production server
09:27nurettinmichaelr525: it has built-in timers, queues, services, jobs, etc.
09:27vijaykirannurettin: then you might want to start with immutant :)
09:28nurettinvijaykiran: that will make my job much easier thanks :-)
09:31jcrossley3nurettin: are you looking to integrate with an existing jboss deployment?
09:31tomojwasn't someone looking at url/repo metadata in project.clj's in github and/or pom.xml's in repos?
09:32nurettinjcrossley3: I'm planning to replace it :-)
09:33jcrossley3nurettin: we're in #immutant if you have any specific questions about it
09:36nurettinit will depend on how fast our lead developers can transition from C# to clojure :D
09:38bosie_is there a function that would let me do (get-in {:1 {:3 "blah"} :3 {:3 "foo"} :4 {:8 "ewe"}} [ANY :3]) and return a hash with all maps fitting the pattern?
09:38bosie_hi ticking
09:39tickingbosie_, hey :D sory for being undercover for some time had a lot of stuff on my plate ^^
09:39bosie_ticking: figured. education is a bitch. ;)
09:39tickingyeah ^^
09:40tickingbosie_ you could do the above with a sequence or zip of some sort I think
09:41bosie_ticking: get all the keys and apply (get-in) over them
09:41bosie_oh
09:41bosie_actually, why not
09:41tickingbosie_ ah its only one nesting deep?
09:41bosie_ticking: yes
09:44tickingbosie_ hrm I think zippers are capable of doing thing like that, buts its some weeks back that I last used them
09:50clgv bosie_: thats easily achievable with a `for`
09:50tickingclgv a filter should probably already do the trick
09:51clgv,(for [[_ m] {:1 {:3 "blah"} :3 {:3 "foo"} :4 {:8 "ewe"}} :when (contains? m :3)] (get m :3))
09:51clojurebot("blah" "foo")
09:51bosie_clgv: damn, thats nifty
09:52clgv,(for [[_ m] {:1 {:3 "blah"} :3 {:3 "foo"} :4 {:8 "ewe"}} {x :3} m :when x] x)
09:52clojurebot()
09:53clgvdamn the second should have worked as well
09:54clgv,(for [[_ {x :3}] {:1 {:3 "blah"} :3 {:3 "foo"} :4 {:8 "ewe"}} :when x] x)
09:54clojurebot("blah" "foo")
09:54clgvthats it^^
09:56bosie_so _ is like in prolog
09:56clgvbosie_: no, it is just convention for "I dont care for that value"
09:56bosie_what is the name of "_"?
09:56clgvunderscore?
09:57bosie_lol yes
09:57bosie_but why can you use it in this context
09:57bosie_the for docs don't mention it
09:57clgvwhy not? you can use all UTF-8 encoded charachters except the reserved ones
09:57bosie_oh
09:57bosie_right
09:58bosie_nvm i thought it had magic to it
09:58clgv,(let [𝛂 2 𝛃 3] (println "𝛂 + 𝛃 =" (+ 𝛂 𝛃)))+
09:58clojurebot𝛂 + 𝛃 = 5\n
09:58bosie_right
09:59clgvpretty useful when doing math^^
09:59bosie_i expected the _ to do what you actually wrote
09:59bosie_the :when part baked into the _
09:59clgvthe underscore stands for "I do not care for the keys"
10:00bosie_well, it doesn't stand for anything. its just a variable name
10:00bosie_right?
10:00clojurebotto be fair I dunno that I've ever had code out right rejected, it just sits in jira or assembla or where ever, or if I ask if there is any interest (before writing any code) I get told to go write alioth benchmarks
10:00clgvif you need a seq on a fixed level of a map hierarchy `for` is your friend ;)
10:00clgvbosie_: yes
10:00clgva binding name
10:00bosie_ye
10:01clgvbut only if that fixed level is known at compile time^^
10:01bosie_sure. the _ threw me. IIRC in datalog you would get this exact behavior with _
10:01bosie_where _ is resolved to mean any variable that solves [_ :3]
10:02bosie_which you are doing too, except you also need the :when clause
10:03bosie_nvm thanks
10:16bosie_clgv: btw
10:17bosie_nvm, lets drop it. sorry
10:19clgvbosie_: lol, you can just ask. someone might answer ;)
10:20bosie_nah, i wanted to ask if you really think the for solution is better than a filter
10:24clgvbosie_: the following is even shorter: ##(keep :3 (vals {x :3}] {:1 {:3 "blah"} :3 {:3 "foo"} :4 {:8 "ewe"}}))
10:25clgvhumm lazybot is lazy again
10:25clgv,(keep :3 (vals {x :3}] {:1 {:3 "blah"} :3 {:3 "foo"} :4 {:8 "ewe"}}))
10:25clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: ]>
10:25bosie_clgv: thats the disadvantage of lazy eval. you never know when it will run
10:25bosie_jk
10:25clgv,(keep :3 (vals {:1 {:3 "blah"} :3 {:3 "foo"} :4 {:8 "ewe"}}))
10:25clojurebot("blah" "foo")
10:26bosie_right
10:26bosie_but i am looking for everything
10:26nDuffAre there conventions for the naming of anaphoric macros?
10:26bosie_{:1 {:3 "blah"} :3 {:3 "foo"}} in your case
10:28clgvoh, well. so you want no get-in but sa select-in-pred ;)
10:28tomojI think the convention is pretty much "don't do anaphoric macros"?
10:28bosie_clgv: (filter #(comp (= :3.0 %) first keys second) {:1 {:3 "blah"} :3 {:3 "foo"} :4 {:8 "ewe"}})
10:28bosie_ok not working
10:29S11001001tomoj: yep
10:30tomoje.g. the new as-> takes a name
10:30bosie_clgv: yup, i guess you could say "select-in-pred"
10:31tomojI've been thinking about how to write select-in
10:31clgvbosie_: you could use reduce-kv to build the new map
10:32bosie_clgv: my filter works
10:32bosie_clgv: but the whole first keys second thingie bothers me
10:32tomojdoesn't seem to work to me
10:33tomoj#(comp (= :3.0 %) first keys second) is a predicate that's always true
10:33tomojwait
10:33tomojwhat?
10:33clojurebotwhat is meta
10:33bosie_tomoj: tomoj (filter #(= :9.0 ((comp first keys second) %)) {...})
10:33nDufftomoj: Not sure how to get my desired effect (logging functions aware of the current *ns*) without either anaphoric macros or a lot of repetition.
10:34clgvbosie_: try (reduce-kv (fn [result k m] (if (contains? m :3) (assoc result k m) result)) {} {:1 {:3 "blah"} :3 {:3 "foo"} :4 {:8 "ewe"}})
10:35clgv,(reduce-kv (fn [result k m] (if (contains? m :3) (assoc result k m) result)) {} {:1 {:3 "blah"} :3 {:3 "foo"} :4 {:8 "ewe"}})
10:35clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: reduce-kv in this context, compiling:(NO_SOURCE_PATH:0)>
10:35clgv,(clojure-version)
10:35clojurebot"1.4.0-master-SNAPSHOT"
10:35clgv:O
10:35clgv&(reduce-kv (fn [result k m] (if (contains? m :3) (assoc result k m) result)) {} {:1 {:3 "blah"} :3 {:3 "foo"} :4 {:8 "ewe"}})
10:35lazybot⇒ {:3 {:3 "foo"}, :1 {:3 "blah"}}
10:35tomojnDuff: what is the anaphor?
10:35clojurebotmonads are #<RuntimeException java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "=" at line 1, column 38.>
10:36bosie_clgv: &(clojure-version)
10:36bosie_&(clojure-version)
10:36lazybot⇒ "1.4.0"
10:36clgvclojurebot has some weird version 1.4.0 if it has no reduce-kv ;)
10:36tomojI thought reduce-kv was added in 1.5
10:37babilenno, reduce-kv was added in 1.4
10:37tomojah, yeah
10:37clgvtomoj: you should write more 1.4.0 ;)
10:38nDufftomoj: When called as (!setup-logging!), I'm defining logger, log-info, log-warn, &c. against the local *ns*
10:38tomojI'm on 1.5.0-RC3 everywhere
10:39tomojnDuff: as new functions in the current ns?
10:39bosie_clgv: thanks
10:39tomojmixfix bangs seem appropriate :)
10:40nDufftomoj: Yes. Suppose I could take the function names as arguments, just to make it clearer.
11:02AWizzArdWhat is the difference between „ratio?” and „rational?”?
11:02tickinglol I'm doing clojure for almost a year now and still get bitten by contains? from time to time
11:02ChongLiticking: bitten by?
11:03ChongLiohhh yeah
11:04ChongLiyou have to supply the index, not the value
11:04ChongLithis is where a type error would be helpful
11:04tickingChongLi exactly
11:05tickingChongLi actually I think a reasonable less expectation inducing term would have been better
11:05ChongLithis is one of those naming problems
11:06tickingI'd be happy with an additional 'in?
11:06ChongLiyou can use some to check if a vector contains some value
11:07tickingyeah combined with sets, but checking for nil is still not possible with this
11:07ChongLiyeah to check for nil you gotta write your own function I suppose
11:07ChongLiusing the nil? predicate
11:08tickingyou'd have to do something like (apply or (map nil? col))
11:08tickingapply and rather
11:09ChongLigenerally though it's not usually that useful to get a true/false answer about a collection
11:09Bronsaor and and are macros
11:09Bronsayou can't apply them
11:09ChongLiyou'd usually be more interested in finding a specific value
11:10tickingreally? damn
11:10tickingwhy for gods sake
11:10ChongLibecause clojure is not a lazily evaluated language
11:10ChongLiyou can't implement and/or with a normal function
11:10tickingah I know so that they allow for shortcuts
11:11ChongLiand/or in haskell are just normal functions
11:11tickingChongLi not really, macros allow just for call by name
11:11ChongLiwhich is nice because you can apply/map them
11:11Bronsayou can use some/not-any/every?
11:13tickingnDuff yeah that was the first name I thought of as well ^^
12:08FoxboronNow, i feel like a tard. I went about doing a fresh install of leiningen, but when i do "lein self-install", the download links complains about "forbidden" and wont download the 2.1.0-snapshot.
12:09technomancyFoxboron: get the stable version instead
12:09Foxborontechnomancy: Roger.
12:10Foxborontechnomancy: why do ya push 2.1.0 too master if its not ready yet btw?
12:13technomancyFoxboron: because master is where things go that aren't ready
12:14Foxborontechnomancy: ah i see. I am more used too that being in a own branch. Thanks for the help tho ^^
12:16technomancynp
12:16technomancyare there any docs that point people to downloading bin/lein from the master branch? if so we should fix that
12:18Foxborontechnomancy: i honestly believe its people's first reaction if they go too the github page. The lein docs point too stable tho.
12:19Foxborontechnomancy: ya could consider switching the default branch from master too stable.
12:20technomancyI think that would change the branch people get when they clone too, which would be confusing
12:22Foxborontechnomancy: thats actually true.
12:34gfrederickstechnomancy: did you ever express an opinion about the spies lib idea?
12:35technomancygfredericks: just that tools.trace is worth looking at
12:36gfrederickstechnomancy: oh this was for testing not debugging
12:36gfredericksit's been suggested that spy is a bad name anyhow
12:37gfredericksthe core functionality would be functions that track each of their calls so you can expect on them later
12:37technomancyright but it probably has mechanisms for what you want
12:37technomancyjust use swap! instead of println
12:37gfredericks"has mechanisms" as implementation details or part of the API?
12:38technomancyno idea; have only briefly glanced at it
12:38gfredericksokay cool; thanks
12:38technomancyjust worth looking at in depth before embarking on your own adventure
13:13ChongLitechnomancy: is there a recommended way for repeatably adding google closure libraries to a cljs project in leiningen?
13:13ohpauleezChongLi: Usually you use a goog.jar provided somewhere
13:13ohpauleezCLJS ships with one, there are a few others on Clojars
13:14ChongLino I mean a 3rd party library
13:14ChongLinot a google one
13:14ChongLia library written for the closure compiler
13:14ohpauleezYou'd just jar it up and put it in a repository
13:14ChongLioh ok
13:14technomancyChongLi: never used cljs, sorry
13:14ohpauleezoooo what's the library?
13:14ChongLigl-matrix
13:15ohpauleezahh
13:15technomancypossibly relevant: http://www.webjars.org/
13:15ChongLifast matrix math for javascript using typed arrays
13:59josteinkin fact, they are very, very, very slow
14:00josteinkbut since they are free, they are my best shot at deploying clojure code without it costing a fortune :P
14:02nDuffjosteink: Clojure can be run in App Engine, IIRC
14:02bltavare_josteink: what about heroku?
14:02nDuffjosteink: ...likewise, Heroku's free tier.
14:03josteinknever tried either of them
14:03josteinkfree tiers sounds good for fooling around though :)
14:03josteinkmaybe I should google around for some howtos
14:04bltavare_https://devcenter.heroku.com/articles/clojure
14:04josteinkthis will be a LOW traffic site. if it werent for me being a pedant, it could be fully server by PHP or even static hosting ;)
14:04josteinkI just want to have fun with clojure and enlive though, so I need something which can run it :)
14:04nDuff...bigger issue with Heroku is that if you need anything other than hosting for the app server itself, that's not included with the free dyno
14:04nDuffie. want a datastore? Well...
14:04josteinkyeah. not going to need that
14:05technomancyboth heroku and app engine will give you free hosting at the cost of idling, so your first request on an idled app will invoke process boot cost
14:05bltavare_nDuff: you have the postgresql free tier as well
14:05josteinkthis will be a "hey this is my homepage. no. Im not going to bother to blog, so there are none" kinda page :P
14:05josteinkthat sounds good
14:05technomancyapp engine doesn't give you a full JDK, but they give you access to their bigtable custom data store instead.
14:06josteinktechnomancy: not sure i like the sound of non-standard datastores which cant be had anywhere else ;)
14:06technomancyyou also won't get persistent disk with either one, but you don't get that with a micro anyway, you just get something that looks like a persistent disk if you're not paying attention
14:06josteinkanyway
14:06josteinkthanks for the feedback
14:07josteinkguess Ill start off at the EC2 instance I already have (since that works right now) and see if I cant move it off to something a bit more sexy
14:07nDuffjosteink: App Engine has a MySQL-compatible storage interface.
14:08technomancyah, /me retracts his FUD =)
14:08josteinknDuff: ah good to know
14:09josteinkeven as someone who had a complete mysql meltdown last weekend :P
14:09nDuff...note that I didn't say it was MySQL. :)
14:09josteinkheeh
14:09technomancyI have only deployed Mirah on App Engine. it was pretty bonkers, but that was probably more due to Mirah than App Engine. =)
14:10technomancyhuh; it's still there. cool.
14:10josteinkthe demos Ive seen for app engine has all been very straight forward
14:10josteinkit looks sexy enough
14:10josteinkIm just already very heavily invested into google stuff(tm) and I dont see the need to get even deeper invested
14:11josteinknot if other viable options exists
14:11bltavare_I have friends that use app engine for python and they kinda hate it, just saying
14:11josteinkyeah
14:11bltavare_specially the way you store data there
14:11josteinkIll try to look into heroku first
14:12josteinkthats at least a platform (which as far as I have heard) where people around the internets are able to contribute and make it better
14:12cemericktechnomancy: don't be ashamed of your FUD. Spreading it effectively is a good skill to have. ;-P
14:12josteinknot a single-god-google only sort of driven platform ;)
14:13technomancycemerick: the project I did there was completely nuts; really immature compiler plus two completely new runtimes. (app engine/android)
14:13technomancyI'm surprised it still works
14:14technomancyhttps://ferrante-della-griva.appspot.com/
14:14cemerickI cringe every time I see an appspot.com URL
14:15technomancyI think the only reason I got it running is that one of the Mirah compiler authors works on the App Engine team
14:15cemerickJust screams "this is a toy platform" to me.
14:16hiredmanI had a facebook app written in clojure on app engine for a while
14:17nDuff...dealing with AWS would be considerably more work.
14:17hiredmanI just wanted a bar chart of the ages of my facebook friends
14:18nDuff(pulling down and cross-correlating bid estimates from the Texas Department of Transportation)
14:18technomancywill be interesting to see how google's infrastructure compute platform turns out
14:19technomancydoes app engine have enough of a JDK to run a repl?
14:19hiredmanthe appengine platform is just weird
14:19rboydnDuff: that's hilarious
14:19hiredmantechnomancy: yes
14:19rboydnDuff: do you extort him with threats of releasing it to his employer?
14:20technomancycool
14:20hiredmantechnomancy: it is pretty complete, they just have some threading classes blacklisted I believe
14:20pbostromdoes anyone know why AWS micro is so slow? It seems like the drop off from small to micro is not linear compared to the specs
14:20technomancyhiredman: last I heard local filesystem as well?
14:20technomancyjava.io.File and friends
14:21rboydpbostrom: doesn't micro have some kind of cpu quota? I think it slows significantly when you're over quota
14:21hiredmantechnomancy: https://developers.google.com/appengine/docs/java/runtime#The_Sandbox
14:21hiredmantechnomancy: yeah, that too
14:21nDuffrboyd: No extortion involved. Management is aware of said app, and said coworker's claims of being too busy to do anything else correspondingly adjusted in realism.
14:21pbostromrboyd: makes sense, I remember reading something about CPU bursts
14:22technomancywhy would they disallow signed jars? that's weird.
14:26lucianpbostrom: micro is extremely vulnerable to bad neighbours *and* they throttle it
14:33pbostrommicro instances give me the most trouble when starting lein (or probably more generally, the JVM). Once my app is up and running, I don't really notice the performance hit. Admittedly, my app is not very CPU intensive
14:33hiredmanµ instances have always had trouble starting jvms, when they first became available trying to start a jvm on them would actually crash the instance
14:34technomancypbostrom: do you use trampoline?
14:34hiredmanlein starts 2 jvms
14:35pbostromtechnomancy: no I do not, maybe I should
14:39josteinkcreating webpages in enlive just feels like cheating :)
14:41borkdudejosteink the whole of clojure feels like cheating
14:46pbostromTBH, I haven't quite gotten the hang of deployment, I just run lein as root, even though lein calls me out on it
14:48gfrederickstechnomancy: out of curiosity, why not trampoline all the time? or at least by default?
14:49technomancygfredericks: it's a possibility. there are weird semantics around chaining that I'm still uncomfortable with. I want more people testing LEIN_FAST_TRAMPOLINE too.
14:49borkdudegfredericks the answer is correctness over convenience last time I asked
14:49amalloytechnomancy: what does LEIN_FAST_TRAMPOLINE do?
14:49technomancy`lein do compile :all, clean` doesn't work as you'd expect, for instance.
14:49technomancyamalloy: memoize away the entire lein JVM
14:50technomancysubsequent invocations of the same command jump straight to the project JVM
14:50amalloyhah. so a map, used somehow in bash, from lein-args to trampoline-file-output?
14:51technomancymore or less
14:51hiredmanhttps://developer.apple.com/library/mac/#documentation/opensource/Conceptual/ShellScripting/AdvancedTechniques/AdvancedTechniques.html
14:51hiredman"Using the eval Builtin for Data Structures, Arrays, and Indirection"
14:52technomancyamalloy: lein args and project.clj checksum
14:54TimMcThe map-updating can be done from Clojure, so that's nice.
15:00TimMctechnomancy: Would you want to include the lein version in there somewhere?
15:00ChongLihmmm so map over one coll is optimized for chunked sequences whereas with more than one coll it falls back on cons
15:00TimMcI don't know how often the trampoline script logic changes...
15:02josteinkpbostrom: yeah same here. thats how I hope to keep things until I get heroku or "something better" sorted out ;)
15:02josteink(with regard to ec2 and startup time)
15:03lynaghkibdknox: ping
15:05ohpauleezlynaghk: on the interwebs?!?!
15:06lynaghkohpauleez: I HAVE RETURNED!
15:07ohpauleezSICK!
15:07lynaghknext time I go to New Zealand I'll be sure to pack the Internet =P
15:07technomancyTimMc: good point; maybe an issue for that?
15:09technomancylynaghk: bouncer in ec2 us-west-2 dude =)
15:09lynaghktechnomancy: last mile always kills
15:10ibdknoxlynaghk: sup?
15:10lynaghktechnomancy: aws has something in Japan now, which may be a bit closer. The friend I was travelling with asked the very pertinent question: "Kevin, where is the Internet anyway?"
15:10technomancylynaghk: tried mosh?
15:10lynaghkibdknox: yo. I'm in San Francisco for the next week---was wondering if you wanted to grab a coffee
15:11lynaghktechnomancy: I remember running across this once before, but I'd forgotten about it. Looks really useful, thanks!
15:11technomancyI haven't used it, but I would if I were crossing the pacific over SSH on a regular basis =)
15:11wei_in compojure, how would I retrieve the payload of a request?
15:12wei_it's not encoded as application/x-www-form-urlencoded so not showing up even with wrap-params
15:12ibdknoxlynaghk: absolutely! What part of town are you staying in?
15:13lynaghkibdknox: okay to PM?
15:14nDuffHmm.
15:14Apage43wei_: It's :body on the ring map. (POST "/bleh" {body :body} …)
15:16wei_Apage43: thanks, that was it
15:19wei_had to use (slurp body) to get the actual content
15:19Apage43ah, it was a stream oslt?
15:21wei_it was a #<HttpInput org.eclipse.jetty.server.HttpInput@e9d222e>
15:21wei_that's why I couldn't find my original params when I printed out the entire ring map
16:35Frozenlockdnolen: accessing a field using (.-fieldname element) will not be munged, as opposed to (aget element "fieldname"), correct?
16:37dnolenFrozenlock: no .-fieldname will be munged. aget wont.
16:38FrozenlockAaaaand that explain why my code doesn't work :)
16:38Frozenlockthanks
16:44dnolenFrozenlock: if it's isn't a string, JS keyword, or JS native - Closure will try to munge it.
16:45ziltiIs there a good tutorial to start with Clojure's type system? I'd like to "extend" the reader.
16:46wei_when opening a browser repl with (repl/connect "http://localhost:9000/repl&quot;), ever get the error "Uncaught TypeError: Cannot call method 'setParameterValue' of undefined" ? it occurs in a library function, goog.net.xpc.CrossPageChannel.prototype.getPeerUri
16:47Frozenlockwei_: without advanced compilation?
16:47wei_without. it happens with simple and whitespace
16:48FrozenlockDid you call repl/connect after the page is fully loaded?
16:48Frozenlockfor example: (set! (.-onload js/window) #(repl/connect "http://localhost:9000/repl&quot;))
16:49wei_trying that
16:50wei_same error, weird. https://gist.github.com/4659442
16:51dnolenwei_: you need to declare the Google Closure Third Party jar as a dependency are you doing that?
16:52wei_in project.clj? I think so, just added that to the gist.
16:52wei_though, I never needed to declare it before, using lein-cljsbuild
16:56ChongLihmm
16:56ChongLitransient vectors are 90% slower than javascript typed arrays
16:59ChongLiI wonder if in certain cases it'd be cheaper just to do your mutation on a javascript typed array before converting to a vector
17:02mjiigcan anyone help me fill in the blank to make this evaluate to true? http://paste.ubuntu.com/1583778/
17:05Sgeo4clojure?
17:06nDuff...smells that way to me.
17:06amalloy4clojure has no such problem. some other sort of koan project
17:07technomancyor homework
17:07Frozenlocktechnomancy: clojure in school? Nice.
17:07mjiigunfortunately not in school
17:07mjiigclojure koans on github
17:09ChongLimjiig: are you aware of interpose
17:09ChongLi?
17:09mjiigno
17:09ChongLi&(apply str (interpose ", " ["hello" "mjiig"]))
17:09lazybot⇒ "hello, mjiig"
17:10amalloyi don't understand why reinventing clojure.string/join is so popular. it's not *that* hard to find, is it?
17:10winkjot really
17:10Raynesamalloy: I got a patch into kibit to replace any instance of 'apply str' with join.
17:10ChongLihaha
17:10RaynesAll bases are covered there, people just need to use kibit now.
17:10winkmjiig: join, vals, and some sorting
17:11ChongLiit's just a habit I guess
17:11winkmhm, kibit
17:12wink10month old ticket I never finished up with :(
17:12technomancyRaynes: wat
17:12ChongLiI'm leery of lint tools
17:12Raynestechnomancy: Be quiet single branch if boy.
17:12pjstadigkibit can be somewhat...schizophrenic
17:13ChongLiI recall haskell's lint tool frequently made suggestions that were type errors
17:13RaynesI've never encountered that in hlint.
17:13technomancyRaynes: there are tons of places where apply str is legitimate because you don't want to bother messing with the ns form to bring in clojure.string
17:13ChongLiI guess my code was pathological
17:13ChongLihaha
17:14Raynestechnomancy: I doubt there are many. join should be faster than apply str as well. They are not equivalent.
17:14brehautChongLi: im sure the right permutation of compiler flags would resolve the type errors
17:14technomancyRaynes: that's the kind of call only a human is qualified to make
17:14wei_I resolved my js error from a while back.. with "lein cljsbuild clean" ._.
17:15ChongLibrehaut: no, I think it was genuinely a malformed transformation
17:15TimMctechnomancy: Wait, you mean I *shouldn't* just use "Quick Fix" repeatedly in Eclipse until my code works?
17:15Raynestechnomancy: This is a lint tool, sir. In almost all cases you want join. If you don't want join, you ignore the lint.
17:15brehautChongLi: sorry sorry, was trying to have a laugh at compier option boilerplate in GHC code
17:15technomancyI already ignore the hell out of it because it makes bad suggestions.
17:15ChongLihey at least we're not using Go
17:15ChongLiwhere unused module imports are errors
17:16craigbrocleanliness!
17:16sshackNext to godliness.
17:16craigbromy resident Go hacker gets upset when the clojure compiler complains about my earmuffing non dynamic vars
17:16ChongLibrehaut: yeah I've seen my fair share of that
17:17nDuff /me tries using "lein kibit" for the first time, and gets a big fat NPE.
17:17ChongLihell, even Haskell's figured out that sometimes you just want the compiler to shut up and let you test one thing without having to fix all of the type errors
17:18pjstadigdon't hate on the type checker, it's just proving things about your code
17:18pjstadiglike how wrong it is
17:18hiredman*snap*
17:18ohpauleezhaha
17:18ChongLipjstadig: oh, I have nothing against that
17:18ChongLiit's just nice that you can turn it off
17:19ChongLiso that it replaces all ill-typed expressions with run-time exceptions!
17:19pjstadigstatic BURN
17:20technomancyI really don't want to start getting pull requests saying "hey I made a bunch of kibit-suggested changes" that make my codebase stylistically inconsistent.
17:21RaynesYou're awfully bitter these days, huh?
17:22pjstadigtechnomancy: just require people to sign a CA
17:22ibdknoxlol
17:22TimMcouch
17:22RaynesOr, you know, close the pull request and decline.
17:22technomancypjstadig: that'll take care of those pesky contributors!
17:22technomancy"WONTFIX: your patch is bad and you should feel bad"
17:23technomancyI hate declining pull requests =(
17:23brehauttechnomancy: dont forget to have jira as a second line of defense
17:26tickingthe frequent bashing of clojures contrib policy makes me wonder how long it will take until the project forks ^^
17:26ibdknoxa long time
17:26pjstadigforking would be bad for the community
17:27pjstadignot that the bashing is good for the community
17:27technomancyit would happen sooner if most of the problems couldn't be worked around in userspace
17:27ibdknoxthe community would have to be substantially larger
17:27pjstadigyeh
17:27pjstadig*yeah
17:27tickingibdknox yeah but PL communities tend to grow exponentially
17:28mjiigthanks for the help got it working now
17:28ibdknoxticking: I don't think that'll be the case with Clojure
17:28tickingibdknox which basically means a week from "thats nagging" and "all the forks" ;)
17:28ibdknoxhaha
17:29tpopehas anyone ever successfully forked a mainstream language?
17:29octagonhello everyone! is there a way to look up a var if you have a string with its name? like ((lookup "my-ns/doit") "foo")
17:29brehauttpope: other than microsoft ;)
17:29tpopeclojure is far from the only language that's difficult to contribute to
17:29tickingibdknox I think LT will give the community a big push on release due to news coverage
17:29weavejesterHum, incanter's docs are a little archaic
17:29octagonsorry, i mean in clojurescript
17:29craigbroLT?
17:29clojurebotdefmulti doc is ugly
17:29craigbrooh, got it
17:29amalloyoctagon: yes, but vars are generally intended to store things that you know about / use at compile time
17:29TimMcweavejester: Illuminated manuscripts?
17:30craigbrowell, it may not fork
17:30ibdknoxticking: the original blog post tripled the the traffic to the Clojure github
17:30pjstadigoctagon: clojurescript doesn't have vars
17:30craigbrobut you could get balkanization
17:30craigbroala CL
17:30amalloyin cljs? cljs doesn't have vars, so it's probably something like (aget js/window "x")
17:30craigbroit's something that languages where you write small composable bits are prone too
17:30tickingtpope I think it happened to a lot of them, all the lisps, for C every compiler is a fork, think of all the rubies ^^
17:30TimMcClojure would be hella easy to fork, being a lib.
17:30craigbroas opposed to languages where you write big frameworks
17:30weavejesterTimMc: Getting started pages from 2010 that assume Leiningen 1.1.0...
17:30ibdknoxtpope: no one outside of a company has successfully forked a language. As brehaut said, MSFT has forked many :)
17:30dnolenoctagon: if you plan on using advanced compilation you can't rely on stable ns names
17:31craigbroibdknox: err, lisps, C++, C....
17:31wkellydoes perl 5 continuing development count as a fork? :P
17:31tpopeticking: speaking to the ruby case, those aren't really forks, but alternate implementations
17:31craigbroibdknox: smalltalk, awk, sed....
17:31tickingwkelly, if so then do python and python 3 ;)
17:31craigbroibdknox: languages get forked regularly
17:31octagondnolen: have you found any significant improvement with advanced compilation? i haven't been able to see a difference myself
17:31ibdknoxcraigbro: I assumed that "successful" in this case means that the fork overtakes the original
17:32tickingtpope right, but I'm shure they're not 100% compatible ;)
17:32pjstadigforking happens because of community issues
17:32craigbrotpope:the difference between fork and different implementation exists only at time of creation, and usualy diverges after that
17:32pjstadigand if there's no hope of unification, then forking doesn't make sense
17:32dnolenoctagon: if you're aware of the type of optimizations at play it will be much faster - also huge code sizing savings
17:32weavejesterEven the getting-started wiki page for Incanter is 2 years old...
17:32tpopeI was setting a lower bar than "overtaking"
17:32craigbrohmm, weird deifnition of forking, but alright
17:32tpopebut I was specifically referring to source forks
17:32ohpauleezAs far as CA blues is concerned - it seems like you can email dev admins a signed CA, and they'll mail it in for you
17:32craigbropjstadig: forking happens for lots of reasons, including technological ones
17:33tpopewhich was the implied response to clojure's contrib policy
17:33octagondnolen: i know dead code elimiination is a thing, but generally i have small libraries that get compiled via lein, so i don't think much elimination can be done
17:33pjstadigcraigbro: technological differences mirror community problems
17:33craigbropjstadig: bullshit 8^)
17:33pjstadigcraigbro: that's it i'm forking clojure
17:33craigbropjstadig: I win!
17:33ohpauleezSo with the scanned CA + http://clojure-doc.org/ - this fixes two of the most frequently issues for Clojure community
17:34tickingpjstadig I'd call not being able to contribute to a language a community issue ;) , I got a tripple tested multi implemented ultra performance tuned partition-between lying around that would allow a twice as fast partition-by (by using it with (fn [a b] (not (==a b))) alone)
17:34hiredmanweavejester: what are you looking at incanter for? charts?
17:34weavejesterhiredman: Charts and basic stat functions
17:34craigbroI would give them some time to reconsider THEIR priorities
17:34craigbroclojure core that is
17:35craigbrobefore forking or something like that
17:35hiredmanweavejester: for chart stuff using jfreechart directly is not that bad, and it is more flexible then what incanter offers
17:35dnolenoctagon: if dead code eliminations isn't important to you then - then you can be more free w/ your style. But it will probably limit who will be interested in adopting your CLJS library.
17:35Natchdo I really have to create a new lein template if I want all my "lein new" project.clj files to include some sane defaults?
17:35tickingwavejester, yeah Incanter is a pita api wise, but there are not many options ^^
17:35weavejesterhiredman: It's just to get an idea of where the bottleneck of a system is. No apps - just need some visualization.
17:35RaynesNatch: Well, yeah. Not sure what you'd rather have.
17:36pjstadigright, you could always engage people about changing the default template to have "sane" defaults
17:37RaynesIf the defaults are currently insane, I'd happily take a patch to change them to sane ones.
17:37Raynes:p
17:37Raynestechnomancy and I don't care much for insane.
17:37octagondnolen: i should be able to ^:export symbols in my namespace and be able to find them via js/my_ns.foo, right?
17:37octagondnolen: even under advanced compilation
17:37pjstadigi think we should have temporarily insane defaults IMHO
17:38technomancyNatch: if you have development-time tools you want to share across all your projects, you should put them in your user profile
17:38NatchRaynes: sane for me that is, like different license and such
17:39RaynesNatch: Yeah, that's what the templates are for. I know it's quite a bit of overhead just for changing a few things in project.clj, but we went for the most flexible option. It would have been quite a bit less flexible to just have 'project.clj' templates.
17:40Natchtechnomancy: yes, I already do that. what I wanted was something like a setting in a ~/.lein/ file that would put a few things in all my new project.clj files
17:40RaynesThings like luminus wouldn't have been possible.
17:40NatchRaynes: honestly I'd rather write a script that does it for me than bother with templates. so much work for such a small change
17:41technomancyjust the license?
17:41RaynesIt's likely just copy paste, find replace, and your change. If you decided to go the template route that is.
17:44RaynesIt's a pretty good language.
17:44RaynesIt's okay.
17:46Natchtechnomancy: pretty much
17:47technomancyit's not MIT/X11, is it?
17:48Natchtechnomancy: it's not my default license, no
17:48technomancyNatch: part of the problem is that it's only recently that we've had access to a comment-preserving reader
17:48technomancyso operations which treat defproject as data and write back to project.clj haven't been possible until sjacket
17:50tpopewas that a setup for some lecture about MIT/X11?
17:50Raynestpope: Yes.
17:50RaynesMeet technomancy.
17:50NatchMIT/X11 is bad now?
17:50tpopeI would like to hear
17:50technomancyNatch: it doesn't have a patent protection clause
17:50Natchtechnomancy: I see
17:50technomancyso someone can submit a patch, get acquired by Oracle, and sue your users
17:51technomancymost licenses longer than a page don't have this problem
17:51Natchouch
17:55technomancycourse you can always erect a CA process with its own explicit patent grant to prevent that
17:55technomancyor you could pick a more discerning license
17:57mybuddymichaelSo what's the X11-plus-patent-clause license?
17:57tpopegoing out on a limb here but I'm guessing it's the default license
17:58tpopeaka eclipse
17:58technomancymost people pick apache v2, but that has this annoying "you must put license boilerplate in every single file" clause
17:58technomancyif they want to avoid copyleft
17:58tpopeoh fuck that shit
17:58sshacktechnomancy: In X11's defence, it was created back in a time when computers were in black and white.
17:59technomancyI'm not aware of a good non-copyleft non-boilerplate patent-safe license
17:59tpopeso why is eclipse the default?
17:59technomancyunless you want to take a scalpel to apachev2 and perform a clause-ectomy
17:59ChongLirecommended for lawyers only IMO
18:00technomancytpope: it's what Clojure uses and I don't hate it, mostly
18:00technomancymy least favourite thing about it is the name
18:00ChongLiyeah it's confusing
18:00tpopeI'm no lawyer but I see the word patent in there like 10 times
18:01tpopeyes I hate the name :(
18:02blrtpope: does your appearance in this channel suggest the possibility of life improvements for pariah clojure vim users? :)
18:02tpopeblr: have you not seen foreplay.vim?
18:02blrno O.o
18:02tpopeI never posted it to the mailing list :/
18:03TimMctechnomancy: If you *really* want to scare off contributors, you can add an IP assignment clause. "While you have Leiningen's source code checked out, any work you do that I might find useful in the future is assigned to me."
18:03tpopewas saving that for post-rename
18:03technomancyTimMc: I'll run that by salesforce legal
18:03TimMcIf companies do it, why not FOSS project? :-P
18:03tpopebut I don't have a good name to rename too
18:03blroh, good show man!
18:03jballanctpope: what's wrong with the name?
18:03jballanc;-)
18:03blrthis looks swanky
18:03mybuddymichaeltpope: The name is dynamite.
18:03tpopejballanc: some people have expressed concerns with evangelizing it to their colleagues
18:04tpopea fair point, I guess
18:04mybuddymichaelHonestly, vim-intercourse would be more apt.
18:04mybuddymichaelThat's how great it is.
18:04tpopeI try not to have those kinds of colleagues but to each his own
18:04mybuddymichaelBut I digress.
18:04blrtpope: I think most vim users are probably all a bit broken anyway, can't imagine it would be a problem
18:04jballanctpope: tell them it's named after your favorite Boston song ;-) - http://www.youtube.com/watch?v=7HuLpztWyFA
18:04blrlet the prudes use eclipse!
18:05tpopeblr: that's what I said when I named it
18:05tpopenobody complained for a month
18:05ChongLiI like the close-quarters-combat mnemonic for invoking foreplay
18:05tpopebut then like 3 people voiced concerns
18:05clojurebotmax people is 317
18:05ChongLicqc
18:05ChongLifantastic
18:05tpopeChongLi: neat mnemonic
18:06dnolenoctagon: yes
18:13babilentpope: I was one of those three and /I/ don't really mind the name. My comment was spurred by comments from collegues and my gf ... I don't mind the name, but /some/ people will have a problem with it.
18:13babilenseriously, if I would waste time and energy on something like that I would get nothing done :)
18:14tpopewell another didn't really mind the name either
18:14tpopeit's basically just this redl guy
18:14tpopemaintaining a butchered fork just because he doesn't like the name
18:14babilenI was quite sad when I read that mail
18:15mybuddymichaeltpope: I'd say definitely don't change the name just for one guy.
18:15babilenThe features look useful (I haven't found time to investigate fully), but forking over something so trivial is, well, a bad step.
18:15jsnoob_are there any good orms for clojure? i didn't get much when i tried google, so i'd have to assume not
18:16tpopejsnoob_: spoiler alert: clojurists hate ORMs
18:16babilenjsnoob_: korma? (not a real ORM)
18:16weavejesterThere's a lot of SQL abstraction libraries
18:16babilenfunctional objects in persistent mutibility heaven?
18:17technomancyjsnoob_: there are DB libs, but nothing particularly satisfying yet
18:17weavejesterBut ORM is inherently OOP.
18:17technomancyall existing SQL libraries are widely regarded as having deep-seated shortcomings.
18:17craigbroreally?
18:17craigbrowhat is kormas?
18:17tpopespeaking of stuff clojurists hate
18:17tpopespeclj
18:18tpopethis guy says it's popular https://github.com/tpope/vim-foreplay/issues/45
18:18tpopeI don't believe him
18:18jsnoob_tpope, any particular reason why?
18:18ibdknoxcraigbro: nothing lives up to technomancy standards
18:18jsnoob_not like i can't write a join, it's just a bit easier to prototype without messing with sql
18:18weavejestertechnomancy: I think some could be improved, but I'm not sure I'd say they had deep-seated shortcomings...
18:18tpopeI don't want to believe him
18:18craigbroI can think of things I would want changed in kroma, but no deep-seated shortcomings
18:18technomancycraigbro: a few main things: 0) it forces connection pooling which should be an orthogonal concern, 1) it forces a top-level connection def and doesn't let you handle scoping connections yourself, and 2) entity definitions are coupled to vars and can't be handed around in a really first-class way.
18:18technomancy0 and 1 could probably be fixed
18:18TimMctpope: Changing the name is probably appropriate.
18:19technomancywithout too much hassle
18:19tpopejsnoob_: they're just overly complex and not particularly functional
18:19craigbroI don't use entities
18:19ibdknoxtechnomancy: none of those are close to deepseated
18:19weavejestertechnomancy: Actually now that you mention it, I agree with all those points :)
18:19weavejesterBut I'm not sure I'd call them deepseated
18:19craigbrohehe
18:19ibdknoxtechnomancy: you could have easily fixed those in the time you spend telling everyone how shitty it is
18:20TimMctpope: The current name kind of gives a "naming is hard and so am I" sort of vibe.
18:20weavejesterWoah, let's be nice here
18:20craigbroI think thats a valid response
18:20tpopenaming is hard and so is expiring caches
18:20ibdknoxweavejester: everytime someone mentions korma he does this.
18:20technomancyok, sorry; I was thinking more of c.j.jdbc with the deep-seated comment.
18:20craigbroit's working quite well for me
18:21tpopeI don't really like the name, I just like everything else less
18:21TimMcheh
18:21hyPiRiontpope: naming is hard, but expiring caches are easier than finding a good system design
18:21weavejesterMy problem is more with SQL than any abstraction layer.
18:22craigbroI find that my actual engineering problems are more deep-seated than any fail in a clojure library or tool that can't be patched with a little (load "monkeypath.clj") action
18:22weavejesterIt's such a bad language, it's hard to write anything good around it.
18:22hyPiRionAt least you can figure out if your caches are erroneous or not, but that's not the case for design.
18:22craigbroweavejester: I do a ton of functioanl sql generation with korma, it's pretty sweet. I also help implement an SQL syntax in CL (see UncommonLisp, also an ORM) ages ago
18:23craigbroi find functional generation as useful, and often easier to deal with, than the syntax in USQL
18:24ibdknoxweavejester: it's a hard problem :( I would argue it's not even SQL's fault so much as RDBMs just don't actually match how we write/think about software.
18:25craigbroI would have to understand weavejester's issues more to comment on that, ibdknox
18:25ibdknoxah
18:26weavejesteribdknox: I have a few issues with the relational model in general, but more with SQL.
18:26ibdknoxyeah, I guess he might've just meant that it doesn't make it easy to do composition
18:26weavejesterWell, yep, that's a big one :)
18:26ibdknoxyeah, that one is just plain stupid
18:26craigbrocomposition?
18:27craigbroyou mean combining queries together?
18:27craigbronot using union and such...?
18:27ibdknoxor parts of queries
18:27weavejesterBeing able to build a query out of smaller components.
18:27craigbrooh, I wrote some of those
18:28craigbro(ensure-joined...
18:28ibdknoxthings like order shouldn't matter
18:28ibdknoxwhen it comes to the clauses
18:28craigbrothat's easy to get around
18:28craigbroyou are building a map representing the query anyways
18:28craigbrospitting it out in proper order doesn't matter
18:28weavejesterLike… [[:from :users] [:where (> :id 1)] [:project :name]]
18:29ibdknoxright, in Korma it doesn't matter
18:29craigbrooh, I thought we were talking about korma
18:29ibdknoxbut it's a fundamental failing of SQL's design that it can't do that itself :)
18:29craigbrook, well, that's a lame complaint
18:29craigbrosorry
18:29weavejesterBut all SQL abstraction systems have to do a lot of work to get to that point.
18:29craigbrono
18:29weavejesterAnd it's almost always imperfect.
18:29craigbrothe clause sets are well defined
18:29ibdknoxeh
18:30craigbrothe order is well defined
18:30craigbrook, maybe I'm being too glib with that "well defined"
18:30ibdknoxwith vendor specifics it's not
18:30weavejesterAlso SQL sorta-kinda-not-really cares about order.
18:31weavejesterLike if you have a bunch of joins the order doesn't matter
18:31weavejesterBut put in a subselect and it does.
18:31weavejesterSQL groups together a bunch of separate relational operations
18:33weavejesterProjection (which SQL calls select), selection (which SQL calls where), renames (as), and all the joins
18:33craigbroweavejester, ibdknox: I have 1600+ lines of functioanl sql composition using Korma 8^)
18:33ibdknoxdamn
18:33ibdknoxlol
18:33weavejesterIt's like having a class when what you want is function composition.
18:34craigbroit works
18:34craigbrowhat I find could use some improvement is composition of conditionals
18:34craigbrothey are a bit opaque at the public korma api level
18:34ibdknoxyeah
18:34craigbroI have some helpers to do things like join to a table if it's not already joined
18:35craigbrocomposition of fields is fine (tho it's a bit surprising when you add a fields clause to a select that had no fields, and losea bunch of stuff that was in the results before (because the * is replaced y the fields)
18:35craigbroalso, composition of order-by clauses would be nice (but a bit tricky)
18:36ibdknoxcraigbro: when it comes to fields what is the behavior you would expect?
18:36craigbrowhat happens now, it's just mildly surprising
18:36ibdknoxyeah, I certainly don't disagree
18:36rationalrevoltIn compojure, are (GET "/app*" ..) and (GET "/app/*" ..) mean different routes? with the for former requests to /app and /app/foo go through, but with the later only /app/foo goes through
18:37craigbroI would like to be able to extract theconditional clause
18:37weavejesterrationalrevolt: "/app*" would allow "/appfoo" as well as "/app/foo"
18:37rationalrevoltyup, thats true
18:38weavejesterrationalrevolt: With regard to the ending /, I think I need some sort of redirect in the route macros, perhaps.
18:38craigbroibdknox: what I have found tho, is that by the time my functioanl SQL composition gets too hairy, I'm already confusing the hell out of the query planner 8^)
18:38weavejesterBecause "/foo/" should redirect to "/foo". A 200 OK response from both would be wrong.
18:39craigbroibdknox: which tells me I should be making some derived tables or some other means of doing the query
18:39ibdknoxlol
18:39craigbrowell, it's true 8^)
18:40craigbroI gota 4tb postgresql server sitting on a big ZFS pool, and if I make it cry, then... well, not much more I can ask of postgresql
18:40craigbroin other words, I don't need composition to be better at the korma level (tho I do have some mild complaints)
18:41craigbrowhen I need to do is use a different tool, instead of an RDBMS in some cases
18:41rationalrevoltweavejester: another similar question - in compojure.route/resources - should specifiying the options with {:root ""} and {:root "/"} mean different? When i tried the former works and the later doesn't
18:41craigbroibdknox: other than composing conditionals (let me add a (where clause to a query, ORing it with the existing one....))
18:42weavejesterrationalrevolt: Java resources don't have a beginning "/". (Normally, anyway…)
18:42weavejesterrationalrevolt: And setting the :root to "" is a bad idea, because it exposes your source code.
18:42ibdknoxcraigbro: that's a hard one
18:42craigbroibdknox: adding WHERE operators like ILIKE should be a standard operation (def-conditional-op or something
18:42ibdknoxcraigbro: that would be relatively straightforward to add I think
18:43ibdknoxcraigbro: the right course of action is probably to dump strings
18:43craigbroibdknox: also, I have some monkeypatches to add UNION and INTERSECTION of queries
18:43craigbroibdknox: have you see USQL?
18:43ibdknoxnope
18:43craigbroibdknox: breaks down the full sql syntax, from the token level up, into CLOS objects
18:44craigbroibdknox: you can then emit those as strings for various target DBs
18:44rationalrevoltthe ring resource-response works the same for both
18:44cemerickit sounds like Clojure/lein on windows is a solved issue these days...
18:44craigbroibdknox: obviously, being clojure, it would be maps, not objects. And I think right now in korma the only things like that already are conditionals, right?
18:44weavejesterrationalrevolt: IIRC that's because it has some code that removes a beginning "/"
18:44technomancycemerick: sure, just use ccw =)
18:44cemerickanyone here have issues re: windows + clojure?
18:45technomancycemerick: having to manually download curl is pretty silly
18:45cemericktechnomancy: well, ccw doesn't run lein tasks, and I probably wouldn't ever use it for that, anyway :-)
18:45technomancyoh... I didn't realize that. is it in the works?
18:45cemerickI'm OK with that. curl sucks pretty badly.
18:46cemericktechnomancy: you'd have to ask lpetit what his current priorities are, but I'd guess not
18:46ibdknoxcraigbro: it uses vectors in some spaces, but it keeps most things as data until the end
18:46technomancyI was vaguely considering writing a bin/lein replacement in elisp that could launch a Leiningen nrepl server and talk to it from eshell.
18:46cemericktechnomancy: except for `lein repl`, which will soon replace all of ccw's custom launch stuff
18:46ibdknoxcraigbro: it gets aggressive with string creation in where clauses, but I don't remember why I did that originally
18:46rationalrevoltweavejester: yup, thats correct
18:47technomancymostly just to prove a point to people who lord it over bash that powershell is OOP instead of string-based.
18:47cemerickheh
18:47technomancybut also to help with startup time
18:47technomancykind of a resurrection of 1.x's `lein interactive`
18:47cemerickwell, you have to give the powershell folk credit for being usefully contrarian there
18:48craigbroibdknox: oh, some oher minor nits, would prefer it show me queries with the vars included, not the ?'s 8^)
18:48technomancywell, they're hardly the first to notice that "everything as strings" is not a good least-common-denominator.
18:48craigbroibdknox: makes it a bit of a pain to EXPLAIN a generated query of any complexity 8)
18:49amalloycraigbro: i doubt if korma actually replaces the ?s itself, so it doesn't really have queries with vars included
18:49ibdknoxcorrect
18:50ibdknoxdelegates to JDBC so that I can't fuck it up
18:50ibdknoxscrewing up query escaping = not cool ;)
18:50craigbroamalloy: Yah, I know
18:50craigbroamalloy: if it coudl get the SQL from JDBC and present that... woudl be ideal
18:50cemericktechnomancy: I think they're OK with not being first ;-)
18:50amalloyibdknox: isn't being on the front page of HN cool?
18:50craigbroas it is, I either hit my DB logs, or just edit it by hand
18:50craigbro??
18:50lazybotcraigbro: Definitely not.
18:51ibdknoxamalloy: hm?
18:51amalloyif you messed up query escaping you'd be cool
18:51ibdknoxah
18:51ibdknoxhaha
18:51craigbroamalloy: don't do that 8) I horridly loaded HN and was about to wake my ops guy
18:51ibdknoxamalloy: oh yes. I mean, hey, the rails kids are doing it.. :D
18:51craigbrohurriedly
18:52ibdknoxnot that we can say much given the number of JVM zero days that have been coming up lately...
18:53craigbroibdknox: sandbox escaping, not a issue for server side apps
18:58craigbrothe first library I ever wrote was an ORM for perl (97 or so), then I ended up using EOF for a few years, and then I co-wrote an ORM in common lisp, and then used lots of ActiveRecord, and then lots of DataMapper -- good riddance to all of them, hello FRP!
19:02warzfiber reinforced plastic?
19:02ibdknoxfunctional reactive programming
19:03technomancyI'm working on a branch of clojars that uses event sourcing instead of SQL
19:03technomancyof course, clojars is cheating since the data set is trivial
19:03technomancybut it's fun
19:04ibdknoxthat's neat
19:04hiredmanI bet you can buy fiber reinforced plastic on amazon industrial
19:04warzis FRP another way of saying event driven?
19:05warzkind of like javascript or something
19:05warzevent emitters in js
19:05ibdknoxno
19:05ibdknoxwarz: http://elm-lang.org/
19:05ibdknoxcheck that out :)
19:05warzis my head going to explode
19:05hiredmanelm is functional reactive, not functional relational, no?
19:06mybuddymichaelibdknox: From that site: "some values change over time"...
19:06technomancyhiredman: same acronym either way =)
19:06mybuddymichaelಠ_ಠ
19:06ibdknoxhiredman: oh, I thought we were talking about reactive. But you are probably right lol
19:06hiredmanfrom the context I got relational
19:07ibdknoxthat would make sense
19:08craigbroFRP = functional relational programming
19:08craigbroin my use
19:08craigbronot functional reactive 8^)
19:09craigbroI'm out...
19:09hiredmanthe less mentioned frp, but larger driving force behind clojure and datomic
19:11rkzhi guys I'm writing a simple rest api wrapper, just wondering what the best way to store the creds is? sometihng like make-api-client that takes creds map and returns a closure?
19:11rkzany good exmples?
19:12hiredmanwhy not just use the creds map?
19:12rkzfor every fn call?
19:12hiredmanrkz: yes
19:12rkzcould do but might be a bit annoying when using from repl
19:12warzelm looks cool
19:13hiredmanrkz: less annoying then trying to gin up some kind of opaque closure?
19:13rkztrue
19:13hiredman(do-something {:user ... :pass ...} some-data more-data)
19:14rkzlooking at this for inspiration, but I think defining protocols is overkill https://github.com/sunng87/reddit.clj/blob/master/src/reddit/clj/core.clj
19:14hiredmanhttps://github.com/hiredman/propS3t is an s3 library that just uses clojure datastructures, it is pretty nice to work with, if I do say so myself
19:21n_brkz: It's pretty idiomatic to have something like what hiredman suggested
19:21clojurebothiredman is lazy
19:22n_bmuch moreso than a closure. Look at Raynes' Tentacles library for an example
19:30rkzok I'm with you
19:31rkzgoing to do it that way
19:31rkzthen maybe do something like this http://cemerick.com/2011/10/17/a-la-carte-configuration-in-clojure-apis/
19:39aaelonycan anyone recommend a good, free profiler?
19:47TimMcclojurebot: FRP?
19:47clojurebotFRP is functional reactive programming, or maybe fiberglass reinforced plastic
19:50TimMchiredman: Have you started making changes to clojurebot's factoid interface?
19:52tmciverI'd like to separate the interface to a data store from the implementation so I could easily change between using SQLite, MySQL or XML, for example. Is there an idiomatic way to do that in Clojure?
19:52tmciverIs defprotocal an accaptable way to do this?
19:54tmciverI suppose I could use a set of same-named functions in different namespaces with different corresponding implementations.
19:55ChongLitmciver: the key issue is the differences between the various back-ends
19:55amalloyprotocols or multimethods would be the way to go, although honestly you'll probably discover that the differences are too significant to paper over
19:56ChongLithis ties right into Clojure's philosophy of not wrapping
19:56tmciveramalloy: so I'd be better of just committing to a single storage mechanism?
19:56ChongLiClojure deliberately exposes the power of its host platform (the JVM or js in the case of CLJS)
19:57ChongLiif it used a wrapper for portability, you'd be stuck with the intersection of all the platforms
19:57brehautamalloy: but lossy abstractions are what polymorphism is all about
19:57TimMctmciver: It depends on how much of each backend's specialties you want to take advantage of.
19:58ChongLiand how much effort you're willing to put into your library knowing it'll have these limitations
19:58TimMctmciver: You'll also have to make sure your abstraction either doesn't guarantee ACID, or implement it for XML-on-disk.
19:59tmciverTimMc: Hmm, true. Perhaps I'd be better off sticking with SQL and using something like korma.
19:59ChongLikorma's a very nice library from what I hear
20:02ChongLiit certainly looks nice, judging from the code on its site
20:02ChongLiibdknox uses some nice designs for his sites too
21:02hiredmanis there a core.logic mailing list?
21:39hartoHello #clojure. If I have a symbol (e.g. 'VK_A), and I want to use it to get the value of a class field (e.g. KeyEvent/VK_A), what's the easiest way to do that?
21:40hartoe.g. the (working) equivalent of (let [x 'VK_A] (. KeyEvent x))
21:40dnolenharto: probably reflection
21:41hartoyeah ok, I suspected as much
21:43gfredericksharto: if you have the symbol at compile-time you can do it with a macro
21:43harto,(clojure.lang.Reflector/getStaticField "java.awt.event.KeyEvent" "VK_A")
21:43clojurebot#<RuntimeException java.lang.RuntimeException: java.lang.ExceptionInInitializerError>
21:44hartogfredericks: yeah I messed around with that but couldn't see a nice way to do it
21:45gfredericks(defmacro static-getter [sym] `(. KeyEvent ~sym))?
21:46hartohuh, guess I didn't try hard enough :-)
21:46gfredericksthen you'd call (static-getter VK_A)
21:47gfredericksnow I'm not really sure what's being gained anymore :/
21:47dnolengfredericks: nothing gained :)
21:48dnolenmacro means you won't be able to use a symbol stored in a local
21:50hartoright
21:51gfredericksalso since you said "easiest", eval is probably easier than relfection :P
21:52TimMc(-> java.awt.event.KeyEvent class (.getDeclaredField "VK_A")) ;;= 65
21:53TimMcwhoops, wrong one
21:53TimMc(-> java.awt.event.KeyEvent (.getDeclaredField "VK_A") (.get nil))
21:53TimMcharto: ^
21:56hartohmm
21:57hartoyeah, eval looks ok: (let [x 'VK_A] (eval `(. KeyEvent ~x)))
21:58dnolenharto: just note that eval in Clojure triggers compilation, probaly much slower than even reflection.
21:59hartothanks dnolen
22:00dnolenand by much slower, if you put that code in a loop, it can run only 2000 times or so in 1second on 2.66ghz i7
22:01gfredericksI just furb'd it at the repl and eval was 177 times slower
22:01dnolen177 times slower than reflection is crazy given how slow reflection is.
22:02hartoD:
22:02gfrederickstoday's lesson: don't compile your code in a tight loop.
22:04dnolengfredericks: on my machine it's >1000X slower than TimMc's suggestion.
22:04amalloygfredericks: but that's everyone's first instinct when they learn about lisp! data is code, so what if i built a genetic algorithm to generate programs!!! i could stop when it does what i want!!!
22:05dnoleneval is rarely a good answer
22:06gfredericksamalloy: quick, let's write a genetic algorithm and see if we can generate programs that access static members of classes!
22:06gfredericksthere's still time!
22:06amalloyyou could write a macro that does a bunch of reflection at compile time, and emits lookup functions that are fast
22:08fcabralHello, is it possible to use re-seq in cond but be able to bind the returned seqs?
22:10TimMc$latest hugod/criterium
22:10lazybotNo project by this name exists on clojars.
22:11TimMc$latest criterium
22:11lazybot[criterium "0.3.1"] -- https://clojars.org/criterium
22:31mcohen3there's a point in Hickey's "Language of the System" talk where he says it's your job not to create a system that's just about different services/systems triggering events on each other....i'm curious if any folks here can recommend some good (recent) reading material that talks about how to design distributed systems composed of services
22:42rationalrevolt&(doc refer-clojure)
22:42lazybot⇒ "Macro ([& filters]); Same as (refer 'clojure.core <filters>)"
22:47rclarksonhow do i url stringify a map?
22:53brehautrclarkson: how do you what now?
22:53rclarksonbrehaut: what?
22:53rclarksoni have a map i wanna convert into a url string
22:53brehaut"how do i url stringify a map?" that could mean so many things
22:53xeqirclarkson: are you looking for something like https://github.com/cemerick/url and how it handles :query ?
22:54rclarksonyeah i recall that it was part of ring
22:56brehauti suspect he's thinking of something in http://ring-clojure.github.com//ring/ring.util.codec.html like url-encode
22:57brehautbut i dont think it does what he htinks it does
22:57callenbotdammit, he left
22:58callenbotI was going to ask what his native tongue was
22:58callenbotbecause it obviously wasn't English.
22:58callenbotI'm going to guess...swedish.
22:58brehautbased on my own inability with english, i would never assume that
22:58tomojwhat was wrong with his english?
22:59callenbotbrehaut: hostmask included telia, he's sweidsh.
22:59callenbotswedish*
22:59callenbottomoj: couldn't express himself
22:59octagonhi! what would be the best way to go about defining functions in a namespace that are also in clojure.core, ex. map, identity, etc. How can i define these in my namespace without having to do core/map core/identity, etc all throughout my namespace?
23:00callenbotoctagon: why are you naming things like that?
23:00octagoncallenbot: well i'm making a library that does all the familiar things that are in core but with a different evaluation semantic
23:00brehautoctagon: :refer-clojure in your namespace
23:01octagoncallenbot: the client would use them as (x/map foo bar) (x/identity foo) etc
23:01callenbotoctagon: what sort of semantics?
23:01brehautoctagon: and then require clojure.core as something short
23:01octagonbrehaut: yes but i was trying to avoid that
23:01octagoni was thinking maybe there was a way to export symbols or something
23:01brehautoctagon: well dont. that would make your code impossible to reason about
23:02amalloyindeed. inside your library, you can't define a function called map and have the symbol 'map refer to clojure.core/map
23:02brehautoctagon: what you are asking is really to have two values for one name, and have the compiler magically guess the right one
23:03octagoni suppose i could have one ns like foo.impl that has my-map, my-identity, etc, and another namespace foo.core that does (def map foo.impl/my-map) etc
23:03octagonthen the user would :require foo.core
23:03brehautthat seems needlessly complex
23:03octagonthey could then use foo.core/map foo.core/identity
23:04TimMcgfredericks: I couldn't even get a benchmark out of criterium with the eval method. It just hung. :-/
23:04brehautalso, as an aside: core namespaces are a hack. use a better name if you can
23:04octagonbrehaut: how do you mean "hack"?
23:04octagonbrehaut: thanks for the help btw
23:05brehautoctagon: because single segment namespaces (eg foo) dont work nicely outside of clojure (ie in java) foo.core namespaces were created as a compromise
23:05brehautbut its forced
23:05brehautif you can have libraryname.meaningfulname its better
23:05brehautie, i have a library im writing called basilisk, and it bundles stuff so the primary namespace is basilisk.bundle
23:05octagoni see, thanks brehaut
23:05brehautno problem
23:06brehauti think lein does the right thing now with 2+ segment names now when creating a project
23:06octagonthe default thing with lein is to make the last segment "core" :)
23:07brehauthmm. im sure there was noise about fixing that
23:08octagoni am probably using an older version
23:08brehautive got my local lein into a funny state so im not using 2 release, otherwise i'd test it properly
23:09Raynesbrehaut, octagon: I've began namespacing and renamespacing my projects to have a me.raynes.<project-name> structure
23:09brehautRaynes: rdn naming is not panacea
23:09Raynesbrehaut: 'rdn'?
23:09brehautRaynes: reverse domain name
23:09Raynesbrehaut: So there is something wrong with my naming scheme?
23:10RaynesI was pretty sure it was nice. I have me.raynes.laser, me.raynes.fs...
23:10brehautit has pros and cons
23:10brehautpros, you get that
23:10RaynesLike?
23:10brehautcons, if ownership changes it can be weird
23:10brehautdepends how much you care about that i guess
23:11brehauti think if there was a single great solution, everyone would have agreed by now
23:11RaynesI'd just change the namespace if I cared.
23:11RaynesYeah, but what else would I do with laser?
23:11Rayneslaser.lightsaber.htmlstuff?
23:12brehautor just laser.html?
23:12brehauti dunno, im crap at naming
23:12RaynesI've had people give me crap over two segment namespaces.
23:12RaynesNot unique enough for some people.
23:12tomojwell "laser" is not unique
23:12tomoj..enough for me
23:12tomojbut datomic.api seems fine
23:12tomojas an example
23:12RaynesIf me.raynes.laser isn't good enough, I give up on naming anything ever.
23:13tomojyeah. me.raynes.laser is fine afaic
23:13craigbroRaynes: obvious answer here is, can the person who gave you shit about the namespace able to best you in hand to hand combat
23:13Raynescemerick is pretty skinny.
23:13tomojbut I think (hop?) as long as you have a unique first segment, dropping RDN in the ns is OK
23:13tomojI still use RDN in the group
23:14tomojs/hop/hope/
23:14craigbroi think the com.something.foobar naming is too verbose
23:14brehauttomoj, Raynes im pretty certain everyone has different criteria they want everyone elses naming scheme to adhere to, thus everyone bitches
23:15RaynesI didn't used to be a fan of it either,
23:15Raynesstill not really.
23:15RaynesI was under the impression that people would be unable to complain about this particular naming scheme.
23:15craigbroseems like an advertising trick to me
23:15RaynesI might as well go back to foo.core now.
23:15brehautRaynes: you must be new
23:15tomojdatomic pretty much makes you have to fully qualify in some places, so I abandoned RDN in ns's :(
23:16craigbrotomoj: that annoying difference between a unqualified symbol and a qualified one?
23:17tomojcraigbro: just that :com.loku.deezy/maybe is so much worse than :deezy/maybe
23:17tomojfor example
23:17tomojhmm, though 'deezy.api/maybe is not THAT much worse than 'com.loku.deezy/maybe
23:17tomojbut it seems like noise
23:18callenbotcom.loku.deezy/maybe is just a way of telling the world they're java scum and to be avoided at all costs.
23:18TimMccallenbot: Shush.
23:19TimMcYou're just a bot, what do you know?
23:19callenTimMc: leave the digital pet alone
23:19tomoj..you mean people who use RDN are java scum?
23:20TimMcI use RDN, but I own timmc.org, which I feel is short enough.
23:20TimMcAnyway, what's the point of :as if you don't use it, anyhow?
23:21tomoj:as makes it bearable, but datomic makes it hard not to fully-qualify some places. and no :as in edn
23:22callenbotalright alright, lets have a contributions context
23:22callenbotI've got 3,104 contributions for the past year on github.
23:22callenbotRaynes: y tu?
23:23brehautits not the number of contributes you've made, but what you do with them that counts
23:24callenbotbrehaut: I get paid by the KLOC.
23:25callenbotbrehaut: unsurprisingly, all my code is asm generated by m4.
23:26brehautif i were paid by line of assembler generated, i'd stick with the JVM
23:27callenbotbrehaut: I can't hear you over the SPEEEEEED
23:28Raynescallenbot: 1242.
23:28RaynesEr, 1424.
23:29callenbotRaynes: http://i.imgur.com/Gkh1BIQ.png
23:29callenbotRaynes: however, I'm willing to concede that you win in terms of open source contributions by a mile.
23:31RaynesEvery single thing I've done this year is open source, work included.
23:31callenbotRaynes: we can't all be hippies.
23:31callenbotRaynes: grumble mumble startups mumble YC mumble retire by 30 grumble grumble
23:33callenbotRaynes: your ears have homework: http://www.youtube.com/watch?v=WfgMZH7PSy4
23:35brehautthat song is 90% pingpong delay
23:35callenbotbrehaut: your mother is a member of the joy division at a racquetball training camp.
23:36callenbotbrehaut: and you didn't hear the proper part of the song, there's a build-up.
23:36brehautnext time, try not to lead with the 'your mother'
23:37SgeoHelp
23:38SgeoPotential employer asked for code for a project listed on my resume
23:38amalloybrehaut: "is a member the joy division at a racquetball training camp your mother"? doesn't work out as well
23:38SgeoI sent it, but it's among the less pleasant code I've written
23:38brehautamalloy: lol
23:38SgeoI did mention a project for which I wrote cleaner code and isn't on my resume
23:38SgeoHopefully they ask to see that code
23:38TimMcSgeo: Send along a critique of your own code, maybe?
23:39SgeoI did mention things in the email I disliked about the code
23:39SgeoWell, in general terms
23:39Sgeo(It's a bit repetitive, use of if 0 to comment out code that was used for debugging, etc)
23:42dnolenhiredman: LOGIC-109, hrm I cannot reproduce that on master.
23:48cakeherolawlz: http://cl.ly/image/0R3K3x391N0x
23:49Raynescakehero: Some of the problems on 4clojure are really stupid.
23:49cakeheroWell, it's not stupid - my answer is stupid
23:49callenbotRaynes: did you listen to the song?
23:49RaynesIt's pretty stupid.
23:49cakeheroheh
23:49Raynescallenbot: I didn't even click on it.
23:49Raynescallenbot: Give me rdio links, dude.
23:49cakeheroIt's nice to have a list of clojure problems to go through
23:49RaynesGet with the program, callenbot.
23:49callenbotdafuq.
23:50Raynescallenbot: Listening now.
23:50cakeheroconsidering it's like the 30th line of clojure i've written
23:50Raynescakehero: Don't get me wrong, 4clojure is great. I'm a developer of it.
23:50dnolenhiredman: actually I think I see what's going on - please try master when you get a chance.
23:50callenbotRaynes: http://www.rdio.com/artist/Collapse_Under_The_Empire/album/Crawling/track/Crawling/ if you still want the Rdio.
23:50Raynesamalloy did all the stupid parts.
23:51callenbotRaynes: which are?
23:51Raynescallenbot: You're a good person for going over there and getting that there link for me. I'm impressed.
23:51cakeheroRaynes excellent, I'll blame him
23:51callenbotRaynes: I'm hell-bent on exposing you to post-rock.
23:52callenbottechnomancy: Mega Man 2, best soundtrack ever.
23:52RaynesYou're just grumpy in general.
23:52RaynesWhat's megaman?
23:52technomancy...
23:52RaynesHahahaha, kidding, kidding.
23:52RaynesI'm not that young.
23:53warzlol
23:53warzbut seriously
23:53callenbotoh dammit. I thought for sure I'd have more commits than technomancy.
23:53RaynesI grew up with SNES.
23:53warzyou do know what megaman is
23:53warzdont you
23:53callenbottechnomancy: does heroku host their git on github?
23:53Rayneswarz: Yes.
23:53callenboter, vice versa.
23:53technomancycallenbot: with external mirrors, yeah
23:53warzman SNES was right before all of the really good games on NES
23:53callenbottechnomancy: http://i.imgur.com/Gkh1BIQ.png duel me.
23:53technomancywhoa protomen sell FLACs along with MP3. <3
23:54Rayneswarz: I also have emulators.
23:54RaynesOh wait, I guess that's illegal.
23:54craigbrocallenbot: wipeout, best soundtrack ever
23:54warzpsh, not even the same
23:54RaynesMy friend who isn't me has emulators.
23:54callenbotcraigbro: Wipeout is good but there's too much eurotrash.
23:54Rayneswarz: I've considered making an snes or nes controller interface with my 'puter for them.
23:55craigbrocallenbot: haha, too much sasha eh?
23:55technomancycallenbot: 2066; most of my work at heroku is maintenance
23:55craigbrocallenbot: it's burned into my head because of the zen state wipeout induced when racing
23:55callenbotcraigbro: *holds index finger and thumb together very closely* just a liiiiiil bit.
23:55warzRaynes, like a USB controller? My friend has one it works well.
23:55callenbottechnomancy: dammit!
23:55Rayneswarz: Yes, an snes-shaped usb controller.
23:55callenbottechnomancy: help me find somebody with more than me. It must exist!
23:56technomancycallenbot: I beat your longest streak though; 21
23:56callenbottechnomancy: solid.
23:56warzRaynes, actually the best is really just the gamecube controllers. those things kick ass.
23:56warzfor any thing
23:56warzthey have USB versions
23:57warzi tried blogging about my experiences with clojure as a newb, but i bet it makes no sense, heh
23:58warzi tried to make it make sense, anyways
23:59warzi use blogging as my way of teaching others because i feel liek i learn a ton when i have to explain it to somebody else