#clojure log - Jan 28 2013

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

0:00 rationalrevolt: In 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?

0:08 xeqi: rationalrevolt: yes, they are the same. It will match either, with the route-params having preference

0:08 well, almost the same

0:09 {{id :id} :params} instead of {{id "id"} :params}

0:10 rationalrevolt: hmm

0:14 i'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

0:16 technomancy: TimMc: I actually used that (symbol "") trick in Leiningen once

0:17 when 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

0:17 amalloy: rationalrevolt: there's probably a wrap-params middleware wrapped around somewhere

0:17 brehaut: wait a minute, java.jdbc has an sql generation dsl‽

0:19 xeqi: rationalrevolt: 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

0:22 callenbot: yogthos|away: luminus is looking pretty great. :)

0:23 technomancy: callenbot: come up to seattle

0:23 callenbot: technomancy: is there countryside that is accessible to Seattle?

0:23 technomancy: best clojure group per capita

0:23 callenbot: technomancy: I'm seriously considering Seattle.

0:23 technomancy: what's the contracting environment like there?

0:24 technomancy: callenbot: couldn't tell you re: contracting

0:24 rationalrevolt: xeqi: thanks

0:24 technomancy: country really isn't far though

0:24 callenbot: I was looking at google maps, trying to figure out where I could snag a homestead in riding distance of seattle

0:24 technomancy: we have a couple irregular attendees to seajure that come from bainbridge island even (other side of the water)

0:24 public transit is a joke unfortunately, but slowly improving

0:25 callenbot: technomancy: I ride a motorcycle, don't care.

0:25 technomancy: ah, gotcha

0:26 callenbot: convinced my friend to let me use Clojure for our portfolio site :)

0:26 technomancy: I'm just across the city limits to the north; I like it a lot. tons of parks and the mountains aren't far away.

0:26 callenbot: that sounds pleasant.

0:27 xeqi: but what if you hate coffee

0:27 technomancy: xeqi: dunno, you'd have to ask hiredman

0:27 callenbot: xeqi: I love coffee

0:28 technomancy: when we first moved up here every other weekend we were exploring a new park

0:29 during the summer it's the best place ever for working remotely: https://secure.flickr.com/photos/technomancy/tags/remoteoffice/

0:29 xeqi: do you have a lightbox?

0:30 callenbot: technomancy: d'awww, family.

0:31 technomancy: heh. most of those are old; kids are 3 and 5 now.

0:33 feel free to pm if you want to know more about seattle without boring the channel

1:05 magnars: You'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?

1:12 Here's my solution, if that triggers any thoughts: (mapv #(apply concat) (partition-all 2 (partition-by is-commit-header lines)))

1:52 francis: I'm having an exception occur ONLY when I'm runnning code in the REPL https://gist.github.com/4653543

1:52 I'm not sure why that would happen and would appriciate some direction.

2:07 brehaut: does clojure.java.jdbc have any diagnostics support?

2:08 Raynes: brehaut: It's awfully late for you to be around.

2:08 How rare.

2:08 brehaut: Raynes: woo public holiday

2:09 Raynes: and who doesnt like beating their head against an (apparently) obtuse SQL error of their own divising

3:10 nurettin: hi, is there an RSS or atom feed for newest clojure related libraries ?

3:37 noidi: nurettin, it's not quite what you asked for, but there's https://twitter.com/planetclojure

3:38 it lists new of clojure-related blog posts, which often are about new libraries

3:39 michaelr525: hello

3:48 nurettin: noidi: great source, thanks

4:00 noidi: here's how I made an rss out of it:

4:00 http://api.twitter.com/1/statuses/user_timeline.rss?screen_name=planetclojure

4:00 noidi: cool

4:00 nurettin: now it relays to my old phone :-)

4:34 josteink: //Get the current status from the DB

4:34 DocumentRow docRow = DocumentRow.GetFromIdxDocumentId(incomingInfo.DocumentId);

4:34 DocumentLockSemantics currentStatus = docRow.LockSemantics;

4:34 DocumentLockSemantics newStatus = incomingInfo.LockSemantics;

4:34 if ((int)currentStatus < (int)newStatus)

4:34 {

4:34 docRow.LockSemantics = newStatus;

4:34 docRow.Save();

4:34 if (currentStatus != DocumentLockSemantics.None)

4:34 {

4:34 _helper.EnsureDirectoryExists(new DirectoryInfo(_helper.GetVersionHistoryFolderPath(docRow, string.Empty)));

4:34 }

4:35 }

4:35 that's definitely not clojure and definite not intended for this channel

4:35 er. sorry

4:48 nurettin: josteink: looks very C#

4:48 josteink: it is

4:49 clgv: josteink: you should use pasting sites for other channels as well ;)

4:49 josteink: it was a very accidental paste :P

4:49 I was supposed to copy a URL and paste

4:49 instead I Ctrl-v'ed in the URL bar (instead of CTRL-c) without noticing ;)

4:56 clgv: josteink: so you are a ClojureCLR user? ;)

4:57 josteink: nah

4:57 I tried starting out there. figured it would be better/easier whatever

4:58 but I found much less support for it around than for plain, mainline JVM clojure

4:58 it's not like anyone will allow me to intermix F#-code, even less clojure-code, into our company's codebase

4:58 and if its not work

4:59 well. I just do plain jvm ;)

4:59 can you even use lein with clojureclr?

5:00 if you cant use leiningen, whatever clojure-related you are selling me, you will fail :P

5:17 clgv: josteink: there is a lein plugin for clojureclr, afair on the ML

5:23 josteink: still

5:23 I dont see enough benefits to going CLR

5:24 if nothing else, I see value in poking my nose in new stuff, stuff Im not exposed to 24/7 anyway

6:02 clgv: josteink: I'd only use it if I needed it in a .Net application

6:20 zby: cemerick - what is the signature of the function needed for :credential-fn?

6:20 I deduced #(if(= (% :username) (% :password)) {:roles #{::admin}} nil) - as a simple example

6:21 in the session there still seems that something is not set:

6:21 {:cemerick.friend/identity {:current nil, :authentications {nil {:identity nil, :roles #{:friend-testing.core/admin}}}}}

7:09 michaelr525: hey

7:10 i've created a number of different workers where each blocks on a rabbitmq message queue

7:11 what would be a good way to manage/organize them?

7:11 they all belong to a single web app

7:11 should i run one jvm process and spawn multiple threads or maybe run one jvm per worker?

7:21 bosie_: https://www.refheap.com/paste/9018

7:21 why would this give me a runtimeexception?

7:21 cemerick: zby: see https://github.com/cemerick/friend/#credential-functions-and-authentication-maps

7:23 clgv: bosie_: because you try to use a java function as higher order function. and thus the compile thinks you specify a static field there

7:23 *compiler

7:23 bosie_: clgv: i see

7:23 clgv: ,(doc mem.fn)

7:23 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: mem.fn>

7:23 clgv: ,(doc mem-fn)

7:23 clojurebot: It's greek to me.

7:23 clgv: ,(doc memfn)

7:23 clojurebot: "([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."

7:24 clgv: bosie_: you can either construct that function composition explicitely or use memfn

7:25 bosie_: clgv: i just tried and re-read the doc. sounds like it wouldn't work on static functions

7:26 clgv: ,((memfn Float/parseFloat) "0.12")

7:26 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: parseFloat for class java.lang.String>

7:26 clgv: oh right^^

7:26 bosie_: just asked out of curiosity, will use read-strings instead ;)

7:27 cgrand: TheBubsy: here

7:27 TheBusby: cgrand: hey there

7:27 cgrand: I don't understand your last msg

7:27 TheBusby: cgrand: how much data are you dealing with?

7:28 cgrand: TheBusby: not much, in my example it was between 1e6 and 1e7

7:28 TheBusby: cgrand: 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

7:29 in profiling I didn't see the reduce step as being too expensive, but the combine was consuming the bulk of the time

7:29 cgrand: TheBusby: ok you meant have the ability to pass a random function f who takes the reducer-chunk and yield the value

7:29 TheBusby: yes,

7:30 cgrand: no questions aced about how it (this function) performed its job

7:30 TheBusby: so instead of reducef, something like reduce-chunk-f

7:30 cgrand: I thought about that but it doesn't compose well

7:30 TheBusby: no it doesn't and it kind of breaks the model of ignoring the storage format

7:30 cgrand: if the coll is the result of a r/map for example it won't work

7:30 TheBusby: :(

7:31 tomoj: are you talking about clojure.core.reducers/fold or something new I'd like to see? :)

7:31 TheBusby: tomoj: fold

7:31 tomoj: oh, ok

7:31 TheBusby: reducers are *great*, until you try and output a map

7:32 cgrand: TheBusby: hence my proposal of having a "cleanup" function called on the same thread as reduce before combine get to see the result

7:32 TheBubsy, how does fold-in-map works?

7:33 tomoj: for map output, the combinef is merge?

7:33 TheBusby: cgrand: old way was this, https://gist.github.com/4655172

7:34 tomoj: that's the big issue, the combinef has to be merge.

7:34 and the bulk of the time will be spent in the combine step

7:34 until at the very end, you have one core pegged as merge handles two giant maps

7:35 tomoj: interesting

7:35 have you thought about how reduce-kv could help if you could use it composably?

7:35 how/whether

7:35 TheBusby: the problem is there isn't an efficient way to generate large maps

7:36 tomoj: right, guess it wouldn't help

7:36 TheBusby: just today I had to cut/paste half the PersistentHashMap.java source code to produce my own map

7:37 cgrand: try some quick profiling, I'd be surprised if too much of your time is in reducef and not combinef

7:37 cgrand: TheBubsy: 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

7:38 TheBusby: cgrand: you're right, excellent point

7:38 cgrand: when you only need to perform lookups into the resulting map there's a possible cheap workaround

7:38 TheBusby: even with a small percentage of keys though, how much of your time is spent in reducef?

7:39 cgrand: TheBusby: switching from naive reduce to naive fold -> nearly halved the runtime (about -45%) on a 2core CPU

7:40 going from naive reduce to transient reduce -> about -75%

7:40 so I conclude that merge is not my current hotspot

7:41 TheBusby: cgrand: fair enough. Apologize for hijacking your thread, but the merge issues has been dogging me too long. :(

7:42 cgrand: TheBubsy however I could use a faster merge on another project

7:43 tomoj: the cleanup function seems familiar

7:44 TheBusby: cgrand: the problem is it needs to be done in PersistentHashMap to be clean

7:44 it's so easy to divide and concur with the BitmapIndexedNode as you know all similiar keys are already grouped together

7:44 s/concur/conquer/

7:46 arcatan: are let bindings guaranteed to be evaluated in the order they're in source?

7:46 TheBusby: cgrand: you can do the transient persist! trick now if you use reflection?

7:47 cgrand: arcatan: yes

7:47 arcatan: cgrand: thanks.

7:48 TheBusby: cgrand: in your combinef just have something like (if (isa? foo ATransientMap)(persist! foo) foo)) no?

7:48 cgrand: TheBusby: no, transient have same-thread policy you can't call persistent! from the combining thread

7:49 TheBusby: cgrand: ah, I see

7:50 cgrand: gotta crash for the night, but it was good talking to you and I hope to hear progress regarding reducers+transients

7:53 tomoj: why put the cleanup in the combinef and not the reducef?

7:53 cgrand: TheBusby: https://gist.github.com/4655215 /cc tomoj

7:54 it only works when you can get by with only needing lookup on the merge map

7:54 tomoj: cool, a fn sentinel

7:56 (fn ([] (transient! [])) ([ret] (persistent! ret)) ([ret v] (conj! ret v)))

7:56 TheBusby: cgrand: also curious why foldcat is 3x slower than (r/fold (r/monoid into vector) conj coll) ...

7:56 cgrand: tomoj: 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

7:57 tomoj: yeah, the suggestion would be to have r/reduce call the cleanup function after reduce

7:57 although not sure how to do that without breaking everyone and now requiring an extra arity..

7:57 cgrand: TheBusby: no idea have never looked into it

7:58 tomoj: 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

7:58 tomoj: http://squing.blogspot.com/2008/11/beautiful-folding.html

8:00 cgrand: TheBusby, tomoj: gotta run, thanks

8:00 TheBusby: cgrand: have a great day

8:01 cgrand: TheBusby: good night

8:01 tomoj: hmm, agreed that is weird

8:24 ticking: I 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?

8:25 S11001001: ,[1 "hi"] ;ticking

8:25 clojurebot: [1 "hi"]

8:25 S11001001: ,(doc sort-by)

8:25 clojurebot: "([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."

8:26 S11001001: ticking: `map' is the other ingredient, bake for 30min at 350 degrees, let cool for 10min, enjoy

8:26 tomoj: &(->> ["foo" "bar" "baz"] (map-indexed vector) (sort-by second (comp - compare)))

8:26 lazybot: ⇒ ([0 "foo"] [2 "baz"] [1 "bar"])

8:27 ticking: S11001001 tomoj, the string sorting was an example, there are many other cases where one cannot provide a special comparator function

8:28 tomoj: what you're asking for is like metadata. 1) strings can't take metadata 2) positions aren't metadata

8:28 nurettin: tomoj: what is the meaning of second (comp - compare) ?

8:28 magnars: dependency inversion on database access: pass in a function that closes over the database atoms, or something else entirely?

8:28 tomoj: (comp - compare) is the reverse of the default compare

8:29 &(sort (comp - compare) (range 10))

8:29 lazybot: ⇒ (9 8 7 6 5 4 3 2 1 0)

8:29 nurettin: oh I see

8:29 second is the values

8:29 cool thanks

8:29 tomoj: second pulls out the strings from the pairs, then the comparator is applied on the strings

8:29 ticking: tomoj, 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

8:30 S11001001: ticking: what cases?

8:30 ticking: magnars 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

8:31 magnars: ticking: I think that was posted to the wrong person. I'm mostly thinking about dependency inversion in clojure now. :-)

8:31 ticking: magnars: ah sorry :D

8:32 nurettin: &(->> ["foo" "bar" "baz"] (map-indexed vector) (sort-by second(comp compare)))

8:32 lazybot: ⇒ ([1 "bar"] [2 "baz"] [0 "foo"])

8:32 S11001001: ticking: 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.

8:32 nurettin: tomoj: why does it require the whitespace after - ? is it just the rule or does it have an explanation ?

8:33 tomoj: there comp, function composition, is applied to two arguments

8:33 the first is -, the minus function

8:33 nurettin: so I have to put whitespace between function components

8:33 tomoj: if you try to write -compare it will think you're looking for a function called '-compare

8:33 ticking: S11001001 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

8:33 nurettin: awesome thanks

8:34 S11001001: ticking: "I dare you to tell me which which which points to in this sentence."

8:34 tomoj: you don't always need whitespace though

8:34 ticking: S11001001 what I want is the same only that there is one canonical element on which all operations are performed by default

8:34 tomoj: &((comp {:foo :bar}[:foo]) 0)

8:34 lazybot: ⇒ :bar

8:35 tomoj: but no good reason not to have a space between arguments..

8:35 ticking: S11001001 sorry non native is a habbit I picked up some time ago and it's hard ot get rid of ^^

8:35 nurettin: {:foo :bar} is that a hash with one key and [:foo] an array ?

8:35 ticking: nurettin: yes

8:35 nurettin: ticking: cool

8:35 tomoj: a vector

8:36 nurettin: ah ok I call it vector

8:36 ticking: nurettin [] denotes vectors though

8:36 nurettin: [:teh :vectorz]

8:36 hyPiRion: ,(vector 1 2 3)

8:36 clojurebot: [1 2 3]

8:36 tomoj: which is maybe analogous to what other languages call an array

8:36 hyPiRion: ,(hash-map 1 2 3 4)

8:36 clojurebot: {1 2, 3 4}

8:36 tomoj: but much better :)

8:36 nurettin: :this :looks :weird "why" "not" "like" "this" ?

8:37 is it like strings and symbols in ruby ?

8:37 tomoj: well, there is at least one incidental reason, Strings can't be made functions (yet)

8:37 hyPiRion: It's keywords. They stand out more than strings usually, and are used for different purposes.

8:37 tomoj: &(:foo {:foo 3})

8:37 lazybot: ⇒ 3

8:37 ticking: S11001001 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.

8:38 S11001001: ticking: assuming all "which"s are interchangable, then it's fine

8:40 nurettin: thanks everyone now I'm not a complete stranger to clojure :-)

8:41 * nurettin composes some functions in private

8:46 nurettin: are there awesome mysql/postgres ORMs written for clojure ?

8:48 mapping sql databases to clojure data structures

8:49 tomoj: no

8:50 :P

8:50 nurettin: heh that would be nice

8:50 tomoj: there are sql libraries

8:51 nurettin: according to this clojure seems to perform much better on their machine http://benchmarksgame.alioth.debian.org/u32q/benchmark.php?test=all&lang=clojure&lang2=jruby

8:51 except for regexes :D

8:53 I use jruby in production, but I have to cache like crazy

8:54 michaelr525: nurettin: korma sql is half way to an "ORM"

8:54 maps database records to clojure maps :)

8:54 tomoj: then that's, what 40% of the way? :P

8:54 p_l: a lot of ORMs are doing it wrong. And in a language like clojure you don't need what is typically shown as ORM

8:54 now, something akin to Sequel (a Ruby ORM), yes

8:55 nurettin: (has-many address {:fk :userID})) <- I like it

8:55 now if it has some left and inner joins it would be nice :D

8:55 michaelr525: it has

8:58 nurettin: lein looks interesting

8:58 leiningen

9:00 ticking: nurettin don't do clojure without it

9:00 nurettin it makes up 50% of the grase that lets clojure run so smooth ^^

9:00 * nurettin takes notes

9:08 nurettin: sooo noir korma and jboss let's see how long this takes

9:20 michaelr525: nurettin: last i heard noir was deprecated and became a library which is supposed to be used together with ring/compojure..

9:20 nurettin: what's the jboss part in all of this?

9:23 kristian-: michaelr525: ....and in Luminus, ref http://www.luminusweb.net

9:26 nurettin: michaelr525: it is what we use for web application production server

9:27 michaelr525: it has built-in timers, queues, services, jobs, etc.

9:27 vijaykiran: nurettin: then you might want to start with immutant :)

9:28 nurettin: vijaykiran: that will make my job much easier thanks :-)

9:28 * nurettin looks at luminous

9:31 jcrossley3: nurettin: are you looking to integrate with an existing jboss deployment?

9:31 tomoj: wasn't someone looking at url/repo metadata in project.clj's in github and/or pom.xml's in repos?

9:32 nurettin: jcrossley3: I'm planning to replace it :-)

9:33 jcrossley3: nurettin: we're in #immutant if you have any specific questions about it

9:36 nurettin: it will depend on how fast our lead developers can transition from C# to clojure :D

9:38 bosie_: 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?

9:38 hi ticking

9:39 ticking: bosie_, hey :D sory for being undercover for some time had a lot of stuff on my plate ^^

9:39 bosie_: ticking: figured. education is a bitch. ;)

9:39 ticking: yeah ^^

9:40 bosie_ you could do the above with a sequence or zip of some sort I think

9:41 bosie_: ticking: get all the keys and apply (get-in) over them

9:41 oh

9:41 actually, why not

9:41 ticking: bosie_ ah its only one nesting deep?

9:41 bosie_: ticking: yes

9:44 ticking: bosie_ hrm I think zippers are capable of doing thing like that, buts its some weeks back that I last used them

9:50 clgv: bosie_: thats easily achievable with a `for`

9:50 ticking: clgv a filter should probably already do the trick

9:51 clgv: ,(for [[_ m] {:1 {:3 "blah"} :3 {:3 "foo"} :4 {:8 "ewe"}} :when (contains? m :3)] (get m :3))

9:51 clojurebot: ("blah" "foo")

9:51 bosie_: clgv: damn, thats nifty

9:52 clgv: ,(for [[_ m] {:1 {:3 "blah"} :3 {:3 "foo"} :4 {:8 "ewe"}} {x :3} m :when x] x)

9:52 clojurebot: ()

9:53 clgv: damn the second should have worked as well

9:54 ,(for [[_ {x :3}] {:1 {:3 "blah"} :3 {:3 "foo"} :4 {:8 "ewe"}} :when x] x)

9:54 clojurebot: ("blah" "foo")

9:54 clgv: thats it^^

9:56 bosie_: so _ is like in prolog

9:56 clgv: bosie_: no, it is just convention for "I dont care for that value"

9:56 bosie_: what is the name of "_"?

9:56 clgv: underscore?

9:57 bosie_: lol yes

9:57 but why can you use it in this context

9:57 the for docs don't mention it

9:57 clgv: why not? you can use all UTF-8 encoded charachters except the reserved ones

9:57 bosie_: oh

9:57 right

9:58 nvm i thought it had magic to it

9:58 clgv: ,(let [𝛂 2 𝛃 3] (println "𝛂 + 𝛃 =" (+ 𝛂 𝛃)))+

9:58 clojurebot: 𝛂 + 𝛃 = 5\n

9:58 bosie_: right

9:59 clgv: pretty useful when doing math^^

9:59 bosie_: i expected the _ to do what you actually wrote

9:59 the :when part baked into the _

9:59 clgv: the underscore stands for "I do not care for the keys"

10:00 bosie_: well, it doesn't stand for anything. its just a variable name

10:00 right?

10:00 clojurebot: to 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:00 clgv: if you need a seq on a fixed level of a map hierarchy `for` is your friend ;)

10:00 bosie_: yes

10:00 a binding name

10:00 bosie_: ye

10:01 clgv: but only if that fixed level is known at compile time^^

10:01 bosie_: sure. the _ threw me. IIRC in datalog you would get this exact behavior with _

10:01 where _ is resolved to mean any variable that solves [_ :3]

10:02 which you are doing too, except you also need the :when clause

10:03 nvm thanks

10:16 clgv: btw

10:17 nvm, lets drop it. sorry

10:19 clgv: bosie_: lol, you can just ask. someone might answer ;)

10:20 bosie_: nah, i wanted to ask if you really think the for solution is better than a filter

10:24 clgv: bosie_: the following is even shorter: ##(keep :3 (vals {x :3}] {:1 {:3 "blah"} :3 {:3 "foo"} :4 {:8 "ewe"}}))

10:25 humm lazybot is lazy again

10:25 ,(keep :3 (vals {x :3}] {:1 {:3 "blah"} :3 {:3 "foo"} :4 {:8 "ewe"}}))

10:25 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: ]>

10:25 bosie_: clgv: thats the disadvantage of lazy eval. you never know when it will run

10:25 jk

10:25 clgv: ,(keep :3 (vals {:1 {:3 "blah"} :3 {:3 "foo"} :4 {:8 "ewe"}}))

10:25 clojurebot: ("blah" "foo")

10:26 bosie_: right

10:26 but i am looking for everything

10:26 nDuff: Are there conventions for the naming of anaphoric macros?

10:26 bosie_: {:1 {:3 "blah"} :3 {:3 "foo"}} in your case

10:28 clgv: oh, well. so you want no get-in but sa select-in-pred ;)

10:28 tomoj: I think the convention is pretty much "don't do anaphoric macros"?

10:28 bosie_: clgv: (filter #(comp (= :3.0 %) first keys second) {:1 {:3 "blah"} :3 {:3 "foo"} :4 {:8 "ewe"}})

10:28 ok not working

10:29 S11001001: tomoj: yep

10:30 tomoj: e.g. the new as-> takes a name

10:30 bosie_: clgv: yup, i guess you could say "select-in-pred"

10:31 tomoj: I've been thinking about how to write select-in

10:31 clgv: bosie_: you could use reduce-kv to build the new map

10:32 bosie_: clgv: my filter works

10:32 clgv: but the whole first keys second thingie bothers me

10:32 tomoj: doesn't seem to work to me

10:33 #(comp (= :3.0 %) first keys second) is a predicate that's always true

10:33 wait

10:33 what?

10:33 clojurebot: what is meta

10:33 bosie_: tomoj: tomoj (filter #(= :9.0 ((comp first keys second) %)) {...})

10:33 nDuff: tomoj: 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:34 clgv: bosie_: 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:35 ,(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:35 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: reduce-kv in this context, compiling:(NO_SOURCE_PATH:0)>

10:35 clgv: ,(clojure-version)

10:35 clojurebot: "1.4.0-master-SNAPSHOT"

10:35 clgv: :O

10:35 &(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:35 lazybot: ⇒ {:3 {:3 "foo"}, :1 {:3 "blah"}}

10:35 tomoj: nDuff: what is the anaphor?

10:35 clojurebot: monads are #<RuntimeException java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "=" at line 1, column 38.>

10:36 bosie_: clgv: &(clojure-version)

10:36 &(clojure-version)

10:36 lazybot: ⇒ "1.4.0"

10:36 clgv: clojurebot has some weird version 1.4.0 if it has no reduce-kv ;)

10:36 tomoj: I thought reduce-kv was added in 1.5

10:37 babilen: no, reduce-kv was added in 1.4

10:37 tomoj: ah, yeah

10:37 clgv: tomoj: you should write more 1.4.0 ;)

10:38 nDuff: tomoj: When called as (!setup-logging!), I'm defining logger, log-info, log-warn, &c. against the local *ns*

10:38 tomoj: I'm on 1.5.0-RC3 everywhere

10:39 nDuff: as new functions in the current ns?

10:39 bosie_: clgv: thanks

10:39 tomoj: mixfix bangs seem appropriate :)

10:40 nDuff: tomoj: Yes. Suppose I could take the function names as arguments, just to make it clearer.

11:02 AWizzArd: What is the difference between „ratio?” and „rational?”?

11:02 ticking: lol I'm doing clojure for almost a year now and still get bitten by contains? from time to time

11:02 ChongLi: ticking: bitten by?

11:03 * nDuff presumes this is relevant to contains? not doing O(n) searches but checking for whether keys exist in vectors.

11:03 ChongLi: ohhh yeah

11:04 you have to supply the index, not the value

11:04 this is where a type error would be helpful

11:04 ticking: ChongLi exactly

11:05 ChongLi actually I think a reasonable less expectation inducing term would have been better

11:05 ChongLi: this is one of those naming problems

11:06 ticking: I'd be happy with an additional 'in?

11:06 ChongLi: you can use some to check if a vector contains some value

11:07 ticking: yeah combined with sets, but checking for nil is still not possible with this

11:07 ChongLi: yeah to check for nil you gotta write your own function I suppose

11:07 using the nil? predicate

11:08 ticking: you'd have to do something like (apply or (map nil? col))

11:08 apply and rather

11:09 ChongLi: generally though it's not usually that useful to get a true/false answer about a collection

11:09 Bronsa: or and and are macros

11:09 you can't apply them

11:09 ChongLi: you'd usually be more interested in finding a specific value

11:10 ticking: really? damn

11:10 why for gods sake

11:10 ChongLi: because clojure is not a lazily evaluated language

11:10 you can't implement and/or with a normal function

11:10 ticking: ah I know so that they allow for shortcuts

11:11 ChongLi: and/or in haskell are just normal functions

11:11 ticking: ChongLi not really, macros allow just for call by name

11:11 ChongLi: which is nice because you can apply/map them

11:11 Bronsa: you can use some/not-any/every?

11:12 * nDuff supposes has-key? might have been better than contains?

11:13 ticking: nDuff yeah that was the first name I thought of as well ^^

12:08 Foxboron: Now, 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:09 technomancy: Foxboron: get the stable version instead

12:09 Foxboron: technomancy: Roger.

12:10 technomancy: why do ya push 2.1.0 too master if its not ready yet btw?

12:13 technomancy: Foxboron: because master is where things go that aren't ready

12:14 Foxboron: technomancy: ah i see. I am more used too that being in a own branch. Thanks for the help tho ^^

12:16 technomancy: np

12:16 are there any docs that point people to downloading bin/lein from the master branch? if so we should fix that

12:18 Foxboron: technomancy: i honestly believe its people's first reaction if they go too the github page. The lein docs point too stable tho.

12:19 technomancy: ya could consider switching the default branch from master too stable.

12:20 technomancy: I think that would change the branch people get when they clone too, which would be confusing

12:22 Foxboron: technomancy: thats actually true.

12:34 gfredericks: technomancy: did you ever express an opinion about the spies lib idea?

12:35 technomancy: gfredericks: just that tools.trace is worth looking at

12:36 gfredericks: technomancy: oh this was for testing not debugging

12:36 it's been suggested that spy is a bad name anyhow

12:37 the core functionality would be functions that track each of their calls so you can expect on them later

12:37 technomancy: right but it probably has mechanisms for what you want

12:37 just use swap! instead of println

12:37 gfredericks: "has mechanisms" as implementation details or part of the API?

12:38 technomancy: no idea; have only briefly glanced at it

12:38 gfredericks: okay cool; thanks

12:38 technomancy: just worth looking at in depth before embarking on your own adventure

13:13 ChongLi: technomancy: is there a recommended way for repeatably adding google closure libraries to a cljs project in leiningen?

13:13 ohpauleez: ChongLi: Usually you use a goog.jar provided somewhere

13:13 CLJS ships with one, there are a few others on Clojars

13:14 ChongLi: no I mean a 3rd party library

13:14 not a google one

13:14 a library written for the closure compiler

13:14 ohpauleez: You'd just jar it up and put it in a repository

13:14 ChongLi: oh ok

13:14 technomancy: ChongLi: never used cljs, sorry

13:14 ohpauleez: oooo what's the library?

13:14 ChongLi: gl-matrix

13:15 ohpauleez: ahh

13:15 technomancy: possibly relevant: http://www.webjars.org/

13:15 ChongLi: fast matrix math for javascript using typed arrays

13:59 * josteink notes that amazon EC2 "micro" instances are not the best choice for clojure-work evar

13:59 josteink: in fact, they are very, very, very slow

14:00 but since they are free, they are my best shot at deploying clojure code without it costing a fortune :P

14:02 nDuff: josteink: Clojure can be run in App Engine, IIRC

14:02 bltavare_: josteink: what about heroku?

14:02 nDuff: josteink: ...likewise, Heroku's free tier.

14:03 josteink: never tried either of them

14:03 free tiers sounds good for fooling around though :)

14:03 maybe I should google around for some howtos

14:04 bltavare_: https://devcenter.heroku.com/articles/clojure

14:04 josteink: this 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:04 I just want to have fun with clojure and enlive though, so I need something which can run it :)

14:04 nDuff: ...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:04 ie. want a datastore? Well...

14:04 josteink: yeah. not going to need that

14:05 technomancy: both 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:05 bltavare_: nDuff: you have the postgresql free tier as well

14:05 josteink: this will be a "hey this is my homepage. no. Im not going to bother to blog, so there are none" kinda page :P

14:05 that sounds good

14:05 technomancy: app engine doesn't give you a full JDK, but they give you access to their bigtable custom data store instead.

14:05 * josteink likes free tiers :)

14:06 josteink: technomancy: not sure i like the sound of non-standard datastores which cant be had anywhere else ;)

14:06 technomancy: you 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:06 josteink: anyway

14:06 thanks for the feedback

14:07 guess 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:07 nDuff: josteink: App Engine has a MySQL-compatible storage interface.

14:08 technomancy: ah, /me retracts his FUD =)

14:08 josteink: nDuff: ah good to know

14:09 even as someone who had a complete mysql meltdown last weekend :P

14:09 nDuff: ...note that I didn't say it was MySQL. :)

14:09 josteink: heeh

14:09 technomancy: I have only deployed Mirah on App Engine. it was pretty bonkers, but that was probably more due to Mirah than App Engine. =)

14:10 huh; it's still there. cool.

14:10 josteink: the demos Ive seen for app engine has all been very straight forward

14:10 it looks sexy enough

14:10 Im just already very heavily invested into google stuff(tm) and I dont see the need to get even deeper invested

14:11 not if other viable options exists

14:11 bltavare_: I have friends that use app engine for python and they kinda hate it, just saying

14:11 josteink: yeah

14:11 bltavare_: specially the way you store data there

14:11 josteink: Ill try to look into heroku first

14:12 thats 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:12 cemerick: technomancy: don't be ashamed of your FUD. Spreading it effectively is a good skill to have. ;-P

14:12 josteink: not a single-god-google only sort of driven platform ;)

14:13 technomancy: cemerick: the project I did there was completely nuts; really immature compiler plus two completely new runtimes. (app engine/android)

14:13 I'm surprised it still works

14:14 https://ferrante-della-griva.appspot.com/

14:14 cemerick: I cringe every time I see an appspot.com URL

14:15 technomancy: I think the only reason I got it running is that one of the Mirah compiler authors works on the App Engine team

14:15 cemerick: Just screams "this is a toy platform" to me.

14:16 hiredman: I had a facebook app written in clojure on app engine for a while

14:17 * nDuff uses App Engine when he has toys he wants to run on the free tier indefinitely -- something it's perfectly good for.

14:17 nDuff: ...dealing with AWS would be considerably more work.

14:17 hiredman: I just wanted a bar chart of the ages of my facebook friends

14:18 * nDuff has a webapp that automates the job of one of his fiancee's annoying coworkers (yes, really).

14:18 nDuff: (pulling down and cross-correlating bid estimates from the Texas Department of Transportation)

14:18 technomancy: will be interesting to see how google's infrastructure compute platform turns out

14:19 does app engine have enough of a JDK to run a repl?

14:19 hiredman: the appengine platform is just weird

14:19 rboyd: nDuff: that's hilarious

14:19 hiredman: technomancy: yes

14:19 rboyd: nDuff: do you extort him with threats of releasing it to his employer?

14:20 technomancy: cool

14:20 hiredman: technomancy: it is pretty complete, they just have some threading classes blacklisted I believe

14:20 pbostrom: does 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:20 technomancy: hiredman: last I heard local filesystem as well?

14:20 java.io.File and friends

14:21 rboyd: pbostrom: doesn't micro have some kind of cpu quota? I think it slows significantly when you're over quota

14:21 hiredman: technomancy: https://developers.google.com/appengine/docs/java/runtime#The_Sandbox

14:21 technomancy: yeah, that too

14:21 nDuff: rboyd: 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:21 pbostrom: rboyd: makes sense, I remember reading something about CPU bursts

14:22 technomancy: why would they disallow signed jars? that's weird.

14:26 lucian: pbostrom: micro is extremely vulnerable to bad neighbours *and* they throttle it

14:33 pbostrom: micro 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:33 hiredman: µ 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:34 technomancy: pbostrom: do you use trampoline?

14:34 hiredman: lein starts 2 jvms

14:35 pbostrom: technomancy: no I do not, maybe I should

14:39 josteink: creating webpages in enlive just feels like cheating :)

14:41 borkdude: josteink the whole of clojure feels like cheating

14:46 pbostrom: TBH, I haven't quite gotten the hang of deployment, I just run lein as root, even though lein calls me out on it

14:48 gfredericks: technomancy: out of curiosity, why not trampoline all the time? or at least by default?

14:49 technomancy: gfredericks: 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:49 borkdude: gfredericks the answer is correctness over convenience last time I asked

14:49 amalloy: technomancy: what does LEIN_FAST_TRAMPOLINE do?

14:49 technomancy: `lein do compile :all, clean` doesn't work as you'd expect, for instance.

14:49 amalloy: memoize away the entire lein JVM

14:50 subsequent invocations of the same command jump straight to the project JVM

14:50 amalloy: hah. so a map, used somehow in bash, from lein-args to trampoline-file-output?

14:51 technomancy: more or less

14:51 hiredman: https://developer.apple.com/library/mac/#documentation/opensource/Conceptual/ShellScripting/AdvancedTechniques/AdvancedTechniques.html

14:51 "Using the eval Builtin for Data Structures, Arrays, and Indirection"

14:52 technomancy: amalloy: lein args and project.clj checksum

14:54 TimMc: The map-updating can be done from Clojure, so that's nice.

15:00 technomancy: Would you want to include the lein version in there somewhere?

15:00 ChongLi: hmmm so map over one coll is optimized for chunked sequences whereas with more than one coll it falls back on cons

15:00 TimMc: I don't know how often the trampoline script logic changes...

15:02 josteink: pbostrom: yeah same here. thats how I hope to keep things until I get heroku or "something better" sorted out ;)

15:02 (with regard to ec2 and startup time)

15:03 lynaghk: ibdknox: ping

15:05 ohpauleez: lynaghk: on the interwebs?!?!

15:06 lynaghk: ohpauleez: I HAVE RETURNED!

15:07 ohpauleez: SICK!

15:07 lynaghk: next time I go to New Zealand I'll be sure to pack the Internet =P

15:07 technomancy: TimMc: good point; maybe an issue for that?

15:09 lynaghk: bouncer in ec2 us-west-2 dude =)

15:09 lynaghk: technomancy: last mile always kills

15:10 ibdknox: lynaghk: sup?

15:10 lynaghk: technomancy: 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:10 technomancy: lynaghk: tried mosh?

15:10 lynaghk: ibdknox: yo. I'm in San Francisco for the next week---was wondering if you wanted to grab a coffee

15:11 technomancy: I remember running across this once before, but I'd forgotten about it. Looks really useful, thanks!

15:11 technomancy: I haven't used it, but I would if I were crossing the pacific over SSH on a regular basis =)

15:11 wei_: in compojure, how would I retrieve the payload of a request?

15:12 it's not encoded as application/x-www-form-urlencoded so not showing up even with wrap-params

15:12 ibdknox: lynaghk: absolutely! What part of town are you staying in?

15:13 lynaghk: ibdknox: okay to PM?

15:14 nDuff: Hmm.

15:14 * nDuff is going to be spending a week in SFO mid-month; hadn't thought to look for any Clojure meetups.

15:14 Apage43: wei_: It's :body on the ring map. (POST "/bleh" {body :body} …)

15:16 wei_: Apage43: thanks, that was it

15:19 had to use (slurp body) to get the actual content

15:19 Apage43: ah, it was a stream oslt?

15:21 wei_: it was a #<HttpInput org.eclipse.jetty.server.HttpInput@e9d222e>

15:21 that's why I couldn't find my original params when I printed out the entire ring map

16:35 Frozenlock: dnolen: accessing a field using (.-fieldname element) will not be munged, as opposed to (aget element "fieldname"), correct?

16:37 dnolen: Frozenlock: no .-fieldname will be munged. aget wont.

16:38 Frozenlock: Aaaaand that explain why my code doesn't work :)

16:38 thanks

16:44 dnolen: Frozenlock: if it's isn't a string, JS keyword, or JS native - Closure will try to munge it.

16:45 zilti: Is there a good tutorial to start with Clojure's type system? I'd like to "extend" the reader.

16:46 wei_: when opening a browser repl with (repl/connect "http://localhost:9000/repl"), 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:47 Frozenlock: wei_: without advanced compilation?

16:47 wei_: without. it happens with simple and whitespace

16:48 Frozenlock: Did you call repl/connect after the page is fully loaded?

16:48 for example: (set! (.-onload js/window) #(repl/connect "http://localhost:9000/repl"))

16:49 wei_: trying that

16:50 same error, weird. https://gist.github.com/4659442

16:51 dnolen: wei_: you need to declare the Google Closure Third Party jar as a dependency are you doing that?

16:52 wei_: in project.clj? I think so, just added that to the gist.

16:52 though, I never needed to declare it before, using lein-cljsbuild

16:56 ChongLi: hmm

16:56 transient vectors are 90% slower than javascript typed arrays

16:59 I 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:02 mjiig: can anyone help me fill in the blank to make this evaluate to true? http://paste.ubuntu.com/1583778/

17:05 Sgeo: 4clojure?

17:06 nDuff: ...smells that way to me.

17:06 amalloy: 4clojure has no such problem. some other sort of koan project

17:07 technomancy: or homework

17:07 Frozenlock: technomancy: clojure in school? Nice.

17:07 mjiig: unfortunately not in school

17:07 clojure koans on github

17:09 ChongLi: mjiig: are you aware of interpose

17:09 ?

17:09 mjiig: no

17:09 ChongLi: &(apply str (interpose ", " ["hello" "mjiig"]))

17:09 lazybot: ⇒ "hello, mjiig"

17:10 amalloy: i don't understand why reinventing clojure.string/join is so popular. it's not *that* hard to find, is it?

17:10 wink: jot really

17:10 Raynes: amalloy: I got a patch into kibit to replace any instance of 'apply str' with join.

17:10 ChongLi: haha

17:10 Raynes: All bases are covered there, people just need to use kibit now.

17:10 wink: mjiig: join, vals, and some sorting

17:11 ChongLi: it's just a habit I guess

17:11 wink: mhm, kibit

17:12 10month old ticket I never finished up with :(

17:12 technomancy: Raynes: wat

17:12 ChongLi: I'm leery of lint tools

17:12 Raynes: technomancy: Be quiet single branch if boy.

17:12 pjstadig: kibit can be somewhat...schizophrenic

17:13 ChongLi: I recall haskell's lint tool frequently made suggestions that were type errors

17:13 Raynes: I've never encountered that in hlint.

17:13 technomancy: Raynes: 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:13 ChongLi: I guess my code was pathological

17:13 haha

17:14 Raynes: technomancy: I doubt there are many. join should be faster than apply str as well. They are not equivalent.

17:14 brehaut: ChongLi: im sure the right permutation of compiler flags would resolve the type errors

17:14 technomancy: Raynes: that's the kind of call only a human is qualified to make

17:14 wei_: I resolved my js error from a while back.. with "lein cljsbuild clean" ._.

17:15 ChongLi: brehaut: no, I think it was genuinely a malformed transformation

17:15 TimMc: technomancy: Wait, you mean I *shouldn't* just use "Quick Fix" repeatedly in Eclipse until my code works?

17:15 Raynes: technomancy: This is a lint tool, sir. In almost all cases you want join. If you don't want join, you ignore the lint.

17:15 brehaut: ChongLi: sorry sorry, was trying to have a laugh at compier option boilerplate in GHC code

17:15 technomancy: I already ignore the hell out of it because it makes bad suggestions.

17:15 ChongLi: hey at least we're not using Go

17:15 where unused module imports are errors

17:16 craigbro: cleanliness!

17:16 sshack: Next to godliness.

17:16 craigbro: my resident Go hacker gets upset when the clojure compiler complains about my earmuffing non dynamic vars

17:16 ChongLi: brehaut: yeah I've seen my fair share of that

17:17 nDuff: /me tries using "lein kibit" for the first time, and gets a big fat NPE.

17:17 ChongLi: hell, 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:18 pjstadig: don't hate on the type checker, it's just proving things about your code

17:18 like how wrong it is

17:18 hiredman: *snap*

17:18 ohpauleez: haha

17:18 ChongLi: pjstadig: oh, I have nothing against that

17:18 it's just nice that you can turn it off

17:19 so that it replaces all ill-typed expressions with run-time exceptions!

17:19 pjstadig: static BURN

17:20 technomancy: I 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:21 Raynes: You're awfully bitter these days, huh?

17:22 pjstadig: technomancy: just require people to sign a CA

17:22 ibdknox: lol

17:22 TimMc: ouch

17:22 Raynes: Or, you know, close the pull request and decline.

17:22 technomancy: pjstadig: that'll take care of those pesky contributors!

17:22 "WONTFIX: your patch is bad and you should feel bad"

17:23 I hate declining pull requests =(

17:23 brehaut: technomancy: dont forget to have jira as a second line of defense

17:26 ticking: the frequent bashing of clojures contrib policy makes me wonder how long it will take until the project forks ^^

17:26 ibdknox: a long time

17:26 pjstadig: forking would be bad for the community

17:27 not that the bashing is good for the community

17:27 technomancy: it would happen sooner if most of the problems couldn't be worked around in userspace

17:27 ibdknox: the community would have to be substantially larger

17:27 pjstadig: yeh

17:27 *yeah

17:27 ticking: ibdknox yeah but PL communities tend to grow exponentially

17:28 mjiig: thanks for the help got it working now

17:28 ibdknox: ticking: I don't think that'll be the case with Clojure

17:28 ticking: ibdknox which basically means a week from "thats nagging" and "all the forks" ;)

17:28 ibdknox: haha

17:29 tpope: has anyone ever successfully forked a mainstream language?

17:29 octagon: hello 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:29 brehaut: tpope: other than microsoft ;)

17:29 tpope: clojure is far from the only language that's difficult to contribute to

17:29 ticking: ibdknox I think LT will give the community a big push on release due to news coverage

17:29 weavejester: Hum, incanter's docs are a little archaic

17:29 octagon: sorry, i mean in clojurescript

17:29 craigbro: LT?

17:29 clojurebot: defmulti doc is ugly

17:29 craigbro: oh, got it

17:29 amalloy: octagon: yes, but vars are generally intended to store things that you know about / use at compile time

17:29 TimMc: weavejester: Illuminated manuscripts?

17:30 craigbro: well, it may not fork

17:30 ibdknox: ticking: the original blog post tripled the the traffic to the Clojure github

17:30 pjstadig: octagon: clojurescript doesn't have vars

17:30 craigbro: but you could get balkanization

17:30 ala CL

17:30 amalloy: in cljs? cljs doesn't have vars, so it's probably something like (aget js/window "x")

17:30 craigbro: it's something that languages where you write small composable bits are prone too

17:30 ticking: tpope 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:30 TimMc: Clojure would be hella easy to fork, being a lib.

17:30 craigbro: as opposed to languages where you write big frameworks

17:30 weavejester: TimMc: Getting started pages from 2010 that assume Leiningen 1.1.0...

17:30 ibdknox: tpope: no one outside of a company has successfully forked a language. As brehaut said, MSFT has forked many :)

17:30 dnolen: octagon: if you plan on using advanced compilation you can't rely on stable ns names

17:31 craigbro: ibdknox: err, lisps, C++, C....

17:31 wkelly: does perl 5 continuing development count as a fork? :P

17:31 tpope: ticking: speaking to the ruby case, those aren't really forks, but alternate implementations

17:31 craigbro: ibdknox: smalltalk, awk, sed....

17:31 ticking: wkelly, if so then do python and python 3 ;)

17:31 craigbro: ibdknox: languages get forked regularly

17:31 octagon: dnolen: have you found any significant improvement with advanced compilation? i haven't been able to see a difference myself

17:31 ibdknox: craigbro: I assumed that "successful" in this case means that the fork overtakes the original

17:32 ticking: tpope right, but I'm shure they're not 100% compatible ;)

17:32 pjstadig: forking happens because of community issues

17:32 craigbro: tpope:the difference between fork and different implementation exists only at time of creation, and usualy diverges after that

17:32 pjstadig: and if there's no hope of unification, then forking doesn't make sense

17:32 dnolen: octagon: if you're aware of the type of optimizations at play it will be much faster - also huge code sizing savings

17:32 weavejester: Even the getting-started wiki page for Incanter is 2 years old...

17:32 tpope: I was setting a lower bar than "overtaking"

17:32 craigbro: hmm, weird deifnition of forking, but alright

17:32 tpope: but I was specifically referring to source forks

17:32 ohpauleez: As 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:32 craigbro: pjstadig: forking happens for lots of reasons, including technological ones

17:33 tpope: which was the implied response to clojure's contrib policy

17:33 octagon: dnolen: 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:33 pjstadig: craigbro: technological differences mirror community problems

17:33 craigbro: pjstadig: bullshit 8^)

17:33 pjstadig: craigbro: that's it i'm forking clojure

17:33 craigbro: pjstadig: I win!

17:33 ohpauleez: So with the scanned CA + http://clojure-doc.org/ - this fixes two of the most frequently issues for Clojure community

17:34 ticking: pjstadig 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:34 hiredman: weavejester: what are you looking at incanter for? charts?

17:34 weavejester: hiredman: Charts and basic stat functions

17:34 craigbro: I would give them some time to reconsider THEIR priorities

17:34 clojure core that is

17:35 before forking or something like that

17:35 hiredman: weavejester: for chart stuff using jfreechart directly is not that bad, and it is more flexible then what incanter offers

17:35 dnolen: octagon: 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:35 Natch: do 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:35 ticking: wavejester, yeah Incanter is a pita api wise, but there are not many options ^^

17:35 weavejester: hiredman: It's just to get an idea of where the bottleneck of a system is. No apps - just need some visualization.

17:35 Raynes: Natch: Well, yeah. Not sure what you'd rather have.

17:36 pjstadig: right, you could always engage people about changing the default template to have "sane" defaults

17:37 Raynes: If the defaults are currently insane, I'd happily take a patch to change them to sane ones.

17:37 :p

17:37 technomancy and I don't care much for insane.

17:37 octagon: dnolen: i should be able to ^:export symbols in my namespace and be able to find them via js/my_ns.foo, right?

17:37 dnolen: even under advanced compilation

17:37 pjstadig: i think we should have temporarily insane defaults IMHO

17:38 technomancy: Natch: if you have development-time tools you want to share across all your projects, you should put them in your user profile

17:38 Natch: Raynes: sane for me that is, like different license and such

17:39 Raynes: Natch: 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:40 Natch: technomancy: 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:40 Raynes: Things like luminus wouldn't have been possible.

17:40 Natch: Raynes: 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:41 technomancy: just the license?

17:41 Raynes: It's likely just copy paste, find replace, and your change. If you decided to go the template route that is.

17:44 * gfredericks likes clojure

17:44 Raynes: It's a pretty good language.

17:44 It's okay.

17:46 Natch: technomancy: pretty much

17:47 technomancy: it's not MIT/X11, is it?

17:48 Natch: technomancy: it's not my default license, no

17:48 technomancy: Natch: part of the problem is that it's only recently that we've had access to a comment-preserving reader

17:48 so operations which treat defproject as data and write back to project.clj haven't been possible until sjacket

17:50 tpope: was that a setup for some lecture about MIT/X11?

17:50 Raynes: tpope: Yes.

17:50 Meet technomancy.

17:50 Natch: MIT/X11 is bad now?

17:50 tpope: I would like to hear

17:50 technomancy: Natch: it doesn't have a patent protection clause

17:50 Natch: technomancy: I see

17:50 technomancy: so someone can submit a patch, get acquired by Oracle, and sue your users

17:51 most licenses longer than a page don't have this problem

17:51 Natch: ouch

17:55 technomancy: course you can always erect a CA process with its own explicit patent grant to prevent that

17:55 or you could pick a more discerning license

17:57 mybuddymichael: So what's the X11-plus-patent-clause license?

17:57 tpope: going out on a limb here but I'm guessing it's the default license

17:58 aka eclipse

17:58 technomancy: most people pick apache v2, but that has this annoying "you must put license boilerplate in every single file" clause

17:58 if they want to avoid copyleft

17:58 tpope: oh fuck that shit

17:58 sshack: technomancy: In X11's defence, it was created back in a time when computers were in black and white.

17:59 technomancy: I'm not aware of a good non-copyleft non-boilerplate patent-safe license

17:59 tpope: so why is eclipse the default?

17:59 technomancy: unless you want to take a scalpel to apachev2 and perform a clause-ectomy

17:59 ChongLi: recommended for lawyers only IMO

18:00 technomancy: tpope: it's what Clojure uses and I don't hate it, mostly

18:00 my least favourite thing about it is the name

18:00 ChongLi: yeah it's confusing

18:00 tpope: I'm no lawyer but I see the word patent in there like 10 times

18:01 yes I hate the name :(

18:02 blr: tpope: does your appearance in this channel suggest the possibility of life improvements for pariah clojure vim users? :)

18:02 tpope: blr: have you not seen foreplay.vim?

18:02 blr: no O.o

18:02 tpope: I never posted it to the mailing list :/

18:03 TimMc: technomancy: 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:03 tpope: was saving that for post-rename

18:03 technomancy: TimMc: I'll run that by salesforce legal

18:03 TimMc: If companies do it, why not FOSS project? :-P

18:03 tpope: but I don't have a good name to rename too

18:03 blr: oh, good show man!

18:03 jballanc: tpope: what's wrong with the name?

18:03 ;-)

18:03 blr: this looks swanky

18:03 mybuddymichael: tpope: The name is dynamite.

18:03 tpope: jballanc: some people have expressed concerns with evangelizing it to their colleagues

18:04 a fair point, I guess

18:04 mybuddymichael: Honestly, vim-intercourse would be more apt.

18:04 That's how great it is.

18:04 tpope: I try not to have those kinds of colleagues but to each his own

18:04 mybuddymichael: But I digress.

18:04 blr: tpope: I think most vim users are probably all a bit broken anyway, can't imagine it would be a problem

18:04 jballanc: tpope: tell them it's named after your favorite Boston song ;-) - http://www.youtube.com/watch?v=7HuLpztWyFA

18:04 blr: let the prudes use eclipse!

18:05 tpope: blr: that's what I said when I named it

18:05 nobody complained for a month

18:05 ChongLi: I like the close-quarters-combat mnemonic for invoking foreplay

18:05 tpope: but then like 3 people voiced concerns

18:05 clojurebot: max people is 317

18:05 ChongLi: cqc

18:05 fantastic

18:05 tpope: ChongLi: neat mnemonic

18:06 dnolen: octagon: yes

18:13 babilen: tpope: 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:13 seriously, if I would waste time and energy on something like that I would get nothing done :)

18:14 tpope: well another didn't really mind the name either

18:14 it's basically just this redl guy

18:14 maintaining a butchered fork just because he doesn't like the name

18:14 babilen: I was quite sad when I read that mail

18:15 mybuddymichael: tpope: I'd say definitely don't change the name just for one guy.

18:15 babilen: The features look useful (I haven't found time to investigate fully), but forking over something so trivial is, well, a bad step.

18:15 jsnoob_: are there any good orms for clojure? i didn't get much when i tried google, so i'd have to assume not

18:16 tpope: jsnoob_: spoiler alert: clojurists hate ORMs

18:16 babilen: jsnoob_: korma? (not a real ORM)

18:16 weavejester: There's a lot of SQL abstraction libraries

18:16 babilen: functional objects in persistent mutibility heaven?

18:17 technomancy: jsnoob_: there are DB libs, but nothing particularly satisfying yet

18:17 weavejester: But ORM is inherently OOP.

18:17 technomancy: all existing SQL libraries are widely regarded as having deep-seated shortcomings.

18:17 craigbro: really?

18:17 what is kormas?

18:17 tpope: speaking of stuff clojurists hate

18:17 speclj

18:18 this guy says it's popular https://github.com/tpope/vim-foreplay/issues/45

18:18 I don't believe him

18:18 jsnoob_: tpope, any particular reason why?

18:18 ibdknox: craigbro: nothing lives up to technomancy standards

18:18 jsnoob_: not like i can't write a join, it's just a bit easier to prototype without messing with sql

18:18 weavejester: technomancy: I think some could be improved, but I'm not sure I'd say they had deep-seated shortcomings...

18:18 tpope: I don't want to believe him

18:18 craigbro: I can think of things I would want changed in kroma, but no deep-seated shortcomings

18:18 technomancy: craigbro: 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:18 0 and 1 could probably be fixed

18:18 TimMc: tpope: Changing the name is probably appropriate.

18:19 technomancy: without too much hassle

18:19 tpope: jsnoob_: they're just overly complex and not particularly functional

18:19 craigbro: I don't use entities

18:19 ibdknox: technomancy: none of those are close to deepseated

18:19 weavejester: technomancy: Actually now that you mention it, I agree with all those points :)

18:19 But I'm not sure I'd call them deepseated

18:19 craigbro: hehe

18:19 ibdknox: technomancy: you could have easily fixed those in the time you spend telling everyone how shitty it is

18:20 TimMc: tpope: The current name kind of gives a "naming is hard and so am I" sort of vibe.

18:20 weavejester: Woah, let's be nice here

18:20 craigbro: I think thats a valid response

18:20 tpope: naming is hard and so is expiring caches

18:20 ibdknox: weavejester: everytime someone mentions korma he does this.

18:20 technomancy: ok, sorry; I was thinking more of c.j.jdbc with the deep-seated comment.

18:20 craigbro: it's working quite well for me

18:21 tpope: I don't really like the name, I just like everything else less

18:21 TimMc: heh

18:21 hyPiRion: tpope: naming is hard, but expiring caches are easier than finding a good system design

18:21 weavejester: My problem is more with SQL than any abstraction layer.

18:22 craigbro: I 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:22 weavejester: It's such a bad language, it's hard to write anything good around it.

18:22 hyPiRion: At least you can figure out if your caches are erroneous or not, but that's not the case for design.

18:22 craigbro: weavejester: 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:23 i find functional generation as useful, and often easier to deal with, than the syntax in USQL

18:24 ibdknox: weavejester: 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:25 craigbro: I would have to understand weavejester's issues more to comment on that, ibdknox

18:25 ibdknox: ah

18:26 weavejester: ibdknox: I have a few issues with the relational model in general, but more with SQL.

18:26 ibdknox: yeah, I guess he might've just meant that it doesn't make it easy to do composition

18:26 weavejester: Well, yep, that's a big one :)

18:26 ibdknox: yeah, that one is just plain stupid

18:26 craigbro: composition?

18:27 you mean combining queries together?

18:27 not using union and such...?

18:27 ibdknox: or parts of queries

18:27 weavejester: Being able to build a query out of smaller components.

18:27 craigbro: oh, I wrote some of those

18:28 (ensure-joined...

18:28 ibdknox: things like order shouldn't matter

18:28 when it comes to the clauses

18:28 craigbro: that's easy to get around

18:28 you are building a map representing the query anyways

18:28 spitting it out in proper order doesn't matter

18:28 weavejester: Like… [[:from :users] [:where (> :id 1)] [:project :name]]

18:29 ibdknox: right, in Korma it doesn't matter

18:29 craigbro: oh, I thought we were talking about korma

18:29 ibdknox: but it's a fundamental failing of SQL's design that it can't do that itself :)

18:29 craigbro: ok, well, that's a lame complaint

18:29 sorry

18:29 weavejester: But all SQL abstraction systems have to do a lot of work to get to that point.

18:29 craigbro: no

18:29 weavejester: And it's almost always imperfect.

18:29 craigbro: the clause sets are well defined

18:29 ibdknox: eh

18:30 craigbro: the order is well defined

18:30 ok, maybe I'm being too glib with that "well defined"

18:30 ibdknox: with vendor specifics it's not

18:30 weavejester: Also SQL sorta-kinda-not-really cares about order.

18:31 Like if you have a bunch of joins the order doesn't matter

18:31 But put in a subselect and it does.

18:31 SQL groups together a bunch of separate relational operations

18:33 Projection (which SQL calls select), selection (which SQL calls where), renames (as), and all the joins

18:33 craigbro: weavejester, ibdknox: I have 1600+ lines of functioanl sql composition using Korma 8^)

18:33 ibdknox: damn

18:33 lol

18:33 weavejester: It's like having a class when what you want is function composition.

18:34 craigbro: it works

18:34 what I find could use some improvement is composition of conditionals

18:34 they are a bit opaque at the public korma api level

18:34 ibdknox: yeah

18:34 craigbro: I have some helpers to do things like join to a table if it's not already joined

18:35 composition 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:35 also, composition of order-by clauses would be nice (but a bit tricky)

18:36 ibdknox: craigbro: when it comes to fields what is the behavior you would expect?

18:36 craigbro: what happens now, it's just mildly surprising

18:36 ibdknox: yeah, I certainly don't disagree

18:36 rationalrevolt: In 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:37 craigbro: I would like to be able to extract theconditional clause

18:37 weavejester: rationalrevolt: "/app*" would allow "/appfoo" as well as "/app/foo"

18:37 rationalrevolt: yup, thats true

18:38 weavejester: rationalrevolt: With regard to the ending /, I think I need some sort of redirect in the route macros, perhaps.

18:38 craigbro: ibdknox: 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:38 weavejester: Because "/foo/" should redirect to "/foo". A 200 OK response from both would be wrong.

18:39 craigbro: ibdknox: which tells me I should be making some derived tables or some other means of doing the query

18:39 ibdknox: lol

18:39 craigbro: well, it's true 8^)

18:40 I 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:40 in other words, I don't need composition to be better at the korma level (tho I do have some mild complaints)

18:41 when I need to do is use a different tool, instead of an RDBMS in some cases

18:41 rationalrevolt: weavejester: 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:41 craigbro: ibdknox: other than composing conditionals (let me add a (where clause to a query, ORing it with the existing one....))

18:42 weavejester: rationalrevolt: Java resources don't have a beginning "/". (Normally, anyway…)

18:42 rationalrevolt: And setting the :root to "" is a bad idea, because it exposes your source code.

18:42 ibdknox: craigbro: that's a hard one

18:42 craigbro: ibdknox: adding WHERE operators like ILIKE should be a standard operation (def-conditional-op or something

18:42 ibdknox: craigbro: that would be relatively straightforward to add I think

18:43 craigbro: the right course of action is probably to dump strings

18:43 craigbro: ibdknox: also, I have some monkeypatches to add UNION and INTERSECTION of queries

18:43 ibdknox: have you see USQL?

18:43 ibdknox: nope

18:43 craigbro: ibdknox: breaks down the full sql syntax, from the token level up, into CLOS objects

18:44 ibdknox: you can then emit those as strings for various target DBs

18:44 rationalrevolt: the ring resource-response works the same for both

18:44 cemerick: it sounds like Clojure/lein on windows is a solved issue these days...

18:44 craigbro: ibdknox: 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:44 weavejester: rationalrevolt: IIRC that's because it has some code that removes a beginning "/"

18:44 technomancy: cemerick: sure, just use ccw =)

18:44 cemerick: anyone here have issues re: windows + clojure?

18:45 technomancy: cemerick: having to manually download curl is pretty silly

18:45 cemerick: technomancy: well, ccw doesn't run lein tasks, and I probably wouldn't ever use it for that, anyway :-)

18:45 technomancy: oh... I didn't realize that. is it in the works?

18:45 cemerick: I'm OK with that. curl sucks pretty badly.

18:46 technomancy: you'd have to ask lpetit what his current priorities are, but I'd guess not

18:46 ibdknox: craigbro: it uses vectors in some spaces, but it keeps most things as data until the end

18:46 technomancy: I was vaguely considering writing a bin/lein replacement in elisp that could launch a Leiningen nrepl server and talk to it from eshell.

18:46 cemerick: technomancy: except for `lein repl`, which will soon replace all of ccw's custom launch stuff

18:46 ibdknox: craigbro: it gets aggressive with string creation in where clauses, but I don't remember why I did that originally

18:46 rationalrevolt: weavejester: yup, thats correct

18:47 technomancy: mostly just to prove a point to people who lord it over bash that powershell is OOP instead of string-based.

18:47 cemerick: heh

18:47 technomancy: but also to help with startup time

18:47 kind of a resurrection of 1.x's `lein interactive`

18:47 cemerick: well, you have to give the powershell folk credit for being usefully contrarian there

18:48 craigbro: ibdknox: oh, some oher minor nits, would prefer it show me queries with the vars included, not the ?'s 8^)

18:48 technomancy: well, they're hardly the first to notice that "everything as strings" is not a good least-common-denominator.

18:48 craigbro: ibdknox: makes it a bit of a pain to EXPLAIN a generated query of any complexity 8)

18:49 * technomancy listens for the sound of Genera users yelling "get offa my lawn"

18:49 amalloy: craigbro: i doubt if korma actually replaces the ?s itself, so it doesn't really have queries with vars included

18:49 ibdknox: correct

18:50 delegates to JDBC so that I can't fuck it up

18:50 screwing up query escaping = not cool ;)

18:50 craigbro: amalloy: Yah, I know

18:50 amalloy: if it coudl get the SQL from JDBC and present that... woudl be ideal

18:50 cemerick: technomancy: I think they're OK with not being first ;-)

18:50 amalloy: ibdknox: isn't being on the front page of HN cool?

18:50 craigbro: as it is, I either hit my DB logs, or just edit it by hand

18:50 ??

18:50 lazybot: craigbro: Definitely not.

18:51 ibdknox: amalloy: hm?

18:51 amalloy: if you messed up query escaping you'd be cool

18:51 ibdknox: ah

18:51 haha

18:51 craigbro: amalloy: don't do that 8) I horridly loaded HN and was about to wake my ops guy

18:51 ibdknox: amalloy: oh yes. I mean, hey, the rails kids are doing it.. :D

18:51 craigbro: hurriedly

18:52 ibdknox: not that we can say much given the number of JVM zero days that have been coming up lately...

18:53 craigbro: ibdknox: sandbox escaping, not a issue for server side apps

18:58 the 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:02 warz: fiber reinforced plastic?

19:02 ibdknox: functional reactive programming

19:03 technomancy: I'm working on a branch of clojars that uses event sourcing instead of SQL

19:03 of course, clojars is cheating since the data set is trivial

19:03 but it's fun

19:04 ibdknox: that's neat

19:04 hiredman: I bet you can buy fiber reinforced plastic on amazon industrial

19:04 warz: is FRP another way of saying event driven?

19:05 kind of like javascript or something

19:05 event emitters in js

19:05 ibdknox: no

19:05 warz: http://elm-lang.org/

19:05 check that out :)

19:05 warz: is my head going to explode

19:05 hiredman: elm is functional reactive, not functional relational, no?

19:06 mybuddymichael: ibdknox: From that site: "some values change over time"...

19:06 technomancy: hiredman: same acronym either way =)

19:06 mybuddymichael: ಠ_ಠ

19:06 ibdknox: hiredman: oh, I thought we were talking about reactive. But you are probably right lol

19:06 hiredman: from the context I got relational

19:07 ibdknox: that would make sense

19:08 craigbro: FRP = functional relational programming

19:08 in my use

19:08 not functional reactive 8^)

19:09 I'm out...

19:09 hiredman: the less mentioned frp, but larger driving force behind clojure and datomic

19:11 rkz: hi 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:11 any good exmples?

19:12 hiredman: why not just use the creds map?

19:12 rkz: for every fn call?

19:12 hiredman: rkz: yes

19:12 rkz: could do but might be a bit annoying when using from repl

19:12 warz: elm looks cool

19:13 hiredman: rkz: less annoying then trying to gin up some kind of opaque closure?

19:13 rkz: true

19:13 hiredman: (do-something {:user ... :pass ...} some-data more-data)

19:14 rkz: looking 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:14 hiredman: https://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:21 n_b: rkz: It's pretty idiomatic to have something like what hiredman suggested

19:21 clojurebot: hiredman is lazy

19:22 n_b: much moreso than a closure. Look at Raynes' Tentacles library for an example

19:30 rkz: ok I'm with you

19:31 going to do it that way

19:31 then maybe do something like this http://cemerick.com/2011/10/17/a-la-carte-configuration-in-clojure-apis/

19:39 aaelony: can anyone recommend a good, free profiler?

19:47 TimMc: clojurebot: FRP?

19:47 clojurebot: FRP is functional reactive programming, or maybe fiberglass reinforced plastic

19:50 TimMc: hiredman: Have you started making changes to clojurebot's factoid interface?

19:52 tmciver: I'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:52 Is defprotocal an accaptable way to do this?

19:54 I suppose I could use a set of same-named functions in different namespaces with different corresponding implementations.

19:55 ChongLi: tmciver: the key issue is the differences between the various back-ends

19:55 amalloy: protocols or multimethods would be the way to go, although honestly you'll probably discover that the differences are too significant to paper over

19:56 ChongLi: this ties right into Clojure's philosophy of not wrapping

19:56 tmciver: amalloy: so I'd be better of just committing to a single storage mechanism?

19:56 ChongLi: Clojure deliberately exposes the power of its host platform (the JVM or js in the case of CLJS)

19:57 if it used a wrapper for portability, you'd be stuck with the intersection of all the platforms

19:57 brehaut: amalloy: but lossy abstractions are what polymorphism is all about

19:57 TimMc: tmciver: It depends on how much of each backend's specialties you want to take advantage of.

19:58 ChongLi: and how much effort you're willing to put into your library knowing it'll have these limitations

19:58 TimMc: tmciver: You'll also have to make sure your abstraction either doesn't guarantee ACID, or implement it for XML-on-disk.

19:59 tmciver: TimMc: Hmm, true. Perhaps I'd be better off sticking with SQL and using something like korma.

19:59 ChongLi: korma's a very nice library from what I hear

20:02 it certainly looks nice, judging from the code on its site

20:02 ibdknox uses some nice designs for his sites too

21:02 hiredman: is there a core.logic mailing list?

21:39 harto: Hello #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:40 e.g. the (working) equivalent of (let [x 'VK_A] (. KeyEvent x))

21:40 dnolen: harto: probably reflection

21:41 harto: yeah ok, I suspected as much

21:43 gfredericks: harto: if you have the symbol at compile-time you can do it with a macro

21:43 harto: ,(clojure.lang.Reflector/getStaticField "java.awt.event.KeyEvent" "VK_A")

21:43 clojurebot: #<RuntimeException java.lang.RuntimeException: java.lang.ExceptionInInitializerError>

21:44 harto: gfredericks: yeah I messed around with that but couldn't see a nice way to do it

21:45 gfredericks: (defmacro static-getter [sym] `(. KeyEvent ~sym))?

21:46 harto: huh, guess I didn't try hard enough :-)

21:46 gfredericks: then you'd call (static-getter VK_A)

21:47 now I'm not really sure what's being gained anymore :/

21:47 dnolen: gfredericks: nothing gained :)

21:48 macro means you won't be able to use a symbol stored in a local

21:50 harto: right

21:51 gfredericks: also since you said "easiest", eval is probably easier than relfection :P

21:52 TimMc: (-> java.awt.event.KeyEvent class (.getDeclaredField "VK_A")) ;;= 65

21:53 whoops, wrong one

21:53 (-> java.awt.event.KeyEvent (.getDeclaredField "VK_A") (.get nil))

21:53 * gfredericks phews

21:53 TimMc: harto: ^

21:56 harto: hmm

21:57 yeah, eval looks ok: (let [x 'VK_A] (eval `(. KeyEvent ~x)))

21:58 dnolen: harto: just note that eval in Clojure triggers compilation, probaly much slower than even reflection.

21:59 harto: thanks dnolen

22:00 dnolen: and 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:01 gfredericks: I just furb'd it at the repl and eval was 177 times slower

22:01 dnolen: 177 times slower than reflection is crazy given how slow reflection is.

22:02 harto: D:

22:02 gfredericks: today's lesson: don't compile your code in a tight loop.

22:04 dnolen: gfredericks: on my machine it's >1000X slower than TimMc's suggestion.

22:04 amalloy: gfredericks: 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:05 dnolen: eval is rarely a good answer

22:06 gfredericks: amalloy: quick, let's write a genetic algorithm and see if we can generate programs that access static members of classes!

22:06 there's still time!

22:06 amalloy: you could write a macro that does a bunch of reflection at compile time, and emits lookup functions that are fast

22:08 fcabral: Hello, is it possible to use re-seq in cond but be able to bind the returned seqs?

22:10 TimMc: $latest hugod/criterium

22:10 lazybot: No project by this name exists on clojars.

22:11 TimMc: $latest criterium

22:11 lazybot: [criterium "0.3.1"] -- https://clojars.org/criterium

22:20 * hugod wonders if clojure-test-mode could be made to ediff test failure results

22:31 mcohen3: there'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:42 rationalrevolt: &(doc refer-clojure)

22:42 lazybot: ⇒ "Macro ([& filters]); Same as (refer 'clojure.core <filters>)"

22:47 rclarkson: how do i url stringify a map?

22:53 brehaut: rclarkson: how do you what now?

22:53 rclarkson: brehaut: what?

22:53 i have a map i wanna convert into a url string

22:53 brehaut: "how do i url stringify a map?" that could mean so many things

22:53 xeqi: rclarkson: are you looking for something like https://github.com/cemerick/url and how it handles :query ?

22:54 rclarkson: yeah i recall that it was part of ring

22:56 brehaut: i suspect he's thinking of something in http://ring-clojure.github.com//ring/ring.util.codec.html like url-encode

22:57 but i dont think it does what he htinks it does

22:57 callenbot: dammit, he left

22:58 I was going to ask what his native tongue was

22:58 because it obviously wasn't English.

22:58 I'm going to guess...swedish.

22:58 brehaut: based on my own inability with english, i would never assume that

22:58 tomoj: what was wrong with his english?

22:59 callenbot: brehaut: hostmask included telia, he's sweidsh.

22:59 swedish*

22:59 tomoj: couldn't express himself

22:59 octagon: hi! 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:00 callenbot: octagon: why are you naming things like that?

23:00 octagon: callenbot: well i'm making a library that does all the familiar things that are in core but with a different evaluation semantic

23:00 brehaut: octagon: :refer-clojure in your namespace

23:01 octagon: callenbot: the client would use them as (x/map foo bar) (x/identity foo) etc

23:01 callenbot: octagon: what sort of semantics?

23:01 brehaut: octagon: and then require clojure.core as something short

23:01 octagon: brehaut: yes but i was trying to avoid that

23:01 i was thinking maybe there was a way to export symbols or something

23:01 brehaut: octagon: well dont. that would make your code impossible to reason about

23:02 amalloy: indeed. inside your library, you can't define a function called map and have the symbol 'map refer to clojure.core/map

23:02 brehaut: octagon: what you are asking is really to have two values for one name, and have the compiler magically guess the right one

23:03 octagon: i 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:03 then the user would :require foo.core

23:03 brehaut: that seems needlessly complex

23:03 octagon: they could then use foo.core/map foo.core/identity

23:04 TimMc: gfredericks: I couldn't even get a benchmark out of criterium with the eval method. It just hung. :-/

23:04 brehaut: also, as an aside: core namespaces are a hack. use a better name if you can

23:04 octagon: brehaut: how do you mean "hack"?

23:04 brehaut: thanks for the help btw

23:05 brehaut: octagon: because single segment namespaces (eg foo) dont work nicely outside of clojure (ie in java) foo.core namespaces were created as a compromise

23:05 but its forced

23:05 if you can have libraryname.meaningfulname its better

23:05 ie, i have a library im writing called basilisk, and it bundles stuff so the primary namespace is basilisk.bundle

23:05 octagon: i see, thanks brehaut

23:05 brehaut: no problem

23:06 i think lein does the right thing now with 2+ segment names now when creating a project

23:06 octagon: the default thing with lein is to make the last segment "core" :)

23:07 brehaut: hmm. im sure there was noise about fixing that

23:08 octagon: i am probably using an older version

23:08 brehaut: ive got my local lein into a funny state so im not using 2 release, otherwise i'd test it properly

23:09 Raynes: brehaut, octagon: I've began namespacing and renamespacing my projects to have a me.raynes.<project-name> structure

23:09 brehaut: Raynes: rdn naming is not panacea

23:09 Raynes: brehaut: 'rdn'?

23:09 brehaut: Raynes: reverse domain name

23:09 Raynes: brehaut: So there is something wrong with my naming scheme?

23:10 I was pretty sure it was nice. I have me.raynes.laser, me.raynes.fs...

23:10 brehaut: it has pros and cons

23:10 pros, you get that

23:10 Raynes: Like?

23:10 brehaut: cons, if ownership changes it can be weird

23:10 depends how much you care about that i guess

23:11 i think if there was a single great solution, everyone would have agreed by now

23:11 Raynes: I'd just change the namespace if I cared.

23:11 Yeah, but what else would I do with laser?

23:11 laser.lightsaber.htmlstuff?

23:12 brehaut: or just laser.html?

23:12 i dunno, im crap at naming

23:12 Raynes: I've had people give me crap over two segment namespaces.

23:12 Not unique enough for some people.

23:12 tomoj: well "laser" is not unique

23:12 ..enough for me

23:12 but datomic.api seems fine

23:12 as an example

23:12 Raynes: If me.raynes.laser isn't good enough, I give up on naming anything ever.

23:13 tomoj: yeah. me.raynes.laser is fine afaic

23:13 craigbro: Raynes: obvious answer here is, can the person who gave you shit about the namespace able to best you in hand to hand combat

23:13 Raynes: cemerick is pretty skinny.

23:13 tomoj: but I think (hop?) as long as you have a unique first segment, dropping RDN in the ns is OK

23:13 I still use RDN in the group

23:14 s/hop/hope/

23:14 craigbro: i think the com.something.foobar naming is too verbose

23:14 brehaut: tomoj, Raynes im pretty certain everyone has different criteria they want everyone elses naming scheme to adhere to, thus everyone bitches

23:15 Raynes: I didn't used to be a fan of it either,

23:15 still not really.

23:15 I was under the impression that people would be unable to complain about this particular naming scheme.

23:15 craigbro: seems like an advertising trick to me

23:15 Raynes: I might as well go back to foo.core now.

23:15 brehaut: Raynes: you must be new

23:15 tomoj: datomic pretty much makes you have to fully qualify in some places, so I abandoned RDN in ns's :(

23:16 craigbro: tomoj: that annoying difference between a unqualified symbol and a qualified one?

23:17 tomoj: craigbro: just that :com.loku.deezy/maybe is so much worse than :deezy/maybe

23:17 for example

23:17 hmm, though 'deezy.api/maybe is not THAT much worse than 'com.loku.deezy/maybe

23:17 but it seems like noise

23:18 callenbot: com.loku.deezy/maybe is just a way of telling the world they're java scum and to be avoided at all costs.

23:18 TimMc: callenbot: Shush.

23:19 You're just a bot, what do you know?

23:19 callen: TimMc: leave the digital pet alone

23:19 tomoj: ..you mean people who use RDN are java scum?

23:20 TimMc: I use RDN, but I own timmc.org, which I feel is short enough.

23:20 Anyway, what's the point of :as if you don't use it, anyhow?

23:21 tomoj: :as makes it bearable, but datomic makes it hard not to fully-qualify some places. and no :as in edn

23:22 callenbot: alright alright, lets have a contributions context

23:22 I've got 3,104 contributions for the past year on github.

23:22 Raynes: y tu?

23:23 brehaut: its not the number of contributes you've made, but what you do with them that counts

23:24 callenbot: brehaut: I get paid by the KLOC.

23:25 brehaut: unsurprisingly, all my code is asm generated by m4.

23:26 brehaut: if i were paid by line of assembler generated, i'd stick with the JVM

23:27 callenbot: brehaut: I can't hear you over the SPEEEEEED

23:28 Raynes: callenbot: 1242.

23:28 Er, 1424.

23:29 callenbot: Raynes: http://i.imgur.com/Gkh1BIQ.png

23:29 Raynes: however, I'm willing to concede that you win in terms of open source contributions by a mile.

23:31 Raynes: Every single thing I've done this year is open source, work included.

23:31 callenbot: Raynes: we can't all be hippies.

23:31 Raynes: grumble mumble startups mumble YC mumble retire by 30 grumble grumble

23:33 Raynes: your ears have homework: http://www.youtube.com/watch?v=WfgMZH7PSy4

23:35 brehaut: that song is 90% pingpong delay

23:35 callenbot: brehaut: your mother is a member of the joy division at a racquetball training camp.

23:36 brehaut: and you didn't hear the proper part of the song, there's a build-up.

23:36 brehaut: next time, try not to lead with the 'your mother'

23:37 Sgeo: Help

23:38 Potential employer asked for code for a project listed on my resume

23:38 amalloy: brehaut: "is a member the joy division at a racquetball training camp your mother"? doesn't work out as well

23:38 Sgeo: I sent it, but it's among the less pleasant code I've written

23:38 brehaut: amalloy: lol

23:38 Sgeo: I did mention a project for which I wrote cleaner code and isn't on my resume

23:38 Hopefully they ask to see that code

23:38 TimMc: Sgeo: Send along a critique of your own code, maybe?

23:39 Sgeo: I did mention things in the email I disliked about the code

23:39 Well, in general terms

23:39 (It's a bit repetitive, use of if 0 to comment out code that was used for debugging, etc)

23:42 dnolen: hiredman: LOGIC-109, hrm I cannot reproduce that on master.

23:48 cakehero: lawlz: http://cl.ly/image/0R3K3x391N0x

23:49 Raynes: cakehero: Some of the problems on 4clojure are really stupid.

23:49 cakehero: Well, it's not stupid - my answer is stupid

23:49 callenbot: Raynes: did you listen to the song?

23:49 Raynes: It's pretty stupid.

23:49 cakehero: heh

23:49 Raynes: callenbot: I didn't even click on it.

23:49 callenbot: Give me rdio links, dude.

23:49 cakehero: It's nice to have a list of clojure problems to go through

23:49 Raynes: Get with the program, callenbot.

23:49 callenbot: dafuq.

23:50 Raynes: callenbot: Listening now.

23:50 cakehero: considering it's like the 30th line of clojure i've written

23:50 Raynes: cakehero: Don't get me wrong, 4clojure is great. I'm a developer of it.

23:50 dnolen: hiredman: actually I think I see what's going on - please try master when you get a chance.

23:50 callenbot: Raynes: http://www.rdio.com/artist/Collapse_Under_The_Empire/album/Crawling/track/Crawling/ if you still want the Rdio.

23:50 Raynes: amalloy did all the stupid parts.

23:51 callenbot: Raynes: which are?

23:51 Raynes: callenbot: You're a good person for going over there and getting that there link for me. I'm impressed.

23:51 cakehero: Raynes excellent, I'll blame him

23:51 callenbot: Raynes: I'm hell-bent on exposing you to post-rock.

23:52 * technomancy gets grumpy without enough megaman rock opera in his life

23:52 callenbot: technomancy: Mega Man 2, best soundtrack ever.

23:52 Raynes: You're just grumpy in general.

23:52 What's megaman?

23:52 technomancy: ...

23:52 Raynes: Hahahaha, kidding, kidding.

23:52 I'm not that young.

23:53 warz: lol

23:53 but seriously

23:53 callenbot: oh dammit. I thought for sure I'd have more commits than technomancy.

23:53 Raynes: I grew up with SNES.

23:53 warz: you do know what megaman is

23:53 dont you

23:53 callenbot: technomancy: does heroku host their git on github?

23:53 Raynes: warz: Yes.

23:53 callenbot: er, vice versa.

23:53 technomancy: callenbot: with external mirrors, yeah

23:53 warz: man SNES was right before all of the really good games on NES

23:53 callenbot: technomancy: http://i.imgur.com/Gkh1BIQ.png duel me.

23:53 technomancy: whoa protomen sell FLACs along with MP3. <3

23:54 Raynes: warz: I also have emulators.

23:54 Oh wait, I guess that's illegal.

23:54 craigbro: callenbot: wipeout, best soundtrack ever

23:54 warz: psh, not even the same

23:54 Raynes: My friend who isn't me has emulators.

23:54 callenbot: craigbro: Wipeout is good but there's too much eurotrash.

23:54 Raynes: warz: I've considered making an snes or nes controller interface with my 'puter for them.

23:55 craigbro: callenbot: haha, too much sasha eh?

23:55 technomancy: callenbot: 2066; most of my work at heroku is maintenance

23:55 craigbro: callenbot: it's burned into my head because of the zen state wipeout induced when racing

23:55 callenbot: craigbro: *holds index finger and thumb together very closely* just a liiiiiil bit.

23:55 warz: Raynes, like a USB controller? My friend has one it works well.

23:55 callenbot: technomancy: dammit!

23:55 Raynes: warz: Yes, an snes-shaped usb controller.

23:55 callenbot: technomancy: help me find somebody with more than me. It must exist!

23:56 technomancy: callenbot: I beat your longest streak though; 21

23:56 callenbot: technomancy: solid.

23:56 warz: Raynes, actually the best is really just the gamecube controllers. those things kick ass.

23:56 for any thing

23:56 they have USB versions

23:57 i tried blogging about my experiences with clojure as a newb, but i bet it makes no sense, heh

23:58 i tried to make it make sense, anyways

23:59 i 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

Logging service provided by n01se.net