#clojure log - May 22 2012

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

0:28 * nDuff grumbles at nREPL's fragility -- tending towards hanging rather than failing fast on errors.

0:32 Raynes: Write cemerick hate mail.

0:33 nDuff: actually -- I'm tempted to try using drawbridge rather than the TCP socket handler -- I'm already running a servlet, and if that does a better job of shutting down cleanly, it'll kill multiple birds with one stone.

0:34 (the client not shutting down cleanly is annoying; the server end not shutting down cleanly is a showstopper)

1:24 Roxxi: If I have java classes compile in my source directory (via leiningen) how do I reference them in clojure?

1:29 nDuff: Roxxi: are you asking about Java interop, or about building Java with leiningen? If the latter, do you have :java-source-paths set in your project.clj?

1:29 Roxxi: ...if you don't know which of those the problem is in, have you checked whether .class files are generated?

1:30 Roxxi: I'm talking about Java interop, it seems that my classes are indeed being created.

1:30 I suppose I'm looking for the analogous invocation of (require 'package :as short-name)

1:31 nDuff: (import '[com.example ClassOne ClassTwo])

1:31 ...or something like that -- I usually just use the (ns) macro form

1:31 Roxxi: yeah, what's the ns macro form?

1:31 that's what I'm trying to find

1:32 nDuff: (ns foo (:import [com.example ClassOne ClassTwo]))

1:37 Roxxi: Thanks!

2:57 ro_st: i have (map (something) … )

2:57 what's the paredit spell for killing the (map … ) part and leaving (something) behind?

3:08 neotyk: ro_st: kill (something), kill (map ...), C-y, M-y

3:09 ro_st: sorry no paredit spell I know of

3:10 amalloy: whaaaat

3:10 (map |(something) ...) ;; M-r => |(something)

3:11 ro_st, neotyk: ^

3:11 neotyk: amalloy: sweet

3:12 &(inc amalloy)

3:12 lazybot: java.lang.RuntimeException: Unable to resolve symbol: amalloy in this context

3:12 neotyk: (inc amalloy )

3:12 lazybot: ⇒ 3

3:12 amalloy: there's paredit commands for pretty much anything interesting you can do with sexps

3:14 even the occasionally-useful paredit-convolute-sexp: (fn [x] (fn [y] |(/ x y))) ==> |(fn [y] (fn [x] (/ x y)))

3:15 ro_st: amalloy: thank you. you rockstar you

3:15 that's paredit-raise-sexp

3:15 found it in the paredit cheatsheet i have stuck on my wall

3:15 thanks!

3:17 ah, convolute: turn inside out?

3:18 wow, that rocks

3:19 once you know all the paredit commands as 2nd nature, i can't think that any programmer in any other language could possibly be more efficient at expressing intent as code

3:19 michaelr`: last time i used paredit i somehow got to a situation of unbalanced []s and had to disable paredit to fix it and renable it again... it was very annoying

3:20 every time i start using emacs i have to deal with shit like this :)

3:21 emacs is my IRC client of choice, though :)

3:21 ro_st: why does the paredit indent feature double indent 'resource' in this code snippet? http://rationalist.co.za/uploads/Screen%20Shot%202012-05-22%20at%209.18.07%20AM-hpeksKuFXO.PNG

3:21 tomoj: you can just C-u DEL or C-u C-d to delete and e.g. C-q ) to just insert a close paren

3:22 michaelr`: oh.. thanks

3:22 ro_st: michaelr`: i've found it goes out of its way to keep parens balanced, actually. C-k will only kill to the closing paren, hitting ; on a line will only comment out the form and put the closing parens on the next line, etc

3:23 tomoj: I don't get that indentation

3:23 I get this https://gist.github.com/651495618665de2a2041

3:23 ro_st: michaelr`: put this in your emacs init script: (require 'rainbow-delimiters) (global-rainbow-delimiters-mode)

3:24 michaelr`: ro_st: that what annoyed me, that it failed it's main porpuse too keep the parens balanced and then i had to make an extra effort to fix it

3:24 tomoj: paredit doesn't handle indentation I believe, so maybe you have some difference in your emacs lisp or clojure-mode indent settings?

3:24 ro_st: tomoj: ah, ok. i think it's slime that does indentation

3:24 i'll look into it

3:25 tomoj: seems doubtful they'd reimplement indentation in slime

3:26 michaelr`: it shouldn't fail unless you paste something unbalanced into it

3:26 ro_st: my slime menu has Editing > Update Indentation

3:26 tomoj: michaelr`: or comment stuff out without properly selecting a balanced form

3:26 neotyk: tomoj: if you ([ and hit backspace it goes unbalanced

3:27 tomoj: that would be silly

3:27 for me, ([|]) -DEL> (|)

3:28 neotyk: not for me, (])

3:28 tomoj: DEL should be bound to paredit-backward-delete

3:28 michaelr`: ro_st: what's that rainbow coloring?

3:28 ro_st: rainbow parens colouring

3:28 michaelr`: ro_st: i have (highlight-parentheses-mode t) it does that too

3:28 ro_st: seem my screenshot link above

3:28 tomoj: (and you should be using paredit version 23)

3:28 neotyk: tomoj: it is paredit-backward-delete

3:29 ro_st: oh, right :)

3:29 tomoj: dunno if the version matters

3:29 neotyk: version 22 here

3:30 kral: hola

3:31 neotyk: tomoj: where did you get v23 from, marmelade has v22

3:31 tomoj: http://mumble.net/~campbell/emacs/paredit-beta.el

3:31 (rename to paredit.el before putting in load-path)

3:32 seems odd that they wouldn't have thought of that until v23 though..

3:32 I mean that's the main point of paredit-backward-delete t ome

3:32 * kymair

3:32 ro_st: what's new in 23?

3:33 tomoj: no clue :(

3:37 kima: /join #arch-linux

4:04 muhoo: how would i pass command-line args to an app on heroku?

4:08 tomoj: huh, I never noticed seque

4:08 hiredman: many a splendid thing

4:10 amalloy: i was sad to discover that you can't use seque from inside an agent action

4:11 (because it's implemented using an agent, and when inside an agent action, sends are queued until the action completes)

4:15 al-maisan: Good morning

4:22 si14: Does Luke Vanderhart visit this room?

4:36 ro_st: si14: you can tweetle him at @levand

4:36 sorry, @levanderhart

4:41 muhoo: i'm dealing with a function that runs (eval `(~stuff ~blah)) on things passed to it. so, i can't pass it anything defined with let, sadly. what are my options?

4:41 i don't control that eval function btw, so i have to deal with it.

4:42 si14: ro_st: thanks

4:44 muhoo: i was thinking of fighting `s with `s, an doing some hacky (let [ugly (whatever)] `(do (def fubar# ~ugly) (call-thing-that-evals fubar#))) but that seems.... so veyr wrong to me

4:50 or this atrocity: https://www.refheap.com/paste/2824

4:53 kima: I don't think you have much options ...

4:53 Are you able to reimplement the functionality without using eval

4:54 muhoo: maybe, i'm just not sure how many breaking changes i want to introduce into someone else's library :-)

4:58 kima: maybe you could try to change the eval to contextual eval wich can take a map of local variables. You could make the context map an optional parameter of the function. Do you have a copy of the Joy of Clojure it's defined there

4:59 so when called normal the function has the default behavior and when called with the context map extra parameter it works with let bindings

4:59 muhoo: i do, i'll look in there.

5:00 still, maybe i'm chasing the wrong thing. the error is actually this: https://www.refheap.com/paste/2825

5:00 kima: section 8.1

5:00 for use case page 309-310

5:00 muhoo: no matching ctor. which is weird, because, it's a function that takes one arg, and it's being called as a function with one arg.

5:01 clgv: muhoo: code?

5:01 muhoo: good idea, let me narrow it down to the 3 lines that'll fail

5:03 clgv: this is all that's required to make the fireworks happen: https://www.refheap.com/paste/2826

5:03 fliebel: Raynes: ping

5:05 amalloy: i suppose custom-handler* is some silly macro?

5:06 clgv: amalloy: it's a defn

5:06 muhoo: it's actually a noir.core function.

5:06 a defn, with eval

5:08 clgv: muhoo: does your (:list-url fsettings) evaluate to something like [:post "/login"] ?

5:08 muhoo: have a look

5:08 it's in the refheap paste

5:09 fails with just simple str "/urls" as well as [:post "/fuu/:id/routes/too"]

5:09 clojurebot: I don't understand.

5:09 clgv: muhoo: ah right - it does not

5:09 muhoo: it's the eval that's making my life complicated, but why, i'm still unsure

5:10 clgv: you can try: [:post (:list-url fsettings)] or :get or what you need ^^

5:10 muhoo: it's not that arg that's the assplosion. it's the second arg, the function

5:10 by the way, if i move that out of a defn, it all works

5:11 amalloy: muhoo: just fyi, asplosion is a cutesy way to say explosion. assplosion is a cutesy way to say diarrhea

5:12 clgv: amalloy: rofl

5:12 muhoo: the stacktraces i got were more akin to an ass-plosion than an asplosion, it's true

5:12 ro_st: +1 for applying cutesy to diarrhea

5:13 clgv: muhoo: can you post the stacktrace from the minimal example?

5:13 muhoo: clgv: i think it's an inner-class thing in jvm maybe? https://www.refheap.com/paste/2827

5:13 clgv: minimal stacktrace is more cutesy: https://www.refheap.com/paste/2828

5:15 clgv: muhoo: you could go through custom-handler* code to see what results you get in the single steps

5:15 muhoo: clgv: i did that

5:15 amalloy: muhoo: minimal repro case is basically (eval `(~(constantly 1) 10))

5:15 you can't eval closures

5:15 muhoo: added printlns. everything checks out

5:15 amalloy: that's the problem, yes

5:16 hmm. wow. i guess i'm screwed thenn.

5:17 clgv: muhoo: you can create a patched implementation of custom-handler*, I guess

5:17 muhoo: i think that's the only option.

5:18 clgv: muhoo: do you know why an eval is needed there?

5:19 muhoo: the line is this: (eval `(~action ~url {params# :params} (~func params#)))

5:19 and action is compojure.core/GET or POSt

5:19 it's basically creating the route, then storing it in an atom.

5:20 at page reloads, the routes and app are regenerated, makes for nice interactive development of the rails-y style

5:21 clgv: muhoo: ah, eval is for reloading so that the code in there is not compiled already.

5:22 muhoo: but if you create that handle via settings anyway you wont need that, right?

5:22 muhoo: what i'm trying to do is generate a whole bunch of pages dynamically

5:23 from a defn. then the body of that defn calls noir to generate the routes and put them into the atom

5:23 Raynes: fliebel: pon

5:23 h

5:23 Jesus.

5:24 fliebel: pong

5:25 fliebel: Raynes: How do I get lazybot in another channel? Can it tell it "go there", or do I need to run it on my won sever?

5:25 Raynes: You can do one of two things: 1) ask me to put him there (permanently) and I'll happily host him for you 2) run him yourself and deal with maintaining your own instance.

5:26 ro_st: how do i get paredit going in the slime-repl?

5:26 amalloy: Raynes: is lazybot still busted re: evaluating clojure?

5:26 Raynes: amalloy: define 'busted'

5:26 amalloy: &(inc 1)

5:26 lazybot: ⇒ 2

5:26 fliebel: Raynes: Ok, do I owe you some project maintainance or cake? If you could add it to #hackerschool, that'd be grewat.

5:27 amalloy: &`inc

5:27 lazybot: ⇒ clojure.core/inc

5:27 amalloy: hey, he's working!

5:27 $login

5:27 lazybot: You've been logged in.

5:27 Raynes: amalloy: I didn't do anything to fix it. I restarted him but it was still broken.

5:27 amalloy: $join #hackerschool

5:27 Raynes: fliebel: You don't owe us anything. <3

5:27 fliebel: yay!

5:27 muhoo: it is kind of weird to hear a bot referred to as "him"

5:27 ro_st: can paredit work in the repl?

5:27 Raynes: amalloy: Can you add it to the channel list for me? I'm on my desktop and don't feel like getting sshed in and using emacs with this keyboard.

5:28 ro_st: i thought it was but it appears not

5:28 amalloy: fiiiine

5:28 fliebel: Raynes: I might write some plugins for it, regardless.

5:28 clgv: muhoo: I think you function only has to make sure that you assoc the needed data in both maps. so you can definitely write something like custom-handler* yourself

5:29 Raynes: fliebel: Great. You write 'em, I'll add 'em. :p

5:29 amalloy: fliebel: do you want channel logs?

5:30 Raynes: Goodnight pals.

5:30 <3

5:30 muhoo: clgv: yep, that seems like a reasonable next thing to try.

5:30 fliebel: amalloy: erm, dunno, doesn't hurt I guess, havn't thought deeply about it.

5:30 amalloy: But if you run out of space, feel free to scrap them :P

5:30 amalloy: $reload

5:30 lazybot: Reloaded successfully.

5:31 amalloy: he might or might not be logging now, but he should at least log next time we restart him

5:31 fliebel: there are quite a few people interrested in learning clojure at hackerschool :)

5:32 clgv: fliebel: what's hackerschool?

5:32 ro_st: good. the more, the merrier. clojure rocks

5:32 fliebel: $google hacker school

5:32 lazybot: [Hacker School] https://www.hackerschool.com/

5:41 michaelr`: what's a good function/macro to measure execution time?

5:41 amalloy: ,(clojure.repl/apropos "time")

5:41 clojurebot: (time dotimes read-instant-timestamp parse-timestamp)

5:41 amalloy: ,(doc time) ;; tada!

5:41 clojurebot: "([expr]); Evaluates expr and prints the time it took. Returns the value of expr."

5:42 michaelr`: &(time (count (range 1000)))

5:42 lazybot: java.lang.ClassNotFoundException: clojure.core

5:42 michaelr`: ,(time (count (range 1000)))

5:42 clojurebot: "Elapsed time: 7.161 msecs"

5:42 1000

5:43 michaelr`: how about printing a label

5:45 like (time "db fetch" (fetch-db db))

5:48 okay, i'll write my first clojure macro ever ;)

5:48 after this there will be no way to go back..

5:56 muhoo: clgv: aha, i see why he did it this way. there's a trap here.

5:57 to call GET, you need to supply args. those need to be gensymed, and so you need syntax quoting, and then you're stuck evaling

5:58 but, i think i can do it manually, bypassing most of this stuff

6:24 michaelr`: ooh performance optimization is so fun

6:27 clgv: muhoo: you dont need syntaxquoting for gensym. there is 'gensym ##(doc gensym)

6:27 lazybot: ⇒ "([] [prefix-string]); Returns a new symbol with a unique name. If a prefix string is supplied, the name is prefix# where # is some unique number. If prefix is not supplied, the prefix is 'G__'."

6:30 muhoo: kima: i see, that contextual eval is pretty crazy. [k `'~v] , eh?

6:31 kima: it becomes clear after a bit thought and macroexpand :-)

8:03 hi #clojure

8:32 lewang: hello all

8:33 gfredericks: this must be the sound of #clojure waking up in the morning

8:34 ordnungswidrig: it's midday over here. maybe everybody is on the plane to uk

8:35 foxdonut: (ns good.morning)

8:36 clgv: java.lang.RuntimeException: java.lang.ExceptionInInitializerError

8:36 foxdonut: (let [your-day be-a-good-one] ..)

8:36 clgv: java.lang.Exception: Unable to resolve symbol: be-a-good-one in this context

8:57 Borkdude: is there a shortcut for (keep identity coll)?

9:02 lewang: Can anyone lend me a hand with swank-clojure and Emacs? It works, but I can't get meaningful stack traces.

9:03 foxdonut: Borkdude: doesn't seem like there is. (keep identity coll), (filter identity coll), (remove nil? coll), etc.

9:04 ordnungswidrig: (remove nil? coll) is the easiest to understand, IMHO.

9:07 hyPiRion: foxdonut: (filter identity coll)? ##(filter identity [true false nil 1])

9:07 lazybot: ⇒ (true 1)

9:07 hyPiRion: &(keep identity [true false nil 1])

9:07 lazybot: ⇒ (true false 1)

9:07 hyPiRion: It's subtle, isn't it.

9:08 michaelr`: ibdknox: ping

9:12 ro_st: what's a nifty way to get a subset of a map's data by keys?

9:13 (gimme-a-map-with-just-these-keys-please source-map (:key1 :key2))

9:14 S11001001: ,(doc select-keys)

9:14 clojurebot: "([map keyseq]); Returns a map containing only those entries in map whose key is in keys"

9:14 ro_st: i really should read through the api some time. thanks s11

9:14 foxdonut: hyPiRion: good point. I think (remove nil? coll) is most obvious at what it does.

9:15 hyPiRion: foxdonut: Yeah, it's more or less verbatim of how I would've described the function.

9:16 S11001001: ro_st: best check what happens when a key in keyseq isn't in your map, and make sure it's what you want

9:16 hyPiRion: If I were to describe it in a non-programming language.

9:16 ro_st: s11: thanks for the tip. in this case, the source map is sql data, so they'll always be there

9:17 is there a clever way to select the current form so that i can copy it? emacs + paredit

9:18 right now i'm ctrl-space, C-M-f, enter

9:18 hyPiRion: Current form?

9:19 ro_st: oui

9:19 the form at the point: |(my form) or (m|y form)

9:19 hyPiRion: Ah.

9:20 For the first one, I use C-<space> C-M-n

9:20 C-M-p and C-M-n are good when you're at the start or end, but I'm an emacs newbie myself :)

9:22 S11001001: ro_st: I imagine killing the current form only would have a paredit-specific binding; try C-h m

9:23 vijaykiran: ro_st: C-k and C-_ should be the same

9:23 ro_st: ?! now my repl says "Unable to resolve symbol: doc in this context"

9:23 this is in slime

9:24 i thought doc was one of them global ones?

9:24 vijaykiran: may be you should (use 'clojure.repl)

9:24 bobry: is it possible to initialize a record with a map? i.e. with keyword arguments instead of positional?

9:24 ro_st: ah. my slime repl doesn't seem to do that

9:25 hyPiRion: bobry: Is speed essential for you? If not, I'd try to replace the record with a map.

9:25 AWizzArd: bobry: in Clojure 1.4 you can you it with map->XYZ

9:25 (defrecord Foo [a b]) (map->Foo {:b 2, :a 1})

9:26 In earlier Clojure versions you could do (into (Foo. nil nil) {:b 2, :a 1})

9:26 This is a bit unfortunate, as you first have to create a throw-away Foo instance.

9:26 hyPiRion: AWizzArd: are there any other functions defined at defrecord-time?

9:26 bobry: AWizzArd: thanks! 'map->*' is exactly what I was looking for

9:27 hyPiRion: Sounds practical.

9:28 clgv: hyPiRion: yes, (->Foo 10 20) as a kind of constructor as well

9:28 bhenry: is there a (clojure-version) equivalent for clojurescript?

9:29 hyPiRion: clgv: Fancy.

9:30 ro_st: there must be a way to have the slime repl run some code on startup ¿

9:30 ? too

9:30 matessim: Hey, i'm abit confused about lambda's vs fn's

9:30 if lambda's don't have explicit do's basically only the last form in the lambda will be evaluated?

9:31 dnolen: bhenry: that works in CLJS

9:31 bhenry: dnolen: i'll restart the repl. that throws me an error

9:32 matessim: What's wrong with this? => (#(println "a")(println "b"))

9:32 b

9:32 ArityException Wrong number of args (1) passed to: user$eval560$fn clojure.lang.AFn.throwArity (AFn.java:437)

9:33 dnolen: matessim: the anon fn takes no arguments

9:33 matessim: i didn't give it any arguements.

9:33 or did i somehow?

9:33 dnolen: matessim: you did.

9:33 ro_st: (println "b") is being passed as an arg to #(println "a")

9:33 foxdonut: the (println "b") is an argument

9:33 ro_st: #() is a function 'literal'

9:34 matessim: oh i'm missing a bunch of parenthesis

9:34 thanks

9:34 rhc: matessim: i think you want this: #(do (println "a") (println "b")) ?

9:34 matessim: I was trying to see the difference in anon vs fn myself(From what i understood, anon would print b and fn would print ab)

9:34 and yeah rhc

9:34 ro_st: is there a way to specify a clj script to run on startup of my slime repl?

9:35 dnolen: ro_st: probably, perhaps technomancy knows

9:35 matessim: Now i'm even more confused, whats wrong with this?

9:35 => (#((println "a")(println "b")))

9:35 a

9:35 b

9:35 NullPointerException user/eval564/fn--565 (NO_SOURCE_FILE:1)

9:35 vijaykiran: println returns nil

9:35 dnolen: matessim: you are calling nil as a function

9:35 vijaykiran: so you are truing to call (nil)

9:35 foxdonut: ,(doall (map println ["a" "b"]))

9:35 clojurebot: a

9:35 b

9:35 rhc: matessim: break that down, its basically (#(nil nil))

9:35 clojurebot: (nil nil)

9:36 matessim: aha

9:36 if it was (#(nil)), would that be alright?

9:36 dnolen: ,(macroexpand '#((println "a")(println "b")))

9:36 rhc: matessim: nope

9:36 clojurebot: (fn* [] ((println "a") (println "b")))

9:36 dnolen: matessim: ^

9:36 rhc: matessim: (nil) is just trying to call 'nil' which isnt a valid function

9:37 matessim: so isn't it mean its evaluating twice?

9:37 dnolen: ,(macroexpand '#(do (println "a") (println "b")))

9:37 clojurebot: (fn* [] (do (println "a") (println "b")))

9:37 dnolen: ,(#(nil))

9:37 clojurebot: #<CompilerException java.lang.IllegalArgumentException: Can't call nil, compiling:(NO_SOURCE_PATH:0)>

9:38 dnolen: matessim: there's no implicit do when using #(...)

9:38 ,(#(do nil))

9:38 clojurebot: nil

9:38 matessim: but #(do(nil)) is still wrong, right? and println evaluates to nil

9:38 ro_st: matessim: the first symbol in a list is in function position, and clojure will attempt to call it as a function.. unless you quote the list '(nil 1 2 3)

9:39 rhc: matessim: yes, because (nil) is still trying to call nil

9:39 dnolen: matessim: (nil) will never work, nil is not a function

9:39 matessim: so i need to qoute the anonymous function?

9:39 '#(do(nil)) is fine?

9:40 dnolen: matessim: I think you stop a moment and think this through :)

9:40 vijaykiran: ro_st: I think you need :repl-init in your project.clj

9:40 matessim: dnolen, i'm just a bit confused, for example ,i'll want to print something with an anonymous function

9:40 dnolen: ,(macroexpand '#(do (nil)))

9:40 clojurebot: (fn* [] (do (nil)))

9:41 dnolen: matessim: figure what is wrong with ^

9:41 rhc: matessim: read the first chapter of this book: http://cdn.oreilly.com/oreilly/booksamplers/9781449394707_sampler.pdf

9:41 matessim: i'm reading

9:41 Programming Clojure

9:41 dnolen: matessim: and you'll understand why none of your ideas so far work.

9:41 matessim: just got it yesterday

9:41 dnolen, i understand, the macro is expanded, but the whole thing is a string

9:41 rhc: oh ok, perfect. the first chapter should help a lot

9:41 matessim: that's not being evaluated

9:41 because of the '

9:42 ro_st: vijaykiran: ah, that sounds promising! does slime/swank respect it?

9:42 rhc: matessim: its not exactly "just a string"

9:42 for example, you can't do '([)

9:42 dnolen: matessim: sorry didn't mean to confuse. the macroexpand was just an illustration of what you're code actually will get compiled as.

9:43 your

9:43 rhc: its still parsing it, just not evaluating '(a b c) as "call a with b c"

9:43 matessim: okay rhc, and i think i understand a bit better

9:43 foxdonut: dnolen: +1.. trying to grasp too many concepts at once

9:43 vijaykiran: ro_st: I'm guessing - it will - I didn't try it though

9:43 matessim: extra question, what's the green text in the REPL? i understand black is stdout

9:44 but when i do (do #(println "x"))

9:44 it does x in black, and nil in green.

9:44 vijaykiran: the return value of the function

9:44 every function must return a value - in this case println returns nil

9:45 matessim: thanks.

9:45 rhc: and do returns the return value of the last argument

9:46 bhenry: dnolen: https://gist.github.com/25cdcee02bb03d506f70

9:48 matessim: the only difference between letn and fn is the namespace binding?

9:49 defn*

9:49 not letn

9:50 vijaykiran: ,(macroexpand '(defn x [] (y)))

9:50 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

9:51 bhenry: matessim: (defn x [] …) is just a shortcut for (def x (fn [] …))

9:51 vijaykiran: &(macroexpand '(defn x [] (y)))

9:51 lazybot: ⇒ (def x (clojure.core/fn ([] (y))))

9:51 S11001001: matessim: defn has lots more sugar too

9:51 matessim: right, thanks again

9:51 clgv: &(macroexpand '(clojure.core/fn ([] (y))))

9:51 lazybot: ⇒ (fn* ([] (y)))

9:52 vijaykiran: matessim: if you are feeling adventurous, try (source defn) :)

9:52 matessim: wow thats awesome vijaykiran, had no idea you can do that :P

9:53 * ro_st watches matessim's brain blow up

9:53 matessim: how can i pull the metadata? (preferably by key?)

9:53 the ^[:doc stuff.

9:54 ro_st: (meta thing)

9:54 matessim: ty

9:54 Bronsa: ,(meta #'first)

9:54 clojurebot: {:ns #<Namespace clojure.core>, :name first, :arglists ([coll]), :added "1.0", :static true, ...}

9:54 Bronsa: ,(:doc (meta #'first))

9:54 clojurebot: "Returns the first item in the collection. Calls seq on its\n argument. If coll is nil, returns nil."

9:54 clgv: ,(doc first)

9:54 clojurebot: "([coll]); Returns the first item in the collection. Calls seq on its argument. If coll is nil, returns nil."

9:55 matessim: Bronsa, why is the #' in the meta tag?(I sort of understand the ' but not the #)

9:55 Bronsa: #' is reader macro for var

9:55 ,(:doc (meta (var first)))

9:55 clojurebot: "Returns the first item in the collection. Calls seq on its\n argument. If coll is nil, returns nil."

9:56 Bronsa: the metadata is attached to the Var `first` not to the symbol

9:57 matessim: i see, thanks

9:57 Bronsa: so, #' is not related to '

9:58 Borkdude: ,#'+

9:58 clojurebot: #'clojure.core/+

9:58 Borkdude: ,'+

9:58 clojurebot: +

9:58 Bronsa: ,'#'+

9:58 clojurebot: (var +)

9:59 Borkdude: ,'#

9:59 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading character>

9:59 Bronsa: 'nception

9:59 Borkdude: ,#"+"

9:59 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.util.regex.PatternSyntaxException: Dangling meta character '+' near index 0

9:59 +

9:59 ^>

9:59 matessim: Q_Q

10:00 Borkdude: , #" "

10:00 clojurebot: #" "

10:00 Borkdude: ,#(+ % %1)

10:00 clojurebot: #<sandbox$eval304$fn__305 sandbox$eval304$fn__305@e2be94>

10:01 Borkdude: ,`(let [+# -] (+# 1 2 3))

10:01 matessim: ,(#(+ % %1) 1)

10:01 clojurebot: 2

10:01 (clojure.core/let [+__27__auto__ clojure.core/-] (+__27__auto__ 1 2 3))

10:01 Borkdude: ,#{1 2 3}

10:01 clojurebot: #{1 2 3}

10:02 Borkdude: ,(contains? #{1 2 3} 1)

10:02 clojurebot: true

10:02 Borkdude: have we covered every use of # now?

10:03 ,#_(eval '(+ 1 2 3))

10:03 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

10:03 Borkdude: ,#_1

10:03 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

10:03 Borkdude: ,

10:03 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

10:04 bhenry: ,#_ 1 2

10:04 clojurebot: 2

10:06 gtuckerkellogg: i'm feeling pretty stupid, but there's something I don't understand about "="

10:06 Borkdude: maybe reader literals, but I can't show it here

10:06 gtuckerkellogg: I had thought all of these comparisons would be true

10:07 http://pastebin.com/ndfUJtQg

10:08 Borkdude: ,(= {:a 1, :b 2} {:a 1, :b 2})

10:08 clojurebot: true

10:09 Borkdude: ,(= {:a #" ", :b 2} {:a #" ", :b 2})

10:09 clojurebot: false

10:09 Borkdude: gtuckerkellogg: I guess it has to do with how equals is defined on regexes

10:09 gtuckerkellogg: oh!

10:09 why?

10:09 clojurebot: Why is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone

10:10 Borkdude: ,(type #" ")

10:10 clojurebot: java.util.regex.Pattern

10:10 gtuckerkellogg: ,(doc =)

10:10 clojurebot: "([x] [x y] [x y & more]); Equality. Returns true if x equals y, false if not. Same as Java x.equals(y) except it also works for nil, and compares numbers and collections in a type-independent manner. Clojure's immutable data structures define equals() (and thus =) as a value, not an identity, comparison."

10:10 Borkdude: ,(resolve 'javadoc)

10:10 clojurebot: nil

10:11 Bronsa: ,(= #"" #"")

10:11 clojurebot: false

10:11 Borkdude: gtuckerkellogg: regexes are never equal except when they are the same object

10:12 gtuckerkellogg: hmm

10:12 Bronsa: ,(hash #"")

10:12 clojurebot: 28127006

10:12 Bronsa: ,(hash #"")

10:12 clojurebot: 31360080

10:12 gtuckerkellogg: aha

10:12 Borkdude: gtuckerkellogg: i.e., they don't define equality, the equals method is inherited from Object

10:12 gtuckerkellogg: i see

10:12 vijaykiran: http://stackoverflow.com/questions/10055034/java-comparing-two-pattern-objects

10:14 gtuckerkellogg: ok, that's very helpful. thanks Borkdude, Bronsa, and vijaykiran

10:14 ro_st: is there a shortcut in emacs to select the symbol under the current point?

10:14 Bronsa: i guess it would be convenient if for patterns `=` compared their .toString

10:14 ro_st: paredit's cheatsheet doesn't show anything for selection

10:14 gtuckerkellogg: Bronsa, it sure would!

10:15 ro_st, you might get an answer here, but have you checked the #emacs channel?

10:15 ro_st: what? this isn't #emacs-incognito? :-)

10:22 S11001001: ro_st: you will have better luck if you use emacs lingo for such things rather than some other UI's lingo :)

10:23 ro_st: so i have this form (convert-resource-media r). cursor is somewhere in the function element. i want to select the first element of the list. surely there's a quick way to do that?

10:23 eclipse ccw has a gesture for this, i think

10:24 vijaykiran: ro_st: I'm sure #emacs guys will point you to : http://emacswiki.org/emacs/MarkCommands#toc6 :)

10:24 ro_st: thank you :)

10:24 i'll stop pestering you guys with emacs questions

10:25 vijaykiran: but M-x mark-word seems to work fine, just bind it to whatever keycombi you like

10:25 ro_st: M-@ :-)

10:26 whoever made emacs show you the bound keybindings when you use M-x (command) is a bloody genius

10:28 TimMc: Yay for discoverable interfaces!

10:31 ro_st: yay indeed

10:32 clgv: TimMc: ?

10:33 vijaykiran: so how many of you guys here will be in-person at EuroClojure ?

10:35 Borkdude: vijaykiran: are you going?

10:35 vijaykiran: yeah, I'll be there

10:36 Borkdude: what is the official hashtag for euroclojure? #euroconj ?

10:36 vijaykiran: I guess https://twitter.com/#!/search/%23euroclojure

10:36 oops #euroclojure

10:37 gfredericks: futures always spawn new threads??

10:37 lazybot: gfredericks: What are you, crazy? Of course not!

10:37 TimMc: clgv: My name for user interfaces that allow you discover new ways of using them, unobtrusively.

10:38 clgv: TimMc: ah kk

10:38 TimMc: clgv: Similarly, having keyboard shortcuts next to items in a drop-down menu.

10:38 clgv: gfredericks: they use an executorservice

10:38 matessim: what happens if i have a java object with a void method by the name a and a public variable a(not static), what will i get when i do (.a instanceName)

10:38 Borkdude: TimMc: clgv or help -> search (in menu items) in OSX

10:38 matessim: not void, no args i meant

10:39 TimMc: Or especially having commands grouped into menus in the first place! You can find new commands by accident.

10:39 matessim: public class A{public int x; public A(){...) public int x()}

10:40 doing in clojure (.x instanceOfA) would give me what?

10:40 gfredericks: clgv: I could have sworn that was true but my coworker just made a jackload of futures which created a jackload of threads

10:40 and eventually crashed the jvm for having too many threads

10:40 I think

10:40 TimMc: matessim: I was wondering about that when I was writing an interop lib! I think the official answer is "Don't do that!" :-/

10:40 matessim: TimMc, so its a undocumented implementation detail? i'll check later though, but that sounds like sound advice :P

10:40 clgv: gfredericks: humm I hope I didnt confuse it with pmap. I'll check

10:40 TimMc: matessim: (. instanceOfA (x)) should be unambiguous for the nullary method, though.

10:41 so maybe fields are checked first?

10:41 matessim: why? the book i have says the unsugared syntax for both is the same(fields and methods)

10:41 both the sugared and unsugared is the same for fields and no-arg methods

10:42 clgv: gfredericks: yes it is an executor service - this one: Executors.newCachedThreadPool();

10:42 gfredericks: it's probably not limited like the FixedThreadPool

10:44 gfredericks: hrm

10:44 clgv: I had issue with future myself when using it for blocking shell calls

10:45 TimMc: &(. "foo" (toString))

10:45 lazybot: ⇒ "foo"

10:45 TimMc: &(. "foo" toString)

10:45 lazybot: ⇒ "foo"

10:45 TimMc: matessim: ^

10:46 matessim: err. what?

10:46 why would it return anything else?

10:46 As far as i'm aware the String type has no public toString field

10:46 &(.toString "foo")

10:46 lazybot: ⇒ "foo"

10:46 gfredericks: clgv: yeah I just created 10000 sleepy threads and it stayed up. I will ridicule coworker.

10:47 TimMc: Right... just demo'ing the two .-forms of method calling

10:47 matessim: those aren't the two forms though (what you wrote is the same)

10:47 TimMc: matessim: Count the parens.

10:47 matessim: just with a extra parenthesis...

10:47 aren't the two forms

10:47 TimMc: ...

10:47 matessim: :

10:47 aren't the two forms these?:

10:47 &(.toString "Foo")

10:47 lazybot: ⇒ "Foo"

10:48 matessim: &(. "Foo" toString

10:48 lazybot: java.lang.RuntimeException: EOF while reading, starting at line 1

10:48 matessim: &(. "Foo" toString)

10:48 lazybot: ⇒ "Foo"

10:48 TimMc: Parens are never "extra" in a Lisp.

10:48 matessim: &(. "Foo" (((toString))))

10:48 lazybot: java.lang.IllegalArgumentException: Malformed member expression

10:48 matessim: hmm

10:48 what do those extra parenthesis do there then?

10:48 between the forms you posted.

10:48 TimMc: THey say, "this is explcitily a method".

10:49 matessim: oh, okay.

10:50 TimMc: Unfortunately, CLojure doesn't actually have a specification. You'd have to make a class and see what happens.

10:50 matessim: pr = clojure wrapper for println?

10:50 TimMc: pr = print read'ably

10:50 matessim: TimMc, is that something on purpose or just lack of people documenting?

10:50 TimMc: Not sure.

10:51 matessim: pr is (mostly) the inverse of read (or pr-str vs. read-string)

10:51 matessim: okay, so its basically for "dynamic code"(Code that creates extra code?)

10:51 or w/e the terminology is

10:52 zakwilson: No.

10:52 Parens *usually* indicate that the first thing in them is callable - a function, special form, macro, etc...

10:53 Or were you asking about pr?

10:53 matessim: zakwilson i understand that...

10:53 yeah

10:53 :)

10:53 vijaykiran: " By default, pr and prn print in a way that objects

10:53 can be read by the reader"

10:54 zakwilson: That's generally for serialization. It would be unusual to pr something then run it as code.

10:54 TimMc: matessim: pr-str and read-string are for reading and serializing data objects.

10:54 matessim: Okay, makes sense :).

10:55 TimMc: matessim: Great for config files. Just read the doc for *read-eval* if you read user-controlled data!

10:55 matessim: what are "things" that are in between asterisks btw?

10:55 TimMc: &(doc *read-eval*)

10:55 lazybot: java.lang.SecurityException: You tripped the alarm! *read-eval* is bad!

10:55 matessim: i saw it with *ns*

10:56 zakwilson: For runtime code generation, eval takes lists, not strings.

10:56 TimMc: matessim: They're part of the symbol. It's a convention for naming dynamic vars.

10:56 matessim: the bot doesn't want us to use read eval? :P

10:57 TimMc: ,(doc *read-eval*) ;; let's try a less secure bot

10:57 clojurebot: "; When set to logical false, the EvalReader (#=(...)) is disabled in the read/load in the thread-local binding. Example: (binding [*read-eval* false] (read-string \"#=(eval (def x 3))\")) Defaults to true"

10:57 zakwilson: I can't imagine why the bot wouldn't want us to poke at something like that.

10:58 ibdknox: Would anyone like lots of karma on HN? :)

10:58 http://www.chris-granger.com/2012/05/21/the-future-is-specific/

10:58 second Light Table demo ^

10:59 zakwilson: Can I buy things with it?

10:59 matessim: ibdknox I found out about Clojure because of your kickstarter, i was like "What is this awesome language" when i saw the demo

11:00 i ordered Programming Clojure the same day :P

11:00 ibdknox: haha

11:00 cool :)

11:00 zakwilson: The rest of you have about a minute before I take that karma.

11:01 ibdknox: zakwilson: someone beat you to it

11:01 Borkdude: this dude already did it: http://news.ycombinator.com/user?id=olauzon

11:01 zakwilson: ibdknox: how did that prototype idea work out for you? I was considering doing something similar.

11:01 olauzon: just managed to slip in

11:01 zakwilson: Good. I have enough karma.

11:01 Borkdude: haha

11:01 I don't care about karma

11:01 ibdknox: zakwilson: there was lots of interest, but the projects were depressing

11:02 zakwilson: I don't mind depressing projects right now. I like money.

11:03 ibdknox: one of them was an airbnb for bicycles :(

11:03 most of the people really need help at the idea phase

11:03 which I could've done

11:03 but is harder to sell

11:04 zakwilson: http://renthubnyc.com/ <-- airbnb for arbitrary stuff

11:04 ibdknox: hah

11:04 no I mean this guy ripped it off

11:04 his example used the same font faces

11:04 the same design entirely

11:04 lucian: python mode for lighttable yay

11:05 ibdknox: lucian: well, an example of one :)

11:06 zakwilson: I'd tell a client it's not a good idea to copy a design that closely. Still, if somebody has a bad idea and wants to pay me to build it, I'm not about to refuse.

11:08 Borkdude: ibdknox: nice video

11:09 ibdknox: thanks :)

11:11 zakwilson: Your video is too popular. It's buffering slowly.

11:12 foxdonut: it's about 14MB in HD

11:13 ibdknox: I'm waiting for the "Y U NO USE DJANGO?"

11:14 Borkdude: ibdknox: why you not use clojure-py :P

11:14 lucian: ibdknox: sure, but i still think it's nice that it's being considered

11:14 zakwilson: I'm guessing because it's a hammer and you weren't driving a nail.

11:16 ibdknox: here's a youtube link for the slowness

11:16 http://www.youtube.com/watch?v=osLReQSB9F0

11:18 zakwilson: Just in time for it to finish buffering!

11:20 RickInGA: ibdknox: new light table post/video is amazing

11:20 TimMc: Oh, and posted to reddit as well: http://www.reddit.com/s/http%3A//www.chris-granger.com/2012/05/21/the-future-is-specific/

11:26 zakwilson: ibdknox: The future of tools? It's the past too - seems to me Emacs had the same idea of being easy to adapt to the problem at hand. I could see something like this replacing Emacs for me, and that's huge.

11:27 ibdknox: zakwilson: totally, I've been thinking about having something like a major and minor modes distinction :)

11:28 gtrak: I'd rather invest my tool-molding learning into something smaller and more modern than emacs, ibdknox is LT scriptable with clojure?

11:28 ibdknox: it's Clojure + ClojureScript

11:28 + whatever language back end you use

11:28 gtrak: awesome

11:30 yea, a scriptable JVM-based editor with a browser UI sounds excellent

11:32 Wild_Cat: I'm not so hot about the browser UI TBH

11:32 zakwilson: A lot of what I'm seeing there reminds me of Slime. I don't understand why that sort of thing isn't already more popular for other dynamic languages.

11:32 Wild_Cat: ...then again I used to say that about email clients too, so who knows.

11:32 ro_st: is there a method that returns true if all the elements in the coll are truthy?

11:32 zakwilson: Why are we still running those in batch mode most of the time instead of having the editor talk to a running program?

11:34 ro_st: sorry, not a method, a function :)

11:35 vijaykiran: (every? true? '(blah))

11:35 ro_st: gah. of course.

11:35 TimMc: vijaykiran: Not quite.

11:36 &(map true? [1 true false nil])

11:36 lazybot: ⇒ (false true false false)

11:36 foxdonut: ,(true? 42)

11:36 clojurebot: false

11:36 TimMc: ro_st: You can use identity instead of true? there.

11:36 ro_st: actually, i want to assert whether 3 particular keys in a map are nil or not

11:36 TimMc: Specifically non-nil?

11:37 ro_st: so i'm using (select-keys) to restrict to those 3, and now i want a yes/no on all not nil or not

11:37 foxdonut: &(every? identity [1 true false nil])

11:37 lazybot: ⇒ false

11:37 foxdonut: &(every? identity [1 true false])

11:37 lazybot: ⇒ false

11:37 TimMc: ro_st: Instead of select-keys, you can also use juxt. :-)

11:37 &((juxt :a :b :c) {:a 4 :b 5 :c 6 :d 7})

11:37 lazybot: ⇒ [4 5 6]

11:37 foxdonut: &(every? (complement nil?) [1 true false])

11:37 lazybot: ⇒ true

11:38 ro_st: ah that's even better!

11:40 metellus: &(every? (not nil?) [1 true false])

11:40 lazybot: java.lang.ClassCastException: java.lang.Boolean cannot be cast to clojure.lang.IFn

11:40 metellus: that explains that

11:40 ro_st: complement is like ! from javascript?

11:41 S11001001: no

11:41 metellus: &(doc complement)

11:41 lazybot: ⇒ "([f]); Takes a fn f and returns a fn that takes the same arguments as f, has the same effects, if any, and returns the opposite truth value."

11:41 timvisher: anyone know why clojure.java.shell would find an executable specified later in PATH when it had the opportunity to find the same executable name earlier in PATH?

11:42 foxdonut: &(not (some nil? [1 true false nil]))

11:42 lazybot: ⇒ false

11:42 TimMc: ro_st: It's a higher-order function. ! is like not.

11:42 pandeiro: anybody use clojurescript on a low powered processor (like atom, athlon)?

11:42 foxdonut: &(not (some nil? [1 true false]))

11:42 lazybot: ⇒ true

11:42 pandeiro: the compile times i'm getting with lein cljsbuild + cljs 1236 are painful

11:42 TimMc: $inc foxdonut

11:42 lazybot: ⇒ 1

11:42 pandeiro: like one minute to compile a 10 line cljs file

11:42 foxdonut: ro_st: that's another option according to your taste.

11:43 TimMc: That's an application of De Morgan's law, right?

11:43 ro_st: thanks fox

11:43 foxdonut: welcome

11:46 $inc TimMc

11:46 lazybot: ⇒ 6

11:47 TimMc: heh

11:47 S11001001: pandeiro: have used plain clojure on atom, seems fine

11:47 ro_st: ((juxt :triple_namespace :triple_key :triple_value) %)

11:47 dnolen: raph_amiard: ping

11:48 ro_st: "java.lang.Boolean cannot be cast to clojure.lang.IFn"

11:48 why?!

11:48 % here is a map

11:48 TimMc: TOo many parens somewhere?

11:48 S11001001: fun fact: juxt is lifting vector into the reader monad

11:49 TimMc: I'll take it on faith that that was English.

11:50 foxdonut: lol

11:50 ro_st: one day i'll learn what a monad is

11:51 timvisher: `(System/getenv "PATH")` returns the right thing

11:51 S11001001: and comp is just a less-powerful version of map :)

11:51 foxdonut: ,((juxt :a :b :c) {:a 1 :b 2 :c 42})

11:51 clojurebot: [1 2 42]

11:51 timvisher: is there another place that Runtime.exec looks for executables that supersedes PATH?

11:52 pandeiro: S11001001: yeah clojure is fine, but lein-cljsbuild is taking eons... dunno wats up

11:52 ro_st: https://gist.github.com/2769905

11:52 TimMc: timvisher: Are you in Cygwin by any chance?

11:52 pandeiro: ibdknox: f'ing awesome, haven't even watched the demo but i loved the writeup.. esp. about routes being the logical unit, context switching etc

11:52 ro_st: so i'm trying to either just grab :name, or :triple_* if those aren't nil

11:52 TimMc: Although someone was experiencing some PATH weirdness in SLIME or something the other day.

11:53 timvisher: TimMc: windows

11:53 in cmd

11:53 from within emacs

11:53 TimMc: Maybe it was you!

11:53 foxdonut: ro_st: you have extra parens #(if ((

11:53 timvisher: I believe it was ;)

11:53 ro_st: foxdonut: thank you. was killing me

11:54 timvisher: interestingly, I was experiencing the same thing from a cmd shell _but_ if I cd out of the default directory (`c:\windows\system32`) then it does find the correct path

11:54 foxdonut: ro_st: welcome

11:54 timvisher: which leads me to believe that windows somehow honors `.` before anything, even if it's not in PATH

11:54 ro_st: man, i'm really digging this language

11:54 TimMc: timvisher: Oh god...

11:54 You might be right.

11:55 ro_st: makes me think hard. i've spent all day writing code and i'm at 83 lines of code, and i'm mentally exhausted!

11:55 timvisher: even stranger, perhaps is that `(sh "pwd")` does not tell me that i'm in that default directory

11:55 ro_st: eventually you want that amount of effort to stop, probably ;)

11:55 unless you're doing something that is inherently very hard. lol

11:55 gtrak: ro_st: I found that density terrifying initally, but then I started thinking about how much code I would have written in java for the same thing, and felt better

11:55 foxdonut: ro_st: I've lost 15 pounds by sheer mental exercise ;)

11:56 ro_st: yes, naturally. but it's been a long time that i've been so nicely challenged

11:56 timvisher: where are you coming from?

11:56 ro_st: i'm only about a week and a half into clojure

11:56 timvisher: java?

11:56 clojurebot:

11:56 ro_st: oh, all the usual imperative stuff. ruby, javascript, php, actionscript in no particular order

11:56 timvisher: yeah, it'll probably take you awhile to get used to clojure then. :)

11:57 well worth it, though, imo

11:57 ro_st: absolutely!

11:57 TimMc: JS really helped me learn Scheme, though.

11:57 timvisher: you know that is true

11:57 ro_st: its not just learning clojure. it's also learning emacs

11:57 timvisher: i always forget how functional javascript can be

11:57 TimMc: just insofar as callbacks

11:57 timvisher: most people don't teach it that way but it can be done

11:57 ro_st: double whammy

11:58 what are you doing to learn emacs?

11:58 gtrak: underscore.js looks pretty good actually

11:58 ro_st: timvisher: deep end

11:58 foxdonut: to me a hurdle was to "unlearn" the solutions I'm used to from OO for which FP has different (usually better) solutions

11:58 ro_st: pestering folks on here, mostly :)

11:58 TimMc: ro_st: Oof. I failed to learn either when I tried to learn both at the same time. If you can, do one at a time.

11:58 timvisher: lol

11:58 it may sound crazy to you but _read the manual_

11:59 it's an astonishingly good resource

11:59 ro_st: i have several post-its on my monitor with swank and paredit shortcuts

11:59 already internalised enough to get around without swearing in the high decibels

11:59 main thing is the core text editing stuff. once that's natural, the rest is jam

12:00 foxdonut: emacs is not something I've gone back to though. I'm staying with vim. One less problem to solve.

12:00 ro_st: i come from windows text editing

12:00 vijaykiran: ro_st: http://shop.fsf.org/product/gnu-emacs-reference-mugs/ :)

12:00 ro_st: so it's been particularly .. fun

12:00 timvisher: if you go on an emacs binge, i highly recomend https://peepcode.com/products/meet-emacs and http://vimeo.com/channels/222837

12:00 pardon the self-promotion, of course. ^_^

12:00 ro_st: i want maximum productivity in the long term

12:00 timvisher: foxdonut: i hear that paredit is getting ported to vim, is that true?

12:00 ldopa: ro_st: ms text editing ... you mean like word?

12:00 lucian: i've used emacs + evil for a few months, it was ok

12:00 ro_st: i tried ccw, sublime text 2, intellij + la clojure

12:00 all subpar

12:01 foxdonut: timvisher: I dunno.. I use vimclojure and surround, works well..

12:01 ro_st: ldopa: no, using ctrl left right to move between words and variants thereof

12:01 timvisher: gotcha

12:01 ldopa: ro_st: sorry, bad joke ;)

12:01 timvisher: paredit was pretty life-changing. miss it in every language that i'm in, even the ones that don't have the revealed ast

12:01 ro_st: timvisher: i already have the peepcast. reeeaally helpful

12:02 i'll check the vimeo stuff out. it's on the list along with disclojure and all the itunes clojure podcast material

12:02 and joy of clojure, of course

12:03 to think i was going to commit our company to using rails -shudder-

12:03 timvisher: for my next revelation, `(sh "which" "convert")` … returns the right thing

12:03 zakwilson: Paredit is pretty useful, though I find Slime to be the best thing about Emacs. It's like LightTable, kindasortaalmost.

12:03 timvisher: joy of clojure is awesome

12:03 banseljaj: Hello everyone. :)

12:04 timvisher: zakwilson: i'll agree with you there. the slime video was one of the 2 things that brought me back to to emacs about 5 years ago

12:04 ro_st: i still maintain a php codebase, and i'm still actively developing a google-closure javascript app. going to find ways to emacsify those asap

12:04 zakwilson: I kind of like Rails for quick one-off projects. I don't think I'd want to run a big project on it long-term; it's not *simple* - there's a lot of complecting.

12:05 ro_st: already using magit in emacs as well. feels completely natural

12:05 mprentice: magit is pretty great

12:05 foxdonut: just watched a quick video to see what paredit's about: http://www.youtube.com/watch?v=hiwEm88xaxM

12:06 it's funny, the guy is almost whispering and rushing/talking fast, so it sounds like he's recording the demo on someone else's computer that he's not supposed to be using :D

12:06 mprentice: i remapped paredit to make more sense to me. { } to spit back and forward respectively, ( ) to gobble same

12:06 RickInGA: thanks guys for all these good emacs links.

12:06 ro_st: foxdonut: how do i get that completion?!

12:06 the popup showing the possible symbols to complete to

12:07 vijaykiran: M-Tab

12:07 foxdonut: :)

12:07 ro_st: i have completion, i don't have the displayed list

12:07 not like he does there

12:08 i get it in a separate buffer - one of my pending annoyances to fix

12:08 timvisher: ro_st: i'm pretty sure that'd be icicles mode

12:08 vijaykiran: ro_st: you mean something like this: https://github.com/overtone/live-coding-emacs

12:08 ro_st: -beam-

12:08 i love open source

12:09 * timvisher sighs…

12:09 timvisher: looks like it's time to get off of imagemagick and move to pure java

12:09 TimMc: timvisher: Just because of path? :-(

12:09 ro_st: ok, i have to unplug. upvotes, everyone! later

12:10 timvisher: TimMc: I've been looking at this on and off for the past week and really haven't gotten any leads

12:10 works great on my mac

12:10 it's my windows machine that screws up

12:10 TimMc: timvisher: `which convert` gets you the absolute path though, right?

12:11 Also, is there a shell=true thing to explore?

12:15 timvisher: TimMc: in cmd: c:\windows\system32>which convert => c:\windows\system32\convert.exe

12:16 cmd: c:\windows>which convert => c:\...ImageMagick...\convert.exe

12:16 in clojure i can only get which to report the imagemagick path

12:16 and i can only appear to find the convert path when executing as the firstargument

12:16 first argument*

12:17 and `pwd` reports the directory i ran lein from

12:17 ^_^

12:17 and opening a new CMD shell automatically starts in c:\windows\system32

12:21 nDuff: ...so, the JVM doesn't actually have a mechanism to change the current working directory, but you can select one for your subprocess to run in

12:22 timvisher: nDuff: i'm aware of that, but i don't actually want to change my working directory

12:22 * nDuff scrolls up to try to find more context for what timvisher is discussing, and gives up after a screenful or two.

12:22 timvisher: unless my working directory turns out to be c:/windows/system32

12:22 in which case i might care very much to change out of that ;)

12:23 dnolen: dherman: ping

12:23 dherman: pong

12:23 timvisher: basically, i'm experiencing a strange issue where java is electing an executable found later in my PATH over one that appears earlier in my PATH

12:23 TimMc: timvisher: Change out of the default, run which, then you have the correct path, right?

12:23 dnolen: dherman: so was there ever any ES discussion about ctors with only final fields?

12:23 TimMc: (I'm in problem-solving mode, not debugging mode.)

12:24 Then you can use the absolute path in future shell-outs.

12:24 dherman: dnolen: saw your tweet... not quite sure what you mean by "final" here

12:24 can't be shadowed by prototype extension?

12:24 immutable?

12:24 dnolen: dherman: property which can only be set in the cnostructur and never again.

12:24 timvisher: I believe I could chop off the end of :out and that should give me the full path to convert

12:24 dnolen: oops ctor

12:24 * timvisher goes off to try that

12:26 timvisher: (sh (.trim (:out (sh "which" "convert")))) seems to be a fairly interesting option

12:26 although i'd still love understanding exactly what is happening here

12:27 LeNsTR: https://github.com/liebke/avout

12:27 * timvisher pines for the ease of a sensible environment

12:27 LeNsTR: > Latest commit to the master branch | liebke authored 4 months ago

12:27 is it alive?

12:28 Bronsa: maybe it got stable enough?

12:28 dnolen: dherman: it seems to me that such a facility would be far more useful then Object.freeze which is broken really. You want your instance to immutable at the time of construction.

12:29 dherman: then you could safely pass that instance to a Worker - no copying.

12:29 LeNsTR: latest version "0.5.3"

12:29 not sure

12:30 dnolen: dherman: I note that Dart has final fields - I suspect over time they'll be able to really run with that.

12:31 dherman: dnolen: what you're talking about is not much different from freeze, in the sense that it's not immutable at time of construction; it's immutable after an arbitrarily long period of computation

12:32 dnolen: dherman: it's very different. freeze encourages leaking

12:32 gfredericks: is (def ^:private foo ...) not how to create a private var...?

12:32 S11001001: no, it is

12:32 TimMc: dnolen: Can you call freeze at the end of the constructor?

12:32 gfredericks: S11001001: it behaves differently from (defn- ...)

12:32 dnolen: TimMc: still encourages leaking

12:32 gfredericks: specifically it gives :tag :private rather than :private true

12:32 and ns-publics doesn't respect :tag :private

12:32 dnolen: TimMc: dherman: Java Concurrency in Practice covers this stuff.

12:33 S11001001: what cloj version?

12:33 gfredericks: oh 1.2 ew

12:34 that's what I get for using `lein repl` outside a project

12:34 dnolen: var o = ctor(); concurrentProcess(o); will always work with final fields

12:34 var o = ctor(); concurrenctProcess(o); Object.freeze(o);

12:34 BOOM

12:34 hc: hi

12:35 TimMc: dnolen: No, I mean effectively Object.freeze(this) inside the constructor.

12:35 dnolen: TimMc: won't work

12:35 function ctor(...) { concurrentProcess(this); Object.freeze(this); }

12:35 BOOM

12:36 TimMc: the whole reason why deftype and defrecord ctors work the way they do, they eliminate that stuff.

12:37 they're even better since you can put executable stuff in/around field assignments

12:37 cannot I mean

12:38 TimMc: OK, I guess I'm confused about what concurrentProcess is doing. Setting timeouts that further whack on o?

12:38 err, "this"?

12:38 dnolen: TimMc: possibly attempting mutating fields

12:39 attempting to mutate I mean.

12:40 dherman: I actually don't see how any of Niko Matsakis Parallel JS could ever really work w/o something like this.

12:42 dherman: sorry, back. reading backscroll

12:43 dnolen: what you're talking about has the exact same problem

12:43 dnolen: dherman: it does not

12:43 dherman: function C() { concurrentProcess(this); this.foo = 12 }

12:43 BOOM

12:43 dnolen: dherman: only field assignment

12:43 in ctor

12:44 dherman: better if it's just implicit, like a tuple type.

12:44 dherman: dnolen: ok, so yeah, with sufficient restrictions you can have something that is immutable on construction

12:44 there are many options in the design space

12:44 dnolen: dherman: Type(a, b c). No executable body.

12:44 dherman: and yes, we have talked about that kind of thing, though not exactly as you're describing it

12:45 but, PJS does not need any of that

12:45 PJS is a very different approach

12:45 dnolen: dherman: I recall Niko saying he didn't have a solution for sharing data at all.

12:45 dherman: he would not have said that :)

12:45 given that PJS is *all about* sharing data

12:46 PJS is a dynamic approach to enforcing no shared writes -- basically, write barriers

12:46 dynamically guard against writing to shared data

12:46 so reads are cheap

12:46 and writes are fail-fast

12:47 dnolen: dherman: so the runtime checks are really that small?

12:47 dherman: we don't know yet, 's why it's research :)

12:47 but our memory architecture is a pretty nice fit for it

12:48 we have memory "compartments" that have mechanisms for installing automatic proxies between one another

12:48 we have an intern just starting this week to work on implementation

12:48 so we'll see how it goes

12:48 note that reads are cheap, though

12:49 they don't require any guards

12:49 dnolen: dherman: gotcha. Though it seems you could just avoid research and provide immutable non-executable ctors :) but that does sound interesting.

12:50 metajack: With enlive, is there a way to clone the first element of a list and delete the rest. For example, the template html has an example list..

12:50 dnolen: dherman: one pressure we have is that engines currently punish Object.freeze last I checked. So we can't use it to protect our persistent data structures yet.

12:55 dherman: so you think PJS would work with persistent data structures, essentially nested arrays?

13:03 TimMc: dnolen: Under what circumstances would the CLJS compiler produce a constructor containing concurrent code?

13:03 brainproxy: dnolen: you'll be presenting on cljs at Strange Loop, that's awesome; Hickey's keynote last year stirred my interest in Clojure, and I've tried to apply his ideas/advice to my nodejs prog'ing even before getting into clojure/script

13:03 jhulten: How do people decide between atoms, refs, etc? Is there common understanding of what is best to use where?

13:03 dnolen: TimMc: it would not

13:03 jhulten: brainproxy: His 'Simple made Easy' talk rocked my world.

13:04 dnolen: brainproxy: yep, mostly talking about nerdy details of the CLJS complier.

13:04 brainproxy: jhulten: yeah, mine too, really enjoyed it

13:04 technomancy: jhulten: it basically comes down to whether you need consistency among multiple threads

13:04 TimMc: dnolen: So I fail to see the problem with using freeze -- except you said something about penalization.

13:05 jhulten: Atoms lock across threads and refs use STM? Ref changes can be reordered?

13:05 dnolen: TimMc: yes, yes - we'd be ok with Object.freeze if engines don't hurt us for it.

13:05 TimMc: Atoms are always uncoordinated (independent of each other.)

13:05 dnolen: Gotcha, thanks.

13:06 jhulten: Ah. So if you need to change two things in concert you use refs?

13:06 nDuff: jhulten: yes

13:06 TimMc: jhulten: Right. Or change one thing based on the current value of another.

13:06 technomancy: jhulten: if it's important that each thread gets a consistent view of the world

13:06 brainproxy: dnolen: so last night I had some success coming up w/ some logic to wrap up unoptimized output as spit out by n/cljsc in such a way that it can be run on nodejs

13:06 jhulten: Thinking on a clojure based statsd as a learning project.

13:07 ibdknox: woah.

13:08 Matt Mullenweg just kicked in 10k

13:08 nDuff: jhulten: ...you wouldn't be the first person to use clojure for real-time stream processing and statistics, and the last folks I knew using it in that space were very, very happy.

13:08 dherman: dnolen: I think PJS would work with persistent data structures. I want immutable data structures too. but that's hard too, b/c JS still has mutable prototypes

13:08 timvisher: ibdknox: whoo!

13:09 rplevy: jhulten: atom is by far the most common way of dealing with state, refs are only needed for those things discussed above.

13:09 technomancy: jhulten: you might be interested in https://github.com/heroku/pulse

13:09 dherman: dnolen: and also b/c shallow immutability is still not a guarantee of deep immutability

13:09 TimMc: I still haven't had to use an agent.

13:09 timvisher: i don't mean to be 'that guy' because lighttable is freaking awesome looking, but so much of what you're saying seems true of emacs. is there a quick answer as to why you wouldn't just enhance emacs?

13:09 rplevy: TimMc: I have used agents, but it almost always ends up being future that makes more sense

13:09 brainproxy: dnolen: beyond the use of java facilities for doing file i/o, are there parts of compiler.clj that simply couldn' be expressed in cljs vs. clj?

13:10 timvisher: i think people would even still be willing to pay to have that sort of work done, as pointed out by technomancy

13:10 TimMc: Because elisp. :-P

13:10 dnolen: brainproxy: not that I'm aware of.

13:10 rplevy: timvisher: because ibdknox is vi-user (troll)

13:10 TimMc: rplevy: Oy! Come to BAZNEX tomorrow!

13:10 technomancy: I doubt you could get USD200k+ for implementing it in Emacs

13:11 rplevy: TimMc: I live in Vermont now, dude ;)

13:11 brainproxy: dnolen: I'm considering an attempt to split out the file i/o parts into a separate namespace, which I could then implement with nodejs's fs module

13:11 timvisher: technomancy: i wonder if there would be less work to do though? probably not

13:11 TimMc: rplevy: Vermont is no excuse!

13:11 technomancy: there would be much less work to do

13:11 brainproxy: in which case I could then compile compiler.clj down to standalone javascript

13:11 ibdknox: I highly doubt that

13:11 timvisher: i'm not familiar enough with what the demos are being written in

13:11 dnolen: dherman: hmm, why are mutable prototypes a problem? seems like worrying about people doing the wrong thing?

13:11 technomancy: if you based it on the xembed branch of emacs anyway; since you can embed webkit

13:12 ibdknox: starting from emacs means I can never break away from any of the things it did wrong

13:12 dherman: dnolen: aren't your data structures deeply immutable?

13:12 I mean, how do you avoid data races?

13:12 technomancy: if you had to make it work with the current trunk version it would be hard

13:12 brainproxy: it would only be good for generating unoptim'd output, i.e. if you waned optimized output, you would still have to pass back through closure.clj to get at the google closure routines

13:12 timvisher: i really am not trying to put down the idea at all. like i said the ui alone is jaw dropping, let alone the actual interactive demos, but this last post especially talking about customizing your environment and tool etc is a classic selling point of emacs

13:12 dnolen: dherman: they are.

13:12 ibdknox: I think do things as I showed

13:12 would take far longer starting from emacs

13:13 dherman: so...?

13:13 ibdknox: you'd end up with a better base editor certainly

13:13 timvisher: ibdknox: good enough :)

13:13 ibdknox: at least in the near term

13:13 TimMc: ibdknox: Maybe you can embed emacs for the editing. :-P

13:13 ibdknox: TimMc: it's a thought

13:13 not going to worry about it anytime soon

13:13 TimMc: Good.

13:14 timvisher: i really wish you the best of luck. feels like an editor with enough good ideas that it could have the same effect that clojure seems to be having on the programming world

13:14 also, didn't you mention at some point that the underlying tech supports different editor modes?

13:14 foxdonut: ibdknox: "...I also advise and invest in startups through my company Audrey Capital."

13:14 dnolen: dherman: I don't follow ... like being worried that somebody will change prototype underneath you?

13:14 timvisher: you wouldn't get the lispy extension of emacs, but you could at least get it's keybindings

13:15 rplevy: TimMc: codemirror is pretty cool, someone should make a codemirror-like thing that is full emacs maybe

13:16 TimMc: timvisher: Presumably it would Clojure-scriptable at the very least.

13:16 foxdonut: ibdknox: that is awesome. you might have to up the number of 10k slots available before the 10 days are up!

13:16 rplevy: except it would be clojurescript instead of elisp hehe

13:17 timvisher: you wouldn't hear any arguments from me if you could get clojurescript to be the extension language of my editor. :)

13:17 technomancy: timvisher: how about for extending your desktop? =)

13:17 p_l: well, elisp seems easier to get a runtime running...

13:18 timvisher: oh come now, you know i've though over and over of getting an emacs written in clojure!

13:18 dnolen: brainproxy: wasn't following closely enough - somebody needs to port more of the Clojure reader before bootstrapping is possible.

13:18 * timvisher is assuming of course that by desktop you meant emacs

13:18 technomancy: no, I mean gnome

13:18 timvisher: lol, i know

13:18 old emacs joke

13:18 dnolen: brainproxy: I'd also be concerned about performance of the compiler - CLJ on JVM highly tuned - CLJS perf work still in progress.

13:19 technomancy: =)

13:19 rplevy: LightTable seems awesome. the question is, is it awesom enough to pull me (and "people like me") away from emacs, at least some of the time. Another question is, is it worth it for non-front-end kinds of hacking.

13:19 brainproxy: dnolen: point taken

13:19 timvisher: do have something like that running? or are we dreaming of a lisp machine?

13:19 technomancy: timvisher: I have hello world, but I don't have the repl hooked up yet

13:19 timvisher: cljsmacs, maybe?

13:19 brainproxy: dnolen: so basically I'd run into issues where I needed support from cljs.reader that just isn't there yet?

13:19 timvisher: woah! publishing that any time soon?

13:19 technomancy: timvisher: https://github.com/technomancy/lein-gnome

13:19 timvisher: that might be reason to finally kick my Apple habbit

13:20 rplevy: timvisher: just emajin

13:20 dnolen: brainproxy: yes it's not there.

13:20 brainproxy: compiler.clj would also need to change - very Java reader result type centric ATM

13:20 brainproxy: dnolen: alright, I'll hold off then ... not that I've got the ability to run a "detached" JVM ncljsc server, compile times are down to ~2 secs anyway

13:20 i.e. because I don't have to spin up the jvm every time

13:21 timvisher: well boy oh boy. now i'm fairly sure that technomancy is an alien too

13:21 lol

13:21 brainproxy: *now that..

13:21 timvisher: i don't how you all do it

13:21 dherman: dnolen: if we allow concurrent/parallel access to a data structure, we have to ensure race freedom. a shallowly immutable data structure that has immutable references to mutable data structures would still make races possible

13:21 dnolen: brainproxy: yeah, compiler is not slow - but booting JVM, compiling CLJS is killer.

13:23 rplevy: technomancy: I might have switch back from KDE to gnome. the massive fail of Unity led me revisit KDE and it made amazing progress since the old days.

13:24 technomancy: Unity makes me sad just because of how divisive it is.

13:24 rplevy: ironic too...

13:24 technomancy: gnome could be so much better if all this effort wasn't being poured into duplicating its features in unity.

13:24 but gnome will win in the long run because of its extension mechanism

13:24 it will just take longer

13:25 gtrak: kde is freaking great now

13:25 technomancy: does it have a repl? =)

13:26 gtrak: hmm, well I have enough things to mess with, honestly :-)

13:27 http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/GettingStarted

13:27 glitch99: Is there a way to get at the javadoc statements about a function from the REPL?

13:28 AH (doc <func>) - sorry that was too easy

13:29 gtrak: I just find any other DE unusable for multiple monitors, I've used gnome 3 and 2 for years though. Gnome2 not really an option anymore. gnome3 and unity are optimized for one app at-a-time, imo.

13:30 technomancy: gtrak: yeah, but that's easy to fix with an extension

13:30 it's all just JS

13:30 runtime-modifiable

13:30 beffbernard: technomancy: I'm experiencing some odd behavior with how swank-clojure is dealing with async callbacks. i.e. It doesn't appear to be calling my callbacks

13:31 technomancy: oops.. looks like that was premature.. obv it was all my doing.. closing the connection too soon

13:32 clojure-newcomer: Hi guys. If I have a clojure.lang.Cons result like : http://pastebin.com/nALzZF6K can anyone help me with emitting it as XML using clojure.data.xml ? It is the mapping function I am struggling with.

13:32 beffbernard: disregard

13:32 gtrak: technomancy: I'll believe it when I see it :-). The gnome guys interpretation of 'usability' isn't really viable. But those other spinoffs look interesting. eg. cinnamon

13:33 clojure-newcomer: The result is from clojure.java.jdbc with-query-results

13:33 technomancy: gtrak: it doesn't really matter what their opinions are; it matters that they provide a good foundation and reasonable abstractions to build upon.

13:33 gtrak: technomancy: I know you're interested in doing some stuff with that, I'll definitely check it out :-)

13:33 rplevy: gtrak: I agree, so many aspects of the UI are just complete WTF I can't believe they shipped this...

13:34 dnolen: dherman: yeah, I suppose that would be less of a real issue if you could control field visibility.

13:34 rplevy: but if I can customize it al in ClojureScript....

13:34 technomancy: rplevy: try it! =)

13:34 TimMc: technomancy: It matters that they don't seem to do user testing.

13:34 p_l: gtrak: GNOME lost the sight of what they were doing somewhere around 2.4

13:34 dherman: dnolen: yeah, it's remarkably hard to shoe-horn immutability onto JS. but I believe it's possible. we just need to try different ideas

13:34 technomancy: TimMc: it matters if you're going to use unmodified gnome

13:34 dherman: dnolen: and I agree Object.freeze blows. if I weren't so busy on my PhD at the time it happened, I might've fought it

13:35 rplevy: technomancy: I definitely will, it sounds awesome!

13:35 technomancy: TimMc: Emacs still ships with ido-mode off by default for crying out loud.

13:35 dnolen: dherman: :)

13:35 technomancy: TimMc: that kind of problem is easy to fix if you know what you're doing

13:35 TimMc: technomancy: I'm customization-shy these days. THings break too quickly due to upgrades.

13:35 I still do it, but I don't like to rely on it.

13:35 gtrak: I think the fragmentation issue is kind of a big deal. for instance, if I invest time into learning light table, why not make that the DE? Anything can do anything.

13:36 technomancy: gtrak: I actually think light table would be an interesting base for a browser

13:36 TimMc: yo dawg

13:36 gtrak: sure, but things will settle on some local maxima, and it's hard to go against the grain as a normal user

13:37 technomancy: "the reasonable man adapts himself to the world; the unreasonable man adapts the world to him; therefore all progress depends upon the unreasonable man."

13:37 Shaw had it right

13:37 TimMc: I'm pretty damn unreasonable, but I have other work to do.

13:38 gtrak: I agree with TimMc :-)

13:38 technomancy: you guys are no fun =(

13:38 ibdknox: lol

13:38 gtrak: DE?

13:38 development env?

13:38 TimMc: Desktop Env

13:38 gtrak: window manager?

13:38 ibdknox: ah

13:38 gtrak: why not?

13:39 ibdknox: I sort of think of it that way to be honest, but the answer to "why not" is time

13:39 gtrak: right

13:39 technomancy: gjs can control X =)

13:39 ibdknox: I also think we need to get one thing really, really right first

13:40 if that happens, who knows what people will do with it :)

13:40 dnolen: dherman: still seems like something like this could be solved with an immutable record type. no customizable constructor, prototype with non-mutable implementations (can be extended), only final private fields (this.field only works in prototype methods)

13:41 technomancy: tiling window manager in javascript: https://github.com/gfxmonk/shellshape

13:42 gtrak: I think it'd be lovely to run some kitchen-sink environment like emacs or LT as a window manager

13:43 if you're a developer, I mean..

13:44 technomancy: yeah, I'm all for reducing the number of programs you use that you don't have direct control over

13:46 TimMc: Dynamic langs make that easier.

13:46 sjl: since contrib is gone, what should I use to replace dissoc-in ?

13:46 TimMc: sjl: update-in with dissoc

13:46 sjl: ick

13:46 that won't clear out the intermediate empty lists though, right?

13:47 technomancy: TimMc: I think that's a red herring.

13:47 TimMc: interactive languages make it easier. dynamic languages historically have had the edge on interactivity.

13:48 but I don't think there's anything intrinsic to the typing discipline.

13:49 foxdonut: technomancy: do you use shellshape? the demo looks pretty good.

13:51 technomancy: foxdonut: no, I'm not on 3.4 yet. Just good to see it's possible

13:53 foxdonut: technomancy: indeed.

13:53 TimMc: technomancy: You're right, interactive is what I really mean.

13:53 Interpreted/compiled on-the-fly langs too.

13:54 technomancy: yeah, languages that compile directly to machine code seem to have a harder time with seamless interactivity

13:54 TimMc: ...which I would call a slightly different concept.

13:54 technomancy: it's easier to do on a VM/interpreter, but that's not required

13:55 IIRC haskell's interactive compiler has subtle differences vs the mainline one

13:55 hiredman: technomancy: that may have more to do with immutability of top level references

13:55 gtrak: the whole java stack and how we abuse it is pretty bizarre but awesome, when you think about it

13:56 hiredman: and issues with redefining types

13:56 technomancy: hiredman: that would make sense

13:57 brainproxy: woohoo, strange loop ticket acquired :)

13:57 technomancy: would be interesting to see how the straight-to-C schemes do it

13:57 if they do in fact do it

13:57 brainproxy: any other #clojure folks will be attending?

13:57 gtrak: brainproxy: duh :-)

13:57 dnolen: brainproxy: a lot :)

13:58 brainproxy: I actually live in St. Louis, so it's just down the street for me

13:58 almost literally

13:58 about 2 miles :D

13:58 hiredman: technomancy: direct memory access is pretty much the definition of "mutable global reference"

13:59 jlongster: dnolen: I will see you at Strange Loop as well :)

13:59 devn: oh shite. i need a strange loop ticket.

13:59 foxdonut: *sigh* wish I could go to these things. :_(

13:59 dnolen: jlongster: cool! I look forward to more Lisp conversation :)

13:59 * devn is on a bus to the airport to go to euroclojure

13:59 technomancy: hiredman: heh; sure

14:00 Borkdude: devn: cool

14:00 jlongster: dnolen: me too!

14:00 imami|afk: hey technomancy

14:00 * imami|afk <---- banseljaj

14:01 technomancy: ohai

14:05 kmicu: whether val,key, int, etc... fns are implemented in the latest version of clojurescript? Where I can find such an info?

14:06 dnolen: kmicu: at the moment no better documentation than the source really.

14:08 kmicu: dnolen: thx

14:09 brainproxy: i'm the organizer of the JS meetup here in Saint Louis (stljs.org) ... w/ all the JS-related speakers setup for SL2012 (inc. Eich!) i'm wondering if I should push Sept's meeting to the week and try to get one of the SL speakers to make an appearance

14:10 Borkdude: what is the leading repo of clojurescript, I assume https://github.com/clojure/clojurescript ?

14:10 brainproxy: Borkdude: yeah, thats the one

14:10 Borkdude: it has a "forked from … " message on the top, but that one doesn't even exist anymore

14:11 rplevy: how would I configure lein to always run clean? would I use the prep-tasks feature for this?

14:11 brainproxy: ah, right ... you can safely ignore that i think, all the official commits go to clojure/clojurescript

14:11 technomancy: rplevy: in 2.x, yeah

14:11 :prep-tasks ["clean"]

14:11 rplevy: more interested in why you need it though

14:12 rplevy: well, I have run into problems with tests passing, running lein clean, and then seeing tests fail (as they should)

14:13 dnolen: Borkdude: that's the official repo

14:16 S11001001: rplevy: you aren't overusing macros are you?

14:17 &aot

14:17 lazybot: java.lang.RuntimeException: Unable to resolve symbol: aot in this context

14:17 S11001001: no

14:17 rplevy: S11001001: only using them appropriately haha

14:18 S11001001: so not at all in the aot case then

14:18 rplevy: S11001001: need AOT though

14:18 S11001001: welp

14:18 macros and aot only get together during the holidays, and then always subjecting everyone around to uncomfortable silences

14:19 rplevy: LOL

14:22 S11001001: so anyway that's what lein test! is for, yes?

14:22 rplevy: there should be a lein midje! then

14:22 S11001001: lein clean, midje

14:23 rplevy: true enough

14:23 Borkdude: S11001001: lein test! as in destructive testing?

14:23 rplevy: or... prep-tasks

14:23 Borkdude: it runs clean and deps

14:23 S11001001: clean can be annoying, especially if you're repling at the same time

14:24 gets all turned around

14:24 Borkdude: write a script ;)

14:24 rplevy: Borkdude: I don't want to have to run lein through a script though that is the obvious last resort

14:25 S11001001: hmm, it would be better to freshly clone the dir and run a build and test out of that

14:27 Borkdude: Some programming language tend to use a lot of $ characters, clojure doesn't. it's obviously not interested in money making.

14:28 foxdonut: Borkdude: the money's in the (tax) brackets!

14:28 S11001001: rplevy: you missed Jeff talking about Kiln at bos cloj, was pretty good

14:28 rplevy: is there video?!

14:28 that sounds good

14:28 S11001001: doubt it

14:28 rplevy: you guys should record these things...

14:29 S11001001: with any luck, we're just getting to the "having regular meetings" stage

14:29 rplevy: nice

14:32 robink: I know Clojure 1.5.0-alpha1 is out, but in future, how do I specify clojure-1.5.0-master-SNAPSHOT in a project.clj?

14:33 rplevy: S11001001: is Jeff somehow using Kiln at work or is this completely his personal project

14:35 S11001001: former I think was the implication

14:36 Borkdude: robink: [org.clojure/clojure "1.5.0-master-SNAPSHOT"] ?

14:37 robink: Borkdude: Doesn't find it if I specify it that way.

14:37 Borkdude: robink: that's because it doesn't exist

14:37 wkmanire: Howdy folks.

14:37 robink: Borkdude: It does on Sonatype's repository. If I include the repository it still fails to resolve.

14:37 Borkdude: robink: http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.clojure%22%20AND%20a%3A%22clojure%22

14:37 robink: ah well, I don't know then

14:39 raek: the sonatype repo of releases might be different from the repo of snapshots

14:39 wouldn't be suprised if only the releases repo is used by lein by default

14:40 Borkdude: robink: when I search here I don't see it: https://repository.sonatype.org/index.html#nexus-search;quick~clojure

14:41 TimMc: rplevy: Doesn't Vermont have trains?

14:43 rplevy: TimMc: yeah, do you know how far north Burlington is?

14:43 damn near Canada

14:44 TimMc: nonsense

14:44 rplevy: beautiful though, I can see the Adirondacks across the lake from my porch

14:44 this might be off-topic

14:45 TimMc: OK, maybe a bit closer to Canada.

14:45 robink: Borkdude: https://oss.sonatype.org/service/local/repositories/snapshots/content/org/clojure/clojure/1.5.0-master-SNAPSHOT/clojure-1.5.0-master-20120519.020223-8.jar

14:45 rplevy: other than as an unpaid advertisment for Clojurers to come work at Draker

14:46 S11001001: it's clojurian

14:46 rplevy: aha

14:46 Borkdude: S11001001: how do you pronounce clojurian, could you spell it phonetically?

14:46 rplevy: Clojurista

14:46 TimMc: cljer ("kludger")

14:46 S11001001: like centurion, emphasis on 2nd syllable

14:47 Borkdude: S11001001: I was wondering about the j, if it is still pronounces as an s?

14:47 S11001001: I wouldn't pronounce it as an s in Clojure

14:47 given the other billion things that already means

14:47 Borkdude: S11001001: how do you pronounce clojure?

14:47 rplevy: me neither

14:47 S11001001: hard J

14:48 rplevy: same

14:48 antares_: Borkdude: as in "jurassic"

14:48 TimMc: I think Rich wants it pronounced like an s, but there's no chance of that.

14:49 S11001001: honestly have never heard it as "closure", though perhaps I just missed it

14:49 rplevy: I've heard Rich say it that way

14:49 zh

14:49 Borkdude: I always pronounce it as "closure"

14:49 S11001001: madness

14:49 I'll just assume anyone who says that means the Clozure CL implementation

14:49 TimMc: Or GClosure

14:50 (Google Closure)

14:50 S11001001: or the Closure web browser written in CL

14:50 Borkdude: Closure means Clojure unless stated otherwise

14:50 TimMc: Nah, too much talk about GClosure in here due to CLJS.

14:50 Borkdude: gclosure is fine

14:51 I had a discussion with some american Dutch people (from America originally) about how to pronounce Clojure

14:51 TimMc: Except people often leave off the "G".

14:51 Borkdude: they told me: if the author wants it to be pronounced as closure, that's fine

14:51 S11001001: Nabokovite

14:51 TimMc: It's not his choice to make. :-P

14:52 Borkdude: so from then on, I just did that

14:52 rplevy: Lolitian?

14:52 S11001001: it was Nabokov's position that the artistic life of a book existed entirely in the mind of the author, and it was the job of the reader to, as closely as possible, rediscover precisely that interpretation

14:53 in other words, writer-supremacy

14:53 Borkdude: clojure with a hard j doesn't sound very nice in Dutch, like calling names

14:53 TimMc: As opposed to what I see as the prevailing view these days.

14:53 Borkdude: not really, but it just doesn't sound nice

14:53 robink: Borkdude: Also: https://oss.sonatype.org/index.html#nexus-search;quick~clojure (oss.sonatype.org, not repository.sonatype.org).

14:53 TimMc: What's that quote? "As the author, you're the least qualified person in this room to discuss what your book means!"

14:54 Borkdude: TimMc: so do you agree with Nabokov?

14:54 S11001001: I should think not

14:54 what being a hard J user and all

14:54 p_l: TimMc: that's the motto of literature PhDs

14:54 pipeline: my english dialect has no difference between a "zh" and "j" sound anyway

14:54 rplevy: dzh = j

14:55 diphthong

14:55 pipeline: given that there are millions of us, "clojure" and "closure" are gonna blur together

14:55 Borkdude: lol means let over lambda in here right?

14:55 rplevy: no it means land of lisp

14:55 Borkdude: or let over fun?

14:55 lof

14:55 let over fn

14:55 foxdonut: rplevy: you live near Canada?

14:55 rplevy: yeah

14:55 not far from Montreal

14:56 Burlington, VT

14:56 mfex: robink: use [org.clojure/clojure "1.5.0-alpha1"] or do you need something more recent even?

14:57 robink: mfex: I don't currently, just wondering how one would specify "1.5.0-master-SNAPSHOT" as a dependency.

14:57 foxdonut: rplevy: that's cool. I live in Montreal.

14:57 rplevy: cool, is there a meetup there?

14:57 TimMc: foxdonut: Hold a Clojure meetup, maybe rplevy can make it t... damn, beat me to it.

14:57 rplevy: hehe

14:58 foxdonut: heh, well we have Bonjure :)

14:58 Borkdude: clojure eyes, give me your hand…. total eclipse of the code

14:58 rplevy: foxdonut: leiningen will allow if ironic

14:58 foxdonut: http://www.bonjure.org/

14:58 rplevy: oh it's a thing

14:58 nice

14:59 ibdknox: dnolen: with cljs master I'm getting the following: clojure.lang.ArityException: Wrong number of args (3) passed to: core$get

14:59 dnolen: not happening with any of the releases

14:59 dnolen: ibdknox: looking

15:00 ibdknox: dnolen: I'm trying to track it down, just wondering if you've seen anything around this lately. It's something to do with macroexpansion

15:01 dnolen: ibdknox: yes, a small optimization get's are now inlined to -lookup

15:01 ibdknox: ah

15:01 dnolen: ibdknox: not sure where that would be coming from tho

15:02 ibdknox: did you try cleaning? re-checking out your clojurescript?

15:02 foxdonut: rplevy: I think many Montrealers drive down to Burlington to fly out for cheaper

15:02 ibdknox: dnolen: cleaned, but I'll try cloning the repo again

15:03 dnolen: ibdknox: hmm, oh sorry that looks like an error in the compiler side of things.

15:04 ibdknox: compiler.clj 1407 is where the problem starts apparently

15:05 rplevy: is Bonjure French-speaking or English?

15:05 dnolen: ibdknox: I think I've spotted it

15:06 rplevy: the website is in English, and the discussion group too, so...

15:06 foxdonut: rplevy: either or according to those present :)

15:07 rplevy: cool

15:07 foxdonut: basically English is the default not to ever make anyone feel left out

15:07 dnolen: ibdknox: sorry about that, pull latest

15:07 ibdknox: let me know if the issue persists

15:08 felideon: heh Bonjure

15:09 ibdknox: dnolen: hm, still getting it

15:10 dnolen: ibdknox: huh, I don't suppose you can isolate the code that causes the problem?

15:12 ibdknox: dnolen: I wish I could :( It's not the result of any change I made, I just pulled and ended up here, so my whole codebase is suspect. What goes down that codepath? maybe I can isolate it that way

15:14 dnolen: ibdknox: trying re-checking out one more time.

15:14 ibdknox: core$get just doesn't make sense to me, that's the alias and it's only used in one place.

15:15 ibdknox: it most certainly supports 3 args.

15:16 y3di: where can i see clojurelogs

15:16 s/clojurelogs/#clojure logs

15:16 dnolen: ibdknox: if you could paste the entire stacktrace that would be helpful too.

15:17 mfex: robink: this worked for me to get 1.5.0-master-SNAPSHOT: https://gist.github.com/2771033

15:17 ibdknox: dnolen: I'll have to piece it back together, that stupid printing thing is still happening haha. This is a comedy of errors. Give me a sec

15:17 robink: mfex: Thanks! I'll try it out.

15:17 uvtc: y3di, <http://clojure-log.n01se.net/&gt;

15:17 dnolen: ibdknox: thx

15:19 ibdknox: dnolen: https://www.refheap.com/paste/2830

15:19 robink: mfex: Works, thank you very much, I'll keep that repository in mind in future.

15:20 brainproxy: dnolen: is there any project (yet) akin to clojuredocs for clojurescript? it would be nice to be able to reference a list of all the operators in core, core.reader, etc.

15:21 dnolen: ibdknox: in your checkout can you look at src/clj/cljs/core.clj line 253?

15:21 brainproxy: there is not - and i agree that would be useful.

15:21 brainproxy: maybe not even something as fancy as clojuredocs, even just a list

15:22 ibdknox: dnolen: (-dissoc! [tcoll key])

15:22 y3di: thanks uvtc

15:22 dnolen: ibdknox: that's not the right file, not core.cljs

15:22 antares_: Just released Welle 1.0: https://twitter.com/clojurewerkz/status/205013459379818499 (more at http://clojureriak.info)

15:22 ibdknox: oh sorry

15:22 dnolen: ibdknox: the macros file, same directory as compiler.clj

15:23 ibdknox: dnolen: https://www.refheap.com/paste/2831

15:23 dnolen: ibdknox: do you see why I think that error is bizarre?

15:23 ibdknox: haha yes

15:23 dnolen: ibdknox: there's the 3 argument case right there.

15:24 Raynes: ibdknox: It'd be cool to have a clojure stacktrace pygments lexer.

15:24 One that did things like clj-stacktrace.

15:24 ibdknox: Raynes: that would be neat

15:24 dnolen: ibdknox: if that didn't work I would have seen errors myself when running the tests.

15:24 Raynes: But I'll be damned if I plan on writing the Python to do it.

15:25 amalloy: dnolen: related to the implicit &env, &form arguments?

15:25 dnolen: amalloy: how?

15:25 amalloy: and if that was true, why aren't the other multiarity macros affected?

15:26 amalloy: occasionally i've seen "incorrect" error messages about wrong number of args to macros

15:26 like a three-arg macro being "omg i can't handle three args" because really it wants five

15:27 dnolen: amalloy: again I could believe that if +, -, etc didn't all work.

15:27 amalloy: *nod* i understand what you mean. i'm just brainstorming here since you guys seem at a loss, but i don't have a lot of cljs expertise

15:28 dnolen: ibdknox: what version of Clojure are you running? 1.4.0?

15:28 ibdknox: dnolen: yeah

15:28 amalloy: but suppose someone were calling (get x) - that *should* fail, and you might get this error message

15:28 dnolen: amalloy: oh huh that's probably it.

15:28 TimMc: Sneaky.

15:28 dnolen: ibdknox: look for (get x)

15:29 ibdknox: a typo in your own code

15:29 ibdknox: looking

15:29 dnolen: ibdknox: wouldn't have come before

15:29 amalloy: right. an error in ibdknox's code that would be at runtime before, but is macro-time now

15:29 ibdknox: there are no runtime errors

15:30 if I move off to the latest release everything is fine

15:30 amalloy: ibdknox: if you never call the function there wouldn't be

15:30 ibdknox: mm

15:30 true

15:30 wait

15:30 could it be that it's no longer respecting if I exclude get?

15:31 dnolen: ^

15:31 amalloy: probably

15:31 dnolen: ibdknox: actually I just verified I get the same error if I write (fn [x] (get x))

15:31 brainproxy: dnolen: regarding JS concurrency (generally speaking), did you ever look into the Flapjax project, headed up by some comp sci students at Brown a couple years back?

15:31 ibdknox: amalloy: I bet that's what it is then

15:31 dnolen: brainproxy: I have though I don't find such projects (adding a concurrency layer) that interesting.

15:32 ibdknox: dnolen: that's it

15:32 dnolen: you can no longer name something get

15:32 amalloy: dnolen: i don't understand why you make things like `get` a separate macro - can't you put it as :inline metadata on the function? that might help with excluding from the namespace

15:32 dnolen: amalloy: there is not such thing as :inline metadata, nor is it necessary.

15:33 brainproxy: dnolen: you think the concepts are too limiting? not that helpful?

15:33 dnolen: ibdknox: were you excluding get?

15:33 ibdknox: yep

15:33 dnolen: brainproxy: performance mostly.

15:33 amalloy: oh, really? i guess the feature's nonexistence would be a good reason not to use it

15:34 dnolen: amalloy: you just don't need it, compiler macros do what :inline did

15:34 ibdknox: can you paste your ns declaration? excluding macros is closed ticket

15:35 ibdknox: mm

15:35 amalloy: i always thought of :inline as just being a way to declare a compiler macro. is the way you're doing this (separate function/macro) the cljs way of doing compiler macros, then?

15:35 dnolen: amalloy: yes

15:36 ibdknox: dnolen: https://www.refheap.com/paste/2833

15:37 brainproxy: dnolen: I had been trying to build a generalized flapjax (fully variadic, with monad-like transforms) using coffeescript, but hit difficult areas because some of the abstractions are tricky sitting atop js/coffee, will probably try again w/ clojurescript

15:37 dnolen: brainproxy: that sounds interesting :)

15:38 ibdknox: hmm at the REPL that exclude w/ (get x) compiles fine

15:38 brainproxy: dnolen: i think so.. will let you know if/when I have any luck w/ it

15:38 ibdknox: dnolen: it was fixed by just changing the name from get

15:39 dnolen: ibdknox: do you have multiple :requires, :refer-clojure, :uses etc ?

15:39 ibdknox: dnolen: nope, that's the whole ns

15:39 very simple one

15:39 dnolen: here's the file https://www.refheap.com/paste/2834

15:40 pepijndevos: amalloy: ohnoes, huggle is broken in lazybot.

15:41 dnolen: ibdknox: why does it say clojure.core/get ? is that a typo?

15:42 ibdknox: hah

15:42 that is

15:42 amalloy: hah, neue

15:43 you know you can just use new there, right?

15:43 ibdknox: dnolen: switching to cljs.core/get doesn't fix it

15:43 amalloy: habit

15:43 amalloy: so used to not being able to name things new :)

15:43 amalloy: i like the spelling though. it's a cute workaround

15:44 Borkdude: ibdknox: german roots?

15:44 ibdknox: Borkdude: stimmt

15:44 dnolen: ibdknox: can you do me a favor

15:44 ibdknox: Borkdude: though it works nicely with Helvetica Neue and such too

15:44 dnolen: ibdknox: compile a project with just that file.

15:44 ibdknox: sure

15:47 dnolen: blows up with the same stacktrace

15:49 drguildo: has anyone else used seesaw?

15:49 dnolen: ibdknox: checking it out here

15:50 * drguildo ** WinSys ** Client: XChat-WDK 1507 (x64) ** OS: Microsoft Windows 7 Ultimate ** CPU: Intel(R) Core(TM)2 Duo CPU E7400 @ 2.80GHz (2.00 GHz) ** RAM: 8191 MB Total (4862 MB Free) ** VGA: ATI Radeon HD 4600 Series ** Uptime: 10.08 Hours **

15:50 drguildo: oops

15:50 sorry!

15:50 dnolen: ibdknox: hmm ... it successfully compiles

15:50 drguildo: i didn't think it'd spit it out here

15:51 pepijndevos: Raynes: Y U remove good stufz? https://github.com/flatland/lazybot/commit/9f3629b6abd84ab8c65ee978ecc08d305f743077

15:51 dnolen: ibdknox: it definitely did not work for you in a project by itself?

15:51 raek: drguildo: if you have a question, just go ahead and ask it

15:51 ibdknox: dnolen: yeah, that was the only cljs file in it

15:52 Raynes: pepijndevos: Bahaha.

15:52 Bronsa: are you sure you are both using the same clojurescript version? :)

15:52 Raynes: pepijndevos: A lot of those were vulgar test commands from the early days of lazybot.

15:52 pepijndevos: $guards

15:52 lazybot: SEIZE HIM!

15:52 drguildo: i'm just wondering whether i'm doing something wrong or whether seesaw is badly written because whenever i build against it my jar file is massive and it includes a ton of crap that i shouldn't even be using

15:52 ibdknox: Bronsa: both on master

15:52 amalloy: also a lot of them didn't work at all

15:53 like balance. really

15:53 Raynes: amalloy: No, they all worked.

15:53 drguildo: crap being other libraries

15:53 amalloy: well okay, by "a lot" i meant one

15:53 Raynes: amalloy: They all worked in that almost all of them just printed a silly message and did something trivial. Balance did what I wanted it to do, which was stupid. :p

15:54 emezeske: drguildo: Your jar file, or your uberjar file?

15:54 drguildo: also loading the resulting program takes ages

15:54 emezeske, uberjar

15:54 pepijndevos: Raynes: Maybe I can reintroduce them by the weird x is y syntax?

15:54 ibdknox: dnolen: maybe it's the way I'm including master?

15:54 Raynes: pepijndevos: You mean the whatis plugin?

15:54 ibdknox: dnolen: I'm just doing the extra-classpaths thing

15:54 emezeske: drguildo: Of course that's going to be big, it contains all the dependencies for your entire project, including dependencies of dependencies, etc

15:55 Raynes: pepijndevos: amalloy and I have been discussing rewriting whatis as a more clojureboty factoid plugin, but we always argued over syntax and such and never actually did it. Feel free to ignore us and do it yourself.

15:55 drguildo: emezeske, so what are my options? i want to be able to run it standalone with as little unused/unneeded stuff as possible.

15:56 emezeske, and that also doesn't explain why programs built with seesaw are so slow

15:56 dnolen_: ibdknox: I've emailed you the project that I tested with, can you 'lein deps', 'lein-cljsbuild once' to see if that doesn't work for you?

15:56 emezeske: drguildo: Well I can't speak for seesaw's performance.

15:56 drguildo: If you want a smaller uberjar, I guess have less dependencies?

15:57 drguildo: emezeske, i only depend on seesaw; i wouldn't be surprised if i depended on all the other stuff

15:57 pepijndevos: Raynes: I mean this one ???

15:57 lazybot: pepijndevos: How could that be wrong?

15:57 emezeske: drguildo: You can see what seesaw depends on here: https://github.com/daveray/seesaw/blob/develop/project.clj

15:58 drguildo: Of course, any of its deps might have their own deps and so on

15:58 drguildo: emezeske, i guess it's just bloated

15:58 Raynes: pepijndevos: That's completely random. No x is y.

15:58 pepijndevos: ok

15:58 drguildo: they include the kitchen sink when i just want a more clojurey way of using swing

15:59 raek: drguildo: ahead of time compiling your application should reduce the start up time greatly

15:59 pepijndevos: drguildo: Yea... I think there should be a Object.toSwing protocol, just data as code, code as data, etc...

16:00 drguildo: raek, okay, thanks, but if i write an equivalent pure swing program it compiles and runs a ton faster which leads me to believe that the problem lies with seesaw unless i'm doing something "wrong"

16:00 ibdknox: dnolen_: that seems to have worked

16:01 raek: drguildo: is there noticeable performance degradation after it has started up?

16:01 dnolen_: ibdknox: I'd like to isolate what's different between my project and your project.

16:01 drguildo: raek, kinda impossible to tell because it's just a jlabel embedded in the main jframe

16:01 raek: drguildo: clojure is always slow to start up without aot, basically

16:02 since you compile all code at startup

16:02 dnolen_: ibdknox: are you not using lein-cljsbuild? some custom build process here?

16:02 ibdknox: dnolen_: yeah using noir.cljs

16:02 dnolen_: one sec

16:02 raek: drguildo: have you tried enabling aot compilation?

16:02 drguildo: raek, like i say, direct calls to swing using clojure are fine, seesaw is slow as hell compiling and running

16:03 raek, nope

16:04 wouldn't lein uberjar compile the clojure code anyway?

16:04 raek: no

16:05 ibdknox: dnolen_: it must be something to do with the difference in the way the classpath is set up

16:05 not sure how that could be true though

16:06 uvtc: ,(def m {:a 1 :b 2}) (type m)

16:06 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

16:06 uvtc: ,(def m {:a 1 :b 2}) (println (type m))

16:06 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

16:06 uvtc: &(def m {:a 1 :b 2}) (println (type m))

16:06 lazybot: java.lang.SecurityException: You tripped the alarm! def is bad!

16:06 ibdknox: dnolen_: either way, this issue is on my end

16:06 dnolen_: ibdknox: hmm I don't think so. you could only see that error if somehow that :excludes information was discarded before compilation.

16:06 uvtc: &(println (type {:a 1 :b 2}))

16:06 lazybot: ⇒ clojure.lang.PersistentArrayMap nil

16:06 ibdknox: dnolen_: oh

16:06 drguildo: are there any good clojure gui/swing libraries?

16:06 uvtc: Why is that an array map, and not a hash map?

16:06 dnolen_: ibdknox: before expanding any macros we check to make sure that the macro hasn't been excluded.

16:07 ibdknox: it could only fail if something is messing around with cljs.compiler/namespaces atom

16:07 ibdknox: dnolen_: not touching it

16:07 emezeske: uvtc: I think because it's very small.

16:08 Raynes: drguildo: https://github.com/daveray/seesaw

16:08 emezeske: uvtc: I'm not sure where the threshold is, but smaller maps are created as ArrayMap and larger ones as HashMap

16:08 uvtc: emezeske, Interesting. Will experiment. Thanks!

16:08 Bronsa: uvtc maps with more than 8 elements should be hash-maps

16:08 drguildo: Raynes, seesaw is slow and bloated

16:08 emezeske: &(type {:a 1 :b 1 :c 1 :d 1 :e 1 :f 1 :g 1 :h 1 :i 1 :j 1 :k 1 :l 1 :m 1})

16:08 lazybot: ⇒ clojure.lang.PersistentHashMap

16:08 emezeske: uvtc: ^

16:09 Raynes: ...okay.

16:09 In that case, I guess not. :\

16:09 uvtc: emezeske, Ah, ok. Thanks guys (emezeske, Bronsa )

16:10 help_please: hi. are there any users of korma here? I'm running into what I feel like should be a simple join, but i cant get it to work

16:10 drguildo: https://github.com/stathissideris/clarity

16:11 Raynes: drguildo: Have you talked to daveray about your problems though? Opened issues on Github?

16:12 drguildo: Raynes, nope, i'm not sure how constructive my criticism would be

16:12 gtrak: drguildo: you might learn something useful if you dig into it

16:12 uvtc: drguildo, if the apps are just for Gnome, I recently heard about this: https://github.com/technomancy/lein-gnome

16:13 drguildo: uvtc, i'm using windows and wouldn't want to do platform specific stuff anyway

16:13 dnolen_: ibdknox: I may have a fix for you ... one second

16:14 uvtc: drguildo, how about using clojurescript and creating your app in the GUI? (sorry if that's already been suggested...)

16:15 drguildo: uvtc, haven't really thought about it

16:16 uvtc: drguildo, Aack! typo: s/GUI/browser/. Sorry. :)

16:19 dnolen_: ibdknox: try master now

16:33 brainproxy: anybody know if the source document for the paredit cheat sheet is available somewhere ... would love to generate a high-res PDF rather than magnifying a relatively low-res png file

16:35 muhoo: is it true that ` is exactly equivalent to (comp list quote) ?

16:36 gtrak: brainproxy: I had good results through a combination of scaling, sharpening, and mathematical morphology ops in gimp, unfortunately, not sure what I did with that file :-)

16:36 S11001001: muhoo: no, 1st quote's not a function

16:38 muhoo: well then to (list (quote)), no way to comp macros,

16:38 or special forms. i'm just trying to understand what it *does*

16:38 gtrak: by morphology I mean erode/dilate

16:39 aperiodic: brainproxy: andy fingerhut is the guy who puts it together; you could shoot him an email

16:39 muhoo: seems like ` behaves the same as (list (quote ...)), but i might be oversimplifying

16:40 brainproxy: aperiodic: sweet thanks

16:40 gtrak: sounds complicated :o

16:41 mebaran151: I'm getting a weird EOF error from clojure/clojurescript project. Anyway to get the compiler to tell me which file is EOF'ing it?

16:42 amalloy: muhoo: i don't think that makes sense. ` behaves like (quote ...) with a couple exceptions; i don't know where you're getting the idea of an extra (list)

16:43 mebaran151: muhoo: here's a nice little guide that explains how they all subtly change the reader's behavior: http://www.learningclojure.com/2010/11/syntax-quote-kata-for-confused.html

16:45 muhoo: amalloy: thanks, i'm just kind of thrashing around trying to understand stuff.

16:46 mebaran151: thanks, that looks good

16:46 brainproxy: dnolen_: just found this https://github.com/jafingerhut/clojure-cheatsheets/blob/master/pdf/cljs-cheatsheet.pdf ... certainly along the lines of what I said I was wishing for

16:46 dnolen_: brainproxy: is that different than this? http://himera.herokuapp.com/index.html

16:47 muhoo: ahh. that makes more sense. it's quote with full qualification

16:48 TimMc: muhoo: And the possiblity of unquoting.

16:50 brainproxy: dnolen_: nope .. had forgotten about that, though I have made frequent reference to himera's "synonyms" page

16:59 uvtc: I could've sworn that there was a longer "javascript --> clojure" sort of cheatsheet/quick-ref at fogus's himera ... anyone remember that or have a link to it?

16:59 It had the same styling as what's currently at http://himera.herokuapp.com/index.html .

17:01 mebaran151: hey ibdknox, I think I tracked down this EOF error to cljs/start: any idea how I could get the file that is throwing it for a loop?

17:05 uvtc: Ah ha! Found it: <http://himera.herokuapp.com/synonym.html>

17:06 dnolen_: nice latest WebKit's support drawing without smoothing.

17:10 jtoy: from inside of a method, can I know the name of the method I am in?

17:11 gtrak: jtoy: why?

17:11 methods don't have names, vars do?

17:11 jtoy: i guess i need to use a macro for that

17:11 joegallo: you mean in a proper java method? or were you speaking loosely about clojure functions?

17:12 jtoy: joegallo: clojure function

17:13 TimMc: gtrak: Fns have names too!

17:13 Or they can, at least.

17:13 gtrak: yea, just saw that, though I've never used it for anything

17:13 jtoy: i want do to this? (defn mymethod (log nameofthismethod))

17:13 TimMc: It's useful for general recursion.

17:13 jtoy: and i want to add the (log nameofthismethod) into a bunch of methods without having to type the actual name of the method

17:14 TimMc: jtoy: This is for debugging, yeah?

17:14 jtoy: no, for logging some data

17:16 gtrak: &(.getClass (fn inscrutable [] (+ 1 2)))

17:16 lazybot: ⇒ sandbox7529$eval10218$inscrutable__10223

17:17 jtoy: gtrak: can I do that from inside inscrutable though?

17:17 gtrak: hmm, probably?

17:17 jtoy: how, what would I pass to .getClass ?

17:18 gtrak: you might have to have it close over itself

17:18 TimMc: &(((fn foooo [] (fn baaaar [] (.getClass #())))))

17:18 lazybot: ⇒ sandbox7529$eval10258$foooo__10259$baaaar__10260$fn__10265

17:18 gtrak: oh yea, that works

17:18 jtoy: what is #() ?

17:19 gtrak: &(fn inscrutable [] (.getClass inscrutable))

17:19 lazybot: ⇒ #<sandbox7529$eval10280$inscrutable__10281 sandbox7529$eval10280$inscrutable__10281@45a218>

17:19 jtoy: &(#())

17:19 lazybot: ⇒ ()

17:19 amalloy: ,'#()

17:19 clojurebot: (fn* [] ())

17:19 TimMc: jtoy: It's the fastest way of getting a function you don't care about.

17:20 s/getting/defining/

17:20 tmciver: TimMc: don't you care about *all* your functions? :)

17:26 gtrak: though if you're referencing it by a symbol, you could just give back the name of the symbol..

17:27 &(fn inscrutable [] (name inscrutable))

17:27 lazybot: ⇒ #<sandbox7529$eval10319$inscrutable__10320 sandbox7529$eval10319$inscrutable__10320@14ed89a>

17:27 gtrak: &(fn inscrutable [] (name 'inscrutable))

17:27 lazybot: ⇒ #<sandbox7529$eval10328$inscrutable__10329 sandbox7529$eval10328$inscrutable__10329@d40bb0>

17:27 gtrak: &(fn inscrutable [] (symbol inscrutable))

17:27 lazybot: ⇒ #<sandbox7529$eval10344$inscrutable__10345 sandbox7529$eval10344$inscrutable__10345@8c7267>

17:27 gtrak: grr!

17:28 emezeske: &((fn inscrutable [] (name 'inscrutable)))

17:28 lazybot: ⇒ "inscrutable"

17:28 muhoo: interesting, lazybot doesn't allow (defn foo [] ) but it allows (fn foo [] ) ?

17:28 emezeske: &(name 'inscrutable)

17:28 lazybot: ⇒ "inscrutable"

17:28 emezeske: muhoo: lazybot doesn't let you def things

17:28 brehaut: lazybot doesnt allow def (because it lets you munge a shared resource)

17:29 gtrak: emezeske: oh, duh

17:30 emezeske: gtrak: ^_^

17:31 * nDuff ponders whether there would be value in using #bash's evalbot infrastructure (copy-on-write virtual machine reset to a known state for every invocation) to replace lazybot.

17:32 nDuff: ...it would, at least, prevent the restrictions on def and such from being needed.

17:32 muhoo: what about startup time?

17:33 oh, copy, got it.

17:33 nDuff: muhoo: very cheap if it's done right. Make the image small enough that it can all be cached in RAM, pure copy-on-write so nothing on disk has to be changed on reset, snapshot with all the software you want in the VM already running (REPL already attached to a virtual "serial port"), and there's not much to it.

17:35 gtrak: &((fn inscrutable [] (.getClass inscrutable)))

17:35 lazybot: ⇒ sandbox7529$eval10369$inscrutable__10370

17:37 drguildo: has anyone used proguard on a clojure jar?

17:37 muhoo: drguildo: i think the clojure android guys have

17:37 drguildo: i'm getting a ExceptionInInitializerError

17:38 * muhoo just realized that the past four 10+ hour days he's spent trying to understand macros and eval and quoting and such is really bikeshedding.

17:38 muhoo: time to get back to more practical work. like soon.

17:39 mwillhite: anyone familiar with clj-time?

17:39 emezeske: muhoo: As someone else who had to go through a period like that, I can anecdotally say that it pays off in the long run :)

17:39 mwillhite: It seems from-sql-date should be in the 0.4.2 release, but clojure throws up on it

17:40 joegallo: mwillhite: perhaps if you ask your question, then people who can answer it will pipe up

17:40 beat me to it :)

17:40 emezeske: muhoo: I had to beat my head against quoting for a long while, and then take a break, and then beat my head against it some more

17:40 dnolen: ibdknox: did you get to try master?

17:41 mwillhite: :)

17:41 still always good advice

17:41 michaelr`: so is hiccup relatively slow or i'm doing something bad in my code?

17:42 emezeske: michaelr`: I've found hiccup to be very fast myself (although our use cases could differ)

17:42 dnolen: from O'Reilly themselves on CLJS book - https://twitter.com/oreillymedia/status/205006393604976641

17:42 mwillhite: when I try including that function like this in my namespace (ns ... (:use [clj-time.coerce :only (from-sql-data)])

17:42 Raynes: So there is going to be a ClojureScript book?

17:42 mwillhite: I get the following error: CompilerException java.lang.RuntimeException: Unable to resolve symbol: from-sql-date in this context, compiling:(NO_SOURCE_PATH:1)

17:42 Raynes: Already?

17:42 mwillhite: any ideas?

17:43 hiredman: michaelr`: it sort of depends, last I checked hiccup pregenerates as much html as it can, but if it cannot figure it out at compile time it will do the generation at runtime

17:43 mwillhite: the change was committed prior to the latest push to clojars

17:43 michaelr`: hmm

17:44 we have to go deeper ;)

17:49 dnolen: Raynes: why not? I wonder who's working on it

17:49 Raynes: dnolen: Because it's way, way, way too much of a moving target.

17:49 What is our currently release? 0.2?

17:50 dnolen: Raynes: stuff underneath is moving, not the external api.

17:50 Raynes: *shrug*

17:51 mebaran151: michaelr`: I've found hiccup a lot faster than the old erb snippets I was used to

17:56 rplevy: it

17:56 it is very odd that they would not have publically announced it

17:56 an Aug 2012 release?

17:57 and a twitter response as first mention?

17:57 maybe a viral marketing technique haha

17:57 fil512: question for you smart people

17:58 testing, namespace, privacy

17:58 rplevy: whoever is working on it is being very secretive too, weird

17:58 fil512: to encapsulate, I want to use defn-

17:58 To keep ns clean, I put my tests in a seeparate namespace

17:58 And I use "use" to import the functions under test

17:58 gtrak: fil512: you know defn- doesn't really protect anything right?

17:59 fil512: But now how do I test the "private" methods?

17:59 gtrak: (#'ns/function args)

17:59 fil512: When I tried to call a "defn-" function, I got an IllegalStateException

18:00 Is that how most ppl write tests?

18:00 gtrak: fil512: you can get to the var and call it from there

18:00 Chousuke: only for defn- functions I suppose

18:00 rplevy: fil512: there's a great idea in Joy of Clojure

18:00 create an impl ns

18:00 the chapter with that in it is one of the free ones if you don't have the book but I recommend the book

18:00 fil512: I have the book

18:01 I just discovered defn- from reading this book and that is what prompted my question

18:01 tremolo: fil512: you can use the @#'my.stuff/myvar form

18:01 rplevy: so the idea to recap is you don't need to make your non-public functions private, just refer the vars from a non-API ns

18:01 Chousuke: I think defn- is mostly there to prevent anyone from accidentally using your function

18:01 rplevy: problem solved

18:01 Chousuke: you shouldn't use it too much

18:02 rplevy: Chousuke: it is for being declarative about your API

18:02 Chousuke: declarative? :/

18:02 rplevy: I think so

18:02 in my humble opinion

18:02 emezeske: Chousuke: defn- == "Don't use this function, it's liable to change, and isn't part of the public api"

18:03 Chousuke: I would use it for some small helper functions that don't really need to get tested but are not public API either.

18:03 rplevy: emezeske: exactly what I'm saying

18:03 gtrak: rplevy: if you want a declarative api, maybe use 'declare' too much :-)

18:03 fil512: so I split my ns into two ns? one "public" and the other "private?"

18:03 Chousuke: emezeske: defn doesn't imply the opposite either, though.

18:03 rplevy: I prefer (defn ^:private ...

18:03 emezeske: Chousuke: It does to me...

18:04 rplevy: because you can use it with def, defmacro, etc

18:04 Chousuke: emezeske: public API is what you document it to be

18:04 defn implies nothing

18:04 rplevy: defn to me does imply public api, unless you are not saying that the ns is part of your api

18:04 emezeske: Chousuke: Right, and the API is documented by metadata

18:04 Chousuke: If you don't mark something as :private, it will get used.

18:05 tremolo: fil512: just to recap, if you have a private method "defn- bar" in the "foo" ns, you should be able to get to it form your tests with @#'foo/bar

18:05 *from

18:05 hiredman: even if you mark it as private I will use it

18:05 rplevy: emezeske: that is by far the consensus in the community too

18:05 emezeske: hiredman: hahaha

18:05 ivan: is conjing arbitrary keys to a record undefined behavior? or supported?

18:05 Chousuke: emezeske: you might not be able to mark it as private if you use it within your own namespaces, even if it's not intended as public API

18:05 hiredman: I don't care how you've documented you api, what accessors you've declared or whatever

18:05 if I need it I will use

18:06 it

18:06 fil512: I feel like I'm hearing two different approaches: one use defn- and then for testing use @#'foo/bar to get at it, the other is to split my namespace into two namespaces, one public one private and handle it that way--is that correct?

18:06 emezeske: hiredman: oh, I hear you. The point is, though, if I break backwards compat on a :private var, you can't complain. Or, you can, but I won't listen :)

18:06 hiredman: and curse the name of anyone or thing that makes it harder to do

18:06 trptcolin: i thought the preferred way was to cut & paste code from project to project

18:06 :trollface:

18:06 hiredman: trptcolin: if I need to

18:06 Chousuke: fil512: either works, it depends on what you need

18:07 trptcolin: hiredman: ditto

18:07 fil512: which option is more common?

18:07 Chousuke: if you have just a couple defn- functions you can just circumvent the "encapsulation" (there is none, in reality) and test it

18:07 tremolo: fil512: if you're just testing, the @#'foo/bar approach is fine. in fact, it's recommended in the clojure/core style guide

18:07 Chousuke: otherwise, you might want a namespace that you document as "private"

18:07 technomancy: fil512: my approach is to mark internal defns with ^:internal metadata

18:07 hiredman: https://github.com/hiredman/clojurebot/blob/424732436c34de48ca29f04a4f2f7a6ea02b613a/src/hiredman/triples.clj#L29

18:08 technomancy: it doesn't do anything to the compiler, but it communicates to the reader

18:08 fil512: the @#'foo/bar option looks messy

18:08 I like the two namespace option

18:08 are there conventions to indicate which namespaces are public and which private?

18:08 emezeske: I like technomancy's approach.

18:09 rplevy: hiredman: I think it's fine to violate API if you do it with self-awareness of this fact, and that is only possibly by having that distinction

18:10 fil512: guess not

18:10 well gtg.

18:10 thanks for your help!

18:10 Chousuke: I like technomancy's approach too

18:10 you can't prevent anyone from using your private functions, so why complicate things for yourself :P

18:11 rplevy: I like that idea

18:11 hiredman: rplevy: *shrug*

18:11 technomancy: I hope it takes off so that doc tools know to ignore internal functions.

18:13 rplevy: I also augment fogus's impl ns idea by marking internal ns with ^:impl. "internal" is probably better, both for ns and for vars

18:15 dwierenga: can anyone recommend a blog entry or something on how to use the repl to speed up development? everyone seems to rave about how much it helps and i just don't get *how*. i feel like i'm missing something fundamental that is just obvious to others and isn't to me...

18:17 Chousuke: dwierenga: write a function, test the function in the repl immediately, and if it works, write more functions :p

18:18 gtrak: dwierenga: it's really helpful just to try stuff, in emacs you can C-x e and it'll send the last form behind the cursor to the repl

18:18 Chousuke: you can also define whatever temporary variables you need at any time, eg. a vector of test input

18:18 dwierenga: Chousuke: ok... but i don't get how that's dramatically superior to just running your code..

18:18 Chousuke: you don't need to put it in the source file, though a common thing to do is to have some code inside a comment form

18:18 dwierenga: it's faster and more flexible.

18:19 you can also affect the behaviour of a running application with the repl

18:19 technomancy: replaca's talk on Flow at the first conj might be a good starting point

18:19 Chousuke: that's not possible with compile and run style development

18:20 dwierenga: gtrak: oh.. i use gvim on windows. haven't managed to get vim hooked up to the repl

18:20 gtrak: that'll probably help, until you do, you're limited to copy/paste

18:21 dwierenga: you should watch the game of life screencast maybe? it's a good example

18:22 http://www.youtube.com/watch?v=lgsAztXDuH0

18:22 dwierenga: gtrak: will do, thanks!

18:29 gtrak: ok, yeah.. that's spiffiness i don't currently have.

18:30 gtrak: he made the return vals show up inline, but the normal setup just shows it in the emacs minibuffer

18:30 mwillhite: exit

18:37 rlb: gfredericks: not sure keep-indexed can (easily) do what I want after all -- in this case, I want to find the index of the last item that's less then the previous item, if there is one.

18:38 s/then/than/

18:42 rplevy: I think putting :aot in a deploy profile is probably the best solution to avoiding AOT woes during development, rather than running lein clean all the time

18:42 technomancy: clojure.tools.logging doesn't let you set the level at runtime, does it?

18:42 rplevy: yes, definitely

18:44 because it can't be implemented consistently across some of the annoying backends?

18:45 java the albatross =\

18:46 McMartin: I miss tail call elimination every day

18:48 rplevy: technomancy: thanks, I find this to be much cleaner. btw, in preview-4 I got errors running :prep-tasks ["clean"], but I didn't look into it much, probably something I was doing wrong.

18:49 technomancy: rplevy: hm; can you open an issue?

18:49 rplevy: ok I will do that

18:50 technomancy: I haven't tried customizing prep-tasks, but I can't think of a reason it shouldn't work

18:53 amalloy: rlb: i think you want partition

18:54 &(let [coll '(1 3 2 5 4 7)] (keep-indexed (fn [i [a b]] (when (< a b) (inc i))) coll))

18:54 lazybot: java.lang.UnsupportedOperationException: nth not supported on this type: Long

18:55 amalloy: &(let [coll '(1 3 2 5 4 7)] (last (keep-indexed (fn [i [a b]] (when (< a b) (inc i))) (partition 2 1 coll))))

18:55 lazybot: ⇒ 5

19:03 dnolen: another boost to satisfies? lands in CLJS master - the perf hit for calling fn through to protocol fn gets ever smaller.

19:09 ieure: Hmm.

19:09 So in this Compojure route

19:09 I have (parse-stream (reader (:body req)))

19:09 Using [cheshire.core :only [parse-stream parse-string]] [clojure.java.io :only [reader]]

19:09 This always returns null.

19:09 Seems wrong. Has anyone gotten this to work before?

19:10 dakrone: ieure: try (parse-stream (input-stream (reader (:body req))))

19:10 nDuff: My routes which need to refer to the body look like so: (PUT "/wherever" [:as {body :body}] ...)

19:10 technomancy: or parse-string on slurping the body

19:12 ieure: dakrone, java.lang.IllegalArgumentException: Cannot open <#<BufferedReader java.io.BufferedReader@3668ad91>> as an InputStream.

19:12 Er

19:12 My fault on that

19:12 Probably

19:12 What I see in the request is :body #<HttpInput org.eclipse.jetty.server.HttpInput@65012945>

19:12 dakrone: ieure: are you using clj-http?

19:12 ieure: HttpInput is a subclass of InputStream already

19:13 carllerche: so… this may sound insane, but is there a way to hook into the byte code loading of clojure.core functions?

19:13 cjz: what is the ^ in (def ^:dynamic x 1)

19:13 ieure: dakrone, No.

19:13 cjz, What's the name of the character, or what does it mean to Clojure?

19:13 cjz: what does it mean to Clojure

19:13 ieure: cjz, It's a reader macro

19:14 cjz, http://clojure.org/reader#The%20Reader--Macro%20characters

19:15 dakrone: ieure: cheshire should work fine on BufferedReaders itself: https://github.com/dakrone/cheshire/blob/master/test/cheshire/test/core.clj#L122 does the reader need to be opened?

19:15 McMartin: Is there a way to get a byte-based input stream out of a string without ducking down to Java? input-stream seems to insist on treating the string as a file/URL.

19:15 raek: ieure: readers are for text, input-streams are for binary data

19:15 cjz: thank you ieure

19:15 ieure: cjz, You

19:15 *You're welcome

19:16 raek: you can turn an input-stream into a readed, but not the other way around

19:16 *reader

19:16 McMartin: raek: Right. In Java you can however turn a String into a byte[] by handing it an encoding, and then build an InputStream around that

19:16 I can obviously do that with .. in Clojure, but is there a Clojure-native way of doing it?

19:17 raek: McMartin: yes, using the java api

19:17 via interop

19:17 ieure: dakrone, Does not appear to be correct; (parse-stream (:body req)) -> java.lang.ClassCastException: org.eclipse.jetty.server.HttpInput cannot be cast to java.io.Reader

19:17 raek: (ByteArrayInputStream. (.getBytes some-string "UTF-8))

19:17 McMartin: raek: Right, that's the solution I ended up using, was curious if I could do it without interop (since you don't need it for the other)

19:18 I actually used input-stream there instead of ByteArrayInputStream. and it worked, though that might be more reflective

19:18 raek: yeah, that should work too

19:18 dakrone: ieure: and (with-open [rdr (reader (:body req))] (parse-stream rdr)) doesn't work?

19:19 raek: input-stream is mostly sugar for calling the correct method to acquire the stream (for example .getInputStream on a socket) and wrapping the stream in a BufferedInputStream

19:19 ieure: technomancy, (parse-string (slurp (:body req))) doesn't error out, but it returns null.

19:19 raek: its primary purpose is to eliminate most of the boilerplate code you need to write in java

19:20 ieure: lul

19:20 dakrone: ieure: what is (slurp (:body req)) returning then? is it an actual string? just 'null'?

19:20 raek: clojure.java.io does not abstract away java io

19:21 technomancy: ieure: better check to make sure req is what you think it is then

19:21 ieure: technomancy, I did.

19:21 :body #<HttpInput org.eclipse.jetty.server.HttpInput@798a6dd4>

19:21 :content-length 28

19:22 technomancy: how about just (slurp (:body req))

19:23 amalloy: i'm hoping for "null // 21 character comments"

19:24 tmciver: reconnecting to a previously-connected-to swank session and running (ns-publics *ns*) shows my previously-defined vars. But when I try to evaluate one, I get #<Unbound Unbound: #'my-ns/my-var>. How do I re-bind them?

19:25 ieure: technomancy, https://gist.github.com/d0944ab7cc5c198c6166

19:25 I don't think I'm crazy here.

19:26 There's a (log/debug req) above that let form

19:26 technomancy: looks like an empty body

19:26 I wonder if :content-length includes HTTP headers

19:26 amalloy: i have to say, it looks like the input is empty and someone is lying about content-length

19:26 technomancy: it shouldn't

19:27 ieure: technomancy, amalloy, I'm just using curl to send this request

19:27 curl --trace-ascii shows it sending 28 bytes of body

19:27 technomancy: there's no good logging library for Java that allows you to set the level at runtime is there?

19:28 giving up on clojure.tools.logging, thought I'd ask before I give up and just call println after checking *level*

19:28 ieure: Okay so

19:28 For some reason

19:28 Omitting the content-type makes it all blow up

19:28 emezeske: technomancy: I consistently feel like java has made logging a bigger ordeal than it needs to be

19:28 dakrone: technomancy: we set it dynamically with log4j

19:29 technomancy: dakrone: is it an ordeal?

19:30 dakrone: technomancy: see pm

19:30 * technomancy backs down from the edge

19:31 technomancy: thanks dakrone

19:31 the equivalent in j.u.Logging is a pit of despair

19:44 kwertii: technomancy: is there a better way to add a lein-git-dependency to the project than using :source-paths on its src/ dir in Lein 2?

19:45 technomancy: there's not really any good way to do dependencies using git (in any language)

19:45 I mean there's checkout dependencies, but that's different

19:46 kwertii: right.. I'm looking at the lein-git-deps plugin, which does mostly what I need (except for recursive dependencies)

19:46 Ruby Bundler is very nice as far as Git deps go

19:46 technomancy: not according to the maintainers =\

19:46 kwertii: heh. I never maintained it, just used it, and never ran into any issues

19:47 I can imagine it must be a pain

19:47 tmciver: I see now that my unbound var issue is only with one of the vars - the server returned by the run-jetty function. I did not pass {:join? false} so the call did not return (and the var not bound to the symbol), which is why I killed slime in the first place.

19:47 hiredman: calling ruby bundler "nice" is something that is sure yo get you sighed at

19:47 to

19:48 kwertii: hiredman: I suppose "nice" is a relative term. It's nicer than what we were all doing before bundler, which was trying to maintain a DLL Hell-esque systemwide mess of gems or hacked together custom versioning solutions.

19:49 I am frequently faced with a case where some bugfix or new feature I need exists in a Git master branch or on somebody's fork, but hasn't been packaged up. If the maintainer isn't really into the project, it's sometimes months before it gets released

19:50 technomancy: using git for dependencies is really only appropriate during development

19:50 that's what checkout deps are for

19:50 hiredman: ditch or fork

19:51 technomancy: if you have to deploy with an unreleased change, you need to cut your own release


19:52 kwertii: What's the etiquette for that? fork it and push my own foo-prime release to clojars?

19:52 emezeske: kwertii: If you're just using it locally, you can just "lein install" it, without pushing to clojars

19:53 hiredman: kwertii: clojars will namespace non-canonical forks (aslong as the canonical version is there already)

19:53 technomancy: if you have your own private repo it's better to publish there

19:53 kwertii: hiredman: interesting. didn't know that. that sounds perfect

19:53 technomancy: but it's not necessary

19:53 hiredman: maven has group-ids and project-ids, lein typically keeps them the same, but they don't have to be

19:54 it is also pretty easy to run your own maven repo

19:54 you can just copy the relevent bits of your .m2 to s3

19:55 if the library is written in clojure you can even just rewrite particular functions and redefine them

19:56 kwertii: having this information out there would probably help a lot of people and increase our general library update velocity. is this written up anywhere? if not, I'll write it up now

19:58 jtoy: so i just want to confirm ,for keyword arguments in clojure: http://stuartsierra.com/2010/01/15/keyword-arguments-in-clojure (defn foo [a b & options] (let [opts (apply hash-map options)] ….. is the recommended way?

19:59 hiredman: jtoy: you are kidding right?

19:59 jtoy: hiredman: im a clojure newb,

19:59 hiredman: jtoy: have you read what you just linked to?

19:59 jtoy: yes

19:59 hiredman: try again

19:59 jtoy: he said the first example is preferred

20:00 kwertii: So to push a non-mainline release of some already published library, I edit pom.xml and change the group id? or will it autodetect that?

20:00 jtoy: hiredman: he says his blog post is wrong

20:00 technomancy: kwertii: try `lein help deploying`

20:00 kwertii: technomancy: thanks

20:03 jtoy: ?

20:09 TimMc: jtoy: I don't know what hiredman is trying to say. I mean, I happen to disagree with stuart, but that is what stuart is saying.

20:10 jtoy: TimMc: what way to do you recommend? I don't want to write several different versions of the function, i want to use something like a vector and set default args

20:13 kwertii: added instructions on deploying forks to my fork of lein-git-deps README. Thanks guys.

20:16 TimMc: jtoy: It turns out to be annoying to call such functions with a map of options. apply doesn't work on maps the way one might hope.

20:17 emezeske: jtoy: I'm pretty sure the most common idiom, if you really want to do that, is (defn f [a b c & {:keys [x y z]}] ...), or so

20:18 jtoy: I agree with TimMc, though, in that it's pretty annoying. I generally prefer just passing a map in.

20:19 jtoy: emezeske: do you guys know a good blog page that explains that ? jstu so i can understand exactly how it works

20:20 emezeske: jtoy: I don't unfortunately.

20:20 jtoy: k,thx

20:22 emezeske: jtoy: Maybe this is helpful? Or at least gives you some more things to google: http://stackoverflow.com/questions/3337888/clojure-named-arguments

20:22 jtoy: emezeske: awesome!

20:24 McMartin: I got a lot of mileage out of map bindings but that's not quite what you're looking for here

20:24 Ooh, destructured rest

20:28 jtoy: so for their example: (defn blah [& {:keys [key1 key2 key3]}] (str key1 key2 key3)) to set default values would I just do (let final_key1 (if (nil? key1) "default value" key1)) and do that for every variable or is there a better way?

20:29 McMartin: Better was is later int he article:

20:29 emezeske: jtoy: You want to use :or I think

20:30 McMartin: Yeah

20:30 Also, if-let is better than (let [foo (if (nil? exp) 'default exp)]...

20:31 emezeske: &((fn [& {:keys [a b c] :or {c 42}}] [a b c]) :a 1 :b 2)

20:31 lazybot: ⇒ [1 2 42]

20:32 emezeske: jtoy: ^

20:36 jtoy: emezeske: cool, can I set multiple items with or like that? that seems like the best way to set everything up

20:37 emezeske: jtoy: Yep!

20:37 &((fn [& {:keys [a b c] :or {c 42 d 100}}] [a b c]) :a 1 :b 2)

20:37 lazybot: ⇒ [1 2 42]

20:37 emezeske: &((fn [& {:keys [a b c] :or {c 42 d 100}}] [a b c d]) :a 1 :b 2)

20:37 lazybot: java.lang.RuntimeException: Unable to resolve symbol: d in this context

20:38 emezeske: &((fn [& {:keys [a b c d] :or {c 42 d 100}}] [a b c d]) :a 1 :b 2)

20:38 lazybot: ⇒ [1 2 42 100]

20:38 emezeske: There we go

21:36 timvisher: hey all

21:36 what mode is it that gets me the function argument possibilities in the mini-buffer in emacs?

21:36 mine seems to work 50/50 but i don't know how to debug because i'm not even sure what it is

21:40 gfredericks: light-table-mode

21:42 arohner: timvisher: slime-mode

22:03 * gfredericks just heard someone walk by while using the word "overpronunciate"

22:03 danlarkin: greetings humans

22:04 I just pushed https://github.com/danlarkin/clabango

22:04 amalloy: timvisher: eldoc-mode

22:05 timvisher: amalloy: Yes! thank you so much

22:05 now i just need to track down why it seems to randomly enable and disable itself

22:05 foxdonut: danlarkin: no docs?

22:05 danlarkin: foxdonut: well, there are tests :)

22:05 I know, terrible answer

22:06 no, no docs yet

22:07 foxdonut: danlarkin: I know, writing docs is no fun, but if you want to get people interested.. you need at least an example on the front page so that people might decide "hmm, I want to learn more about this library.."

22:08 my 2c anyway.

22:08 danlarkin: you're right

22:09 maybe a brownie will write docs for me :)

22:10 foxdonut: heh

22:34 Kowboy: so, i have a good question

22:35 is it possible, in a test case, to mock a function called by the function you are testing?

22:35 how would this be done?

22:36 so, the func I am testing is ns1/func1 and it calls ns2/func2 internally

22:36 metellus: Kowboy: with binding

22:36 Kowboy: I want to mock ns2/func2

22:37 metellus: (binding [func2 mocked-func2] (func1 a b))

22:37 brehaut: that only works for dynamic vars though

22:37 metellus: I knew I was missing something

22:37 Kowboy: crap

22:38 metellus: sorry

22:38 technomancy: use with-redefs

22:39 or Rodney Leonard Stubbs: https://github.com/technomancy/rodney-leonard-stubbs

22:39 brehaut: technomancy: your libs have the best names

22:39 technomancy: "He was the Thomas Edison of handing a dude his ass."

22:40 Kowboy: technomancy, looking at this lein bug about proxy settings

22:40 technomancy: http://achewood.com/index.php?date=01272006

22:40 Kowboy: oh, great

22:40 Kowboy: was hoping to mock up classpath/get-proxy-settings

22:41 since System.setEnv() doesn't exist

22:41 Raynes: https://www.refheap.com/paste/2834 Oh my God oh my God oh my God! Light table code on refheap!

22:41 clojurebot: sharing code between client and server is not as simple or great as it sounds: http://blog.ianbicking.org/2011/03/30/js-on-server-and-client-is-not-a-big-deal/

22:42 gfredericks: technomancy: that library makes me really want to make other libs with namespace of rodney.* or rodney.leonard.*

22:42 technomancy: gfredericks: http://clojars.org/groups/robert

22:42 McMartin: I hope the Rodney Leonard Stubbs library is for ripping the entire middles out of functions.

22:43 technomancy: Kowboy: with-redefs is your best bet there

22:44 Kowboy: I'll give it a shot

22:44 gfredericks: technomancy: I assume you've applied for the .robert TLD

22:44 if anybody else gets it first sue'em

22:44 Kowboy: here is one case where the JVM doesn't let you create the side-effect

22:49 technomancy: "Listen, man. You know how I agreed to stop calling the police about your animatronic Nativity scene? I got a favor to ask." <3 achewood

22:50 gfredericks: technomancy: please write a library that makes us all prolific readers

22:50 brehaut: just dont write a library that makes me have to read stephenson

22:51 technomancy: brehaut: I think liebke covered that one?

22:51 brehaut: haha

22:51 maybe he did

23:01 amalloy: oh, is avout a reference to anathem? i didn't see the relevance

23:07 Kowboy: technomancy, I'm assuming the right way to do this is to reuse classpath/get-proxy-settings and adding those to the jvm-args inside of eval/get-jvm-args

23:08 as -Dhttp.proxyHost=foo

23:08 etc.

23:08 technomancy: Kowboy: yeah, that's the idea

23:08 Kowboy: OK, I think I have it then, just need to test

23:10 (with-redefs [classpath/get-proxy-settings (constantly {:host "foo.com" :port "8080"})] ....)

23:10 seems to work

23:12 unit test passes! Now to install a build of lein2 and test it manually

23:12 technomancy: you should be able to just run bin/lein test

23:12 provided you've bootstrapped your checkout

23:16 Kowboy: well I launched the repl, but forgot I don't have a proxy setting. DOH!

23:17 best place to test this would be at work, where they have a super insane firewall

23:17 technomancy: yeah, it's always hard to find people to test the proxy features =)

23:18 Kowboy: I think I complained about proxy features before

23:18 something about the downloading of lein's own deps

23:19 eggsby: woah flask in light table, you rule ibdknox

23:20 Kowboy: ah, it was lein plugin install that didn't use proxy settings

23:20 fixed 4 months ago

23:20 but yeah, I got hit by that one

23:21 so, would you prefer if I use rodney for mocking (classpath/get-proxy-settings)???

23:21 lazybot: Kowboy: How could that be wrong?

23:22 Kowboy: did I confuse lazybot?

23:22 brehaut: i dont think so??

23:22 lazybot: brehaut: What are you, crazy? Of course not!

23:23 amalloy: i think lazybot gave you a pretty good answer tbh

23:25 technomancy: Kowboy: no, if with-redefs works then that's simpler

23:25 no need to pull in a library for this

23:25 Kowboy: ok

23:50 technomancy, I've pushed to my fork, but I'll test it tomorrow before I send you a pull

23:51 technomancy: Kowboy: great; thanks!

23:57 Kowboy: ok, I

23:58 I'm out, see ya later

Logging service provided by n01se.net