#clojure log - Jan 10 2013

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

0:09 arrdem: you could modify this to show value changes...

0:09 but (gensym) would be involved.

0:10 gtrak: well, the solution I'm thinking of is to let clojure manipulate the forms, not paredit

0:10 arrdem: haha that'll be a good start

0:15 blackdog: is there a reason (doc :>) doesn't work?

0:15 how do you look up symbols?

0:15 gtrak: ,(doc +)

0:15 clojurebot: "([] [x] [x y] [x y & more]); Returns the sum of nums. (+) returns 0. Does not auto-promote longs, will throw on overflow. See also: +'"

0:15 gtrak: ,`doc

0:15 clojurebot: clojure.repl/doc

0:16 gtrak: might be a clue

0:16 arrdem: ,(cons :foo #{:bar :bas})

0:16 clojurebot: (:foo :bas :bar)

0:17 gtrak: ha

0:17 arrdem: herm.

0:17 gtrak: ,(second (cons :foo #{:bar :bas}))

0:17 clojurebot: :bas

0:17 gtrak: :-D

0:17 blackdog: gtrak: ah, i think i see what's going on. it's just a symbol, and there's some cascalog macro that does something evil/clever with it

0:18 gtrak: cascalog is mostly cleverness, so I don't doubt it

0:18 blackdog: gtrak: so i'm gathering :)

0:19 gtrak: cascading on its own makes me poke my eyes out

0:20 but I suppose it's better than straight map-reduce

0:23 tomoj: whoa

0:25 datomic.db/->Datum looks like a customized record constructor

0:25 gtrak: oooo

0:25 tomoj: its last arg is a number which gets converted into a boolean in the Datum

0:26 oh, no

0:26 gtrak: *when* in evaluation do those get created? right after a defrecord? I honestly don't know.

0:26 tomoj: it's just a custom ILookup and custom printed repr

0:26 gtrak: ah

0:26 tomoj: right at the end of the macroexpansion of defrecord

0:26 gtrak: I wonder if you could wrap one and give it the same name, though

0:27 I can't think of why not

0:27 ah, it's just a defn

0:31 arrdem: Okay. I'm being too clever for my own good, but this'll print temporary values from rebindings as well. https://www.refheap.com/paste/8315

0:31 gtrak: hahaha

0:32 yea, that's totally incomprehensible

0:32 it should be in core

0:32 arrdem: haha. what's illegible about it? seems obvious to me...

0:32 gtrak: well, b/c you wrote it

0:32 arrdem: there is that.

0:34 gtrak: vec's nice instead of apply vector..

0:34 mattmoss: &(*(+(*)(*)(*))(-(*(+(*)(*))(+(*)(*))(+(*)(*)))(*))(+(*)(*)))

0:34 lazybot: ⇒ 42

0:35 loliveira: how do I perform

0:36 how do I perform a multiiple insert using clojure.java.jdbc?

0:38 jkkramer: loliveira: insert-records

0:38 loliveira: it is only possible when each value is passed to insert function.

0:39 gtrak: huh, I was hoping datomic was flexible wrt lucene.. disappointed, going manual..

0:39 loliveira: (sql/insert-values :x [:a :b] [1 2] [3 4]) is ok but (sql/insert-values :x some-vector) not.

0:40 jkkramer: loliveira: (apply sql/insert-rows :x [:a :b] collection-of-rows)

0:41 gtrak: arrdem: I see, you so you just rename the symbols if they're rebound

0:42 jkkramer: insert-values, rather

0:42 arrdem: gtrak: I don't rename... I create a new "intermediate state" one which will preserve the value to be destroyed and then faitfully include the rebinding

0:43 so [a 1 a 2] -> [a 1 a_rebinding_1 a a 2]

0:43 gtrak: ah, yea

0:45 loliveira: gtrak: ty. i will try.

0:46 gtrak: loliveira: think you meant jkkramer

0:46 loliveira: =)

0:46 jkkramer: ty

0:49 jkkramer: it worked. ty.

0:54 arrdem: gtrak: alternate implementation... thoughts? https://www.refheap.com/paste/8318

0:55 I'm concerned that it'll suck because I recalculate the frequencies map every itteration but I don't know how much of that Clojure'll optimize out.

0:55 gtrak: arrdem: if it happens at compile time, then it'll just slow down compile

0:56 so, read, macro-expand... then you've got just code... so the let bindings in the end map to locals, no cost

0:57 arrdem: at runtime sure.

0:57 but in something "large"... this is gonna be O(N!)

0:57 gtrak: haha

0:57 meh

0:57 it's good to have the dirtiness grow proportionately on multiple axes

0:58 consistency :-)

0:59 clojure doesn't optimize much really

0:59 arrdem: well.. no.. O(1/2 x^2)

1:00 gtrak: it mostly just relies on the JIT and not doing bad things in code-gen

1:00 I guess with the exception of primitives

1:01 the compiler's only aware of special forms

1:02 * arrdem meanders off to see how slow it really is on a thousand-rebinding print-let

1:02 gtrak: i think there's gotta be a limit on how many locals in a stack frame

1:03 arrdem: right... but it should be frikkin huge

1:03 couple hundred ish

1:05 Okay... so 255 is the limit for java function arguments...

1:10 Okay... well (print-let (vec (interpose (map gensym (range 1000)) (repeat 1)))) has had over two minuted of compute time I'll call that dead

1:13 gtrak: but is it web-scale?

1:13 arrdem: gtrak: probably not... I'm kicking and it's still down

1:19 augustl: is there a good way to process just the values of a map?

1:19 I did a group-by, but now I need to process the values before I'm done

1:19 I need to do the grouping first for the processing to make sense

1:20 arrdem: ,(vals {:foo [:bar :baz] :bung [ 2 3 4 ]})

1:20 clojurebot: ([:bar :baz] [2 3 4])

1:21 tomoj: don't think of anything better

1:21 augustl: I should also mention that I need to return a map :)

1:21 so {:foo 1 :bar 2} should essentially return {:foo (process 1) :bar (process 2)}

1:22 tomoj: I wish it were (r/map process {:foo 1 :bar 2})

1:22 but that doesn't work

1:22 gtrak: augustl: seq functions and into are your friend

1:22 augustl: I usually use zipmap, but then I need to assign the map to something :)

1:22 arrdem: tomoj: all I've got is a nested function application...

1:23 tomoj: oh, I thought you were someone else

1:23 and thought you had a different question

1:23 oh

1:23 gtrak: ,(into {} (for [[k v] {:a 1 :b 2 :c 3}] [k (inc v)]))

1:23 tomoj: nevermind :)

1:23 clojurebot: {:a 2, :c 4, :b 3}

1:24 arrdem: (inc gtrak)

1:24 lazybot: ⇒ 5

1:25 arrdem: gtrak: I fixed an infinite sequence issue and now (let) and my rebinder are handling 10,000 symbol lets manfully

1:25 erp no that's a stackoverflow.

1:25 gtrak: ah, neat

1:25 hopefully that's more than you can read

1:25 arrdem: as is 5k....

1:25 2k is OK

1:25 ivan: (defn mapvals [f m] (into {} (map (fn [[k v]] [k (f v)]) m)))

1:26 arrdem: 3k is OK

1:26 .... oh I was using the fast (loop) one.

1:26 lemme try the (reduce)

1:27 gtrak: ivan: for makes you look more l33t

1:27 arrdem: gtrak: yeah 3k worked with the (reduce) but took about half a second instead of being instant

1:28 holy shit

1:28 gtrak: arrdem: sounds like locals

1:29 well, I can't tell what's slowing it down specifically

1:29 arrdem: anyone got a better stress-test idea than (rebinding-expand (vec (take 3000 (interleave (repeat `foo) (repeat 1))))) ?

1:29 gtrak: arrdem: why do you avoid frequencies in the the loop-recur?

1:30 arrdem: gtrak: because in the loop-recur I build the frequencies map by hand

1:30 if I processed a previously seen sym I (inc) it...

1:30 and if I haven't seen it I set it's count to 1

1:31 gtrak: ah, you could probably pass that around in your accumulator then pull it out in the end

1:31 ivan: clojurebot: why is startup slow is busy compiling the `for` macroexpansion

1:31 clojurebot: Ok.

1:33 arrdem: gtrak: is the (reduce) really sufficiently more readable that you would hack it into what is, in terms of datastructures exactly the loop-recur?

1:34 I mean there's no appreciable speed difference between the two on a "modern" pc for any sane number of symbols so it just comes down to style.

1:34 gtrak: it's equivalent, reduce is closer to the data side of code is data

1:35 and has some built in benefits, like 'reductions'

1:36 reifying a computation into a seq is what lazy seqs are all about

1:36 arrdem: right... but by nature this isn't a lazy seq.

1:36 gtrak: sure

1:36 if looking at it as data is useless, then it's not worth the effort :-)

1:37 arrdem: idk. this whole thing is just an "exercise for the reader" don't mean to harp on about it.

1:37 haha if only all languages were as pragmatic...

1:37 gtrak: useless and interesting :-)

1:38 arrdem: well IDK about useless... I intend to use that let-print but the rebinding-expand is me being silly.

2:44 dyreshark: does clojure have a way to check to see if two lists contain the same elements, regardless of order? i.e. (foo '(1 2 3 4) '(4 2 3 1)) ; => true

2:47 tomoj: no

2:47 regardless of order and multiplicity or just order?

2:47 for the former, #(apply = (map set %&))

2:47 for the latter, I guess #(apply = (map frequencies %&))

2:51 pppaul: hello

2:51 what clojure books are easiest to digest?

3:06 amalloy: e-books. paper is too pulpy

3:07 Raynes: amalloy: Thank you, man.

3:07 amalloy: I'll never understand people's fascination with paper books.

3:08 I have no desire to own a paper programming book.

3:08 amalloy: <3 paper books

3:08 Raynes: Why though?

3:09 pppaul: they taste better

3:09 arcatan: for non-fiction books, i like the ease of browsing the book by just leafing through it or opening it from random places

3:09 pppaul: e-books sting

3:09 talios: toilet paper :)

3:09 I wipe my a*** on scala :)

3:09 Raynes: Your asss?

3:10 pppaul: it's better than just a normal ass

3:10 talios: its bigger than a normal one thats for sure ;p

3:10 pppaul: (inc ass) -> asss

3:11 Raynes: "I like the feel of a paper book in my hands" is a big one. Whatever, hold a book in your left and and a kindle in your right.

3:11 ro_st: pretty hard to write a thoughtful note on the inside cover of a digital book when gifting it

3:12 Raynes: Amazon lets you send a comment when you gift a book, IIRC. Or you can include the pdf as an email attachment if you bought it elsewhere.

3:12 Seems like a weird reason for preferring paper books.

3:12 ro_st: collectability?

3:12 -looks at his complete Terry Pratchett collection-

3:12 Raynes: I have a nice big organized kindle library and tons of shelf space.

3:13 amalloy: lendability too

3:13 * Raynes sends amalloy a PDF.

3:13 amalloy: *shrug* that's not an ebook

3:13 ro_st: paper books don't need batteries

3:13 or amazon/itunes accounts

3:13 that makes them far more lendable

3:13 Raynes: If you don't have electricity you have bigger problems than books.

3:14 amalloy: What is an ebook then?

3:14 I was under the impression that ebooks came in various formats.

3:14 ro_st: i've decided to stop throwing baseballs at you :-)

3:15 are you going to Cwest, Raynes?

3:15 Raynes: I don't know if I'm ever going to another conference ever again.

3:15 But definitely not that one.

3:15 ro_st: it's only 12 hours away by train

3:16 (or so i am told)

3:16 amalloy: someday, a pdf may be an ebook. right now, pdfs aren't nearly as flexible on an ereader as, say, a .mobi or a .epub. graceful resizing, a sane TOC, the ability to highlight/note stuff "in the margins"

3:16 Raynes: Whatever /me sends amalloy an epub

3:16 ro_st: decent search

3:16 Raynes: ro_st: I'd probably have to use vacation days to go, and I'd have to pay for it.

3:17 amalloy: ebooks are more convenient most of the time, for sure. easier to get

3:17 Raynes: I really don't think I'd go to any conferences I have to actually pay for, even if I did have the money. It doesn't feel worth it for most conferences

3:18 ro_st: Raynes: sorry to hear that. i realise i'm incredibly lucky to have the company pay for me to go, especially considering i live in cape town

3:18 amalloy: but amazon can take them away from you whenever they feel like it, and sometimes that happens. and you don't *own* them, you only own a license to read them. it's against the rules to let someone borrow one, for now

3:18 or to inherit from your parents

3:18 Raynes: IIRC, we're going to get to go to a conference again someday.

3:18 ro_st: cwest looks like a cracker, esp with the minikanren bolt-on.

3:19 Raynes: I wish I was more interested in all the logic talks, but I mostly just feel like taking a nap during them,

3:19 ro_st: Raynes, are you/will you be using Clj for work?

3:19 Raynes: We use Clojure.

3:20 ro_st: what sort of thing do you work on? web stuff?

3:20 Raynes: I work on backend stuff.

3:20 echo-area: Is there ACL related stuff in nREPL? I can telnet on localhost, but cannot telnet from another host

3:21 ro_st: echo-area: we use ssh tunneling

3:21 amalloy: nrepl is probably only listening on localhost, not on, echo-area

3:21 ro_st: map a local port to a remote port over ssh, and then nrepl to the local

3:21 echo-area: ro_st: Oh, let me try

3:22 Raynes: ro_st: How did you know I was moving to LA?

3:22 Sneaky.

3:22 ro_st: saw you mention it a couple times

3:23 Raynes: You're like a ninja, waiting in the bushes.

3:23 ro_st: we're watching you, Raynes.

3:25 Raynes: what do you think of the luminus additions?

3:25 to lib-noir

3:26 Raynes: Well, I approved them.

3:26 ro_st: a pal just started with clojure, doing web stuff. i recommended he start with the luminus template and lib-noir

3:27 Raynes: I'm pretty biased since I maintain lib-noir. :P

3:27 But yeah, luminus is a great start (and includes lib-noir).

3:28 ro_st: we have like 80 defpages and pre-routes to convert

3:28 going to be nice to get it upgraded. compojure is much more composable

3:29 i like how you can compose routing groups with contexts

3:30 echo-area: ro_st: Thanks, it is not convenient that way but it works

3:30 ro_st: echo-area: cool. i've yet to find a clever way to disable auto-complete in emacs when connecting to a remote nrepl. it's soooo slowwww.

3:31 echo-area: ping cemerick. whatever he's doing is the right way :-)

3:33 echo-area: ro_st: It's not slow here

3:33 ro_st: i'm in cape town and we ssh into ec2

3:33 definitely slow for us

3:33 we had a local VPS which was nice and fast

3:33 so… lucky you :-)

3:33 echo-area: Oh, that's another story :)

3:40 tomoj: &(= (:foo :bar))

3:40 lazybot: ⇒ true

3:40 tomoj: bad typo

3:40 ro_st: &(:a :b)

3:40 lazybot: ⇒ nil

3:40 ro_st: interesting

3:41 tomoj: &(:a (Object.) 42)

3:41 lazybot: ⇒ 42

3:41 ro_st: how long'd that take to hunt down, tomoj?

3:41 tomoj: probably 1min

3:41 was in existence without my knowledge for maybe 3

3:46 ro_st: nice. high five

3:46 you're clearly a landoflisp.com/#guilds warrior!

3:52 tomoj: eh, function was 5 lines long, not many places to look

3:54 dyreshark: thanks tomoj

4:31 rahcola: any recommendations for a simple parsing library to use when writing macros?

4:32 maybe something like what Scheme has?

4:48 Sgeo_: ,(fn name [] name) ; I forget whether this is a thing

4:48 clojurebot: #<sandbox$eval27$name__28 sandbox$eval27$name__28@7be1232c>

4:48 Sgeo_: ,(fn name [] (name))

4:48 clojurebot: #<sandbox$eval55$name__56 sandbox$eval55$name__56@3fe2135c>

4:48 Sgeo_: ,((fn name [] (name)))

4:48 clojurebot: #<RuntimeException java.lang.RuntimeException: java.lang.StackOverflowError>

4:54 echo-area: &(+ 3 4)

4:54 lazybot: ⇒ 7

4:54 foodoo: ,((fn name [] (recur)))

4:54 clojurebot: Execution Timed Out

4:55 foodoo: Sgeo_: use tail calls to avoid stack overflows ;)

4:55 Sgeo_: Or I could just use a language with TCO >.>

4:56 Or perhaps implement a Clojure-like language in that language

4:56 foodoo: Sgeo_: Or add TCO to the clojure compiler. It's not really a language issue, but a compiler issue, isn't it?

5:01 noidi: foodoo, I think the compiler could only change self-calls into loops, but it can't support mutual tail recursion as that's not supported by the JVM

5:02 i.e. when fn a calls b from tail position, a's stack frame can't be optimized away

5:03 foodoo: noidi: I don't know much about JVM bytecode, but isn't there some kind of goto, that could be used to avoid building stack frames/function calls?

5:03 zamaterian_: jahluv Discrete Mathematics and Its Application - Kenneth H. Rosen.pdf

5:05 noidi: foodoo, I don't know, but a quick google turned up this http://stackoverflow.com/questions/105834/does-the-jvm-prevent-tail-call-optimizations?lq=1

5:05 foodoo: noidi: okay. So it's a security thing. Thanks. Nice to know

5:06 noidi: I've yet to encounter a situation when the lack of TCO would have really bothered me

5:08 using trampolines is a bit of a bother, but I think I've only used them once

5:08 and I actually prefer the distinction between recur and stack-consuming recursion

5:19 Raynes: $latest lein-gitify

5:19 lazybot: [lein-gitify "0.1.0"] -- https://clojars.org/lein-gitify

5:19 Raynes: $latest lein-bin

5:19 lazybot: [lein-bin "0.2.0"] -- https://clojars.org/lein-bin

5:20 Raynes: $botsnack

5:20 lazybot: Raynes: Thanks! Om nom nom!!

5:20 Raynes: $latest bultitude

5:20 lazybot: [bultitude "0.2.0"] -- https://clojars.org/bultitude

5:21 ejackson: $Raynesnack

5:21 Raynes, dude, laser is cool.

5:22 Raynes: ejackson: As an ice cube.

5:22 ejackson: i've always liked enlive for its awesome factor, but this comes with all that AND....

5:22 docs

5:22 crazy

5:23 i hope you enjoyed my MVPR (minimum viable pull request)

5:23 Raynes: I did, indeed. :P

5:23 I never proof-read that guide at all.

5:24 ejackson: i read it yesterday, and its pretty clear, thanks for taking the effort

5:24 Raynes: :D

5:24 ejackson: communicating these libraries is the uberkey

5:25 Raynes: hrm

5:26 lein-bin isn't resolving.

5:26 I even just pushed a new version, but leiningen can't find it.

5:26 Bizarre.

5:26 And extremely annoying.

6:18 pmaes: I'd like to provide some preprocessing functions to use my library with others. At the moment I rely on a dependency to these projects. This isn't ideal. Is there a better way to do this?

6:21 ro_st: move the code out to its own project and have its previous project use it as a dep, and then share that same project with your 'others'

6:51 tomoj: &(Math/pow 2 0x2000)

6:51 lazybot: ⇒ Infinity

6:51 tomoj: &(= 0x2000 (* 8 1024))

6:51 lazybot: ⇒ true

6:53 Raynes: ejackson: Are you using (or planning to use) laser for anything?

6:54 ejackson: not right now, although I certainly will soon

6:54 Raynes: o/

6:54 ejackson: I'm forever parsing HTML and XML

6:54 the next one I write will be in laser

7:06 wingy: is there a way to trigger a fn when heroku run my app?

7:06 ro_st: call it from your main fn ?

7:06 or do you mean, how do you do a 'main' fn?

7:07 wingy: ro_st: i mean do i have to call it in my :main fn

7:07 i mean :main namespace

7:08 ro_st: your main namespace should have a defn -main in it

7:08 wingy: ok

7:08 ro_st: doesn't the heroku clojure guide cover this?

7:11 vijaykiran: wingy: you can add a procfile to run whatever the lein command you want to use as "start"

7:44 Ember-: hey, I have a problem with with-redefs-fn and multiple bindings

7:44 for some reason this doesn't seem to work:

7:44 dbushenko: how to set context path in a ring/compojure application (for deployment on tomcat)

7:44 ?

7:44 Ember-: (with-redefs-fn {#'foo.bar/bloo (fn [] "ubr") #'foo.bar/blergh (fn [] "ubr")}

7:45 how should I place the multiple binding arguments?

7:45 if not that way

7:47 oh, my bad just found out what I was doing wrong

7:47 not there :)

7:54 * Sgeo wonders if anyone would be interested in a Racket style destructuring mechanisms

7:54 Sgeo: *mechanism

7:54 Where the interesting thing is how it's extendable

7:58 Wait, does rhickey have something against pattern matching?

7:58 tomoj: is there an easy way to compile new cljs in a compatible way with previously compiled js already loaded in a browser?

7:59 dbushenko: how to set context path in compojure application?

8:16 ejackson: Sgeo: you mean the complected comment ?

8:17 Sgeo: ejackson, I've never really seen the complecting talk

8:17 ejackson: oh, ok then.

8:18 i think he gave pattern matching as an example of complection.

8:18 ie having the dispatch and functionality in the same place in the code

8:26 pjstadig: i think the complection was that it is ordered

8:26 it complects dispatch with the order of the matching clauses

8:27 ejackson: aaaah, that makes even better sense

8:27 thanks

8:29 * gfredericks can't remember what things to try when lein-cljsbuild hangs

8:31 gfredericks: I guess it's always hanging on retrieving the closure jar

8:43 aroemers: Nice word, complecting. I used it in my master thesis, and my supervisor was like, is that a word? Well, yes it is!

8:46 clojure-newb: hey guys… whats a nice way to generate an arbitrary number of td tags to go inside a tr tag (from a map maybe) in enlive ?

8:46 I kind of want to avoid writing a string of html content

8:46 gfredericks: looks like crate removed the string functionality all together?

8:53 tomoj: update-proxy: "Note that this function can be used to update the behavior of an existing instance without changing its identity. Returns the proxy."

8:53 wow!

8:53 that's nuts

8:54 gfredericks: tomoj: wat why does that exist

8:55 * gfredericks needs answers

8:55 tomoj: I think I've wanted that before

8:56 ejackson: clojure-newb: you need to use do. I'd suggest you switch from enlive to laser by Raynes, as its similar but well documented.

8:56 clojure-newb: look at Seq of Nodes in https://github.com/Raynes/laser/blob/master/docs/guide.md

8:57 Raynes: Has anybody ever written a lazy version of clojure.walk?

8:57 clojure-newb: ejackson: thx, I will go take a look

9:06 samrat: any idea why this do form isn't working? https://www.refheap.com/paste/8328

9:09 dbushenko: how to set context path in compojure application?

9:09 weavejester: dbushenko: The context macro

9:09 dbushenko: can you please point me at any example?

9:10 I've seen the discussions where you have already advised :context and :path-info and other ways

9:10 but couldn't get any of them working

9:11 each time I deploy my app to tomat, the resources and requests go to "/" but not to "/myapp/"

9:13 weavejester ...

9:13 weavejester: dbushenko: Oh, you're deploying to Tomcat?

9:13 dbushenko: Via lein-ring?

9:14 dbushenko: yep

9:14 weavejester: lein-ring will automatically set the :context and :path-info keys

9:14 But some Ring middleware doesn't currently use :path-info

9:14 Like wrap-resources

9:14 dbushenko: so what should I do?

9:15 weavejester: The compojure.route/resources will work

9:15 And is recommended if you're using Compojure

9:15 dbushenko: ok, let me try...

9:18 yogthos: weavejester: got a question, about lein ring server, is it possible to bootstrap it from a main?

9:18 weavejester: yogthos: Bootstrap it?

9:18 yogthos: weavejester: and would there be any downsided vs using run-jetty

9:19 weavejester: what I mean is that when run-jetty runs you can't hook in init/destroy

9:19 dbushenko: weavejester, so I did the following: (route/resources "/myapp/"). But that still didn't help

9:19 yogthos: weavejester: but when it runs as a war or with lein ring server then those get picked up

9:19 weavejester: yogthos: "lein ring server" uses the ring-server library underneath

9:20 yogthos: So you could include ring-server and then use ring.server.standalone/serve

9:20 yogthos: https://github.com/weavejester/ring-server/blob/master/src/ring/server/standalone.clj

9:20 yogthos: weavejester: any pros/cons between that and run-jetty?

9:21 Raynes: weavejester: Do you plan to add a crouton-to-html function or the like to crouton?

9:21 weavejester: dbushenko: What exactly is going wrong?

9:21 yogthos: weavejester: looks like it would be more consistent for me to use ring-server in the template

9:22 weavejester: Raynes: What would that do? Render a Clojure XML map as a HTML string?

9:22 yogthos: Why do you want to use a -main method in the first place?

9:23 yogthos: I mean, why manually create a -main method?

9:23 yogthos: weavejester: heroku needs a main for example

9:23 Raynes: weavejester: Yeah. I was actually just curious if you had already written something like that, because I'm probably going to rewrite hickory's to-html function (which isn't stack safe) soon.

9:23 dbushenko: weavejester, each time the resources point to localhost:8080/css/file.css instead of localhost:8080/myapp/css/file.css

9:23 Raynes: yogthos: It doesn't.

9:23 yogthos: Raynes: no?

9:23 Raynes: yogthos: You can run your code however you like on heroku.

9:23 I run refheap with lein ring server-headless, IIRC.

9:24 yogthos: Raynes: ooh, I didn't realize that

9:24 weavejester: yogthos: I'd be tempted to use "lein ring server" in production, but set something like...

9:24 Raynes: Whatever is in your Procfile.

9:24 yogthos: Raynes: ah that makes sense

9:24 weavejester: :profiles {:production {:ring {:open-browser? false :stacktraces? false :auto-reload false}}}

9:25 Raynes: I haven't written anything like that, but I imagine JSoup might have something for rendering HTML that we could use in Crouton

9:25 yogthos: weavejester: you'd have to have lein on the target machine for that though

9:25 Raynes: weavejester: I need to write something that works with maps.

9:26 weavejester: yogthos: Yes, but Lein-Ring 0.8.0-SNAPSHOT has the "lein ring uberjar" command

9:26 yogthos: Which creates an executable jar file with a main method

9:26 yogthos: weavejester: ah nice

9:26 weavejester: So if you want to deploy it to Linux with an nginx proxy

9:26 lein ring uberjar

9:27 And then: java -jar <project>-<version>-standalone.jar

9:27 yogthos: weavejester: right right

9:27 tomoj: if you make your proxy class implement clone sanely

9:27 yogthos: weavejester: I guess my only other use case for a main is actually running it from something like eclipse

9:28 tomoj: .. can you?

9:28 yogthos: weavejester: but yeah that might not be worth the trouble

9:28 weavejester: dbushenko: I don't understand what you mean by "the resources point to localhost:8080/css/file.css"

9:28 dbushenko: Do you mean the links in your HTML file don't point to the right place?

9:29 dbushenko: If so, that's something that needs to be solved by whatever generates the HTML

9:29 dbushenko: Hiccup, for instance, has wrap-base-url

9:30 dbushenko: weavejester, thanks

9:30 though I use Enlive

9:30 will look into it

9:30 weavejester: dbushenko: I don't believe Enlive will automatically change your links for you

9:30 dbushenko: so what would you suggest?

9:30 weavejester: yogthos: My current thought is that you should only manually have to create the handler

9:31 yogthos: How the handler is deployed, either as a war, or with an embedded Jetty server, or whatever, is an compilation detail

9:32 yogthos: weavejester: right that makes sense

9:32 weavejester: dbushenko: You can still use Enlive. You just need to be aware that it's a templating solution - it doesn't have an awareness of anything outside that. (as far as I know)

9:32 yogthos: weavejester: but then what's the option for starting it from the repl?

9:32 weavejester: dbushenko: So you have to ensure your links are created with a context you can change depending on how it is deployed.

9:33 dbushenko: ok, thanks

9:33 weavejester: yogthos: ring.server.repl … when I get around to writing it :)

9:33 yogthos: weavejester: haha, alright as soon as it shows up I'm on it :)

9:34 weavejester: yogthos: Or just use run-jetty… REPLs are a little trickier because they don't have a connection to your project options directly

9:34 yogthos: weavejester: that's pretty much what the -main is doing right now

9:34 weavejester: yogthos: So you'd need to manually enter them I guess. Or somehow pull the project map into the REPL

9:34 But rather than starting a web server from a REPL

9:35 yogthos: weavejester: but I really like the plan of leaving it up to lein-ring to create the standalone jars and wars

9:35 weavejester: I wonder if it might make more sense to start a REPL server from the web server with something like drawbridge

9:35 Not sure whether that's a good idea or not

9:35 yogthos: weavejester: could be a security hole :)

9:35 weavejester: if you forget to disable it for production for example

9:35 weavejester: yogthos: If it's just turned on in development

9:36 yogthos: Technically speaking, things like stacktraces are a security weakpoint if you leave them on in production

9:36 yogthos: weavejester: yup

9:36 weavejester: the more of that you can minimize by default the better though I think

9:37 weavejester: I think technomancy disagrees with me on my slight phobia of the -main method

9:37 yogthos: weavejester: I'm a big fan of reasonable defaults, and then let the user tweak them if they feel they need to

9:38 weavejester: But he works for Heroku, where all the web apps are standalone apps with main methods :)

9:38 yogthos: weavejester: I think for short term I'll switch my main to use ring-server, so at least it'll be consistent and I'll document that proper way to build stuff for deploying is by using lein ring uberwar/uberjar

9:56 Anderkent: Exception in thread "main" java.lang.IllegalStateException: Pop without matching push - any ideas?

9:56 knob: Good morning everyone

10:13 yogthos: weavejester: is the lein-ring 0.8 snapshot generally stable enough to switch to from from 0.7.5?

10:14 weavejester: yogthos: It should be. I was going to release 0.8.0 in the next day or two, once I've run a few more tests

10:15 yogthos: weavejester: excellent, I think what I'll do is just provide a start-server/stop-server functions for repl dev, and then the only way to build a war or a jar is via lein ring

10:32 shafire: hi

10:32 is someone using jamaicavm with clojure?

10:32 bosie: anyone has this book https://leanpub.com/fp-oo and started with clojure with it?

10:59 * julienXX Hello I'm having the same issue as described here https://groups.google.com/forum/?fromgroups#!topic/httpasyncclient/_z43p1YHH58

10:59 julienXX: Anybody know a solution? I'm using Clojure 1.4 with http.async 0.5

11:02 neilmock: julienXX: you need :timeout -1 added to the stream-seq options

11:03 TimMc: Raynes: Just so you know, I'm expecting a Colin Percival-style incident analysis report regarding clojail. (ref: http://www.daemonology.net/blog/2011-01-18-tarsnap-critical-security-bug.html)

11:04 julienXX: neilmock: unfortunately it doesn't solve the issue, the stream is still being stalled after 19 heartbeats

11:04 clojure-newb: ejackson: how do I get a nested element with a selector in laser, maybe <html><body><div><ul> (the ul) ?

11:04 neilmock: julienXX: strange. i was having the same issue and it solved it for me

11:17 yogthos: Raynes: ping

11:49 ejackson: clojure-newb: sorry, AFK.

11:49 clojure-newb: no probs

11:49 I'm cheating with a different way in :-)

11:49 ejackson: i've not actually run it yet, but I think you want to compose a bunch of child-of selectors with and

11:50 clojure-newb: I've just put a class on the element

11:50 easier for now

11:50 ejackson: or an id.

12:08 no7hing: has anybody used cemerick's friend library and did start the opened workflow manually?

12:08 openid/opened

12:12 cemerick: no7hing: if you're having an issue, maybe post a question to the clojure or clojure-sec lists?

12:12 I'm going afk for a while

12:13 no7hing: thanks and i've found a ticket on github: https://github.com/cemerick/friend/issues/17

12:13 cemerick: no7hing: ah; do update the ticket with your use case, as I still don't grok it

12:14 no7hing: will do

12:44 sshack: Okay, I'm having a weird failure. I've setup speclj in a brand new project. I run leon spec -a, and about 50% of the time it dumps me a stack trace. No files in the project have changed (editor is closed).

12:47 http://pastebin.com/RRmykDPJ

12:48 An example. Run right after each other.

12:52 TimMc: Some kind of AOT issue?

12:53 hiredman: I prefer to see it as the universe telling you not to bother with speclj

12:58 * nDuff scowls at the pastebin.com link

12:59 TimMc: haha, I was waiting for that

13:02 sshack: TimMc: I'm not sure what it is. or why it would happen intermittently.

13:16 alexnixon: I can see there are several clojure validation libraries out there: mississippi, clj-schema, bouncer, validateur, metis, validation-clj (and valip and corroborate, though they look abandoned). Is this a NIH syndrome epidemic, or are there substantial differences between them? Any recommendations on which one to look at first?

13:17 AimHere: Heh, the first 2012 conj video is almost no clojure and almost all music theory

13:18 ibdknox: AimHere: it was the last scheduled presentation, so it fit really nicely as a closing

13:18 technomancy: alexnixon: I'd start with the clojurewerks one; at least you know you'll have docs =)

13:19 AimHere: I approve. Like inviting Scala guys to talk about Scala data structures and Scheme guys to talk about relational programming and guys talking about the etymology of words like 'Simple'. Clojure conferences could be the starting point of a general-purpose education

13:20 ram9: ooh - a clojure conf??

13:20 lazybot: ram9: Definitely not.

13:20 ram9: ahaha

13:21 AimHere: ram9> ClojureTV on youtube is starting to put up the videos for the latest conj conference

13:21 alexnixon: technomancy: so that's "validateur". Thanks, I'll take a look.

13:22 * tmciver checks out ClojureTV

13:27 TimMc: alexnixon: Validation libs are the kind of thing that are easy to start writing. :-)

13:29 alexnixon: TimMc: yeah I could see someone starting writing a small function to validate their specific use-case, then growing it over time into something more fully-fledged, then releasing it as a library

13:30 TimMc: Or making something half-assed and releasing it.

13:30 I haven't looked at any of the validator libs, but I suspect a goodly number of them are just good enough to address the original author's needs.

13:30 s/good/comprehensive/

13:31 nickmbailey: right

13:31 err wrong window, sorry

13:31 alexnixon: that's the impression I get, although clj-schema looks fairly comprehensive (at first glance)

13:31 TimMc: nickmbailey: It's OK, I don't mind you agreeing with me!

13:32 nickmbailey: without reading any context your statement sound agreeable enough to me :)

13:34 * gfredericks has forgotten how to create a tarball

13:37 Zerker: T

13:37 tar -cvzf

13:39 duncanm: anyone going to the Boston clojure meetup tonight?

13:40 amalloy: if it's any help supporting TimMc's claim, i've released a half-assed validation-related library

13:40 rbxbx: TimMc fwiw I've had good experiences with validateur thusfar.

13:41 Easily extensible to usecases that aren't provided out of the box.

13:42 alexnixon: amalloy: what's the name of it?

13:42 technomancy: I'm going to be disappointed if no one releases one called VALIS

13:43 amalloy: it's at https://github.com/flatland/schematic but doesn't really have any doc aside from the tests (which is one reason it's never been formally announced)

13:50 TimMc: duncanm: Yep.

13:51 technomancy: Sounds like a job for... you.

13:51 I mean, being a literature reference and all.

13:51 amalloy: gfredericks: real men create tarballs with `tar cz`. the -vf characters are for wimps

13:51 alexnixon: it looks like clj-schema is more composable than validateur (schemas can contain each other, whereas validateur doesn't appear to support that, as far as I can tell)

13:52 jkkramer: fwiw, I released a validation lib recently, too - with a rational - https://github.com/jkk/verily

13:52 alexnixon: jkkramer: why does clj-schema not fit your needs?

13:53 metellus: $findfn 23 5 4

13:53 lazybot: [clojure.core/quot clojure.core/unchecked-divide-int]

13:55 jkkramer: alexnixon: clj-schema is very elaborate

13:55 I wanted something based on simple function composition

13:55 with multi-key map validations

13:58 mattmoss: &(-(*(+(*)(*))(+(*)(*)))(*))

13:58 lazybot: ⇒ 3

13:59 alexnixon: jkkramer: can you come up with (and perhaps add to the readme?) some examples showing why, for those specific cases, verily is preferable to clj-schema?

14:00 jkkramer: alexnixon: I would need to spend time learning clj-schema's api to do that

14:01 alexnixon: jkkramer: up to you, but I suspect that would be worthwhile

14:01 TimMc: mattmoss: You saw this? http://hypirion.com/musings/swearjure

14:04 pppaul: hey, i've been doing swearjure for a while

14:04 i like it

14:04 magnars: Why do I have to do (vec (map ...)) to make sure I still work with vectors, and is there a better way?

14:04 technomancy: magnars: you can do mapv

14:05 magnars: technomancy: oh, that's great - thanks mate!

14:05 pppaul: hey technomancy i would like to get the values of my project configuration in my running problem. easy?

14:05 technomancy: but don't do that if you're just doing it to avoid laziness; it's sometimes abused for that

14:05 pppaul: yeah, check out configleaf

14:05 pppaul: thanks

14:06 technomancy: pppaul: leiningen is designed to have no effect on the project at runtime, but the configleaf plugin gets you access to that

14:06 pppaul: cool

14:06 i'll add it now

14:11 magnars: Any better way of doing `[~elem ~@list] than (into [elem] list) ? (cons elem list) makes me a seq instead of vector.

14:12 technomancy: magnars: into is reasonable there

14:12 magnars: thank you

14:12 technomancy: magnars: nice work on dash and friends btw; looking forward to trying them out next time I need to write some elisp

14:13 magnars: technomancy: thanks :-) scratching my own itch, glad it can be of use for others too!

14:14 technomancy: wish I had found it before I started nrepl.el =)

14:15 aaelony: is anyone here familiar with storm-starter? https://github.com/nathanmarz/storm-starter/blob/master/src/clj/storm/starter/clj/word_count.clj

14:16 magnars: technomancy: I'm using nrepl.el in a major-mode I've written, to communicate with a clojure app as a backend for the heavy lifting. I had a lot of fun doing that - and it was a joy to work with.

14:16 technomancy: cool

14:16 aaelony: the storm-starter word count basically uses rand-nth to choose from sentences it then consumes

14:16 technomancy: magnars: I haven't been following its development much since swank has been deprecated

14:17 aaelony: when I change rand-nth to next, it runs then bombs out

14:17 a more apt use case is something that consumes something, rather than select a random line.

14:17 technomancy: aaelony: you shouldn't expect to be able to replace a call to rand-nth with next

14:18 rand-nth returns a single element and next returns a seq

14:18 aaelony: what

14:18 what is the

14:18 best way to get the next element to hand off to nextTuple?

14:20 perhaps some way to call first i guess… but unclear to me

14:23 technomancy: that helps. Calling "first" works without bombing (even if it doesn't do anything useful). Next to is to see if some kind of first & rest thing will work. thanks...

14:25 danostrowski: hey all

14:28 knob: hey

14:28 =)

14:28 technomancy: going to release leiningen 2.0.0-RC1 today; if you have any open issues that you'd like addressed please let me know

14:29 abp: technomancy, leiningen is great, but I don't think that's an issue.

14:40 TimMc: technomancy: sweeet

14:41 Will we get a lein-newnew 0.3.6?

14:41 technomancy: oh, thanks for the reminder

14:42 TimMc: technomancy: Reminder: It's gonna break lein's tests.

14:44 technomancy: oh, we're on 0.3.6 on master already

14:47 it's 0.3.7 we want

14:49 TimMc: Huh, OK. I don't see a 3.6 tag on lein-newnew's repo, by the way.

14:49 $latest lein-newnew

14:49 lazybot: [lein-newnew "0.3.7"] -- https://clojars.org/lein-newnew

14:49 technomancy: thanks; tagged

14:51 wei_: is it possible to run cljs and clojure code in the same process? my goal is integration testing where I can run clojurescript and observe backend changes

14:55 TimMc: wei_: What do you mean by "in the same process"? CLJS runs on JS VMs, CLJ runs on the JVM.

14:55 technomancy: rhino/nashorn?

14:55 pjstadig: technomancy: jinx

14:55 aaelony: made a list of my storm-starter questions https://www.refheap.com/paste/8335. The storm-user irc channel is silent and likely doesn't use clojure so I am asking here. thanks in advance.

14:55 TimMc: Are you saying you want to launch a headless browser or something?

14:56 danostrowski: Hey all. So this is a really noobie question, but, what is Maven's relationship with Clojure? I am about to start learning Clojure and while I currently use Python, in past lives I've done Java. I remember Maven being particularly complicated and painful so I was glad to see that lein looked more like pip or easy install.

14:57 How much Maven will I have to know to get started writing a Clojure project? At least one of these "start here" things for IDEs I'm familiar with say to make a Maven project.

14:57 wei_: i guess the JS VM and the JVM don't have to be "the same process" as long as they can interact. I thought though that you could get a clojurescript repl from within a clojure repl

14:57 TimMc: danostrowski: You *can* use Maven when building/running Clojure, but almost everyone uses leiningen instead.

14:57 danostrowski: TimMc, that's exactly the answer I was hoping for. :)

14:57 TimMc: A lot of online guides are completely out in left field.

14:58 danostrowski: Right. OK. Cool. I think I'll give CCW a try. Not sure I'm committed enough for an Emacs excursion.

14:58 ... yet anyhow.

14:58 TimMc: danostrowski: How about vim?

14:58 * technomancy seconds the notion

14:58 TimMc: There's some decent support there as well.

14:59 danostrowski: TimMc, I've used vim-clojure on our servers for editing Riemann scripts already.

14:59 Which is fine, but I find that now that I'm spoiled on IDEs, I like to have a lot more files open than I prefer to have open in Vim. I don't konw, there's something psychological about it I suppose. If CCW is not great, I will probably fire up vim-clojure.

15:00 TimMc: I last tried CCW like a year ago and didn't find the experience pleasant, but I hear that it has come a long ways.

15:02 As long as it has syntax highlighting, identation support, and paredit (or similar), I'm happy.

15:02 *indentation

15:02 danostrowski: TimMc, my experience is that the debugger is always better in a JetBrains project, but that Eclipse maybe has better paredit capabilities.

15:02 I may try La Clojure, too, since I use PyCharm every day and love it.

15:03 Of course, since I don't even know what paredit means really I may not miss it at first, haha.

15:04 amalloy: yeah, if you don't know what paredit is you won't miss it...but you'll be missing out, all the same

15:06 arcatan: does vim-clojure have a paredit-equivalent?

15:07 jlewis: yeah that's a paredit plugin, it's separate

15:10 arcatan: ah, okay

15:10 paredit is the main reason i'm using emacs for clojure coding, while i usually use vim for everything else

15:11 bultje: arcatan: isn't there a paredit-a-like for vim?

15:11 jlewis: http://www.vim.org/scripts/script.php?script_id=3998

15:11 bultje: that one ;-)

15:12 arcatan: yeah. i have to try it out at some point.

15:12 jlewis: or https://github.com/vim-scripts/paredit.vim for the github happy

15:12 i can vouch for its awesomeness.

15:12 bultje: jlewis: thanks, will try it out now...

15:12 came in here to check up on the whole clojure-vim combo status

15:13 and erm... *dumdum* on windows... :P

15:17 avidal: Is there a recommended jar for connecting to unix domain sockets in clojure? Preferably something that has a native clojure API, and perhaps supports both domain sockets and tcp/udp sockets?

15:19 i guess i can ignore unix domain sockets for now and use pocket from clojars

15:19 Bronsa: https://github.com/meh/clj-sockets this is being written

15:20 bultje: is there a 'sanctioned' method of connecting to nrepl via vim already?

15:20 or is that still wip?

15:22 brainproxy: avidal: there's also the aleph library, but I don't tihnk it supports domain sockets, only tcp/udp

15:22 also, http, websocket and some others

15:23 amalloy: aleph is based on netty, which doesn't support domain sockets

15:29 avidal: roger

15:29 i'll skip sockets for now anyway

15:29 weavejester: Has anyone heard of a "chunked readahead" function for consuming lazy seqs?

15:29 avidal: i'm new to clojure, trying to generate requests to an scgi socket which can be configured to listen on tcp or on a unix socket

15:29 weavejester: Something where it would read ahead N spaces

15:29 avidal: so i'll try to generate the actual request first

15:29 amalloy: weavejester: seque?

15:30 weavejester: amalloy: Ah, I've never used that one before

15:31 amalloy: weavejester: be aware that the version in clojure.core will leak a thread under some circumstances. if you're not on a 1.5 prerelease, you probably want to use useful's seque*

15:34 weavejester: amalloy: I'm spawning off a bunch of threads anyway, so… it might be okay

15:35 amalloy: weavejester: i mean, each time you call seque, it leaks a new thread (or can, depending on race conditions based on how you consume from it). if you only call seque once, that's fine; but we had a powerhouse of a machine grind to a halt after leaking thousands of threads

15:35 weavejester: amalloy: Ohhhh. That's worse.

15:35 amalloy: So where's this seque*?

15:36 amalloy: weavejester: https://github.com/flatland/useful/blob/develop/src/flatland/useful/seq.clj#L322

15:38 arrdem: someone said that there's a vimclojure replacement?

15:39 weavejester: amalloy: Awesome, thank you

15:40 amalloy: you're welcome! that's the functionality you meant by chunked readahead, then, i hope?

15:42 bosie: is there a loop function that i can use which produces no output/end result?

15:44 https://gist.github.com/4505549

15:44 problem is the output in line 7

15:48 mmitchell: is there a function like select-keys but for vectors? something like select-indices?

15:51 amalloy: it couldn't efficiently return a vector, mmitchell

15:51 jkkramer: ,(map [:a :b :c :d] [1 2 0]) ;mmitchel

15:51 clojurebot: (:b :c :a)

15:51 jkkramer: ,(mapv [:a :b :c :d] [1 2 0])

15:51 clojurebot: [:b :c :a]

15:51 mmitchell: interesting!

15:51 thanks!

15:54 TimMc: bosie: Every Clojure expression has a return value.

15:54 bosie: TimMc: hm

15:54 daydreamt: bosie:If it's the printing that troubles you, you only get the end result because of the repl. If you were to compile and run the program, the last line wouldn't be printed.

15:55 bosie: daydreamt: but wouldn't i feed it regardless?

15:55 daydreamt: if i want a generic output function that prints every Nth iteration

15:56 TimMc: bosie: The problem is that you are in a REPL, which will print the return value.

15:56 bosie: daydreamt: i could wrap it in reduce (as i did) but then reduce itself has a return value

15:56 TimMc: Try (do (reduce ...) "ignore me!")

15:56 bosie: TimMc: k

15:57 TimMc: If you have an application, the only time this will be relevant is in your -main function, where you can return nil.

15:57 *where returning nil doesn't result in printing.

15:58 bosie: hm

15:59 https://gist.github.com/8e6ad0c6087af8cd6dd7

16:00 TimMc: Well, sure.

16:00 bosie: the output is there

16:01 TimMc: map doesn't operate on STDOUT, it operates on values you pass to it

16:01 You're throwing away the 0, 2, and 4 after printing them.

16:03 bosie: but map doesn't let me "sum up" a counter like i do with reduce?

16:04 oh

16:04 mefisto`: this is strange... I'm in emacs, and fire up nrepl, and any time I try to do anything, an empty *nrepl-error* buffer appears

16:04 bosie: hm

16:04 i could use iterate and pass it into map i guess

16:05 arrdem: in ring if I want to use $PROJ_ROOT/resources/public/$PATH for my static files I just use (route/resources "resources/public"), right?

16:05 bosie: thanks TimMc

16:06 amalloy: (resources "/"), i think. might be "/public", but i don't thinks o

16:06 weavejester: arrdem: No, (resources "/"), because "/" is the path

16:07 arrdem: The default root is public, e.g. (resources "/" {:root "public"})

16:07 mefisto`: never mind, figured it out

16:08 TimMc: mefisto`: What was it?

16:08 arrdem: weavejester: thanks

16:11 mefisto`: TimMc: misspelled :use in my ns declaration. The error message went to *Messages* only, and *nrepl-error* was empty, oddly enough

16:12 arrdem: woohoo! weavejester is there a reason that I had to do route/resources _first_ and _then_ my routes?

16:13 weavejester: arrdem: The routes are matched in order, so route/resources should probably be after your other routes.

16:13 arrdem: But it shouldn't really matter, because ideally you won't have a resource named the same as a route.

16:14 arrdem: weavejester: right.... if I define a "/" page and have resources on "/" won't that bug it?

16:14 weavejester: arrdem: No, because "/" is just the prefix.

16:15 arrdem: For instance, let's say you have a file "resource/public/foo.html"

16:15 arrdem: mmkay cool! thanks for the help, I'm learning to subsist w/o Noir atm

16:15 weavejester: arrdem: Since the "resources" directory is on the classpath, that means you have a "public/foo.html

16:15 resource

16:15 TimMc: mefisto`: THanks. I'm filing that away for when I next try to use nrepl in Emacs.

16:16 weavejester: So (route/resoures "/static" {:root "public"}) would give you a "static/foo.html" route

16:16 (route/resources "/" {:root "public"}) would give you a "/foo.html" route

16:16 And since the default root is "public", you can just write (route/resources "/")

16:21 devinus: are there any other advanced clojure books like JoC?

16:23 AimHere: Maybe not clojure, but you could try pinching ideas from other lisp books, like On Lisp

16:26 yogthos: arrdem: btw, I'm trying to fill the Noir niche with Luminus http://www.luminusweb.net/

16:27 arrdem: yogthos: oh yeah didn't you mention that you were doing a post-noir CMS a while back?

16:27 yogthos: arrdem: yeah, it's been moving along steadily :)

16:27 arrdem: unlike noir though, I'm not adding any new ways to define routes, so once you create the project from the template it's just plain compojure

16:28 * arrdem shrugs

16:28 arrdem: that seems to be the only thing that noir really *added* that lib-noir doesn't encompas

16:28 sp?

16:28 clojurebot: Lisp isn't a language, it's a building material.

16:28 yogthos: arrdem: main goal is to provide good defaults via the template

16:29 arrdem: I'm putting all the functionality into lib-noir, which has some updates already

16:32 arrdem: yogthos: very cool, will definitely check it out when I start my next web project I think I'm past the "find sane defaults" step on the current one XP

16:32 yogthos: arrdem: haha sure thing, it'll get more polish by then too :)

16:35 * arrdem wanders off to cook lunch and ponder replacing (defpage)

16:42 zepard: hey

16:53 mattmoss: $findfn 1 2 5

16:53 lazybot: [clojure.core/bit-set clojure.core/bit-flip]

16:54 aaelony: in my quest to learn Storm, came across this gem: (defmacro dofor [& body] `(doall (for ~@body))) Now that's something I've needed for some time!!

16:55 technomancy: aaelony: you don't need that

16:56 aaelony: technomancy: it's pretty common to get unrealized lazy seqs that I actually do need

16:56 technomancy: then you should call doall on them

16:57 aaelony: I do, but it's annoying

16:57 loganlinn: so you call dofor instead?

16:57 technomancy: not as annoying as creating a macro for a single call composition

16:57 aaelony: haha, maybe

16:58 just looking through this… https://github.com/nathanmarz/storm/blob/master/src/clj/backtype/storm/util.clj

16:59 line 294

16:59 technomancy: gross =(

17:00 aaelony: haha

17:00 technomancy: there are a lot of things wrong with that file; not sure where to begin

17:00 seriously though, don't write a macro for something so trivial

17:01 aaelony: actually, though I understand macros, I haven't yet needed to write one.

17:01 but I need to use doall almost every time i need for

17:01 gtrak: I thought I understood macros until I wrote a few

17:02 amalloy: then you're not using for very well. having to doall them is very rare

17:02 aaelony: fine

17:02 technomancy: if you need doall a lot then you should probably re-examine your use of dynamic scope

17:02 nDuff: ...that, or you're using for in a place where you should be using doseq

17:02 aaelony: the use case is typically a large data structure with many nested levels

17:02 amalloy: i hate that storm util file too, personally, but i can't really object to its having been written; the whole point of util files is to capture patterns for personal use. so it's a great util file for whoever wrote it (nathan?) but shouldn't be stolen from

17:03 technomancy: amalloy: bare use and trailing parens though

17:03 ibdknox: it's old

17:04 the vendetta against bare use wasn't a thing until about 8-9 months ago

17:04 hiredman: that is not true

17:04 amalloy: ibdknox: that's not true at all

17:04 technomancy: bare use has always been bad form

17:04 ivan: it's obviously bad in other languages

17:04 amalloy: and the file is only a year old; it's not like nathan was just learning clojure

17:05 ibdknox: virtually every piece of code I looked at in clojure land a year ago had uses in it

17:05 including stuff from core

17:05 so

17:05 technomancy: the change is that all use calls are now discouraged

17:05 hiredman: ibdknox: yes, that just means they are all behind #clojure

17:06 ibdknox: hiredman: sure, my point was more generally that isn't surprising that there's still lots of code out there with them in it :)

17:06 amalloy: nothing was wrong with use; use-without-only was the problem

17:06 ibdknox: and I don't think you can fault the code writers for it, since the greater body of Clojure work used them

17:06 aaelony: look what I've started ...

17:06 yogthos: I find use to only be really offensive when referencing code within the project

17:07 amalloy: i think the :use's in that file are a pretty small portion of the problem

17:08 aaelony: is the problem that it's inelegant? or done for speed?

17:08 ibdknox: amalloy: technomancy: hiredman: to be clear, I'm firmly against bare use as well - just don't think you can get upset with people over it given the history

17:08 technomancy: amalloy: I was starting at the top and working my way down =)

17:08 ibdknox: just saying it's not a good example to crib from. I don't have the context to make a value judgment beyond that.

17:09 hiredman: ibdknox: that implies a sort of "no one was ever fired for buying ibm" mentality towards coding practices

17:09 amalloy: most of it is in fact already cribbed from old-contrib

17:09 hiredman: "you can't say this code is bad, because it does the same thing all the other code does"

17:10 systemfault: I'm reading joy of clojure at the moment, I'm at the beginning (Quoting) and it's saying that quote is more used than ' , is that true?

17:11 amalloy: i doubt it

17:12 mpan: is it the case that clojure applets in general need to run as signed?

17:12 hiredman: heh 2009:Jun:08:07:32:16 drewr : Ugh. I'm seeing more and more :use without :only. We need a PEP 8 for Clojure.

17:12 yogthos: don't people generally prefer to use vectors to lists?

17:12 ibdknox: hiredman: conventions aren't always determined by the few, in this case whatever prevails in common use is what becomes convention to new people. Which in this case happens to be unfortunate

17:13 lol too many "in this cases" in there

17:15 do we have a good place to learn best practice for Clojure? (books aside)

17:15 a tiny percent of the population will ever visit #clojure

17:16 yogthos: somebody started this https://github.com/bbatsov/clojure-style-guide

17:16 hiredman: https://github.com/bbatsov/clojure-style-guide/pull/31

17:17 aaelony: ibdknox: this started for me because i need to understand storm-starter well enough to apply it to any input source. https://www.refheap.com/paste/8335 that got me having to start source diving...

17:17 ibdknox: hiredman: haha

17:17 pjstadig: is it pragmatic to have a bare use or not?

17:17 yogthos: lol

17:17 arrdem: the consensus seems to be not...

17:17 hiredman: bbatsov has a bunch of "style guide" repos for a number of different languages

17:17 technomancy: pjstadig: it's nice and short to type in the repl

17:18 amalloy: systemfault: you misread that sentence

17:19 "In other Lisps, this need is so common that they provide a shortcut: a single quote. Although it’s used less in Clojure, it’s still provided." - quoting is less common in clojure than in other lisps, but ' is still provided

17:19 hiredman: I can't say I recognize him as any kind of style authority

17:19 systemfault: amalloy: Ahh, my bad.

17:20 yogthos: amalloy: would that be related to the fact that Clojure has a literal notation for vectors?

17:20 technomancy: hiredman: maybe if he submitted a pull request to https://github.com/PharkMillups/thought-leaders

17:20 hiredman: yes

17:20 only if he makes the thought-leaders list

17:20 loganlinn: lol

17:22 amalloy: beats me, yogthos. i'm just explaining what fogus/chouser meant, not agreeing or justifying

17:23 pjstadig: i think that's what it means

17:23 in clojure you usually just quote symbols

17:23 in other lisp you're often quoting lists of data

17:24 there's more data as data forms in clojure, so there's not the need to "escape evaluation to make some data"

17:24 AimHere: Also, don't other lisps use quoted symbols where clojure uses keywords?

17:24 arrdem: many do...

17:24 yogthos: amalloy: I find I practically always use vectors unless I have a specific reason to use a list, which isn't often

17:25 pjstadig: right many cases where you might use a quoted symbol you go for the keyword instead

17:25 so it becomes pretty rare to have quote things

17:25 yogthos: pjstadig: mostly in macros :)

17:25 AimHere: Or maybe the repl

17:31 pjstadig: technomancy: it seems the thought leaders list is missing "Mark Phillips: thought leaders"

17:31 should have been the first one :(

17:32 bpr: technomancy: is there any chance that the lein-otf will get folded into leiningen as default behavior?

17:32 technomancy: pjstadig: there's a pull request for that

17:32 pjstadig: ah

17:32 technomancy: bpr: probably not since AOT is typically a good idea when creating distributables for purposes of error-catching and startup time

17:33 bpr: technomancy: ah. ok thanks

17:36 i'm not fully up to speed with how profiles work, but can my dev profile attach a ^:skip-aot to my :main class while my :release profile doesn't?

17:36 technomancy: bpr: in the latest version of leiningen having :main does not trigger AOT

17:36 TimMc: nice

17:36 technomancy: so you could have :aot 'all in the base

17:37 and then put :aot ^:replace [] in the dev profile I think?

17:37 hm; is that what you meant by lein-otf behaviour as default?

17:37 arrdem: weavejester: is there a "best practice" to structuring your route definitions?

17:37 technomancy: it's not quite the same as it doesn't provide its own gen-class'd :main

17:37 TimMc: technomancy: Do yopu advocate AOT for libs?

17:37 technomancy: but you can always use clojure.core -m whatevs.main

17:37 bpr: not exactly, but that does what I'm looking for too

17:37 technomancy: TimMc: not if there's any way around it

17:38 TimMc: OK, just checking. "distributables" has an ambiguous target.

17:38 technomancy: ah yeah, should have said end-user distributables

17:53 Fare: hi

17:56 cemerick: Fare: hi :-)

17:56 TimMc: Fare!

17:57 cemerick: in #clojure, even ;-)

18:00 amalloy: lamina gets really sad if you plug a channel back into itself

18:00 Fare: I'm now on the ALU board, and I'm trying to widen its scope.

18:00 mattmoss: Am I being stupid and missing some builtin that effectively does this?: (if (nil? x) [] (if (coll? x) (vec x) [x])))

18:00 ne1_1: <technomancy> bpr: in the latest version of leiningen having :main does not trigger AOT - sounds great, not AOTing speeds things up a lot for me

18:01 Fare: I know that things didn't end nicely when Rich Hickey left the board a few years back -- but water has passed under the bridges since.

18:01 ian_: noob here. I'm using a (for) to iterate over a vector. Is it possible to get the index? e.g. 0 for the first element, 1 for the second, and so on. Or maybe there's some type of zip operation? What is the idiomatic way to do this? (FWIW, i'm storing all the elements in a DB and need to store the position.)

18:01 S11001001: &(doc map-indexed)

18:01 lazybot: ⇒ "([f coll]); Returns a lazy sequence consisting of the result of applying f to 0 and the first item of coll, followed by applying f to 1 and the second item in coll, etc, until coll is exhausted. Thus function f should accept 2 arguments, index and item."

18:01 S11001001: ^^ ian_

18:02 bbloom: mattmoss: there isn't a native coll-ify or vec-ify sort of wrapper like that. every time i've wanted one, i find out later that i didn't want it :-P but that said, take a look at ##(doc fnil) which should help a bit

18:02 lazybot: ⇒ "([f x] [f x y] [f x y z]); Takes a function f, and returns a function that calls f, replacing a nil first argument to f with the supplied value x. Higher arity versions can replace arguments in the second and third positions (y, z). Note that the function f can... https://www.refheap.com/paste/8352

18:02 arohner: is there a way to "apply" core.logic constraints? I want to take a seq of constraints as arguments to a fn, and apply them in a run*

18:02 ian_: S11001001: Thanks

18:03 S11001001: Fare: going to boston-clojure tonight?

18:03 bbloom: mattmoss: i guess the reason it doesn't exist is because there are two variables: what test to use and what collection to create. you'd need the cross product of seq? coll? vector? X list vec etc

18:03 mattmoss: bbloom: Thanks, I'll check fnil again, see if it fits in nicely. Basically, my multi-select form will return nil, a single string, or a vector of strings depending on what the user selected.

18:03 bbloom: oh add to that sequential?

18:04 TimMc: What's ALU, besides a CPU component?

18:04 Fare: S11001001, oh -- what / where / when -- lemme check the web

18:04 S11001001: Fare: akamai, 8 cambridge center (near kendall), 6:30

18:04 TimMc: Oh right, I was about to head over to Basho.

18:04 S11001001: heh

18:04 mattmoss: Which I then need to have a vector (or some sequential) before passing it on into library code.

18:05 Fare: http://www.meetup.com/Boston-Clojure-Group/events/95400612/

18:05 I might be a bit late.

18:07 cemerick: TimMc: Association of Lisp Users, IIRC

18:20 clizzin: i've got a compojure app that is intended to respond to most requests with json, so i'm using the wrap-json-response middleware from ring-json. however, there is one route that i want to return plain text. i'm imagining that i need to merge two sets of routes, but one of those sets of routes needs some middleware attached to it first. how can i do that?

18:20 ian_: Um... I got map-indexed going, but it's not doing anything. I'm guessing this is because it's a lazy seq. How can I force this to run?

18:21 gtrak: ian_: dorun doall doseq depending on what you want

18:22 ian_: gtrak: Thanks!

18:23 gtrak: you should try to avoid needing to care about that though, if there are side effects you should postpone them until transformations are finished

18:23 weavejester: clizzin: You can attach middleware to whatever set of routes you like

18:23 callen: technomancy: goddamn you, I'm writing CSS and keep typing lein-height

18:23 weavejester: clizzin: A route is just a Ring handler

18:23 Raynes: callen: Hahahahaha. I do that. All the time.

18:23 gtrak: lein height plugin

18:24 xeqi: clizzin: (defroutes app (-> json-routes wrap-json-response) plain-text-routes) I think

18:24 callen: Raynes: the CSS is scorching my brain.

18:24 Raynes: none of it makes any sense.

18:24 I clearly need to just sit down and read the spec end to end.

18:24 systemfault: callen: It won't help you that much..

18:25 callen: systemfault: haha, you were in #css right?

18:25 systemfault: callen: Yeah.

18:25 clizzin: weavejester: xeqi: ah, great, i think i just forgot that i needed to wrap *all* the routes in one of the compojure handler wrapper fns. as a result, my plain-text-routes weren't being handled properly

18:25 ian_: gtrak: I think I understand. I'm inserting into a DB. That's pure side-effect, so I have to force it.

18:26 gtrak: ian_: yea, I'm guessing you're mapping the side effect over the result of map-indexed?

18:26 callen: systemfault: we are forever cursed re: CSS?

18:26 there'

18:26 there's no deeper understanding? it'll always be batshit?

18:26 systemfault: callen: We should be fine in about 5 years...

18:27 gtrak: ian_: not sure if there's a better way, but I would always hope to avoid explicitly forcing stuff

18:27 isn't the entire web stack batshit?

18:27 systemfault: callen: We'll have a logical box model.. real columns.. real typography support.. etc

18:28 gtrak: I'm a fan of the simplicity of the HTTP protocol

18:28 gtrak: yea, http doesn't bother me too much, though implementation caveats wrt browsers are pretty heinous

18:29 ie, use POST

18:29 weavejester: systemfault: HTTP is kinda a bit weird too, but all protocols from that era are.

18:29 systemfault: I'm the kind of guy who touches himself while thinking a REST/HATEOAS/Hypermedia APIs

18:29 weavejester: Nowadays we'd write a protocol to pass around basic data types, like bencode

18:30 systemfault: s/a/of

18:30 weavejester: But older protocols seem to be designed to be human readable over a TCP stream

18:30 callen: HATEOAS is fascism.

18:31 gtrak: systemfault: I don't know about the latter 2, but I think if I did I'd still say that's unfortunate

18:31 systemfault: callen: how?

18:31 callen: and based on a religion of similar provenance to the Christians.

18:31 systemfault: it's all based on one little thing a dude wrote

18:31 weavejester: I like the idea of REST, but Rich argued me round to his point of view regarding things like URLs.

18:31 callen: systemfault: they took it too far.

18:31 weavejester: what's his point of view WRT URLs?

18:31 systemfault: callen: That dude is one of the creators of the HTTP protocol, not some weird unknown dude

18:32 Raynes: callen: Careful now, you'll summon pitchforks.

18:32 callen: Also, you should listen to Somebody Told Me by The Killers.

18:33 systemfault: Hmm...

18:33 gtrak: I'm not sure what's so special about the web that makes call stacks an unsuitable abstraction.

18:33 systemfault: Did your boyfriend looks like a girlfriend I had back in february of last year?

18:33 callen: Raynes: firing it up right now.

18:33 weavejester: callen: That there should be some way of telling the difference between a "value" URL and a "reference" URL.

18:34 brb

18:34 Raynes: callen: I think you're the only person who consistently listens to music I tell him to listen to, and you listen to nearly the exact opposite of what I do.

18:34 weavejester: or maybe bbl :)

18:34 Raynes: You're fascinating.

18:34 technomancy: http://wondermark.com/282/

18:34 callen: Raynes: I am an excellent discriminant of advice.

18:35 my CSS classes are all in lolcat today.

18:36 systemfault: I'm surprised we got so far with CSS...

18:38 gtrak: I don't know, I'd say the web was doomed to fail if it wasn't a natural monopoly.

18:40 systemfault: How difficult is it to run a clojure(servlet?!) web application?

18:40 gtrak: systemfault: super easy

18:40 pick a level of abstraction

18:40 systemfault: Is it "fast enough"? Do I require a server with a lot of resources(mainly ram?)

18:40 gtrak: it's better than spring, probably

18:40 systemfault: Ah, nice

18:42 gtrak: there's no pervasive runtime overhead, except just the number of classes

18:42 lein-ring is the easiest way to do it right now

18:42 systemfault: Is that something like compojure? (I'm still at the "Learning the language" level)

18:42 gtrak: if you want to code-gen your own servlet, that's also pretty trivial

18:42 amalloy: systemfault: 4clojure.com runs with a 60MB heap. resident set size is 126MB at the moment

18:43 gtrak: lein-ring is a leiningen plugin, compojure is a bunch of functions and macros that you use as a library

18:43 callen: Raynes: Killers is one of those bands I don't listen too often, but am happy when I remember when they exist. Good timing on the song.

18:43 amalloy: could probably squeeze out another 30MB or so if it were necessary, but not a lot more

18:43 systemfault: amalloy: Looks acceptable to me, no permgen space errors or things like that?

18:44 Raynes: callen: :D

18:44 amalloy: welllll, it's hard to say because 4clojure is somewhat unusual: its purpose is to run unsafe user-submitted code

18:44 there are problems pretty frequently where someone accidentally realizes an infinite seq

18:45 gtrak: systemfault: you can see how the integration is done here: https://github.com/rmarianski/ring-jetty-servlet-adapter/blob/master/src/ring/adapter/jetty_servlet.clj

18:45 jkkramer: if you use a servlet container like tomcat, there's a bug which can cause permgen errors

18:45 systemfault: Ah! It embeds a jetty server

18:45 gtrak: lein-ring can also do a WAR

18:46 Raynes: callen: This is the first song I've ever listened to by them.

18:46 Or at least the first that stood out to me.

18:46 The chorus is brilliant.

18:46 systemfault: Permgen is set separately from heap space.

18:46 We mainly just limit the heap.

18:47 gtrak: systemfault: here's the other piece of the puzzle: https://github.com/mmcgrana/ring/blob/master/ring-servlet/src/ring/util/servlet.clj

18:48 systemfault: Thank you :)

18:48 gtrak: but unfortunately, if you have a more complicated need, like multiple servlets or filters, you're on your own and should do your own code-gen.

18:48 the abstraction doesn't account for that

18:48 systemfault: I'll start with something simple, I still have a ton of things to learn.

18:49 Raynes: systemfault: The most important thing when writing a Clojure web app is using laser.

18:49 * Raynes shifty eyes.

18:49 * Raynes files his fingernails.

18:49 systemfault: What's laser?

18:50 Raynes: A perpetual infomercial.

18:50 https://github.com/Raynes/laser

18:50 systemfault: Hmm, html templating

18:51 ivan: if someone grepped everything in clojars for hiccup I'm sure there would be many exciting XSS holes

18:52 systemfault: I'm not of fan of describing a document using code but I'll still take a look at Laser once I'll start working on my website.

18:52 gtrak: does laser sanitize user input?

18:52 callen: systemfault: I ended up switching to hiccup from stencil. I just hate mustache too much even if dsantiago's work is good.

18:52 Raynes: systemfault: What do you mean? You write HTML in HTML.

18:52 gtrak: Yes.

18:52 callen: systemfault: I want django/jinja templates in Clojure.

18:53 Raynes: gtrak: Well, hickory does, which laser uses, so it's all good.

18:53 gtrak: well... I definitely need to use that, then!

18:53 Raynes: gtrak: Any strings you put into your HTML are escaped on the way out. If you want to insert HTML anywhere, you have to parse it from a string and insert the nodes.

18:53 gtrak: neat

18:54 Raynes: Because I prefer people not do (html-content "<a>somecrap</a>") and instead do something like (laser/node :a :content "somecrap").

18:54 yogthos: Mornin' beautiful.

18:55 systemfault: Raynes: Can a selector be more complex?

18:55 gtrak: ah, I haven't done enough html to feel like "<a>somecrap</a>" is better to write, but I could see experienced people wanting to do that.

18:55 Raynes: systemfault: A selector can be as complex as you want it to be.

18:55 gtrak: Raynes: is it fast, though?

18:56 Raynes: gtrak: Is laser fast?

18:56 gtrak: yea

18:56 systemfault: Raynes: How would I select the second row of some table for example?

18:57 gtrak: one nice thing about hiccup is I can just eval a template at compile-time and include the emitted string

18:57 callen: Raynes: I GAT SOUL BUT I'M NOT A SOULJAH

18:57 gtrak: though I don't know if that makes sense at scale

18:57 Raynes: It doesn't seem to be slow. I used the same benchmarks tinsel uses and it appears to be about as fast as enlive is for those.

18:57 callen: but enlive is slow.

18:59 Raynes: systemfault: I don't have any built in select-nth sorts of things yet, but you can write a selector to do it. I think the selector would be sort of like child-of. It would answer: am I a child of a table? If so, do I have one sibling to the left of me?

18:59 systemfault: Ah ok

18:59 Raynes: It's definitely possible. Not even hard, really.

18:59 I just haven't written anything to do it in a general case yet.

19:00 gtrak: Well, you can do that sort of thing in laser too. (def foo (my-template args)), etc.

19:00 I think Enlive does some sort of caching too.

19:00 hiredman: /win 11

19:00 Raynes: Laser can probably do that.

19:01 But even if laser didn't you could probably easily wrap caching around it.

19:01 It's all pretty flexible.

19:01 gtrak: yea, I think there's probably an optimization in stringbuilder for strings, if you're escaping everything you might take a hit.

19:02 Raynes: hickory's escape stuff uses a stringbuilder.

19:02 The to-html function isn't particularly efficient though. Hoping to improve that soon.

19:02 gtrak: right, I just mean the java code might not have to go character-by-character necessarily, if escaping, it definitely has to

19:03 just my speculation

19:04 muhoo: hiredman: isn't that supposed to be win \o/ ?

19:05 * muhoo sneaks away after bad irc pun

19:05 gtrak: Raynes: just verified, it uses arraycopy to do the work, so I should be right, unless it's not significant.

19:06 arraycopy is necessarily better than what you get if you check every character

19:06 callen: weavejester: in what respect can a URL refer a value or a reference?

19:06 weavejester: they are by definition all references. They're URLs.

19:08 devn: typical evening surfing clojure github repos: find yet another Raynes repo (fs)

19:08 Raynes: lol

19:09 devn: i like this.

19:10 gtrak: so if there's a way to box up a string and mark it as safe, it might be beneficial

19:11 whitelist instead of blacklist (having to manually escape everything)

19:13 devn: Raynes: one thing about laser i noticed that isn't that big of a deal, but was a little awkward IMO was (l/and (l/element= :div) (l/class= "foo")) -- :div and "foo", keyword and string, seemed like maybe it would be better to just have the opinion that in every place you can expect to use a kw

19:14 Raynes: devn: I didn't give it much though, but that seems fair. I can just call name on the input.

19:14 devn: it could also just as well be a string everywhere

19:14 Raynes: I did it that way because that's the actual internal representation (that I did not come up with).

19:14 Tags are keywords, attributes are strings.

19:15 But there isn't anything wrong with doing (name ..)

19:15 weavejester: callen: A URL can point to a resource that never changes

19:15 callen: Effectively a value.

19:15 devn: Raynes: what do you think about saying everything is a string?

19:15 gtrak: devn: no!

19:15 Raynes: I think I'd prefer to just work with keywords.

19:16 With the the option of strings.

19:16 devn: i can imagine someone doing something clever where they want to prepend something to every class they're adding in a template

19:16 callen: weavejester: it's an ontology created from a distinction that is trivial.

19:16 weavejester: that is exceptionally weird.

19:16 Raynes: The internal representation will still be strings, devn.

19:16 callen: weavejester: you should write a templating library.

19:16 gtrak: string literals are not used for semantics in clojure, keywords are

19:16 weavejester: callen: A templating library?

19:16 Raynes: All I'm proposing is letting them pass keywords to functions like class= and what not.

19:17 callen: weavejester: yeah, for templating HTML. for web apps.

19:17 weavejester: callen: Like Hiccup?

19:17 callen: Or Comb, my Erb clone?

19:17 callen: weavejester: you mean CL-WHO's Revenge?

19:17 devn: (str "prefix-" thingy) vs (str "thingy" (name :thingy))

19:17 callen: wait, Comb. need to see this.

19:17 devn: Raynes: yeah i like the "either one works" idea

19:18 Raynes: It can be as consistent as people want it to be in that case.

19:18 weavejester: callen: https://github.com/weavejester/comb

19:18 devn: Raynes: double agree. like it.

19:18 weavejester: It's basically just Erb

19:18 callen: weavejester: yeah looking at it. intriguing. just wish it had extends/include.

19:18 ibdknox: callen: I've sent you comb multiple times :p haha

19:18 devn: i go looking for new templating libs in clojure maybe once a month

19:19 Raynes: ibdknox: How are things?

19:19 callen: ibdknox: I ended up looking at a few that are analogous to comb.

19:19 devn: have you found any that don't make you piss blood?

19:19 Raynes: ibdknox: Are you going to move to LA so we can go out?

19:19 callen: I suffice with Hiccup, but meh

19:19 ibdknox: Raynes: haha, I don't think I'll be moving in the near future :p

19:19 callen: Raynes: he's in the bay area. this place is a black hole.

19:19 IIRC, anyway.

19:19 ibdknox: Raynes: I did, however, get JS eval working last night...

19:20 technomancy: what if recompiling an ns form after adding :refer-clojure :exclude could unmap it for you?

19:20 ibdknox: 0.3.0 is going to be a bigger release than I thought :)

19:20 Raynes: ibdknox: Haskell and Python or gtfo.

19:20 ibdknox: lol

19:20 weavejester: There are a few mustache libs around

19:20 Like Stencil: https://github.com/davidsantiago/stencil

19:20 devn: callen: of all of them hiccup has been my go to, but i mean, here's the rub: I like views being more like functions than something like erb

19:20 ibdknox: Raynes: so picky :p

19:20 Raynes: ibdknox: Also, paredit.

19:20 devn: which is why laser is appealing (and enlive before it)

19:21 gtrak: ibdknox: I played around with the new version of light-table, is it ready for folks look at source and try to extend and such yet?

19:21 ibdknox: Raynes: I think that may be on its way

19:21 devn: although i think i like the simplicity of laser right now

19:21 callen: weavejester: I love stencil's underpinnings but hate mustache.

19:21 Raynes: ibdknox: Someone working on an efficient version?

19:21 ibdknox: gtrak: not yet, that'll be part of the beta that goes to the KS people

19:21 callen: weavejester: I want django/jinja templates. If I'm really lucky, that hybridized with comb.

19:21 ibdknox: Raynes: yep, talked to someone who wants to help out

19:21 gtrak: ibdknox: ah, I don't remember if I'm that high on the KS

19:22 devn: callen: i think after all of this time staring at different templating thingies, i wind up thinking enlive, laser, or hiccup make the most sense to me

19:22 gtrak: ibdknox: ah, guess not :-)

19:22 devn: i dont like littering the filesystem and eval'ing in the context of a thingy

19:23 callen: devn: I like being productive.

19:23 devn: callen: so why ever learn anything new?

19:24 callen: devn: sometimes new things are more productive.

19:24 Raynes: technomancy: You're a proponent of ex-info right?

19:24 devn: callen: but they have an initial opportunity cost sometimes

19:24 it's like learning a lisp

19:24 enlive was like that for me, it was a different way of thinking about templates for me

19:25 callen: devn: you're misunderstanding me, taking that misunderstanding, lighting it on fire, and then complaining about burnt hands. hold on.

19:25 Raynes: lol

19:25 devn: bahaha

19:25 callen: devn: I said new things are more productive sometimes. That includes the cost of learning the new thing. That's fine.

19:25 technomancy: Raynes: always have been; always will be

19:25 Raynes: technomancy: How does it work?

19:26 callen: devn: I'm saying that hiccup/enlive/stencil are categorically inferior to some alternatives that I currently use and it pains my soul that it prevents Clojure being a "practical" choice for me.

19:26 Raynes: technomancy: Like, I want to throw a nice exception. That's what this is for, right?

19:26 devn: callen: i think we probably are dancing around some sort of violent agreement.

19:26 technomancy: Raynes: (throw (ex-info "ex-info needs explaining" {:explainer "technomancy" :explainee "Raynes"}))

19:26 Raynes: technomancy: Sounds excellent.

19:27 technomancy: it really is

19:27 devn: callen: i hate to be "that open source guy" but, if there's a templating language that's better, why not port it to clojure?

19:27 technomancy: Raynes: if you use slingshot, you can destructure ex-infos <3

19:29 cemerick: callen: enlive is slow? o.O

19:29 devn: cemerick: he's right i think

19:29 :X

19:30 wait, before you respond

19:30 i retract that because i have no idea

19:30 cemerick: it'd be interesting to see numbers

19:30 I know cgrand spent a ton of time optimizing it *shrug*

19:30 ibdknox: someone benchmarked all the common libs a while back

19:30 callen: cemerick: I don't hold myself accountable to the fascism of numericism.

19:30 ibdknox: and enlive was quite a bit slower

19:30 callen: ibdknox: stop proving me right.

19:30 ibdknox: now whether or not that has any practical implication...

19:30 Raynes: cemerick: dsantiago has some benchmarks on his tinsel page, and I have some on laser's page. Laser and Enlive are the slowest templating engines in Clojure.

19:30 devn: yeah, i'd be interested to see that -- all i'm basing that on is ancedotal evidence from dealing with some particularly messy DOMs

19:31 callen: devn: wanna know how slow enlive is?

19:32 devn: HOW SLOW IS IT?

19:32 callen: devn: REAL DAMN SLOW BRO!

19:33 ibdknox: the practical implications are obvious. It's a templating library for quiche-eaters.

19:33 devn: aw, i was hoping for a "it's so slow, that the chariots of fire theme song plays every time you render a template"

19:33 callen: devn: clearly you have more panache for this.

19:34 devn: callen: quiches aren't easy to make

19:34 gtrak: callen: are you blaming the french?

19:34 callen: gtrak: dude. you seriously don't know this famous bit of hacker lore?

19:35 devn: dude, i don't know it either.

19:35 gtrak: ah, no! too young.

19:35 I will learn it

19:35 callen: http://en.wikipedia.org/wiki/Real_Programmers_Don't_Use_Pascal

19:36 gtrak: I'm not old :|

19:36 devn: http://www.th-soft.com/zzJargon/

19:37 wei_: re: a previous question, is it possible to drive cljs and clojure with the same code? goal is to write an integration test that manipulates a javascript widget and then looks in the database to observe changes

19:37 devn: wei_: i think that's what crossover is about???

19:37 lazybot: devn: Oh, absolutely.

19:37 ivan: can't be slower than that old version of Genshi

19:38 callen: ivan: you are from the land of snakes...what do you use for templating?

19:39 ivan: I use jinja2 in my Python programs but for Clojure want a fixed hiccup that escapes everything

19:39 callen: ivan: sigh, I use jinja2 in Python.

19:39 ivan: I might change my mind if s-exps for HTML turn out to be problematic

19:40 but I find this unlikely

19:41 wei_: devn: thanks, just read that. seems like crossovers are for sharing code between cljs and clojure compilers. but, is it possible to run cljs code, and then clj code within a single test?

19:41 ivan: sure, you can run cljs code with rhino

19:42 Raynes: dsantiago: Are you trying to keep 1.3.0 support in hickory?

19:42 ivan: do you want to test with a real browser?

19:42 Raynes: Clojure 1.3.0, that is.

19:42 wei_: phantomjs

19:42 dsantiago: Raynes: Hadn't thought about it.

19:43 Raynes: dsantiago: I'm playing around with using ex-info to improve error messages, but IIRC it is 1.4.0-only.

19:43 dsantiago: My usual policy is to just use new features if they are worthwhile, and if you need to work with an older Clojure, use an old version.

19:44 Raynes: Sounds reasonable. I'll see what I come up with and show it to you later.

19:44 dsantiago: Sure

19:44 gtrak: 1.3 to 1.4 is not a big jump, and are you testing against 1.2?

19:44 Raynes: gtrak: ex-info

19:44 gtrak: yea

19:44 Raynes: That's why the jump would be necessary.

19:45 Unless I'm misunderstanding what you're trying to say.

19:45 gtrak: I'm saying, I'm not sure why someone would avoid 1.4 if they're already on 1.3. If they're on 1.2 I get it.

19:45 ivan: wei_: well, phantomjs is running your compiled JS in that case

19:45 Raynes: Oh.

19:46 gtrak: 1.2 to 1.3 was a month or so for us, 1.4 was a couple of days

19:46 wei_: ivan: yes, the tests references dom elements so I'd need a browser, or a headless browser like phantomjs

19:46 technomancy: agreed there's no reason to stay on 1.3

19:48 frozenlock: Languages like clojure have spoiled me... now I get mad when I do 1 / 2 and get 0.

19:48 gtrak: ,(1 / 2) ;; :-)

19:48 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>

19:48 gtrak: way better

19:49 arrdem: anyone got a compelling reason for me to try a new DB before I start writing more congomongo?

19:50 frozenlock: "You cannot have nested FORALL statements within a FORALL statement." Why the hell not? Raaaaa

19:51 yogthos: technomancy: I noticed something funny with project.clj if there's a new line between :min-lein-version and "2.0.0" then v2 does not get picked up

19:51 frozenlock: arrdem: Still in mongodb, or in another db type?

19:52 arrdem: frozenlock: suggest something. mongo's the only thing I've used more than once, but I'm open and at the point of needing to pick a backend.

19:52 technomancy: yogthos: on heroku or inside leiningen?

19:53 yogthos: technomancy: on heroku

19:53 technomancy: is it something heroku does?

19:53 frozenlock: arrdem: I can't really suggest anything, I've only used congomono :p

19:53 congomongo even

19:53 arrdem: haha well then I guess I'm doing ibdknox's simpledb -> mongodb again

19:54 technomancy: yogthos: the script we use to detect that has to be written in bash, so we don't have access to a full Clojure reader

19:54 tomoj: should hickory include a function for converting hiccup to hickory?

19:54 technomancy: it's a fallible heuristic by design unfortunately

19:54 tomoj: and/or does it already?

19:54 yogthos: technomancy: ah ok, I ran into this when I was injecting stuff into the project file and then pretty printing it :)

19:54 hiredman: time to write a reader in bash

19:55 yogthos: lol

19:56 arrdem: a task I do not envy...

19:56 yogthos: is there anything else to watch out for or is it the only heroku specific flag? :)

19:56 hiredman: I'm sure somebody's written a lisp parser in bash :P

19:57 technomancy: yogthos: leiningen will issue a warning, and it has the proper map to work with rather than grep

19:58 yogthos: technomancy: yeah I saw the warning, but took me a few min to figure out what was causing it ;)

20:03 argh pretty printer really doesn't like the idea of putting them on the same line even with *print-right-margin* set

20:04 I guess because the structure is a list, it reasonably decides to put each item on its own line

20:05 technomancy: the pretty printer is beyond the scope of puny human minds

20:05 yogthos: lol

20:05 it's technically doing the right thing

20:09 bpr: is there a way to query a multimethod for a list of methods registered with it?

20:10 Fare: yes

20:12 technomancy: leiningen 2.0.0-RC1 is out my friends

20:12 https://github.com/technomancy/leiningen/blob/master/NEWS.md

20:13 frozenlock: Yay!

20:13 jkkramer: technomancy: congrats!

20:13 frozenlock: Can it make sandwiches now? :)

20:15 brainproxy: technomancy: congrants, and THANKS!

20:15 technomancy: frozenlock: better make a plugin

20:15 amalloy: &(doc methods) ;; bpr

20:15 lazybot: ⇒ "([multifn]); Given a multimethod, returns a map of dispatch values -> dispatch fns"

20:15 bpr: thanks: amalloy

20:16 amalloy: really just search for "method" in clojure/core.clj to find all the public features; and look in MultiFn.java for a few that are secret and not a good idea to use

20:16 bpr: yeah, i searched for "-method" :-/

20:17 bbloom: bpr: i'll also keep pushing my dispatch-map project :-) https://github.com/brandonbloom/dispatch-map

20:18 bpr: bbloom: i was looking at that earlier. it looks really cool!

20:20 brainproxy: dang, lein-ring is bombing after upgrade to rc1

20:20 lein2 rc1 i mean

20:20 weavejester: ^

20:20 frozenlock: technomancy: I'm impressed by the number of changes VS the last version

20:20 brainproxy: will investigate, see if I can fix and work up a pull request

20:21 technomancy: frozenlock: this one kept getting pushed back because of issues with clojars

20:21 frozenlock: I also realize I'm not using lein to its full potential...

20:21 weavejester: brainproxy: Try lein-ring 0.8.0-SNAPSHOT

20:22 brainproxy: weavejester: will do

20:22 yogthos: technomancy: gross :) https://www.refheap.com/paste/8355

20:24 brainproxy: weavejester: works great!

20:24 weavejester: I'll release 0.8.0 sometime tomorrow or this weekend

20:25 brainproxy: weavejester: cool, thanks for the heads up

20:29 xeqi: weavejester: could I persuade you to upgrade the version of leinjacker used by lein-ring

20:29 it keeps pulling in a thneed 1.0.0-SNAPSHOT

20:30 weavejester: xeqi: Already done- oh wait, maybe I haven't pushed...

20:30 xeqi: hurray

20:30 thakns

20:31 weavejester: xeqi: I've already pushed it to clojars, so 0.8.0-SNAPSHOT should work if you test it out

20:32 xeqi: heh, kinda defeats not relieing on a snapshot

20:32 weavejester: xeqi: 0.8.0 will be released tomorrow, probably

20:33 xeqi: no rush, just happy its in the pipeline

20:40 andrewma`: Does anyone have any recommendations for clojurescript testing frameworks? I've been looking around but haven't had all that much success finding anything

20:46 yogthos: weavejester: it doesn't look like the jar produced by lein ring uberjar accept a custom port, is there a way to specify it?

20:47 callen: yogthos: getenv?

20:47 yogthos: 12-factor that shit up?

20:47 weavejester: yogthos: It checks the $PORT env variable

20:47 yogthos: callen: weavejester: ah ok that works

20:47 weavejester: yogthos: Maybe it should also take the port as an argument

20:47 callen: like I said.

20:47 yogthos: weavejester: as long as it's documented I think env is fine

20:55 callen: yogthos: I'd told you lumnius was going to probably need to shift to a 12-factor style at some point :P

20:55 yogthos: callen: yup I do recall that :P

20:56 callen: I've just done a huge refactor to finally use ring-server for everything :)

20:56 clojurebot: Excuse me?

20:56 callen: yogthos: written by Herokuites: http://www.12factor.net/

20:56 yogthos: handy :)

20:57 callen: yogthos: yeah ring-server should save some effort.

20:57 yogthos: callen: yeah it's a lot cleaner and it pushes stuff like reloading into project profile where it belongs

20:59 callen: yogthos: aye. good call.

21:00 yogthos: callen: weavejester set me straight on that this morning ;)

21:00 callen: yogthos: the more best practices that get embedded in Luminus, the better off we all are.

21:00 yogthos: have you looked at Kiln?

21:00 yogthos: callen: briefly

21:00 callen: yogthos: I've been considering testing a request context thingy.

21:01 to replicate something really useful in Flask.

21:01 yogthos: callen: looks kinda neat, what's the use case you were thinking for it?

21:02 callen: yogthos: best if I just link it: http://flask.pocoo.org/docs/api/#flask.g

21:02 yogthos: insanely useful for things like getting, "is there a user logged in for this request lifecycle?"

21:03 yogthos: callen: it sounds similar to lib-noir sessions no?

21:03 callen: yogthos: sessions are for users.

21:03 yogthos: callen: you can do a flash session with it

21:04 callen: I don't like mixing request lifecycle state with sessions.

21:04 yogthos: callen: ah, but the functionality is similar right?

21:04 callen: 'ish but it squicks me out.

21:04 yogthos: callen: hehe

21:05 but yeah that's what we've got there so far http://www.luminusweb.net/noir-api/noir.session.html

21:05 callen: Store a value that will persist for this request and the next.

21:05 yogthos: and the next?

21:05 yogthos: callen: appears that way :)

21:05 callen: yogthos: that's no bueno man.

21:05 not what I was talking about.

21:06 Flask.g is *not* for users. it's expressly server-side and per-request only.

21:06 yogthos: callen: don't shoot the messenger :P

21:06 callen: yogthos: I'm just saying, it's something I need.

21:07 yogthos: callen: gotcha, would probably be easier to do with middleware than going fill klin though :)

21:08 callen: depending how much functionality you need of course, if you just want to persist some value from one request cycle I'd do it via middleware with an atom or something

21:08 callen: yogthos: middleware with an atom is my point, but I want to explore the problem and codify "best practice"

21:09 yogthos: callen: I could add that to lib-noir if Raynes likes it :)

21:11 callen: then document it on luminus and voila it's a standard feature :)

21:16 Raynes: yogthos: I don't see what we're supposed to add

21:16 What does he want?

21:16 I just read what he said, but I don't get it.

21:17 yogthos: Raynes: I think he wants a variable which will persist for a single request lifecycle, kind of like session/flash-put

21:17 Raynes: but he doesn't like that it's conflated with the session

21:17 I'd like to see an example of it in action :)

21:18 callen: is that about right?

21:18 Raynes: yogthos: Okay. That's kind of what flash sessions used to be, and they were pretty painful to use so we changed them. If you find something that's useful and you're fairly confident that it's useful for people who also aren't named Chris Allen, go for it.

21:19 :p

21:19 yogthos: Raynes: haha that's pretty much what I'm thinking, if I can see a general use case and make an obvious example then I'd add it :)

21:20 I think the fact that we're not getting how it's supposed to be used is a bit of a red flag :)

21:22 weavejester: oh maybe update clojure toolbox to mention luminus and remove noir, seeing how it's deprecated now :)

21:24 weavejester: also liberator is worth mentioning http://clojure-liberator.github.com/

21:27 xeqi: weavejester: I think clj-webdriver could go under the Web Testing heading

21:43 SegFaultAX: Anyone heard of Sonain?

21:43 Err, Sonian?

21:43 amalloy: i bet hiredman has

21:44 SegFaultAX: amalloy: Is that where he works?

21:44 amalloy: last i checked

21:44 SegFaultAX: hiredman: Ping. :)

21:58 rbxbx: Does clojure make any guarantees that keys and vals return in the same sort order?

21:58 They currently do, but that seems counter intuitive knowing that hash-maps don't guarantee ordering

21:59 yogthos: rbxbx: in a sorted-map they do

21:59 rbxbx: yogthos they do in a std hash-map as well, currently

21:59 is the difference if it were to execute on a separate thread?

21:59 yogthos: &(sorted-map :x 1 :b 2 :c 3 :a 5)

21:59 lazybot: ⇒ {:a 5, :b 2, :c 3, :x 1}

21:59 weavejester: rbxbx: In a hash-map? Not just an array-map?

22:00 yogthos: weavejester: ping re: libs :)

22:00 rbxbx: user=> (keys {:a 1 :b 2 :c 3})

22:00 (:a :c :b)

22:00 user=> (vals {:a 1 :b 2 :c 3})

22:00 (1 3 2)

22:00 weavejester: yogthos: Oh yeah, I'll add them to the toolbox tomorrow

22:01 yogthos: weavejester: awesome :)

22:01 rbxbx: weavejester ^^

22:01 weavejester: rbxbx: But that's an array map

22:02 rbxbx: Does it work with a hash map as well?

22:02 jkkramer: rbxbx: I believe the BDFL has said they are guaranteed to return in the same order, so that (zipmap (keys m) (vals m)) would always hold true

22:02 but I'm not sure where or when that was said

22:02 weavejester: It makes sense, obviously

22:03 I was just curious as to whether it held in all cases.

22:03 yogthos: wouldn't it be safer to just iterate the map as a vector? eg (vec {:foo 1 :bar 2})

22:03 amalloy: yes, jkkramer, that is a thing that he has said but nobody with permission to document it seems interested in doing so

22:03 rbxbx: weavejester works with hash-maps as well

22:03 jkkramer that was the use-case that sprung this

22:03 Good to know. Thanks everyone.

22:04 yogthos: so it is guaranteed?

22:06 amalloy: yes. i agree with yogthos, though: it's generally a better idea to consume the map as a seq of kv pairs if you're doing this anyway

22:07 devn: bah, im blanking, if i want to (comp myfn .toLowerCase), how do I do that?

22:08 I thought it was memoize?

22:08 rbxbx: don't you just need to wrap the method in an anon fn?

22:08 (comp myfn #(.toLowerCase %))

22:10 devn: yep :)

22:10 * devn wishes he could nest #()

22:10 cantsin`: guys, im having problems installing lein. i get "Could not find artifact lein-newnew:lein-newnew:jar:0.3.7"

22:11 i dont have http_proxy set or anything like that, anyone have any ideas?

22:11 rbxbx: devn :)

22:11 cantsin`: (lein version is 2.0.0-rc1)

22:12 jkkramer: there's also (comp myfn (memfn toLowerCase)) but hardly anyone uses memfn

22:13 rbxbx: jkkramer didn't know about that. Why don't people use it? Seems it more clearly expresses intent.

22:14 jkkramer: I dunno. maybe because it's a dirty macro

22:14 rbxbx: Also doesn't seem to work?

22:14 user=> ((memfn .toLowerCase) "FOOBAR")

22:14 IllegalArgumentException No matching method found: .toLowerCase for class java.lang.String clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:53)

22:14 user=> (.toLowerCase "FoOOBAR")

22:14 "fooobar"

22:15 tpope: rbxbx: extra dot

22:15 jkkramer: &((memfn toLowerCase) "FOOBAR")

22:15 lazybot: ⇒ "foobar"

22:15 rbxbx: doh.

22:15 tpope thanks.

22:16 I should work on that whole thinking before speaking thing.

22:16 tpope: incidentally, you're also including an extra . at the end of each line

22:17 technomancy: cantsin`: run `lein version` inside a project first and it'll fix that

22:17 cantsin`: we'll have a final 2.0.0 soon

22:17 cantsin`: technomancy: thanks :)

22:19 technomancy: worked like a charm, thanks once again

22:19 devn: i tend to do this kind of thing a lot: (defn thing->otherthing [thing] ...), and then make another fn (defn things->otherthings [things] ...)

22:19 am i doing it wrong?

22:29 hm, i think i need to build a fancy shmancy music server thingamabob in clojure

22:29 so people can jam to my excellent tunages

22:30 (.trustMe (> my-music your-music))

22:30 talios: mmm distributed concurrent overtone

22:31 tomoj: the latency on my audio interface is already bad enough

22:31 devn: whine whine whine

22:31 do you want free music or not?

22:31 tomoj: oh, yeah

22:31 devn: :)

22:31 tomoj: I was referring to collab overtone over wan

22:31 devn: oh!

22:32 tomoj: seems tricky

22:32 devn: man, i'm not that old. i'm 27

22:32 * talios found a bunch of Kosmic Free Music Foundation mp3s the otherday

22:32 devn: i remember wanting to be able to "jam" online with other musicians in real time, using analog inputs

22:32 this was in like 2000

22:32 i've seen lots of attempts

22:32 tomoj: can't really let people play live

22:32 devn: but nothing satisfying

22:32 it would be glorious if that could happen

22:33 tpope: technomancy: can we get a bump to nrepl 0.2.0-RC2 into lein?

22:33 ibdknox: collaborative overtone probably wouldn't be that hard

22:33 devn: you know how there's the new york jazz scene, and the paris scene, etc.? imagine if you could just get online and play with dizzy gillespie or something.

22:33 ibdknox: someone already did it

22:33 technomancy: tpope: definitely; can you open an issue so I remember?

22:34 tpope: I can

22:34 technomancy: great

22:34 tomoj: but there's too much latency to have your local play-time sync'd with your local listen-time, isn't there?

22:34 ibdknox: devn: with overtone?

22:34 devn: ibdknox: yeah, can't remember what it was called now! blast!

22:34 tomoj: if play/compose-time is ahead of listen-time I can imagine it

22:35 ibdknox: tomoj: it's based on a metronome, so long as you sync the very first beat

22:35 tpope: whoa, I've never seen "Please review the guidelines for contributing to this repository." before

22:35 I want that on all my projects, NOW

22:35 devn: do you guys know about yaxu?

22:35 alex maclean?

22:35 ibdknox: tomoj: yeah, but that's true of overtone anyways right?

22:35 I mean I guess you could come close to real time if you use some other input device

22:36 but if you're actually writing the code, it's hard to imagine that working

22:36 tomoj: by 'live' (play-time ~= listen-time) I'm thinking of e.g. left click = drum hit, where I click along with what I'm hearing

22:36 oh, yeah

22:36 devn: http://yaxu.org/dorkcamp-and-new-demo/

22:36 alex mclean makes everyone mortal

22:36 ibdknox: I've tried out basically every real-time music jam service

22:37 it never worked

22:37 like you said, the latency kills it

22:37 devn: ibdknox: do you have a "best" if you had to pick one?

22:37 ibdknox: anything more than about 30-40ms

22:37 devn: ibdknox: or do they all just fuck it up?

22:37 ibdknox: the speed of light fucks it up ;)

22:38 tomoj: but how about a mashup jam, you each get a few tracks and queue up voices from samples on those tracks, which get auto mashed, and you have to pass 'solo' rights around

22:38 devn: ibdknox: hence the number of services/apps/projects/whatever that allow you to download some editable version of music and collaborate on it, version control

22:39 one idea that i havent seen is people collaborating on LOOPS in real time

22:39 tomoj: yeah, was thinking that too

22:39 devn: people either seem to go for true real-time collaboration, or async collaboration

22:39 ibdknox: the loop thing is how I would imagine a collaborative overtone working

22:39 devn: i think you probably need to meet in the middle

22:40 sure, pile on after i have a great idea! ;)

22:40 tomoj: I don't really want to write code in a browser, but some collab loop interface with clojure-extensible controls/effects would be cool

22:40 devn: but no, i think that's something that is surprisingly close to real-time, whether people know it or not

22:40 that's how "grooves" happen

22:41 your bass goes: "bum _ _ _ bum bum bow" for 4 measures, and then i figure out some embellishment or addition that is satisfying and hit the enter key on my keyboard

22:42 tomoj: just need to coordinate change seconds in advance instead of, uh, shorter

22:43 devn: maybe the one thing that sucks the most about any sort of async collaboration is that there usually isn't an immediate "no!"

22:43 rbxbx: devn that's essentially how real time electronic music works anyway

22:43 ie: playing with someone next to me on a pile of drum machines is going to be the same way

22:43 devn: rbxbx: but it's 1 person

22:43 i disagree. there needs to be a meeting of the minds

22:43 sometimes people get to veto one another

22:44 rbxbx: I mean, it's easier irl because you have the feedback loop of their facial expressions and body language

22:44 but that could be emulated as well via skype or some such

22:44 much like pair programming

22:44 in fact, overtone, skype, tmux, ssh. Find some way to pipe the audio realtime

22:45 done

22:45 forget the browser

22:45 devn: down to brass tacks: I fucking love overtone. Overtone is bad ass. Truly bad ass. But I have to say that usually my experience with anything close to programming music goes like this: Cool. Wow. That's great. Holy shit. ...2 hours pass... Oh, I can play guitar. Why am I not doing that? That's *way* more fun.

22:45 rbxbx: devn totally. but you were just trying to come up with realtime overtone collaboration

22:45 and I've given you that.

22:45 :D

22:46 devn: haha. yeah. literally the last 8 years I've thought about this a lot, and it's really, really hard.

22:46 I don't think you can emulate real-time collaboration even with a tiny murmur of delay in the signal

22:46 it just doesn't work

22:46 people are way more flexible

22:46 that's the joy of it

22:46 rbxbx: I think with loop based music you'd be fine

22:47 That said I've not done extensive research.

22:47 devn: ah but!!! I'll be the naysayer here

22:47 my experience with loop-based music is something like this:

22:47 rbxbx: you typically vibe for a few bars anyway before adding components

22:48 devn we should maybe take this offline, not sure #clojure is the appropriate venue anymore.

22:48 devn: cool static loop! oh wait! it changes every single time you play it!

22:49 rbxbx: meh. no one is saying anything.

22:49 rbxbx: We're still filling the backlog with rubbish ;)


22:50 seangrove: Does clojurescript modify js prototypes?

22:50 devn: again: meh. the backlog is always filled with rubbish.

22:50 seangrove: I'm seeing some problems with other plugins on the same page, wondering if it's my/cljs' fault for modifying expected js primitive behavior

22:52 devn: seangrove: first question's answer: no.

22:52 seangrove: second question'

22:52 second question's answer: you didn't ask a second question.

22:52 seangrove: Yes, glad you noticed that ;)

22:52 Good stuff, back to trial and error

22:52 devn: seangrove: godspeed!

22:53 seangrove: Much appreciated

22:53 devn: (keep going 50mph and you'll survive)

22:53 * seangrove takes a breath and dives back under

23:14 alex_baranosky: devn: question 'what is the meaning of life'?

23:29 wei_: what's lein cljsbuild doing in the 30 seconds after it says "Successfully compiled …" and when it returns? hard to debug since there's no output.

23:29 since the targets seem to be generated, is it safe to kill the "lein cljsbuild once" process?

23:52 Raynes: wei_: Calling it's mom and talking about its dad's bowel movements.

23:53 wei_: hah.

Logging service provided by n01se.net