#clojure logs

2012-02-17

00:56leviHuh, I didn't think that interview was very depressing. I have a soft spot for Scheme, though.
01:08JulioBarrosI'm trying to use noir with enlive and can't figure out how to get the templates (defpage defsnippet) to reload during development. (I'm new to this). Anyone have any tips?
01:15adeandradeGuys, how can I apply a list of args to a Java method? I tried something like: (apply #(.get java-object) [1 2 3]) but didn't work.
01:18sritchieJulioBarros: you either have to re-eval the forms, or use the auto-reload middleware
01:19sritchieJulioBarros: (:require [ring.middleware.reload :as rl]), then (noir.server/add-middleware rl/wrap-reload)
01:19JulioBarrosThanks!
01:48ibdknoxJulioBarros: noir has auto-reloading already
01:48ibdknoxyou don't need to add that middleware
01:49JulioBarrosibdknox Doesn't seem to work for me for the html files. Works for the clj files though. I'm trying to work on the design and have to keep restarting. I'm using enlive.
01:49JulioBarros.
01:50ibdknoxyeah, it won't reload html files
01:50ibdknoxI assume enlive keeps a cache or something
01:50ibdknoxthe reload middleware simply calls (require 'some-ns :reload) for all the clj files it can find
01:51JulioBarrosWhile you are here … could you help me with the syntax for adding a content type to the ring content type middleware?
01:51JulioBarrosI tried: (noir.server/add-middleware ct/wrap-content-type {:mime-types {"less" "text/css"}})
01:51JulioBarroswhere ct is (:use [ring.middleware.content-type :as ct] ) ..
01:52ibdknoxJulioBarros: not sure I understand what you're trying to do with that?
01:52ibdknoxJulioBarros: it should set the content types correctly for you
01:53JulioBarrosI'm trying set the content type for a .less file. It does not seem to understand that extension so it sets it to octet stream.
01:53ibdknoxI see
01:55ibdknoxit looks as though you've done the right thing
01:55ibdknoxbut I suspect the standard resources route is already setting it before it gets to you
01:55JulioBarrosI could edit the mime_type.clj file or follow the syntax for ring but was trying to figure it out for noir.
01:56JulioBarrosOkay cool. I can actually get around it in the html but I was trying to see if I understood the syntax/operation.
01:56JulioBarrosThanks again.
01:56ibdknoxyeah, you had it right :)
02:00fhdWhat is the correct name for an expression that can be evaluated? Like (+ 1 2) [1 2] 1? Not a sexp.
02:00scriptoras opposed to an expression that can't be evaluted?
02:00scriptor*evaluated
02:01fhdscriptor: Point taken
02:01fhdscriptor: So is "expression" the term?
02:01scriptorfhd: I think so
02:01ibdknoxJulioBarros: I'm about to push a fix in the latest noir so you can set that
02:02fhdscriptor: Hm, already named it that, but it felt wrong. Guess I'll stick with it then, thanks.
02:04amalloysexp applies too. it's a symbolic expression
02:09fhdamalloy: Even a literal numeric value?
02:10fhdamalloy: Just read it up, atoms are sexps too. Wonder why I was so sure they weren't...
02:10scriptorfhd: yes, still counts
02:10amalloy*shrug* just because it doesn't happen to have anything that clojure calls a symbol doesn't mean it's not in the class of symbolic expressions
02:11amalloy(as an aside, 1 is a symbol designating the numeric value 1)
02:11clojurebot'Sea, mhuise.
02:11amalloy~botsmack
02:11clojurebotOwww!
02:11scriptorwhat's that, Irish?
03:05spoon16I have a java api that has many methods that return Future<T>. Does Clojure treat Future objects special in anyway? Is there some idiomatic way of converting a Future into a memorized function or something?
03:05raekspoon16: clojure does not treat Future objects in any special way.
03:06raekspoon16: in a way, they are already like memoized functions (whose first execution has already been started)
03:06raekspoon16: just use .get to retrieve the result of the future
03:07spoon16yeah, that's what I'm doing… just wasn't sure if it was idiomatic or if clojure had some neat syntax for dealings with a Future
03:07spoon16thanks
03:09raekClojure only has special syntax for a very limited number of features
03:09raekthe Future objects that the 'future' function returs also implement IDeref, so that's why can do (deref ftr) or @ftr
03:09raek*why you can do
03:10raekspoon16: I wrote a bit about Executors and Futures a while ago: http://blog.raek.se/2011/01/24/executors-in-clojure/
03:12raekalso, calling .get on a future object will always return the same result. the value will only be calculated once per future object.
03:12raekwas something like that what you meant by "converting a Future into a memorized function"?
04:29octehttp://paste.lisp.org/display/127821
04:29octeis this 'idiomatic'?
04:30octewould a multimethod be better suited?
04:32Chousukeocte: seems fine to me.
04:33octe.13
04:33octethx
04:33octe:)
04:33tsdhHi
04:34tsdhIs there any good way to test if a macro explodes at expansion time?
04:34Chousukeexplodes?
04:34tsdhChousuke: Throws an IllegalArgumentException.
04:34clgvtsdh: macroexpand-1 ?
04:35spoon16just posted a concurrency question on SO, hoping to get some attention from the experts here: http://stackoverflow.com/questions/9325492/best-way-to-handle-future-exceptions-in-clojure
04:35tsdhI tried (deftest ... (is (thrown? IllegalArgumentException (macroexpand '(my-macro ..))))) but that fails...
04:36Chousukeocte: though it seems to me you have lots of intermediate strings there.
04:36tsdh... with expected: (thrown? IllegalArgumentException ...), actual: nil
04:37tsdhclgv: Well, strangely, my deftest passes in a REPL, but not when ant runs the test... (It's in the clojure test suite itself.)
04:38Chousukeocte: it might be a good idea to split that function in two parts, so that you get a seq of (seqs of) string fragments and then flatten and apply str on that.
04:39clgvtsdh: the 'is seems odd. isnt the 'thrown? sufficient?
04:39clgvtsdh: then there might be a runtime exception that wraps the IllegalArgumentException - that occurs frequently
04:40tsdhclgv: The is is correct, see http://clojure.github.com/clojure/clojure.test-api.html
04:40tsdhclgv: Hm, that might be...
04:41clgvtsdh: try to catch Throwable for debugging this
04:42tsdhclgv: Oh, wait. I think I just missed recompiling clojure after my last modification...
04:43tsdhclgv: If that doesn't repair things, I'll check again with Throwable.
04:43clgvtsdh: or just wrapp a try-catch and print that exception if any
04:45tsdhclgv: That the exception is thrown can be easily validated with (my-macro wrong args). It's just that it's hard to write a working testcase for compile time errors.
04:46tsdhclgv: Ok, recompiling didn't help. Now I run the tests again checking for only Throwable.
04:46tsdhclgv: Nope, still fails. :-(
04:47tsdhclgv: It seems that macroexpand (and eval) just don't work with the clojure.test machinery...
04:47clgvtsdh: one problem that remains is that macroexpand-1 only expands the outer macro. maybe the error does not happen there
04:48tsdhI use macroexpand, although it's the outest macro that throws on expansion.
04:48clgvtsdh: isnt that the same?
04:48clgv&(doc macroexpand)
04:48lazybot⇒ "([form]); Repeatedly calls macroexpand-1 on form until it no longer represents a macro form, then returns it. Note neither macroexpand-1 nor macroexpand expand macros in subforms."
04:48clgvah ok.
04:49clgvtsdh: well, still you only can expand the direct form that is passed. it might contain a form somewhere insde that throws the Exception at compile time
04:51tsdhclgv: http://pastebin.com/PRZ3DA6y
04:52clgvtsdh: whats the definition of 'are?
04:53tsdhclgv: http://pastebin.com/rGjU4q3E
04:53clgvtsdh: btw: midje supports that with tables
04:54samaaronocte: a multimethod would be useful if you wanted to offer people the opportunity to deal with new cases at a later date
04:54tsdhclgv: Well, I cannot add a midje dep to clojure itself. :-)
04:55clgvtsdh: but a dev-dep should be possible^^
04:56clgvtsdh: humm well. to my mind the macroexpansion should be fine there
04:57tsdhclgv: Yeah, it is totally correct. But one gets CLJ issue patches accepted better if they come with a test case. And my test case works in the repl, but not when doing "ant test" in clojure...
04:58clgvtsdh: but your testcase does use macroexpand-1 in the paste
04:59clgvtsdh: hm repl works fine.
04:59tsdhclgv: Yeah, just tried that before pasting. It doesn't work with either one of eval, macroexpand or macroexpand-1.
04:59tsdhclgv: See!
05:01clgvtsdh: well thats really odd. the only reason left would be deftest then.
05:02clgvyeah deftest doesnt work on repl either with that testcase
05:05clgvtsdh: I think I might have a clue
05:05clojurebotGabh mo leithscéal?
05:06clgvtsdh: I 'use clojure.test on repl and now get the error that 'are already belongs to clojue.test. maybe it isnt testing your 'are at all within a deftest?
05:08clgvtsdh: yeah it does not it seems
05:08clgvtsdh: I added 'println forms to both branches of the 'if
05:09clgvtsdh: you are using an old clojure.test to test your clojure.test patch?
05:13tsdhclgv: No, I modified clojure.test/are directly in clojure's git repo checkout with a repl running 1.4.0-beta1.
05:13tsdhclgv: Well, I'm pretty sure its some ant-runs-its-own-vm issue. See http://dev.clojure.org/jira/browse/CLJ-931
05:13clgvtsdh: humm very strange. but maybe somehow you are ending up testing the wrong one?
05:17clgvtsdh: the interesting question is, do you really need a test for that code?
05:18tsdhclgv: Dunno, but having a test case is newer a bad idea, right?
05:18clgvtsdh: except if the code is easy verifiable like that and you spent hours to get a test to run ;)
05:19clgvtsdh: one case is questionable: what if argv is empty?
05:21tsdhclgv: Hm, not sure. At least, there's no meaningful reason to use it that way.
05:22tsdhclgv: With my patch, (are [] true) throws IllegalArgumentException, but (are [] true 1) which is wrong in two ways throws a "divide by zero" ArithmeticException at compile time.
05:23clgvtsdh: yeah, the divide by zero will be odd^^
05:23tsdhHm, right...
05:24clgvand (are [] true) should be right but useless
05:33fooblya_monadhttp://sqlkorma.com/ -> :username "db" Is there really :username and not :user?
05:33dbushenko:user
05:37tsdhclgv: Ok, updated the patch.
05:52Kototamahi i have a 'Could not locate ring/util/servlet__init.class or ring/util/servlet.clj on classpath' error while deploying a WAR build by ring
05:52Kototamaany ideas?
05:53weavejesterYou probably want to do lein ring uberwar instead of lein ring war
05:53weavejesterThe latter doesn't include the libraries
05:54Kototamai did a lein ring uberwar already
05:54Kototamai use ring 0.5.4
05:55Kototamai have another project which use ring 0.4.5 without this problem, not sure if its linked
05:55weavejesterYou mean lein-ring 0.5.4
05:55Kototamayes
05:55weavejesterHm… Well, I haven't changed any of the war or uberwar stuff in a while...
05:55Kototamaand compojure 1.0.1
05:56weavejesterPerhaps check the war file to see if it contains the ring/util/servlet.clj
05:56weavejesterAnother thing you could try is clearing your lib and classes directories, then running ring deps; lein ring uberwar again
05:57Kototamawhat is the difference between lein deps and lein ring deps?
05:58weavejesterThere is no lein ring deps
05:58weavejesterOh
05:58weavejesterer, sorry
05:58weavejesterI meant: lein deps; lein ring uberwar
05:58Kototamai have WEB-INF/lib/ring-core-1.0.1.jar in the WAR, is ring/util supposed to be in this JAR?
05:58weavejesterNo, it's in ring-servlet-1.0.1.jar
05:59weavejesterThat should be in your lib directory as well…
05:59weavejesterAlthough… hm, are you using Leiningen 1.7.0?
06:00Kototamai'm using lein 1.6.2
06:00Kototamaring/util/ is missing in the WAR
06:00weavejesterIs ring-servlet-1.0.1.jar in your lib or lib/dev directories?
06:00Kototamawhat is the latest version of lein-ring?
06:01weavejester0.5.4, but I've been working on a version for Leiningen 1.7.0
06:02Kototamai have it in /lib/dev/ring-servlet-1.0.1.jar
06:02Kototamaoh but wait
06:02Kototamai also have :main ^{:skip-aot true}
06:02Kototamaand a main
06:02Kototamacould be an interference here?
06:02weavejesterI don't think so...
06:03Kototama(i wanted to build a self executable jetty server last time)
06:03weavejesterWhen you run "lein ring uberwar" the result doesn't contain ring-servlet?
06:03Kototamano it does not
06:04weavejesterHm… wait, this might be a bug.
06:05weavejesterTry explicitly adding [ring-servlet "1.0.1"] as a dependency in your project.clj file
06:05weavejesterNot a dev-dependency
06:05Kototamacommenting the :main does not solve the problem
06:05aperiodicdev dependencies do not go in uberjars
06:06Kototamausing 0.4.5 neither
06:06aperiodicif it's set as that, then switching it to the dependencies list should stick it in there
06:06weavejesterYeah. I think lein-ring needs an explicit non-dev dependency. It should really add that automatically to the project map it uses.
06:07Kototamalein deps does not seem happy with ring-servlet 1.0.1
06:07Kototamais it on clojars?
06:07weavejesterOh, sorry, ring/ring-servlet "1.0.1"
06:08aperiodicwell, if it's a dependency of a dependency it should work
06:09Kototamamaybe the problem is that i'm using compojure with clojure 1.3.0 but forget the :exclude directive?
06:10weavejesterKototama: No... I think it's because lein-ring uberwar needs ring-servlet in your lib, not just your lib/dev
06:10Kototamabut the other project works and ring-servlet is only in dev
06:11weavejesterKototama: Maybe I'm reading the code wrong then...
06:11weavejesterBut try adding it in as an explicit dependency [ring/ring-servlet "1.0.1"]
06:11Kototamamaybe i'm getting confused
06:12Kototamait gets added to the WAR
06:12Kototamai'm trying on the jetty server now
06:12Kototamait works
06:12weavejesterAh, awesome
06:12Kototamamany many many thanks :-)
06:13weavejesterCould you open an issue up on lein-ring so I don't forget to fix this?
06:13weavejesterThat would help a lot :)
06:13Kototamasure
06:13weavejesterThanks! Bye for now
06:13Kototamaso you mean it should be normally done automatically without specifying ring-servlet?
06:14weavejesterKototama: Yep
08:34octe~()
08:34clojurebotyour assessment smacks of bias, thus undermining your credibility further. (http://wondermark.com/560/)
08:34octe~(str :test)
08:34clojurebotExcuse me?
08:34octehm
08:34octe~,(str :test)
08:34clojurebotExcuse me?
08:45TimMcocte: try ,
08:45TimMctilde is the factoid trigger
08:46octeah
08:46octe,(name :a)
08:46clojurebot"a"
09:33beffbernardIf I want to type hint something as a byte array, how do I do that?
09:33stuartsierra^bytes the-array as of Clojure 1.3
09:33beffbernardstuartsierra: perfect, thanks
09:40ferdI'm using hugod's
09:40ferdzi to run tests using maven
09:41ferdNow, I need to read/write the "target" directory. Can anybody recommend a clean way to access it?
09:42hugodferd: read/write the target directory from what?
09:42ferdI tried *compile-path*, but is not properly set on that case
09:43hugodfrom a test?
09:43ferdhugod: I want to unpack some test data there, and shell-out to run some commands and assert on their outputs
09:43ferdI thought of using a "temp" directory, but I like all the test data/outputs to reside on target/
09:44ferdhugod: Oh, "from what", from Clojure unit tests
09:44hugodI can see why you might like that, but I wonder how to do that whithout making the tests dependent on zi
09:45ferd... well I'm only using zi for the zi:test goal
09:45hugodI guess *compile-path* could be set to target/classes
09:46ferdI though of setting some var with the "initScript"
09:46hugodsetting a property there would work
09:47ferdgood. I did try *compile-path*, but it reads "class" , while the CWD is the project's basedir, not target
09:47hugodI should probably fix *compile-path* anyway - feel free to raise an issue
09:48hugodusing a property set in initScript seems to be the cleanest solution to your requirement though
09:48clgvwhat is "zi"?
09:48hugodzi is a clojure plugin for maven
09:49hugod... written mainly in clojure
09:49ferdwish I could fix it myself quickly... but zi/test.clj has too much magic for me ;-)
09:49stuartsierrawhere is it?
09:49ferdhttps://github.com/pallet/zi
09:50stuartsierrainteresting, thanks
09:52ferdhugod: now... I thought it'd be easy to pass the target location to the initScript, but I think I back to the same problem
09:53hugodferd: something like (System/setProperty "somename" "${project.build.directory}")
09:55ferdwill it properly eval the "${project.build.directory}" ?
09:55hugodcertainly should
09:55ferdis zi "filtering" the clojure source ? Or who is resolving the "${}" ?
09:56hugodmaven evaluates it before passing the initScript to the test mojo
10:01tylergilliesanyone know how to move to a function declaration from a function call in emacs?
10:03tylergilliesn/m http://stackoverflow.com/questions/2374246/jump-to-function-definition-in-emacs-slime-leiningen-swank-clojure
10:06bsteuberwho's responsible for the conj2 videos on blip?
10:06bsteubercemerick's Bayesian Network talk is cut off in the middle
10:07redingerbsteuber: Yeah, it's a problem with the video that we are working with Confreaks on getting fixed
10:07stuartsierraAlan D. was working with confreaks - I pointed him to the mailing list thread on this issue.
10:07bsteuberok great
10:08bsteubercan't wait to see the 2nd part :)
10:08cemerickMy talk from the first conj got eaten by the camera; I smell a conspiracy ;-P
10:08stuartsierracemerick: my mic failed halfway through my first conj talk.
10:08stuartsierraI carried on without, but that video was worthless.
10:09cemerickI remember.
10:09stuartsierraI know
10:09stuartsierra:)
10:09redingercemerick: What until you see what we have planned for your third Conj talk
10:09stuartsierraHint - it involves Alex Warr and glitter.
10:12cemerickstuartsierra: surprised you hadn't gotten wind of zi
10:12stuartsierraI'm behind the times.
10:14cemerickIt looks very nice. I'd be knee-deep in it w/ hugod if I weren't neck-deep in REPL and lein stuff.
10:15stuartsierraI'm deliberately trying not to become any more knowledgeable about maven.
10:15cemerickA wise choice. The project is, AFAICT, broken w.r.t. organization and process.
10:16cemerickre: 3.0.4 taking ~ 9 months to get out to fix fatal known issues
10:16stuartsierrawow. That's unfortunate for such a critical piece of JVM tooling.
10:17cemerickIt's been an interesting year for open source organizational drama.
10:17cemerickthe couch snafu was particularly bizarre and unpleasant
10:18TimMcNew band name: "The Couch Snafu"
10:18jkdufairwhen i clojure-jack-in are all the .clj files compiled and available in my repl?
10:18jkdufairfrom my project?
10:18stuartsierracemerick: I just added my own fuel to the fire. http://clojure.com/blog/2012/02/17/clojure-governance.html
10:18hugodcemerick: the aether/sisu guys were very responsive
10:18cemerickjkdufair: I don't think so.
10:19cemerickhugod: yeah, I've no problem with aether
10:19jkdufaircemerick, thx. is there some way to easily compile the whole project via the repl?
10:20cemerickjkdufair: why? What are you trying to accomplish?
10:20stuartsierraIf you have one ns that requires/uses all the others, just compile that.
10:20cemerickhugod: it was the constant round-robin of "can we include this as-is, do we need to change package names, etc"
10:20cemerickpackage names!
10:20jkdufairstuartsierra, makes sense. thx
10:21cemerickstuartsierra: I didn't see a whole lot of fuel there.
10:21stuartsierraThen I succeeded. :)
10:21stuartsierraThe first draft was a lot more inflammatory. :)
10:21cemerick"not a lot"; there's still some, mind you ;-)
10:21hugod3.0.4 contains some nice fixes to sisu that improves the ability to write plugins from dynamic languages
10:21stuartsierracemerick: :)
10:22pyrstuartsierra: whenever we finally get to its cleanup
10:22pyrwe have a nice leiningen plugin
10:22pyrthat spits out poms that behave well with zi
10:22stuartsierracool
10:23pyrand which gets you 1:1 fucntionnality for a lot of lein things
10:24pyrlike ring
10:27hugodpyr: does the lein plugin just add the zi plugin to the pom and wire up the executions?
10:27pyryes
10:27pyrmostly
10:27hugodand add sonatype as a plugin repository, I guess
10:27pyrthen translates stuff like ring map to build wars
10:34hugodstuartsierra: I have no issue with clojure being conservative. At least for me, the frustration is in the stagnation of jira issues.
10:34stuartsierrabelieve me, it frustrates me too
10:34TimMcOh hey, it's Friday.
10:35TimMcPatch Complaints Day. :-P
10:37hugodstuartsierra: I have 5 open issues on clojure that I initiated. I have no idea about what needs to be done to help progress any of them.
10:38stuartsierrahugod: create more hours in the day/week/month/year
10:38TimMcstuartsierra: Could we just send caffeine instead?
10:38TimMcor chocolate?
10:38stuartsierraTimMc: Caffeine Buffer Overflow Exception
10:39TimMcOh, we had that happen in the kitchen here recently.
10:39stuartsierraIf there's a patch, and it works, someone will get to it eventually.
10:40TimMcSeriously, I'd send a box of Taza 87% Bolivian single-source chocolate if I thought it would help.
10:41hugodstuartsierra: if the jira process can't work due to time constraints, don't be surprised that it causes frustration
10:41stuartsierraRich and Stu H have been preoccupied with something else. You'll be hearing about it at Clojure/West.
10:42stuartsierrahugod: I'm not surprised. I want to get rid of JIRA. But I don't have an alternative that meets Rich's requirements for accountability.
10:42cemerickThe tool cannot be blamed for the process.
10:42hugodcemerick: here, here
10:43cemerickstuartsierra: see, you saved all your fuel for #clojure ;-)
10:43TimMcI think JIRA is the least of the concerns.
10:43stuartsierrayep
10:43stuartsierraI come here to work off steam.
10:47jcromartielike a gym
10:51jkdufairi thought it was a nice overview for someone who has only skirted the community for years. very succinct.
11:12jkdufairi'm building a math quiz for my kids. is this function to administer the quiz idiomatic? http://pastebin.com/CbXRUTQf
11:20pjstadigi'm not sure why rich and/or stu and/or clojure/core want to make themselves the bottleneck and then go off to work on a secret project
11:20pjstadigit's just asking people to gripe
11:21TimMcI'm annoyed enough already that CLJS is getting sch priority.
11:22clgvTimMc: "sch"?
11:22TimMc*such
11:23clgvah. I am no web-dew so I share that opinion of yours ;)
11:23clgv*web-dev
11:25tmciverjkdufair: I'm not sure (assoc {} :correct correct :total total) is idiomatic. why not just return a literal map?
11:26TimMcjkdufair: Do you have a Common Lisp background?
11:26jkdufairtmciver, thx. i saw that in some other code once and figured there mustve been a reason.
11:26jkdufairscheme
11:26jkdufairrusty
11:28tmciverI'm not sure that it's *not* idiomatic; I've seen it before too, but I would return a literal map in such situations myself.
11:28jcromartieI don't think there's any reason to do that.
11:28cemerickThere's no reason for it.
11:29jcromartieand if you really just hate curly braces, then use hash-map
11:29jcromartie:P
11:30jkdufairoh no, i rather love curly braces and square brackets. i loved scheme but like my childhood home, i have no plans to move back there
11:31jkdufairthank you all
11:43`fogus@pjstadig: You'll not gripe when you find out that the secret project was "do everything Paul wants done and quick" -- I'll be over to mow the grass next week.
11:46TimMcShhh, you're ruining the surprise!
11:47`foguswhoops
11:47dnolenin other news I'm looking forward to present ClojureScript at JSConf :D
11:49`fogusWhat angle will you take?
11:50dnolenstill pondering. But probably not overly technical ... more narrative
11:50clgvdnolen: do you present core.logic on CLojureJS?
11:55dnolenI have a personal theory why FP / Common Lisp / Scheme / etc continue to fail to attract folks (the false belief that technical superiority or purism matters) and I'm going to start from there.
11:56luciandnolen: because C, mostly
11:56dnolenlucian: ?
11:56lucianC is to blame for that, i'd think
11:57lucianlanguages that aren't at least similar to C don't get popular
11:58dnolenlucian: once upon a time the reasons may have technical but given that we all walk around with supercomputers in tiny aluminum cases - I think the reasons today are deeply social, nothing to do w/ syntax rather communication
12:00pjstadig`fogus: not really helpful :(
12:00luciandnolen: sure, it's the social bit i meant
12:00pjstadigespecially since i don't have a lawn ;)
12:00luciandnolen: people even hate python with a passion because it doesn't have C's syntax
12:01`fogusexcept for the people who love Python
12:01lucian`fogus: sure, but it's an extremely common argument against python, even though it's complete bunk
12:03tmciverFor those who haven't seen it, Paul Graham has a short essay on why Lisp isn't popular: http://www.paulgraham.com/iflisp.html
12:05rplevywhen using cucumber-jvm in clojure projects, do you think it makes sense for cucumber features directory to be at the top level, parallel to tests, or somewhere else? as a convention of how to organize a project.
12:05jlongsterdnolen: let me know if you need a sidekick to hold up visual aids or something
12:05dnolenlucian: I think it that misses the point. Alan Kay's frustration with Art of MetaObject Protocol is a better example of why Lisp isn't popular.
12:06dnolenjlongster: haha! :)
12:06rplevyI noticed lein-cuke isn't using the new cucumber-jvm that replaced cuke4duke and I'm updating it
12:08hiredmanhttps://github.com/cucumber/cucumber-jvm/pull/138 I rewrote the clojure backend for cucumber-jvm in clojure and included a lein plugin, but haven't had the time to give the pull request the attention it deserves
12:09rplevyhiredman: awesome
12:09TimMcWhy doesn't .invokePrim get used here? https://refheap.com/paste/766
12:10TimMc(This is an attempt at making String/valueOf a private "defn" that can handle primitive invocation.)
12:13zxcxzchrm, so im using la clojure, but the repl it lets you open is not one made via "lein repl", so all my dependencies are not available. this seems wrong. how do i use la clojure with leiningen properly?
12:13tmciverTimMc: Do you know how method dispatch is done in a reified object? I don't, but perhaps it's: "Grab the first method that matches on arity and perform boxing if necessary"?
12:14tmciverTimMc: first in the ordered defined, that is.
12:15TimMctmciver: I think the Clojure compiler makes this decision by inspecting the reified IFn and choosing the "best" invocation.
12:16TimMctmciver: I don't think it uses "first match" -- (do (def-statics System currentTimeMillis) (currentTimeMillis)) throws an arity exception, since there is only an .invokePrim and not an .invoke (other than the throwing default.)
12:17TimMc(Not defining a matching .invoke is a bug in def-statics, but it illustrates the problem nicely.)
12:17redingerpjstadig: Apparently step one is for `fogus to acquire you a lawn
12:17TimMcredinger: It will be delivered through his mail slot.
12:19tmciverTimMc: but the invoke defs come before the invokePrims... that sounds to me like the compiler is choosing the first matching method it encouters.
12:20TimMcAh, I see -- still doubtful, but I'll give it a try.
12:21TimMcnope
12:21pjstadigi'd be happy with seeing a patch for CLJ-855 applied
12:22tmciverworth a shot
12:22TimMcCertainly.
12:22TimMcThe compiler doesn't see these things in any particular order, of course.
12:22rplevyhiredman: it looks like aslakhellesoy just wanted to make sure the ant build works, and the other changes suggested seem like a separate pull request to me
12:30TimMcdnolen: Any ideas on how to get teh compiler to pick up .invokePrim on a reification of IFn?
12:31tutysarahi there... help needed on installing swank-clojure
12:31TimMcdnolen: I had figured that given an IFn reification of String/valueOf called "valueOf", (valueOf (long 5)) would get the invokePrim call for sure, but it actually gets .invoke instead.
12:32tutysarai am trying to install swank-clojure by - lein plugin install swank-clojure 1.4.0. Getting a message - [INFO] Unable to find resource 'swank-clojure:swank-clojure:jar:1.4.0' in repository central (http://repo1.maven.org/maven2)
12:32dnolenTimMc: .invokePrim requires that IFn that satisfies a particular primitive interface right? IFn$OLLLD (Object, long, long, long, double) or something like that I think.
12:33TimMcdnolen: Yep, and the reification has those.
12:33jkdufairdnolen, I agree with your assertion about fp failing to catch on because people are trying to sell it on its technical merits
12:33TimMcin this case ;; And now the prims:
12:33TimMc ;; interleaving IFn subinterfaces and invokePrim impls
12:33TimMc ~@(mapcat (fn [[^Class pcls, [sig]]]
12:33TimMc [(symbol (.getName pcls)) (invocation cls name sig)])
12:33TimMc prims)
12:33jkdufairi remember my first exposure to fp. friend showed me elisp
12:33TimMcagggh
12:34TimMcdnolen: In this case, clojure.lang.IFn$LO
12:34jkdufaireep. sorry for the interrupt
12:35mdeboard^c
12:41jkdufairanyway, if we show what clojure can actually do, it seems the syntax (or lack thereof) might not be such a barrier.
12:42perezdhey everyone, I'm having this exact problem (found this on google) with clojure 1.3 and the latest alpeh 0.2.1, any advice on how to fix?
12:42TimMcperezd: Is this the "t" thing?
12:42perezddon't think so? can't resolve enqueue
12:42perezdeven if I require lamina.core
12:45perezdoops: link https://gist.github.com/1450202
12:45TimMc"Unable to resolve symbol: t in this context"
12:45perezdoh thats not the exact error then
12:45TimMcSo weird.
12:45perezdfuck, it looked close
12:45perezdmine is unable to resolve enqueue
12:46perezdException in thread "main" java.lang.RuntimeException: Unable to resolve symbol: enqueue in this context
12:46TimMcgist your project.clj and ns block
12:46perezdmy code looks nearly identical
12:47perezdhttps://gist.github.com/488dd95e9444690c77fd
12:47perezdwow for whatever reason I can't c/p out of emacs very well
12:47perezdits all there, just scroll
12:47redingerpjstadig: Stu has just responded to your proposal for 855.
12:49dnolenTimMc: I don't think reify methods fns can take primitive args, doesn't matter if you implement the interface.
12:50TimMcdnolen: Presumably the reified object, if seen from Java-land, would actually take prim args?
12:51TimMc(if someone decided to call .invokePrim on it)
12:51pjstadigredinger: thx
12:53jaimefwhy does filter blowbup on a keyword in a vector?
12:54TimMcjaimef: It doesn't.
12:54hiredmancause the function you are filtering with does
12:54TimMcdnolen: Is it even possible to create an IFn in Clojure that can take advantage of invokePrim?
12:56dnolenTimMc: I think it should be but I haven't looked at it closely enough. now that I think about it, not sure why what you're doing doesn't work, but I don't have time to investigate
12:56beffbernardMight be of interest to some but you can get gcc/command line tools w/o xcode on macs for lion
12:56beffbernardhttp://kennethreitz.com/xcode-gcc-and-homebrew.html
12:57TimMcdnolen: OK, thanks for the sanity check. :-)
12:58beffbernardfyi, it's interesting because it's officially supported by apple
12:59JulioBarrosI'm new to clojure and trying to use some java classes in my project. I'm able to use one (set of) classes fine but when I try to use another I get a " java.lang.IllegalArgumentException: Unable to resolve classname:" exception. I've checked the spelling, capitalization and package names and they all seem fine. Has anybody seen this issue or have any ideas on what it could be? Thanks in advance.
12:59TimMctmciver: I'm going to poke around clojure.lang.Compiler to see if there's anything enlightening.
13:00jkdufairJulioBarros, sounds like a classpath issue. are you sure those other classes are in your classpath?
13:02TimMcperezd: gist your call to enqueue as well
13:02JulioBarrosyeah. it is some old abandoned code so no maven repo. I put it in src/java and added the path to my project.clj file. The class files are generated but I still get the error
13:02tmciverTimMc: earlier you told me that the compiler outputs bytecode for the particular method from the reified object that is to be called; but isn't that method dispatch done at runtime, but the jvm?
13:06jkdufairJulioBarros, are the class files ending up in lib?
13:06JulioBarrosYup.
13:06TimMctmciver: Not sure what you're asking.
13:08TimMcThe compiler is supposed to detect an opportunity to put invokePrim in the bytecode.
13:09tmciverTimMc: how can it know when to call invokePrim except at runtime? (I know little about bytecode or the clojure compiler, so...)
13:11tmciverTimMc: when is the bytecode generated? When you make the call on the repl?
13:11TimMcOoh, I may have found something.
13:11TimMcHold onto your butts.
13:12TimMchttps://github.com/clojure/clojure/blob/1.3.x/src/jvm/clojure/lang/Compiler.java#L3472
13:12TimMc^ giant page warning
13:12TimMcCompiler.java looks at the metadata on the var. We're not putting arglists in the var's meta!
13:13hagnawhere is ants.clj I'd like to see the code
13:14TimMcdnolen: Might have found it. We neglected to attach :arglists to the reified fn's var's meta.
13:14TimMc$google ants.clj
13:14lazybot[Clojure Ants demo (May 2009) - Toronto Lisp Users' Group] http://www.lisptoronto.org/past-meetings/2009-05-clojure-ants-demo
13:14dnolenTimMc: nice
13:14rplevyhiredman: I was curious and ran the "maven clean install" on the clojure-native branch, and the build did fail because of an error in ResourcesTest when running the tests
13:14TimMcYay for reading the source!
13:14dnolenTimMc: always good to peek at Compiler.java IME
13:15hagnalazybot: yeah I did that
13:20jkdufairis there some way to create a seq from a producer function that does not cache the result like lazy-seq does?
13:21jkdufairthe function i'm calling does random number generation
13:21mr_rmis anyone here using clj-ldap? or is there a more appropriate channel?
13:22perezdTimMc: https://gist.github.com/488dd95e9444690c77fd
13:22perezdjust updated it
13:22perezdwas following this: https://github.com/ztellman/aleph/wiki/HTTP
13:22xeqijkdufair: repeatedly?
13:23xeqi,(take 5 (repeatedly #(rand-int 11)))
13:23clojurebot(3 10 3 4 9)
13:24jkdufairsuper. thx
13:24jkdufairi tried that and must have misunderstood the compiler error
13:30TimMcperezd: lamina.core/enqueue
13:31perezdoh, i figured it was in the root ns
13:31perezdsince I didn't as it
13:31perezdwow none of the docs say that :(
13:32perezdbut that in fact fixed it it..
13:32perezdweire
13:32perezddoes use do something different?
13:32perezdvs require
13:33perezdapparently so :)
13:34seancorfieldcan some folks help this guy over some of the problems he's having understanding import and some basic Java interop: https://gist.github.com/1852795
13:35seancorfielduse = require + refer
13:36perezdah, good to know!
13:36seancorfieldrequire loads the library and makes it available, optionally with an alias
13:36seancorfieldrefer "imports" symbols into your namespace so you can use them without a prefix
13:36TimMcperezd: google 8thlight use require refer
13:36perezdthx
13:37seancorfieldlink http://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html
13:37perezdthis is great stuff
13:37TimMcperezd: and only use :use with :only :-)
13:37technomancyif only the official docs made half as much sense as trptcolin's article =)
13:37perezdgood mnemonic device
13:38seancorfieldi almost never use use these days, just require, at least in production code - until use really improves readability
13:38seancorfieldi've read colin's article dozens of times to get it to sink in...
13:38technomancy:use could go away in a future release if http://dev.clojure.org/jira/browse/CLJ-879 ever gets applied
13:39TimMcMan, what are you on about, just use load. :-P
13:42seancorfieldtechnomancy: that proposes (:require [... :refer [ .. ]]) ? that would be more sensible
13:42technomancyyup
13:43seancorfieldvoted
13:43technomancyeven got the verbal OK from rich himself
13:43technomancyotherwise I wouldn't have bothered with jira
13:48seancorfieldmaybe that's the Big Secret that Rich has been working on :)
13:51redingerseancorfield: Shhhh....
13:54TimMcThe big secret is that Clojure will be renamed to CL#
13:55ibdknoxTimMc: I have experience leading *# languages, perhaps I should offer my services ;)
13:55TimMcHaha, that's right!
13:56seancorfieldi saw that a lot of people think it's (more) work on Clojure in Clojure
13:56ibdknoxthat would be my blind guess
13:56seancorfieldthat doesn't seem very "big" to me, considering how far they got with ClojureScript - and how far away from JVM Clojure's current state that would be
13:57ibdknoxwell
13:57technomancyClojure is in a feature freeze right now; announcing a bunch of work on it doesn't make sense
13:57ibdknoxthe reason I don't think it's that is because the term "product" was used
13:57hiredmanwell, rich has mention working on a product
13:57ibdknoxand CinC is not a product
13:57hiredmanibdknox: right
13:57seancorfieldyup
13:57ibdknoxwhich makes me wonder if they're pre-empting my learning clojure initiative :p
13:58ibdknoxpreempting*
13:58ibdknoxseems like an obvious product for them to build
14:00franksRaynes: about your fs library... just found out that the way you use cwd may not be thread-safe...
14:00ibdknoxWhat other products would it make sense for relevance to build?
14:01franksRaynes: if i change the cwd with fs.core/chdir in two concurrent repl-sessions, cwd will be changed for both by the last one who set!
14:02jsabeaudryibdknox, Have you received any patch for jayq.util/map->js? Something along the lines of clj->js as shown at the bottom of this would be great http://techylinguist.com/posts/2012/01/23/clojurescript-getting-started/
14:02pjstadigibdknox: supposedly rich != relevance != clojure/core
14:03ibdknoxpjstadig: that's true, but he's working with StuH
14:03jsabeaudryibdknox, The problem with the current implementation is recursive maps {:icons {:primary "sutff"}}
14:03ibdknoxjsabeaudry: I'd be happy to take such a patch
14:03stuartsierraClojure/core is a subset of Relevance. Rich is not a member of that set.
14:04TimMcbut has allowed them use of the trademark :-)
14:04stuartsierrayes
14:04TimMc(I presume Clojure is trademarked...)
14:17septominanyone want to refer me for the clojure/west discount?
14:19ibdknoxseptomin: say you know Chris Granger :)
14:24seancorfieldone of my team just got a credit because someone registered with them as a "friend"... that was very nice!
14:27hey_luhi, can you help me with strange leiningen issues?
14:29ibdknoxseancorfield: haha. it doesn't do me any good really, but I want more people to go :)
14:31technomancyhey_lu: not without a few more details
14:31technomancy==)
14:31technomancywhoa
14:31ibdknoxalien smiley
14:32hey_lutechnomancy: i get this 'java.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot be cast to clojure.lang.Named'
14:32hey_lu(when running lein help with an uberjar generated by lein 1.7)
14:33seancorfieldsyntax error in project.clj?
14:33hey_luno, it says it's in help.clj:10
14:34ibdknoxprobably syntax error
14:34ibdknoxhey_lu: gist your project.clj?
14:35technomancyif it's when you run help then it's probably a plugin
14:35hey_luit's the one from leiningen itself (sorry, forgot to tell you that I build lein (git master))
14:35ibdknoxoh
14:36technomancyoh, are you interested in helping out with testing the new version?
14:36hey_luand when i run lein jar it fails with too many arguments to def (no changes)
14:36hey_luin part, I'm trying to speed it up by putting it into nailgun
14:36technomancyspeed up the task runs themselves?
14:37hey_luno, just the jvm startup time
14:37technomancyyou should help out the guys working on jark
14:38hey_lui.e. having what's that?
14:38technomancythey've already got some good infrastructure for this and I believe are working on running leiningen tasks in a daemon JVM
14:38technomancyhttp://icylisper.in/jark/
14:38hiredmanhey_lu: most likely that is a clojure version issue, you are trying to load clojure 1.3 code in clojure 1.2
14:38hiredman1.3 added the ability to give doc strings to dev
14:38hiredmandef
14:39hey_lutechnomancy: thanks, I'll look into that later
14:39technomancyhey_lu: yeah, it sounds like you might be using the shell script for lein 1.x with the clojure source for 2.x
14:40hey_luhiredman: I only have clojure 1.3
14:40technomancyhey_lu: lein 1.x has clojure 1.2 though
14:41hey_luoh, in the standalone jar?
14:41technomancyyeah
14:42hey_luoops, sorry. I think part of the problem was using the old script.
14:49hey_luwell, I got something else: "No implementation of method: :as-file of protocol: #'clojure.java.io/Coercions found for class: java.lang.Character"
14:50hey_luwhen running lein jar on another project
15:05jkdufairswing question - if i spawn a thread to remove all actionlisteners and add an actionlistener in my actionlistener am i damning myself to hell?
15:05jkdufairvia proxy, that is
15:12TimMcjkdufair: I think as long as you stay within the Swing threading model you should be fine.
15:12jkdufairok. guess i have to learn the swing threading model!
15:13amalloythe swing threading model is: "do everything in our thread"
15:13TimMcThere's not much to it, but you'll get really confused if you don't do it.
15:14jkdufairheh. i just found that out. so if i spawn a thread from "their thread", it would seem i'm causing trouble. or perhaps because i spawned it from there and it presumably has a handle i'm ok?
15:15TimMcI think you need to spawn it on their event loop. invokeLater, I think?
15:16ibdknoxthe joys of UI programming
15:16jkdufairTimMc, yes that makes total sense
15:17jkdufairnever wanted to be a swing expert but i guess if you're going to do clojure and want a desktop app, it's the only way to roll, right?
15:19trptcolinjkdufair: https://github.com/daveray/seesaw
15:19amalloyjkdufair: you can do whatever work you want on your own thread, so long as you don't touch any UI components therein
15:20redingertechnomancy: https://github.com/clojure/clojure/commit/f5bcf647d480c4eaa4e808ec41edb698ad66ec63
15:20hiredmanjcip has a bit about swing something like: there have been attempts made to make it multi thread, but these are always a nightmare
15:20hiredmanhuzzah!
15:20dakronehooray!
15:21trptcolinohsnap!
15:21jkdufairtrptcolin, thank you! The Horror of Swing seems to be about right
15:21amalloyso a common pattern (in java, anyway; i don't know about interop from clojure) would be to do something like (future (let [x (do-all-the-work)] (SwingUtilities/invokeLater #(change-ui-based-on x))))
15:23jkdufairamalloy, i may have to try that
15:26stuartsierraCLJ-879 has been applied and pushed.
15:29TimMcFantastic!
15:30ibdknoxclj-
15:30ibdknoxwhoops
15:30dnolennice
15:31ibdknoxsweet
15:40TimMcstuartsierra: If you want an easy one to screen, there's http://dev.clojure.org/jira/browse/CLJ-827 -- the second patch implements >>> the same way << and >> are already implemented.
15:40stuartsierraI'm busy.
15:40TimMc*nod*
15:40stuartsierraWhat we need is a way to search JIRA for tickets that have patches but have never been vetted / screened.
15:41stuartsierrafor example, I just found CLJ-866 through the mailing list, but it doesn't show up on any of our filters.
15:41pjstadigperhaps some of cemerick's work could help with that
15:41pjstadigor pull requests
15:42hiredmanclj-866 doesn't have a patch, does it?
15:42TimMcstuartsierra: 866 doesn't have a patch.
15:42stuartsierrasorry, meant 886
15:43hiredmanstuartsierra: I have a patches! filter
15:43hiredmanit shows up there
15:44hiredmanthe patches! filter shows open issues with patches, ordered by the last time they were updated with the oldest at the top
15:44stuartsierrahiredman: how do I get that filter in my JIRA?
15:45hiredmanclick the little arrow next to issues and in the drop down "manage filters"
15:45hiredmanand search
15:45cemerickpjstadig: yes, a proper workflow would do wonders.
15:51stuartsierrahiredman: found it, thanks
15:54TimMcI see a "Patch" field. Should I have altered that when I added a patch to a ticket?
15:56stuartsierrayes
15:56stuartsierraAlthough it's easy to miss, so I don't want to rely on it for searches.
15:57stuartsierrastuarthalloway: hi
16:24carllercheDoes anybody happen to be familiar w/ ragel (the state machine library)? I ask because I'm trying to build something similar but as a clojure macro and I am having a hard time figuring out how to reconcile ragel features w/ clojure's immutability.
16:25hiredmancarllerche: depending on what you care about you might end up with either a loop around a case or trampolining functions
16:26carllerchethe real problem comes w/ ragel offering a number of (very useful) features that let embedded actions modify the state of the machine...
16:26hiredman,(loop [state :start] (case state :start (recur :end) :end 1))
16:26hugodstuartsierra: are we supposed to set labels? I don't see any way of doing that
16:26clojurebot1
16:26stuartsierraI don't even know anymore.
16:29Apage43carllerche: as long as something outside the action isn't trying to read it I don't see that being too awful to reconcile
16:35teI have a map: {:foo ["bar", "baz"], :quz ["etc"]} I would like to print the key as a heading (println "!! " (key m)), and then print each item in each map entry's value, but for the last item in the collection, print a newline
16:36teI don't know how to get the last part to work.
16:37wyanhi, n00b here: trying to get a hello world in leiningen compile, any tips/resources recommended?
16:38stuartsierrawyan: you don't need to compile anything unless you want to distribute an app.
16:38ordnungswidrigte: you think iteratively, think i lists.
16:39wyanstuartsierra: can't actually get anything running either :(
16:39stuartsierrawyan: Can you run `lein repl`?
16:40amalloy&(let [m {:foo '[bar baz], :quz '[etc]}] (doseq [[k v] m] (apply println "!!" k v))) ; te
16:40lazybot⇒ !! :foo bar baz !! :quz etc nil
16:40TimMcwyan: What does `lein version` say?
16:41wyanstuartsierra: it runs, but it throws (Don't know how to create ISeq from: clojure.lang.Keyword)
16:41stuartsierrawyan: you have a syntax error in your clojure source code somewhere
16:41wyanTimMc: Leiningen 1.7.0 on Java 1.6.0_29 Java HotSpot(TM) 64-Bit Server VM
16:42TimMcwyan: post your .clj to refheap.com, let's see
16:43wyanTimMc: https://refheap.com/paste/776
16:43ordnungswidrigis there sth. more elegant than (update in map-of-vectors [key] #(conj (or % []) value)) ?
16:44ordnungswidrigplain conj doesn't work if I want to append to the end.
16:44wyanTimMc: darn, got it, wrong contrib version * feeling stupid *
16:45TimMcwyan: Ah! I didn't even notice that.
16:45amalloy(fnil conj []) value
16:45TimMcwyan: Your best is actually to drop monolithic contrib and use clojure 1.3.0
16:45ordnungswidrigamalloy: nice
16:45TimMc*best bet
16:45wyanTimMc: I know, but the project intends to use incanter, and there are apparently some quirks....
16:45teamalloy: specifically i am trying to print something different when the item in the coll is the last item. so in the above, baz and qux would print differently
16:45TimMcThat's a shame, didn't know that.
16:46wyanTimMc: maybe it's worth just jumping in, though
16:46wyanstuartsierra, TimMc: thanks anyway :)
16:46Bronsaoh god. 4clojure #53 was hard
16:46amalloymhm...did you try actually running that code? it adds a newline for just the last one
16:47stuartsierrawyan: you're welcome. good luck!
16:49ordnungswidrig&(update-in {} [:a] (fnil conj []) 3)
16:49lazybot⇒ {:a [3]}
16:50ordnungswidrigamalloy: thanks, nice.
16:50teamalloy: okay, then i want two newlines specifically only when printing baz and etc in your above examples
16:59TimMcI'd like to see what's going on inside Compiler.java when I run some specific code. Any tips for attaching a debugger?
16:59TimMcE.g. can CDT help me here?
17:00technomancyTimMc: cdt can step into java code, but I don't know if it works on the compiler
17:00technomancymight as well try it though
17:00TimMcI don't actually have CDT set up yet -- are there any other approaches you'd recommend if I run out of steam on that?
17:01technomancycdt is supposed to be pretty easy with swank 1.4.0
17:04TimMcOK, I'll definitely check it out.
17:05jcrossley3can anyone tell me how i might turn the string "seconds" into java.util.concurrent.TimeUnit/SECONDS? i tried using (symbol) but that just left me with a... um, symbol. :)
17:06jcrossley3and by "turn" i mean "map", of course
17:06cemerickjcrossley3: All enums provide .values() and .valueOf static methods
17:06cemerick,(java.util.concurrent.TimeUnit/valueOf "SECONDS")
17:07clojurebot#< SECONDS>
17:07jcrossley3cemerick: perfect, thanks!
17:10teI have a map: {:foo ["bar", "baz"], :quz ["etc"]} I would like to print the key as a heading (println "!! " (key m)), and then print all of its values, but for the last item in the collection i want to print 2 newlines
17:11te!! foo\n- bar\n- baz\n\n!! quz\n- etc\n\n
17:12carllercheApage43: hiredman This is the kind of API i've been playing w/ so far (re state machine generator) https://gist.github.com/bfedfcc1e31a905bcbec
17:13photexhi folks, is there a cheatsheet or some central documentation for clojurescript that I'm missing?
17:15photexI've had a bit more success noodling around with scriptjure than I have with cljs haha ;)
17:15tehow can i determine which element is the last element while in a doseq?
17:15photexnot sure what is miswired in my brain
17:15emezeskephotex: Are you looking for "getting started" docs, or more thorough library-doc type stuff?
17:16photexI've started with cljsbuild
17:16photexand I have my little alert running when the page loads... so ok, things are in motion... but
17:17photexI'm looking at information about javascript libraries that are not written in clojurescript
17:17photexand having a hard time translating anything
17:17emezeskephotex: Ah, you'll want to read this then: http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html
17:17photexawesome, thanks for the link
17:18emezeskeAlso, depending on what you are trying to do, I recommend everything ibdknox does: crate, fetch, jayq, etc
17:19pbostromI ran into a seemingly simple Clojurescript issue; the following call does nothing if I execute from compiled cljs, but does exactly what I think it should do if I run from a browser-connected repl: (map #(js/alert %) ["a" "b"])
17:19emezeskepbostrom: Perhaps a laziness issue?
17:20emezeskepbostrom: (doseq [x ["a" "b"] (js/alert x))
17:20emezeskepbostrom: 'map returns a lazy sequence, so the function is not applied until you actually use the result from the map call
17:21emezeskepbostrom: 'doseq forces all evaluations, presumably for side-effects (like js/alert)
17:21emezeskepbostrom: It probably works in the REPL because when it prints the result of the command, it has to realize the full lazy seq
17:22dnolenphotex: it's still super early days for ClojureScript, so still little documentation, and few examples
17:23pbostromemezeske: thanks, your snippet worked, although I'm gonna need to re-read what you said a few times before it sinks in
17:23photexyeah, I just wanted to dip my toes in the water. Scriptjure is actually a pretty wonderful way to generate js otherwise :)
17:25emezeskepbostrom: Try this in your REPL: (do (map #(js/alert %) ["a" "b"]) nil). The result of that expression is "nil", and the REPL won't have to realize the (map ...), so I think you'll find that the alerts won't happen.
17:27photexI also know very little about D3 which is what I'm attempting to mess around with. Setting my self up for a world of hurt.
17:28photexthought it would be a lot of fun to graph the start and finish times of a bunch of jobs from the render farm at work
17:28photexwhich were making connections to our asset management database
17:28pbostromemezeske: that makes sense
17:28photexfigured it might be nice for the crew to see our concurrent workload visually
17:30emezeskephotex: I guess I don't understand the point of something like scriptjure
17:30emezeskephotex: Why not just write javascript?
17:31photexoh for that, I was just outputting js inline, and it was just easier to directly include data in the document that way
17:32photexsince I'm not clojurescripting very well at the moment, I haven't tried fetch yet
17:32emezeskeAh, I see, just a little inline blurb of javascript
17:32photex(var finished (clj (count finished-jobs)))
17:33photexfor example; right
17:33emezeskeI was thinking you were writing client-side scripts in that
17:33photexnope
17:33emezeskeI was like, "there's already a tool for writing javascript: it's called writing javascript"
17:33emezeske^_^
17:33photexhaha
17:34hiredmanwell, it's not a good tool
17:34pbostromin any case, I'm finding that my cljs code is pretty heavy on the side effects; is that just the nature of doing stuff like DOM manipulation, or do I need to approach things a bit different?
17:35emezeskehiredman: Well, certainly writing javascript in javascript makes more sense than writing it in scriptjure, for an application.
17:36emezeskehiredman: CLJS is a different story; it's not for writing javascript. It's for writing clojure that executes in a browser.
17:36hiredmanemezeske: well, scriptjure doesn't even have a license so it's not like you'd want to use it in an application anyway
17:36emezeskehiredman: haha, touche!
17:36hiredman(or didn't last I checked which was a few years ago)
17:36hiredmanwell, maybe one and a half or something
17:37emezeskethat's like 5 years in clojure time
17:43ibdknoxpbostrom: the DOM is one big side-effect, not really any way around that
17:46brehautibdknox: document fragments as transient dom fragments, treat the dom as a ref :P
17:48ibdknox:p
17:49pbostromibdknox: quick fetch question - is there an easy way to check the status of the response returned by the remote?
17:49ibdknoxI wondered if someone was going to build up a structure of the dom initially, and then try to make some magical thing that worked over it with zippers and "committed changes"
17:50ibdknoxpbostrom: intentionally no, it's supposed to just be a "function call" :)
17:50ibdknoxbrehaut: ^ would be so inefficient though
17:50ibdknoxpbostrom: if you want to do xhr, you can do that with fetch too
17:51anieroemezeske: clojurescript isn't for writing applications for the browser?
17:52semperostrying to use leiningen plugin lein-newnew; followed the Usage section on its README, but not seeing any difference when using 'lein new'; anyone have experience using it?
17:52TimMcdnolen: OK, turns out that since :arglists is attached to the var, not the fn, hinting is impossible in combination with HOFs.
17:52ibdknoxsemperos: you have to give it a template after that, otherwise it's the same
17:53brehautibdknox: of course! there was a reason for the colon pea
17:53emezeskeaniero: Isn't that exactly what I said?
17:53semperostried 'lein new default foo' and still get the "old" template
17:53semperos'lein templates' shows default, template and plugin options available
17:53ibdknoxtry lein new plugin hey
17:53teBest way to take a map: {:a [1 2 3], :b [1 2]} and return a seq of new maps: ({:a 1} {:a 2} {:a 3} {:b 1 :b 2}) ?
17:53TimMcdnolen: Compiler.java only use .invokePrim when both 1) the call position is occupied by a Var, and 2) the first matching arity it finds in :arglists is prim-invocable.
17:54anieroemezeske: well, i was hoping it *was* :)
17:54ibdknoxTimMc: I wish we put the metadata on the fn :(
17:54semperosibdknox: I'm checking if README.md gets produced, as that seems common to all the new templates, and I'm getting just README when I run that
17:54ibdknoxweird
17:55semperosthat's why I'm here :-)
17:55ibdknoxsemperos: you'd have to ask Raynes
17:55semperosyeah
17:55semperosno biggy, I can wait for 2.0
17:55TimMcibdknox: But then the compiler would have access to that data, would it? In ((identity hinted-fn) 7), all it knows is that there's some fn-producing expr.
17:55TimMc*wouldn't
17:55emezeskeaniero: My point was: CLJS is not a tool for "writing javascript". It's a tool for writing browser apps. Whereas something like Scripjure is just a tool for "writing javascript".
17:55ibdknoxTimMc: is there any reason both couldn't have it?
17:55dnolenTimMc: seems related the thread on the ML about anonymous primitives fn not being supported.
17:56TimMcNow I wish I subscribed to the ML.
17:56anieroemezeske: ah ok, got it
17:57emezeskeaniero: Kind of confusing to articulate that how I want :)
17:57anieroemezeske: what i'm looking for is some kind of example of *how* to build an app with cljs
17:57te&(let [m {:a [1 2]}, k (apply key m),vs (apply val m)] (for [v vs] (hash-map k v)))
17:57lazybot⇒ ({:a 1} {:a 2})
17:58teIs that a reasonable solution?
17:58tethe (apply val m) thing seems weird
17:58ibdknoxaniero: currently ClojureScript One is the best example
17:58te&(let [m {:a [1 2]}, k (val k)] [m, k])
17:58lazybotjava.lang.RuntimeException: Unable to resolve symbol: k in this context
17:58te&(let [m {:a [1 2]}, k (val m)] [m, k])
17:58lazybotjava.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot be cast to java.util.Map$Entry
17:58te:\
17:59emezeskeaniero: Yeah, unfortunately there's not a lot of those out there ;(
17:59ibdknoxunfortunately it mixes everything together - libraries, structure, utils
17:59emezeskeaniero: I have a good example, but it is closed-source :( :( :(
18:00anieroibdknox: ah, how do you mean? looks like it wraps up some of the google closure libs
18:01anieroibdknox: i suppose just as much of this could be done with jayq... hmm
18:01ibdknoxaniero: it's in kind of a weird example, in the sense that it uses many things that would themselves seemingly be libraries, but suggests they aren't
18:02jkkramer,(let [m {:a [1 2 3], :b [1 2]}] (for [[k vs] m, v vs] {k v}))
18:02clojurebot({:a 1} {:a 2} {:a 3} {:b 1} {:b 2})
18:02ibdknoxs/example/state
18:02jkkramerte: ^
18:02tejkkramer: thanks
18:02anieroibdknox: e.g. the event dispatching stuff?
18:02ibdknoxaniero: among other things. It doesn't provide you a clean way to then go off and build your own project that isn't exactly like that one
18:03anieroibdknox: yeah, definitely. this is all very strange coming from, say, backbone.js
18:03ibdknoxthat starting point just doesn't exist because cljs is too new :)
18:03dnolenand in flux
18:03ibdknoxindeed
18:03anieroguess i'm in at the ground floor then. someone's gotta beat their head against the wall and figure some of this out, right?
18:04ibdknoxI'll try and help out with creating some of that soon, but it's just not in the cards right this moment
18:04ibdknoxthe best I could do was release a bit of my work there
18:04dnolenaniero: as technomancy said ClojureScript feels like Clojure in 2008
18:04anieroi've got a long weekend coming up, i'll see what i can figure out with some of your libs
18:04anierodnolen: yep
18:04dnolenyou kind of have to be a sicko to use it. but it's so fun.
18:05ibdknoxdnolen: I tried running some of my stuff on an iPad yesterday. It was sad :(
18:05dnolenibdknox: too slow right?
18:05ibdknoxway too slow
18:05anierocljs ends up being slow?
18:05ibdknoxaniero: depends on how you use it
18:05ibdknoxaniero: If you're not rendering with it, it's fine
18:06dnolenibdknox: yeah iPad is already a 10X perf hit, and CLJS is generally 10X slower, most of it's surmountable but someone's got to do the work.
18:06anieroibdknox: rendering, meaning ports of hiccup and the like?
18:06ibdknoxaniero: I was doing canvas stuff
18:06ibdknoxno
18:06ibdknoxthat stuff is fine
18:06anieroohh canvas
18:07ibdknoxdnolen: yeah, who's helping out with cljs these days?
18:07dnolena bunch of folks doing small patches here and there - but someone needs to the multi arity fn optimization pass
18:07teokay, new question... clojure.pprint/print-table, how does it work? I pass it something like (print-table (:a :b) ({:a 1} {:a 2} {:b 1} {:b 3}))
18:07dnolenthat'll be a giant performance boost
18:08team i using that right?
18:08pbostromI'll chime in and say that ibdknox's libs were a good starting point for me, CljsOne had too much going on
18:09teit works, but the problem is that the columns wont print on the same row
18:09ibdknoxwish I had more time to work on them
18:09ibdknoxthere's very cool stuff hiding in there
18:10hiredmante: a. use doric b. no you need to pass in maps
18:10dnolenibdknox: but even today you can write write fast CLJS. You just have to stick with non-multi-arity fns, loop/recur, mutable arrays in your performance critical code.
18:10hiredmante: https://github.com/joegallo/doric
18:10ibdknoxdnolen: I did
18:10hiredmante: maps like {:a 1 :b 1} {:a 2 :b 2}
18:11dnolenibdknox: huh, that's I don't suppose you have a private gist of that code anywhere?
18:11ibdknoxsome of it is public :)
18:11dnolenibdknox: link?
18:12ibdknoxdnolen: https://github.com/ibdknox/monet/blob/master/src/monet/canvas.cljs#L124
18:12dnolenibdknox: you're using map destructuring, very slow
18:13ibdknoxI see
18:13anierodnolen: slow due to limitations of the cljs compiler?
18:13ibdknoxdnolen: is explicit (get ..) faster?
18:13dnolenaniero: no, because "get" go through several layers of multi-arity fns
18:14hiredmannth?
18:14dnolenget won't be fast until we stop using arguments for multi-arity fns
18:14ibdknoxto do that you were saying we needed to output arity-named functions, right?
18:14ibdknoxor that was the proposal
18:15hiredmanthat sounds kind of horrible
18:15dnolenibdknox: it's already done that way, but they aren't emitted top level where they can be targeted by the compiler
18:15dnolenhiredman: not sure why, multi-arity fns are not possible in JS with hacking around with arguments - which unoptimizable by JS engines
18:16dnolenwithout
18:16hiredmandnolen: I guess I was thinking about anonymous functions
18:17dnolenhiredman: good point, we probably can't make those fast
18:17dnolenbut that's not the bottle neck right really.
18:17hiredmanwhich generally are not multiarity anyway
18:18ibdknoxhiredman: yeah, I've never written one that's multiairty
18:18technomancydo varargs count?
18:19hiredmanyes and no I guess
18:19hiredmandepends, but I doubt what dnolen is talking about would cover varargs
18:19ibdknoxit can't
18:20ibdknoxunfortunately I do write lots of vararg functions
18:20ibdknoxprimarily because of optional arguments
18:21ibdknoxwhich "just work" in JS
18:21dnolenas far as i can tell varargs are just another arity. a fiction of the compiler.
18:22hiredmanfor clojure?
18:22hiredmanthe vararg arity for clojure does java varargs and wraps the results in a seq and calls a non vararg arity I think
18:23dnolenhiredman: so I think we can basically the same thing in JS since JS is always varargs
18:24hiredmanoh, interesting
18:24hiredmanwell, you can't because you need to do the seq boxing, you'll have to call arguments() somewhere
18:25ibdknoxunless the compiler rewrites the code
18:26hiredmanjavascript :(
18:26dnolenhiredman: yes we might not be able to avoid checking arguments in the case of varargs, but I don't think that's really a big deal - people use that for expressivity not perf anyhow.
18:27ibdknoxif it knows the available arities, and finds one greater than the available with varargs, it could just write it out
18:27ibdknoxcompiler would have to get a lot smarter though :)
18:27hiredmanibdknox: if only we have a sufficently smart compiler
18:27ibdknoxyup
18:27hiredmanI still want the clojure compile to rewrite letfns as static methods
18:33dnolenibdknox: glanced a bit more at your code, if you avoid the CLJS datatypes, rest args & destructuring, your canvas code should as fast or nearly as fast as JS.
18:33dnolenthese are the same things to avoid in perf sensitive CLJ code as well
18:35ibdknoxI don't mind doing that here, since it's write once, but I think those limitations make doing anything with canvas pretty unrealistic :(
18:35dnolenibdknox: how so?
18:36ibdknoxthe code a user would write update position and check for collisions and stuff would also have to do that
18:36ibdknoxand this array of keys thing is gross
18:36ibdknoxit's way more verbose than the JS would be with no actual value from using CLJS
18:36dnolenibdknox: define protocols for that, that user will end up writing code you can call into relative efficiently.
18:36ibdknoxwhich is fine
18:38dnolenthe overhead for protocol dispatch is surprisingly small and I expect it will get smaller as JS engines improve
18:38ibdknoxI can't protocol someone's update logic
18:38ibdknoxI can protocol the update call easy enough
18:39ibdknoxbut someone using filter over a seq in their update and it's too slow :p
18:40dnolenibdknox: ha, true - I don't see anyway to solve that problem. But performance is easy to get wrong in plain JS as well I see it all the time.
18:41ibdknoxdnolen: certainly true, but even wrong is usually fast enough still :) In this case doing the idiomatic thing is far too slow
18:41ibdknoxbut like I said, that's really only canvas, which *shrug*
18:42ibdknoxthe potential alternative is to write superfast versions of things in a JS library that gets used from CLJS
18:43ibdknoxI started some work on much faster versions of maps and a fast (map ..) and (reduce ..)
18:43ibdknoxmaybe I can make that work
18:44dnolenibdknox: perhaps, I personally don't have a problem writing slightly different code when performance matters. I think it's better just to write a tutorial about this stuff to show people what to avoid.
18:44dnolenibdknox: jsperf.com is proof that people make a lots of wrong assumptions about js performance all the time.
18:46hiredmandnolen: the code is not slightly different, and while clojure has datatypes and protocols, they are rare in actual clojure code (I know core.logic uses them a lot for performance)
18:47ibdknoxI guess the only problem I see there is that performant CLJS is worse than just writing the JS
18:47hiredmanusing them for every level in cljs code instead of just at the bottom is kind of yetch
18:48dnolenhiredman: true, I guess I mess around with this stuff more than most people. One my first non-trivial Clojure projects was trying to get acceptable perf out of a flocking animation w/ clj-processing
18:48hiredmansure, and when you are trying to squeeze out peformance you end up at protocols and datatypes
18:48clj_newbso either Clojure or Java is lying to me; and I am not happy when people lie to me. Is there a way to show all _static_ members of package foo.bar.Cat ? I'm pretty darn sure (by staring at the java source) that there is a static function foo.bar.Cat/bark ... but Clojure claims it does not exist
18:48hiredmanwell, you can
18:49clj_newbi.e. I want some magic function so that (magic 'foo.bar.Cat) will list out all static members of foo.bar.Cat
18:49hiredmanI have a macro somewhere that looks sort of like definining multimethods but ends up generating a big cond at the "call" site
18:51clj_newb? ? ?
18:51clj_newbif I have asked a question that has baffled the clojure wizards, I feel it's time I upgrade to clj_apprentice
18:51clj_newbor clj_sorceror
18:51ibdknoxclj_newb: clojure.reflection/reflect
18:52hiredmanhttps://gist.github.com/1856326
18:54hiredmanhttps://gist.github.com/1856336
18:54clj_newbibdknox: is this an external package? (require 'cljojure.reflection) is giving me errors
18:54ibdknoxclj_newb: are you using 1.3?
18:54hiredman(none of that is actually in chesire)
18:55clj_newb1.3.0
18:55dnolenibdknox: I think it'll be very rare that fast CLJS code will be more troublesome to write than JS, https://gist.github.com/1856319
18:56dnolenibdknox: in JS you actually can't abstract away the fact two of those functions are identical except for a flipped argument call to A
18:57ibdknoxdnolen: but I can use something like _ (which is "fast enough") to get back much better semantics than doing stuff like that
18:57dnolenibdknox: ?
18:58ibdknoxclj_newb: ah it's clojure.reflect
18:58ibdknoxdnolen: underscore.js
18:58ibdknoxdnolen: then I get my filter/map/reduce/etc that I *want* to use back
18:58ibdknoxif I wrote that canvas code in JS, it would be much simpler.
18:59clj_newb, clojure.reflect
18:59clojurebot#<CompilerException java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.reflect, compiling:(NO_SOURCE_PATH:0)>
18:59dnolenibdknox: ? only in the simplest case right, because filter/map/reduce in underscore.js are lazy, you can't really combine them in interesting ways.
18:59dnolenibdknox: I would never use _ in performance sensitive code anyhow.
18:59ibdknoxdnolen: I was able to write a pretty complex game with it :)
19:00clj_newbibdknox: it works now; thanks!
19:00dnolenibdknox: I certainly don't doubt that. I definitely think we'll be able to get "fast enough" out of CLJS - there so few optimizations present.
19:01dnolenbut for the fastest code, I'll put my money on macros over arrays anyway :)
19:01dnolenany day
19:01ibdknoxdnolen: Hopefully I'll get some time to help :)
19:01dnolen:)
19:12robinkraftnewb question about floats: does the .0 in 2.0 do something special, as compared to the .1 in 2.1? here's why I ask:
19:12robinkraft'(== (float 2.0) 2.0)
19:12robinkraft,(== (float 2.0) 2.0)
19:12clojurebottrue
19:12robinkraft,(== (float 2.1) 2.1)
19:12clojurebotfalse
19:12robinkraft(pulling hair out)
19:12technomancy,(= (float 2.1) 2.1)
19:12clojurebotfalse
19:12emezeskerobinkraft: http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm
19:12technomancyhum
19:13emezeskerobinkraft: Comparing floats for equality, in general, is a bad idea
19:13technomancy,(= (double 2.1) 2.1)
19:13clojurebottrue
19:13technomancybut yeah, floats are inexact by definition
19:13hiredmanneed to get clojurebot on a 1.4 alpha
19:14IceD^technomancy, hey
19:14robinkraftI'm ok with floats being inexact and whatnot, but the 2.0 vs. 2.1 dichotomy has caused me to go slightly crazy these last few days
19:14IceD^technomancy, can we please have clojure-jack-in-standalone
19:14robinkraftemezeske: thanks, am educating myself
19:15hiredmanrobinkraft: that might just be a bug in the compiler intrinsics
19:15technomancyIceD^: I'd merge a patch for that, sure
19:15IceD^jack-in is awesome, so I don't want to resort to launching swank manually if I just want to play (or having empty play project)
19:15IceD^ahh, nice )
19:16IceD^will try to implement than
19:16technomancyIceD^: you could just jack into a checkout of swank
19:16technomancythat's what I do
19:16technomancyeither way
19:17robinkraftemezeske: the author of that article has since deprecated it, and suggests this series written just weeks ago: http://randomascii.wordpress.com/category/floating-point/
19:17IceD^more like M-x clojure-jack-in-standalone C-m 1.2.1
19:17IceD^etc :)
19:17amalloyrobinkraft: 2.1 can't be represented exactly in binary, whereas 2.0 can. so rounding off to float-exactness makes no difference for 2.0, but it changes 2.1
19:17emezeskerobinkraft: ah, cool :)
19:18Dotanhey guys. if anyone familiar with storm, can it be used for gruntwork such as monitoring systems?
19:18robinkraftamalloy: thanks.
19:23robinkrafthiredman: the first table is illumanting on 2.0 vs. 2.1 http://randomascii.wordpress.com/2012/01/11/tricks-with-the-floating-point-format/
19:23robinkraftamalloy was right on
19:24robinkraftedit: illuminating
19:24TimMcIf I had a nickel for every time someone said that...
19:24amalloyTimMc: a nickel for every time someone says illumanting? i think you'd have about a nickel
19:32hiredman,*clojure-version*
19:32clojurebot{:interim true, :major 1, :minor 4, :incremental 0, :qualifier "master"}
19:41TimMc":interim true"?
19:42TimMcIs that -alpha?
19:42TimMc,(clojure-version)
19:42clojurebot"1.4.0-master-SNAPSHOT"
19:42TimMcHah, they're using SNAPSHOT before a release.
19:45bitrotHi guys, I'm seeing some strange behavior with leiningen -- if I run 'lein repl' from within a project directory, I don't get any output, but if I'm not within a project directory, it works fine.
19:45bitrot(Leiningen 1.7.0 on Java 1.7.0-internal OpenJDK Client VM)
19:53bitrotOddly enough, sometimes starting lein with PWD of a project directory *does* print the "REPL started" line, but I won't get a prompt.
20:00srcererAnyone need a buddy for Clojure/West signup?
20:31TimMctmciver, dnolen: Well, there's the writeup on reify and def-statics: http://www.brainonfire.net/blog/hof-vs-prim-invoke-clojure/ -- it's pretty much a brain dump on invokePrim, hinting, and HOFs.
20:35muhooif the command to connect to slime is clojure-jack-in, i shudder to think what would be the command to DISconnect from it.
20:35TimMcjack-out?
20:36muhooheh
20:36TimMc<- pretends obtuseness
20:42dnolenTimMc: now that I think about it your solution seems convluted
20:42dnolenTimMc: why can't you just emit a primitive wrapper fn?
20:42dnolen(defn valueFn [^double x] (String/valueOf x))
20:56picklesevening all
20:56picklesmacro question
20:57picklescan a macro create multiple definitions? e.g. can I create a (def <var> ...) and also a (defn do-something-to-<var> [..] ...) in a single macro?
20:57picklessome experimentation did not yield encouraging results...
20:57dnolenpickles: yes, but you need to wrap in a do expression
20:58picklesaaahh
20:58picklesi c
20:58picklesthanks!
20:58dnolennp
21:13TimMcdnolen: String/valueOf has many overloads, one fn won't cut it
21:13TimMcmany overloads for the same arity, too
21:36picklesdnolen: doesn't seem to be working well :(
21:36picklesit's only getting the last definition of the do
21:45picklesooo i c (yay google) you have to do `(do (def...) ...) not (do `(def ...) ...)
23:48aphyrWhat's the best way to test for... listy things, i.e. vectors, lists, sets--but not strings?
23:49lynaghk``aphyr: coll?
23:49hiredmansets are listy things now?
23:49aphyrEnumerable, I suppose.
23:50TimMcaphyr: http://www.brainonfire.net/files/seqs-and-colls/main.html -- which parts of the Venn diagram do you want?
23:50aphyrcoll? is close but also applies to maps.
23:50lynaghk``oh, you don't want maps?
23:51aphyrIt'd be OK. I don't *expect* them
23:51lynaghk``nice writeup TimMc.
23:52aphyr(foo [a b c])
23:52aphyr(foo a)
23:52lynaghk``You can always say #(and (coll? %) (not (map? %)))
23:52aphyr(foo '(a b c))
23:52aphyrI'd like to support all of these cleanly.
23:52aphyrMaybe (flatten [args]) is what I really want.
23:52TimMc~flatten
23:52clojurebot#<RuntimeException java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalArgumentException: No matching method found: endsWith for class java.lang.Character>
23:54TimMcMaps are weird.
23:54TimMcThey're the only collection that can only have collections as "items".
23:55TimMcThey just barely make sense in the same abstraction.
23:55cemerickwha?
23:55cemerick[[1 2]]
23:55cemericka collection with a collection as an item ^^
23:55TimMccemerick: "can only have"
23:55hiredman~flatten
23:55clojurebot#<RuntimeException java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalArgumentException: No matching method found: endsWith for class java.lang.Character>
23:55cemerickah
23:56hiredmanhuh
23:56cemerickTimMc: well, it's easy enough to make an IPC that requires a collection arg to cons
23:56TimMccemerick: Well, sure.
23:56cemerickbut, yes, maps are weird.
23:57cemerick,(conj {:a 5} {:b 6 :c 7})
23:57clojurebot{:b 6, :c 7, :a 5}
23:58TimMc,(conj {:a 5} [:b 6])
23:58clojurebot{:b 6, :a 5}
23:59cemerickThey're all complected.
23:59TimMcAlso, apply doesn't do what you expect for maps, because it can't.
23:59TimMchaha
23:59cemerickThat's fine by me.