#clojure log - Mar 06 2012

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

0:03 TimMc: mac: "not for now", basically

0:03 About what you'd expect.

0:25 JulioBarros: Hi, I'm trying to deploy an uber jar to a jetty server on ubuntu (to run it rather than lein run) and I'm getting an java.lang.ExceptionInInitializerError at sun.reflect.NativeConstructorAccessorImpl.newInstance0 when

0:25 it gets to the part in my code where I try to use enlive.

0:25 A basic hello world noir app works but my real app does not. Any ideas?

0:31 tmciver: $findfn [1 1 1 2 3 4] [[1 1 1] [2 3 4]]

0:31 lazybot: []

0:32 scriptor: trying to cheat? :)

0:32 tmciver: Hell yeah? wanna help me?

0:32 scriptor: which problem was this again?

0:32 pyninja: hi, in ClojureScript, what's the equivalent of field.value? I tried (.value field) and variations...

0:34 tmciver: I'm trying to remember a function that splits a seq into two groups based on the result of a predicate *changing*

0:34 scriptor: tmciver: something like this? http://clojuredocs.org/clojure_core/clojure.core/split-with

0:35 pyninja: what happens when you do (.value field)?

0:35 pyninja: scriptor: #<TypeError: Cannot call method 'value' of undefined>

0:36 scriptor: it tries to call ns.field.value();

0:36 muhoo: gawd, i can't escape clojurescript.

0:36 tmciver: scriptor: that may work but it's not the function I was thinking of.

0:36 muhoo: i just started hacking on this beaglebone, and all the libraries for doing digital i/o on it are in.... javascript

0:37 my goal was to use clojure to do some stuff on the beagle, since it runs java just fine

0:37 but instead, the libraries i need are in fucking javascript. so it'll have to be clojurescript instead.

0:37 running on node.

0:38 or maybe in rhino, that might work.

0:39 scriptor: pyninja: have you tried different values for field?

0:40 pyninja: scriptor: actually, (. field -value) worked, but I don't understand why

0:42 scriptor: hmm, don't know it enough to remember if - has any special meaning

0:42 does it just compile to _value?

0:55 muhoo: hehehe even easier, i can just read the data structures i need in as json , and make them into clojure data

0:56 json on an embededed device. soon, i predict, all development will be web development.

0:57 dnolen: 3

0:58 oops

1:02 amalloy: pyninja: (.foo bar) or (. bar foo) is always a "method" call, (.-foo bar) or (. bar -foo) is always a property lookup

1:03 pyninja: amalloy: oh ok thanks

1:03 amalloy: on the jvm, there's a way to tell properties and methods apart, so (.foo bar) just Does What You Mean

1:03 pyninja: yeah

1:11 mindbender1: hi

1:49 gtuckerkellogg: have *all* of the clojure.contrib libs moved to individual repos?

2:39 _ulises: morning all

2:46 gtuckerkellogg: morning

2:46 scriptor: marnin

2:47 gtuckerkellogg: could someone tell me what the current status is with clojure.contrib?

2:48 _ulises: being ported still I believe

2:48 gtuckerkellogg: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

2:48 gtuckerkellogg: oh, hey that's useful

2:49 _ulises: indeed

2:49 gtuckerkellogg: much more so than the circular lnks at http://richhickey.github.com/clojure-contrib/

2:49 lazybot: Nooooo, that's so out of date! Please see instead http://clojure.github.com/clojure-contrib/ and try to stop linking to rich's repo.

2:49 gtuckerkellogg: well if it's out of date, i shouldn't need lazybot to tell me (IMHO)

2:49 clojurebot: Cool story bro.

2:50 _ulises: cool story indeed

3:04 tomoj: if I typed (def parse-parse [parse]), should I start over?

3:04 well

3:05 assume I already made it a defn :)

3:25 hsandhu: deploying a noir web app, any suggestions for daemonizing the instance (just using jetty as the container)

3:28 Fossi: hsandhu: there should be a way to package a war, most likely via lein

3:29 i don't know noir at all, so ymmw

3:29 hsandhu: hmm, that could be one option if I was using tomcat for example...how about supervisord?

3:30 Fossi: you can use jetty as you would use tomcat

3:30 never heard of supervisord

3:30 hsandhu: right, but the following will not create a daemon: "lein run"

3:55 tomoj: findfn "S=(NP=(DET=(the)N=(dog))VP=(V=(runs)))" {:S [{:NP [{:DET "the"} {:N "dog"}]} {:VP [{:V "runs"}]}]}

3:56 raek: tomoj: parsing natural language? :-)

3:56 tomoj: no, it's already parsed

3:56 I just need to parse the parse

3:56 :)

3:57 raek: https://gist.github.com/954222

3:58 tomoj: sweet

3:58 raek: (this was before core.logic got support for special DCG syntax9

3:58 )

3:58 tomoj: I heard dnolen mention parsing but couldn't figure it out for myself

3:58 ah, shucks

4:00 raek: my proessor in Formal Languages and Automata Theory used this sentence as an example of ambiguity in grammars...

4:01 he telled the joked, said "and now an explanation of the joke", and showed two parse trees on the projector

4:04 tomoj: corenlp gets it right, but it also thinks "in the dressing room" is attached to the NP

4:29 sorenmacbeth: what the difference between #^ClassName and ^ClassName?

4:30 I see both and no clear description of the difference or when to use which

4:31 ejackson: the former is deprecated

4:32 sorenmacbeth: ejackson: thanks, that explains it

4:34 G0SUB: datomic!

4:40 ejackson, PM?

4:40 ejackson: DATOMIC!

4:45 muhoo: VerifyError class org.codehaus.jackson.smile.SmileParser overrides final method getBinaryValue.(Lorg/codehaus/jackson/Base64Variant;)[B java.lang.ClassLoader.defineClass1 (ClassLoader.java:-2)

4:46 it does?

5:07 mtd: with clojure 1.3 on posix, is there a way to get all of clojure-contrib into the classpath? Does nobody really do that?

5:07 s/a way/a way without rebuilding all the jars oneself/

5:08 ejackson: with 1.3 there is no clojure-contrib

5:08 you want to select the libs you want and put them into leiningen

5:08 which will put them onto the CP for you

5:08 mtd: ejackson: right

5:09 ejackson: it's called clojure contrib here, FWIW http://dev.clojure.org/display/doc/Clojure+Contrib -- what's the right term?

5:09 ejackson: for repl use that's a bit of work, but not as much as compiling them all myself, sure.

5:09 ejackson: just wondering how people did it, thanks.

5:09 ejackson: you don't need to compile 'em, just let lein fetch the jars from clojars

5:09 mtd: ejackson: indeed

5:10 babilen: mtd: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go might help to select the right ones

5:10 mtd: ejackson: I was hoping for something I could stick in ~/bin/clj so that I could (use 'math.numeric-tower) and stuff without having to run through lein each time

5:10 babilen: thanks

5:11 ejackson: I can just have lein download them once or something

5:11 ejackson: mtd: i strongly recommend using lein for everything

5:11 mtd: ejackson: For pre-packaged stuff of course

5:11 ejackson: yes, lein will dl them and put them into ~/.m2/... and then into your project's ./lib

5:11 mtd: ejackson: I'm talking about one-off scripts / generic repl stuff

5:12 ejackson: even so, save yourself

5:12 i mean, >lein new, >emacs project.clj, >lein repl.... hard to beat

5:12 mtd: ejackson: sorry, I don't think I'm being clear: I want to let something like lein decide for me what jar to dl to get math.numeric-tower

5:13 ejackson: ...I just don't think I need it to decide that that oftern

5:13 babilen: mtd: Take a look at https://github.com/mtyaka/lein-oneoff for oneoff scripts

5:13 mtd: ejackson: yeah but...I want oneoff scripts, not projects. I totally get what you're saying for projects, and I'm just being lazy

5:13 ejackson: mtd: lein should pull the deps for you

5:13 mtd: babilen: thanks, looks good

5:14 babilen: that's pretty much exactly what I want, thanks

5:14 ejackson: hm, numeric-tower is not in clojars, and its a maven thingy

5:14 mtd: ejackson: nooooo...hmm.

5:15 ejackson: so you'll have to build it w/ maven yourself

5:16 arbscht: hi from desktop

5:16 mtd: ejackson: awesome :) :/ thanks for saving me the headache of finding that out myself

5:16 ejackson: no sweat

5:17 babilen: mtd: AFAICT you can just include "[org.clojure/math.numeric-tower "0.0.1"]" in your project.clj and fetch it with "lein deps"

5:18 mtd: babilen: yeah, I'm cool with that usage of lein and deps...modulo ejackson's clojars comment re math.numeric-tower...

5:19 babilen: Yeah, but do not forget about http://search.maven.org/#search%7Cga%7C1%7Cnumeric-tower

5:19 mtd: babilen: it's just I don't have project.clj, just playing with oneoff scripts (in fact, I just wanted a nicer sqrt fn but will just use java.lang.Math/sqrt for now

5:19 babilen: ah, cool, didn't know that

5:19 ejackson: hahaha, def easier

5:20 raek: mtd: with lein-oneoff the "defdeps" form at the top of the file serves as a "script-local project.clj"

5:20 clojurebot: It's greek to me.

5:21 raek: so you'll have (defdeps [[org.clojure/math.numeric-tower "0.0.1"]]) at the op of your file

5:21 *top

5:21 mtd: raek: yeah, thanks, that was exactly what I wanted...very useful, I think

5:21 raek: another approach is to have a "scratch project" whose project.clj include the libs you usually use

5:21 * mtd often gets the feeling he's fighting the whole "d/l a whole set of jars for project x, just like project y's jars" idea, but lein-oneoff is perfect

5:22 mtd: raek: yeah ISWYM about scratch project; that would work too

5:22 raek: you can run individual script files using lein "run -m the.name.space"

5:22 mtd: raek: gotcha, good to know

5:22 raek: if you provide a (defn -main [...] ...) function in that namespace

5:23 mtd: yeah, the install libs globally and run a file approach is perhaps more convenient for one-off scripts

5:23 mtd: raek: gotcha

5:24 raek: mtd: but Leinginen has higher ambitions. you need something like projects in the end for anything that becomes big

5:24 mtd: raek: definitely...I appreciate (in many senses) that goal, and it's quite easy to use.

5:25 raek: AFAICT, most other "dynamic" lagnuages have developed something similar to the proejct approach (e.g. virtualenv in python and rvm in ruby)

5:26 mtd: raek: yeah, though I never needed that level of flexibility in python; if I did, I would just stick the offending (older-version, usually) module in the project's pythonpath.

5:26 raek: can't speak for ruby. The set-of-jars-per-project really feels like overkill coming from python world, but I understand the idea from a defensive / deployment perspective.

5:27 raek: I know that I don't have to convince you, but here is the rationale in case you want to read more: https://github.com/technomancy/leiningen/wiki/Repeatability

5:28 mtd: raek: I buy the arguments for repeatability in theory, and have never needed them in practice (though I of course understand tons of people would). I'm just lucky :).

5:28 raek: will read that in detail, thanks

5:29 raek: but it can be nice that you can still clone a two year old project on github and run lein deps and it still works

5:30 mtd: raek: indeed, good point

5:30 raek: immutability in build systems ftw!

5:31 * talios shudders at the thought of self modifying build systems - but then, thats kinda what the maven release plugin does

5:34 mtd: heh

5:36 raek: that is a good read, not least for the implicit survey of current-best-way-of-doing-X, for X in commonly-needed-thing. Thanks.

6:36 apologies for the vagueness, but is there a python dir() equivalent for the clojure REPL? I want something like clojure.contrib.repl_utils for clojure 1.3 that works both for java objects and clojure <waves hands> objects.

6:36 * mtd has seen http://stackoverflow.com/questions/4637615/python-dir-equivalent-in-clojure

6:36 mtd: (it's basically unanswered for 1.3, AFAICS)

6:37 clgv: mtd: you can get the code from the old contrib if it wasnt migrated to a new library

6:38 mtd: clgv: sure - was hoping someone had already done it, but will go that route if not

6:38 clgv: dir() is super useful in python repl: applicable to everything, always present (as opposed to documentation)

6:38 * mtd misses that in clojure

6:39 clgv: mtd: hm yeah something like that for namespaces would be great

6:39 mtd: doc, dir, pr, clojure.reflect/reflect, etc.

6:40 clgv: yeah - clojure.repl/dir is a good start, but wish it took a whole bunch of types besides symbols-of-namespaces

6:40 clgv: mtd: ok, clojure.reflect/reflect does not print useful output ;)

6:40 mtd: clgv: indeed :)

6:41 clgv: (map prn (get (reflect f) :members)) is a bit more useful

6:41 (if I make my terminal font about 1pt :))

6:42 clgv: well they should have included show then^^

6:42 * mtd has used (inspect some-symbol) and was trying to discover, without using javadoc, the JFrame method to close (it's "dispose", but I had to cheat)

6:42 mtd: clgv: yeah, wish they had (in clojure.repl, I guess)

6:43 * mtd has "lost" a JFrame - it's still on my screen, (inspect foo) instantiated it, but I've evaluated plenty of forms at the REPL and I don't know how to get a symbol for the JFrame any more :(

6:43 mtd: (sorry for spamming the channel with newbie stuff)

6:45 clgv: what inspect did you use?

6:46 mtd: clgv: (use 'clojure.inspect) --> #<inspector$inspect clojure.inspector$inspect@1bfd9cd5>

6:47 clgv: oops, clojure.inspector

6:47 clgv: ah that one improved

6:48 hmm I wonder what the buttons are for

6:49 mtd: clgv: they don't do much in the few things I've inspected, yeah

6:49 clgv: mtd: I built my own inspect^^

6:49 but it needs to get more user friendly for customizing display^^

6:51 mtd: seems those buttons are for decoration only, yet ;)

6:51 they have no handler in the source I got

6:52 mtd: clgv: ah

7:38 Frozenlock: I'm trying to get clojure-jack-in to work on win7. I get this error: "Could not start swank server: '$SHELL'..." I think I need to add something to my environment variable, but what?

9:09 antares_: hi. how can I distinguish between maps and functions in a protocol w/o using all specific map implementation classes?

9:10 clgv: antares_: via 'map? and 'fn? - if that doesnt help you you have to explain in more detail what you really want to do.

9:11 antares_: clgv: those functions won't work for protocols

9:11 clgv: you got the idea right but I am trying to do this with protocols

9:11 so I have to provide types

9:11 bsteuber: clojure.lang.IPersistentMap ?

9:11 antares_: alternatively, is there a core function that returns "type" I can cond on?

9:11 clgv: antares_: well then I dont understand what you want to do^^

9:11 antares_: bsteuber: yes but maps are also functions

9:12 so I am getting IFn matching some of the time and IPersistentMap matching other times

9:12 clgv: I am trying to write a protocol function that can work with both maps and functions

9:12 but maps are also functions

9:12 clgv: so whats the problem?

9:13 bsteuber: IFn shouldn't match when you have implemented it for IPersistentMap

9:13 clgv: make (minimal) examples - they always help to understand^^

9:13 bsteuber: because the most concrete type should be matching

9:13 and I

9:14 IPersistenMap should be a subtype of IFn

9:14 antares_: clgv: sometimes compiler seems to pick on one implementation (tests pass), sometimes the other (obscure failures)

9:14 bsteuber: at least in clj, different story with cljs

9:14 antares_: bsteuber: yes, and that's exactly the issue

9:14 bsteuber: antares_: so you do cljs?

9:14 antares_: bsteuber: no I don't

9:15 clgv: https://gist.github.com/035d79153dd3781fd179

9:15 jsabeaudry: When working with gloss, if I have a prefix indicating the length of a string, is the proper way to do this a (repeated (string :length 1) :prefix :byte) ?

9:15 antares_: roughly half of the time I am getting obscure runtime exceptions about APersistentMap being invoked with 0 arguments

9:18 clgv: listing exact map implementation classes seems to help, I need to run tests 100 times to tell for sure :(

9:18 bsteuber: antares_: that's really weird, I can confirm this behavior

9:18 maybe write an issue

9:19 hiredman: emacs -nw /var/log/emacs.log

9:19 bsteuber: or there's just something I don't understand about protocols yet ^^

9:19 hiredman: whoops, pardon me

9:19 clgv: antares_: you can inspect the map belonging to the protocol. maybe you spot something odd in there

9:19 antares_: clgv: how can I do it?

9:19 (println [proto name]) ?

9:20 bsteuber: ok, will do

9:20 clgv: antares_: it is bound to the name of the protocol

9:21 antares_: clgv: yeah I figured it out. Awesome, thanks. I will play with it a bit more and file a ticket.

9:22 Frozenlock: I'm trying to get clojure-jack-in to work on win7. I get this error: "Could not start swank server: '$SHELL'..." I think I need to add something to my environment variable, but what?

9:22 bsteuber: antares_: actually, all the maps I tried trigger IFn

9:23 antares_: bsteuber: ok

9:23 dnolen: antares_: there is no way to accomplish what you want w/ protocols

9:23 antares_: bsteuber: so should I list implementation classes instead?

9:23 dnolen: even if I use specific classes and not interfaces?

9:24 dnolen: antares_: oh sorry, yes if you specify specific classes.

9:24 antares_: dnolen: I can rewrite this using multimethods. Is there a good way to get :map, :fn and similar kewords for a data structure, using some core functions?

9:24 dnolen: ok, I think that will work. Hopefully 1.4 won't introduce new classes :)

9:25 clgv: antares_: you dont need keywords for multimethods. you can use types there as well

9:26 antares_: clgv: hm, yeah, but it won't be any different from protocols

9:26 hm, but the comparison will be exact, right?

9:26 clgv: multimethods use 'isa?

9:26 antares_: I see

9:26 ok folks, thanks for your help

9:27 clgv: &(isa? clojure.lang.IFn {})

9:27 lazybot: ⇒ false

9:27 clgv: &(isa? {} clojure.lang.IFn)

9:27 lazybot: ⇒ false

9:27 raek: &(isa? clojure.lang.IFn (class {}))

9:27 lazybot: ⇒ false

9:28 TimMc: isa? is backwards

9:28 raek: &(isa? (class {}) clojure.lang.IFn)

9:28 lazybot: ⇒ true

9:28 TimMc: (relative to instance?)

9:30 antares_: dnolen: if I use AFunction or RestFn, will it cover all functions (that return true for clojure.core/fn?)

9:31 dnolen: antares_: you're running into the problem where things are overlapping w/ protocols. one possible workaround? let IFn be handled in the default case.

9:31 so first match all the types, then in the default case test for IFn and handle it there.

9:32 antares_: dnolen: the problem is, I have Object implementation already and I really need it

9:32 dnolen: antares_: so keep it, doesn't stop you from handling IFn.

9:33 antares_: dnolen: but won't function just match Object impl?

9:33 TimMc: Nothing stopping you from using instance? at that point is there?

9:34 dnolen: (extend-type Object PFoo (bar [x] (if (fn? x) fn-case-expr object-case-expr)))

9:35 antares_: dnolen: ok, thanks. It would work for me, too.

9:35 dnolen: I think clojure.lang.AFunction worked

9:38 dnolen: antares_: interesting, good to know if true.

9:38 antares_: dnolen: I am trying with AFunction and IPersistentMap

9:39 seems to work, 10 passes in a row

9:41 dnolen: antares_: looking at the JVM source, that looks right to me.

9:42 antares_: dnolen: it better be right, I already tweeted about it :D

9:48 bsteuber: good to know extend doesn't handle interface hierarchies

9:54 uvtc: Hi #clojure. I just noticed that this page http://dev.clojure.org/display/design/Moving+clojure.org+to+Confluence indicates that clojure.org was at one point going to be switched over to using Confluence.

9:55 but evidently clojure.org uses wikispaces.

9:55 Also, the link to "demark" on the Confluence page is broken...

9:55 Just curious what the history is here, and what plans there are.

9:58 ... if there *are* any plans, anyway.

10:01 stuartsierra: no firm plans

10:01 clojure.org is a mess

10:01 uvtc: In what way? In that it requires updates?

10:05 bsteuber: how does lein-clojurescript deal with macros?

10:05 or is there a better cljs plugin?

10:07 uvtc: stuartsierra: Ok. Found this http://dev.clojure.org/display/doc/clojure.org+TODO+list

10:12 bsteuber: ah I think it was lein-cljsbuild

10:28 jsabeaudry: What is the use for merge? Isn't conj enough?

10:31 TimMc: jsabeaudry: I give you two or more maps. Now merge them with conj.

10:31 hiredman: /win 15

10:32 jsabeaudry: ,(conj {:a 1} {:b 2} {:c 3})

10:32 clojurebot: {:c 3, :b 2, :a 1}

10:33 gtrak`: ,(conj {:a 1 :b 2} {:c 3 :d 4})

10:33 clojurebot: {:d 4, :c 3, :a 1, :b 2}

10:33 gtrak`: hmm, why does that make sense?

10:33 jsabeaudry: TimMc, I just did?

10:34 TimMc: gtrak`: It doesn't.

10:34 ,(conj {:a 1 :b 2} {:c 3 :d 4} {:e 5 :f 6})

10:34 clojurebot: {:e 5, :f 6, :d 4, :c 3, :a 1, ...}

10:34 gtrak`: i would have thought it would work with entries but not full maps

10:34 TimMc: &(conj {:a 1 :b 2} {:c 3 :d 4} {:e 5 :f 6})

10:34 lazybot: ⇒ {:e 5, :f 6, :d 4, :c 3, :a 1, :b 2}

10:35 TimMc: Ugh, this is that stupid special-casing.

10:35 &(conj {:a 1 :b 2} {:a 3 :d 4} {:a 5 :f 6})

10:35 lazybot: ⇒ {:f 6, :d 4, :a 5, :b 2}

10:35 TimMc: jsabeaudry: Carry on then. -.-

10:35 uvtc: ,(into {:a 1 :b 2} {:c 3 :d 4})

10:35 clojurebot: {:a 1, :b 2, :c 3, :d 4}

10:36 gtrak`: into makes more sense

10:36 uvtc: I was going to ask what bots are on this channel, and I see there's 2 (at least). What's the difference between clojurebot and lazybot?

10:36 jsabeaudry: TimMc, I'm not sure what the conclusion is here? conj works as merge but it shouldn't so I should use merge and not rely on the current behavior?

10:37 gtrak`: jsabeaudry, relying on the special-case is a form of obfuscation

10:37 TimMc: uvtc: Names, features, security, maintainers...

10:38 gtrak`: you should do the thing that matches your intent most closely, unless there's a performance win or something (there probably isn't)?

10:38 TimMc: uvtc: Use clojurebot when lazybot complains that you're trying to hax it.

10:38 jsabeaudry: gtrak, got it, thanks!

10:38 uvtc: TimMc: Hah. :) Thanks.

10:38 TimMc: uvtc: But lazybot is generally faster and smarter.

10:38 miltondsilva: jsabeaudry: if this works (conj [] [1] [2] [3]) why shouldn't your case?

10:39 TimMc: &(conj [] [1] [2] [3])

10:39 lazybot: ⇒ [[1] [2] [3]]

10:39 TimMc: miltondsilva: Did you want that, or [1 2 3]?

10:39 gtrak`: that's what I would have expected

10:39 miltondsilva: oh I see what you mean

10:39 gtrak`: since maps are seqs of entries, the map-case doesn't make sense

10:40 DrBenway_: ,(conj nil {:a 1 :b 2} {:a 3 :d 4} {:a 5 :f 6})

10:40 clojurebot: ({:a 5, :f 6} {:a 3, :d 4} {:a 1, :b 2})

10:41 DrBenway_: ,(merge nil {:a 1 :b 2} {:a 3 :d 4} {:a 5 :f 6})

10:41 clojurebot: {:f 6, :d 4, :b 2, :a 5}

10:41 DrBenway_: big difference in behavivor :-)

10:41 gtrak`: ,(conj {} {:a 1 :b 2} {:a 3 :d 4} {:a 5 :f 6})

10:41 clojurebot: {:f 6, :d 4, :b 2, :a 5}

10:41 TimMc: THat's right, the nil base case is completely different.

10:42 gtrak`: ,(conj {} :a 1 :b 2)

10:42 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword>

10:42 TimMc: The first arg's .cons method controls the behavior, and if it is nil, an empty seq is substituted in.

10:42 gtrak`: ,(conj {} [:a 1] [:b 2])

10:42 clojurebot: {:b 2, :a 1}

10:43 TimMc: Read PersistentHashMap's .cons method, it's fucked up.

10:43 (Possibly actually APersistentMap)

10:47 gtrak`: ,(conj {} [[:a 1] [:b 2]])

10:47 clojurebot: {[:a 1] [:b 2]}

10:47 gtrak`: ,(into {} [[:a 1] [:b 2]])

10:47 clojurebot: {:a 1, :b 2}

10:52 beardmigration: Big thank you to @babilen and @vijaykiran for help in getting me up and running with emacs a couple of days ago.

10:53 Now I've found time to do a bit of clojure I have another newbie problem with classpaths and name spaces...

10:53 ... I want to set up a leiningen project, write a couple of functions and unit tests for them.

10:53 However nothing seems to want to compile.

10:53 Any suggestions?

10:54 vijaykiran: beardmigration: hi there ..

10:54 amro: what's the error?

10:54 uvtc: What have you done so far?

10:55 vijaykiran: may be you want to paste your project.clj - somewhere

10:55 beardmigration: From the command line: lein compile No namespaces to :aot compile listed in project.clj.

10:55 uvtc: beardmigration: you might paste code to https://refheap.com/paste

10:55 clgv: beardmigration: try "lein uberjar" if you want a standalone jar of your project

10:56 neotyk: beardmigration: lein test

10:56 don't lein compile if you don't have to

10:56 devn: kibit is awesome.

10:56 * vijaykiran +1s kibit

10:56 * devn writes a github bot to wander around automating pull requests with kibit

10:57 devn: :X

10:57 neotyk: devn: are you aware of hubot?

10:58 how cool would it be if kibit could derive the rules from clojure source code?

10:59 gtrak`: kibit = awesome

10:59 beardmigration: lein test output - stacktrace starting with: Exception in thread "main" java.lang.RuntimeException: java.lang.Exception: namespace 'pruefungen.core' not found after loading '/pruefungen/core'

11:00 gtrak`: beardmigration, did you do 'lein new' to create your project or set it up manually?

11:01 beardmigration: <gtrak'> lein new.

11:02 I'm confused as to the role of two core.clj files - one in the testing tree and one in the src.

11:02 TimMc: beardmigration: The test one should test the src one.

11:03 beardmigration: By the way, "core" is just a suggestion -- you can name it anything.

11:03 owain`: Hey all. I'm interested to know if anyone has any experience in building large web apps in Clojure. I've built a few smaller apps but wondered if there are any example of big ish apps out there.

11:03 beardmigration: So must the name of the test file match the file it unit tests?

11:04 owain`: I'd love to do more and more work in clojure and know how to do mvc from scratch but some examples would be really useful to learn from.

11:04 TimMc: beardmigration: Nope. (But the namespace must match the file name and path.)

11:04 vijaykiran: no, it doesn't. You can put the test anywhere you like.

11:05 gtrak`: owain`, check out noir and korma

11:05 beardmigration: Ah that's the nub of it - how must the namespace match the paths?

11:05 owain`: thanks. I've looked at both. Noir is excellent

11:05 Vinzent: owain`, also, take a look at https://github.com/duck1123/jiksnu

11:05 owain`: Just wondering more about structuring things like how you'd do MVC in rails or Django.

11:05 Or does that not apply so much in a functional language?

11:06 Vinzent: not seen that before. thanks

11:06 gtrak`: mvc is a little different in functional-land, really I think no-one agrees on what MVC should be anyway

11:06 owain`: That's kind of what I was wondering.

11:06 duck1123: Ciste is the MVC part. Jiksnu is more of an implementation of Ciste

11:06 owain`: Does MVC matter as much in a language like Clojure. I'd LOVE to do all my web work in Clojure.

11:07 TimMc: beardmigration: - becomes _, . becomes /

11:07 DrBenway_: beardmigration, if you have any clj files in src or test paths where the path dosnt mach the (ns or have no (ns ... ) - you gets relly wired errors messages from lein

11:07 TimMc: Blame the JVM for those restrictions.

11:07 gtrak`: owain`, separation of concerns matters, but a controller can be a namespace instead of an object or something, for example

11:08 owain`: I'm still reaching for ROR for apps if I need things doing quickly. This is mainly becuase it's just easier to do. If I was doing a startup now I'd like to use Clojure ratherthan ror

11:08 TimMc: beardmigration: ./src/foo/bar/baz.clj has a namespace of foo.bar.baz (if src is the source root)

11:08 uvtc: Was just reading http://clojure.org/state and would like to confirm some terminology: The term "object" is pretty generic and may refer to values (that is, your usual immutable garden variety things such as numbers, strings, functions, data structures, etc.) or "object" may refer to "reference types" (Vars, Refs, Agents, or Atoms --- which are mutable). Correct?

11:08 owain`: This was the only really good example I've seen. https://github.com/abedra/shouter

11:09 gtrak`: owain`, conjure was an attempt to be like rails, but I don't know how many folks actually use it

11:09 owain`: Yeah I didn't like the look of it.

11:09 Felt too "big"

11:09 Not sure how to describe it. Just seemed wrong for Clojure.

11:10 Certainly interesting.

11:10 beardmigration: <TimMc> Does that mean that ./test/pruefungen/test/test_core.clj should have ns test.pruefungen.test.test_core?

11:10 TimMc: uvtc: I havne't heard the latter sense before.

11:10 beardmigration: Drop the first "test."

11:10 vijaykiran: and I think test_core should be test-core

11:10 at the end

11:11 gtuckerkellogg: can anyone tell me what I'm doing wrong here? http://pastebin.com/YhX8JpUm

11:11 TimMc: ^ yeah, hyphen in the ns

11:11 beardmigration: <TimMc> so the test directory is included in the classpath?

11:11 vijaykiran: I'd leave -/_ for now - just name it core.clj

11:11 uvtc: TimMc: Vars, Refs, Agents, and Atoms are mutable, correct?

11:11 TimMc: beardmigration: right

11:11 clgv: gtuckerkellogg: you are closing the file from with-open before the lazy-seq from map is evaluated

11:12 TimMc: uvtc: yup

11:12 beardmigration: <vijaykiran> yep I'd noticed some problems with _ being translated to - or vice versa - is it recommended not to use these in filenames?

11:12 TimMc: uvtc: "reference types"

11:12 gtuckerkellogg: am I?

11:12 huh

11:12 duck1123: owain`, I would suggest you check out Ciste, if you're looking for MVC.

11:12 clgv: gtuckerkellogg: it'll work if you put a 'doall in front of the map

11:12 gtuckerkellogg: thanks!

11:12 vijaykiran: beardmigration: the only caveat is _ in the file name means - in namespace .. but you can safely ignore it for now.

11:13 uvtc: TimMc, I think I saw that term in Joy of Clojure ... one sec...

11:13 gtuckerkellogg: yay! and so it did, thank you clgv

11:13 vijaykiran: beardmigration: since _ means something diff in clojure :)

11:14 beardmigration: <vijaykiran> yes of course.

11:14 Ok thanks for the input - let me try it out...

11:14 uvtc: TimMc: Yes, here it is, section 11.2 of JoC: "Clojure currently provides four different reference types to aide in concurrent programming: Refs, Agents, Atoms, and Vars."

11:15 gtrak`: owain`, also this guy: https://github.com/seancorfield/fw1-clj

11:15 they use it for real stuff

11:16 owain`: gtrac: Thanks. Looks good. What I was looking for.

11:16 uvtc: TimMc: my hunch is that the word "object" is simply overloaded, and somewhere along the line I thought it was equivalent to "value".

11:16 owain`: I was wondering how many people used a hybrid approach like Flightcaster where all the front end would be done in something like ror etc and the complex stuff done in Clojure.

11:17 uvtc: TimMc: Thanks.

11:17 gtrak`: owain`, I think twitter does stuff like that, slowly replacing their ruby backend with java/scala/clojure

11:18 owain`: I kind of like that idea. Splitting up into smaller apps that do specific things.

11:18 gtrak`: http://www.infoq.com/articles/twitter-java-use

11:18 owain`: I heard Etsy.com use Clojure/Scala as well. Might be wrong.

11:20 beardmigration: I'm making progress - at least lein seems to want to try to run some tests. However it doesn't recognise the assertions in this code: (ns pruefungen.test.test-core (use: pruefungen.core) (use: clojure.test)) (deftest core-test (is (= hello "Hello World!")) (is (= (hello "thing") "Hello thing!")))

11:20 owain`: Maybe that's a good way to go. Smaller apps working together rather than one giant monolithic framework.

11:20 duck1123: it all depends on how much you can break off into smaller tasks and how many queues you have

11:21 uvtc: beardmigration, just saw a blog post that might be useful to you: http://reminiscential.wordpress.com/2012/03/03/writing-a-simple-clojure-library/

11:22 beardmigration: Thanks <uvtc> - that post seems to be at my level!

11:23 gtrak`: meh, no sense in overengineering everything upfront, I think FP makes it easier to refactor out into services later

11:24 babilen: beardmigration: You are most welcome -- Great that you got it working! :)

11:24 uvtc: beardmigration, sure, yw

11:25 owain`, Regarding etsy.com, from the job postings I've seen, they don't mention explicitly Clojure ("Our current systems run PHP, Java, Python, Ruby, Solr/Lucene, Postgres, MySQL, and more.")

11:25 raek: beardmigration: :use, not use:

11:26 beardmigration: babilen: Erm not quite unfortunately - lein doesn't see my assertions in my testing file, for some reason. I've just put the use: namespaces in square brackets but that doesn't seem to help.

11:26 Suspect I still have a classpath / namespace problem.

11:27 babilen: beardmigration: See raek's remark

11:27 owain`: uvtc: I think this bit was done in Clojure. http://www.etsy.com/search?search_submit=&q=

11:27 vijaykiran: beardmigration: see what raek said (:use ....) not (use: ...)

11:27 owain`: Remember seeing it on HN I think. Hang on.

11:27 http://news.ycombinator.com/item?id=1453259

11:27 They probably use a ton of stuff by the look of it.

11:28 PHP, Java, Python and Ruby? Why would you use so many languages? Haha.

11:29 dnolen: owain`: from what I hear they're pulling back on the number of languages they use.

11:29 uvtc: owain`, Ah, neat. Thanks.

11:29 hiredman: I wonder if I could interest them in my lisp->php compiler

11:31 langmartin: I have a java interop question, I'm trying to use a netty http client and I can't access some static class fields (which are just constants, as far as I can tell). (ns ... (:import org.jboss.netty.handler.codec.http.HttpHeaders)) is fine, it's meant to have a Names and Values static subclass with a bunch of static fields in each

11:32 gtrak`: hiredman, gross :-)

11:32 langmartin: Names and Values are both not found, and can't be imported directly. any help would be greatly appreciated

11:32 owain`: gtrack: +1 haha

11:32 babilen: beardmigration: Actually make that: (ns pruefungen.test.test-core (:use [pruefungen.core]))

11:33 hiredman: langmartin: you have to use the jvm class names

11:33 beardmigration: <facepalm!> Ahem - yes I should have paid attention to the syntax colouring. That's great - thanks all assertions are failing and passing as they should.

11:33 Is there a better workflow to test just the file you have edited in emacs rather than go out the shell?

11:33 hiredman: langmartin: javac turns inner classes into like HttpHeaders$Names

11:34 langmartin: hiredman: no shit! that goes on my newbie notes page then

11:34 dnolen: clojurebot: ~max

11:34 clojurebot: Pardon?

11:35 dnolen: ~max

11:35 clojurebot: Most users ever in #clojure: 404

11:35 hiredman: ~max users

11:35 clojurebot: Pardon?

11:35 uvtc: ~current

11:35 clojurebot: Titim gan éirí ort.

11:35 hiredman: clojurebot: jerk

11:35 clojurebot: you cut me deep, man.

11:35 vijaykiran: 404 :)

11:35 babilen: beardmigration: Well, I like lazytest -- https://github.com/stuartsierra/lazytest -- But there are good alternatives such as midje too. Also a number of testing related leiningen plugins are listed on https://github.com/technomancy/leiningen/wiki/Plugins

11:37 stuartsierra: Midje is under more active development than Lazytest right now.

11:37 babilen: stuartsierra: I still like lazytest -- Sad to hear that midje is under more active development (which probably means that lazytest is not)

11:38 jsabeaudry: &(bytes [1 2 3 4])

11:38 lazybot: java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to [B

11:38 langmartin: hiredman: thanks so much, works like a char

11:38 m

11:38 stuartsierra: babilen: I wrote Lazytest, but have not had time to work on it in the past year or so.

11:38 babilen: stuartsierra: But you are right -- Given that the last commit was one year ago, I probably shouldn't recommend it anymore.

11:39 Vinzent: is there topological sort implementation somewhere in standart lib?

11:39 beardmigration: 'lein test' is somewhat slow for optimal test integration.

11:39 hiredman: "optimal test integration"

11:42 beardmigration: I suppose that would be a fast test runner integrated into the editor. But look I'm being picky - it's all new and exciting. I'll have a look at midje.

11:43 babilen: beardmigration: https://github.com/marick/Midje/wiki/Midje-mode

11:43 gtrak`: midje uses core.unify, maybe it can use core.logic or does it matter?

11:43 owain`: babilen: that looks good. Thanks.

11:44 beardmigration: babilen: even better an emacs minor mode!

11:44 mdeboard: So, funny question: Is anyone here going to be at Pycon

11:45 gtrak`: mdeboard, I did pycon audio/visual in 2010, I'm sad I can't go, but I'm going to clojure/west :-)

11:45 mdeboard: Yeah unfortunately I'm a single parent otherwise I'd just stay out there :(

11:45 Well, "unfortunately my responsibilities prevent me from staying out there", not unfortunately @ single parent

11:46 beardmigration: Thanks again to all - I'm looking forward to writing something more substantial.

11:46 gtrak`: mdeboard, apparently stallman's giving a lecture, too

11:46 mdeboard: ya

11:49 gtrak`: is there any big news in python anyway? I lost interest a couple years back

11:52 mdeboard: gtrak`: Not really in my world of web dev. Nothign I personally get too excited about anyway.

11:52 (though admittedly it does take a lot to get me excited)

11:52 gtrak`: clojure stole my heart :-)

11:52 mdeboard: yeah

11:53 well, I'll probably be primarily python for a few years but clojure/scala/anything else is a great way to get better at programming in general

11:54 gtrak`: I think there's a lot of value in writing equivalent code in different methods/paradigms/languages

11:55 uvtc: gtrak, I hear about PyPy making strides. Actually, to keep things on-topic, I read about a Clojure impl in Python a few days ago: https://github.com/halgari/clojure-py

11:55 gtrak`: yea, pypy was always interesting to me

11:55 unladen swallow died unfortunately

11:55 alexbaranosky: gtrak, I agree -- the best way to see alternative design solutions is to be able to come up with multiple isomorphic solutions

11:56 then you can compare and contrast their relative merits

11:57 gtrak`: alexbaranosky, on an even deeper level, you can just see the code is equivalent... i.e. static functions with a lookup-table on the first-arg vs polymorphic virtual functions

11:57 refactoring is a big part of what I do every day

11:57 lucian: gtrak`: i'd say unladen fortunately died :)

11:57 alexbaranosky: gtrak, that's the kind of thing I'm thinking, yeah!

11:58 geoffeg_c: with "lein deploy", it should push into the maven repo defined in :deploy-repositories in project.clj and with the auth defined in ~/.lein/profiles.clj?

11:58 lein doesn't seem to be picking up the auth definition in profiles.clj

11:59 martintrojer: So, who's gonna start an open-source datomic compatible project? The gauntlet is thrown...

11:59 gtrak`: alexbaranosky, making code look like what it is :-)

12:15 geoffeg_c: is there some full example of a profiles.clj file i can read? lein doesn't seem to be picking mine up

12:16 i can't find docs on what the file needs to contain

12:16 xeqi: what version of lein are you using?

12:17 geoffeg_c: 1.6.2

12:17 xeqi: profiles new for 2.0

12:18 sorenmacbeth: geoffeg: you have to use 1.7.0 to use ~/.lein/profiles.clj

12:18 xeqi: *are new

12:18 sorenmacbeth: xeqi: they are in 1.7.0 as well I believe

12:19 geoffeg_c: ok, i'll upgrade

12:24 ok. i upgraded to 1.7.0 and it does not appear to be reading profiles.clj. is there an example profiles.clj i can see?

12:25 TimMc: geoffeg_c: Yes, in the lein repository there is a sample project.clj.

12:25 erf, misread

12:26 geoffeg_c: yep, but i can't find an example profiles.clj

12:30 `fogus: Anyone have insight on how to get lein to spit out a different directory for the pom resources element?

12:30 kij: Hey, is there any guides how to do logins and security in clojurescriptone ?

12:30 xeqi: profiles are new in lein 2 which doesn't have a release yet, requires running from master; see https://github.com/technomancy/leiningen/tree/1.x for the 1.7 readme

12:32 `fogus: have you tried :resources-path ?

12:33 `fogus: xeqi: Oh! You're supposed to spell that properly!?! ;-)

12:33 Thank you

12:34 technomancy: Lein 3.0 feature request: DWIM :p

12:35 sorenmacbeth: xeqi: I'm using profiles just fine in lein 1.7.0

12:36 technomancy: there's a plugin back-porting profiles to 1.x, but it won't work out of the box

12:37 it's also a bit behind the profiles implementation in lein 2

12:40 gtrak`: kij, there's sandbar for a clj solution, i think some folks use spring security for more comprehensive stuff

12:40 sorenmacbeth: technomancy: isn't profile.clj the recommended way to do site-wide plugin handling in 1.7?

12:40 profiles

12:40 technomancy: sorenmacbeth: no, the back-porting of profiles to 1.x is kind of experimental

12:40 great if it works for you though =D

12:41 sorenmacbeth: technomancy: seems to be :p

12:41 technomancy: I don't think I've actually told anyone about it, so congratulations on discovering the easter egg =)

12:41 sorenmacbeth: technomancy: though I did have to run `lein plugin install` still

12:42 so maybe I just thought it was working

12:45 kij: gtrak`: thanks!

12:53 geoffeg_c: how do i get "lein deploy" to also install the pom ("lein install" generates it)?

12:55 Licenser: did you ever notice that if you have the wrong font pom and porn look very much the same?

12:56 geoffeg_c: i hadn't previously

12:56 how can i install porn in maven?

12:57 eggsby: lol Licenser :D

12:57 that keming D:

12:57 sorenmacbeth: geoffeg_c: mvn porn:bow-chica-bow-wow

12:58 geoffeg_c: i'm amused that there are so very few discussions about deploying a jar to a maven repo.. apparently most clojure developers don't work in mutli-developer teams.. or if they do, they don't use maven

12:58 Licenser: now you guys have something to talk about that should end the quiet

12:58 gtuckerkellogg there is lein-clojars?

12:59 geoffeg_c I ment

12:59 TimMc: geoffeg_c: As in, deploying to a local nexus?

12:59 sorenmacbeth: geoffeg_c: see http://clojars.org

12:59 geoffeg_c: yea, but my employer has their own private maven repo (artifactory), i don't want to push to clojars..

13:00 technomancy: geoffeg_c: "lein deploy" should get the pom installed too; I've never heard of that failing

13:00 it sounds like you may have found a bug?

13:00 geoffeg_c: hmmm, maybe artifactory is being stupid.. it seems to really enjoy doing stupid thjings

13:00 Licenser: stop saying pom … please?

13:00 geoffeg_c: technomancy: i'll look into what the problem with the pom is

13:01 technomancy: geoffeg_c: I try to encourage people to use private s3 buckets for private repositories since there's no maintenance burden, but if you've already got an archiva set up that should work

13:03 geoffeg_c: technomancy: hmm, that's an interesting idea.. but how will lein handle finding the jars i push up to s3? in other words: i have two projects we've developed in-house, one depends on the other and we have multiple developers (5-6) working on it

13:03 can i tell lein to go look in s3 for deps?

13:03 technomancy: just add a repository like "s3p://my-secret-bucket/releases" to :repositories in project.clj

13:03 and be sure the s3-wagon-private plugin is in :plugins

13:03 geoffeg_c: i like this idea :)

13:14 technomancy: would people use the backported profiles plugin if I updated it?

13:14 I'm hesitant to just because I want people to try out lein 2, but that's selfish of me =)

13:15 `fogus: thanks for getting that pushed out

13:18 hiredman: technomancy: if I had the time to do new things I would just move to lein 2

13:19 technomancy: yeah, with the migration path being helped by lein-precate I think backporting features is probably unnecessary

13:20 `fogus: technomancy: Thanks for the legwork on lein-marg

13:34 mrBliss: `fogus: I spotted a small mistake in your announcement about Marginalia (I use it a lot, thanks!) on the ML: `(def a-var value "The docstring")` should be `(def a-var "The docstring" value)`

13:35 `fogus: mrBliss: Thanks. Will fix now.

13:37 mrBliss: `fogus: that's quick! Thanks again for your hard work.

13:38 `fogus: Thank you

13:38 technomancy: `fogus: oh hum... marginalia needs to run in-process, doesn't it?

13:38 I mean in the project's process rather than Leiningen's?

13:38 `fogus: ja

13:39 technomancy: yeah I think I may have goofed on the lein2 support; I must have only been testing it with 1.7 =(

13:41 herp && derp

13:41 `fogus: DO'ETH!

13:45 technomancy: `fogus: I've got a fix

13:45 if you want to do an 0.7.1 of lein-marg alone I'll update the docs to reflect it

13:45 sorry =\

13:46 `fogus: Nah, it's been ~11 minutes. I'll repush v0.7.0

13:47 technomancy: sneaky

13:48 pull-req'd

13:58 * `fogus wonders how Ken will yell about the release notes this time.

14:04 technomancy: is he still around?

14:05 dnolen: perhaps reincarnated as Cedric Greevey

14:05 technomancy: wouldn't surprise me

14:06 `fogus: There is no chance that they are different people

14:07 TimMc: Who is this, some kind of complainer? troll? agent provacateur?

14:07 `fogus: You have no chance to survive make your time

14:10 emezeske: For great justice!

14:10 dgrnbrg: How do I split a string on a character?

14:10 I have a dot-separated string, and I'm trying to use .split, but I'm not getting the result I expect

14:11 nvm

14:11 I forgot . & regex interaction

14:11 technomancy: for some reason .split uses faux-regexes

14:11 it's pretty silly

14:12 I guess that's a coping mechanism for working in a language that doesn't have literal syntax for regexes

14:16 dgrnbrg: technomancy: i think they're real regexes

14:16 it just compiles them for you

14:17 technomancy: dgrnbrg: no, it takes a string argument

14:17 dgrnbrg: which is first compiled to a regex

14:17 it's a real regex, but it doesn't take the regex as the argument

14:17 it takes the pattern str-

14:17 technomancy: right; I'm just saying that a better-designed API would be to take a regex argument

14:18 if you didn't have to work around the shortcomings of the Java Programming Language™

14:19 danlarkin: technomancy: Sun's ex-lawyers thank you

14:19 technomancy: I should set up a dabbrev for that

14:20 dgrnbrg: technomancy: :)

14:20 at least the jvm is really fast

14:21 emezeske: *once it's running

14:26 dgrnbrg: *if it starts

14:29 rplevy: does cucumber-jvm's included clojure interface support the tabular data feature of cucumber? it seems like it doesn't yet, but I may be wrong.

14:53 Licenser: is there a way to make a callback function not callbacky?

14:53 `fogus: Unable to parse that sentence

14:54 amalloy: i think it parses fine but lacks semantics

14:55 Licenser: okay let me rephrase :)

14:55 solidsnack: Licenser: Do you mean, threads?

14:56 Licenser: I got some icky library that wants to only communicate via callbacks like bla.start(something, callback_function)

14:57 but I'd like to get the result out of that callback function and have the result outside of the call and not inside of the callback

14:57 TimMc: Licenser: atom & watcher?

14:58 * Licenser looks that up

14:59 `fogus: Licenser: You want to convert a function taking a callback into one that is synchronous?

14:59 amalloy: i suggest drinking their callback koolaid

14:59 Licenser: yes that is about what I want :)

14:59 amalloy it is annoying

14:59 `fogus: Licenser: https://github.com/joyofclojure/book-source/blob/master/src/joy/promises.clj#L39

14:59 TimMc: Licenser: but that lacks certain concurrency characteristics, since there is only one atom involved

15:00 amalloy: a promise is certainly better than an atom

15:00 nicl: Hey all, beginner here looking to get into clojure. But I'm having a problems installing swank-clojure and getting it set up with emacs.

15:00 TimMc: Licenser: Forget everything I said about atoms, including my correction.

15:00 nicl: Clojure and Leiningen are installed fine

15:01 And I've installed swank-clojure

15:01 Licenser: what atoms TimMc ?

15:01 TimMc: Hmm? :-P

15:01 nicl: But when I run lein swank I get 'Couldn't find project.clj...'

15:01 Any good walkthroughs out there for ubuntu/linux or anyone come across this problem ?

15:02 ibdknox: hm, are promises in CLJS?

15:02 ldopa: nicl: are you trying to run lein swank outside of a leiningen project?

15:03 nicl: ldopa: yeah, I just want to check if it is working. Because I get the same problem when I try m-x-clojure-jack-in in emacs

15:03 Licenser: ibdknox that is what I am researching right now ^^

15:03 ibdknox: I don't think they are

15:03 nicl: ldopa: do I need to create a project for this to work / to playaround ?

15:03 ldopa: nicl: yep

15:03 Licenser: noooooo :(

15:03 nicl: ldopa: ok great, thanks for the heads up

15:04 ibdknox: ,(source promise)

15:04 clojurebot: Source not found

15:04 stuartsierra: A Clojure promise is basically an Atom + a j.u.c.CountDownLatch

15:04 * Licenser simply tries

15:05 TimMc: Locking is easier in JS. :-P

15:05 ibdknox: heh

15:05 unfortunately that can't really work in JS

15:05 * lucian wants CPS transform macro :)

15:05 ibdknox: thinking about it more

15:05 TimMc: ibdknox: Oh, hum... because you can't block threads.

15:05 amalloy: it can easily just be an atom, right?

15:06 `fogus: promise deliver in ClojureScript could just be aliasing of the atom stuff as a start

15:06 TimMc: You;d have to make it a callback thingy anyhow!

15:06 ibdknox: `fogus: but you can't block

15:06 ever

15:06 amalloy: oh, right, i see

15:06 Licenser: hmm seems it does not

15:06 ibdknox: stupid browsers

15:06 TimMc: Licenser: The good news is, we can write promise/deliver. The bad news is, it will need a callback.

15:06 `fogus: A promise doesn't block either if it doesn't block

15:06 ibdknox: programming on the UI thread is stupid

15:07 * TimMc insert Radio Yerevan joke here

15:07 TimMc: s,/me ,/say /,

15:07 Licenser: problem is I hate this silly return everything in callbacks stuff

15:07 ibdknox: I think the closest you could do is something like a more complicated form of my letrem in fetch

15:07 TimMc: Welcome to JS.

15:08 amalloy: Licenser: it's not really silly, even on the jvm. in javascript it's practically mandatory

15:08 ibdknox: which wouldn't be that hard

15:08 TimMc: Right, you could have a macro that hides the fact that it is a callback.

15:08 Licenser: amalloy I understand that in some palces callbacks are a great thing

15:08 but not when every forking function reutrns their stuff in callbacks

15:09 lucian: surely dealing with callbacks is easier than dealing with threads in most cases

15:09 Licenser: ibdknox do you have a link to that in code?

15:09 lucian: deferreds or CPS transform are very simple solutions

15:09 ibdknox: Licenser: https://github.com/ibdknox/fetch/blob/master/src/fetch/macros.clj#L12

15:09 amalloy: meh. what's the difference? (my-fn (lib-call a)) vs (lib-call a my-fn)

15:10 nicl: ldopa: ok, created a project and it works great! Thanks

15:10 ibdknox: amalloy: try doing that when there's a loop involved

15:10 less common in Clojure

15:10 amalloy: it's true, i picked the most-convenient example

15:11 ibdknox: I think the problem is mostly that it requires an inversion of the implementation :(

15:11 and more importantly, the thinking around how to solve it

15:11 it works well enough and the simple case is certainly simple. It easily ends up degrading over time though. It's what pissed me off about Node

15:11 ldopa: nicl: np

15:12 Licenser: I just find it annoying this I don't want to put callbacks in every function call it is just annoying\

15:13 ibdknox: anyways, hiding it in a macro seems ok

15:14 Licenser: amalloy also if you want to do two things with the result from lib-call the first is a big difference to the second

15:15 ibdknox: I feel like this discussion about the ns form is mostly a non-discussion, the available options here are very narrow: break everyone or do nothing

15:16 I have a hard time believing the former would really be on the table

15:16 amalloy: ibdknox: for jvm-clojure, yes. for cljs, isn't it the opposite? fix it or do nothing?

15:17 ibdknox: amalloy: true, I bet the cljs "fix" is pretty trivial too

15:19 TimMc: ibdknox: ns discussion?

15:19 ibdknox: TimMc: http://groups.google.com/group/clojure-dev/browse_thread/thread/e8411f74f86b5a09

15:19 hiredman: multiple :requires is icky

15:20 arohner: ibdknox: I also have yet to see an opinion on why it needs a breaking change at all

15:20 ibdknox: arohner: yeah

15:20 arohner: hiredman: sure, but break all the existing code? why?

15:20 hiredman: arohner: to force people to do things in a not icky way

15:20 *shrug*

15:20 arohner: hiredman: would you like to come fix 50kLoC for me?

15:21 for free?

15:21 hiredman: arohner: you ahve 50kLoC of erroneous code

15:21 TimMc: If hiredman didn't have me on /ignore, I could explain to him some very compelling reasons.

15:21 gfredericks: reducing multiple requires to one shouldn't be hard to automate...

15:21 hiredman: I bet you could write a 10 line clojure program to fix it

15:21 TimMc: I'll just have to tell him in person at the meetup tonight.

15:21 arohner: hiredman: no, I don't. I have 50kLoC of other people's broken libraries

15:21 gfredericks: TimMc: what did you do to him?

15:22 TimMc: gfredericks: No idea.

15:22 arohner: "broken"

15:22 which is exactly why 1.3 was so painful

15:22 hiredman: arohner: ah, well, most of those are broken under 1.4 anyway

15:22 arohner: hiredman: what is breaking in 1.4?

15:22 hiredman: 1.3/1.4

15:23 TimMc: I don't have you on ignore

15:23 well, /ignore

15:23 Licenser: are we talking about combining require and use?

15:24 gfredericks: TimMc: the plot thickens!

15:24 hiredman: I am not deeply committed to the idea of breaking everything, I just can't believe the horrible style people write clojure code in

15:25 amalloy: i don't see why multiple requires are so offensive. i don't like them, but it's a reasonable choice to allow. maybe i want my app-related use/requires first, and then at the bottom some use/requires that i think nobody will care about

15:26 TimMc: Whoa, he acknowledges my existence!

15:26 gfredericks: amalloy: I due usually end up grouping things like that, but it makes me feel a little dirty

15:26 Raynes: Because it is.

15:26 hiredman: I've been thinking we could have one thing that does require+import that differentiated via () or []

15:27 Raynes: I hate when people use code with no meaning just to group code visually.

15:27 That's what comments are for.

15:27 TimMc: hiredman: Did you before? Because it's awfully curious how you'd answer people after I'd answered them, with the same advice, many seconds later.

15:27 Meh, whatever.

15:28 Licenser: can someone explain why multiple requires should be bad?

15:28 hiredman: TimMc: possibly, I have 74 people on ignore, so obviously I don't really keep track

15:28 but you are not on /ignore now

15:28 TimMc: *shrug*

15:28 amalloy: ibdknox: just poked around: you can get an almost-working version of multiple-require in cljs with like a one-line change

15:29 rplevy: Licenser: repetition is ugly and morally wrong

15:30 Licenser: but I have mutliple defn's in my code too

15:30 Vinzent: Without multiple :uses you can't e.g. :reload only namespaces which you want

15:30 TimMc: rplevy: Ah, but what about separating use/require against one set of libs from use/require against another set?

15:30 rplevy: TimMc: trying to picture it...

15:30 TimMc: I prefer to organize my ns by topic rather than how each piece is refer'd.

15:31 Licenser: I'd double TimMc there, that is a good reason

15:32 Vinzent: TimMc, could you explain what do you mean?

15:33 hiredman: emacs -nw /var/log/safe.log

15:33 pardon me

15:33 Licenser: Vinzent (ns bla (:rquire [liba.overloading]) (:use [liba.nonoverloding]) (:rquire [libb.overloading]) (:use [libb.nonoverloding]))

15:33 TimMc: Vinzent: (:use [clojure.java.jdbc :only (...)]) (:require clojure.java.jdbc.internal) ... some other libs using the same pattern

15:35 Vinzent: you can (:use [clojure.java.jdbc :only [...]] [clojure.java.jdbc.internal :only []] ...)

15:35 Actually, I don't understand why :require isn't deprecated already :)

15:36 Licenser: huh?

15:36 amalloy: haha

15:36 * lucian still doesn't quite understand clojure's importing system

15:38 Licenser: oddly enough someone on clojure.de suggested combining use and requrie into one today - actually a good Idea I think

15:38 Vinzent: Licenser, you can write (:use [a-lib :only [] :as a]) instead of (:require [a-lib :as a]), that'd allow you to avoid multiple use\require clauses

15:38 Licenser: really?

15:39 TimMc: Vinzent: Is that true on 1.3?

15:39 amalloy: yes, but that's atrocious

15:39 Vinzent: Licenser, TimMc, yes, try it :)

15:39 TimMc: Oh, that's not what I want anyway.

15:39 Raynes: Didn't require and use already get merged?

15:39 Vinzent: amalloy, why?

15:39 Raynes: I thought that ship had sailed.

15:40 Vinzent: Because it is atrocious.

15:40 rplevy: the new :require ... :refer vars solves all these problems elegantly, no?

15:41 TimMc: Definitely looking forward to that.

15:42 Vinzent: Raynes, hah :) but what exactly is wrong with it? It's supported in all versions of clojure and it requries much less typing than :require + :refer

15:43 Raynes: Vinzent: I don't have to explain myself to you. BEGONE.

15:43 TimMc: Vinzent: Doesn't it still refer all the ns publics?

15:43 Vinzent: Raynes, what's wrong with you?

15:44 TimMc, with :only [], no

15:44 TimMc: oh, I see. And ew.

15:44 That's atrocious.

15:44 Raynes: Hahaha

15:46 Vinzent: TimMc, lol :) well, that's better than using both :use and :require

15:47 * Bronsa actually likes use/require

15:47 Bronsa: am I a bad person?

15:47 lucian: wtf, (use 'clojure.set) moves everything into the current ns?

15:47 Raynes: You're a horrible person.

15:47 Bronsa: i suspected that

15:47 lucian: that's like doing python's from clojure.set import * by default

15:48 scriptor: lucian: only use :use with :only

15:48 unless if trolling

15:48 Vinzent: Bronsa, I feel silly when I have to e.g. (:use [foo :only [bar]]) and then (:require [foo :as f])

15:48 lucian: scriptor: but that's the other way around. it defaults to *

15:48 Vinzent: Bronsa, also, it's idiomatic to use only :use (see http://datomic.com/company/resources/clojure-api)!

15:48 scriptor: lucian: yea, that's just what use does, if you want something like import require is what you want

15:49 lucian: scriptor: that's a terrible default

15:49 Bronsa: wait what.

15:49 lucian: scriptor: isn't use considered idiomatic?

15:49 scriptor: lucian: only if you just want certain functions, I'm not sure tbh

15:49 Bronsa: i tought it was going to be considered idiomatic require

15:49 Vinzent: lucian, yes it is

15:50 Bronsa: and deprecated use

15:50 lucian: Bronsa: that would be good

15:50 haskell makes the same mistake

15:50 Bronsa: isn't that what technomancy proposed?

15:50 amalloy: :use/:as is fine, if a little tacky. but :use :only [] :as is disgusting

15:52 Bronsa: https://github.com/clojure/clojure/commit/f5bcf647d480c4eaa4e808ec41edb698ad66ec63

15:52 Vinzent: Bronsa, well, as you can see on that page, looks like :use is idiomatic (after all, you're not going to argue with Rich Hickey about what is idiomatic clojure?! :)

15:53 lucian: ok, (require [foo :as bar]) is nice

15:54 Vinzent: amalloy, what's wrong with it? :use without :only considered harmful, so you always have to write [:use ... :only [...]]. If you don't want to imports symbols in your ns, :only list is empty. I think it's not that bad from this point of view.

15:54 Bronsa: well, http://dev.clojure.org/jira/browse/CLJ-879 this (accepted) ticket seems to suggest otherwise

15:54 amalloy: that's what :require is for, dude

15:55 TimMc: Vinzent: When I am reading someone's code and I see "use" I think "OK, be on the lookout for the symbols in the :only clause (because you'd beter have one, dude)"

15:56 Vinzent: and then I see :only [], and I'm like "WTF, this is actually a :require :as in disguise."

15:57 tmciver: So, despite the constant advise to 'only use :use with :only', you shouldn't use :use at all?

15:57 s/advise/advice

15:57 gfredericks: tmciver: :only with a non-empty list is I think the purpose

15:58 Vinzent: Bronsa, I guess it was accepted so people can choose what style they prefer

15:58 amalloy, There can be only one! :)

15:58 stuartsierra: CLJ-879 is an attempt to unify :require/:use into just :require.

15:58 Bronsa: Vinzent: the propsal states that the intent is to deprecate :use

15:58 Raynes: stuartsierra: I thought that had already been accepted.

15:58 stuartsierra: Raynes: it has

15:58 and committed

15:59 Raynes: I see.

15:59 Bronsa: Cant a warning be printed whan using :use?

15:59 well, probabily it would be too noisy

15:59 Raynes: That'd probably not be the best idea.

15:59 People will support old versions on purpose.

16:00 Vinzent: ok, I give up then :) stuartsierra, thanks for clearing that out.

16:00 TimMc: I'll use the old-style stuff in libs, and the new syntax in top-level projects.

16:01 Raynes: TimMc: Same here.

16:01 TimMc: We should be friends or something, we have so much in common.

16:01 TimMc: A lint option would be nice.

16:01 Raynes: It's too bad you're a... what was it?

16:01 I have that alias around here somewhere...

16:02 "weak-ass ill-conceived piece of shit"

16:02 Bronsa: lol

16:02 Raynes: :D

16:02 TimMc: ...and so is BrowserID.

16:02 o\__/o

16:03 I wonder if Google has picked that up yet.

16:04 Interestingly, the 5th result for that (unquoted) is The Big Lebowski's IMDB page.

16:07 Raynes: What-all languages are you going to have eval for?

16:08 Raynes: TimMc: I don't have a list yet. It'll grow over time, I expect.

16:09 * lucian is now a lot less confused about require/use

16:18 uvtc: What is the purpose of this list: http://dev.clojure.org/display/community/Libraries ? Is it libraries that are under consideration for possible inclusion in contrib?

16:19 technomancy: uvtc: that list is ancient; best to ignore it

16:20 uvtc: technomancy, Ok, thank you.

16:33 mrBliss: is github giving a 500 error to anyone else?

16:34 Raynes: Looks good to me.

16:35 mrBliss: it's fixed now

16:36 Raynes: mrBliss: Maybe someone haxed it again.

16:36 mrBliss: Raynes: that's what you get with Rails ;-)

16:37 * ibdknox inserts add about using noir in the top bar of girhub

16:37 ibdknox: ad*

16:37 eggsby: mmm, 4clojure is fun

16:37 ibdknox: so much fail in that

16:37 jodaro: girlhub?

16:38 ibdknox: you know how it is.

16:38 jodaro: is that porn equivalent?

16:38 ibdknox: lol

16:38 redinger: "noir: No mass assignment bug here"?

16:38 jodaro: i think there are probably more crass options

16:39 ibdknox: redinger: exactly. Seems like rails has set a new very low bar for success ;)

16:39 time to profit!

16:42 Raynes: redinger: Ohai.

16:42 redinger: Raynes: Hello there

16:43 ordnungswidrig: hi all

16:45 uvtc: With Clojure, is it customary to install contrib and other Clojure libraries into a central location (like how Python uses site-packages)? Or are necessary libs always installed per-project?

16:46 technomancy: relying on site-packages is repeatability-poison

16:46

16:46 brehaut: ~repeatabilty

16:46 clojurebot: Excuse me?

16:47 brehaut: bah

16:47 ibdknox: ~guards

16:47 clojurebot: SEIZE HIM!

16:47 technomancy: clojurebot: have you suffered severe head trauma?

16:47 clojurebot: No entiendo

16:47 TimMc: suffering from typos

16:47 ibdknox: lazybot: is clojurebot retarded???

16:47 lazybot: ibdknox: Yes, 100% for sure.

16:47 TimMc: lack of \i

16:47 ~repeatability

16:47 clojurebot: repeatability is crucial for builds, see https://github.com/technomancy/leiningen/wiki/Repeatability

16:47 TimMc: <- clojurebot-whisperer

16:47 uvtc: technomancy, Ok. So, lein always installs per-project?

16:47 ibdknox: lol

16:48 brehaut: that'll teach me fore using a tiny font

16:48 (not really)

16:48 technomancy: uvtc: leiningen forces isolation and will only pull in dependency trees which are explicitly specified

16:49 it doesn't always mean copying things into the project directory, but it does mean you are forced to be explicit and are protected from sloppy dependency declarations a la ruby/python

16:49 uvtc: technomancy, by "forces isolation", you mean "installs libs into the current project", correct?

16:49 technomancy: uvtc: no, it means it limits the classpath to exactly what is specified

16:49 uvtc: technomancy, (sorry --- was typing while you were typing)

16:50 technomancy: leiningen 1 copies things to lib/ by default, but that's just one way to do it

16:50 leiningen 2 constructs classpaths with references to ~/.m2/repository

16:50 the end result is the same when it comes to isolation

16:50 TimMc: technomancy: Run into any command length limits with that yet?

16:51 technomancy: TimMc: no, but I don't use windows

16:51 jsabeaudry: &(try :a (finally :b))

16:51 lazybot: ⇒ :a

16:51 TimMc: Ah, is that mostly a Windows problem?

16:51 Too bad, I was thinking of clever symlink tricks to get around it.

16:51 technomancy: TimMc: I've never heard of it being a problem, so I'm assuming it's a winders thing

16:51 TimMc: haha, OK

16:51 uvtc: Is lein's job to pull in dependencies that I specify in the project.clj? Or can I tell it to install whatever I want?

16:52 technomancy: uvtc: I'm not sure what you are asking.

16:52 uvtc: I'm trying to learn the basic principles lein follows.

16:53 technomancy: the best place to start is "lein help tutorial"

16:53 uvtc: I read the tutorial at the github page.

16:55 amalloy: TimMc: there's a limit to command length on unix too, but only because the shell has a fixed-size buffer for you to type at (or something similar to that). if you construct a long command programmatically it works fine

16:56 eg, in a directory with a million files `echo *` fails because the shell can't glob that much, but `find . | xargs echo` works because xargs is willing to make the command as long as necessary

16:57 uvtc: technomancy, I'm asking about how contrib + other 3rd party libs are handled by lein. For example, `lein help install` says it installs the current project and deps into my local repository. What does "local repository" mean? Somewhere in my home dir?

16:57 technomancy: uvtc: that's correct; ~/.m2/repository

16:57 you can think of it as a local cache for Maven Central and Clojars

16:58 it will be available for other projects, but only those that explicitly request that specific version

16:59 uvtc: technomancy, Ah! Ok. Though, earlier you wrote, "relying on site-packages is repeatability-poison" ... were you talking about python there, or the ~/.m2/repository directory?

16:59 technomancy: uvtc: I meant having system-wide packages available implicitly

17:00 like python and ruby

17:00 amalloy: uvtc: he was talking about global installs in general. ~/.m2 isn't a global install because it's all neatly versioned and explicit

17:01 technomancy: at least in the ruby community they are experiencing a lot of pain moving away from that model

17:01 uvtc: Excellent. So then, what is the point of `lein install`? If I can run my project from within the project dir via `lein run`?

17:02 technomancy: if you make a change to a project, you may want to make it available to other projects that depend on it

17:02 you could do that by pushing it to clojars, or you could install it locally first to test before you push

17:02 uvtc: Why is the directory named ".m2"?

17:02 technomancy: it's an implementation detail; comes from maven2

17:03 brehaut: its an abbreviation of Maven Madness

17:04 amalloy: brehaut: c'mon, we need you commonwealthers to keep Muppetry alive

17:05 brehaut: amalloy: i dont understand

17:05 amalloy: instead of Madness

17:05 brehaut: oh right

17:06 uvtc: Ok. So when I use Leiningen, a local repository (~/.m2/repository) is automatically set up to hold common libs (jars).

17:07 And if I use `lein install`, libs are copied to that repository.

17:07 amalloy: so far so good, uvtc

17:08 geoffeg_c: so how do most people manage war files? developer builds war file, sends it to QA who tests it and then deploys it to production.. do most people put those war files in maven or git or some http server?

17:08 raek: libs are also copied to that directory when lein deps finds that it isn't there and it is available in one of the repos

17:08 geoffeg_c: putting war files in git seems wrong and maven doesn't seem like the right place

17:08 technomancy: geoffeg_c: definitely don't want those checked in

17:09 geoffeg_c: right, agreed

17:09 but at the same time you want to keep previous "versions" of war files around in case you need to roll back a deployment to prod.. and you need to keep checksums of the war files around to verify the correct one was deployed to prod..

17:10 technomancy: geoffeg_c: one way is to get a CI server that uploads each successful release to s3 or something

17:10 ordnungswidrig: I'd use a locale repository, either maven or a webserver. webdav might be of use here.

17:11 uvtc: raek, so, when you run `lein deps` it looks at the project.clj's :dependencies to see what it needs to download, correct?

17:11 geoffeg_c: ok, so s3 or some http server.. which is what i was thinking but wondering if there was something more... appropriate

17:11 ordnungswidrig: geoffeg_c: a private maven repository is appropriate.

17:12 raek: uvtc: yes

17:12 geoffeg_c: ordnungswidrig: hmm, but maven seems awkward for wars.. i mean, nothing depends on a war file so

17:12 uvtc: raek, Whoops -- sorry, it says that right there in `lein help deps`.

17:12 raek: it also downloads dependencies of dependencies, etc

17:13 ordnungswidrig: geoffeg_c: maven supports artifact types. "war" is one of them as is "pom" or "jar"

17:13 geoffeg_c: ok, i'll consider that again

17:13 raek: uvtc: "lein install" is most often used when you want to try an unreleased version of a project before releasing it properly

17:13 geoffeg_c: thanks everyone

17:13 ordnungswidrig: geoffeg_c: you might want to have a look at http://www.jfrog.com/products.php

17:14 raek: in some sense, you can think of it as a cousin to "make install"

17:14 geoffeg_c: technomancy: is there a way to get lein (1.7) to push a war file in addition to a jar file to a private maven repo?

17:14 raek: most importantly, you rarely need to use "lein install" when using someone else's library

17:15 technomancy: geoffeg_c: maybe using lein ring? I've never used war files.

17:15 geoffeg_c: ok

17:15 * technomancy is a peaceful kind of guy

17:15 geoffeg_c: LOLZ

17:15 ordnungswidrig: +1

17:15 technomancy: some day that joke might get old... but not today!

17:15 uvtc: raek, what I don't get is, it's customary to package Clojure libs as jars, correct? If that's the case, it seems really nice and simple to just have all my deps saved as jar files in my project's lib dir...

17:16 Guess that's why I'm not understanding the point of the .m2 repo.

17:16 amalloy: having your dependencies checked into git would be horrible

17:17 and if you don't put them someplace central (just save a copy in each project) you end up downloading all those jars hundreds of times

17:17 uvtc: amalloy, Ah! Of course. It's assumed you create a git repo for your project after you create it. Right right.

17:17 raek: some of it is explained here: https://github.com/technomancy/leiningen/wiki/Repeatability

17:17 amalloy: *shrug* you can .gitignore them, but then everyone who uses your project needs to get a copy of the deps somehow

17:18 uvtc: Ok. Made some headway. Need to go read the docs again and absorb some more. Thanks so much!

17:26 dgrnbrg: How do I invoke a varargs java fn from clojure?

17:28 arohner: dgrnbrg: pass a java array

17:28 (.foo obj (into-array [:a :b :c])

17:29 might need to use the type argument of into-array

17:29 dgrnbrg: ok, thanks :)

17:29 that's what I thought, but I was having signature mismatches

17:30 jsabeaudry: What kind of problems will be encountered when "send"ing potentially blocking actions to an agent (instead of send-off)?

17:31 arohner: jsabeaudry: the send pool has N + 2 threads in the pool, where N is the number of cpus you have

17:31 while the send-off pool is unbounded

17:31 so send'ing could block your CPU bound actions

17:31 jsabeaudry: arohner, So it would potentially block all other actions, is that right?

17:32 justicefries: what are people actively using? compojure or noir?

17:32 m0smith: just: noir

17:32 arohner: jsabeaudry: yes, if you send enough blocking actions

17:33 justicefries: I'm trying to actively wrap my mind around Clojure and I'm not sure if books (programming clj, joy of clojure) are the best way for me to go.

17:33 or if I just need to reread.

17:33 jsabeaudry: justicefries, best way is to code imho

17:33 justicefries: that's what I'm thinking.

17:34 brehaut: joy of clojure and the orielly clojure book are both great resources though; they wont hurt.

17:34 justicefries: brehaut: trying to work my way through the o'reilly one right now, it's...hard work! :d

17:34 RickInGA: Clojure in Action is good too

17:34 justicefries: :D

17:35 AimHere: A lot of OReilly books probably hurt, if you drop them on your foot

17:35 brehaut: learning anything worth learning is hard work :)

17:35 justicefries: true.

17:35 RickInGA: each one covers things a bit differently, can learn from all.

17:35 dgrnbrg: arohner: anything quirky with inner interfaces?

17:36 I have (into-array qualified.name.of.inner.interface [elts])

17:36 and I import the inner interface directly

17:36 and it complains classnotfound

17:36 amalloy: that's not the real name of the interface

17:36 dgrnbrg: amalloy: what can I do to get it to work?

17:36 amalloy: package.foo.Class$InnerClass

17:37 is the actual name. javac just lets you pretend it's something else

17:38 dgrnbrg: I see :)

17:38 got it compiling :)

17:38 I suppose no one's written a clojure API for the new filesystem watching apis?

17:40 amalloy: $google clojure watchtower

17:40 lazybot: [ibdknox/watchtower - GitHub] https://github.com/ibdknox/watchtower

17:40 dgrnbrg: but that doesn't use the fs watching api

17:40 ibdknox: that doesn't use the NIO stuff in java 7 though

17:40 dgrnbrg: i have a lot of files

17:41 ibdknox: daaku wrote a watcher thing that uses the java 7 apis

17:41 dgrnbrg: i'm writing software to dynamically build indices of java code for vim & emacs completion

17:42 technomancy: dgrnbrg: like ctags?

17:42 ibdknox: what's wrong with ctags?

17:42 dgrnbrg: it's not dynamically reindexing

17:42 it doesn't follow jars & understand the classpath

17:43 unless i'm mistaken wrt ctag's functionality

17:45 ibdknox: that's a very expensive set of things to do in real time

17:45 jodaro: RickInGA: see that mail from alex?

17:45 dgrnbrg: I have a sqlite db with the indices to do cmd-T style completion in vim or emacs, and a daemon that monitors the directories

17:46 currently i'm using a doclet to parse the java, but I may have to move to antlr grammar

17:46 RickInGA: cool

17:46 I didn't know I got a discount too!

17:46 dgrnbrg: I can do it in real time now -- I got the idea to build it b/c I like nail gun/vimclojure, but I'm not aware of that functionality for java

17:54 ordnungswidrig: can defmacro destructure args in 1.3?

17:56 (defmacro foo [[[a b] [c & ds] & body] …)

17:58 Vinzent: ordnungswidrig, yes, why not?

17:59 ordnungswidrig: had some problems with it.

18:03 Vinzent: ok (let [[a & b] [nil]] a) => nil

18:03 Vinzent: that was the problem.

18:06 amalloy: so far i only see intended behavior, no problems

18:09 ordnungswidrig: amalloy: yes, it was a misunderstanding

18:38 OwenOu: a newbie question, keyword can be a function too, e.g., (:foo {:foo :bar}) is the same as ({:foo :bar} :foo), what's a good use for keyword being a function?

18:38 or what's the idiomatic way?

18:40 Vinzent: OwenOu, use keyword first when you treat a map like an object

18:40 technomancy: OwenOu: it's common to map a keyword over a vector of maps

18:41 OwenOu: Vinzent: that's a very good point

18:41 TimMc: I just mapped a map over a collection of keywords. Feels good, man.

18:41 OwenOu: technomancy: can u give me an example?

18:42 arohner: OwenOu: (map :foo [{:foo 1 :bar 2} {:foo 3 :bar 4}])

18:42 => (1 3)

18:42 oh right, we have clojurebot for that

18:42 Iceland_jack: ,(-> {:name {:first-name "Alice" :last-name "Silverman"}} :name :first-name)

18:42 clojurebot: "Alice"

18:43 Iceland_jack: you can access information from within nested data structures

18:43 emezeske: ,(get-in {:first-name "Alice" :last-name "Silverman"} [:name :first-name])

18:43 clojurebot: nil

18:43 emezeske: ,(get-in {:name {:first-name "Alice" :last-name "Silverman"}} [:name :first-name])

18:43 clojurebot: "Alice"

18:43 Iceland_jack: emezeske: thanks :)

18:43 amalloy: that's kinda a lame example, Iceland_jack, because get-in is at least as good at that

18:43 &(get-in {:name {:first-name "Alice" :last-name "Silverman"}} [:name :first-name])

18:43 lazybot: ⇒ "Alice"

18:43 Iceland_jack: I'll try to delame my examples in the future

18:44 * Vinzent tends to use get-in only when keys are not keywords

18:44 amalloy: wow, what is my ping time? like two minutes? you guys had a whole conversation at light-speed while i was typing

18:45 Vinzent: by the way, where is dissoc-in?

18:46 technomancy: Vinzent: there's update-in

18:46 Vinzent: technomancy, yes, but where is dissoc-in? :)

18:46 also, value of nil for the key is not the same as if there is no this key at all

18:49 kenth: How would I map a function that executes javascript over a list of strings, and returns the relevant results in a parallelized manner? My current code is (map #(.executeJavaScript) lst ), however it does not have Thread/sleep

18:49 OwenOu: arohner: thanks

18:49 clojurebot seems pretty neat, is it open sourced?

18:50 emezeske: clojurebot: where do you live?

18:50 clojurebot: It's greek to me.

18:50 emezeske: Aw :)

18:50 technomancy: clojurebot: source?

18:50 clojurebot: source is http://github.com/hiredman/clojurebot/tree/master

18:50 emezeske: clojurebot: Yeah, help out technomancy but not me. Thanks.

18:50 clojurebot: Gabh mo leithscéal?

18:51 amalloy: clojurebot: who's your daddy?

18:51 clojurebot: excusez-moi

18:53 kenth: (pmap #(let [result (.executeJavaScript %1)] (do (Thread/sleep 5000) result)) JSlist) OR (map #(future (let [result (.executeJavaScript %1)] (do (Thread/sleep 5000) result))) JSlist) , which makes sense for javascript type stuff?

18:55 Raynes: OwenOu: Also, lazybot: https://github.com/flatland/lazybot

18:56 Which is more user-friendly (as in, it is possible to run it on your own machine without gouging your eyes out).

18:58 kenth: hm.., what happens with a combination of pmap and future?

19:01 emezeske: kenth: What is the Thread/sleep for?

19:01 kenth: waiting for the javascript execution to do its thing

19:01 OwenOu: Raynes: thanks

19:02 emezeske: kenth: So you're saying that .executeJavaScript returns before it's done?

19:03 kenth: (pmap #(let [reslt (.getNewPage (.executeJavaScript coursepage %1))] (Thread/sleep 5000) reslt) listOfJSstrings)

19:04 yep, waiting for the js info to come in before returning

19:05 emezeske: kenth: But.. what is the value of "result" between when (.executeJavaScript) returns, and when Thread/sleep finishes?

19:07 kenth: I just tried it out, the result wasn't quite right.. its part of http://htmlunit.sourceforge.net/apidocs/com/gargoylesoftware/htmlunit/ScriptResult.html

19:16 groovemonkey: I'm having an issue installing slime for emacs 23. I've followed Lau Jensen's tutorial on vimeo, but when I do M-x slime and choose "yes" for downloading and installing clojure jars, I get an error

19:17 Failed to download clojure jars

19:17 anyone have any ideas?

19:18 technomancy: groovemonkey: sounds like you found some old documentation; try https://github.com/technomancy/swank-clojure/blob/master/README.md

19:19 groovemonkey: thank you! I'll try that right away. Thanks for your time.

19:19 technomancy: sure

20:32 johnmn3: hello

20:32 Does semperos ever pop in?

20:37 amalloy: i know he used to. i don't remember hearing anythin from him for a fair while, but who knows

20:39 apparently he was here earlier today

20:39 so i am not a winner

20:41 johnmn3: hmm

20:41 juxt is the winner!

20:45 what is function A, such that (= 42 (A #(pred that returns true for 42) (range 1 100)))

20:45 Vinzent: some?

20:45 johnmn3: well, I want to stop searching on first find

20:46 take-while & not

20:46 Vinzent: johnmn3, it's some

20:46 johnmn3: Okay, will some return 42?

20:46 and it does

20:46 thanks Vinzent

20:47 Vinzent: np

20:51 johnmn3: ah, no. I want it to work like filter

20:51 where the pred will return true, but the value fed to the pred is returned, if true

20:52 I want filter-but-stop-on-first-success

20:52 (first (drop-while #(not (...

20:52 right?

20:54 well, it works

20:55 I guess I could have changed the pred to a function that returned it's input if true.

21:00 amalloy: (first (filter ...))

21:02 johnmn3: oh, duh

21:02 and filter is lazy, so it'll stop searching after the first, right? (chunking notwithstanding)

21:54 gtuckerkellogg: i'd like to be able to compare two data structure (as part of a unit test) and am unsure how to do it once they become more complicated than a simple map

21:54 For example, this fails (= (() ({:pos 0, :mark "5"})) (() ({:pos 0, :mark "5"})) )

21:54 Iceland_jack: gridaphobe: which properties would you like to compare?

21:54 gtuckerkellogg: all of them,

21:55 if I look at just the map, it works fine, but once I have a seq I can't compare, and can't find a way to use (map) to compare the elements

21:55 (with apologies for my clojure noob-ness)

21:55 gridaphobe: Iceland_jack: are you sure you meant to ping me?

21:55 Iceland_jack: haha, no I didn't

21:56 sorry :)

21:56 gridaphobe: np :)

21:57 Iceland_jack: gtuckerkellogg: I'm not sure how you'd do that without creating your own equality checker

21:58 hopefully someone who actually knows Clojure can come along 8)

21:58 gtuckerkellogg: shouldn't i be able to do that using (map ?

21:58 yet it seems to evade me

21:58 amalloy: just use [] instead of () for the seqs you want to compare

21:59 or quote it, or anything

21:59 Iceland_jack: oh, that was the problem

21:59 ,(= '(() ({:pos 0, :mark "5"}))'(() ({:pos 0, :mark "5"})))

21:59 this works?

21:59 clojurebot: true

21:59 Iceland_jack: thanks clojurebot

22:00 gtuckerkellogg: cool

22:19 ideally_world: is there a way to get output from the Swing thread in Slime?

22:22 technomancy: gtuckerkellogg: have you tried lein-difftest?

22:22 ideally_world: Programming in Clojure is far more revealing of how much of an idiot I am than any other language :)

22:23 gtuckerkellogg: technomancy, no but I'll look into it

22:23 i'm *really* new with clojure, but it's fun

22:24 I have to agree with ideally_world :-)

22:24 technomancy: it's more about making it easier to tell _how_ two data structures are different in the event of failures

22:26 gtuckerkellogg: that would be usefl

22:26 useful

22:37 aperiodic: oh wow, lein-difftest is awesome

23:03 ferd: any way to (set! *print-meta* true) so that slime-macroexpand-1 shows my metadata?

23:59 amalloy: i doubt if you want it to - there are usually zillions of {:line 342} meta entries on source code

23:59 and you can just macroexpand it by hand at the repl if you want to check on occasion

Logging service provided by n01se.net