#clojure logs

2012-03-06

00:03TimMcmac: "not for now", basically
00:03TimMcAbout what you'd expect.
00:25JulioBarrosHi, 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
00:25JulioBarrosit gets to the part in my code where I try to use enlive.
00:25JulioBarrosA basic hello world noir app works but my real app does not. Any ideas?
00:31tmciver$findfn [1 1 1 2 3 4] [[1 1 1] [2 3 4]]
00:31lazybot[]
00:32scriptortrying to cheat? :)
00:32tmciverHell yeah? wanna help me?
00:32scriptorwhich problem was this again?
00:32pyninjahi, in ClojureScript, what's the equivalent of field.value? I tried (.value field) and variations...
00:34tmciverI'm trying to remember a function that splits a seq into two groups based on the result of a predicate *changing*
00:34scriptortmciver: something like this? http://clojuredocs.org/clojure_core/clojure.core/split-with
00:35scriptorpyninja: what happens when you do (.value field)?
00:35pyninjascriptor: #<TypeError: Cannot call method 'value' of undefined>
00:36pyninjascriptor: it tries to call ns.field.value();
00:36muhoogawd, i can't escape clojurescript.
00:36tmciverscriptor: that may work but it's not the function I was thinking of.
00:36muhooi just started hacking on this beaglebone, and all the libraries for doing digital i/o on it are in.... javascript
00:37muhoomy goal was to use clojure to do some stuff on the beagle, since it runs java just fine
00:37muhoobut instead, the libraries i need are in fucking javascript. so it'll have to be clojurescript instead.
00:37muhoorunning on node.
00:38muhooor maybe in rhino, that might work.
00:39scriptorpyninja: have you tried different values for field?
00:40pyninjascriptor: actually, (. field -value) worked, but I don't understand why
00:42scriptorhmm, don't know it enough to remember if - has any special meaning
00:42scriptordoes it just compile to _value?
00:55muhoohehehe even easier, i can just read the data structures i need in as json , and make them into clojure data
00:56muhoojson on an embededed device. soon, i predict, all development will be web development.
00:57dnolen3
00:58dnolenoops
01:02amalloypyninja: (.foo bar) or (. bar foo) is always a "method" call, (.-foo bar) or (. bar -foo) is always a property lookup
01:03pyninjaamalloy: oh ok thanks
01:03amalloyon the jvm, there's a way to tell properties and methods apart, so (.foo bar) just Does What You Mean
01:03pyninjayeah
01:11mindbender1hi
01:49gtuckerkellogghave *all* of the clojure.contrib libs moved to individual repos?
02:39_ulisesmorning all
02:46gtuckerkelloggmorning
02:46scriptormarnin
02:47gtuckerkelloggcould someone tell me what the current status is with clojure.contrib?
02:48_ulisesbeing ported still I believe
02:48_ulisesgtuckerkellogg: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
02:48gtuckerkelloggoh, hey that's useful
02:49_ulisesindeed
02:49gtuckerkelloggmuch more so than the circular lnks at http://richhickey.github.com/clojure-contrib/
02:49lazybotNooooo, that's so out of date! Please see instead http://clojure.github.com/clojure-contrib/ and try to stop linking to rich's repo.
02:49gtuckerkelloggwell if it's out of date, i shouldn't need lazybot to tell me (IMHO)
02:49clojurebotCool story bro.
02:50_ulisescool story indeed
03:04tomojif I typed (def parse-parse [parse]), should I start over?
03:04tomojwell
03:05tomojassume I already made it a defn :)
03:25hsandhudeploying a noir web app, any suggestions for daemonizing the instance (just using jetty as the container)
03:28Fossihsandhu: there should be a way to package a war, most likely via lein
03:29Fossii don't know noir at all, so ymmw
03:29hsandhuhmm, that could be one option if I was using tomcat for example...how about supervisord?
03:30Fossiyou can use jetty as you would use tomcat
03:30Fossinever heard of supervisord
03:30hsandhuright, but the following will not create a daemon: "lein run"
03:55tomojfindfn "S=(NP=(DET=(the)N=(dog))VP=(V=(runs)))" {:S [{:NP [{:DET "the"} {:N "dog"}]} {:VP [{:V "runs"}]}]}
03:56raektomoj: parsing natural language? :-)
03:56tomojno, it's already parsed
03:56tomojI just need to parse the parse
03:56tomoj:)
03:57raekhttps://gist.github.com/954222
03:58tomojsweet
03:58raek(this was before core.logic got support for special DCG syntax9
03:58raek)
03:58tomojI heard dnolen mention parsing but couldn't figure it out for myself
03:58tomojah, shucks
04:00raekmy proessor in Formal Languages and Automata Theory used this sentence as an example of ambiguity in grammars...
04:01raekhe telled the joked, said "and now an explanation of the joke", and showed two parse trees on the projector
04:04tomojcorenlp gets it right, but it also thinks "in the dressing room" is attached to the NP
04:29sorenmacbethwhat the difference between #^ClassName and ^ClassName?
04:30sorenmacbethI see both and no clear description of the difference or when to use which
04:31ejacksonthe former is deprecated
04:32sorenmacbethejackson: thanks, that explains it
04:34G0SUBdatomic!
04:40G0SUBejackson, PM?
04:40ejacksonDATOMIC!
04:45muhooVerifyError class org.codehaus.jackson.smile.SmileParser overrides final method getBinaryValue.(Lorg/codehaus/jackson/Base64Variant;)[B java.lang.ClassLoader.defineClass1 (ClassLoader.java:-2)
04:46muhooit does?
05:07mtdwith clojure 1.3 on posix, is there a way to get all of clojure-contrib into the classpath? Does nobody really do that?
05:07mtds/a way/a way without rebuilding all the jars oneself/
05:08ejacksonwith 1.3 there is no clojure-contrib
05:08ejacksonyou want to select the libs you want and put them into leiningen
05:08ejacksonwhich will put them onto the CP for you
05:08mtdejackson: right
05:09mtdejackson: it's called clojure contrib here, FWIW http://dev.clojure.org/display/doc/Clojure+Contrib -- what's the right term?
05:09mtdejackson: for repl use that's a bit of work, but not as much as compiling them all myself, sure.
05:09mtdejackson: just wondering how people did it, thanks.
05:09ejacksonyou don't need to compile 'em, just let lein fetch the jars from clojars
05:09mtdejackson: indeed
05:10babilenmtd: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go might help to select the right ones
05:10mtdejackson: 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
05:10mtdbabilen: thanks
05:11mtdejackson: I can just have lein download them once or something
05:11ejacksonmtd: i strongly recommend using lein for everything
05:11mtdejackson: For pre-packaged stuff of course
05:11ejacksonyes, lein will dl them and put them into ~/.m2/... and then into your project's ./lib
05:11mtdejackson: I'm talking about one-off scripts / generic repl stuff
05:12ejacksoneven so, save yourself
05:12ejacksoni mean, >lein new, >emacs project.clj, >lein repl.... hard to beat
05:12mtdejackson: 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
05:13mtdejackson: ...I just don't think I need it to decide that that oftern
05:13babilenmtd: Take a look at https://github.com/mtyaka/lein-oneoff for oneoff scripts
05:13mtdejackson: yeah but...I want oneoff scripts, not projects. I totally get what you're saying for projects, and I'm just being lazy
05:13ejacksonmtd: lein should pull the deps for you
05:13mtdbabilen: thanks, looks good
05:14mtdbabilen: that's pretty much exactly what I want, thanks
05:14ejacksonhm, numeric-tower is not in clojars, and its a maven thingy
05:14mtdejackson: nooooo...hmm.
05:15ejacksonso you'll have to build it w/ maven yourself
05:16arbschthi from desktop
05:16mtdejackson: awesome :) :/ thanks for saving me the headache of finding that out myself
05:16ejacksonno sweat
05:17babilenmtd: AFAICT you can just include "[org.clojure/math.numeric-tower "0.0.1"]" in your project.clj and fetch it with "lein deps"
05:18mtdbabilen: yeah, I'm cool with that usage of lein and deps...modulo ejackson's clojars comment re math.numeric-tower...
05:19babilenYeah, but do not forget about http://search.maven.org/#search%7Cga%7C1%7Cnumeric-tower
05:19mtdbabilen: 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
05:19mtdbabilen: ah, cool, didn't know that
05:19ejacksonhahaha, def easier
05:20raekmtd: with lein-oneoff the "defdeps" form at the top of the file serves as a "script-local project.clj"
05:20clojurebotIt's greek to me.
05:21raekso you'll have (defdeps [[org.clojure/math.numeric-tower "0.0.1"]]) at the op of your file
05:21raek*top
05:21mtdraek: yeah, thanks, that was exactly what I wanted...very useful, I think
05:21raekanother approach is to have a "scratch project" whose project.clj include the libs you usually use
05:22mtdraek: yeah ISWYM about scratch project; that would work too
05:22raekyou can run individual script files using lein "run -m the.name.space"
05:22mtdraek: gotcha, good to know
05:22raekif you provide a (defn -main [...] ...) function in that namespace
05:23raekmtd: yeah, the install libs globally and run a file approach is perhaps more convenient for one-off scripts
05:23mtdraek: gotcha
05:24raekmtd: but Leinginen has higher ambitions. you need something like projects in the end for anything that becomes big
05:24mtdraek: definitely...I appreciate (in many senses) that goal, and it's quite easy to use.
05:25raekAFAICT, most other "dynamic" lagnuages have developed something similar to the proejct approach (e.g. virtualenv in python and rvm in ruby)
05:26mtdraek: 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.
05:26mtdraek: 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.
05:27raekI 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
05:28mtdraek: 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 :).
05:28mtdraek: will read that in detail, thanks
05:29raekbut it can be nice that you can still clone a two year old project on github and run lein deps and it still works
05:30mtdraek: indeed, good point
05:30raekimmutability in build systems ftw!
05:34mtdheh
05:36mtdraek: 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.
06:36mtdapologies 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.
06:36mtd(it's basically unanswered for 1.3, AFAICS)
06:37clgvmtd: you can get the code from the old contrib if it wasnt migrated to a new library
06:38mtdclgv: sure - was hoping someone had already done it, but will go that route if not
06:38mtdclgv: dir() is super useful in python repl: applicable to everything, always present (as opposed to documentation)
06:39clgvmtd: hm yeah something like that for namespaces would be great
06:39mtddoc, dir, pr, clojure.reflect/reflect, etc.
06:40mtdclgv: yeah - clojure.repl/dir is a good start, but wish it took a whole bunch of types besides symbols-of-namespaces
06:40clgvmtd: ok, clojure.reflect/reflect does not print useful output ;)
06:40mtdclgv: indeed :)
06:41mtdclgv: (map prn (get (reflect f) :members)) is a bit more useful
06:41mtd(if I make my terminal font about 1pt :))
06:42clgvwell they should have included show then^^
06:42mtdclgv: yeah, wish they had (in clojure.repl, I guess)
06:43mtd(sorry for spamming the channel with newbie stuff)
06:45clgvwhat inspect did you use?
06:46mtdclgv: (use 'clojure.inspect) --> #<inspector$inspect clojure.inspector$inspect@1bfd9cd5>
06:47mtdclgv: oops, clojure.inspector
06:47clgvah that one improved
06:48clgvhmm I wonder what the buttons are for
06:49mtdclgv: they don't do much in the few things I've inspected, yeah
06:49clgvmtd: I built my own inspect^^
06:49clgvbut it needs to get more user friendly for customizing display^^
06:51clgvmtd: seems those buttons are for decoration only, yet ;)
06:51clgvthey have no handler in the source I got
06:52mtdclgv: ah
07:38FrozenlockI'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?
09:09antares_hi. how can I distinguish between maps and functions in a protocol w/o using all specific map implementation classes?
09:10clgvantares_: via 'map? and 'fn? - if that doesnt help you you have to explain in more detail what you really want to do.
09:11antares_clgv: those functions won't work for protocols
09:11antares_clgv: you got the idea right but I am trying to do this with protocols
09:11antares_so I have to provide types
09:11bsteuberclojure.lang.IPersistentMap ?
09:11antares_alternatively, is there a core function that returns "type" I can cond on?
09:11clgvantares_: well then I dont understand what you want to do^^
09:11antares_bsteuber: yes but maps are also functions
09:12antares_so I am getting IFn matching some of the time and IPersistentMap matching other times
09:12antares_clgv: I am trying to write a protocol function that can work with both maps and functions
09:12antares_but maps are also functions
09:12clgvso whats the problem?
09:13bsteuberIFn shouldn't match when you have implemented it for IPersistentMap
09:13clgvmake (minimal) examples - they always help to understand^^
09:13bsteuberbecause the most concrete type should be matching
09:13bsteuberand I
09:14bsteuberIPersistenMap should be a subtype of IFn
09:14antares_clgv: sometimes compiler seems to pick on one implementation (tests pass), sometimes the other (obscure failures)
09:14bsteuberat least in clj, different story with cljs
09:14antares_bsteuber: yes, and that's exactly the issue
09:14bsteuberantares_: so you do cljs?
09:14antares_bsteuber: no I don't
09:15antares_clgv: https://gist.github.com/035d79153dd3781fd179
09:15jsabeaudryWhen 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) ?
09:15antares_roughly half of the time I am getting obscure runtime exceptions about APersistentMap being invoked with 0 arguments
09:18antares_clgv: listing exact map implementation classes seems to help, I need to run tests 100 times to tell for sure :(
09:18bsteuberantares_: that's really weird, I can confirm this behavior
09:18bsteubermaybe write an issue
09:19hiredmanemacs -nw /var/log/emacs.log
09:19bsteuberor there's just something I don't understand about protocols yet ^^
09:19hiredmanwhoops, pardon me
09:19clgvantares_: you can inspect the map belonging to the protocol. maybe you spot something odd in there
09:19antares_clgv: how can I do it?
09:19antares_(println [proto name]) ?
09:20antares_bsteuber: ok, will do
09:20clgvantares_: it is bound to the name of the protocol
09:21antares_clgv: yeah I figured it out. Awesome, thanks. I will play with it a bit more and file a ticket.
09:22FrozenlockI'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?
09:22bsteuberantares_: actually, all the maps I tried trigger IFn
09:23antares_bsteuber: ok
09:23dnolenantares_: there is no way to accomplish what you want w/ protocols
09:23antares_bsteuber: so should I list implementation classes instead?
09:23antares_dnolen: even if I use specific classes and not interfaces?
09:24dnolenantares_: oh sorry, yes if you specify specific classes.
09:24antares_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?
09:24antares_dnolen: ok, I think that will work. Hopefully 1.4 won't introduce new classes :)
09:25clgvantares_: you dont need keywords for multimethods. you can use types there as well
09:26antares_clgv: hm, yeah, but it won't be any different from protocols
09:26antares_hm, but the comparison will be exact, right?
09:26clgvmultimethods use 'isa?
09:26antares_I see
09:26antares_ok folks, thanks for your help
09:27clgv&(isa? clojure.lang.IFn {})
09:27lazybot⇒ false
09:27clgv&(isa? {} clojure.lang.IFn)
09:27lazybot⇒ false
09:27raek&(isa? clojure.lang.IFn (class {}))
09:27lazybot⇒ false
09:28TimMcisa? is backwards
09:28raek&(isa? (class {}) clojure.lang.IFn)
09:28lazybot⇒ true
09:28TimMc(relative to instance?)
09:30antares_dnolen: if I use AFunction or RestFn, will it cover all functions (that return true for clojure.core/fn?)
09:31dnolenantares_: you're running into the problem where things are overlapping w/ protocols. one possible workaround? let IFn be handled in the default case.
09:31dnolenso first match all the types, then in the default case test for IFn and handle it there.
09:32antares_dnolen: the problem is, I have Object implementation already and I really need it
09:32dnolenantares_: so keep it, doesn't stop you from handling IFn.
09:33antares_dnolen: but won't function just match Object impl?
09:33TimMcNothing stopping you from using instance? at that point is there?
09:34dnolen(extend-type Object PFoo (bar [x] (if (fn? x) fn-case-expr object-case-expr)))
09:35antares_dnolen: ok, thanks. It would work for me, too.
09:35antares_dnolen: I think clojure.lang.AFunction worked
09:38dnolenantares_: interesting, good to know if true.
09:38antares_dnolen: I am trying with AFunction and IPersistentMap
09:39antares_seems to work, 10 passes in a row
09:41dnolenantares_: looking at the JVM source, that looks right to me.
09:42antares_dnolen: it better be right, I already tweeted about it :D
09:48bsteubergood to know extend doesn't handle interface hierarchies
09:54uvtcHi #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.
09:55uvtcbut evidently clojure.org uses wikispaces.
09:55uvtcAlso, the link to "demark" on the Confluence page is broken...
09:55uvtcJust curious what the history is here, and what plans there are.
09:58uvtc... if there *are* any plans, anyway.
10:01stuartsierrano firm plans
10:01stuartsierraclojure.org is a mess
10:01uvtcIn what way? In that it requires updates?
10:05bsteuberhow does lein-clojurescript deal with macros?
10:05bsteuberor is there a better cljs plugin?
10:07uvtcstuartsierra: Ok. Found this http://dev.clojure.org/display/doc/clojure.org+TODO+list
10:12bsteuberah I think it was lein-cljsbuild
10:28jsabeaudryWhat is the use for merge? Isn't conj enough?
10:31TimMcjsabeaudry: I give you two or more maps. Now merge them with conj.
10:31hiredman /win 15
10:32jsabeaudry,(conj {:a 1} {:b 2} {:c 3})
10:32clojurebot{:c 3, :b 2, :a 1}
10:33gtrak`,(conj {:a 1 :b 2} {:c 3 :d 4})
10:33clojurebot{:d 4, :c 3, :a 1, :b 2}
10:33gtrak`hmm, why does that make sense?
10:33jsabeaudryTimMc, I just did?
10:34TimMcgtrak`: It doesn't.
10:34TimMc,(conj {:a 1 :b 2} {:c 3 :d 4} {:e 5 :f 6})
10:34clojurebot{:e 5, :f 6, :d 4, :c 3, :a 1, ...}
10:34gtrak`i would have thought it would work with entries but not full maps
10:34TimMc&(conj {:a 1 :b 2} {:c 3 :d 4} {:e 5 :f 6})
10:34lazybot⇒ {:e 5, :f 6, :d 4, :c 3, :a 1, :b 2}
10:35TimMcUgh, this is that stupid special-casing.
10:35TimMc&(conj {:a 1 :b 2} {:a 3 :d 4} {:a 5 :f 6})
10:35lazybot⇒ {:f 6, :d 4, :a 5, :b 2}
10:35TimMcjsabeaudry: Carry on then. -.-
10:35uvtc,(into {:a 1 :b 2} {:c 3 :d 4})
10:35clojurebot{:a 1, :b 2, :c 3, :d 4}
10:36gtrak`into makes more sense
10:36uvtcI 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:36jsabeaudryTimMc, 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:37gtrak`jsabeaudry, relying on the special-case is a form of obfuscation
10:37TimMcuvtc: Names, features, security, maintainers...
10:38gtrak`you should do the thing that matches your intent most closely, unless there's a performance win or something (there probably isn't)?
10:38TimMcuvtc: Use clojurebot when lazybot complains that you're trying to hax it.
10:38jsabeaudrygtrak, got it, thanks!
10:38uvtcTimMc: Hah. :) Thanks.
10:38TimMcuvtc: But lazybot is generally faster and smarter.
10:38miltondsilvajsabeaudry: if this works (conj [] [1] [2] [3]) why shouldn't your case?
10:39TimMc&(conj [] [1] [2] [3])
10:39lazybot⇒ [[1] [2] [3]]
10:39TimMcmiltondsilva: Did you want that, or [1 2 3]?
10:39gtrak`that's what I would have expected
10:39miltondsilvaoh I see what you mean
10:39gtrak`since maps are seqs of entries, the map-case doesn't make sense
10:40DrBenway_,(conj nil {:a 1 :b 2} {:a 3 :d 4} {:a 5 :f 6})
10:40clojurebot({:a 5, :f 6} {:a 3, :d 4} {:a 1, :b 2})
10:41DrBenway_,(merge nil {:a 1 :b 2} {:a 3 :d 4} {:a 5 :f 6})
10:41clojurebot{:f 6, :d 4, :b 2, :a 5}
10:41DrBenway_big difference in behavivor :-)
10:41gtrak`,(conj {} {:a 1 :b 2} {:a 3 :d 4} {:a 5 :f 6})
10:41clojurebot{:f 6, :d 4, :b 2, :a 5}
10:41TimMcTHat's right, the nil base case is completely different.
10:42gtrak`,(conj {} :a 1 :b 2)
10:42clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword>
10:42TimMcThe first arg's .cons method controls the behavior, and if it is nil, an empty seq is substituted in.
10:42gtrak`,(conj {} [:a 1] [:b 2])
10:42clojurebot{:b 2, :a 1}
10:43TimMcRead PersistentHashMap's .cons method, it's fucked up.
10:43TimMc(Possibly actually APersistentMap)
10:47gtrak`,(conj {} [[:a 1] [:b 2]])
10:47clojurebot{[:a 1] [:b 2]}
10:47gtrak`,(into {} [[:a 1] [:b 2]])
10:47clojurebot{:a 1, :b 2}
10:52beardmigrationBig thank you to @babilen and @vijaykiran for help in getting me up and running with emacs a couple of days ago.
10:53beardmigrationNow I've found time to do a bit of clojure I have another newbie problem with classpaths and name spaces...
10:53beardmigration... I want to set up a leiningen project, write a couple of functions and unit tests for them.
10:53beardmigrationHowever nothing seems to want to compile.
10:53beardmigrationAny suggestions?
10:54vijaykiranbeardmigration: hi there ..
10:54amrowhat's the error?
10:54uvtcWhat have you done so far?
10:55vijaykiranmay be you want to paste your project.clj - somewhere
10:55beardmigrationFrom the command line: lein compile No namespaces to :aot compile listed in project.clj.
10:55uvtcbeardmigration: you might paste code to https://refheap.com/paste
10:55clgvbeardmigration: try "lein uberjar" if you want a standalone jar of your project
10:56neotykbeardmigration: lein test
10:56neotykdon't lein compile if you don't have to
10:56devnkibit is awesome.
10:57devn:X
10:57neotykdevn: are you aware of hubot?
10:58neotykhow cool would it be if kibit could derive the rules from clojure source code?
10:59gtrak`kibit = awesome
10:59beardmigrationlein 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:00gtrak`beardmigration, did you do 'lein new' to create your project or set it up manually?
11:01beardmigration<gtrak'> lein new.
11:02beardmigrationI'm confused as to the role of two core.clj files - one in the testing tree and one in the src.
11:02TimMcbeardmigration: The test one should test the src one.
11:03TimMcbeardmigration: By the way, "core" is just a suggestion -- you can name it anything.
11:03owain`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:03beardmigrationSo must the name of the test file match the file it unit tests?
11:04owain`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:04TimMcbeardmigration: Nope. (But the namespace must match the file name and path.)
11:04vijaykiranno, it doesn't. You can put the test anywhere you like.
11:05gtrak`owain`, check out noir and korma
11:05beardmigrationAh that's the nub of it - how must the namespace match the paths?
11:05owain`thanks. I've looked at both. Noir is excellent
11:05Vinzentowain`, also, take a look at https://github.com/duck1123/jiksnu
11:05owain`Just wondering more about structuring things like how you'd do MVC in rails or Django.
11:05owain`Or does that not apply so much in a functional language?
11:06owain`Vinzent: not seen that before. thanks
11:06gtrak`mvc is a little different in functional-land, really I think no-one agrees on what MVC should be anyway
11:06owain`That's kind of what I was wondering.
11:06duck1123Ciste is the MVC part. Jiksnu is more of an implementation of Ciste
11:06owain`Does MVC matter as much in a language like Clojure. I'd LOVE to do all my web work in Clojure.
11:07TimMcbeardmigration: - becomes _, . becomes /
11:07DrBenway_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:07TimMcBlame the JVM for those restrictions.
11:07gtrak`owain`, separation of concerns matters, but a controller can be a namespace instead of an object or something, for example
11:08owain`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:08TimMcbeardmigration: ./src/foo/bar/baz.clj has a namespace of foo.bar.baz (if src is the source root)
11:08uvtcWas 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:08owain`This was the only really good example I've seen. https://github.com/abedra/shouter
11:09gtrak`owain`, conjure was an attempt to be like rails, but I don't know how many folks actually use it
11:09owain`Yeah I didn't like the look of it.
11:09owain`Felt too "big"
11:09owain`Not sure how to describe it. Just seemed wrong for Clojure.
11:10owain`Certainly interesting.
11:10beardmigration<TimMc> Does that mean that ./test/pruefungen/test/test_core.clj should have ns test.pruefungen.test.test_core?
11:10TimMcuvtc: I havne't heard the latter sense before.
11:10TimMcbeardmigration: Drop the first "test."
11:10vijaykiranand I think test_core should be test-core
11:10vijaykiranat the end
11:11gtuckerkelloggcan anyone tell me what I'm doing wrong here? http://pastebin.com/YhX8JpUm
11:11TimMc^ yeah, hyphen in the ns
11:11beardmigration<TimMc> so the test directory is included in the classpath?
11:11vijaykiranI'd leave -/_ for now - just name it core.clj
11:11uvtcTimMc: Vars, Refs, Agents, and Atoms are mutable, correct?
11:11TimMcbeardmigration: right
11:11clgvgtuckerkellogg: you are closing the file from with-open before the lazy-seq from map is evaluated
11:12TimMcuvtc: yup
11:12beardmigration<vijaykiran> yep I'd noticed some problems with _ being translated to - or vice versa - is it recommended not to use these in filenames?
11:12TimMcuvtc: "reference types"
11:12gtuckerkelloggam I?
11:12gtuckerkellogghuh
11:12duck1123owain`, I would suggest you check out Ciste, if you're looking for MVC.
11:12clgvgtuckerkellogg: it'll work if you put a 'doall in front of the map
11:12gtuckerkelloggthanks!
11:12vijaykiranbeardmigration: the only caveat is _ in the file name means - in namespace .. but you can safely ignore it for now.
11:13uvtcTimMc, I think I saw that term in Joy of Clojure ... one sec...
11:13gtuckerkelloggyay! and so it did, thank you clgv
11:13vijaykiranbeardmigration: since _ means something diff in clojure :)
11:14beardmigration<vijaykiran> yes of course.
11:14beardmigrationOk thanks for the input - let me try it out...
11:14uvtcTimMc: 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:15gtrak`owain`, also this guy: https://github.com/seancorfield/fw1-clj
11:15gtrak`they use it for real stuff
11:16owain`gtrac: Thanks. Looks good. What I was looking for.
11:16uvtcTimMc: my hunch is that the word "object" is simply overloaded, and somewhere along the line I thought it was equivalent to "value".
11:16owain`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:17uvtcTimMc: Thanks.
11:17gtrak`owain`, I think twitter does stuff like that, slowly replacing their ruby backend with java/scala/clojure
11:18owain`I kind of like that idea. Splitting up into smaller apps that do specific things.
11:18gtrak`http://www.infoq.com/articles/twitter-java-use
11:18owain`I heard Etsy.com use Clojure/Scala as well. Might be wrong.
11:20beardmigrationI'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:20owain`Maybe that's a good way to go. Smaller apps working together rather than one giant monolithic framework.
11:20duck1123it all depends on how much you can break off into smaller tasks and how many queues you have
11:21uvtcbeardmigration, just saw a blog post that might be useful to you: http://reminiscential.wordpress.com/2012/03/03/writing-a-simple-clojure-library/
11:22beardmigrationThanks <uvtc> - that post seems to be at my level!
11:23gtrak`meh, no sense in overengineering everything upfront, I think FP makes it easier to refactor out into services later
11:24babilenbeardmigration: You are most welcome -- Great that you got it working! :)
11:24uvtcbeardmigration, sure, yw
11:25uvtcowain`, 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:25raekbeardmigration: :use, not use:
11:26beardmigrationbabilen: 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:26beardmigrationSuspect I still have a classpath / namespace problem.
11:27babilenbeardmigration: See raek's remark
11:27owain`uvtc: I think this bit was done in Clojure. http://www.etsy.com/search?search_submit=&amp;q=
11:27vijaykiranbeardmigration: see what raek said (:use ....) not (use: ...)
11:27owain`Remember seeing it on HN I think. Hang on.
11:27owain`http://news.ycombinator.com/item?id=1453259
11:27owain`They probably use a ton of stuff by the look of it.
11:28owain`PHP, Java, Python and Ruby? Why would you use so many languages? Haha.
11:29dnolenowain`: from what I hear they're pulling back on the number of languages they use.
11:29uvtcowain`, Ah, neat. Thanks.
11:29hiredmanI wonder if I could interest them in my lisp->php compiler
11:31langmartinI 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:32gtrak`hiredman, gross :-)
11:32langmartinNames and Values are both not found, and can't be imported directly. any help would be greatly appreciated
11:32owain`gtrack: +1 haha
11:32babilenbeardmigration: Actually make that: (ns pruefungen.test.test-core (:use [pruefungen.core]))
11:33hiredmanlangmartin: you have to use the jvm class names
11:33beardmigration<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:33beardmigrationIs there a better workflow to test just the file you have edited in emacs rather than go out the shell?
11:33hiredmanlangmartin: javac turns inner classes into like HttpHeaders$Names
11:34langmartinhiredman: no shit! that goes on my newbie notes page then
11:34dnolenclojurebot: ~max
11:34clojurebotPardon?
11:35dnolen~max
11:35clojurebotMost users ever in #clojure: 404
11:35hiredman~max users
11:35clojurebotPardon?
11:35uvtc~current
11:35clojurebotTitim gan éirí ort.
11:35hiredmanclojurebot: jerk
11:35clojurebotyou cut me deep, man.
11:35vijaykiran404 :)
11:35babilenbeardmigration: 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:37stuartsierraMidje is under more active development than Lazytest right now.
11:37babilenstuartsierra: I still like lazytest -- Sad to hear that midje is under more active development (which probably means that lazytest is not)
11:38jsabeaudry&(bytes [1 2 3 4])
11:38lazybotjava.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to [B
11:38langmartinhiredman: thanks so much, works like a char
11:38langmartinm
11:38stuartsierrababilen: I wrote Lazytest, but have not had time to work on it in the past year or so.
11:38babilenstuartsierra: But you are right -- Given that the last commit was one year ago, I probably shouldn't recommend it anymore.
11:39Vinzentis there topological sort implementation somewhere in standart lib?
11:39beardmigration'lein test' is somewhat slow for optimal test integration.
11:39hiredman"optimal test integration"
11:42beardmigrationI 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:43babilenbeardmigration: https://github.com/marick/Midje/wiki/Midje-mode
11:43gtrak`midje uses core.unify, maybe it can use core.logic or does it matter?
11:43owain`babilen: that looks good. Thanks.
11:44beardmigrationbabilen: even better an emacs minor mode!
11:44mdeboardSo, funny question: Is anyone here going to be at Pycon
11:45gtrak`mdeboard, I did pycon audio/visual in 2010, I'm sad I can't go, but I'm going to clojure/west :-)
11:45mdeboardYeah unfortunately I'm a single parent otherwise I'd just stay out there :(
11:45mdeboardWell, "unfortunately my responsibilities prevent me from staying out there", not unfortunately @ single parent
11:46beardmigrationThanks again to all - I'm looking forward to writing something more substantial.
11:46gtrak`mdeboard, apparently stallman's giving a lecture, too
11:46mdeboardya
11:49gtrak`is there any big news in python anyway? I lost interest a couple years back
11:52mdeboardgtrak`: Not really in my world of web dev. Nothign I personally get too excited about anyway.
11:52mdeboard(though admittedly it does take a lot to get me excited)
11:52gtrak`clojure stole my heart :-)
11:52mdeboardyeah
11:53mdeboardwell, 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:54gtrak`I think there's a lot of value in writing equivalent code in different methods/paradigms/languages
11:55uvtcgtrak, 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:55gtrak`yea, pypy was always interesting to me
11:55gtrak`unladen swallow died unfortunately
11:55alexbaranoskygtrak, I agree -- the best way to see alternative design solutions is to be able to come up with multiple isomorphic solutions
11:56alexbaranoskythen you can compare and contrast their relative merits
11:57gtrak`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:57gtrak`refactoring is a big part of what I do every day
11:57luciangtrak`: i'd say unladen fortunately died :)
11:57alexbaranoskygtrak, that's the kind of thing I'm thinking, yeah!
11:58geoffeg_cwith "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:58geoffeg_clein doesn't seem to be picking up the auth definition in profiles.clj
11:59martintrojerSo, who's gonna start an open-source datomic compatible project? The gauntlet is thrown...
11:59gtrak`alexbaranosky, making code look like what it is :-)
12:15geoffeg_cis there some full example of a profiles.clj file i can read? lein doesn't seem to be picking mine up
12:16geoffeg_ci can't find docs on what the file needs to contain
12:16xeqiwhat version of lein are you using?
12:17geoffeg_c1.6.2
12:17xeqiprofiles new for 2.0
12:18sorenmacbethgeoffeg: you have to use 1.7.0 to use ~/.lein/profiles.clj
12:18xeqi*are new
12:18sorenmacbethxeqi: they are in 1.7.0 as well I believe
12:19geoffeg_cok, i'll upgrade
12:24geoffeg_cok. 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:25TimMcgeoffeg_c: Yes, in the lein repository there is a sample project.clj.
12:25TimMcerf, misread
12:26geoffeg_cyep, but i can't find an example profiles.clj
12:30`fogusAnyone have insight on how to get lein to spit out a different directory for the pom resources element?
12:30kijHey, is there any guides how to do logins and security in clojurescriptone ?
12:30xeqiprofiles 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:32xeqi`fogus: have you tried :resources-path ?
12:33`fogusxeqi: Oh! You're supposed to spell that properly!?! ;-)
12:33`fogusThank you
12:34`fogustechnomancy: Lein 3.0 feature request: DWIM :p
12:35sorenmacbethxeqi: I'm using profiles just fine in lein 1.7.0
12:36technomancythere's a plugin back-porting profiles to 1.x, but it won't work out of the box
12:37technomancyit's also a bit behind the profiles implementation in lein 2
12:40gtrak`kij, there's sandbar for a clj solution, i think some folks use spring security for more comprehensive stuff
12:40sorenmacbethtechnomancy: isn't profile.clj the recommended way to do site-wide plugin handling in 1.7?
12:40sorenmacbethprofiles
12:40technomancysorenmacbeth: no, the back-porting of profiles to 1.x is kind of experimental
12:40technomancygreat if it works for you though =D
12:41sorenmacbethtechnomancy: seems to be :p
12:41technomancyI don't think I've actually told anyone about it, so congratulations on discovering the easter egg =)
12:41sorenmacbethtechnomancy: though I did have to run `lein plugin install` still
12:42sorenmacbethso maybe I just thought it was working
12:45kijgtrak`: thanks!
12:53geoffeg_chow do i get "lein deploy" to also install the pom ("lein install" generates it)?
12:55Licenserdid you ever notice that if you have the wrong font pom and porn look very much the same?
12:56geoffeg_ci hadn't previously
12:56geoffeg_chow can i install porn in maven?
12:57eggsbylol Licenser :D
12:57eggsbythat keming D:
12:57sorenmacbethgeoffeg_c: mvn porn:bow-chica-bow-wow
12:58geoffeg_ci'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:58Licensernow you guys have something to talk about that should end the quiet
12:58Licensergtuckerkellogg there is lein-clojars?
12:59Licensergeoffeg_c I ment
12:59TimMcgeoffeg_c: As in, deploying to a local nexus?
12:59sorenmacbethgeoffeg_c: see http://clojars.org
12:59geoffeg_cyea, but my employer has their own private maven repo (artifactory), i don't want to push to clojars..
13:00technomancygeoffeg_c: "lein deploy" should get the pom installed too; I've never heard of that failing
13:00technomancyit sounds like you may have found a bug?
13:00geoffeg_chmmm, maybe artifactory is being stupid.. it seems to really enjoy doing stupid thjings
13:00Licenserstop saying pom … please?
13:00geoffeg_ctechnomancy: i'll look into what the problem with the pom is
13:01technomancygeoffeg_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:03geoffeg_ctechnomancy: 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:03geoffeg_ccan i tell lein to go look in s3 for deps?
13:03technomancyjust add a repository like "s3p://my-secret-bucket/releases" to :repositories in project.clj
13:03technomancyand be sure the s3-wagon-private plugin is in :plugins
13:03geoffeg_ci like this idea :)
13:14technomancywould people use the backported profiles plugin if I updated it?
13:14technomancyI'm hesitant to just because I want people to try out lein 2, but that's selfish of me =)
13:15technomancy`fogus: thanks for getting that pushed out
13:18hiredmantechnomancy: if I had the time to do new things I would just move to lein 2
13:19technomancyyeah, with the migration path being helped by lein-precate I think backporting features is probably unnecessary
13:20`fogustechnomancy: Thanks for the legwork on lein-marg
13:34mrBliss`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`fogusmrBliss: Thanks. Will fix now.
13:37mrBliss`fogus: that's quick! Thanks again for your hard work.
13:38`fogusThank you
13:38technomancy`fogus: oh hum... marginalia needs to run in-process, doesn't it?
13:38technomancyI mean in the project's process rather than Leiningen's?
13:38`fogusja
13:39technomancyyeah I think I may have goofed on the lein2 support; I must have only been testing it with 1.7 =(
13:41technomancyherp && derp
13:41`fogusDO'ETH!
13:45technomancy`fogus: I've got a fix
13:45technomancyif you want to do an 0.7.1 of lein-marg alone I'll update the docs to reflect it
13:45technomancysorry =\
13:46`fogusNah, it's been ~11 minutes. I'll repush v0.7.0
13:47technomancysneaky
13:48technomancypull-req'd
14:04technomancyis he still around?
14:05dnolenperhaps reincarnated as Cedric Greevey
14:05technomancywouldn't surprise me
14:06`fogusThere is no chance that they are different people
14:07TimMcWho is this, some kind of complainer? troll? agent provacateur?
14:07`fogusYou have no chance to survive make your time
14:10emezeskeFor great justice!
14:10dgrnbrgHow do I split a string on a character?
14:10dgrnbrgI have a dot-separated string, and I'm trying to use .split, but I'm not getting the result I expect
14:11dgrnbrgnvm
14:11dgrnbrgI forgot . & regex interaction
14:11technomancyfor some reason .split uses faux-regexes
14:11technomancyit's pretty silly
14:12technomancyI guess that's a coping mechanism for working in a language that doesn't have literal syntax for regexes
14:16dgrnbrgtechnomancy: i think they're real regexes
14:16dgrnbrgit just compiles them for you
14:17technomancydgrnbrg: no, it takes a string argument
14:17dgrnbrgwhich is first compiled to a regex
14:17dgrnbrgit's a real regex, but it doesn't take the regex as the argument
14:17dgrnbrgit takes the pattern str-
14:17technomancyright; I'm just saying that a better-designed API would be to take a regex argument
14:18technomancyif you didn't have to work around the shortcomings of the Java Programming Language™
14:19danlarkintechnomancy: Sun's ex-lawyers thank you
14:19technomancyI should set up a dabbrev for that
14:20dgrnbrgtechnomancy: :)
14:20dgrnbrgat least the jvm is really fast
14:21emezeske*once it's running
14:26dgrnbrg*if it starts
14:29rplevydoes 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:53Licenseris there a way to make a callback function not callbacky?
14:53`fogusUnable to parse that sentence
14:54amalloyi think it parses fine but lacks semantics
14:55Licenserokay let me rephrase :)
14:55solidsnackLicenser: Do you mean, threads?
14:56LicenserI got some icky library that wants to only communicate via callbacks like bla.start(something, callback_function)
14:57Licenserbut 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:57TimMcLicenser: atom & watcher?
14:59`fogusLicenser: You want to convert a function taking a callback into one that is synchronous?
14:59amalloyi suggest drinking their callback koolaid
14:59Licenseryes that is about what I want :)
14:59Licenseramalloy it is annoying
14:59`fogusLicenser: https://github.com/joyofclojure/book-source/blob/master/src/joy/promises.clj#L39
14:59TimMcLicenser: but that lacks certain concurrency characteristics, since there is only one atom involved
15:00amalloya promise is certainly better than an atom
15:00niclHey 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:00TimMcLicenser: Forget everything I said about atoms, including my correction.
15:00niclClojure and Leiningen are installed fine
15:01niclAnd I've installed swank-clojure
15:01Licenserwhat atoms TimMc ?
15:01TimMcHmm? :-P
15:01niclBut when I run lein swank I get 'Couldn't find project.clj...'
15:01niclAny good walkthroughs out there for ubuntu/linux or anyone come across this problem ?
15:02ibdknoxhm, are promises in CLJS?
15:02ldopanicl: are you trying to run lein swank outside of a leiningen project?
15:03niclldopa: 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:03Licenseribdknox that is what I am researching right now ^^
15:03ibdknoxI don't think they are
15:03niclldopa: do I need to create a project for this to work / to playaround ?
15:03ldopanicl: yep
15:03Licensernoooooo :(
15:03niclldopa: ok great, thanks for the heads up
15:04ibdknox,(source promise)
15:04clojurebotSource not found
15:04stuartsierraA Clojure promise is basically an Atom + a j.u.c.CountDownLatch
15:05TimMcLocking is easier in JS. :-P
15:05ibdknoxheh
15:05ibdknoxunfortunately that can't really work in JS
15:05ibdknoxthinking about it more
15:05TimMcibdknox: Oh, hum... because you can't block threads.
15:05amalloyit can easily just be an atom, right?
15:06`foguspromise deliver in ClojureScript could just be aliasing of the atom stuff as a start
15:06TimMcYou;d have to make it a callback thingy anyhow!
15:06ibdknox`fogus: but you can't block
15:06ibdknoxever
15:06amalloyoh, right, i see
15:06Licenserhmm seems it does not
15:06ibdknoxstupid browsers
15:06TimMcLicenser: The good news is, we can write promise/deliver. The bad news is, it will need a callback.
15:06`fogusA promise doesn't block either if it doesn't block
15:06ibdknoxprogramming on the UI thread is stupid
15:07TimMcs,/me ,/say /,
15:07Licenserproblem is I hate this silly return everything in callbacks stuff
15:07ibdknoxI think the closest you could do is something like a more complicated form of my letrem in fetch
15:07TimMcWelcome to JS.
15:08amalloyLicenser: it's not really silly, even on the jvm. in javascript it's practically mandatory
15:08ibdknoxwhich wouldn't be that hard
15:08TimMcRight, you could have a macro that hides the fact that it is a callback.
15:08Licenseramalloy I understand that in some palces callbacks are a great thing
15:08Licenserbut not when every forking function reutrns their stuff in callbacks
15:09luciansurely dealing with callbacks is easier than dealing with threads in most cases
15:09Licenseribdknox do you have a link to that in code?
15:09luciandeferreds or CPS transform are very simple solutions
15:09ibdknoxLicenser: https://github.com/ibdknox/fetch/blob/master/src/fetch/macros.clj#L12
15:09amalloymeh. what's the difference? (my-fn (lib-call a)) vs (lib-call a my-fn)
15:10niclldopa: ok, created a project and it works great! Thanks
15:10ibdknoxamalloy: try doing that when there's a loop involved
15:10ibdknoxless common in Clojure
15:10amalloyit's true, i picked the most-convenient example
15:11ibdknoxI think the problem is mostly that it requires an inversion of the implementation :(
15:11ibdknoxand more importantly, the thinking around how to solve it
15:11ibdknoxit 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:11ldopanicl: np
15:12LicenserI just find it annoying this I don't want to put callbacks in every function call it is just annoying\
15:13ibdknoxanyways, hiding it in a macro seems ok
15:14Licenseramalloy also if you want to do two things with the result from lib-call the first is a big difference to the second
15:15ibdknoxI 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:16ibdknoxI have a hard time believing the former would really be on the table
15:16amalloyibdknox: for jvm-clojure, yes. for cljs, isn't it the opposite? fix it or do nothing?
15:17ibdknoxamalloy: true, I bet the cljs "fix" is pretty trivial too
15:19TimMcibdknox: ns discussion?
15:19ibdknoxTimMc: http://groups.google.com/group/clojure-dev/browse_thread/thread/e8411f74f86b5a09
15:19hiredmanmultiple :requires is icky
15:20arohneribdknox: I also have yet to see an opinion on why it needs a breaking change at all
15:20ibdknoxarohner: yeah
15:20arohnerhiredman: sure, but break all the existing code? why?
15:20hiredmanarohner: to force people to do things in a not icky way
15:20hiredman*shrug*
15:20arohnerhiredman: would you like to come fix 50kLoC for me?
15:21arohnerfor free?
15:21hiredmanarohner: you ahve 50kLoC of erroneous code
15:21TimMcIf hiredman didn't have me on /ignore, I could explain to him some very compelling reasons.
15:21gfredericksreducing multiple requires to one shouldn't be hard to automate...
15:21hiredmanI bet you could write a 10 line clojure program to fix it
15:21TimMcI'll just have to tell him in person at the meetup tonight.
15:21arohnerhiredman: no, I don't. I have 50kLoC of other people's broken libraries
15:21gfredericksTimMc: what did you do to him?
15:22TimMcgfredericks: No idea.
15:22arohner"broken"
15:22arohnerwhich is exactly why 1.3 was so painful
15:22hiredmanarohner: ah, well, most of those are broken under 1.4 anyway
15:22arohnerhiredman: what is breaking in 1.4?
15:22hiredman1.3/1.4
15:23hiredmanTimMc: I don't have you on ignore
15:23hiredmanwell, /ignore
15:23Licenserare we talking about combining require and use?
15:24gfredericksTimMc: the plot thickens!
15:24hiredmanI am not deeply committed to the idea of breaking everything, I just can't believe the horrible style people write clojure code in
15:25amalloyi 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:26TimMcWhoa, he acknowledges my existence!
15:26gfredericksamalloy: I due usually end up grouping things like that, but it makes me feel a little dirty
15:26RaynesBecause it is.
15:26hiredmanI've been thinking we could have one thing that does require+import that differentiated via () or []
15:27RaynesI hate when people use code with no meaning just to group code visually.
15:27RaynesThat's what comments are for.
15:27TimMchiredman: 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:27TimMcMeh, whatever.
15:28Licensercan someone explain why multiple requires should be bad?
15:28hiredmanTimMc: possibly, I have 74 people on ignore, so obviously I don't really keep track
15:28hiredmanbut you are not on /ignore now
15:28TimMc*shrug*
15:28amalloyibdknox: just poked around: you can get an almost-working version of multiple-require in cljs with like a one-line change
15:29rplevyLicenser: repetition is ugly and morally wrong
15:30Licenserbut I have mutliple defn's in my code too
15:30VinzentWithout multiple :uses you can't e.g. :reload only namespaces which you want
15:30TimMcrplevy: Ah, but what about separating use/require against one set of libs from use/require against another set?
15:30rplevyTimMc: trying to picture it...
15:30TimMcI prefer to organize my ns by topic rather than how each piece is refer'd.
15:31LicenserI'd double TimMc there, that is a good reason
15:32VinzentTimMc, could you explain what do you mean?
15:33hiredmanemacs -nw /var/log/safe.log
15:33hiredmanpardon me
15:33LicenserVinzent (ns bla (:rquire [liba.overloading]) (:use [liba.nonoverloding]) (:rquire [libb.overloading]) (:use [libb.nonoverloding]))
15:33TimMcVinzent: (:use [clojure.java.jdbc :only (...)]) (:require clojure.java.jdbc.internal) ... some other libs using the same pattern
15:35Vinzentyou can (:use [clojure.java.jdbc :only [...]] [clojure.java.jdbc.internal :only []] ...)
15:35VinzentActually, I don't understand why :require isn't deprecated already :)
15:36Licenserhuh?
15:36amalloyhaha
15:38Licenseroddly enough someone on clojure.de suggested combining use and requrie into one today - actually a good Idea I think
15:38VinzentLicenser, 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:38Licenserreally?
15:39TimMcVinzent: Is that true on 1.3?
15:39amalloyyes, but that's atrocious
15:39VinzentLicenser, TimMc, yes, try it :)
15:39TimMcOh, that's not what I want anyway.
15:39RaynesDidn't require and use already get merged?
15:39Vinzentamalloy, why?
15:39RaynesI thought that ship had sailed.
15:40RaynesVinzent: Because it is atrocious.
15:40rplevythe new :require ... :refer vars solves all these problems elegantly, no?
15:41TimMcDefinitely looking forward to that.
15:42VinzentRaynes, 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:43RaynesVinzent: I don't have to explain myself to you. BEGONE.
15:43TimMcVinzent: Doesn't it still refer all the ns publics?
15:43VinzentRaynes, what's wrong with you?
15:44VinzentTimMc, with :only [], no
15:44TimMcoh, I see. And ew.
15:44TimMcThat's atrocious.
15:44RaynesHahaha
15:46VinzentTimMc, lol :) well, that's better than using both :use and :require
15:47Bronsaam I a bad person?
15:47lucianwtf, (use 'clojure.set) moves everything into the current ns?
15:47RaynesYou're a horrible person.
15:47Bronsai suspected that
15:47lucianthat's like doing python's from clojure.set import * by default
15:48scriptorlucian: only use :use with :only
15:48scriptorunless if trolling
15:48VinzentBronsa, I feel silly when I have to e.g. (:use [foo :only [bar]]) and then (:require [foo :as f])
15:48lucianscriptor: but that's the other way around. it defaults to *
15:48VinzentBronsa, also, it's idiomatic to use only :use (see http://datomic.com/company/resources/clojure-api)!
15:48scriptorlucian: yea, that's just what use does, if you want something like import require is what you want
15:49lucianscriptor: that's a terrible default
15:49Bronsawait what.
15:49lucianscriptor: isn't use considered idiomatic?
15:49scriptorlucian: only if you just want certain functions, I'm not sure tbh
15:49Bronsai tought it was going to be considered idiomatic require
15:49Vinzentlucian, yes it is
15:50Bronsaand deprecated use
15:50lucianBronsa: that would be good
15:50lucianhaskell makes the same mistake
15:50Bronsaisn't that what technomancy proposed?
15:50amalloy:use/:as is fine, if a little tacky. but :use :only [] :as is disgusting
15:52Bronsahttps://github.com/clojure/clojure/commit/f5bcf647d480c4eaa4e808ec41edb698ad66ec63
15:52VinzentBronsa, 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:53lucianok, (require [foo :as bar]) is nice
15:54Vinzentamalloy, 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:54Bronsawell, http://dev.clojure.org/jira/browse/CLJ-879 this (accepted) ticket seems to suggest otherwise
15:54amalloythat's what :require is for, dude
15:55TimMcVinzent: 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:56TimMcVinzent: and then I see :only [], and I'm like "WTF, this is actually a :require :as in disguise."
15:57tmciverSo, despite the constant advise to 'only use :use with :only', you shouldn't use :use at all?
15:57tmcivers/advise/advice
15:57gfrederickstmciver: :only with a non-empty list is I think the purpose
15:58VinzentBronsa, I guess it was accepted so people can choose what style they prefer
15:58Vinzentamalloy, There can be only one! :)
15:58stuartsierraCLJ-879 is an attempt to unify :require/:use into just :require.
15:58BronsaVinzent: the propsal states that the intent is to deprecate :use
15:58Raynesstuartsierra: I thought that had already been accepted.
15:58stuartsierraRaynes: it has
15:58stuartsierraand committed
15:59RaynesI see.
15:59BronsaCant a warning be printed whan using :use?
15:59Bronsawell, probabily it would be too noisy
15:59RaynesThat'd probably not be the best idea.
15:59RaynesPeople will support old versions on purpose.
16:00Vinzentok, I give up then :) stuartsierra, thanks for clearing that out.
16:00TimMcI'll use the old-style stuff in libs, and the new syntax in top-level projects.
16:01RaynesTimMc: Same here.
16:01RaynesTimMc: We should be friends or something, we have so much in common.
16:01TimMcA lint option would be nice.
16:01TimMcRaynes: It's too bad you're a... what was it?
16:01TimMcI have that alias around here somewhere...
16:02TimMc"weak-ass ill-conceived piece of shit"
16:02Bronsalol
16:02Raynes:D
16:02TimMc...and so is BrowserID.
16:02TimMco\__/o
16:03TimMcI wonder if Google has picked that up yet.
16:04TimMcInterestingly, the 5th result for that (unquoted) is The Big Lebowski's IMDB page.
16:07TimMcRaynes: What-all languages are you going to have eval for?
16:08RaynesTimMc: I don't have a list yet. It'll grow over time, I expect.
16:18uvtcWhat 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:19technomancyuvtc: that list is ancient; best to ignore it
16:20uvtctechnomancy, Ok, thank you.
16:33mrBlissis github giving a 500 error to anyone else?
16:34RaynesLooks good to me.
16:35mrBlissit's fixed now
16:36RaynesmrBliss: Maybe someone haxed it again.
16:36mrBlissRaynes: that's what you get with Rails ;-)
16:37ibdknoxad*
16:37eggsbymmm, 4clojure is fun
16:37ibdknoxso much fail in that
16:37jodarogirlhub?
16:38ibdknoxyou know how it is.
16:38jodarois that porn equivalent?
16:38ibdknoxlol
16:38redinger"noir: No mass assignment bug here"?
16:38jodaroi think there are probably more crass options
16:39ibdknoxredinger: exactly. Seems like rails has set a new very low bar for success ;)
16:39ibdknoxtime to profit!
16:42Raynesredinger: Ohai.
16:42redingerRaynes: Hello there
16:43ordnungswidrighi all
16:45uvtcWith 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:46technomancyrelying on site-packages is repeatability-poison
16:46technomancy
16:46brehaut~repeatabilty
16:46clojurebotExcuse me?
16:47brehautbah
16:47ibdknox~guards
16:47clojurebotSEIZE HIM!
16:47technomancyclojurebot: have you suffered severe head trauma?
16:47clojurebotNo entiendo
16:47TimMcsuffering from typos
16:47ibdknoxlazybot: is clojurebot retarded???
16:47lazybotibdknox: Yes, 100% for sure.
16:47TimMclack of \i
16:47TimMc~repeatability
16:47clojurebotrepeatability is crucial for builds, see https://github.com/technomancy/leiningen/wiki/Repeatability
16:47TimMc<- clojurebot-whisperer
16:47uvtctechnomancy, Ok. So, lein always installs per-project?
16:47ibdknoxlol
16:48brehautthat'll teach me fore using a tiny font
16:48brehaut(not really)
16:48technomancyuvtc: leiningen forces isolation and will only pull in dependency trees which are explicitly specified
16:49technomancyit 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:49uvtctechnomancy, by "forces isolation", you mean "installs libs into the current project", correct?
16:49technomancyuvtc: no, it means it limits the classpath to exactly what is specified
16:49uvtctechnomancy, (sorry --- was typing while you were typing)
16:50technomancyleiningen 1 copies things to lib/ by default, but that's just one way to do it
16:50technomancyleiningen 2 constructs classpaths with references to ~/.m2/repository
16:50technomancythe end result is the same when it comes to isolation
16:50TimMctechnomancy: Run into any command length limits with that yet?
16:51technomancyTimMc: no, but I don't use windows
16:51jsabeaudry&(try :a (finally :b))
16:51lazybot⇒ :a
16:51TimMcAh, is that mostly a Windows problem?
16:51TimMcToo bad, I was thinking of clever symlink tricks to get around it.
16:51technomancyTimMc: I've never heard of it being a problem, so I'm assuming it's a winders thing
16:51TimMchaha, OK
16:51uvtcIs 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:52technomancyuvtc: I'm not sure what you are asking.
16:52uvtcI'm trying to learn the basic principles lein follows.
16:53technomancythe best place to start is "lein help tutorial"
16:53uvtcI read the tutorial at the github page.
16:55amalloyTimMc: 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:56amalloyeg, 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:57uvtctechnomancy, 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:57technomancyuvtc: that's correct; ~/.m2/repository
16:57technomancyyou can think of it as a local cache for Maven Central and Clojars
16:58technomancyit will be available for other projects, but only those that explicitly request that specific version
16:59uvtctechnomancy, 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:59technomancyuvtc: I meant having system-wide packages available implicitly
17:00technomancylike python and ruby
17:00amalloyuvtc: he was talking about global installs in general. ~/.m2 isn't a global install because it's all neatly versioned and explicit
17:01technomancyat least in the ruby community they are experiencing a lot of pain moving away from that model
17:01uvtcExcellent. So then, what is the point of `lein install`? If I can run my project from within the project dir via `lein run`?
17:02technomancyif you make a change to a project, you may want to make it available to other projects that depend on it
17:02technomancyyou could do that by pushing it to clojars, or you could install it locally first to test before you push
17:02uvtcWhy is the directory named ".m2"?
17:02technomancyit's an implementation detail; comes from maven2
17:03brehautits an abbreviation of Maven Madness
17:04amalloybrehaut: c'mon, we need you commonwealthers to keep Muppetry alive
17:05brehautamalloy: i dont understand
17:05amalloyinstead of Madness
17:05brehautoh right
17:06uvtcOk. So when I use Leiningen, a local repository (~/.m2/repository) is automatically set up to hold common libs (jars).
17:07uvtcAnd if I use `lein install`, libs are copied to that repository.
17:07amalloyso far so good, uvtc
17:08geoffeg_cso 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:08raeklibs 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:08geoffeg_cputting war files in git seems wrong and maven doesn't seem like the right place
17:08technomancygeoffeg_c: definitely don't want those checked in
17:09geoffeg_cright, agreed
17:09geoffeg_cbut 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:10technomancygeoffeg_c: one way is to get a CI server that uploads each successful release to s3 or something
17:10ordnungswidrigI'd use a locale repository, either maven or a webserver. webdav might be of use here.
17:11uvtcraek, so, when you run `lein deps` it looks at the project.clj's :dependencies to see what it needs to download, correct?
17:11geoffeg_cok, so s3 or some http server.. which is what i was thinking but wondering if there was something more... appropriate
17:11ordnungswidriggeoffeg_c: a private maven repository is appropriate.
17:12raekuvtc: yes
17:12geoffeg_cordnungswidrig: hmm, but maven seems awkward for wars.. i mean, nothing depends on a war file so
17:12uvtcraek, Whoops -- sorry, it says that right there in `lein help deps`.
17:12raekit also downloads dependencies of dependencies, etc
17:13ordnungswidriggeoffeg_c: maven supports artifact types. "war" is one of them as is "pom" or "jar"
17:13geoffeg_cok, i'll consider that again
17:13raekuvtc: "lein install" is most often used when you want to try an unreleased version of a project before releasing it properly
17:13geoffeg_cthanks everyone
17:13ordnungswidriggeoffeg_c: you might want to have a look at http://www.jfrog.com/products.php
17:14raekin some sense, you can think of it as a cousin to "make install"
17:14geoffeg_ctechnomancy: 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:14raekmost importantly, you rarely need to use "lein install" when using someone else's library
17:15technomancygeoffeg_c: maybe using lein ring? I've never used war files.
17:15geoffeg_cok
17:15geoffeg_cLOLZ
17:15ordnungswidrig+1
17:15technomancysome day that joke might get old... but not today!
17:15uvtcraek, 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:16uvtcGuess that's why I'm not understanding the point of the .m2 repo.
17:16amalloyhaving your dependencies checked into git would be horrible
17:17amalloyand 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:17uvtcamalloy, Ah! Of course. It's assumed you create a git repo for your project after you create it. Right right.
17:17raeksome of it is explained here: https://github.com/technomancy/leiningen/wiki/Repeatability
17:17amalloy*shrug* you can .gitignore them, but then everyone who uses your project needs to get a copy of the deps somehow
17:18uvtcOk. Made some headway. Need to go read the docs again and absorb some more. Thanks so much!
17:26dgrnbrgHow do I invoke a varargs java fn from clojure?
17:28arohnerdgrnbrg: pass a java array
17:28arohner(.foo obj (into-array [:a :b :c])
17:29arohnermight need to use the type argument of into-array
17:29dgrnbrgok, thanks :)
17:29dgrnbrgthat's what I thought, but I was having signature mismatches
17:30jsabeaudryWhat kind of problems will be encountered when "send"ing potentially blocking actions to an agent (instead of send-off)?
17:31arohnerjsabeaudry: the send pool has N + 2 threads in the pool, where N is the number of cpus you have
17:31arohnerwhile the send-off pool is unbounded
17:31arohnerso send'ing could block your CPU bound actions
17:31jsabeaudryarohner, So it would potentially block all other actions, is that right?
17:32justicefrieswhat are people actively using? compojure or noir?
17:32m0smithjust: noir
17:32arohnerjsabeaudry: yes, if you send enough blocking actions
17:33justicefriesI'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:33justicefriesor if I just need to reread.
17:33jsabeaudryjusticefries, best way is to code imho
17:33justicefriesthat's what I'm thinking.
17:34brehautjoy of clojure and the orielly clojure book are both great resources though; they wont hurt.
17:34justicefriesbrehaut: trying to work my way through the o'reilly one right now, it's...hard work! :d
17:34RickInGAClojure in Action is good too
17:34justicefries:D
17:35AimHereA lot of OReilly books probably hurt, if you drop them on your foot
17:35brehautlearning anything worth learning is hard work :)
17:35justicefriestrue.
17:35RickInGAeach one covers things a bit differently, can learn from all.
17:35dgrnbrgarohner: anything quirky with inner interfaces?
17:36dgrnbrgI have (into-array qualified.name.of.inner.interface [elts])
17:36dgrnbrgand I import the inner interface directly
17:36dgrnbrgand it complains classnotfound
17:36amalloythat's not the real name of the interface
17:36dgrnbrgamalloy: what can I do to get it to work?
17:36amalloypackage.foo.Class$InnerClass
17:37amalloyis the actual name. javac just lets you pretend it's something else
17:38dgrnbrgI see :)
17:38dgrnbrggot it compiling :)
17:38dgrnbrgI suppose no one's written a clojure API for the new filesystem watching apis?
17:40amalloy$google clojure watchtower
17:40lazybot[ibdknox/watchtower - GitHub] https://github.com/ibdknox/watchtower
17:40dgrnbrgbut that doesn't use the fs watching api
17:40ibdknoxthat doesn't use the NIO stuff in java 7 though
17:40dgrnbrgi have a lot of files
17:41ibdknoxdaaku wrote a watcher thing that uses the java 7 apis
17:41dgrnbrgi'm writing software to dynamically build indices of java code for vim & emacs completion
17:42technomancydgrnbrg: like ctags?
17:42ibdknoxwhat's wrong with ctags?
17:42dgrnbrgit's not dynamically reindexing
17:42dgrnbrgit doesn't follow jars & understand the classpath
17:43dgrnbrgunless i'm mistaken wrt ctag's functionality
17:45ibdknoxthat's a very expensive set of things to do in real time
17:45jodaroRickInGA: see that mail from alex?
17:45dgrnbrgI 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:46dgrnbrgcurrently i'm using a doclet to parse the java, but I may have to move to antlr grammar
17:46RickInGAcool
17:46RickInGAI didn't know I got a discount too!
17:46dgrnbrgI 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:54ordnungswidrigcan defmacro destructure args in 1.3?
17:56ordnungswidrig(defmacro foo [[[a b] [c & ds] & body] …)
17:58Vinzentordnungswidrig, yes, why not?
17:59ordnungswidrighad some problems with it.
18:03ordnungswidrigVinzent: ok (let [[a & b] [nil]] a) => nil
18:03ordnungswidrigVinzent: that was the problem.
18:06amalloyso far i only see intended behavior, no problems
18:09ordnungswidrigamalloy: yes, it was a misunderstanding
18:38OwenOua 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:38OwenOuor what's the idiomatic way?
18:40VinzentOwenOu, use keyword first when you treat a map like an object
18:40technomancyOwenOu: it's common to map a keyword over a vector of maps
18:41OwenOuVinzent: that's a very good point
18:41TimMcI just mapped a map over a collection of keywords. Feels good, man.
18:41OwenOutechnomancy: can u give me an example?
18:42arohnerOwenOu: (map :foo [{:foo 1 :bar 2} {:foo 3 :bar 4}])
18:42arohner=> (1 3)
18:42arohneroh right, we have clojurebot for that
18:42Iceland_jack,(-> {:name {:first-name "Alice" :last-name "Silverman"}} :name :first-name)
18:42clojurebot"Alice"
18:43Iceland_jackyou can access information from within nested data structures
18:43emezeske,(get-in {:first-name "Alice" :last-name "Silverman"} [:name :first-name])
18:43clojurebotnil
18:43emezeske,(get-in {:name {:first-name "Alice" :last-name "Silverman"}} [:name :first-name])
18:43clojurebot"Alice"
18:43Iceland_jackemezeske: thanks :)
18:43amalloythat's kinda a lame example, Iceland_jack, because get-in is at least as good at that
18:43amalloy&(get-in {:name {:first-name "Alice" :last-name "Silverman"}} [:name :first-name])
18:43lazybot⇒ "Alice"
18:43Iceland_jackI'll try to delame my examples in the future
18:44amalloywow, what is my ping time? like two minutes? you guys had a whole conversation at light-speed while i was typing
18:45Vinzentby the way, where is dissoc-in?
18:46technomancyVinzent: there's update-in
18:46Vinzenttechnomancy, yes, but where is dissoc-in? :)
18:46Vinzentalso, value of nil for the key is not the same as if there is no this key at all
18:49kenthHow 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:49OwenOuarohner: thanks
18:49OwenOuclojurebot seems pretty neat, is it open sourced?
18:50emezeskeclojurebot: where do you live?
18:50clojurebotIt's greek to me.
18:50emezeskeAw :)
18:50technomancyclojurebot: source?
18:50clojurebotsource is http://github.com/hiredman/clojurebot/tree/master
18:50emezeskeclojurebot: Yeah, help out technomancy but not me. Thanks.
18:50clojurebotGabh mo leithscéal?
18:51amalloyclojurebot: who's your daddy?
18:51clojurebotexcusez-moi
18:53kenth(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:55RaynesOwenOu: Also, lazybot: https://github.com/flatland/lazybot
18:56RaynesWhich is more user-friendly (as in, it is possible to run it on your own machine without gouging your eyes out).
18:58kenthhm.., what happens with a combination of pmap and future?
19:01emezeskekenth: What is the Thread/sleep for?
19:01kenthwaiting for the javascript execution to do its thing
19:01OwenOuRaynes: thanks
19:02emezeskekenth: So you're saying that .executeJavaScript returns before it's done?
19:03kenth(pmap #(let [reslt (.getNewPage (.executeJavaScript coursepage %1))] (Thread/sleep 5000) reslt) listOfJSstrings)
19:04kenthyep, waiting for the js info to come in before returning
19:05emezeskekenth: But.. what is the value of "result" between when (.executeJavaScript) returns, and when Thread/sleep finishes?
19:07kenthI just tried it out, the result wasn't quite right.. its part of http://htmlunit.sourceforge.net/apidocs/com/gargoylesoftware/htmlunit/ScriptResult.html
19:16groovemonkeyI'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:17groovemonkeyFailed to download clojure jars
19:17groovemonkeyanyone have any ideas?
19:18technomancygroovemonkey: sounds like you found some old documentation; try https://github.com/technomancy/swank-clojure/blob/master/README.md
19:19groovemonkeythank you! I'll try that right away. Thanks for your time.
19:19technomancysure
20:32johnmn3hello
20:32johnmn3Does semperos ever pop in?
20:37amalloyi know he used to. i don't remember hearing anythin from him for a fair while, but who knows
20:39amalloyapparently he was here earlier today
20:39amalloyso i am not a winner
20:41johnmn3hmm
20:41johnmn3juxt is the winner!
20:45johnmn3what is function A, such that (= 42 (A #(pred that returns true for 42) (range 1 100)))
20:45Vinzentsome?
20:45johnmn3well, I want to stop searching on first find
20:46johnmn3take-while & not
20:46Vinzentjohnmn3, it's some
20:46johnmn3Okay, will some return 42?
20:46johnmn3and it does
20:46johnmn3thanks Vinzent
20:47Vinzentnp
20:51johnmn3ah, no. I want it to work like filter
20:51johnmn3where the pred will return true, but the value fed to the pred is returned, if true
20:52johnmn3I want filter-but-stop-on-first-success
20:52johnmn3(first (drop-while #(not (...
20:52johnmn3right?
20:54johnmn3well, it works
20:55johnmn3I guess I could have changed the pred to a function that returned it's input if true.
21:00amalloy(first (filter ...))
21:02johnmn3oh, duh
21:02johnmn3and filter is lazy, so it'll stop searching after the first, right? (chunking notwithstanding)
21:54gtuckerkelloggi'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:54gtuckerkelloggFor example, this fails (= (() ({:pos 0, :mark "5"})) (() ({:pos 0, :mark "5"})) )
21:54Iceland_jackgridaphobe: which properties would you like to compare?
21:54gtuckerkelloggall of them,
21:55gtuckerkelloggif 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:55gtuckerkellogg(with apologies for my clojure noob-ness)
21:55gridaphobeIceland_jack: are you sure you meant to ping me?
21:55Iceland_jackhaha, no I didn't
21:56Iceland_jacksorry :)
21:56gridaphobenp :)
21:57Iceland_jackgtuckerkellogg: I'm not sure how you'd do that without creating your own equality checker
21:58Iceland_jackhopefully someone who actually knows Clojure can come along 8)
21:58gtuckerkelloggshouldn't i be able to do that using (map ?
21:58gtuckerkelloggyet it seems to evade me
21:58amalloyjust use [] instead of () for the seqs you want to compare
21:59amalloyor quote it, or anything
21:59Iceland_jackoh, that was the problem
21:59Iceland_jack,(= '(() ({:pos 0, :mark "5"}))'(() ({:pos 0, :mark "5"})))
21:59Iceland_jackthis works?
21:59clojurebottrue
21:59Iceland_jackthanks clojurebot
22:00gtuckerkelloggcool
22:19ideally_worldis there a way to get output from the Swing thread in Slime?
22:22technomancygtuckerkellogg: have you tried lein-difftest?
22:22ideally_worldProgramming in Clojure is far more revealing of how much of an idiot I am than any other language :)
22:23gtuckerkelloggtechnomancy, no but I'll look into it
22:23gtuckerkelloggi'm *really* new with clojure, but it's fun
22:24gtuckerkelloggI have to agree with ideally_world :-)
22:24technomancyit's more about making it easier to tell _how_ two data structures are different in the event of failures
22:26gtuckerkelloggthat would be usefl
22:26gtuckerkellogguseful
22:37aperiodicoh wow, lein-difftest is awesome
23:03ferdany way to (set! *print-meta* true) so that slime-macroexpand-1 shows my metadata?
23:59amalloyi doubt if you want it to - there are usually zillions of {:line 342} meta entries on source code
23:59amalloyand you can just macroexpand it by hand at the repl if you want to check on occasion