#clojure log - Feb 26 2013

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

0:00 frozenlock: I.e. I want to ship a uberjar that might create its own plugins folder, not an entire m2 path.

0:01 But again I know nothing of the java stuff, it might be impossible.

0:10 Oh I like that https://github.com/cemerick/pomegranate/blob/master/src/main/clojure/cemerick/pomegranate.clj#L42

0:14 I have no idea of the implementation details, but... Main application A. Plugin B is jared with its own depencies, but without those already in application A. Then plugin B is loaded using add-classpath. Could it possibly work, or will I rip the space-time continuum?

2:32 dbushenko: hi all!

2:33 is there a way to reset all the memoized functions?

2:33 just to free some memory?

2:33 probably I can reset the @mem, but may be there is other way?

2:35 alandipert: dbushenko: not that i know of but maybe https://github.com/clojure/core.cache would interest you?

2:35 dbushenko: alandipert, thanks, I'll look into it

2:41 alandipert, yes, you are right, this is more beautiful way to implement a cache. My solution is just a hack

2:51 amalloy: Frozenlock: you might like https://github.com/flatland/useful/blob/develop/src/flatland/useful/map.clj#L5, which is a version of your mapify that is more flexible and generates nicer code as well

3:06 HolyJak: Hi, could anybody be so kind and tell me why, in Ring, the application method passed to run-jetty cannot be modified at runtime? Please see https://www.refheap.com/paste/11819 - after starting jetty, no changes in app-immutable (and re-loading the file in REPL) have any effect while changing external-method works just fine. I believed that in Clojure everything is dynamic and can be changed via REPL at any time but not here :-(

3:07 weavejester: HolyJak: It's because the symbol is resolved before being passed to the function

3:07 HolyJak: For instance, if I (def x 1) (def y (+ x 1)) (def x 2)

3:08 Raynes: Vars, baby.

3:08 weavejester: HolyJak: Then y would be 2, and not 3, because it's redefined after, and only the current value is used when passed to a function

3:08 Raynes: weavejester: Isn't it the case that he can pass a var here?

3:08 weavejester: Raynes: Right, I was coming to that :)

3:08 Raynes: :p

3:08 Sorry for spoiling the surprise.

3:08 ;)

3:09 weavejester: HolyJak: But you can use a var to explicitly make it re-evaluate it each time

3:09 HolyJak: So (run-jetty (var app) {:port 8080})

3:09 HolyJak: Or for short, (run-jetty #'app {:port 8080})

3:10 kasterma: Does #' have a name I can google for?

3:11 HolyJak: weavejester, Raynes: thanks a lot! So the function, if passed just as 'app', will be in a way "passed by value" while #'app is a pass-by-reference and thus will reflect later changes?

3:11 weavejester: kasterma: "var" perhaps? (var x) = #'x

3:12 amalloy: var-quote will probably get useful hits also

3:12 weavejester: HolyJak: Yes, roughly speaking.

3:12 pwned: kasterma: it is an anonymous function

3:12 HolyJak: I believed that function names are actually vars but now I see they are not - what are they then? What is it that I pass to the run-jetty function?

3:13 (I can google the answer myself if you give me the right keywords to look for :-))

3:13 weavejester: HolyJak: When Clojure evaluates a function form, it resolves any symbols before passing then as arguments

3:13 HolyJak: I see

3:14 ChongLi: sharp-quote

3:14 weavejester: HolyJak: So if Clojure comes across (foo x), it will work out what x is before passing it to foo

3:14 ChongLi: I believe that's the term for it

3:14 HolyJak: So whenever passign functions around, if I want to allow them to change later, I have to explicitely var them, right?

3:14 amalloy: ChongLi: that will turn up more common-lisp hits than clojure hits

3:14 ChongLi: amalloy: clojure sharp-quote gives good results

3:15 weavejester: HolyJak: If you're def-ing something static, yes. If you're calling a function then it's evaluated each time.

3:16 pwned: sorry it is a var quote https://groups.google.com/forum/?fromgroups=#!topic/clojure/jDBAJD4nWqs

3:16 kasterma: weavejester amalloy pwned: thx, found some docs.

3:16 weavejester: HolyJak: So… (def y (+ x 1)) is just going to have its body evaluated once, because it's a single value.

3:16 HolyJak: Yep, I managed to understand that for values but wasn't sure how it works with functions.

3:16 Thenk you folks, I love you :-)

3:17 ChongLi: functions are values :)

3:17 weavejester: HolyJak: But… (def f (fn [] (+ x 1))) will resolve x each time f is called.

3:17 HolyJak: I see

3:17 alandipert: Raynes: nice work on laser btw, dig it

3:17 weavejester: HolyJak: So in theory you could also write (run-jetty (fn [req] (app req)) {:port 8080})

3:18 HolyJak: The anonymous function itself would only be resolved once, but "app" would be resolved each time the function is called.

3:18 HolyJak: But it's more concise to just use #'app

3:18 HolyJak: thank you

3:18 weavejester: Ah, I gotta go

3:18 Raynes: alandipert: o/

3:19 Happy you like it, kind sir.

3:29 TheBusby: anyone using s3-wagon-private repos?

3:31 Raynes: alandipert: If you actually use laser, let me know. So far people keep talking about how great it is but nobody has actually mentioned using it (besides me, of course).

3:31 Which is good, since it probably means people aren't having problems.

3:31 Of which I had plenty during development, which is why I was at version 0.1.30 before I released 1.0.0.

3:32 alandipert: Raynes: sure, i hope to use it in the near term to generate poms. i'll let you know how it goes

3:32 Raynes: Ouch, XML?

3:33 I don't know how well that will work. jsoup is a validating HTML5 parser.

3:33 alandipert: yeah, i'm writing a thing called jitjar that looks like a maven repo but actually builds .jars dynamically off github

3:33 oh

3:34 Raynes: With that said, jsoup also has a non-validating version designed for XML, but the current version lacks a method I need (but the author added when I mentioned it). As soon as jsoup releases a version with that method I'll add xml support to laser.

3:34 Simple XML support, at least. Probably at least on the level of enlive.

3:34 alandipert: that's all i'd need

3:35 Raynes: alandipert: Actually, looks like he did release a new version with that change! In that case, I'll see about adding this tomorrow. Look for a new version in a couple of days, probably tomorrow night if I don't run into any significant problems.

3:36 alandipert: Raynes: cool!

3:44 Raynes: alandipert: It just occurred to me that you are up very, very late.

3:44 On a Tuesday no less.

3:44 Be careful or you'll start reminding me of me.

3:45 alandipert: Raynes: i don't let the incidental positions of various stars interfere with my computings ;-)

3:45 Raynes: Haha

3:47 alandipert: I didn't know you were deployed to Iraq.

3:48 I didn't know any of these things, actually.

3:48 Congrats on such a positive outlook.

3:48 alandipert: Raynes: ya

3:48 Raynes: thanks

4:00 ChongLi: alandipert: you're in Iraq right now?

4:00 alandipert: ChongLi: ha, no, fortunately

4:01 ChongLi: alandipert: well good luck when you do go

4:01 stay safe

4:01 alandipert: ChongLi: thanks but i went/did/returned :-)

4:01 ChongLi: oh ok :)

4:03 so Javelin seems pretty cool

4:04 what sort of latency does FRP like that add?

4:05 alandipert: negligible, in up to pretty big browser-based systems anyway

4:05 technically propagation time is linear with respect to the number of formulas

4:06 ChongLi: ahh

4:06 alandipert: (worst case)

4:08 it's good that it's fast, you get a stackoverflow and know you have a cycle almost instantly ;-)

4:08 ChongLi: hahaha

4:08 yeah I really like this design

4:08 it seems so simple and straightforward

4:09 alandipert: thank you, it was a lot of work

4:09 have you had a chance to play with it?

4:09 ChongLi: not yet

4:09 I probably will within the next few days

4:10 alandipert: cool, well definitely give a shout if you have questions

4:10 ChongLi: so a formula cell can have side effects I presume?

4:10 is that recommended?

4:12 alandipert: the idiom we're settling into is formulas for side effects are anonymous, but i'd say do whatever makes sense

4:12 nothing stopping you from wiring however you want except that stackoverflow

4:12 ChongLi: cool

4:13 it seems like I could use this to clean up some callbacks

4:13 and just focus on getting values updating

4:13 instead of directly coupling things with callbacks

4:14 alandipert: yup that's the hope

4:14 one conceptual difference is there is no event to "kick off" what used to be your callbacks, so w/ javelin you have to code as if there's always a base value

4:15 which we came to realize makes total sense, since an app always has a state, even if that state is empty

4:15 ChongLi: yeah

4:16 alandipert: had you used other FRP libs?

4:16 ChongLi: I toyed around with flapjax a bit

4:16 it's quite a bit more complex and somewhat confusing

4:17 it seemed like events and behaviours had a lot of overlap

4:17 piranha: what javelin needs is a library for dealing with DOM :)

4:17 ChongLi: nah, I like that javelin is not complected

4:17 it's the Clojure way

4:18 piranha: I'm building helpers for myself (well, copying them from javelin-demos.dom and modifying them), but still

4:18 sure, javelin should be as it is, but there should be another library

4:18 alandipert: well, we're attacking the DOM thing separaetly with hlisp, an HTML syntax front for cljs

4:18 piranha: so it's easier to start working with

4:19 alandipert: piranha: how's it going btw?

4:19 ChongLi: hmm

4:19 piranha: right, I've seen it, but... I'm a bit sceptical. :) You know, it looks like mixing code with layout again...

4:19 ChongLi: I googled hlisp and I'm getting a bunch of github 404s

4:19 alandipert: ChanServ: https://github.com/tailrecursion/todoFRP/tree/master/todo/hlisp-javelin

4:19 err

4:19 ChongLi: https://github.com/tailrecursion/todoFRP/tree/master/todo/hlisp-javelin

4:20 piranha: alandipert: well, haven't done anything proper yet, just got to setting up base stuff; but I'm giving a talk this Saturday about FRP and replaced Flapjax with Javelin there ;)

4:20 ChongLi: ah ok

4:20 alandipert: piranha: sweet!

4:20 piranha: 'just got' == 15 minutes ago, too much work lately :(

4:20 alandipert: piranha: i understand your concern, but don't worry, it will be awesome when it's done ;-)

4:20 ChongLi: there's a lot of weird stuff going on in the DOM and the browser in general

4:21 I've been working on getting dynamic font loading working

4:21 and it's a bit of a pain

4:21 piranha: alandipert: ok, I'll wait and in the meantime will try to work it out other way :)

4:21 alandipert: piranha: deal

4:21 ChongLi: google's webfont loader requiring you to stuff everything into a global variable

4:22 piranha: ChongLi: that's the problem with all of their APIs :\

4:23 alandipert: piranha: btw if you're willing, would love to add anything you come up with to -demos

4:24 piranha: alandipert: ok! :) not sure though how soon will I get something, I won't have much time during next two weeks due to travel

4:24 alandipert: whenever

4:24 ChongLi: and to think I was taking a look at Elm for some FRP stuff

4:25 piranha: did you like it?

4:25 ChongLi: it's a really nice language but I just can't part with clojure

4:25 the libraries and community are just too compelling

4:25 piranha: it felt a bit strange to me, but maybe I just don't understand something there

4:26 ChongLi: CLJS, as immature as it is, is way ahead of Elm and Fay

4:26 alandipert: i thought the elm paper was great

4:26 but yeah, all of those things seem most appealing to people in languages without existing state models

4:26 and bring a lot of baggage to fill the gap

4:27 ChongLi: and they strip away platform power

4:27 to do anything with JS in those languages you have to go through an FFI

4:28 CLJS's interop is so much nicer than that

4:28 augustl: anyone here happen to know if it's possible to have tomcat automatically share .jars from "lein ring uberwar" packages based on name+checksum or something? Or do I manually have to

4:28 .. configure this, upload the shared .jar files manually, etc?

4:29 alandipert: yeah i'm excited about javelin on both sides... server as input cell

4:29 (or formula)

4:31 ChongLi: so basically any callback can be set to update an input cell, triggering the network to propagate?

4:32 stain: augustl: what do you mean by 'share'?

4:32 ChongLi: this just seems so clean

4:32 stain: augustl: you have JARs inside the WAR that you want to expose?

4:32 alandipert: ChongLi: right

4:33 augustl: stain: my actual problem is that I have multiple war files that contain a .jar file (a dependency) that links into a JNI module, causing tomcat7 to fail since it can only load the jni module once. So I have to figure out how to make the multiple apps share the same .jar, so to speak, so it's only loaded once

4:34 ChongLi: now throw in core.logic and already CLJS seems so damn compelling

4:42 alandipert: ChongLi, piranha : see you later! happy computing

4:43 bluezenix: @augustl you'll have to put that jar in the tomcat lib directory, so it's loaded on startup

4:46 augustl: bluezenix: tried to put the .jar file in $CATALINA_HOME/lib, no change. Removed the .jar file manually from the war files, and then it worked. So it seems I need to manually manage the dependencies that I want to be shared

4:53 stain: yes

4:54 in Maven we would use <scope>provided</scope> for that if I remember correctly

4:54 not sure how you can inject that into Leiningen

4:55 just :scope "provided" I think

4:55 it's tricky if that dependency is implied by someone else, then you would be better to try to ignore it

6:18 kittylyst: Hi. Anyone have some cycles to help me with a quick Leiningen problem?

6:21 babilen: As always: Just ask your real questions. Otherwise you find yourself with an answer of "Sure!" in one hour and are none the wiser.

6:26 kittylyst: On latest Leiningen, running a lein new results in a project which won't lein repl properly - crashes with a ClassCastException: Exception in thread "main" java.lang.ClassCastException: clojure.tools.nrepl.server.Server cannot be cast to compile__stub.clojure.tools.nrepl.server.Server

6:26 Google has precisely 1 hit for this, which is a page of discussion from this channel from last summer.

6:27 cemerick: kittylyst: how did you install lein?

6:28 kittylyst: Upgraded from a previous version

6:29 Oh, and this is Clojure 1.4.0 on OpenJDK8 on Mac 10.7, FWIW

6:29 cemerick: bizarre; it sounds like an AOT fubar, but I'm not sure how...

6:30 kittylyst: I'll retry this on a clean box

6:37 Completely clean install on 1.4.0, OpenJDK7, Ubuntu (only other thing I have around easily) works fine, thankfully

6:42 Interesting. Back on the Mac, cleaning off lein & reinstalling doesn't produce the self-install behaviour. So there could be some fragment of an earlier install kicking around which is mucking things up somehow.

6:49 Resolution: One of the lein self-install jars was owned by root (must have done an lein upgrade at some point whilst root), so I think the wrong jar was getting loaded. Cleaning out self-installs & rerunning lein fixed the issue.

7:33 michaelr525: hey

8:19 aib: I just want a plain old struct - something with named members and no other functionality whatsoever. what type should I go with?

8:24 dobladez: aib: deftype gives you the most basic typed "struct"

8:25 aib: but why not just maps?

8:26 aib: for doc about deftype see http://clojure.org/datatypes

8:26 aib: (I never said no maps :) but my members are predefined and unvarying - think ColorRGB or Vector3

8:30 I just want named accessors- (let [c (ColorRGB :r 255)] (.r c)) or something along those lines

8:31 I'm new to clojure, have I mentioned that? :)

8:44 okay, (hash-map :r 255) and (get c :r) working for now

8:46 cmdrdats: aib: you can just {:r 255} - then (:r c) or (get c :r 0) (using get, you can specify a default if the :r key is not found)

8:47 aib: ahh, more sugar! thanks

8:47 cmdrdats: another handy function is (update-in c [:r] - 10)

8:47 ,(update-in {:r 255} [:r] - 10)

8:47 clojurebot: {:r 245}

8:51 dnolen: aib: (:foo bar) is not really "sugar", keywords are actually functions.

8:51 cmdrdats: you can actually provide default with (:foo bar default) as well

8:51 cmdrdats: dnolen: brilliant - that's good to know :D

9:29 jweiss: in a macro-creating macro, how does one expand into ~@body?

9:39 arkh: is there a way to break up a regular expression #"" into multiple lines?

9:40 not to be confused with a multiline match (?m)

9:42 ambrosebs: I've started a "Getting Started" guide to core.typed. It explains why core.typed is different from other type systems, what types are, and some details https://github.com/clojure/core.typed/wiki/Getting-started

9:42 Feedback welcome. I'm starting on another chapter that deals with actual examples.

9:47 matthavener: ambrosebs: awesome

9:55 dnolen: ambrosebs: looks like a great start!

10:14 ambrosebs: dnolen: thanks

10:22 dnolen: is this not redundant in CLJS or something? (and (sequential? v) (not (nil? v)))

10:26 TimMc: arkh: Just hit Enter. You'll get a newline, though...

10:27 jimduey: ambrosebs: Awesome. I'm just getting ready to dive into TC to see what I can steal for a static analysis problem I'm working on.

10:27 TimMc: On a more serious note... ##(re-pattern (str #"a" #"b")) as long as each subexpression is a valid regular expression.

10:27 lazybot: ⇒ #"ab"

10:27 dnolen: ambrosebs: it not, CLJS extends nil to protocols

10:27 ambrosebs: which I'm leaning towards purging

10:28 "it is not redundant" I mean

10:28 arkh: TimMc: nice - str'ing them together is great, thank you

10:29 ambrosebs: jimduey: Sweet. I've made some good improvements since the Conj. "Single dispatch" MMs work and there's a bit of flow analysis, things like in-body assertions are understood.

10:29 dnolen: I thought a sequential was implicitly a seqable.

10:30 dnolen: ambrosebs: I'm using a new experimental ^not-native type-hint

10:30 ambrosebs: this type hint means protocols are dispatched to directly as a performance thing

10:30 ambrosebs: but nil is really JS null, it's a native type

10:31 ambrosebs: so if you use ^not-native you have to explicitly handle null

10:31 ambrosebs: it's a minor thing but it's just about failing faster

10:31 ambrosebs: Ok. It doesn't seem right that nil is sequential.

10:31 dnolen: ambrosebs: nope

10:32 ambrosebs: the moment nil is no longer extended to core protocols I can remove that bit of ugliness

10:32 ambrosebs: cool

10:34 dnolen: zebra down to 12.5-7ms on CLJS, I think ^non-native support for function invocation might take us the rest of the way ...

10:34 ambrosebs: dnolen: CLJS implementation has me going back and forth as to the true role of nil. It would be nice to get rid of the confusion.

10:34 dnolen: under v8 of course

10:35 ambrosebs: I think the nil-punning protocols were there for convenience

10:35 ambrosebs: but it's bad for perf and semantics are strange

10:35 ambrosebs: Interesting.

10:35 Well I'm glad there's more than one reason to change it :)

10:35 dnolen: ambrosebs: the reason is that nil is a native type, so it goes down the protocol slow path

10:36 jcromartie: I'm on an EC2 instance, and lein is *painfully* slow. I know I don't need it because I could push an uberjar… but this is bad

10:36 ambrosebs: dnolen: ok

10:36 dnolen: ambrosebs: I think nil should be handled at the fn level - lookup, not -loookup

10:36 not -lookup, I mean

10:36 ambrosebs: yep, and etc. for the rest of the protocols.

10:36 dnolen: ambrosebs: which more closely matches CLJ JVM semantics as well

10:36 jcromartie: on my laptop, "time lein" (printing out available tasks) takes 13s

10:36 (which is kind of ridiculous in itself of course…)

10:37 on the server it's 27s

10:38 ,(time (apply + (range 10e6)))

10:38 clojurebot: "Elapsed time: 1740.250494 msecs"\n49999995000000

10:38 jcromartie: hm, well clojurebot is more in line with the EC2 speed I guess

10:39 1828 on the server but 431 on my laptop

10:39 I guess little EC2 instances are just not as beefy

10:44 cemerick: dnolen: FYI, Thomas Heller has his CA in now (according to http://clojure.org/contributing) (re: http://dev.clojure.org/jira/browse/CLJS-466)

10:45 jcromartie: this is a micro?

10:50 jcromartie: cemerick: I think it's a Small

10:51 cemerick: jcromartie: yeah, either way; horrific IO on those, thus really poor class/code loading perf.

10:52 jcromartie: ah, thanks. good to know

10:52 so keep any file i/o asynch if possible heh

11:08 jcrossley3: ohpauleez: do you mind sharing a link for your talk when you have it? we like to list them on immutant.org

11:09 ohpauleez: jcrossley3: We typically don't record them (they're usually swarm based), but I will ping you a link to a blog post on how I got up and running

11:10 Honestly, I was extremely pleased with both OpenShift and Immutant

11:10 and the two together made quick work of me getting something together and out the door

11:10 I'm more than happy to support both efforts however you need

11:10 jcrossley3: ohpauleez: coolio. no recording necesssary, btw. we just like to let folks know if anyone's about to speak near them. the meetup url is fine.

11:11 ohpauleez: Cool

11:25 jcidaho: Anyone using clj-elasticsearch?

11:25 in the docs I can't see an example of how you actually do a search

11:31 Think I'll opt for elastisch

11:39 kittylyst: I need a clojure lib to talk to MongoDB. Is Monger a reasonable choice?

11:42 dcolish: this is very confusing behavior when i am calling a method on a class instance in a macro https://gist.github.com/dcolish/5039976

11:44 Frozenlock: kittylyst: Never tried monger, but I use congomondo and like it.

11:45 ethanis: Anyone have experience using lein cljsbuild with a local git clone of cljs? I've tried following the instructions on the wiki to the dot (https://github.com/emezeske/lein-cljsbuild/wiki/Using-a-Git-Checkout-of-the-ClojureScript-Compiler), alongside r1586, but no dice. The compiler stalls indefinitely with no visual indication of what's going wrong. Thoughts?

11:47 TimMc: dcolish: Your parens are messed up.

11:47 You're giving .at only one arg.

11:47 ohpauleez: ethanis: Are you using Linux?

11:47 ethanis: yep!

11:47 ohpauleez: I knew it!

11:47 dcolish: TimMc: I added a ` to the (recur ... and it seemed to compile

11:47 ethanis: uh oh, what's wrong with openjdk now?

11:47 ohpauleez: there's a weird CLJS bug, where the compiler will hang for like five minutes

11:48 on the first build

11:48 TimMc: dcolish: Or rather, the parens are correct, but you're missing an arg.

11:48 ohpauleez: try using `auto` and not `once`

11:48 ethanis: alright

11:48 ohpauleez: this *JUST* happened to me two days ago

11:48 and I didn't dig in to find the fix

11:48 but that seemed to work out for me

11:48 TimMc: dcolish: y the way, I see no reason for this to be a macro instead of a fn.

11:48 *By the way

11:49 dcolish: TimMc: fair enough, I'm mostly playing around now

11:49 ethanis: hmm, now I'm kind of curious about what's causing it

11:49 ohpauleez: ethanis: I am as well

11:49 TimMc: dcolish: Well, sprinkling macros liberally with syntax-quotes is not going to make them work.

11:49 ethanis: well, I'll heed your suggestion and see how it goes. Comforting to know someone else had this issue.

11:49 ohpauleez: there are reported issues of the same situation on the internet, but like I said, I didn't dig in too deep

11:50 TimMc: You've misused ~@ as well.

11:50 ethanis: thanks ohpauleez, ttyl #clojure

11:50 ohpauleez: np, happy to give some guidance

11:51 dcolish: TimMc: well thats not too surprising, I really have no idea what I'm doing when it comes to macros

11:52 TimMc: dcolish: This is probably closer to what you want: https://gist.github.com/timmc/5040043

11:53 ~@ splices a sequence of forms into an enclosing form: ##(let [a (range 3)] `(:foo ~@a :bar))

11:53 lazybot: ⇒ (:foo 0 1 2 :bar)

11:53 * znDuff was about to suggest that that didn't need to be a macro. :)

11:53 clojurebot: format is http://github.com/tomfaulhaber/cl-format/tree/master

11:53 TimMc: As opposed to just normal unquoting: ##(let [a (range 3)] `(:foo ~a :bar))

11:53 lazybot: ⇒ (:foo (0 1 2) :bar)

11:54 dcolish: ah then ~@ is definitely not what I wanted

11:58 TimMc: Macros are rarely what you want.

11:59 For instance, if you had created that as a macro, no one would be able to write #(apply write-builder foo some-args)

11:59 (Umm, I don't know why I put that # in there. Ignore that.)

12:00 jcromartie: I added :plugins [[lein-ring "0.8.3"]] to my project.clj, but I can't run "lein ring server" etc.

12:00 I can do it locally, but not on the server

12:01 TimMc: jcromartie: Try `lein ring server-headless`, out of curiosity.

12:01 jcromartie: oh huh, I didn't fetch on the server :)

12:01 dcolish: TimMc: thats fair, thanks for the help. Its a lot more readable without the macro as well

12:01 jcromartie: never mind

12:01 I have my terminals confused

12:02 TimMc: Maybe it's failing when trying to launch the browser.

12:03 jcromartie: but yes, the headless bit is important now

12:03 all is well

12:06 TimMc: I'm surprised it wasn't throwing.

12:10 dribnet: hi, any clojurescript + sublime folks listening?

12:12 rasmusto: is there a preferred place to put "example" (not necessarily test) code in leiningen projects? Should I use myns-examples.clj or somesuch? I currently have comment blocks in "myns.clj"

12:13 S11001001: ~ask

12:13 clojurebot: Pardon?

12:13 S11001001: ~anyone

12:13 clojurebot: Just a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."

12:14 hyPiRion: rasmusto: example code? I put it in markdown files. You would usually like to have that as documentation/tutorial

12:14 Foxboron: dribnet: well, i got some knowledge of Sublime if it helps. Not cljs tho.

12:14 hyPiRion: Otherwise make a new repo and create a project using it

12:15 dribnet: ah. well i learned this past week how simple it is to make cljs sublime plugins with emmet.

12:15 i was pretty stoked about it and just wanted to share the news.

12:15 dnolen: dribnet: cool!

12:16 rasmusto: hyPiRion: ok, makes sense. What would you recommend doing with code that I used to incrementally debug what I was writing, should I convert it to test cases?

12:17 hyPiRion: rasmusto: Either manifest it as tests or just let it stay in a file you don't put into the repository

12:19 rasmusto: hyPiRion: perfect, thanks.

12:21 ivan: how do I unrefer things from a namespace?

12:22 hyPiRion: ivan: deref?

12:22 ,(deref #'+)

12:22 clojurebot: #<core$_PLUS_ clojure.core$_PLUS_@f9bc78>

12:23 ivan: I mean I did (require '[clojure.pprint :refer [pp]]) and now I want to get rid of pp so that I can (def pp)

12:24 oh, ns-unmap

12:29 * znDuff grumbles about clojuresque 1.5.5 not being visible in clojars yet.

12:32 seangrove: Is there a way to get a 'submap' from a map, e.g. (submap {:a 10 :b 20 :c 100} [:a :c]) => {:a 10 :c 100} ?

12:33 sproc: Is there an existing function to shuffle/intersperse two lists? i.e., (something '(1 2 3) '(4 5 6)) ;=> '(1 4 2 5 3 6)

12:33 hyPiRion: sproc: ##(interpose '(1 2 3) '(4 5 6))

12:33 lazybot: ⇒ (4 (1 2 3) 5 (1 2 3) 6)

12:33 hyPiRion: interleave, rather

12:33 sproc: Ah, thanks,.

12:33 hyPiRion: ,(interleave '(1 2 3) '(4 5 6))

12:33 clojurebot: (1 4 2 5 3 ...)

12:33 hyPiRion: seangrove: select-keys

12:34 ,(select-keys {:a 10, :b 20, :c 100} [:a :c])

12:34 clojurebot: {:c 100, :a 10}

12:34 seangrove: Ah, beautiful

12:34 I wrote it out and thought there's probably something in core for it

12:34 hyPiRion: And you're right :)

12:41 rasmusto: hyPiRion: whew, I'm no longer going insane from `git add -p` everytime I need to change something, thanks for the tips :)

12:42 hyPiRion: rasmusto: You're welcome :) What kind of editor are you using, by the way?

12:42 rasmusto: hyPiRion: vim + foreplay + fugitive

12:42 er, and paredit.vim

12:43 znDuff: How does paredit.vim compare to paredit.el?

12:43 rasmusto: znDuff: it's a subset of the features as far as I know, I haven't used emacs all that much

12:43 hyPiRion: ah. Not sure if there's some git variant for vim, but emacs has this excellent package named magit which makes most git commands much faster to type

12:44 rasmusto: hyPiRion: fugitive does the equivalent

12:44 hyPiRion: ah, nice

12:50 jcromartie: does it ever make sense to use a map like {:foo {:id :foo …}} over a set like #{{:id :foo …}}

12:50 basically use a hash map as an index

12:51 is the ID really part of the thing?

12:52 palango: hey, I'm trying to validate a html form with (lib-)noir.validation, I looked up most stuff from the docs but when I include the on-error function in the code I get a Unbound cannot be cast to clojure.lang.IDeref exception.

12:53 any idea what could cause that? sample code is here: http://pastebin.com/gBvTkYAQ

12:53 * znDuff scowls at the link to the animated-ad-ridden horror that is pastebin.com

13:25 Frozenlock: What happens when 2 libraries need the same underlying library, but different versions? Are the 2 different versions packaged in the project?

13:26 S11001001: Frozenlock: shallowest wins, then leftmost wins

13:27 antares_: Elastisch 1.1.0-beta1 is released: http://blog.clojurewerkz.org/blog/2013/02/26/elastisch-1-dot-1-0-beta1-is-released/

13:30 Frozenlock: S11001001: Thanks!

13:44 seangrove: Hrm, how do I use java.sql.Timestamp in clojure?

13:47 Do I have to require something first?

13:48 ppppaul: i'm in the mood for profiling

13:48 recommendations?

13:48 technomancy: any windows users want to try out the new self-install in lein.bat? https://github.com/technomancy/leiningen/commit/66ed4818ec52249280c8f2ffb2221c20d32754eb

13:48 no more curl/wget required

13:48 jeremyheiler: seangrove, You have to import it.

13:49 Like (ns foo.bar (:import [java.sql Timestamp]))

13:49 Raynes: technomancy: So, turns out that Haskell's 40MB binaries aren't even statically linked -- that's just how big it comes out on OS X. I can get it down to 23mb by calling strip on it.

13:49 jeremyheiler: Notice the space between sql and Timestamp

13:49 seangrove: jeremyheiler: Ah, thank you

13:49 arkx: Doesn't it work without the space as well?

13:49 technomancy: Raynes: that's less daunting but still a bit of a drag

13:50 frenchyp: seangrove: https://www.refheap.com/paste/11839

13:50 arkx: I mean, using a dot instead.

13:50 Raynes: technomancy: Turns out you only really need to statically link on Linux, since OS X ships with the libs that Haskell dynamically links again.

13:50 technomancy: Not sure what you'd have to do in Windows.

13:50 TimMc: technomancy: So this adds a dependency on Powershell? (If not using Cygwin.)

13:50 technomancy: TimMc: yeah

13:51 someone told me it's available everywhere except old versions of XP without a service pack installed

13:51 Raynes: technomancy: Awesome on using powershell!

13:51 TimMc: Huh, interesting.

13:51 technomancy: Raynes: that's, um, some uncharacteristic enthusiasm

13:51 jeremyheiler: arkx, Yeah, but then you have to use its fully qualified name. If you use the space, you can just use the class name.

13:51 technomancy: for a Windows feature =)

13:51 TimMc: Well, hear-say is good enough for me.

13:52 Raynes: technomancy: It's less pathetic than relying on a user to install curl.

13:53 kevinkevin: has anyone else found that exceptions generated in an agent action don't have stack traces?

13:53 technomancy: don't look at me; I just apply the patches, smile, and nod =)

13:55 and when I say patch, I don't mean a pull request; for some reason this one was a gist

13:55 actsasgeek: is there a way to get lein to run with more memory? specifically lein swank? I saw something like: >JAVA_OPTS="-Xmx50g" lein swank but that doesn't seem to work...:/

13:56 technomancy: which I guess is better than when Windows users just put suggested changes in issue comments

13:56 hyPiRion: :jvm-opts ["-Xss18m"] for instance

13:56 actsasgeek: ^

13:56 technomancy: JAVA_OPTS should work too though

13:56 hiredman: you may need a G instead of a g

13:57 jeremyheiler: arkx, Correction, the full qualifed name can always be used. So, importing with a dot instead of the space doesn't do anything.

13:58 technomancy: actsasgeek: JAVA_OPTS works here; what version are you running?

13:59 amalloy: hiredman: naw, i always use lower-case

13:59 actsasgeek: lein 2

13:59 java 1.6.0

14:02 arkh: with the following: (defn foo [s] (let [re #"\d+"] (when (re-seq re s) true))) , does clojure have to recompile the regular expression at each function call?

14:03 znDuff: arkh: no, it doesn't.

14:03 arkh: znDuff: thanks

14:05 hyPiRion: it's compiled at read-time

14:11 actsasgeek: I dunno…something is funky here. Using the above, querying the runtime yields 505.625Mb for maximum memory. If I add -Xms50g -Xmx50g, I get a "incompatible values for minimum and maximum heap size" error.

14:13 Raynes: actsasgeek: Try setting the maximum "-Xmx" higher than the minimum,

14:14 actsasgeek: Raynes: I tried that as well. and get the same error.

14:14 znDuff: actsasgeek: ...by the way, what's your actual available physical memory?

14:14 amalloy: i rather doubt you really want clojure to have 50g of heap available. that generally just ends in tears

14:15 znDuff: ...and telling the GC to not act until that much garbage has grown up isn't great either.

14:15 actsasgeek: 61Gb

14:16 znDuff: I don't suppose there's any chance you might have a 32-bit JVM?

14:17 actsasgeek: I don't think so. The application runs with similar settings…I just don't seem able to affect them from the command line. And the strange thing is that I can't do it on my local MBP either.

14:18 znDuff: What's your output from ''java -version''?

14:18 pbostrom_: technomancy: I prefer not to refer to myself as a Windows user, but my day job requires it, so I gave it a whirl: https://www.refheap.com/paste/11840

14:19 actsasgeek: for the remote box, java version "1.6.0_25"

14:19 znDuff: actsasgeek: I'm actually interested in more of the output than just the number.

14:19 actsasgeek: java version "1.6.0_25"

14:19 Java(TM) SE Runtime Environment (build 1.6.0_25-b06)

14:19 Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode)

14:20 znDuff: Hmm. No obvious warning signs there.

14:21 actsasgeek: so this works perfectly fine: java -Xms50g -Xmx50g Hello

14:22 technomancy: pbostrom_: thanks; I won't tell anyone =)

14:22 pbostrom_: oh... yeah; I guess it won't work until 2.1.0 is released, heh

14:22 can you try manually changing LEIN_VERSION to 2.0.0?

14:24 actsasgeek: just setting the jvm_opts inside project.clj worked; I was hoping to avoid that (because of dev/prod differences) but oh, well. I have no idea why it won't work. thanks for your help.

14:25 technomancy: actsasgeek: you can put it in the :dev or :production profile in project.clj

14:26 pbostrom_: technomancy: same error

14:27 I couldn't load https://leiningen.s3.amazonaws.com/downloads/leiningen-2.0.0-SNAPSHOT-standalone.jar in my browser either

14:27 technomancy: pbostrom_: yeah, get rid of the -SNAPSHOT part

14:27 pbostrom_: wait, I forgot to leave off SNAPSHOT

14:27 let me fire up Notepad.exe again

14:28 technomancy: (you weren't supposed to say that last part out loud)

14:28 TimMc: pbostrom_: Cue colored lights and techno music.

14:29 Hodapp: blah blah blah, look at me, I'm technomancy, I think I'm superior just because I use emacs!

14:29 * Hodapp runs away

14:29 TimMc: fast zoom on your face, where the computer screen has been projected

14:29 Hodapp: TimMc :P

14:29 technomancy: Hodapp: I got much respect for vim users =)

14:29 Hodapp: technomancy: ...because they have a tough penance to complete?

14:31 pbostrom_: technomancy: success! what's the Notepad shortcut for nrepl-jack-in again?

14:31 technomancy: hehe

14:31 pbostrom_: thanks!

14:32 seangrove: Is there a way to get a list of options a java object has?

14:32 pbostrom_: np

14:32 amalloy: seangrove: i don't think there's any such thing to get a list of?

14:32 seangrove: clj-yaml relies on snakeyml but doesn't expose much, so I'm exploring clj/java interop here :P

14:33 jeremyheiler: seangrove, What do you mean by "optiosn"?

14:33 options...

14:33 seangrove: Ah, sorry

14:33 Methods*

14:33 I meant to type methods, but was looking at the word "options" :P

14:33 The snakeYaml docs say that their DumperOptions object has a explicitStart method, the clojure repl disagrees. I'd like to see what methods it *does* have

14:34 jeremyheiler: seangrove, You'll have to juse Java's reflection.

14:34 antares_: seangrove: http://stackoverflow.com/questions/5821286/how-can-i-get-the-methods-of-a-java-class-from-clojure

14:34 seangrove: jeremyheiler: Thanks, I'll look it up - haven't used it much yet

14:34 antares_: Just got there, thanks

14:34 brianwong: (for [method (.getMethods java.awt.Frame)] method)

14:35 goracio: creating web site without routing some thoughts ...http://bit.ly/128NtOD

14:37 seangrove: brianwong: Very succint, thank you

14:37 brianwong: (for [method (.getMethods java.awt.Frame)] (.getName method))

14:37 a little better

14:41 xorola: hi

14:42 kevinkevin: has anyone else found that exceptions generated in an agent action don't have stack traces?

14:44 amalloy: they probably just have very short stacktraces

14:48 actsasgeek: I was noticing the same thing about stack traces from exceptions in atoms. I wasn't sure if it was swank that was doing it though…but I never get a stack trace from an exception in an atom. I always have to try the stuff outside of it to find problems. I could be doing something wrong, admittedly.

14:54 kevinkevin: amalloy: They have no stack trace at all

14:54 actsasgeek: did you find any way around it?

14:55 actsasgeek: kevinkevin: no, sorry. I just sort of live with it and curse.

14:55 kevinkevin: actsasgeek: it is a huge pain. makes it impossible to track down errors deep in a program

14:56 technomancy: there's a bug in the JVM that can delete stack traces with tiered compilation enabled

14:56 https://github.com/technomancy/leiningen/issues/1025

14:57 kevinkevin: ^

14:57 clojurebot: I don't understand.

15:00 actsasgeek: interesting. why does specifying jvm-opts [] fix it? Wouldn't the defaults be merged into it?

15:01 kevinkevin: technomancy: thanks for the info

15:01 technomancy: actsasgeek: yeah; hrm. that is incorrect. :jvm-opts ["-XX:TieredStopAtLevel=1"] is a better fix.

15:01 I'll update the ticket

15:01 kevinkevin: not sure if that's the problem you're seeing, but it sounds familiar

15:02 kevinkevin: technomancy: it looks like it is, actually

15:02 actsasgeek: yeah, thanks.

15:02 kevinkevin: ran without lein and the stacktraces are there

15:03 technomancy: tiered compilation gives a huge speed boost to startup, but apparently it's not perfect yet

15:04 TimMc: A whole mess of issues around it, yeah?

15:04 I feel like I've heard of maybe 3 different problems it causes in just this past week.

15:06 technomancy: maybe I missed something? this is the only problem I'm aware of, other than it not being as fast as it could be in 2.0.0.

15:09 milos_cohagen: sorry for off topic q, but.. :) is there a emacs lisp fn to switch to the last visited buffer without prompting me? i want to call 'switch-to-buffer non-interactively

15:12 amalloy: milos_cohagen: try #emacs

15:13 Raynes: Not that it's so offtopic that nobody wants to answer it, just that #emacs is more likely to actually have the answer.

15:13 milos_cohagen: ya u guys r right, i'm a bit of newb to irc and this group is only one i visited so far

15:14 antares_: milos_cohagen: I use https://gist.github.com/michaelklishin/62710c5622e84951c916, seems to do what you need?

15:15 brehaut: milos_cohagen: have a look at what C-x left and C-x right are bound to?

15:15 (no idea if thats default, or starter kit default)

15:15 milos_cohagen: antares: tyvm, works perfect

15:16 brehaut: works too, ty guys

15:17 amalloy: brehaut: must be a real default, since i have it too

15:18 brehaut: cool

15:22 Frozenlock: Moving from protocols to multimethods... Is there a way to deal with `nil'?

15:23 My multi dispatch based on the class

15:23 brehaut: Frozenlock: you can implement a protocol for nil

15:24 milos_cohagen: clojure q now.. i'm editing a clojure file in a lein proj w/emacs+nrepl.. i eval a fn in current file, get an error, the err comes from a fn defined in other ns, so my workflow is: switch buffer to the other ns, call 'nrepl-set-ns, modify fn, eval fn, switch back to prev buffer, call 'nrepl-set-ns, call the original fn to see if it works without err, if err repeat workflow.. so my q is: is there a better workflow?

15:24 Frozenlock: brehaut: So multi for everything, but a protocol for nil?

15:25 znDuff: milos_cohagen: If you eval anything with C-x C-e, it's always done in the current ns, so you can put your test statements inside of a comment in your files and eval them, removing the need to do the nrepl-set-ns.

15:25 brehaut: Frozenlock: oh right, my bad

15:25 Frozenlock: got it backwards

15:25 Frozenlock: :p

15:25 brehaut: ,(class nil)

15:25 clojurebot: nil

15:25 brehaut: Frozenlock: i

15:25 znDuff: milos_cohagen: ...also, you might consider recompiling the whole file (C-c C-k) rather than just evaling the piece you change, if there are other things depending on the code you're modifying which could be broken by your changes.

15:25 brehaut: 'd just use nil as the class by the looks of that

15:26 Frozenlock: I tried that, but I got an error...

15:26 (defmethod my-method nil nil)

15:26 brehaut: Frozenlock: what is your defmulti line?

15:27 Frozenlock: (defmulti my-method class)

15:27 (defmulti my-method #(if % (class %) :nil)) could do it perhaps...

15:27 brehaut: Frozenlock: no, class should be fine

15:28 Frozenlock: shouldnt you have an arg list in there somewhere? (defmethod my-method nil [] nil) ?

15:28 Frozenlock: Oh right!

15:28 brehaut: blerk not [], [_]

15:28 * bbloom has fallen pretty deeply down the logic rabbit hole..... it's a scary place down here

15:29 Frozenlock: brehaut: and now it works :)

15:29 Thanks you so much

15:29 brehaut: Frozenlock: o/

15:29 Frozenlock: \o

15:29 I was sure it was a multi-related problem

15:30 brehaut: Frozenlock: its not a very clear error it gives you

15:30 Frozenlock: The best kind of error: java.lang.NullPointerException

15:30 brehaut: Frozenlock: if you get the full stacktrace it does tell you its coming from the method parser though

15:31 maio: hm JVM_OPTS=-d32 and Clojure startup time is few seconds faster. are there any other tricks to make it even faster? :)

15:40 thorwil: could a java.lang.NullPointerException at a (korma.core/defentity comment ...) be due to comment already being defined by clojure.core?

15:41 znDuff: defentity is a macro, right?

15:42 antares_: thorwil: yes, you can use :refer-clojure :exclude [comment] to avoid that. comment returns nil.

15:42 znDuff: So we don't know what code that actually expands to without actually using macroexpand. It certainly could expand to something where comment's preexisting definition could be a problem (in which case the approach given above will avoid it)

15:43 thorwil: yes, a macro

15:46 happens way too often that i stumble over vars not being defined and stuff like that, when i get back to work (with a lein immutant run)

15:47 (:refer-clojure :exclude [comment]) did fix it, thanks antares_

15:48 qizwiz: having trouble finding this. What's the best way to trace through the source in emacs once you've issed "lein run"?

15:48 I found an example web app on github that I can't actually tell if it's doing anything

15:50 this is the app if anyone's interested: https://github.com/santervo/cardealer-demo

15:50 rabbit_airstrike: qizwiz: run the app in the background or in a screen?

15:50 clizzin: i'm working on a web app that i'd like to use clojure for, but that has to integrate with some java silliness (guice modules, if you know about that). it seems like i need to expose my clojure code as a class that acts like a java servlet. does anyone have a good example of this?

15:51 rabbit_airstrike: or you're looking for some kind of verbose mode for this webapp?

15:52 brehaut: clizzin: theres a ring adapter for that

15:52 https://github.com/ring-clojure/ring/tree/master/ring-servlet

15:53 qizwiz: I ran it from a terminal

15:54 augustl: hmm, clout (the route parser in compojure) seems to unescape escaped URIs, why does it do that? /foo/test%20me with a route "/foo/:my-thing" sets :route-params -> :my-thing to "test me", not "test%20me"

15:55 clout seems to do a decode on all "path segments", i.e. everything between a /, which essentially causes data loss (i no longer know what the original URL looked like)

15:56 clizzin: brehaut: oh cool! didn't see that in any of the ring docs. will give it a shot. thanks!

15:56 brehaut: clizzin: its mentioned in the primary ring readme ;)

15:58 rabbit_airstrike: qizwiz: possibly an unfilled mongodb dependency?

15:58 do you have mongodb installed and running for the example app?

16:00 TimMc: augustl: I'm pretty sure that's as designed.

16:00 augustl: TimMc: I wonder why, it's annoying :)

16:00 TimMc: %20 is an encoding for transport

16:01 As a string in memory, you really want " " instead of "%20".

16:01 augustl: %20 is the actual value of the URL, not just for transport

16:01 ..imo

16:02 is "/foo/" and "/foo%2f" the same URL?

16:02 brehaut: an accident of early browser location UIs

16:02 im with TimMc; i think they are

16:02 augustl: can I safely do a request to %2ffoo instead of /foo in all situations?

16:03 SegFaultAX: augustl: Why would you use / within a path segment? It has special meaning inside of URIs.

16:03 rabbit_airstrike: qizwiz: after I installed and started mongodb, that example web-app you linked to works fine

16:03 augustl: SegFaultAX: is that relevant to the discussion? :)

16:03 TimMc: augustl: / might be a special case.

16:04 SegFaultAX: augustl: Yes, it is. Because / is a special case in the URI standards.

16:04 augustl: SegFaultAX: does escaped charcters have any meaning?

16:04 SegFaultAX: augustl: They're a transport encoding as TimMc said.

16:05 augustl: so I can't have any value I want in my URL?

16:05 even if I escape it?

16:05 TimMc: Empirically, http://www.google.com%2F breaks.

16:05 amalloy: %2F is required to behave differently from / in path segments

16:06 brehaut: amalloy: by spec or by historical accident of filesystem based webservers?

16:06 augustl: the actual issue is that I'm writing a proxy, with a clout match like "/proxy*", and I pass (get-in req [:route-params :*]) to the proxy. But clout unescapes it so I get an invalid URL (containing a literal / instead of %2f, for example)

16:06 amalloy: brehaut: by spec

16:07 i can't imagine i would say "required" and mean "typically this is what happens"

16:07 Raynes: ohpauleez: Were the dude working on Clojure stuff for leapmotion?

16:07 augustl: so I have to manually fetch the actual escaped uri from the request and extract the relevant part (the part after /proxy)

16:07 ohpauleez: Raynes: I am

16:07 Raynes: ohpauleez: Have you seen https://getmyo.com/

16:07 ohpauleez: Raynes: I have not, looking now

16:08 Raynes: ohpauleez: It's pretty amazing.

16:08 augustl: amalloy, SegFaultAX, TimMc: so is the conclusion that an URI can't contain arbitrary values, such as slashes, even when escaped?

16:08 or is it a clout specific issue?

16:08 amalloy: of course it can. that's exactly what %2f is for: letting you put / into a uri without interpreting it as a path separator

16:09 SegFaultAX: augustl: I was only pointing out that it's confusing to use / as part of a path segment because it has special meaning in URIs.

16:09 ohpauleez: Raynes: It'll be interesting to see if that actually holds up - if they can make it as accurate as depicted in the video

16:09 SegFaultAX: augustl: (And you run into problems like you're having because of it)

16:09 augustl: You called it a "transport encoding", sounded very serious :)

16:10 SegFaultAX: it's clout that's at fault here, it seems

16:10 amalloy: for example, for URLs like http://my/server/redirect/google.com%2fhome or whatever similar stuff

16:10 Raynes: ohpauleez: I almost bet it'll be more accurate than leapmotion.

16:10 augustl: yet another example of erronous handling of URL encoding..

16:11 ohpauleez: Raynes: I don't know about that - the leap motion uses three IR beams, supporting mm accuracy, with 100 frames of data a second, for a 8ft x 8ft x 8 ft cube

16:11 Raynes: ohpauleez: Yeah, but even it isn't that accurate, given videos I've seen. It's extremely shaky, isn't it?

16:12 Anyways, this uses your damn muscle movement. It's the logical step below hacking into your brain and interpreting your thoughts. I'm pretty optimistic about it.

16:13 rabbit_airstrike: anyone have any experience monitoring periodic at-at jobs?

16:13 ohpauleez: any sensor has jitter - there is no hardware or SDK smoothing at the moment, but it's not hard to implement or ignore. The jitter is not a problem in real-work use.

16:13 noprompt: yeah that looks pretty cool

16:13 ohpauleez: Raynes: Oh no, I think it totally looks cool

16:13 augustl: I posted an issue in the issue tracker of Clout, let's see what happens

16:13 would make sense to have an API like :route-params and :raw-route-params, or something like that.

16:13 bbloom: generally, you need to tune your smoothing to the use case

16:14 ohpauleez: I just have no knowledge about the accuracy of muscle detection // bio-electrical signaling

16:14 bbloom: for a really simple example, the little thumbsticks on video game controllers often have "dead zones" where, over time, they get loose, so the software ignores small dX or dY values

16:14 ohpauleez: bbloom: Right, which is why they've refrained from adding general smoothing

16:14 bbloom: but you can have a square dead zone, or a circular one, for two simple examples

16:17 noprompt: is pmap an example of concurrency or parallelism?

16:18 bbloom: noprompt: yes.

16:18 ohpauleez: haha

16:18 noprompt: bbloom: both?

16:18 i'm trying to understand the distinction

16:18 bbloom: noprompt: it depends on whether or not you have two or more CPU cores

16:19 noprompt: bbloom: ah, ok

16:19 bbloom: if you have 1 CPU core, threads execute concurrently

16:19 if you have two CPU cores, then they execute in parallel

16:19 ohpauleez: noprompt: sort of both - it's not true data parallelism (you're not operating on all pieces of the data at once), but it is a parallel operation, so you're doing more than one thing at the same time (concurrency)

16:20 bbloom: ohpauleez: discussion of "data parallelism" deeply confuses the issue

16:20 ohpauleez: and as bbloom said, it's all built on top of threads, which if you have a SMP OS and multiple cores, you get true concurrency

16:20 noprompt: gotcha

16:20 ohpauleez: bbloom: I disagree - avoiding it is misleading :)

16:21 especially given its name

16:21 bbloom: ohpauleez: when data is parallel, it just means that it is capable of being processed concurrently

16:21 ohpauleez: no

16:21 THAT'S the problem

16:21 data parallelism is operating on individual items (usually used to imply ALL of the items) at once

16:22 is pmap task parallel? Certainly not

16:22 is it data parallel, sort of

16:22 is it concurrent, Yes*

16:22 * assuming you have more than one core

16:22 bbloom: task vs data parallel is orthogonal to concurrent vs parallel execution

16:22 ohpauleez: or else you just have thread and context concurrency

16:23 bbloom: The question wasn't about execution

16:23 it was about concurrency or parallelism

16:23 noprompt: i love this place

16:23 ohpauleez: and the latter comes in multiple forms

16:24 bbloom: he asked specifically about concurrency vs parallelism

16:24 ohpauleez: avoiding these terms isn't going to make them go away

16:24 right, so let's be honest with him

16:24 I feel we both were

16:24 bbloom: ohpauleez: i'm not avoiding them, i'm separating the discussion into two topics

16:24 you can discuss them together and how they effect each other

16:24 but he asked about concurrency, which has to do with execution

16:25 ohpauleez: noprompt: Do you feel like you've better understood how things are running?

16:25 when you use pmap

16:25 noprompt: a little bit, but let me make sure i understand the big picture here

16:25 ohpauleez: ok

16:25 fire away

16:26 noprompt: one second

16:28 concurrency is operating on the same piece of data at the same time

16:29 bbloom: no

16:29 noprompt: ok

16:29 arohner: man I really wish lein had << included

16:29 SegFaultAX: noprompt: I think you've confused the problem by asking about pmap specifically. Maybe your question should be "what's the difference between concurrency and parallelism?"

16:29 bbloom: let's say you have two processes

16:29 antares_: ohpauleez: hey

16:30 bbloom: and by process, i don't mean computer process, i mean like the more abstract notion of some sequence of events

16:30 ohpauleez: antares_: Hey man

16:30 noprompt: SegFaultAX: yes, lets assume i had asked that question instead

16:30 bbloom: noprompt: imagine those processes have a start-time and an end-time

16:30 noprompt: k

16:30 antares_: ohpauleez: do you know if there any improvements on the electronic CA submissions front?

16:30 bbloom: concurrency happens when those two time-spans overlap

16:30 ie Process A starts, then B starts before A finishes

16:31 ohpauleez: antares_: As far as I'm aware, you can email us a scan of a CA and we can mail it on your behalf

16:31 antares_: ohpauleez: or any "official links" to http://clojure-doc.org?

16:31 SegFaultAX: noprompt: But not necessarily running /at the exact same time/. Just with overlapping timelines.

16:31 bbloom: SegFaultAX: right

16:31 antares_: ohpauleez: email who? and why wasn't this announced?

16:31 ohpauleez: antares_: until there is some infrastructure in place to handle scans

16:31 noprompt: ah, ok, i think that's what was tripping me up in my thinking

16:31 bbloom: noprompt: you might have two projects due for work, so you take turns working on both of them a little bit at a time

16:32 you're working on two projects *concurrently*

16:32 however, if you could clone yourself and work on both projects concurrently, one each

16:32 then you (and your clone) are working in parallel!

16:32 antares_: ohpauleez: but does that mean that scans are legally acceptable and Clojure/core now accepts them, it's just a matter of automation?

16:32 noprompt: so operations in parallel, they would necessarily have the same starting time (but maybe not the same ending time)?

16:32 SegFaultAX: noprompt: If you were to graph their timelines, it might look like |A-start ... |A-pause |B-start ... |B-pause |A-resume ... |A-finish |B-resume ... |B-finish

16:32 ohpauleez: antares_: It hasn't been totally settled yet, people are working on it. And you can make a post on the Clojure ML about the link and someone with access to the site content repo can add it to the docs page

16:32 SegFaultAX: noprompt: If you could imagine such an execution timeline.

16:33 noprompt: SegFaultAX: i can somewhat visualize that

16:33 bbloom: if, at any given time T, there are two or more processes that have started, but have not yet finished, then they are concurrent

16:33 if at any given time T, there are two or more processes that are *at that precise instant* both executing, then they are parallel

16:33 ohpauleez: antares_: The scans still need to be printed out, stamped, and mailed - for the time being. There's still a hold up on direct scan acceptance right now

16:34 bbloom: parallelism implies concurrency

16:34 concurrency does not imply parallelism

16:34 SegFaultAX: bbloom: Well said.

16:34 antares_: ohpauleez: oh well, that's already good news

16:34 ohpauleez: so you think we should start a discussion on the ML about having a link to clojure-doc.org from clojure.org?

16:35 bbloom: noprompt: with us so far?

16:35 SegFaultAX: noprompt: The other issue of task vs. data parallelism is orthogonal to the above-described execution strategy.

16:35 bbloom: SegFaultAX: yes, i was going there next. just to pleez ohpauleez :-)

16:35 SegFaultAX: bbloom: Hah, ok I'll let you finish it then :)

16:35 noprompt: bbloom: yes, i think that last bit clarified it

16:35 ohpauleez: bbloom: :)

16:35 thank you'

16:35 bbloom: ok, soooo data & task parallel ism

16:36 ohpauleez: SUPER easy

16:36 may I field this one?

16:36 SegFaultAX: ohpauleez: For someone new to concurrent programming, task/data parallelism just muddies the waters with additional terminology.

16:36 ohpauleez: SegFaultAX: Really?

16:36 bbloom: I agree

16:36 ohpauleez: how so

16:36 SegFaultAX: ohpauleez: I think so, yes.

16:36 ohpauleez: what?!?!

16:36 bbloom: it overloads the word "parallel"

16:36 ohpauleez: haha I can't believe I'm the odd one here

16:37 bbloom: it really should be "task vs data CONCURRENCY" :-P

16:37 noprompt: bbloom: so in the concurrency part, two processes may have started but are not necessarily both executing at the same time?

16:37 bbloom: noprompt: right

16:37 noprompt: parallelism is a special case of concurency?

16:37 SegFaultAX: noprompt: Precisely!

16:37 bbloom: noprompt: yup

16:37 ohpauleez: yes

16:37 and here's the difference

16:37 SegFaultAX: noprompt: Where two or more processes can execute /at the exact same time/

16:37 bbloom: here's another example:

16:38 let's say you're preparing dinner for your family and you're plating the food. you are the only person plating and you only have one serving spoon

16:38 noprompt: i just felt my mind expand a little :)

16:38 love that feeling

16:38 bbloom: if you put the mashed potatoes on everyone's plates

16:38 then you put the peas on everyone's plates

16:38 you're plating concurrently

16:38 if you're sister decides to help you, brings a second spoon

16:38 and she starts plating people's peas while you plate the mashed potatoes

16:39 then you are plating in parallel

16:39 noprompt: right because plating the potatoes and plating the peas are two separate processes but they're not happening at the same time

16:39 SegFaultAX: ohpauleez: I guess my argument is just that concurrency and parallelism are already abstract enough without introducing the specific execution strategy for each thread of execution (system thread or otherwise)

16:39 ohpauleez: SegFaultAX: Is there one task you're applying to lots of data (data parallelism), or is there one set of data your applying lots of different tasks to (task parallelism)

16:39 bbloom: noprompt: you got it

16:39 so now task vs data

16:39 ohpauleez: Are you potentially doing more than one thing at the same time? (concurrency)

16:39 bbloom: serving potatoes and serving peas are two tasks

16:39 antares_: ohpauleez: sorry to interrupt a very interesting concurrency/parallelism discussion but have you seen my Q about starting a discussion about moving clojure-doc.org to docs.clojure.org?

16:40 SegFaultAX: ohpauleez: Task parallelism doesn't imply operating on the same data across multiple tasks.

16:40 ohpauleez: You can have different tasks operating on different data, for example.

16:40 bbloom: but you're spoon can carry many peas at once

16:40 noprompt: no i understand the part prior about starting A, stoping A, starting B, ...

16:40 antares_: ohpauleez: also, since I don't have access to clojure-dev, I am curious how much attention that will get from decision makers

16:40 noprompt: s/no/now

16:40 bbloom: that's sorta like "data parallelism" where you the same (or very similar) operation to a whole bunch of units of data of the same class all at once

16:40 ohpauleez: antares_: I'd definitely just hit up the Clojure ML - that'll have the most eyes on it

16:41 bbloom: there is a distinction between task parallelism and data parallelism not because they are inherently different in any way, but because they offer distinct and interesting concurrency strategies

16:41 ohpauleez: bbloom: YES! Good point

16:41 clojurebot: yes! and the hack is to do (->> blah #(foo % bar)), or use swiss-arrows

16:42 SegFaultAX: bbloom: I think the better analogy for that might be mashing the potatoes. Having 1 thread mashing the entire pot vs. sub dividing the pot and having multiple mashers going.

16:42 bbloom: SegFaultAX: heh, i think the food example breaks down for task v data

16:42 ohpauleez: I agree

16:42 SegFaultAX: Aww, I thought that was a good example!

16:42 (The mashing bit)

16:42 bbloom: it's as awkward as mine :-)

16:43 SegFaultAX: For task parallelism you could have 1 task adding salt to the taters, one adding butter, another milk, etc.

16:43 antares_: ohpauleez: ok, thank you

16:43 SegFaultAX: ... No? Ok, I'm hungry now.

16:43 bbloom: mmm mashed potatoes

16:43 Bronsa: lol

16:43 ohpauleez: SegFaultAX: Salt is a good example actually

16:43 cemerick: Bodil: did I see you talking about porting clojure.test to cljs a few days ago?

16:44 SegFaultAX: ohpauleez: I was trying to make it work.

16:45 bbloom: I feel like you should capture this discussion into a blog post.

16:45 bbloom: You could probably use your kitchen analogy if you clean up the inconsistencies.

16:45 noprompt: so i guess the question left in my mind, is how do you ensure that each plate is never plated twice? or would you never run in to that problem?

16:46 ohpauleez: Are you handling more than one thing at the same time? (Concurrency) Are you *actually* doing multiple things at the same time? (parallelism) Are you doing the same operation, in parallel across a set of data? (data parallelism) Are you doing lots of different tasks across a single piece of data? (task parallelism)*

16:46 You could also being doing lots of tasks on lots of small pieces of different data - also task parallelism

16:46 SegFaultAX: noprompt: Usually there is some other process coordinating the task.

16:46 ohpauleez: but that case is rarely considered

16:46 noprompt: would that be the parent process?

16:46 bbloom: SegFaultAX: it takes me forever to write blog posts.... & i feel like this is a well covered subject :-P will save my writing time for unique things

16:47 noprompt: how do you and your sister keep from plating the same plate twice?

16:47 noprompt: you communicate

16:47 noprompt: either verbally

16:47 SegFaultAX: bbloom: Hah, well it's on the table if you change your mind. (See what I did there?)

16:47 bbloom: or via looking at the plates themselves

16:47 ohpauleez: this is a pretty solid analogy

16:47 noprompt: bbloom: you should consider writing this up, yes. you've definitely helped clear up my confusion.

16:48 ohpauleez: I use classrooms, classes, a school, and chalk boards usually

16:48 noprompt: SegFaultAX: you as well, thank you

16:48 SegFaultAX: (inc bbloom)

16:48 lazybot: ⇒ 6

16:48 bbloom: heh, ok... i'll add it to the queue of posts to be written

16:48 SegFaultAX: (inc ohpauleez)

16:48 lazybot: ⇒ 1

16:48 ohpauleez: Yes!

16:48 ONE!

16:48 :)

16:48 bbloom: i currently have 38 drafts lol

16:48 most of the time, i write enough of an outline that i have some epiphany myself & then loose interest in the blost post

16:48 lol typo: blost. i've invented a new word

16:49 ohpauleez: noprompt: For completeness, I'll give you another analogy that's common in papers and books

16:49 bbloom: web log -> blog ;; blog post -> blost

16:49 i also have a good analogy regarding resource contention that involves ordering drinks at a bar :-)

16:49 noprompt: off topic, but every time i'm in this room i feel inspired to return to college

16:50 jcromartie: noprompt: hah

16:50 bbloom: noprompt: meh, you don't need college. just start a paper-reading club :-P

16:50 SegFaultAX: What's the term for comparisons of the form "foo is to bar as spam is to eggs"?

16:50 ohpauleez: Lots of students attend a school, and they all need to learn. The school has a master chalkboard that all the students see when they enter - the board is FULL of math problems to solve

16:50 amalloy: SegFaultAX: analogy

16:50 bbloom: heh.

16:50 yes.

16:50 SegFaultAX: amalloy: I thought there was s epcial name.

16:51 jcromartie: how can I test if every value in a collection is unique?

16:51 noprompt: bbloom: yes, i've heard similar view points. i never finished my compsci education because i got bored.

16:51 jcromartie: I am doing (defn unique? [coll] (= (count coll) (count (set coll))))

16:51 ohpauleez: so the students one by one take a problem to do, and head to a classroom. Each classroom holds 6 students. And they begin working. They use the chalkboard in the classroom to share work, ideas, and communicate.

16:51 jcromartie: is that reasonable?

16:51 bbloom: jcromartie: seems reasonable to me

16:51 SegFaultAX: amalloy: Well now I feel like a dumbass.

16:51 amalloy: &(doc distinct?)

16:51 lazybot: ⇒ "([x] [x y] [x y & more]); Returns true if no two of the arguments are ="

16:51 ohpauleez: as the students finish their work and solve their problems, the head back to the main school chalkboard, write their answer, and head home

16:52 noprompt: ohpauleez: i like that analogy as well, however it lacks the mashed potatoes

16:52 :)

16:52 ohpauleez: :)

16:52 bbloom: jcromartie: yeah, you can apply distinct?

16:52 jcromartie: ah

16:52 bbloom: IMHO, there is severe lacking of mashed potatoes in computer science

16:53 fuck peas tho. they pretty much only exist to make your cream sauces have some fancy green bits in them

16:54 noprompt: bbloom: i plan to start reading more papers soon, along with implementing your red marker technique

16:54 jcromartie: then a better name would be all-distinct?

16:54 bbloom: noprompt: it's a solid approach :-)

16:54 noprompt: my gf and are splitting up so, yeah, more time for that

16:54 brehaut: bbloom: also to create pea puree for master chef challenges

16:54 gfredericks: so clojure.java.jdbc/transaction -- should it rollback on arbitrary throwables rather than just Exceptions?

16:54 ohpauleez: noprompt: The students use the main chalkboard to make sure no one takes the same problem, and that all the answers get written down somewhere. The classrooms allow students to work in little batches, communicating efficiently with each other (imagine the alternative - screaming in an gym full of all the students) The problems are solved in parallel because all the students are working at the same time.

16:54 noprompt: brehaut: the python discussion did not go as well, or as bad, as i had thought it would

16:55 brehaut: noprompt: just 'meh' ?

16:55 noprompt: ohpauleez: very nice

16:55 jcromartie: ohpauleez: is this a real school, or is it a contrived concurrency problem?

16:55 ohpauleez: noprompt: And that's "exactly" how a GPU works

16:56 global memory (the school chalkboard), local memory (the classroom chalkboard), private memory (the students paper)

16:56 and the classrooms are Processing Units

16:56 noprompt: brehaut: he coped out with the whole "every language has it's warts" bit i've heard time and time again from folks who get scured of learning an lang like cli or hs

16:56 ohpauleez: jcromartie: Just an example

16:56 noprompt: s/cli/clj

16:57 brehaut: re:blackboards http://en.wikipedia.org/wiki/Tuple_space

16:57 jcromartie: I thought maybe you worked for an efficient collaborative school

16:57 brehaut: noprompt: tis both right and a cop out for sure

16:57 noprompt: brehaut: in short he doesn't want to use clojure because he doesn't think there's a significant gain

16:57 SegFaultAX: amalloy: I guess I was thinking of the form "A : B :: C : D" which is called Aristotelian format, eg the format used on SAT's.

16:58 brehaut: noprompt: thats the blub paradox in action

16:58 noprompt: brehaut: but since he's unwilling to even consider the language...

16:58 brehaut: noprompt: tbh thats what i would expect from some who described as a 'Hardcore X user'

16:59 jcromartie: if you ever meed a self-described "PHP guy", run

16:59 just run

16:59 noprompt: brehaut: indeed

16:59 ohpauleez: ok, so now noprompt, do you feel like you've got it?

16:59 noprompt: jcromartie: plenty of those people in my town, sad to say i can't convince that php is shit pancake either

16:59 ohpauleez: two and half examples, a handful of terms

17:00 brehaut: jcromartie: that applies to most martyrs ;)

17:00 TimMc: $google php fractal bad design

17:00 lazybot: [PHP: a fractal of bad design - fuzzy notepad] http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/

17:00 noprompt: jcromartie: my favorite response from PHP debs when you tell them it's an ass language: "well it pays my bills"

17:00 s/debs/devs fucking autocorrect

17:00 brehaut: clojurebot: php is http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/

17:00 clojurebot: Alles klar

17:00 ohpauleez: noprompt: Tell them to honestly read: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/

17:01 damn you brehaut and clojurebot

17:01 haha

17:01 jcromartie: To be honest, PHP is where I got started in web dev, though. It took a while to un-learn it.

17:01 noprompt: ohpauleez: i also like the double clawed hammer post

17:01 brehaut: noprompt: thats the only reason to use PHP. totally legit reason.

17:01 jcromartie: but that was like, high school

17:01 ohpauleez: Selling crack can pay the bills too

17:01 TimMc: noprompt: THat's the one, actually.

17:01 ivan: that page brings out the dunning-kruger in the PHP developer: "why do you care about these things?"

17:01 bbloom: i've also heard "facebook uses it"

17:01 *argh*

17:01 ohpauleez: but I don't sell crack

17:02 bbloom: That's the worst

17:02 bbloom: i generally respond "and they deeply regret it"

17:02 ohpauleez: I get violent when I hear that

17:02 bbloom: haha

17:02 noprompt: someone needs to give php the coffeescipt treatment or something

17:02 ohpauleez: haha

17:02 TimMc: http://phpsadness.com/ is pretty good too.

17:02 ivan: there are languages that compile to PHP

17:02 noprompt: that url is priceless

17:03 sad to say i've turned down contract work purely because it was php

17:03 TimMc: THat's very understandable.

17:03 hashbang1: bbloom: yeah, i love that argument. they also had to write hiphop just to keep it usable

17:03 hyPiRion: that was for performance reasons though

17:03 TimMc: noprompt: "Sad to say, I've turned down construction jobs because I would have been required to use rocks and floss."

17:04 bbloom: hashbang1: from what i'm told, PHP can be safely described as Facebook's server side templating language

17:04 since everything else has become a hodge podge of internal services

17:04 brehaut: ohpauleez, TimMc: Marco Arment (instapaper, and formerly tumblr) is a PHP user who both read that fractal article and acknowledged it to be a pile of ass, and continues to use it.

17:04 bbloom: brehaut: yeah, there is something to be said for "gets the fucking job done"

17:04 ivan: http://scriptor.github.com/pharen/

17:05 TimMc: PHP is very effective for getting the first few pages done. (If you don't mind exploits and stuff...)

17:05 brehaut: bbloom: i certainly cant argue with his results

17:05 im trying to find marco talking about the article, but it might have been on a podcast

17:05 hyPiRion: There's a difference between "getting stuff done" and "dying because of complexity due to bad design" though

17:06 Apage43: some time ago I wrote -waaaay- too much PHP. (Which incidentally is great if you want to break PHP sites, because you learn all the mistakes in a first-hand way)

17:06 jcromartie: this is what's wrong with PHP http://php.net/quickref.php

17:06 Apage43: nowadays I can't really "think in PHP" enough to read PHP code well

17:07 bbloom: hyPiRion: yeah, which is why i feel that Rails has 100% replaced every PHP use case of value with exactly one exception: brain dead deployment

17:07 jcromartie: lol yeah, cmd+f is quick!

17:07 :-P

17:08 noprompt: i've noticed that the guys that use the "get the job done" argument have a hard time recognizing the complexity point of view

17:08 jcromartie: from what I can gather, there are ~4600 PHP functions in a single global namespace

17:08 bbloom: it's simply chaos theory & evolution

17:08 brehaut: bbloom: rails etc have a side disadvantage there; PHP basically dictates a lifecycle model, but with rails etc you have to take some responsibility for those decisions

17:09 bbloom: brehaut: yeah, hence the exception for it

17:09 brehaut: noprompt: thats the blub paradox in action again

17:09 jcromartie: people complain about clojure.core's admittedly massive 580 vars

17:09 pocho: My REPL in counterclockwise prints out "NullPointerException clojure.lang.Numbers.ops (Numbers.java:942)" How do I get better information.

17:09 bbloom: but the bottom line is that software is *really fucking complex* and, yet, survival of the fittest plus iteration == successful software

17:09 it also equals tons of crap software

17:09 jcromartie: pocho: (pst)

17:10 (print stack trace)

17:10 pocho: thanks

17:10 bbloom: jcromartie: i wonder if there is a way to get a count of builtins in Mathematica....

17:11 noprompt: it's all just a great big pile of hacks.

17:11 jcromartie: bbloom "over 3000"

17:11 http://reference.wolfram.com/mathematica/guide/AlphabeticalListing.html

17:11 bbloom: heh

17:11 madness.

17:12 i've been really enjoying playing with mathematica tho

17:12 noprompt: in all fairness though, php wasn't originally purposed to do the things it does now, as we all know

17:12 bbloom: i kinda wish i had a symbolic prepositional order logic available to my clojure code :-)

17:12 jcromartie: about 3500

17:12 hyPiRion: It's not really madness to have many functions in the same namespace though.

17:13 noprompt: hyPiRion: i tend to agree

17:13 hyPiRion: Well, not necessarily at least.

17:13 noprompt: hyPiRion: all though i try to avoid that in my own

17:13 bbloom: hyPiRion: only because they've done a good job of disambiguating with long names

17:13 noprompt: s/all though/although ughh cannot type today

17:13 jcromartie: the thing that might have saved PHP's reputation would have been avoiding the single global namespace

17:13 bbloom: hyPiRion: but also b/c they take the point of view that there is ONE set of semantics

17:14 noprompt: jcromartie: that and separating the templating

17:14 jcromartie: noprompt: but that was the whole appeal

17:14 noprompt: jcromartie: it's funny how you can stick arbitrary html right in the middle of a class definition

17:14 jcromartie: noprompt: one file, everything in one place

17:14 bbloom: jcromartie: Length[Names[]] returns 25,418

17:15 jcromartie: bbloom: dear god… but are those all documented?

17:15 TimMc: ,(count (ns-publics 'clojure.core))

17:15 clojurebot: 593

17:15 ivan: is it reasonable to feed all REPL output through pprint or fipp to avoid O(N^2) Emacs word-wrapping speeds, or are there even more problems with pprint/fipp?

17:15 jcromartie: ,*clojure-version*

17:15 clojurebot: {:major 1, :minor 5, :incremental 0, :qualifier "RC6"}

17:15 jcromartie: hm

17:15 bbloom: jcromartie: well many (most?) of them are just names for symbols

17:15 gfredericks: (sql/transaction (insert-records ...) (assert false)) commits the transaction

17:15 jcromartie: I'm on 1.4

17:15 TimMc: &[(clojure-version) (count (ns-publics 'clojure.core))]

17:15 lazybot: java.lang.SecurityException: You tripped the alarm! ns-publics is bad!

17:16 TimMc: D-:

17:16 bbloom: FullForm[First[Names[]]] is "\[FormalA\]"

17:16 jcromartie: gfredericks: that's a problem, eh

17:16 gfredericks: jcromartie: yeah it's screwed me up a couple times already

17:16 bbloom: or \[FormalA] rather

17:16 jcromartie: gfredericks: oh, I know why! because assert doesn't produce an Exception, it's an Error

17:16 a silly distinction

17:16 but I've basically stopped using assert for that reason

17:16 gfredericks: jcromartie: yep

17:17 bbloom: jcromartie: just catch Throwable :-)

17:17 gfredericks: jcromartie: in my case it was an OOM exception

17:17 bbloom: we have to patch java.jdbc to do that

17:17 jcromartie: bbloom: the problem is that other libraries already don't "just catch Throwable" and they need to be fixed

17:17 in fact, it's time for some pull requests

17:17 gfredericks: I'm filing a jira ticket right now

17:18 bbloom: i hope in clojure 1.6 we can get catch to be rebranded as an interop form & then move to the non-type-switching semantics of javascript

17:18 javascript has `catch (e) {` instead of `catch (Exception e) {`

17:18 noprompt: someone mentioned clojure-docs is moving?

17:20 bbloom: noprompt: there is now http://clojure-doc.org/ too

17:20 annoyingly similarly named

17:21 noprompt: well that's helpful

17:21 jcromartie: oh look bootstrap

17:21 rasmusto: jcromartie: haha, I was going to mention that

17:22 noprompt: jcromartie: don't even get me start.

17:22 technomancy: bootstrap: boring, but at least it's not ugly

17:22 jcromartie: yeah, most clients have never seen a web app that looks half as good as Bootstrap, so it's useful

17:22 noprompt: technomancy: it's superior to the user agent stylesheet that's for sure.

17:22 danielglauser: bbloom: noprompt: I believe the long term plan is to develop clojure-doc.org to the point where it encompasses clojuredocs.org then replace it

17:22 jcromartie: but I ALWAYS ALWAYS ALWAYS run into near-insurmountable conflicts

17:23 technomancy: I'm sure they wouldn't turn down a pull request with a nice custom design

17:23 noprompt: bootstrap is especially nice though for developers who have no design sense

17:23 brehaut: technomancy: on the other hand, you'd want to be sure it was what they considered a nice custom design before you commited the many hours it would take to actually do it

17:24 TimMc: "What do you mean you don't like yellow on pink?"

17:24 technomancy: <blink>

17:24 rasmusto: I have a q: why doesn't (into {}) work on seqs of seqs, does the length of each item need to be known to ensure it's 2?

17:25 brehaut: TimMc: orange on yellow. its the way of the future

17:25 TimMc: technomancy: C'mon, that's not even standards compliant, is it? #doc-view-langs-body li {

17:25 blah

17:25 ... text-decoration: blink is what you want

17:27 technomancy: the wave of the future

17:28 brehaut: wait really, its 'wave' not 'way'?

17:28 clizzin: is it possible for leiningen to run my application with a certain set of command-line arguments (aliased using :aliases in project.clj), but then also expose a repl server to connect to?

17:29 technomancy: brehaut: http://cn1.kaboodle.com/hi/img/a/0/0/c/2/AAAACvH3OhUAAAAAAAwpCA.jpg?v=1156771677000

17:30 brehaut: technomancy: lol

17:30 rasmusto: technomancy: that hash @_@

17:30 technomancy: clizzin: you can start an nrepl server from within your -main defn, or you could try something with lein-pdo

17:32 clizzin: technomancy: my main class has to be java (for sad sad reasons), so starting an nrepl server within is probably not an option. i'll check out lein-pdo. the use case is to start the app, then connect to it so i can recompile code just like in my usual clojure dev process, hopefully pdo can help with that

17:32 gfredericks: http://dev.clojure.org/jira/browse/JDBC-47

17:33 brehaut: clizzin: http://skillsmatter.com/podcast/scala/impromptu-rich-hickey-lightning-talk

17:33 clizzin: brehaut: ?

17:34 Bodil: cemerick: I was looking into producing a test framework for Cljs, at least - not a straight port of clojure.test.

17:34 brehaut: clizzin: rich hickey shows how to make java code that wraps up clojure code for when you need a java class as the front end of an api

17:34 clizzin: brehaut: gotcha. thanks!

17:35 Bodil: cemerick: Btw, I had a go at porting cljs-noderepl to Phantom, but Phantom's API is just too inadequate at this point...

17:36 noprompt: will the clojure-doc apps ever be written in clojure?

17:36 clizzin: brehaut: ahhh, but there's more to the java craziness than just the fact that it's java. i have to code against a framework that always relies on a certain class to be the main class, and then it loads a bunch of modules to run actual interesting code. kind of cool, but makes it difficult to just 'stick something in the main function' — even arbitrary java code would be awkward to add, not just clojure code

17:36 technomancy: noprompt: as soon as someone volunteers to write the HTML frontend for it

17:37 the JSON API is already written in clojure

17:37 noprompt: technomancy: what do you mean by "HTML frontend"?

17:38 technomancy: noprompt: a user interface which serves up HTML?

17:39 noprompt: wait, i'm confused. which one are we talking about? clojure-doc or clojure-docs?

17:39 technomancy: oh, I mean clojuredocs

17:39 clojure-doc.org right now is just static HTML; doing that in Clojure would be silly

17:39 noprompt: technomancy: that makes sense

17:40 technomancy: so which is the project that needs help?

17:41 technomancy: clojuredocs.org can move off rails if someone writes an HTML frontend

17:41 cemerick: Bodil: I started poking at it a bit last night; I think there might be a way to reuse the phantom REPL without getting tied in knots re: return types, etc.

17:45 Bodil: cemerick: I got as far as something speaking the cljs-noderepl protocol (essentially JSON) using a straight eval, but I couldn't get the processes talking to each other, so I gave up. fwiw, here's the Phantom side code: https://www.refheap.com/paste/11849

17:46 noprompt: technomancy: so if i'm understanding this correctly, it's just writing flat html?

17:47 cemerick: Bodil: Thanks; I'll see if I can cook something up. I can't cope with rhino anymore, can't reasonably use JDK8, and need a DOM. So... :-)

17:47 hiredman: cemerick: just like you needed a pom?

17:47 *zing*

17:48 cemerick: hey-o!

17:50 noprompt: technomancy: i guess i'd be happy to help. has anyone started on it?

17:50 technomancy: noprompt: not the HTML part; dakrone was looking for volunteers last I checked

17:50 Bodil: cemerick: Worst case, there's always Node and https://github.com/tmpvar/jsdom

17:51 noprompt: sure i could spare a few hours a week to help if it can move the needle forward.

17:52 bbloom: dnolen: i finally think i have a strong enough foundational understanding of logic to really dig into core.logic... i've been reading wikipedia for like 3 days, heh

17:52 cemerick: Bodil: Perhaps. I'm blissfully ignorant of node, and hope to stay that way. Plus, I figure between phantomjs and figuring out whatever XUL madness will be needed for headless moz, I can have some confidence that test results actually correspond to users' browsers, etc.

17:54 dnolen: bbloom: hehe, it's not clear to me just how much understanding of first order logic helps understanding a Prolog-like system

17:54 bbloom: dnolen: it's mostly terminology, historical context, motivation, etc

17:55 Bodil: cemerick: Well... having done a fair bit of JS-on-QtWebkit dev, I wouldn't trust Phantom to correspond to Chrome or Safari, but at least it'd be much closer than jsdom's emulation. Also, it can generate screenshots. :)

17:55 dnolen: bbloom: yes, my grasp of that stuff is still pretty poor. Art of Prolog is a good resource as far as that goes it seems

17:56 bbloom: dnolen: as discussed: i'm interested in predicate dispatch, but i think it should have an underlying a predicate logic sublanguage... mainly b/c i'm gonna want slightly different syntax and semantics than a more general predicate dispatch system

17:57 i saw that there is such a thing in the minikaren paper & that there is an impl on core.logic, but i'm not to that level of understanding yet :-)

17:57 dnolen: also, relations make me want binary operators instead of prefix notation :-/

17:59 clizzin: hmm lein-pdo doesn't do what i want because the repl and app run as separate processes :( cc technomancy, brehaut fyi

17:59 dnolen: bbloom: you saw a predicate dispatch ref in the miniKanren paper? I don't recall that.

17:59 bbloom: dnolen: no, predicate logic

17:59 dnolen: https://github.com/namin/leanTAP

17:59 dnolen: bbloom: oops, heh yes

17:59 technomancy: clizzin: oh yeah; hm. maybe start a repl, then do `lein run` using :eval-in :nrepl, but that requires using lein master

18:03 cemerick: Bodil: anything to keep me out of the browser variation funhouse as much as possible :-)

18:17 dnolen: hopefully closing in on zero-overhead invocation for non-native IFn types http://github.com/clojure/clojurescript/commit/9e360428682659f8882ad0e9e0ba804f7a509d32

18:17 for CLJS

18:17 ohpauleez: dnolen: wooo!

18:17 dnolen: ohpauleez: we can't fix generic code over course, code that accepts JS fns

18:18 ohpauleez: sure

18:18 dnolen: ohpauleez: but it does mean if you know you're only going to use CLJS fns (which you can specify w/ the ^non-native type-hint), you won't pay.

18:18 ohpauleez: dnolen: This is really great stuff

18:21 dnolen: this also means that deftypes / records that implement IFn could be significantly faster when using ClojureScript data structures as functions.

18:21 if that's in place then more inference in the compiler could really pay off.

18:22 noprompt: are there any serious design flaws in clojure (looking for an honest answer, not trolling, etc)?

18:23 ohpauleez: noprompt: with regards to what?

18:23 brehaut: noprompt: depends who you ask ;)

18:23 noprompt: ask a haskell and scala guy, and they'll point to the lack of a static type system

18:23 TimMc: Huh, https://wiki.theory.org/YourLanguageSucks doesn't have a Clojure entry.

18:24 brehaut: TimMc: php has quite a short list

18:24 noprompt: brehaut: ohpauleez: i'm thinking in the context of our discussion on php

18:24 TimMc: noprompt: Off the top of my head, macros that emit references to private vars in their namespace will cause compile errors.

18:25 brehaut: quirky reloading behaviour for multis and protocols

18:25 ohpauleez: noprompt: After seeing how CLJS was implemented (after the creation/addition of protocols), one might argue that Clojure's implementation could be "better"

18:25 TimMc: There's some JVM-based shittiness around hashing of numeric types.

18:25 brehaut: and anything multiple classloaders related

18:26 bbloom: ohpauleez: agreed. we need protocols for the core abstractions on the JVM

18:26 dnolen: there's lots to complain about Clojure - which as they saying goes - means people actually use it

18:26 ohpauleez: noprompt: Exceptions are a mess and the community is still figuring out how to best tackle that. There are two types of naming for Clojure functions. Two words separated with a dash (Common Lisp style) and two words smashed together (Clojure/Python/Ruby style)

18:26 bbloom: noprompt: they primitives (do, let, loop, recur, etc) should have been namespaced!

18:27 ohpauleez: if the function is found in common lisp, it uses a dash in Clojure, otherwise it doesn't

18:28 bbloom: ohpauleez: *shrug* it took me a while, but i've finally gotten over extreme naming consistency, particularly for builtins and other things you use *a lot*

18:28 ohpauleez: All of that said, Clojure (and especially CLJS) fix a lot of issues and inconsistencies with their platforms

18:28 bbloom: i disagree w/ paul graham about short names always being better, but for shit you use ALL THE TIME, i'm A-OK with it

18:28 ohpauleez: bbloom: Oh totally, I have no issue with it at all

18:28 noprompt: bbloom: of the same mind

18:28 brehaut: realized?

18:28 ,(realized? (iterate 1 inc))

18:28 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IPending>

18:29 TimMc: noprompt: You can try wading through very old tickets on JIRA if you want to find some more.

18:29 bbloom: i also kinda like how .javaismsMakeThemselvesKnown WithObvious. MarkingsOf/SORTS

18:29 ohpauleez: I don't care much about names - we all have auto-complete, we all have an interactive environment, docs are easy to get through

18:29 noprompt: ohpauleez: +1

18:29 TimMc: I still don't use autocomplete with Clojure.

18:29 I really should.

18:29 bbloom: the different-ness makes me less likely to eliminate java-isms for the sake of eliminating java-isms. if they were closer, i'd be annoyed about that last 10% :-)

18:30 i haven't used auto complete for *anything* in nearly 5 years

18:30 ohpauleez: TimMc: most certainly

18:30 brehaut: bbloom: i agree with that

18:30 ohpauleez: bbloom: Not even ctrl-n?

18:30 noprompt: i'm still in the "honeymoon" phase of using clojure so i haven't bumped in to some of these issues

18:31 bbloom: ohpauleez: extremely rarely.... i only ever use it when i have mispelled something 4 times & i want to preemptively spell check myself

18:31 ohpauleez: noprompt: There's a talk by Chas Emerick about "Clojure Sucks and why you'll love it anyway

18:31 "

18:31 bbloom: You're potentially a faster typer than me, and don't make as many spelling mistakes :)

18:32 noprompt: my stress level is usually pretty low while using clojure, but if i'm going to have discussions with programmers about why X language has a bad design, in fairness i feel i should be able to point out clojure flaws as well

18:32 bbloom: ohpauleez: i switched to vim full time roughly around the same time that i switched to mac roughly around the same time i switched to a kensis contoured keyboard roughly around the same time i learned to touch type roughly around the time i gave up on auto complete :-)

18:32 noprompt: i've been using a plugin called "you complete me" for vim that has been very nice

18:33 brehaut: noprompt: amusingly, some of the flaws are in things that you just couldnt do in other languages

18:33 amalloy: i wonder if i could get my pen to tab-complete for the rare occasions i can't use a keyboard

18:33 bbloom: i find auto complete & other as-you-type UI/UX to be distracting. i'd much prefer all that stuff be delayed until i stop typing for a second or two

18:34 TimMc: Oh, auto-complete vs. tab-complete... good point. The latter is good, the former sucks.

18:34 ohpauleez: noprompt: I'm not sure who said it - but there's a quote, "Most languages focus on getting the smaller consistencies right - like function naming - and miss on tackling the larger, harder issues. Clojure focused on solving the larger, harder issues - like concurrency - and didn't favor naming consistency as much

18:34 noprompt: bbloom: the color scheme i use keeps that distraction at a minimum

18:35 ohpauleez: bbloom: I never do -as-I-type, I think it's super distracting too - but I use ctrl-n, ctrl-o

18:35 noprompt: bbloom: but i can see how it could get distracting

18:35 ohpauleez: i don't like having to hit more than one button at a time if i can avoid it

18:35 brehaut: noprompt: theres certainly nothing in clojure like wtf did python do to scoping rules :P

18:35 noprompt: ohpauleez: which is why i've failed at emacs so many times

18:36 i'm jealous of emacs though

18:36 well, some parts of it anyway

18:36 bbloom: noprompt: sometimes i wish i could disable syntax highlighting for the line i'm currently editing

18:36 noprompt: brehaut: that's sort of what i was looking for

18:36 bbloom: b/c if i mistype a builtin or something & the syntax highlighting doesn't show up right, i fix the typo and then FORGET WHAT I WAS FUCKING TYPING

18:36 noprompt: bbloom: i think you might be able to do that

18:37 bbloom: my thought process is exceedingly fragile sometimes :-P

18:37 noprompt: bbloom: you may have to tweak the highlighting rule for cursorline which i *think* you can

18:38 bbloom: noprompt: eh, i avoid VimL as much as i can :-P

18:38 noprompt: bbloom: yes it's disgusting

18:38 bbloom: i just assume tpope knows what's best for me

18:38 noprompt: bbloom: still working on it https://github.com/noprompt/lite-brite/blob/master/colors/lite-brite.vim

18:41 bbloom: this should do it :hi CursorLine guibg=NONE guifg=#ffffff

18:41 then use :set cursorline

18:42 obviously if you use vim in the terminal you'll need need to set ctermfg and ctermbg respectively

18:42 bbloom: noprompt: you assume i use a dark terminal :-P i don't heh

18:42 noprompt: bbloom: sure, that's just the basic idea

18:42 bbloom: noprompt: i know, thx

18:42 noprompt: bbloom: do you know your terminal bg color?

18:42 bbloom: white.

18:42 :-P

18:43 noprompt: bbloom: well that one's easy then!

18:43 :hi CursorLine ctermbg=15 ctermfg=0

18:43 you could toss that in your .vimrc should work out if you don't switch your theme

18:44 bbloom: thx i'll try it out a bit later

18:44 noprompt: bbloom: i like to think i know a bit about color scheming in vim :)

18:45 doug crock ford had a neat concept about context sensitive highlighting

18:45 scoped highlighting

18:45 not sure how you could pull that off in vim though

18:47 bbloom: do you use vimclojure?

18:47 bbloom: no, tpope/vim-foreplay

18:48 noprompt: does that one let you start a repl inside vim?

18:49 bbloom: noprompt: it lets you evaluate forms & stores an evaluation log a-la the macro log, but there is no terminal emulation or anything like that

18:49 noprompt: darn

18:49 bbloom: noprompt: nah, i prefer it this way

18:50 cmd+tab lets me get to a real repl running in the same JVM anyway

18:50 noprompt: maybe i'll give it another shot

18:50 i really like vimclojure but there are a few things that annoy me about it

18:50 the biggest one being the way it seems to fuck up copy/paste

18:51 ivan: http://userscripts.org/scripts/review/108797 javadoc sanity restored

18:52 noprompt: what's the doc style for clojure?

18:54 Raynes: Two quotes and text between them.

18:55 noprompt: Raynes: nice :)

18:55 bbloom: "This is a string that is useful and not redundant and doesn't treat me like a 5 year old, but still helps me in a meaningful way"

18:56 noprompt: so clojure doesn't have a javadoc equivalent?

18:56 or yardoc or whatever

18:56 bbloom: ##(doc doc)

18:56 lazybot: ⇒ "Macro ([s]); "

18:56 technomancy: noprompt: you can generate HTML documentation, but it's not nearly as useful

18:56 bbloom: (doc doc)

18:56 clojurebot: "([name]); Prints documentation for a var or special form given its name"

18:57 bbloom: (doc source)

18:57 technomancy: since you have everything available in the repl

18:57 Raynes: https://github.com/weavejester/codox, https://github.com/tomfaulhaber/autodoc, https://github.com/fogus/marginalia

18:57 bbloom: (doc source) ; i said dammti!

18:57 Raynes: &(doc clojure.repl/doc)

18:57 lazybot: ⇒ "Macro ([name]); Prints documentation for a var or special form given its name"

18:57 Raynes: bbloom: lrn2clj

18:57 hiredman: ,source

18:57 clojurebot: #<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.repl/source, compiling:(NO_SOURCE_PATH:0:0)>

18:57 hiredman: ,(doc source)

18:57 clojurebot: "([n]); Prints the source code for the given symbol, if it can find it. This requires that the symbol resolve to a Var defined in a namespace for which the .clj is in the classpath. Example: (source filter)"

18:57 bbloom: Raynes: i can't read or write

18:57 hiredman: hmmm

18:58 Raynes: bbloom: I can teach you.

19:00 noprompt: marginalia looks nice

19:03 TimMc: technomancy: (doc ...) is useful if you already know what you want.

19:03 HTML docs are good for getting an overview.

19:03 bbloom: TimMc: overviews are good for overviews

19:04 TimMc: by that i mean prose & exposition

19:04 TimMc: if you need a reference, use doc or look at the source :-)

19:04 amalloy: bbloom: your (doc source) attempts were failing because you had inserted a U+007F character before the ( character

19:04 bbloom: amalloy: how the hell did i do that?

19:04 amalloy: *shrug*

19:04 bbloom: that's what? a delete?

19:05 amalloy: yes

19:05 bbloom: (doc inc)

19:05 clojurebot: "([x]); Returns a number one greater than num. Does not auto-promote longs, will throw on overflow. See also: inc'"

19:05 bbloom: (doc inc)

19:05 clojurebot: "([x]); Returns a number one greater than num. Does not auto-promote longs, will throw on overflow. See also: inc'"

19:05 bbloom: (doc inc)

19:05 clojurebot: "([x]); Returns a number one greater than num. Does not auto-promote longs, will throw on overflow. See also: inc'"

19:05 bbloom: yeah, i can't repro that

19:06 muhoo: http://clojure-doc.org/ is 504?

19:06 SegFaultAX: muhoo: clojuredocs.org?

19:07 clojure-doc.org works for me. http://www.downforeveryoneorjustme.com/clojure-doc.org

19:15 noprompt: anyone going to clojure west?

19:15 patchwork: Alright, for json: cheshire or data.json?

19:16 bbloom: noprompt: lots of smart folks! sign up

19:16 technomancy: cheshire

19:16 patchwork: pros/cons?

19:16 noprompt: patchwork: i like data.json

19:16 patchwork: but haven't used the other

19:16 brehaut: patchwork: from memory cheshire is really fast

19:16 technomancy: cheshire uses jackson, which has seen a lot more use. plus its maintainer is super-responsive

19:16 and you don't have to use jira to contribute

19:16 noprompt: bbloom: went to w3conf last week. it was fun, but not exactly mind expanding.

19:17 patchwork: I definitely need speed, thanks guys! Cheshire it is

19:17 noprompt: bbloom: clojure west looks like the ticket.

19:17 bbloom: noprompt: i'm not much of a conference or meetups sort of guy, but everyone i meet involved with clojure is awesome

19:17 i'm speaking at clojure/west too :-)

19:17 Frozenlock: Would `(into #{} ...) be the idiomatic way of getting a coll without duplicates?

19:17 noprompt: bbloom: in that case i'm sold, ha!

19:17 bbloom: Frozenlock: ##(set [1 1 2 3 3])

19:17 lazybot: ⇒ #{1 2 3}

19:17 brehaut: ,(distinct [1 1 2 3 4 4)

19:17 clojurebot: #<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>

19:18 brehaut: ,(distinct [1 1 2 3 4 4])

19:18 clojurebot: (1 2 3 4)

19:18 bbloom: however:

19:18 ,(distinct [1 2 1 2])

19:18 clojurebot: (1 2)

19:18 bbloom: oh nevermind

19:18 set vs seq

19:18 i thought distinct only worked on sorted data, my bad

19:18 brehaut: Frozenlock: it depends if you need the resulting collection to hang about and have more potential duplicates added to it

19:20 Frozenlock: Ah! Can't believe I forgot about `distinct'.

19:20 No this should be created and used as is.

19:20 However if I use a set, I could reduce it...

19:21 brehaut: Frozenlock, bbloom: distinct uses a set underneath, so i guess only use distinct if you need to maintain ordering or handle an infinite stream?

19:21 bbloom: brehaut: well, if it's an infinite stream, you better hope it's elements are of a finite domain :-)

19:22 brehaut: bbloom: indeed :)

19:22 bbloom: i use sets a lot in clojure

19:22 i quite like them

19:22 brehaut: likewise; sets are great to have

19:23 i was always surprised it took dotnet so long to get a real set collection

19:24 rabbit_airstrike: As a Portland resident, I'm looking forward to clojure/west :)

19:24 bbloom: brehaut: i just checked MSDN. holy hell! 4.0? for ISet? seriously!? wow

19:24 brehaut: i know! bananas eh

19:25 bbloom: brehaut: well apparently HashSet<T> was in 3.5

19:25 brehaut: thats really not much better

19:26 bbloom: brehaut: oh, you know why.... IList has a Contains function

19:26 there was like UniqueList or something that was really a set

19:26 brehaut: bbloom: roffles

19:27 bbloom: and everyone else just faked it with a map<T,Bool>

19:27 bbloom: yeah, interfaces are vastly inferior compared to type classes aka protocols aka golang interfaces aka ad hoc polymorphism aka not broken abstraction model

19:27 brehaut: definately

19:28 bbloom: i really like the idea that the fundamental defition of a collection is reducibility, instead of traversability

19:28 brehaut: im a bit torn about whether i prefer typeclasses or protocols. the former is way more expressive, but it lets some really squirrel resolution occur

19:28 bbloom: brehaut: more expressive in what way?

19:29 (side note: i have written more ReadOnlyCollection wrappers than I care to admit)

19:29 brehaut: bbloom: haskell lets you write some remarkably complex abstract types for typeclasses; two abstract types with different implementations of the same typeclass can exist for the same concrete type

19:30 bbloom: brehaut: oh yeah, but that's pretty much just delegation. you can write a macro to do that :-P

19:32 brehaut: bbloom: oh sure, you can fake it out (pretty much like typeclasses do anyway) but the fundamental restriction of protocols to act on a single type (that isnt abstracted over other types) makes it much easier to reason about

19:34 (where 'fake' wrt it comes to macros is not really that fake)

19:55 tyler_: foo is to function as (foo) is to what?

19:55 bbloom: tyler_: a function invocation

19:55 tyler_: or a "call site"

19:55 tyler_: bbloom: thnx

19:55 bbloom: tyler_: or "function application"

19:56 tyler_: i like functional application

19:56 kinda rolls off the tongue

19:56 s/functional/function/

19:56 bbloom: usage of those terms tends to vary on context & connotation

19:57 Oddman: call site reminds me of call centers

19:57 * Oddman shivers

19:58 brehaut: bbloom: ive not heard call site used outside of talking about language implementations.

19:59 bbloom: brehaut: *shrug* "call site" is useful for explicitly differentiating from declaration sites :-)

19:59 brehaut: sure. i was just curious if it was more general than i realised

20:00 dnolen: hrm

20:00 I take it most CLJS users find it convenient that CLJS fns are regular JS fns \cc ibdknox

20:01 bbloom: dnolen: as opposed to objects with an invoke method?

20:01 dnolen: bbloom: yeah

20:02 bbloom: I think any optimization I might have in mind are foiled by RestFns

20:02 bbloom: dnolen: it's definitely convenient to be able to pass a function to 3rd party code without having to marshall it

20:02 noprompt: dnolen: yes i like that

20:02 bbloom: dnolen: basically any code that hooks dom events is gonna be in that boat

20:02 dnolen: bbloom: yep

20:03 so I'm not sure if we can actually optimize CLJS fns because of the rest argument case

20:03 noprompt: dnolen: my biggest gripe is (array) vs [] (js-obj) vs {}, however it's not a that big of a deal

20:04 dnolen: i'm sure that design is intentional and with good reason

20:04 i have no problem using clj->js

20:04 bbloom: noprompt: javascript arrays and objects are mutable, clojurescript vectors and maps are not

20:04 dnolen: noprompt: by design

20:04 hiredman: dnolen: can't you do something like what AFn does?

20:05 maybe you already do, I am not up to date

20:06 noprompt: the cljs code tends to look a little awkward with things like angularjs

20:06 dnolen: hiredman: yeah we could could build a proper AFn/IFn/RestFn type/protocol, which is what I had in mind. The problem is you can't pass that to JS libs.

20:06 noprompt: in a way i feel like that's what stateful code actually looks like - ugly

20:06 hiredman: generate a generic function that dispatches to function$arity and for known native cljs functions call function$arity directly?

20:07 dnolen: hiredman: yeah we already do something like that, the issue is in the case of (reduce f ...)

20:07 we don't know if f is native or not

20:07 so we can't optimize it

20:07 assume we know it's *not* native

20:08 we still don't know if it's rest fn or not

20:08 we could provide a RestFn type but then, RestFns can't interop w/ JS

20:09 hiredman: hmmm

20:10 and you cannot cover every possible arity there hmmm

20:10 dnolen: hiredman: yeah

20:10 it really boils down to interop w/ JS. If we tossed that out, we could do this easily w/ prototypal inheritance to avoid code explosion.

20:12 ibdknox: dnolen: I'd have to think about it, but my suspicion is that such a change would kill virtually all the code that is out there right now. haha

20:12 dnolen: ibdknox: haha

20:12 bbloom: dnolen: i dunno much about RestFn in Clojure

20:12 dnolen: ibdknox: yeah

20:16 ibdknox: dnolen: how big of a difference do you think it would really make?

20:16 bbloom: dnolen: are all usages of `arguments` inherently slow?

20:16 Raynes: ibdknox: I was complaining about you earlier.

20:16 ibdknox: Raynes: sounds legit. :p

20:18 Raynes: what's up?

20:18 Raynes: ibdknox: You named some functions in noir's validation library with question marks at the end but they didn't return booleans.

20:18 I personally think you're the devil.

20:18 ibdknox: ah

20:19 lol

20:19 does everyone do that?

20:19 bbloom: i don't think i've ever succeeded in using `some without first trying `some?

20:21 dnolen: bbloom: arguments is slow, ~1.5-2X hit depending on engine

20:22 ibdknox: probably ~1.5-2X depending on engine? My spidey sense says the current situtation affects inlining

20:23 bbloom: dnolen: so you want dispatch to always go to the arity-named overload, which you think prototypical inheritence can help you by simulating AFn's invoke overloads and subclasses?

20:23 * dnolen should probably look at the v8 dissambler output

20:24 dnolen: bbloom: yes go directly in the case of ^not-native - no testing

20:24 bbloom: non rest-fns are easy arity to dispatch is clear - only rest fns are tricky

20:25 hiredman: obviously the answer is to make clojurescript a lisp-3, one namespace for clojurescript functions, one for clojurescript values, and one for javascript

20:25 dnolen: hiredman: heh

20:26 bbloom: dnolen: so RestFn has one subclass that is never instantiated (from what i can tell)

20:27 and RestFn is only ever instantiated by WithMeta

20:27 withMeta, rather

20:27 oh, and by the 'list function in core

20:28 either way, i don't think the concrete type is strictly necessary.... so what exactly do you need them for?

20:28 dnolen: ibdknox: to be honest this change probaby won't make a big difference to most code - mostly core.cljs implementation and few places in codebases where perf is critical (cljs.reader, core.logic, stuff like that)

20:29 bbloom: to avoid code duplication.

20:29 bbloom: dnolen: existing duplication? or new duplication to be introduced by an optimization?

20:29 dnolen: bbloom: to avoid duplication if we introduced the optimization.

20:30 amalloy: &(instance? clojure.lang.RestFn swap!)

20:30 lazybot: ⇒ true

20:30 amalloy: bbloom: any function that accepts varargs is a RestFn

20:30 bbloom: amalloy: hm, interesting... i can't tell where that happens... maybe in the generated byte code by the compiler?

20:30 amalloy: yes, i think so

20:31 bbloom: aahhh, yes ok, i see now

20:31 it's used via getType at some point

20:31 thanks

20:31 i thought it was just a helper class for the sake of Java code

20:31 dnolen: hrm, I wonder if we could detect interop and auto-marshal CLJS fns?

20:32 we could taint js/foo and external libs ...

20:32 bbloom: dnolen: i thought that too, but you can't b/c you would need full type inference

20:32 (defn foo [x] (js/bar x))

20:32 you'd need to marshall all args

20:33 frenchyp: in clojure.java.jdbc, when using connection pooling, am i supposed to use (sql/with-connection (db/db-connection) ..)?

20:33 and in that case , is the connection returned to the pool or actually closed ?

20:33 dnolen: bbloom: but it's obvious there that we need to wrap x

20:33 hiredman: frenchyp: clojure.java.jdbc doesn't have connection pooling

20:33 bbloom: dnolen: what if x is a number?

20:34 dnolen: or a string?

20:34 dnolen: bbloom: do what cljs.core._truth does, test it

20:34 frenchyp: hiredman: I am referring to http://clojure.github.com/java.jdbc/doc/clojure/java/jdbc/ConnectionPooling.html

20:34 hiredman: frenchyp: if you use something like c3p0 then you connect to c3p0 just like you connect to a database

20:34 dnolen: bbloom: it's a CLJS fn, wrap it

20:34 bbloom: dnolen: then you're paying a test cost for every arg for interop calls

20:34 and you need interop to perform well

20:34 so there can't be any calling over head

20:35 also, how are you going to call functions in clojurescript returned from javascript?

20:35 dnolen: bbloom: CLJS fns pass to JS are already slow if multiple arity or variadic

20:35 bbloom: yeah, but you're going to break or slow interop for all other cases by adding arg tests

20:35 frenchyp: hiredman: k thanks

20:37 dnolen: bbloom: arg tests happen once, you pay for exactly one property lookup

20:37 per arg

20:38 bbloom: not saying we should do this, but probably worth investigating in a branch, w/ interop benchmarks

20:40 bbloom: hrm but you are right. the inference sounds complicated.

20:41 if not impossible :)

20:44 bbloom: dnolen: :-)

20:44 gotta run

21:19 dog_cat11: why does lein sometimes go into "repley.eval-mode.nreple" ns instead of the project my pwd is in?

21:23 noprompt: dnolen: is there another way to do property access in cljs aside from (.-prop o)

21:25 ivan: http://blog.headius.com/2012/11/refining-ruby.html Ruby gets an insane version of protocols?

21:26 alandipert: noprompt: (aget o "prop")

21:26 noprompt: alandipert: ah, thanks

21:27 just what i was looking for

21:27 dog_cat11: nvm, it was because of an error compiling one of my files

21:32 dnolen: noprompt: but note that's really only for interop

21:35 noprompt: dnolen: i'm trying to eliminate some duplication in my angularjs code and (set! (.-prop $scope) …) is becoming a bit unweildy

21:37 dnolen: if you need to set several properties at once is there a better route to go?

21:37 dnolen: noprompt: I don't know angular.js so I can't provide much insight. Don't forget a lot tedious boilerplate can often be eliminated via a simple macro.

21:37 amalloy: noprompt: so figure out what's being unnecessarily repeated, and write a macro that does the unnecessary parts for you

21:43 noprompt: dnolen: amalloy: good call, i haven't ventured in cljs macros

21:45 dnolen: noprompt: sadly it's a bit tricky if you're not used to macros in CLJ, but if you've got that under you belt - it's pretty convenient

21:45 noprompt: i'm thinking i may need to use anamorphic macros

21:45 yeah i love macros in clj

21:46 i've never written anamorphic ones, so i was trying to avoid doing that

21:46 even though i think in the case of angulajs it might make sense

21:47 dnolen: what should i watch out for with cljs?

21:48 dnolen: noprompt: heh, lots of stuff. but keep asking questions here and on Clojure/ClojureScript mailing list and you should be OK.

21:48 noprompt: sure thing :)

21:48 dnolen: noprompt: O'Reilly book looked pretty as well - though lein-cljsbuild info may be out of date now.

21:48 pretty good I mean

21:49 aib: is there a version of case which works with non-compile-time literals, e.g. a static field?

21:49 dnolen: aib: no

21:49 noprompt: dnolen: yeah i've got that one, but i'm thinking i may sign up for the cljs class at clojure west to round out everything

21:49 dnolen: noprompt: yeah that'll be good. Relevance is doing a lot of CLJS it sounds like.

21:53 piranha: alandipert: are you by any chance here? :)

21:53 alandipert: piranha: of course dude

21:54 noprompt: dnolen: oh man, i think i should have been considering macros a little sooner. just cleaned up several lines.

21:54 dnolen: noprompt: it's pretty slick :)

21:54 alandipert: noprompt: only one little expression in your program needs to not be a macro so it will run, otherwise you can write all macros and it rules :-)

21:55 piranha: alandipert: haha, cool. :) I have a code like this: http://paste.in.ua/8055/ - and log is not executed on swap! - what is wrong here?

21:55 dnolen: noprompt: imagine my excited when I realized core.match could work in ClojureScript by changing 10 lines of code.

21:55 excitement

21:56 the bits of tools.macro I've tried also works just fine w/ CLJS which is pretty cool.

21:56 alandipert: piranha: hm. advanced mode compile?

21:57 piranha: alandipert: nope, I'll post my project.clj, just a second

21:57 noprompt: it's probably over my head at this point, but i'd love to get an understanding of how the macros are compiled to js

21:57 alandipert: piranha: cool. i take it the log on line 9 prints the right thing?

21:57 piranha: it does

21:57 alandipert: if you want, I can put whole code on github, so you can see it yourself

21:58 dnolen: noprompt: it's not very complicated. Macro just get expanded until there's nothing left to do, then that code is passed to the compiler.

21:58 alandipert: piranha: i can run it here myself no problem, 1 sec

21:58 piranha: alandipert: it actually prints stuff first time as well, when I create a new cell, but not on swap!

21:58 dnolen: noprompt: pretty much how it works on Clojure JVM

22:00 noprompt: dnolen: that's fascinating. it just seems like something so powerful would be more complex.

22:00 alandipert: piranha: so, you need to quote the map :-)

22:00 piranha: if you don't, it gets "lifted" to a formula

22:00 piranha: alandipert: ah!

22:00 dnolen: noprompt: beauty of lisp!

22:00 noprompt: dnolen: i'll say.

22:00 piranha: alandipert: I was wondering why do you quote a map in your code, but forgot to ask and then forgot to quote myself

22:01 dnolen: noprompt: while a lot of the macros in CLJS are complex and ugly, I fear how nasty the compiler would be w/o them.

22:01 piranha: alandipert: maybe it should be mentioned in readme somehow :)

22:01 alandipert: piranha: yeah, otherwise it turns into the formula of (cell (hash-map x y etc..))

22:01 piranha: it is but it's not very prominent

22:01 brehaut: out of curiosity is there a fixed point combinator in clojure ?

22:01 dnolen: noprompt: actual CLJS compiler is still less < 1000 lines of code.

22:01 piranha: alandipert: yeah, I just searched and it's hard to grasp :)

22:01 brehaut: (not Y )

22:02 alandipert: piranha: i'll add a map example to the Input Cell section since that's pretty common

22:02 amalloy: brehaut: none built in, but of course you can write it

22:03 noprompt: dnolen: really? that's incredible. i mean a 1000 lines of lisp is nothing to sneeze at, but wow.

22:03 piranha: alandipert: thanks :)

22:03 noprompt: dnolen: never would have guessed. i need to take a look at it. compilers are neat.

22:03 dnolen: noprompt: yep, ~1000 lines of analyzer, ~1000 lines of compiler, ~1000 lines of macros

22:04 noprompt: dnolen: so wait, core.match, what's that for again?

22:04 piranha: alandipert: hm, I quoted it and still no luck: (cell (.log js/console (clj->js 'world))) - or should I quote whole expression?

22:04 dnolen: noprompt: pattern matching a la Racket, OCaml, Haskell, Scala

22:04 alandipert: piranha: (def world (cell '{:stuff :test}))

22:04 piranha: ah %)

22:04 alandipert: thanks, it works! :)

22:05 noprompt: dnolen: ok, now i'm really excited.

22:05 alandipert: piranha: sweeeet

22:05 !

22:05 noprompt: why i never used irc in the passed...

22:05 s/passed/past

22:06 Frozenlock: noprompt: IRC is a forgotten gem

22:06 noprompt: this room alone has been like a knowledge christmas.

22:07 dnolen: thanks for all the info!

22:07 dnolen: noprompt: np

22:07 noprompt: *giddy*

22:16 alandipert: piranha: added a couple more examples: https://github.com/tailrecursion/javelin/blob/master/README.md#input-cells-and-formula-cells

22:18 piranha: alandipert: thanks!

22:19 ah, makes sense :)

22:28 noprompt: dnolen: so macro expansion for cljs happens at compile time?

22:28 s/so/does

22:29 dnolen: noprompt: yes, only compile time macros, no runtime macros

22:29 for now

22:30 noprompt: so cool

22:30 well, that's it for me today. gotta run.

22:31 thanks everyone!

22:31 alandipert: that dude was cool

22:50 dcolish: if i have two functions which are of pretty much the same form, like these https://gist.github.com/dcolish/5044900, is that the point where a macro might make sense?

22:52 xeqi: anyone submitting to lambdajam? http://lambdajam.com/cfp/

22:53 Raynes: Where do I have to jam the lambda?

22:53 amalloy: dcolish: that looks like just a reduce

22:53 alandipert: dcolish: i'd probably pass in a function representing the difference. for me anyway, not macro-level yet

22:54 xeqi: Raynes: in a bot

22:54 Raynes: Sounds painful, xeqi.

22:54 dcolish: amalloy: could you elaborate? i dont quite follow

22:54 alandipert: dcolish: +1 what amalloy said, and your reduce function is what's different between them

22:55 amalloy: busy atm. someone elaborate for me

22:55 dcolish: i mean i know what a reduce does, i just dont see how it is an example of one

22:55 kk

22:56 Raynes: lol

22:56 dcolish: hmm, maybe i'm thinking of reduce in a completely different way

22:57 alandipert: dcolish: https://www.refheap.com/paste/11862

22:57 dcolish: untested but i'm guessing that's what amalloy has in mind?

22:58 dnolen: hm

22:59 I think I may have a solution to at least optimizing non-variadic ClojureScript fns

22:59 ^not-native + -invoke

23:04 piranha: alandipert: how do I merge one cell into another? :) (cell (swap! world assoc-in [:form] form-cell)) complains :)

23:06 alandipert: piranha: (cell (assoc-in world [:form] form-cell)) should do it

23:06 piranha: formula cell of the merge

23:06 piranha: oh, ok

23:07 alandipert: piranha: you should really only ever swap input cells

23:07 piranha: alandipert: well, idea is that 'world' is an input cell...

23:07 alandipert: piranha: i see, hm

23:08 piranha: and form is a cell I get from a form inputs, and I wanted to put everything in world back

23:08 alandipert: piranha: well, you could do (swap! world assoc-in [:form] @form-cell) of course, but then you leave FRP land

23:08 piranha: indeed!

23:08 and it won't update on form-cell changes :)

23:08 which is what I want, of course :)

23:09 alandipert: piranha: maybe what's updating form-cell should actually be updating world?

23:09 piranha: well... this means I should pass world inside of something instead of returning a cell from a form

23:09 and returning a cell with values seems to be more natural to me, honestly - this way form has no idea how data is used

23:10 it just returns data and doesn't care what's next

23:10 octagon: hallo

23:10 alandipert: piranha: octagon is micha and collaborator in FRP heresy

23:10 piranha: alandipert: (cell (assoc-in world [:form] formC)) doesn't seem to be working

23:10 ah cool :)

23:12 alandipert: piranha: perhaps you could paste codes?

23:12 piranha: I could, but it's a bit dirty :)) anyway, just a second

23:15 alandipert: here is the initialization: https://github.com/piranha/pairword/blob/master/src/pairwords/game.cljs#L18

23:16 and here are templates: https://github.com/piranha/pairword/blob/master/src/pairwords/tempjave.cljs#L24

23:17 alandipert: piranha: reading, thanks

23:17 piranha: I'm sorry for the amount of commented code there, it's just for a friend who is tracking loosely what's going on there

23:18 octagon: piranha: have you seen this: https://github.com/lynaghk/todoFRP/blob/master/todo/hlisp-javelin/src/include/index.cljs

23:18 alandipert: octagon: i tried to indoctrinate him already

23:20 piranha: octagon: yeah, but I'm wary of do='' notation in html files, to be honest :)

23:20 it's a bit similar to onclick and knockout.js, and I don't like both of them :))

23:20 octagon: piranha: yeah that may not be what you want, but the thing i linked is the FRP underpinnings

23:21 piranha: the structure is the base "world" cell, and then there are a number of functions that mutate that

23:21 alandipert: piranha: so world is kind of a dependency of form? maybe it makes sense to arrange them that way

23:22 octagon: piranha: the state mutating functions are called when the user manipulates the interface, meaning lick on something, submit a form, etc

23:22 alandipert: piranha: where world is a formula cell backed by n form cells

23:22 octagon: s/lick/click/

23:23 piranha: the main idea there being that DOM elements are I/O devices only; no data is stored there

23:23 piranha: alandipert: hmm... maybe I just should not join them, in the end - I just liked the idea of having big hashmap with whole world inside of it, i.e. all the data I have

23:24 alandipert: piranha: that's definitely the way to do it i think

23:24 piranha: and then on click somebody just moves data around inside of this world, not touching other pieces of data

23:24 alandipert: piranha: and a set of functions to transition the world from one state to the next, when events happen

23:24 piranha: aha... but I could have form and world in separate cells

23:24 alandipert: piranha: and then a bunch of event-agnostic IO formulas that effect DOM stuff when the world value changes

23:25 piranha: indeed, but then how do I get values from form into my world without my form knowing full path? :)

23:25 I could pass world and partial path, of course, but that seems a bit backwards

23:25 octagon: piranha: i think it's useful to have cells backing form elements, so you don't have to store data in the dom form

23:26 piranha: octagon: well I do have it :)

23:26 it's :form in my world

23:26 but then I want to merge form data back into world

23:26 I could, of course, pass a world, but this seems like passing a pointer to structure in C

23:27 if I understand correctly, the hard thing here is to determine in cell macro who is dependency here?

23:29 octagon: piranha: is line 56 the one you're referring to? in game.cljs

23:29 piranha: octagon: sorry, that part of code is not used right now - it's from days of flapjax :)

23:29 octagon: the only function used is init-jave, line 18

23:30 octagon: ah ok

23:30 piranha: I should've removed all the useless stuff :\

23:30 alandipert: piranha: did you check out input-to in dom.cljs? i avoid an intermediate cell with it

23:30 piranha: octagon: line 24 passes data to form

23:30 alandipert: aha, I'm using it to populate form cell :)

23:30 alandipert: piranha: aim it at world and your troubles are over

23:30 ;-)

23:31 rabbit_airstrike: working through 4clojure to brush up on some stuff, and it occurred to me that these interactive "learn through exercise" sites could be a bit more tree-structured

23:31 add user options to queue exercises in a breadth-first or depth-first search

23:32 alandipert: piranha: what you're trying to do reminds me of how one might use switchE in f.j.

23:32 piranha: alandipert: indeed! but then my form processor will know path of data in world cell. For a small app like this it's not a problem, really, and I could do that, but I'm just trying to get structure properly (at least that's how I see it, which could be wrong, of course)

23:32 alandipert: piranha: where you can make things that are backed by either B.changes or E's... but we don't really have that in javelin

23:33 piranha: that's true...

23:33 but conceptually feeding data from one cell to another doesn't seem wrong to me

23:33 alandipert: piranha: it's the way to go, the problem is just the direction you're going

23:34 octagon: piranha: line 27 looks like it should work. what does line 28 show in the console log when you run it?

23:34 alandipert: piranha: intermediate input cells that are event targets can't really be composed with other formula cells

23:34 piranha: octagon: it shows that formC is updated

23:35 octagon: so if I put anything in input, this log is executed, but then log on line 22 is not...

23:35 alandipert: and if I want to feed data from one cell to another, this another cell becomes a formula cell?

23:36 octagon: piranha: this is interesting, i have to think about this

23:36 Raynes: lein midje

23:36 Damn it.

23:36 alandipert: piranha: right, that's the (current) definition of a formula cell

23:37 octagon: piranha: have you tried something like (cell (#(assoc-in world [:form] %) formC))?

23:37 piranha: hm, not yet, one moment

23:37 octagon: piranha: no, that's nonsense, sorry

23:38 piranha: octagon: maybe (cell (#(swap! world assoc-in [:form] %) formC))?

23:38 octagon: piranha: (cell (#(swap! world update-in [:form] %) formC))

23:38 indeed

23:38 piranha: :)

23:38 it works! :)

23:38 hooray!

23:39 octagon: piranha: so what was happening there i think was that when you have a formula cell

23:39 piranha: so indeed, if I mask world behind function, it has no problem determining what to do

23:39 octagon: piranha: the arguments are "unboxed"

23:39 piranha: aha

23:39 octagon: like if they're cells they get derefed

23:39 so the function never sees the actual cell

23:39 piranha: and so the cell is not updated

23:39 octagon: just the contents

23:39 piranha: sure

23:39 makes sense

23:40 it's the same as with quotation of hashmap, when you give it to cell

23:40 for cell to see whole thing it should be a 'primitive', so to say

23:40 octagon: alandipert: thanks! :)

23:40 octagon: yes, that was a tradeoff, we convert {:foo "bar"} to (hash-map :foo "bar") and then lift that

23:41 piranha: that's not a problem once one understands the concept

23:45 octagon: piranha: it might be interesting to try (cell (swap! '(cell world) update-in [:form] formC))

23:45 piranha: one moment

23:46 alandipert: octagon: wouldn't just 'world do the trick there?

23:46 piranha: octagon: it works

23:46 alandipert: one moment

23:47 alandipert: Uncaught Error: No protocol method IWatchable.-notify-watches defined for type object: {:state :entering-players, :players []}

23:47 alandipert: ah ok

23:47 octagon: alandipert: well it will deref world then, which we don't want

23:47 piranha: what's better then, '(cell world), or an anonymous function?

23:48 octagon: piranha: does '(cell world) work?

23:48 piranha: octagon: it does :)

23:48 octagon: piranha: sweet! i like that one :)

23:48 piranha: ok :)

23:48 alandipert: octagon: cleaner than cfn imo

23:49 octagon: piranha: wrapping in anon fn means that none of the things in the fn can be reactive

23:49 dog_cat11: ~({:a 1} :a)

23:49 clojurebot: One idea I had was to parameterise Keyword with the key it looks up. :a is of (Keyword :a). But that has other issues.

23:49 dog_cat11: ?({:a 1} :a)

23:49 octagon: like in the '(cell world) case, update-in could be a reactive thing too, or :form

23:49 alandipert: &123

23:49 lazybot: ⇒ 123

23:49 dog_cat11: &({:a 1} :a)

23:49 lazybot: ⇒ 1

23:49 piranha: octagon: aha, I see

23:50 AtKaaZ: ,(partial Integer/parseInt "1")

23:50 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to find static field: parseInt in class java.lang.Integer, compiling:(NO_SOURCE_PATH:0:0)>

23:50 AtKaaZ: any other way? except anon functions

23:50 dog_cat11: &(do (def h2 {"a" 1 "b" 2})(let[{:keys[a b]} h2] b))

23:50 lazybot: java.lang.SecurityException: You tripped the alarm! def is bad!

23:50 dog_cat11: wtf

23:50 is there anyway to use destructing on hashes with string keys?

23:50 AtKaaZ: :strs ?

23:51 dnolen: optimization is not as broad as I would like but it does seems to jive well with protocols since they don't support the variadic case either - http://github.com/clojure/clojurescript/commit/a84c8aca59205bc6aa809cbb9996034c6f0de188

23:51 alandipert: &(let [{:strs [foo]} {"foo" 123}] foo)

23:51 lazybot: ⇒ 123

23:51 AtKaaZ: why is partial not supporting java interop functions?

23:52 alandipert: AtKaaZ: java methods are not clj functions

23:52 dog_cat11: thanks alandipert

23:52 AtKaaZ: alandipert: ok that makes sense

23:53 alandipert: octagon: have you done any reactive-stuff-in-op-position yet?

23:53 octagon: alandipert: only just to check that it works, so far

23:53 alandipert: octagon: same, feels like real ultimate power tho

23:54 octagon: like have a cycling fn

23:56 octagon: alandipert: thing-looper is the only case so far, that i can think of where i actually use that

23:56 but that's more of a curried function, i guess

Logging service provided by n01se.net