#clojure logs

2012-05-22

00:32RaynesWrite cemerick hate mail.
00:33nDuffactually -- 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.
00:34nDuff(the client not shutting down cleanly is annoying; the server end not shutting down cleanly is a showstopper)
01:24RoxxiIf I have java classes compile in my source directory (via leiningen) how do I reference them in clojure?
01:29nDuffRoxxi: 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?
01:29nDuffRoxxi: ...if you don't know which of those the problem is in, have you checked whether .class files are generated?
01:30RoxxiI'm talking about Java interop, it seems that my classes are indeed being created.
01:30RoxxiI suppose I'm looking for the analogous invocation of (require 'package :as short-name)
01:31nDuff(import '[com.example ClassOne ClassTwo])
01:31nDuff...or something like that -- I usually just use the (ns) macro form
01:31Roxxiyeah, what's the ns macro form?
01:31Roxxithat's what I'm trying to find
01:32nDuff(ns foo (:import [com.example ClassOne ClassTwo]))
01:37RoxxiThanks!
02:57ro_sti have (map (something) … )
02:57ro_stwhat's the paredit spell for killing the (map … ) part and leaving (something) behind?
03:08neotykro_st: kill (something), kill (map ...), C-y, M-y
03:09neotykro_st: sorry no paredit spell I know of
03:10amalloywhaaaat
03:10amalloy(map |(something) ...) ;; M-r => |(something)
03:11amalloyro_st, neotyk: ^
03:11neotykamalloy: sweet
03:12neotyk&(inc amalloy)
03:12lazybotjava.lang.RuntimeException: Unable to resolve symbol: amalloy in this context
03:12neotyk(inc amalloy )
03:12lazybot⇒ 3
03:12amalloythere's paredit commands for pretty much anything interesting you can do with sexps
03:14amalloyeven the occasionally-useful paredit-convolute-sexp: (fn [x] (fn [y] |(/ x y))) ==> |(fn [y] (fn [x] (/ x y)))
03:15ro_stamalloy: thank you. you rockstar you
03:15ro_stthat's paredit-raise-sexp
03:15ro_stfound it in the paredit cheatsheet i have stuck on my wall
03:15ro_stthanks!
03:17ro_stah, convolute: turn inside out?
03:18ro_stwow, that rocks
03:19ro_stonce 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
03:19michaelr`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
03:20michaelr`every time i start using emacs i have to deal with shit like this :)
03:21michaelr`emacs is my IRC client of choice, though :)
03:21ro_stwhy 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
03:21tomojyou can just C-u DEL or C-u C-d to delete and e.g. C-q ) to just insert a close paren
03:22michaelr`oh.. thanks
03:22ro_stmichaelr`: 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
03:23tomojI don't get that indentation
03:23tomojI get this https://gist.github.com/651495618665de2a2041
03:23ro_stmichaelr`: put this in your emacs init script: (require 'rainbow-delimiters) (global-rainbow-delimiters-mode)
03:24michaelr`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
03:24tomojparedit doesn't handle indentation I believe, so maybe you have some difference in your emacs lisp or clojure-mode indent settings?
03:24ro_sttomoj: ah, ok. i think it's slime that does indentation
03:24ro_sti'll look into it
03:25tomojseems doubtful they'd reimplement indentation in slime
03:26tomojmichaelr`: it shouldn't fail unless you paste something unbalanced into it
03:26ro_stmy slime menu has Editing > Update Indentation
03:26tomojmichaelr`: or comment stuff out without properly selecting a balanced form
03:26neotyktomoj: if you ([ and hit backspace it goes unbalanced
03:27tomojthat would be silly
03:27tomojfor me, ([|]) -DEL> (|)
03:28neotyknot for me, (])
03:28tomojDEL should be bound to paredit-backward-delete
03:28michaelr`ro_st: what's that rainbow coloring?
03:28ro_strainbow parens colouring
03:28michaelr`ro_st: i have (highlight-parentheses-mode t) it does that too
03:28ro_stseem my screenshot link above
03:28tomoj(and you should be using paredit version 23)
03:28neotyktomoj: it is paredit-backward-delete
03:29ro_stoh, right :)
03:29tomojdunno if the version matters
03:29neotykversion 22 here
03:30kralhola
03:31neotyktomoj: where did you get v23 from, marmelade has v22
03:31tomojhttp://mumble.net/~campbell/emacs/paredit-beta.el
03:31tomoj(rename to paredit.el before putting in load-path)
03:32tomojseems odd that they wouldn't have thought of that until v23 though..
03:32tomojI mean that's the main point of paredit-backward-delete t ome
03:32ro_stwhat's new in 23?
03:33tomojno clue :(
03:37kima /join #arch-linux
04:04muhoohow would i pass command-line args to an app on heroku?
04:08tomojhuh, I never noticed seque
04:08hiredmanmany a splendid thing
04:10amalloyi was sad to discover that you can't use seque from inside an agent action
04:11amalloy(because it's implemented using an agent, and when inside an agent action, sends are queued until the action completes)
04:15al-maisanGood morning
04:22si14Does Luke Vanderhart visit this room?
04:36ro_stsi14: you can tweetle him at @levand
04:36ro_stsorry, @levanderhart
04:41muhooi'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?
04:41muhooi don't control that eval function btw, so i have to deal with it.
04:42si14ro_st: thanks
04:44muhooi 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
04:50muhooor this atrocity: https://www.refheap.com/paste/2824
04:53kimaI don't think you have much options ...
04:53kimaAre you able to reimplement the functionality without using eval
04:54muhoomaybe, i'm just not sure how many breaking changes i want to introduce into someone else's library :-)
04:58kimamaybe 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
04:59kimaso when called normal the function has the default behavior and when called with the context map extra parameter it works with let bindings
04:59muhooi do, i'll look in there.
05:00muhoostill, maybe i'm chasing the wrong thing. the error is actually this: https://www.refheap.com/paste/2825
05:00kimasection 8.1
05:00kimafor use case page 309-310
05:00muhoono 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.
05:01clgvmuhoo: code?
05:01muhoogood idea, let me narrow it down to the 3 lines that'll fail
05:03muhooclgv: this is all that's required to make the fireworks happen: https://www.refheap.com/paste/2826
05:03fliebelRaynes: ping
05:05amalloyi suppose custom-handler* is some silly macro?
05:06clgvamalloy: it's a defn
05:06muhooit's actually a noir.core function.
05:06muhooa defn, with eval
05:08clgvmuhoo: does your (:list-url fsettings) evaluate to something like [:post "/login"] ?
05:08muhoohave a look
05:08muhooit's in the refheap paste
05:09muhoofails with just simple str "/urls" as well as [:post "/fuu/:id/routes/too"]
05:09clojurebotI don't understand.
05:09clgvmuhoo: ah right - it does not
05:09muhooit's the eval that's making my life complicated, but why, i'm still unsure
05:10clgvyou can try: [:post (:list-url fsettings)] or :get or what you need ^^
05:10muhooit's not that arg that's the assplosion. it's the second arg, the function
05:10muhooby the way, if i move that out of a defn, it all works
05:11amalloymuhoo: just fyi, asplosion is a cutesy way to say explosion. assplosion is a cutesy way to say diarrhea
05:12clgvamalloy: rofl
05:12muhoothe stacktraces i got were more akin to an ass-plosion than an asplosion, it's true
05:12ro_st+1 for applying cutesy to diarrhea
05:13clgvmuhoo: can you post the stacktrace from the minimal example?
05:13muhooclgv: i think it's an inner-class thing in jvm maybe? https://www.refheap.com/paste/2827
05:13muhooclgv: minimal stacktrace is more cutesy: https://www.refheap.com/paste/2828
05:15clgvmuhoo: you could go through custom-handler* code to see what results you get in the single steps
05:15muhooclgv: i did that
05:15amalloymuhoo: minimal repro case is basically (eval `(~(constantly 1) 10))
05:15amalloyyou can't eval closures
05:15muhooadded printlns. everything checks out
05:15muhooamalloy: that's the problem, yes
05:16muhoohmm. wow. i guess i'm screwed thenn.
05:17clgvmuhoo: you can create a patched implementation of custom-handler*, I guess
05:17muhooi think that's the only option.
05:18clgvmuhoo: do you know why an eval is needed there?
05:19muhoothe line is this: (eval `(~action ~url {params# :params} (~func params#)))
05:19muhooand action is compojure.core/GET or POSt
05:19muhooit's basically creating the route, then storing it in an atom.
05:20muhooat page reloads, the routes and app are regenerated, makes for nice interactive development of the rails-y style
05:21clgvmuhoo: ah, eval is for reloading so that the code in there is not compiled already.
05:22clgvmuhoo: but if you create that handle via settings anyway you wont need that, right?
05:22muhoowhat i'm trying to do is generate a whole bunch of pages dynamically
05:23muhoofrom a defn. then the body of that defn calls noir to generate the routes and put them into the atom
05:23Raynesfliebel: pon
05:23Raynesh
05:23RaynesJesus.
05:24Raynesfliebel: pong
05:25fliebelRaynes: 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?
05:25RaynesYou 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.
05:26ro_sthow do i get paredit going in the slime-repl?
05:26amalloyRaynes: is lazybot still busted re: evaluating clojure?
05:26Raynesamalloy: define 'busted'
05:26amalloy&(inc 1)
05:26lazybot⇒ 2
05:26fliebelRaynes: Ok, do I owe you some project maintainance or cake? If you could add it to #hackerschool, that'd be grewat.
05:27amalloy&`inc
05:27lazybot⇒ clojure.core/inc
05:27amalloyhey, he's working!
05:27amalloy$login
05:27lazybotYou've been logged in.
05:27Raynesamalloy: I didn't do anything to fix it. I restarted him but it was still broken.
05:27amalloy$join #hackerschool
05:27Raynesfliebel: You don't owe us anything. <3
05:27fliebelyay!
05:27muhooit is kind of weird to hear a bot referred to as "him"
05:27ro_stcan paredit work in the repl?
05:27Raynesamalloy: 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.
05:28ro_sti thought it was but it appears not
05:28amalloyfiiiine
05:28fliebelRaynes: I might write some plugins for it, regardless.
05:28clgvmuhoo: 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
05:29Raynesfliebel: Great. You write 'em, I'll add 'em. :p
05:29amalloyfliebel: do you want channel logs?
05:30RaynesGoodnight pals.
05:30Raynes<3
05:30muhooclgv: yep, that seems like a reasonable next thing to try.
05:30fliebelamalloy: erm, dunno, doesn't hurt I guess, havn't thought deeply about it.
05:30fliebelamalloy: But if you run out of space, feel free to scrap them :P
05:30amalloy$reload
05:30lazybotReloaded successfully.
05:31amalloyhe might or might not be logging now, but he should at least log next time we restart him
05:31fliebelthere are quite a few people interrested in learning clojure at hackerschool :)
05:32clgvfliebel: what's hackerschool?
05:32ro_stgood. the more, the merrier. clojure rocks
05:32fliebel$google hacker school
05:32lazybot[Hacker School] https://www.hackerschool.com/
05:41michaelr`what's a good function/macro to measure execution time?
05:41amalloy,(clojure.repl/apropos "time")
05:41clojurebot(time dotimes read-instant-timestamp parse-timestamp)
05:41amalloy,(doc time) ;; tada!
05:41clojurebot"([expr]); Evaluates expr and prints the time it took. Returns the value of expr."
05:42michaelr`&(time (count (range 1000)))
05:42lazybotjava.lang.ClassNotFoundException: clojure.core
05:42michaelr`,(time (count (range 1000)))
05:42clojurebot"Elapsed time: 7.161 msecs"
05:42clojurebot1000
05:43michaelr`how about printing a label
05:45michaelr`like (time "db fetch" (fetch-db db))
05:48michaelr`okay, i'll write my first clojure macro ever ;)
05:48michaelr`after this there will be no way to go back..
05:56muhooclgv: aha, i see why he did it this way. there's a trap here.
05:57muhooto call GET, you need to supply args. those need to be gensymed, and so you need syntax quoting, and then you're stuck evaling
05:58muhoobut, i think i can do it manually, bypassing most of this stuff
06:24michaelr`ooh performance optimization is so fun
06:27clgvmuhoo: you dont need syntaxquoting for gensym. there is 'gensym ##(doc gensym)
06:27lazybot⇒ "([] [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__'."
06:30muhookima: i see, that contextual eval is pretty crazy. [k `'~v] , eh?
06:31kimait becomes clear after a bit thought and macroexpand :-)
08:03kimahi #clojure
08:32lewanghello all
08:33gfredericksthis must be the sound of #clojure waking up in the morning
08:34ordnungswidrigit's midday over here. maybe everybody is on the plane to uk
08:35foxdonut(ns good.morning)
08:36clgvjava.lang.RuntimeException: java.lang.ExceptionInInitializerError
08:36foxdonut(let [your-day be-a-good-one] ..)
08:36clgvjava.lang.Exception: Unable to resolve symbol: be-a-good-one in this context
08:57Borkdudeis there a shortcut for (keep identity coll)?
09:02lewangCan anyone lend me a hand with swank-clojure and Emacs? It works, but I can't get meaningful stack traces.
09:03foxdonutBorkdude: doesn't seem like there is. (keep identity coll), (filter identity coll), (remove nil? coll), etc.
09:04ordnungswidrig(remove nil? coll) is the easiest to understand, IMHO.
09:07hyPiRionfoxdonut: (filter identity coll)? ##(filter identity [true false nil 1])
09:07lazybot⇒ (true 1)
09:07hyPiRion&(keep identity [true false nil 1])
09:07lazybot⇒ (true false 1)
09:07hyPiRionIt's subtle, isn't it.
09:08michaelr`ibdknox: ping
09:12ro_stwhat's a nifty way to get a subset of a map's data by keys?
09:13ro_st(gimme-a-map-with-just-these-keys-please source-map (:key1 :key2))
09:14S11001001,(doc select-keys)
09:14clojurebot"([map keyseq]); Returns a map containing only those entries in map whose key is in keys"
09:14ro_sti really should read through the api some time. thanks s11
09:14foxdonuthyPiRion: good point. I think (remove nil? coll) is most obvious at what it does.
09:15hyPiRionfoxdonut: Yeah, it's more or less verbatim of how I would've described the function.
09:16S11001001ro_st: best check what happens when a key in keyseq isn't in your map, and make sure it's what you want
09:16hyPiRionIf I were to describe it in a non-programming language.
09:16ro_sts11: thanks for the tip. in this case, the source map is sql data, so they'll always be there
09:17ro_stis there a clever way to select the current form so that i can copy it? emacs + paredit
09:18ro_stright now i'm ctrl-space, C-M-f, enter
09:18hyPiRionCurrent form?
09:19ro_stoui
09:19ro_stthe form at the point: |(my form) or (m|y form)
09:19hyPiRionAh.
09:20hyPiRionFor the first one, I use C-<space> C-M-n
09:20hyPiRionC-M-p and C-M-n are good when you're at the start or end, but I'm an emacs newbie myself :)
09:22S11001001ro_st: I imagine killing the current form only would have a paredit-specific binding; try C-h m
09:23vijaykiranro_st: C-k and C-_ should be the same
09:23ro_st?! now my repl says "Unable to resolve symbol: doc in this context"
09:23ro_stthis is in slime
09:24ro_sti thought doc was one of them global ones?
09:24vijaykiranmay be you should (use 'clojure.repl)
09:24bobryis it possible to initialize a record with a map? i.e. with keyword arguments instead of positional?
09:24ro_stah. my slime repl doesn't seem to do that
09:25hyPiRionbobry: Is speed essential for you? If not, I'd try to replace the record with a map.
09:25AWizzArdbobry: in Clojure 1.4 you can you it with map->XYZ
09:25AWizzArd(defrecord Foo [a b]) (map->Foo {:b 2, :a 1})
09:26AWizzArdIn earlier Clojure versions you could do (into (Foo. nil nil) {:b 2, :a 1})
09:26AWizzArdThis is a bit unfortunate, as you first have to create a throw-away Foo instance.
09:26hyPiRionAWizzArd: are there any other functions defined at defrecord-time?
09:26bobryAWizzArd: thanks! 'map->*' is exactly what I was looking for
09:27hyPiRionSounds practical.
09:28clgvhyPiRion: yes, (->Foo 10 20) as a kind of constructor as well
09:28bhenryis there a (clojure-version) equivalent for clojurescript?
09:29hyPiRionclgv: Fancy.
09:30ro_stthere must be a way to have the slime repl run some code on startup ¿
09:30ro_st? too
09:30matessimHey, i'm abit confused about lambda's vs fn's
09:30matessimif lambda's don't have explicit do's basically only the last form in the lambda will be evaluated?
09:31dnolenbhenry: that works in CLJS
09:31bhenrydnolen: i'll restart the repl. that throws me an error
09:32matessimWhat's wrong with this? => (#(println "a")(println "b"))
09:32matessimb
09:32matessimArityException Wrong number of args (1) passed to: user$eval560$fn clojure.lang.AFn.throwArity (AFn.java:437)
09:33dnolenmatessim: the anon fn takes no arguments
09:33matessimi didn't give it any arguements.
09:33matessimor did i somehow?
09:33dnolenmatessim: you did.
09:33ro_st(println "b") is being passed as an arg to #(println "a")
09:33foxdonutthe (println "b") is an argument
09:33ro_st#() is a function 'literal'
09:34matessimoh i'm missing a bunch of parenthesis
09:34matessimthanks
09:34rhcmatessim: i think you want this: #(do (println "a") (println "b")) ?
09:34matessimI was trying to see the difference in anon vs fn myself(From what i understood, anon would print b and fn would print ab)
09:34matessimand yeah rhc
09:34ro_stis there a way to specify a clj script to run on startup of my slime repl?
09:35dnolenro_st: probably, perhaps technomancy knows
09:35matessimNow i'm even more confused, whats wrong with this?
09:35matessim=> (#((println "a")(println "b")))
09:35matessima
09:35matessimb
09:35matessimNullPointerException user/eval564/fn--565 (NO_SOURCE_FILE:1)
09:35vijaykiranprintln returns nil
09:35dnolenmatessim: you are calling nil as a function
09:35vijaykiranso you are truing to call (nil)
09:35foxdonut,(doall (map println ["a" "b"]))
09:35clojurebota
09:35clojurebotb
09:35rhcmatessim: break that down, its basically (#(nil nil))
09:35clojurebot(nil nil)
09:36matessimaha
09:36matessimif it was (#(nil)), would that be alright?
09:36dnolen,(macroexpand '#((println "a")(println "b")))
09:36rhcmatessim: nope
09:36clojurebot(fn* [] ((println "a") (println "b")))
09:36dnolenmatessim: ^
09:36rhcmatessim: (nil) is just trying to call 'nil' which isnt a valid function
09:37matessimso isn't it mean its evaluating twice?
09:37dnolen,(macroexpand '#(do (println "a") (println "b")))
09:37clojurebot(fn* [] (do (println "a") (println "b")))
09:37dnolen,(#(nil))
09:37clojurebot#<CompilerException java.lang.IllegalArgumentException: Can't call nil, compiling:(NO_SOURCE_PATH:0)>
09:38dnolenmatessim: there's no implicit do when using #(...)
09:38dnolen,(#(do nil))
09:38clojurebotnil
09:38matessimbut #(do(nil)) is still wrong, right? and println evaluates to nil
09:38ro_stmatessim: 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)
09:39rhcmatessim: yes, because (nil) is still trying to call nil
09:39dnolenmatessim: (nil) will never work, nil is not a function
09:39matessimso i need to qoute the anonymous function?
09:39matessim'#(do(nil)) is fine?
09:40dnolenmatessim: I think you stop a moment and think this through :)
09:40vijaykiranro_st: I think you need :repl-init in your project.clj
09:40matessimdnolen, i'm just a bit confused, for example ,i'll want to print something with an anonymous function
09:40dnolen,(macroexpand '#(do (nil)))
09:40clojurebot(fn* [] (do (nil)))
09:41dnolenmatessim: figure what is wrong with ^
09:41rhcmatessim: read the first chapter of this book: http://cdn.oreilly.com/oreilly/booksamplers/9781449394707_sampler.pdf
09:41matessimi'm reading
09:41matessimProgramming Clojure
09:41dnolenmatessim: and you'll understand why none of your ideas so far work.
09:41matessimjust got it yesterday
09:41matessimdnolen, i understand, the macro is expanded, but the whole thing is a string
09:41rhcoh ok, perfect. the first chapter should help a lot
09:41matessimthat's not being evaluated
09:41matessimbecause of the '
09:42ro_stvijaykiran: ah, that sounds promising! does slime/swank respect it?
09:42rhcmatessim: its not exactly "just a string"
09:42rhcfor example, you can't do '([)
09:42dnolenmatessim: sorry didn't mean to confuse. the macroexpand was just an illustration of what you're code actually will get compiled as.
09:43dnolenyour
09:43rhcits still parsing it, just not evaluating '(a b c) as "call a with b c"
09:43matessimokay rhc, and i think i understand a bit better
09:43foxdonutdnolen: +1.. trying to grasp too many concepts at once
09:43vijaykiranro_st: I'm guessing - it will - I didn't try it though
09:43matessimextra question, what's the green text in the REPL? i understand black is stdout
09:44matessimbut when i do (do #(println "x"))
09:44matessimit does x in black, and nil in green.
09:44vijaykiranthe return value of the function
09:44vijaykiranevery function must return a value - in this case println returns nil
09:45matessimthanks.
09:45rhcand do returns the return value of the last argument
09:46bhenrydnolen: https://gist.github.com/25cdcee02bb03d506f70
09:48matessimthe only difference between letn and fn is the namespace binding?
09:49matessimdefn*
09:49matessimnot letn
09:50vijaykiran,(macroexpand '(defn x [] (y)))
09:50clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
09:51bhenrymatessim: (defn x [] …) is just a shortcut for (def x (fn [] …))
09:51vijaykiran&(macroexpand '(defn x [] (y)))
09:51lazybot⇒ (def x (clojure.core/fn ([] (y))))
09:51S11001001matessim: defn has lots more sugar too
09:51matessimright, thanks again
09:51clgv&(macroexpand '(clojure.core/fn ([] (y))))
09:51lazybot⇒ (fn* ([] (y)))
09:52vijaykiranmatessim: if you are feeling adventurous, try (source defn) :)
09:52matessimwow thats awesome vijaykiran, had no idea you can do that :P
09:53matessimhow can i pull the metadata? (preferably by key?)
09:53matessimthe ^[:doc stuff.
09:54ro_st(meta thing)
09:54matessimty
09:54Bronsa,(meta #'first)
09:54clojurebot{:ns #<Namespace clojure.core>, :name first, :arglists ([coll]), :added "1.0", :static true, ...}
09:54Bronsa,(:doc (meta #'first))
09:54clojurebot"Returns the first item in the collection. Calls seq on its\n argument. If coll is nil, returns nil."
09:54clgv,(doc first)
09:54clojurebot"([coll]); Returns the first item in the collection. Calls seq on its argument. If coll is nil, returns nil."
09:55matessimBronsa, why is the #' in the meta tag?(I sort of understand the ' but not the #)
09:55Bronsa#' is reader macro for var
09:55Bronsa,(:doc (meta (var first)))
09:55clojurebot"Returns the first item in the collection. Calls seq on its\n argument. If coll is nil, returns nil."
09:56Bronsathe metadata is attached to the Var `first` not to the symbol
09:57matessimi see, thanks
09:57Bronsaso, #' is not related to '
09:58Borkdude,#'+
09:58clojurebot#'clojure.core/+
09:58Borkdude,'+
09:58clojurebot+
09:58Bronsa,'#'+
09:58clojurebot(var +)
09:59Borkdude,'#
09:59clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading character>
09:59Bronsa'nception
09:59Borkdude,#"+"
09:59clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.util.regex.PatternSyntaxException: Dangling meta character '+' near index 0
09:59clojurebot+
09:59clojurebot^>
09:59matessimQ_Q
10:00Borkdude, #" "
10:00clojurebot#" "
10:00Borkdude,#(+ % %1)
10:00clojurebot#<sandbox$eval304$fn__305 sandbox$eval304$fn__305@e2be94>
10:01Borkdude,`(let [+# -] (+# 1 2 3))
10:01matessim,(#(+ % %1) 1)
10:01clojurebot2
10:01clojurebot(clojure.core/let [+__27__auto__ clojure.core/-] (+__27__auto__ 1 2 3))
10:01Borkdude,#{1 2 3}
10:01clojurebot#{1 2 3}
10:02Borkdude,(contains? #{1 2 3} 1)
10:02clojurebottrue
10:02Borkdudehave we covered every use of # now?
10:03Borkdude,#_(eval '(+ 1 2 3))
10:03clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
10:03Borkdude,#_1
10:03clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
10:03Borkdude,
10:03clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
10:04bhenry,#_ 1 2
10:04clojurebot2
10:06gtuckerkelloggi'm feeling pretty stupid, but there's something I don't understand about "="
10:06Borkdudemaybe reader literals, but I can't show it here
10:06gtuckerkelloggI had thought all of these comparisons would be true
10:07gtuckerkellogghttp://pastebin.com/ndfUJtQg
10:08Borkdude,(= {:a 1, :b 2} {:a 1, :b 2})
10:08clojurebottrue
10:09Borkdude,(= {:a #" ", :b 2} {:a #" ", :b 2})
10:09clojurebotfalse
10:09Borkdudegtuckerkellogg: I guess it has to do with how equals is defined on regexes
10:09gtuckerkelloggoh!
10:09gtuckerkelloggwhy?
10:09clojurebotWhy is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone
10:10Borkdude,(type #" ")
10:10clojurebotjava.util.regex.Pattern
10:10gtuckerkellogg,(doc =)
10:10clojurebot"([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:10Borkdude,(resolve 'javadoc)
10:10clojurebotnil
10:11Bronsa,(= #"" #"")
10:11clojurebotfalse
10:11Borkdudegtuckerkellogg: regexes are never equal except when they are the same object
10:12gtuckerkellogghmm
10:12Bronsa,(hash #"")
10:12clojurebot28127006
10:12Bronsa,(hash #"")
10:12clojurebot31360080
10:12gtuckerkelloggaha
10:12Borkdudegtuckerkellogg: i.e., they don't define equality, the equals method is inherited from Object
10:12gtuckerkelloggi see
10:12vijaykiranhttp://stackoverflow.com/questions/10055034/java-comparing-two-pattern-objects
10:14gtuckerkelloggok, that's very helpful. thanks Borkdude, Bronsa, and vijaykiran
10:14ro_stis there a shortcut in emacs to select the symbol under the current point?
10:14Bronsai guess it would be convenient if for patterns `=` compared their .toString
10:14ro_stparedit's cheatsheet doesn't show anything for selection
10:14gtuckerkelloggBronsa, it sure would!
10:15gtuckerkelloggro_st, you might get an answer here, but have you checked the #emacs channel?
10:15ro_stwhat? this isn't #emacs-incognito? :-)
10:22S11001001ro_st: you will have better luck if you use emacs lingo for such things rather than some other UI's lingo :)
10:23ro_stso 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:23ro_steclipse ccw has a gesture for this, i think
10:24vijaykiranro_st: I'm sure #emacs guys will point you to : http://emacswiki.org/emacs/MarkCommands#toc6 :)
10:24ro_stthank you :)
10:24ro_sti'll stop pestering you guys with emacs questions
10:25vijaykiranbut M-x mark-word seems to work fine, just bind it to whatever keycombi you like
10:25ro_stM-@ :-)
10:26ro_stwhoever made emacs show you the bound keybindings when you use M-x (command) is a bloody genius
10:28TimMcYay for discoverable interfaces!
10:31ro_styay indeed
10:32clgvTimMc: ?
10:33vijaykiranso how many of you guys here will be in-person at EuroClojure ?
10:35Borkdudevijaykiran: are you going?
10:35vijaykiranyeah, I'll be there
10:36Borkdudewhat is the official hashtag for euroclojure? #euroconj ?
10:36vijaykiranI guess https://twitter.com/#!/search/%23euroclojure
10:36vijaykiranoops #euroclojure
10:37gfredericksfutures always spawn new threads??
10:37lazybotgfredericks: What are you, crazy? Of course not!
10:37TimMcclgv: My name for user interfaces that allow you discover new ways of using them, unobtrusively.
10:38clgvTimMc: ah kk
10:38TimMcclgv: Similarly, having keyboard shortcuts next to items in a drop-down menu.
10:38clgvgfredericks: they use an executorservice
10:38matessimwhat 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:38BorkdudeTimMc: clgv or help -> search (in menu items) in OSX
10:38matessimnot void, no args i meant
10:39TimMcOr especially having commands grouped into menus in the first place! You can find new commands by accident.
10:39matessimpublic class A{public int x; public A(){...) public int x()}
10:40matessimdoing in clojure (.x instanceOfA) would give me what?
10:40gfredericksclgv: I could have sworn that was true but my coworker just made a jackload of futures which created a jackload of threads
10:40gfredericksand eventually crashed the jvm for having too many threads
10:40gfredericksI think
10:40TimMcmatessim: I was wondering about that when I was writing an interop lib! I think the official answer is "Don't do that!" :-/
10:40matessimTimMc, so its a undocumented implementation detail? i'll check later though, but that sounds like sound advice :P
10:40clgv gfredericks: humm I hope I didnt confuse it with pmap. I'll check
10:40TimMcmatessim: (. instanceOfA (x)) should be unambiguous for the nullary method, though.
10:41TimMcso maybe fields are checked first?
10:41matessimwhy? the book i have says the unsugared syntax for both is the same(fields and methods)
10:41matessimboth the sugared and unsugared is the same for fields and no-arg methods
10:42clgvgfredericks: yes it is an executor service - this one: Executors.newCachedThreadPool();
10:42clgvgfredericks: it's probably not limited like the FixedThreadPool
10:44gfrederickshrm
10:44clgvI had issue with future myself when using it for blocking shell calls
10:45TimMc&(. "foo" (toString))
10:45lazybot⇒ "foo"
10:45TimMc&(. "foo" toString)
10:45lazybot⇒ "foo"
10:45TimMcmatessim: ^
10:46matessimerr. what?
10:46matessimwhy would it return anything else?
10:46matessimAs far as i'm aware the String type has no public toString field
10:46matessim&(.toString "foo")
10:46lazybot⇒ "foo"
10:46gfredericksclgv: yeah I just created 10000 sleepy threads and it stayed up. I will ridicule coworker.
10:47TimMcRight... just demo'ing the two .-forms of method calling
10:47matessimthose aren't the two forms though (what you wrote is the same)
10:47TimMcmatessim: Count the parens.
10:47matessimjust with a extra parenthesis...
10:47matessimaren't the two forms
10:47TimMc...
10:47matessim:
10:47matessimaren't the two forms these?:
10:47matessim&(.toString "Foo")
10:47lazybot⇒ "Foo"
10:48matessim&(. "Foo" toString
10:48lazybotjava.lang.RuntimeException: EOF while reading, starting at line 1
10:48matessim&(. "Foo" toString)
10:48lazybot⇒ "Foo"
10:48TimMcParens are never "extra" in a Lisp.
10:48matessim&(. "Foo" (((toString))))
10:48lazybotjava.lang.IllegalArgumentException: Malformed member expression
10:48matessimhmm
10:48matessimwhat do those extra parenthesis do there then?
10:48matessimbetween the forms you posted.
10:48TimMcTHey say, "this is explcitily a method".
10:49matessimoh, okay.
10:50TimMcUnfortunately, CLojure doesn't actually have a specification. You'd have to make a class and see what happens.
10:50matessimpr = clojure wrapper for println?
10:50TimMcpr = print read'ably
10:50matessimTimMc, is that something on purpose or just lack of people documenting?
10:50TimMcNot sure.
10:51TimMcmatessim: pr is (mostly) the inverse of read (or pr-str vs. read-string)
10:51matessimokay, so its basically for "dynamic code"(Code that creates extra code?)
10:51matessimor w/e the terminology is
10:52zakwilsonNo.
10:52zakwilsonParens *usually* indicate that the first thing in them is callable - a function, special form, macro, etc...
10:53zakwilsonOr were you asking about pr?
10:53matessimzakwilson i understand that...
10:53matessimyeah
10:53matessim:)
10:53vijaykiran" By default, pr and prn print in a way that objects
10:53vijaykiran can be read by the reader"
10:54zakwilsonThat's generally for serialization. It would be unusual to pr something then run it as code.
10:54TimMcmatessim: pr-str and read-string are for reading and serializing data objects.
10:54matessimOkay, makes sense :).
10:55TimMcmatessim: Great for config files. Just read the doc for *read-eval* if you read user-controlled data!
10:55matessimwhat are "things" that are in between asterisks btw?
10:55TimMc&(doc *read-eval*)
10:55lazybotjava.lang.SecurityException: You tripped the alarm! *read-eval* is bad!
10:55matessimi saw it with *ns*
10:56zakwilsonFor runtime code generation, eval takes lists, not strings.
10:56TimMcmatessim: They're part of the symbol. It's a convention for naming dynamic vars.
10:56matessimthe bot doesn't want us to use read eval? :P
10:57TimMc,(doc *read-eval*) ;; let's try a less secure bot
10:57clojurebot"; 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:57zakwilsonI can't imagine why the bot wouldn't want us to poke at something like that.
10:58ibdknoxWould anyone like lots of karma on HN? :)
10:58ibdknoxhttp://www.chris-granger.com/2012/05/21/the-future-is-specific/
10:58ibdknoxsecond Light Table demo ^
10:59zakwilsonCan I buy things with it?
10:59matessimibdknox I found out about Clojure because of your kickstarter, i was like "What is this awesome language" when i saw the demo
11:00matessimi ordered Programming Clojure the same day :P
11:00ibdknoxhaha
11:00ibdknoxcool :)
11:00zakwilsonThe rest of you have about a minute before I take that karma.
11:01ibdknoxzakwilson: someone beat you to it
11:01Borkdudethis dude already did it: http://news.ycombinator.com/user?id=olauzon
11:01zakwilsonibdknox: how did that prototype idea work out for you? I was considering doing something similar.
11:01olauzonjust managed to slip in
11:01zakwilsonGood. I have enough karma.
11:01Borkdudehaha
11:01BorkdudeI don't care about karma
11:01ibdknoxzakwilson: there was lots of interest, but the projects were depressing
11:02zakwilsonI don't mind depressing projects right now. I like money.
11:03ibdknoxone of them was an airbnb for bicycles :(
11:03ibdknoxmost of the people really need help at the idea phase
11:03ibdknoxwhich I could've done
11:03ibdknoxbut is harder to sell
11:04zakwilsonhttp://renthubnyc.com/ <-- airbnb for arbitrary stuff
11:04ibdknoxhah
11:04ibdknoxno I mean this guy ripped it off
11:04ibdknoxhis example used the same font faces
11:04ibdknoxthe same design entirely
11:04lucianpython mode for lighttable yay
11:05ibdknoxlucian: well, an example of one :)
11:06zakwilsonI'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:08Borkdudeibdknox: nice video
11:09ibdknoxthanks :)
11:11zakwilsonYour video is too popular. It's buffering slowly.
11:12foxdonutit's about 14MB in HD
11:13ibdknoxI'm waiting for the "Y U NO USE DJANGO?"
11:14Borkdudeibdknox: why you not use clojure-py :P
11:14lucianibdknox: sure, but i still think it's nice that it's being considered
11:14zakwilsonI'm guessing because it's a hammer and you weren't driving a nail.
11:16ibdknoxhere's a youtube link for the slowness
11:16ibdknoxhttp://www.youtube.com/watch?v=osLReQSB9F0
11:18zakwilsonJust in time for it to finish buffering!
11:20RickInGAibdknox: new light table post/video is amazing
11:20TimMcOh, 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:26zakwilsonibdknox: 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:27ibdknoxzakwilson: totally, I've been thinking about having something like a major and minor modes distinction :)
11:28gtrakI'd rather invest my tool-molding learning into something smaller and more modern than emacs, ibdknox is LT scriptable with clojure?
11:28ibdknoxit's Clojure + ClojureScript
11:28ibdknox+ whatever language back end you use
11:28gtrakawesome
11:30gtrakyea, a scriptable JVM-based editor with a browser UI sounds excellent
11:32Wild_CatI'm not so hot about the browser UI TBH
11:32zakwilsonA 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:32Wild_Cat...then again I used to say that about email clients too, so who knows.
11:32ro_stis there a method that returns true if all the elements in the coll are truthy?
11:32zakwilsonWhy are we still running those in batch mode most of the time instead of having the editor talk to a running program?
11:34ro_stsorry, not a method, a function :)
11:35vijaykiran(every? true? '(blah))
11:35ro_stgah. of course.
11:35TimMcvijaykiran: Not quite.
11:36TimMc&(map true? [1 true false nil])
11:36lazybot⇒ (false true false false)
11:36foxdonut,(true? 42)
11:36clojurebotfalse
11:36TimMcro_st: You can use identity instead of true? there.
11:36ro_stactually, i want to assert whether 3 particular keys in a map are nil or not
11:36TimMcSpecifically non-nil?
11:37ro_stso i'm using (select-keys) to restrict to those 3, and now i want a yes/no on all not nil or not
11:37foxdonut&(every? identity [1 true false nil])
11:37lazybot⇒ false
11:37foxdonut&(every? identity [1 true false])
11:37lazybot⇒ false
11:37TimMcro_st: Instead of select-keys, you can also use juxt. :-)
11:37TimMc&((juxt :a :b :c) {:a 4 :b 5 :c 6 :d 7})
11:37lazybot⇒ [4 5 6]
11:37foxdonut&(every? (complement nil?) [1 true false])
11:37lazybot⇒ true
11:38ro_stah that's even better!
11:40metellus&(every? (not nil?) [1 true false])
11:40lazybotjava.lang.ClassCastException: java.lang.Boolean cannot be cast to clojure.lang.IFn
11:40metellusthat explains that
11:40ro_stcomplement is like ! from javascript?
11:41S11001001no
11:41metellus&(doc complement)
11:41lazybot⇒ "([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:41timvisheranyone 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:42foxdonut&(not (some nil? [1 true false nil]))
11:42lazybot⇒ false
11:42TimMcro_st: It's a higher-order function. ! is like not.
11:42pandeiroanybody use clojurescript on a low powered processor (like atom, athlon)?
11:42foxdonut&(not (some nil? [1 true false]))
11:42lazybot⇒ true
11:42pandeirothe compile times i'm getting with lein cljsbuild + cljs 1236 are painful
11:42TimMc$inc foxdonut
11:42lazybot⇒ 1
11:42pandeirolike one minute to compile a 10 line cljs file
11:42foxdonutro_st: that's another option according to your taste.
11:43TimMcThat's an application of De Morgan's law, right?
11:43ro_stthanks fox
11:43foxdonutwelcome
11:46foxdonut$inc TimMc
11:46lazybot⇒ 6
11:47TimMcheh
11:47S11001001pandeiro: have used plain clojure on atom, seems fine
11:47ro_st((juxt :triple_namespace :triple_key :triple_value) %)
11:47dnolenraph_amiard: ping
11:48ro_st"java.lang.Boolean cannot be cast to clojure.lang.IFn"
11:48ro_stwhy?!
11:48ro_st% here is a map
11:48TimMcTOo many parens somewhere?
11:48S11001001fun fact: juxt is lifting vector into the reader monad
11:49TimMcI'll take it on faith that that was English.
11:50foxdonutlol
11:50ro_stone day i'll learn what a monad is
11:51timvisher`(System/getenv "PATH")` returns the right thing
11:51S11001001and comp is just a less-powerful version of map :)
11:51foxdonut,((juxt :a :b :c) {:a 1 :b 2 :c 42})
11:51clojurebot[1 2 42]
11:51timvisheris there another place that Runtime.exec looks for executables that supersedes PATH?
11:52pandeiroS11001001: yeah clojure is fine, but lein-cljsbuild is taking eons... dunno wats up
11:52ro_sthttps://gist.github.com/2769905
11:52TimMctimvisher: Are you in Cygwin by any chance?
11:52pandeiroibdknox: 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:52ro_stso i'm trying to either just grab :name, or :triple_* if those aren't nil
11:52TimMcAlthough someone was experiencing some PATH weirdness in SLIME or something the other day.
11:53timvisherTimMc: windows
11:53timvisherin cmd
11:53timvisherfrom within emacs
11:53TimMcMaybe it was you!
11:53foxdonutro_st: you have extra parens #(if ((
11:53timvisherI believe it was ;)
11:53ro_stfoxdonut: thank you. was killing me
11:54timvisherinterestingly, 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:54foxdonutro_st: welcome
11:54timvisherwhich leads me to believe that windows somehow honors `.` before anything, even if it's not in PATH
11:54ro_stman, i'm really digging this language
11:54TimMctimvisher: Oh god...
11:54TimMcYou might be right.
11:55ro_stmakes me think hard. i've spent all day writing code and i'm at 83 lines of code, and i'm mentally exhausted!
11:55timvishereven stranger, perhaps is that `(sh "pwd")` does not tell me that i'm in that default directory
11:55timvisherro_st: eventually you want that amount of effort to stop, probably ;)
11:55timvisherunless you're doing something that is inherently very hard. lol
11:55gtrakro_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:55foxdonutro_st: I've lost 15 pounds by sheer mental exercise ;)
11:56ro_styes, naturally. but it's been a long time that i've been so nicely challenged
11:56timvisherwhere are you coming from?
11:56ro_sti'm only about a week and a half into clojure
11:56timvisherjava?
11:56clojurebot
11:56ro_stoh, all the usual imperative stuff. ruby, javascript, php, actionscript in no particular order
11:56timvisheryeah, it'll probably take you awhile to get used to clojure then. :)
11:57timvisherwell worth it, though, imo
11:57ro_stabsolutely!
11:57TimMcJS really helped me learn Scheme, though.
11:57timvisheryou know that is true
11:57ro_stits not just learning clojure. it's also learning emacs
11:57timvisheri always forget how functional javascript can be
11:57TimMcjust insofar as callbacks
11:57timvishermost people don't teach it that way but it can be done
11:57timvisherro_st: double whammy
11:58timvisherwhat are you doing to learn emacs?
11:58gtrakunderscore.js looks pretty good actually
11:58ro_sttimvisher: deep end
11:58foxdonutto me a hurdle was to "unlearn" the solutions I'm used to from OO for which FP has different (usually better) solutions
11:58ro_stpestering folks on here, mostly :)
11:58TimMcro_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:58timvisherlol
11:58timvisherit may sound crazy to you but _read the manual_
11:59timvisherit's an astonishingly good resource
11:59ro_sti have several post-its on my monitor with swank and paredit shortcuts
11:59ro_stalready internalised enough to get around without swearing in the high decibels
11:59ro_stmain thing is the core text editing stuff. once that's natural, the rest is jam
12:00foxdonutemacs is not something I've gone back to though. I'm staying with vim. One less problem to solve.
12:00ro_sti come from windows text editing
12:00vijaykiranro_st: http://shop.fsf.org/product/gnu-emacs-reference-mugs/ :)
12:00ro_stso it's been particularly .. fun
12:00timvisherif you go on an emacs binge, i highly recomend https://peepcode.com/products/meet-emacs and http://vimeo.com/channels/222837
12:00timvisherpardon the self-promotion, of course. ^_^
12:00ro_sti want maximum productivity in the long term
12:00timvisherfoxdonut: i hear that paredit is getting ported to vim, is that true?
12:00ldoparo_st: ms text editing ... you mean like word?
12:00luciani've used emacs + evil for a few months, it was ok
12:00ro_sti tried ccw, sublime text 2, intellij + la clojure
12:00ro_stall subpar
12:01foxdonuttimvisher: I dunno.. I use vimclojure and surround, works well..
12:01ro_stldopa: no, using ctrl left right to move between words and variants thereof
12:01timvishergotcha
12:01ldoparo_st: sorry, bad joke ;)
12:01timvisherparedit was pretty life-changing. miss it in every language that i'm in, even the ones that don't have the revealed ast
12:01ro_sttimvisher: i already have the peepcast. reeeaally helpful
12:02ro_sti'll check the vimeo stuff out. it's on the list along with disclojure and all the itunes clojure podcast material
12:02ro_stand joy of clojure, of course
12:03ro_stto think i was going to commit our company to using rails -shudder-
12:03timvisherfor my next revelation, `(sh "which" "convert")` … returns the right thing
12:03zakwilsonParedit is pretty useful, though I find Slime to be the best thing about Emacs. It's like LightTable, kindasortaalmost.
12:03timvisherjoy of clojure is awesome
12:03banseljajHello everyone. :)
12:04timvisherzakwilson: 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:04ro_sti 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:04zakwilsonI 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:05ro_stalready using magit in emacs as well. feels completely natural
12:05mprenticemagit is pretty great
12:05foxdonutjust watched a quick video to see what paredit's about: http://www.youtube.com/watch?v=hiwEm88xaxM
12:06foxdonutit'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:06mprenticei remapped paredit to make more sense to me. { } to spit back and forward respectively, ( ) to gobble same
12:06RickInGAthanks guys for all these good emacs links.
12:06ro_stfoxdonut: how do i get that completion?!
12:06ro_stthe popup showing the possible symbols to complete to
12:07vijaykiranM-Tab
12:07foxdonut:)
12:07ro_sti have completion, i don't have the displayed list
12:07ro_stnot like he does there
12:08ro_sti get it in a separate buffer - one of my pending annoyances to fix
12:08timvisherro_st: i'm pretty sure that'd be icicles mode
12:08vijaykiranro_st: you mean something like this: https://github.com/overtone/live-coding-emacs
12:08ro_st-beam-
12:08ro_sti love open source
12:09timvisherlooks like it's time to get off of imagemagick and move to pure java
12:09TimMctimvisher: Just because of path? :-(
12:09ro_stok, i have to unplug. upvotes, everyone! later
12:10timvisherTimMc: I've been looking at this on and off for the past week and really haven't gotten any leads
12:10timvisherworks great on my mac
12:10timvisherit's my windows machine that screws up
12:10TimMctimvisher: `which convert` gets you the absolute path though, right?
12:11TimMcAlso, is there a shell=true thing to explore?
12:15timvisherTimMc: in cmd: c:\windows\system32>which convert => c:\windows\system32\convert.exe
12:16timvishercmd: c:\windows>which convert => c:\...ImageMagick...\convert.exe
12:16timvisherin clojure i can only get which to report the imagemagick path
12:16timvisherand i can only appear to find the convert path when executing as the firstargument
12:16timvisherfirst argument*
12:17timvisherand `pwd` reports the directory i ran lein from
12:17timvisher^_^
12:17timvisherand opening a new CMD shell automatically starts in c:\windows\system32
12:21nDuff...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:22timvishernDuff: i'm aware of that, but i don't actually want to change my working directory
12:22timvisherunless my working directory turns out to be c:/windows/system32
12:22timvisherin which case i might care very much to change out of that ;)
12:23dnolendherman: ping
12:23dhermanpong
12:23timvisherbasically, 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:23TimMctimvisher: Change out of the default, run which, then you have the correct path, right?
12:23dnolendherman: so was there ever any ES discussion about ctors with only final fields?
12:23TimMc(I'm in problem-solving mode, not debugging mode.)
12:24TimMcThen you can use the absolute path in future shell-outs.
12:24dhermandnolen: saw your tweet... not quite sure what you mean by "final" here
12:24dhermancan't be shadowed by prototype extension?
12:24dhermanimmutable?
12:24dnolendherman: property which can only be set in the cnostructur and never again.
12:24timvisherI believe I could chop off the end of :out and that should give me the full path to convert
12:24dnolenoops ctor
12:26timvisher(sh (.trim (:out (sh "which" "convert")))) seems to be a fairly interesting option
12:26timvisheralthough i'd still love understanding exactly what is happening here
12:27LeNsTRhttps://github.com/liebke/avout
12:27LeNsTR> Latest commit to the master branch | liebke authored 4 months ago
12:27LeNsTRis it alive?
12:28Bronsamaybe it got stable enough?
12:28dnolendherman: 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:29dnolendherman: then you could safely pass that instance to a Worker - no copying.
12:29LeNsTRlatest version "0.5.3"
12:29LeNsTRnot sure
12:30dnolendherman: I note that Dart has final fields - I suspect over time they'll be able to really run with that.
12:31dhermandnolen: 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:32dnolendherman: it's very different. freeze encourages leaking
12:32gfredericksis (def ^:private foo ...) not how to create a private var...?
12:32S11001001no, it is
12:32TimMcdnolen: Can you call freeze at the end of the constructor?
12:32gfredericksS11001001: it behaves differently from (defn- ...)
12:32dnolenTimMc: still encourages leaking
12:32gfredericksspecifically it gives :tag :private rather than :private true
12:32gfredericksand ns-publics doesn't respect :tag :private
12:32dnolenTimMc: dherman: Java Concurrency in Practice covers this stuff.
12:33S11001001what cloj version?
12:33gfredericksoh 1.2 ew
12:34gfredericksthat's what I get for using `lein repl` outside a project
12:34dnolenvar o = ctor(); concurrentProcess(o); will always work with final fields
12:34dnolenvar o = ctor(); concurrenctProcess(o); Object.freeze(o);
12:34dnolenBOOM
12:34hchi
12:35TimMcdnolen: No, I mean effectively Object.freeze(this) inside the constructor.
12:35dnolenTimMc: won't work
12:35dnolenfunction ctor(...) { concurrentProcess(this); Object.freeze(this); }
12:35dnolenBOOM
12:36dnolenTimMc: the whole reason why deftype and defrecord ctors work the way they do, they eliminate that stuff.
12:37dnolenthey're even better since you can put executable stuff in/around field assignments
12:37dnolencannot I mean
12:38TimMcOK, I guess I'm confused about what concurrentProcess is doing. Setting timeouts that further whack on o?
12:38TimMcerr, "this"?
12:38dnolenTimMc: possibly attempting mutating fields
12:39dnolenattempting to mutate I mean.
12:40dnolendherman: I actually don't see how any of Niko Matsakis Parallel JS could ever really work w/o something like this.
12:42dhermansorry, back. reading backscroll
12:43dhermandnolen: what you're talking about has the exact same problem
12:43dnolendherman: it does not
12:43dhermanfunction C() { concurrentProcess(this); this.foo = 12 }
12:43dhermanBOOM
12:43dnolendherman: only field assignment
12:43dnolenin ctor
12:44dnolendherman: better if it's just implicit, like a tuple type.
12:44dhermandnolen: ok, so yeah, with sufficient restrictions you can have something that is immutable on construction
12:44dhermanthere are many options in the design space
12:44dnolendherman: Type(a, b c). No executable body.
12:44dhermanand yes, we have talked about that kind of thing, though not exactly as you're describing it
12:45dhermanbut, PJS does not need any of that
12:45dhermanPJS is a very different approach
12:45dnolendherman: I recall Niko saying he didn't have a solution for sharing data at all.
12:45dhermanhe would not have said that :)
12:45dhermangiven that PJS is *all about* sharing data
12:46dhermanPJS is a dynamic approach to enforcing no shared writes -- basically, write barriers
12:46dhermandynamically guard against writing to shared data
12:46dhermanso reads are cheap
12:46dhermanand writes are fail-fast
12:47dnolendherman: so the runtime checks are really that small?
12:47dhermanwe don't know yet, 's why it's research :)
12:47dhermanbut our memory architecture is a pretty nice fit for it
12:48dhermanwe have memory "compartments" that have mechanisms for installing automatic proxies between one another
12:48dhermanwe have an intern just starting this week to work on implementation
12:48dhermanso we'll see how it goes
12:48dhermannote that reads are cheap, though
12:49dhermanthey don't require any guards
12:49dnolendherman: gotcha. Though it seems you could just avoid research and provide immutable non-executable ctors :) but that does sound interesting.
12:50metajackWith 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:50dnolendherman: 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:55dnolendherman: so you think PJS would work with persistent data structures, essentially nested arrays?
13:03TimMcdnolen: Under what circumstances would the CLJS compiler produce a constructor containing concurrent code?
13:03brainproxydnolen: 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:03jhultenHow do people decide between atoms, refs, etc? Is there common understanding of what is best to use where?
13:03dnolenTimMc: it would not
13:03jhultenbrainproxy: His 'Simple made Easy' talk rocked my world.
13:04dnolenbrainproxy: yep, mostly talking about nerdy details of the CLJS complier.
13:04brainproxyjhulten: yeah, mine too, really enjoyed it
13:04technomancyjhulten: it basically comes down to whether you need consistency among multiple threads
13:04TimMcdnolen: So I fail to see the problem with using freeze -- except you said something about penalization.
13:05jhultenAtoms lock across threads and refs use STM? Ref changes can be reordered?
13:05dnolenTimMc: yes, yes - we'd be ok with Object.freeze if engines don't hurt us for it.
13:05TimMcAtoms are always uncoordinated (independent of each other.)
13:05TimMcdnolen: Gotcha, thanks.
13:06jhultenAh. So if you need to change two things in concert you use refs?
13:06nDuffjhulten: yes
13:06TimMcjhulten: Right. Or change one thing based on the current value of another.
13:06technomancyjhulten: if it's important that each thread gets a consistent view of the world
13:06brainproxydnolen: 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:06jhultenThinking on a clojure based statsd as a learning project.
13:07ibdknoxwoah.
13:08ibdknoxMatt Mullenweg just kicked in 10k
13:08nDuffjhulten: ...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:08dhermandnolen: 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:08timvisheribdknox: whoo!
13:09rplevyjhulten: atom is by far the most common way of dealing with state, refs are only needed for those things discussed above.
13:09technomancyjhulten: you might be interested in https://github.com/heroku/pulse
13:09dhermandnolen: and also b/c shallow immutability is still not a guarantee of deep immutability
13:09TimMcI still haven't had to use an agent.
13:09timvisheri 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:09rplevyTimMc: I have used agents, but it almost always ends up being future that makes more sense
13:09brainproxydnolen: 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:10timvisheri think people would even still be willing to pay to have that sort of work done, as pointed out by technomancy
13:10TimMcBecause elisp. :-P
13:10dnolenbrainproxy: not that I'm aware of.
13:10rplevytimvisher: because ibdknox is vi-user (troll)
13:10TimMcrplevy: Oy! Come to BAZNEX tomorrow!
13:10technomancyI doubt you could get USD200k+ for implementing it in Emacs
13:11rplevyTimMc: I live in Vermont now, dude ;)
13:11brainproxydnolen: 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:11timvishertechnomancy: i wonder if there would be less work to do though? probably not
13:11TimMcrplevy: Vermont is no excuse!
13:11technomancythere would be much less work to do
13:11brainproxyin which case I could then compile compiler.clj down to standalone javascript
13:11ibdknoxI highly doubt that
13:11timvisheri'm not familiar enough with what the demos are being written in
13:11dnolendherman: hmm, why are mutable prototypes a problem? seems like worrying about people doing the wrong thing?
13:11technomancyif you based it on the xembed branch of emacs anyway; since you can embed webkit
13:12ibdknoxstarting from emacs means I can never break away from any of the things it did wrong
13:12dhermandnolen: aren't your data structures deeply immutable?
13:12dhermanI mean, how do you avoid data races?
13:12technomancyif you had to make it work with the current trunk version it would be hard
13:12brainproxyit 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:12timvisheri 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:12dnolendherman: they are.
13:12ibdknoxI think do things as I showed
13:12ibdknoxwould take far longer starting from emacs
13:13dhermanso...?
13:13ibdknoxyou'd end up with a better base editor certainly
13:13timvisheribdknox: good enough :)
13:13ibdknoxat least in the near term
13:13TimMcibdknox: Maybe you can embed emacs for the editing. :-P
13:13ibdknoxTimMc: it's a thought
13:13ibdknoxnot going to worry about it anytime soon
13:13TimMcGood.
13:14timvisheri 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:14timvisheralso, didn't you mention at some point that the underlying tech supports different editor modes?
13:14foxdonutibdknox: "...I also advise and invest in startups through my company Audrey Capital."
13:14dnolendherman: I don't follow ... like being worried that somebody will change prototype underneath you?
13:14timvisheryou wouldn't get the lispy extension of emacs, but you could at least get it's keybindings
13:15rplevyTimMc: codemirror is pretty cool, someone should make a codemirror-like thing that is full emacs maybe
13:16TimMctimvisher: Presumably it would Clojure-scriptable at the very least.
13:16foxdonutibdknox: that is awesome. you might have to up the number of 10k slots available before the 10 days are up!
13:16rplevyexcept it would be clojurescript instead of elisp hehe
13:17timvisheryou wouldn't hear any arguments from me if you could get clojurescript to be the extension language of my editor. :)
13:17technomancytimvisher: how about for extending your desktop? =)
13:17p_lwell, elisp seems easier to get a runtime running...
13:18timvisheroh come now, you know i've though over and over of getting an emacs written in clojure!
13:18dnolenbrainproxy: wasn't following closely enough - somebody needs to port more of the Clojure reader before bootstrapping is possible.
13:18technomancyno, I mean gnome
13:18timvisherlol, i know
13:18timvisherold emacs joke
13:18dnolenbrainproxy: I'd also be concerned about performance of the compiler - CLJ on JVM highly tuned - CLJS perf work still in progress.
13:19technomancy=)
13:19rplevyLightTable 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:19brainproxydnolen: point taken
13:19timvisherdo have something like that running? or are we dreaming of a lisp machine?
13:19technomancytimvisher: I have hello world, but I don't have the repl hooked up yet
13:19timvishercljsmacs, maybe?
13:19brainproxydnolen: so basically I'd run into issues where I needed support from cljs.reader that just isn't there yet?
13:19timvisherwoah! publishing that any time soon?
13:19technomancytimvisher: https://github.com/technomancy/lein-gnome
13:19timvisherthat might be reason to finally kick my Apple habbit
13:20rplevytimvisher: just emajin
13:20dnolenbrainproxy: yes it's not there.
13:20dnolenbrainproxy: compiler.clj would also need to change - very Java reader result type centric ATM
13:20brainproxydnolen: 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:20brainproxyi.e. because I don't have to spin up the jvm every time
13:21timvisherwell boy oh boy. now i'm fairly sure that technomancy is an alien too
13:21timvisherlol
13:21brainproxy*now that..
13:21timvisheri don't how you all do it
13:21dhermandnolen: 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:21dnolenbrainproxy: yeah, compiler is not slow - but booting JVM, compiling CLJS is killer.
13:23rplevytechnomancy: 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:24technomancyUnity makes me sad just because of how divisive it is.
13:24rplevyironic too...
13:24technomancygnome could be so much better if all this effort wasn't being poured into duplicating its features in unity.
13:24technomancybut gnome will win in the long run because of its extension mechanism
13:24technomancyit will just take longer
13:25gtrakkde is freaking great now
13:25technomancydoes it have a repl? =)
13:26gtrakhmm, well I have enough things to mess with, honestly :-)
13:27gtrakhttp://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/GettingStarted
13:27glitch99Is there a way to get at the javadoc statements about a function from the REPL?
13:28glitch99AH (doc <func>) - sorry that was too easy
13:29gtrakI 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:30technomancygtrak: yeah, but that's easy to fix with an extension
13:30technomancyit's all just JS
13:30technomancyruntime-modifiable
13:30beffbernardtechnomancy: 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:31beffbernardtechnomancy: oops.. looks like that was premature.. obv it was all my doing.. closing the connection too soon
13:32clojure-newcomerHi 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:32beffbernarddisregard
13:32gtraktechnomancy: 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:33clojure-newcomerThe result is from clojure.java.jdbc with-query-results
13:33technomancygtrak: it doesn't really matter what their opinions are; it matters that they provide a good foundation and reasonable abstractions to build upon.
13:33gtraktechnomancy: I know you're interested in doing some stuff with that, I'll definitely check it out :-)
13:33rplevygtrak: I agree, so many aspects of the UI are just complete WTF I can't believe they shipped this...
13:34dnolendherman: yeah, I suppose that would be less of a real issue if you could control field visibility.
13:34rplevybut if I can customize it al in ClojureScript....
13:34technomancyrplevy: try it! =)
13:34TimMctechnomancy: It matters that they don't seem to do user testing.
13:34p_lgtrak: GNOME lost the sight of what they were doing somewhere around 2.4
13:34dhermandnolen: 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:34technomancyTimMc: it matters if you're going to use unmodified gnome
13:34dhermandnolen: 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:35rplevytechnomancy: I definitely will, it sounds awesome!
13:35technomancyTimMc: Emacs still ships with ido-mode off by default for crying out loud.
13:35dnolendherman: :)
13:35technomancyTimMc: that kind of problem is easy to fix if you know what you're doing
13:35TimMctechnomancy: I'm customization-shy these days. THings break too quickly due to upgrades.
13:35TimMcI still do it, but I don't like to rely on it.
13:35gtrakI 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:36technomancygtrak: I actually think light table would be an interesting base for a browser
13:36TimMcyo dawg
13:36gtraksure, but things will settle on some local maxima, and it's hard to go against the grain as a normal user
13:37technomancy"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:37technomancyShaw had it right
13:37TimMcI'm pretty damn unreasonable, but I have other work to do.
13:38gtrakI agree with TimMc :-)
13:38technomancyyou guys are no fun =(
13:38ibdknoxlol
13:38ibdknoxgtrak: DE?
13:38ibdknoxdevelopment env?
13:38TimMcDesktop Env
13:38gtrakwindow manager?
13:38ibdknoxah
13:38gtrakwhy not?
13:39ibdknoxI sort of think of it that way to be honest, but the answer to "why not" is time
13:39gtrakright
13:39technomancygjs can control X =)
13:39ibdknoxI also think we need to get one thing really, really right first
13:40ibdknoxif that happens, who knows what people will do with it :)
13:40dnolendherman: 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:41technomancytiling window manager in javascript: https://github.com/gfxmonk/shellshape
13:42gtrakI think it'd be lovely to run some kitchen-sink environment like emacs or LT as a window manager
13:43gtrakif you're a developer, I mean..
13:44technomancyyeah, I'm all for reducing the number of programs you use that you don't have direct control over
13:46TimMcDynamic langs make that easier.
13:46sjlsince contrib is gone, what should I use to replace dissoc-in ?
13:46TimMcsjl: update-in with dissoc
13:46sjlick
13:46sjlthat won't clear out the intermediate empty lists though, right?
13:47technomancyTimMc: I think that's a red herring.
13:47technomancyTimMc: interactive languages make it easier. dynamic languages historically have had the edge on interactivity.
13:48technomancybut I don't think there's anything intrinsic to the typing discipline.
13:49foxdonuttechnomancy: do you use shellshape? the demo looks pretty good.
13:51technomancyfoxdonut: no, I'm not on 3.4 yet. Just good to see it's possible
13:53foxdonuttechnomancy: indeed.
13:53TimMctechnomancy: You're right, interactive is what I really mean.
13:53TimMcInterpreted/compiled on-the-fly langs too.
13:54technomancyyeah, languages that compile directly to machine code seem to have a harder time with seamless interactivity
13:54TimMc...which I would call a slightly different concept.
13:54technomancyit's easier to do on a VM/interpreter, but that's not required
13:55technomancyIIRC haskell's interactive compiler has subtle differences vs the mainline one
13:55hiredmantechnomancy: that may have more to do with immutability of top level references
13:55gtrakthe whole java stack and how we abuse it is pretty bizarre but awesome, when you think about it
13:56hiredmanand issues with redefining types
13:56technomancyhiredman: that would make sense
13:57brainproxywoohoo, strange loop ticket acquired :)
13:57technomancywould be interesting to see how the straight-to-C schemes do it
13:57technomancyif they do in fact do it
13:57brainproxyany other #clojure folks will be attending?
13:57gtrakbrainproxy: duh :-)
13:57dnolenbrainproxy: a lot :)
13:58brainproxyI actually live in St. Louis, so it's just down the street for me
13:58brainproxyalmost literally
13:58brainproxyabout 2 miles :D
13:58hiredmantechnomancy: direct memory access is pretty much the definition of "mutable global reference"
13:59jlongsterdnolen: I will see you at Strange Loop as well :)
13:59devnoh shite. i need a strange loop ticket.
13:59foxdonut*sigh* wish I could go to these things. :_(
13:59dnolenjlongster: cool! I look forward to more Lisp conversation :)
13:59technomancyhiredman: heh; sure
14:00Borkdudedevn: cool
14:00jlongsterdnolen: me too!
14:00imami|afkhey technomancy
14:01technomancyohai
14:05kmicuwhether val,key, int, etc... fns are implemented in the latest version of clojurescript? Where I can find such an info?
14:06dnolenkmicu: at the moment no better documentation than the source really.
14:08kmicudnolen: thx
14:09brainproxyi'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:10Borkdudewhat is the leading repo of clojurescript, I assume https://github.com/clojure/clojurescript ?
14:10brainproxyBorkdude: yeah, thats the one
14:10Borkdudeit has a "forked from … " message on the top, but that one doesn't even exist anymore
14:11rplevyhow would I configure lein to always run clean? would I use the prep-tasks feature for this?
14:11brainproxyah, right ... you can safely ignore that i think, all the official commits go to clojure/clojurescript
14:11technomancyrplevy: in 2.x, yeah
14:11technomancy:prep-tasks ["clean"]
14:11technomancyrplevy: more interested in why you need it though
14:12rplevywell, I have run into problems with tests passing, running lein clean, and then seeing tests fail (as they should)
14:13dnolenBorkdude: that's the official repo
14:16S11001001rplevy: you aren't overusing macros are you?
14:17S11001001&aot
14:17lazybotjava.lang.RuntimeException: Unable to resolve symbol: aot in this context
14:17S11001001no
14:17rplevyS11001001: only using them appropriately haha
14:18S11001001so not at all in the aot case then
14:18rplevyS11001001: need AOT though
14:18S11001001welp
14:18S11001001macros and aot only get together during the holidays, and then always subjecting everyone around to uncomfortable silences
14:19rplevyLOL
14:22S11001001so anyway that's what lein test! is for, yes?
14:22rplevythere should be a lein midje! then
14:22S11001001lein clean, midje
14:23rplevytrue enough
14:23BorkdudeS11001001: lein test! as in destructive testing?
14:23rplevyor... prep-tasks
14:23rplevyBorkdude: it runs clean and deps
14:23S11001001clean can be annoying, especially if you're repling at the same time
14:24S11001001gets all turned around
14:24Borkdudewrite a script ;)
14:24rplevyBorkdude: I don't want to have to run lein through a script though that is the obvious last resort
14:25S11001001hmm, it would be better to freshly clone the dir and run a build and test out of that
14:27BorkdudeSome programming language tend to use a lot of $ characters, clojure doesn't. it's obviously not interested in money making.
14:28foxdonutBorkdude: the money's in the (tax) brackets!
14:28S11001001rplevy: you missed Jeff talking about Kiln at bos cloj, was pretty good
14:28rplevyis there video?!
14:28rplevythat sounds good
14:28S11001001doubt it
14:28rplevyyou guys should record these things...
14:29S11001001with any luck, we're just getting to the "having regular meetings" stage
14:29rplevynice
14:32robinkI 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:33rplevyS11001001: is Jeff somehow using Kiln at work or is this completely his personal project
14:35S11001001former I think was the implication
14:36Borkduderobink: [org.clojure/clojure "1.5.0-master-SNAPSHOT"] ?
14:37robinkBorkdude: Doesn't find it if I specify it that way.
14:37Borkduderobink: that's because it doesn't exist
14:37wkmanireHowdy folks.
14:37robinkBorkdude: It does on Sonatype's repository. If I include the repository it still fails to resolve.
14:37Borkduderobink: http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.clojure%22%20AND%20a%3A%22clojure%22
14:37Borkduderobink: ah well, I don't know then
14:39raekthe sonatype repo of releases might be different from the repo of snapshots
14:39raekwouldn't be suprised if only the releases repo is used by lein by default
14:40Borkduderobink: when I search here I don't see it: https://repository.sonatype.org/index.html#nexus-search;quick~clojure
14:41TimMcrplevy: Doesn't Vermont have trains?
14:43rplevyTimMc: yeah, do you know how far north Burlington is?
14:43rplevydamn near Canada
14:44TimMcnonsense
14:44rplevybeautiful though, I can see the Adirondacks across the lake from my porch
14:44rplevythis might be off-topic
14:45TimMcOK, maybe a bit closer to Canada.
14:45robinkBorkdude: 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:45rplevyother than as an unpaid advertisment for Clojurers to come work at Draker
14:46S11001001it's clojurian
14:46rplevyaha
14:46BorkdudeS11001001: how do you pronounce clojurian, could you spell it phonetically?
14:46rplevyClojurista
14:46TimMccljer ("kludger")
14:46S11001001like centurion, emphasis on 2nd syllable
14:47BorkdudeS11001001: I was wondering about the j, if it is still pronounces as an s?
14:47S11001001I wouldn't pronounce it as an s in Clojure
14:47S11001001given the other billion things that already means
14:47BorkdudeS11001001: how do you pronounce clojure?
14:47rplevyme neither
14:47S11001001hard J
14:48rplevysame
14:48antares_Borkdude: as in "jurassic"
14:48TimMcI think Rich wants it pronounced like an s, but there's no chance of that.
14:49S11001001honestly have never heard it as "closure", though perhaps I just missed it
14:49rplevyI've heard Rich say it that way
14:49rplevyzh
14:49BorkdudeI always pronounce it as "closure"
14:49S11001001madness
14:49S11001001I'll just assume anyone who says that means the Clozure CL implementation
14:49TimMcOr GClosure
14:50TimMc(Google Closure)
14:50S11001001or the Closure web browser written in CL
14:50BorkdudeClosure means Clojure unless stated otherwise
14:50TimMcNah, too much talk about GClosure in here due to CLJS.
14:50Borkdudegclosure is fine
14:51BorkdudeI had a discussion with some american Dutch people (from America originally) about how to pronounce Clojure
14:51TimMcExcept people often leave off the "G".
14:51Borkdudethey told me: if the author wants it to be pronounced as closure, that's fine
14:51S11001001Nabokovite
14:51TimMcIt's not his choice to make. :-P
14:52Borkdudeso from then on, I just did that
14:52rplevyLolitian?
14:52S11001001it 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:53S11001001in other words, writer-supremacy
14:53Borkdudeclojure with a hard j doesn't sound very nice in Dutch, like calling names
14:53TimMcAs opposed to what I see as the prevailing view these days.
14:53Borkdudenot really, but it just doesn't sound nice
14:53robinkBorkdude: Also: https://oss.sonatype.org/index.html#nexus-search;quick~clojure (oss.sonatype.org, not repository.sonatype.org).
14:53TimMcWhat's that quote? "As the author, you're the least qualified person in this room to discuss what your book means!"
14:54BorkdudeTimMc: so do you agree with Nabokov?
14:54S11001001I should think not
14:54S11001001what being a hard J user and all
14:54p_lTimMc: that's the motto of literature PhDs
14:54pipelinemy english dialect has no difference between a "zh" and "j" sound anyway
14:54rplevydzh = j
14:55rplevydiphthong
14:55pipelinegiven that there are millions of us, "clojure" and "closure" are gonna blur together
14:55Borkdudelol means let over lambda in here right?
14:55rplevyno it means land of lisp
14:55Borkdudeor let over fun?
14:55Borkdudelof
14:55Borkdudelet over fn
14:55foxdonutrplevy: you live near Canada?
14:55rplevyyeah
14:55rplevynot far from Montreal
14:56rplevyBurlington, VT
14:56mfexrobink: use [org.clojure/clojure "1.5.0-alpha1"] or do you need something more recent even?
14:57robinkmfex: I don't currently, just wondering how one would specify "1.5.0-master-SNAPSHOT" as a dependency.
14:57foxdonutrplevy: that's cool. I live in Montreal.
14:57rplevycool, is there a meetup there?
14:57TimMcfoxdonut: Hold a Clojure meetup, maybe rplevy can make it t... damn, beat me to it.
14:57rplevyhehe
14:58foxdonutheh, well we have Bonjure :)
14:58Borkdudeclojure eyes, give me your hand…. total eclipse of the code
14:58rplevyfoxdonut: leiningen will allow if ironic
14:58foxdonuthttp://www.bonjure.org/
14:58rplevyoh it's a thing
14:58rplevynice
14:59ibdknoxdnolen: with cljs master I'm getting the following: clojure.lang.ArityException: Wrong number of args (3) passed to: core$get
14:59ibdknoxdnolen: not happening with any of the releases
14:59dnolenibdknox: looking
15:00ibdknoxdnolen: 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:01dnolenibdknox: yes, a small optimization get's are now inlined to -lookup
15:01ibdknoxah
15:01dnolenibdknox: not sure where that would be coming from tho
15:02dnolenibdknox: did you try cleaning? re-checking out your clojurescript?
15:02foxdonutrplevy: I think many Montrealers drive down to Burlington to fly out for cheaper
15:02ibdknoxdnolen: cleaned, but I'll try cloning the repo again
15:03dnolenibdknox: hmm, oh sorry that looks like an error in the compiler side of things.
15:04ibdknoxcompiler.clj 1407 is where the problem starts apparently
15:05rplevyis Bonjure French-speaking or English?
15:05dnolenibdknox: I think I've spotted it
15:06rplevythe website is in English, and the discussion group too, so...
15:06foxdonutrplevy: either or according to those present :)
15:07rplevycool
15:07foxdonutbasically English is the default not to ever make anyone feel left out
15:07dnolenibdknox: sorry about that, pull latest
15:07dnolenibdknox: let me know if the issue persists
15:08felideonheh Bonjure
15:09ibdknoxdnolen: hm, still getting it
15:10dnolenibdknox: huh, I don't suppose you can isolate the code that causes the problem?
15:12ibdknoxdnolen: 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:14dnolenibdknox: trying re-checking out one more time.
15:14dnolenibdknox: core$get just doesn't make sense to me, that's the alias and it's only used in one place.
15:15dnolenibdknox: it most certainly supports 3 args.
15:16y3diwhere can i see clojurelogs
15:16y3dis/clojurelogs/#clojure logs
15:16dnolenibdknox: if you could paste the entire stacktrace that would be helpful too.
15:17mfexrobink: this worked for me to get 1.5.0-master-SNAPSHOT: https://gist.github.com/2771033
15:17ibdknoxdnolen: 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:17robinkmfex: Thanks! I'll try it out.
15:17uvtcy3di, <http://clojure-log.n01se.net/&gt;
15:17dnolenibdknox: thx
15:19ibdknoxdnolen: https://www.refheap.com/paste/2830
15:19robinkmfex: Works, thank you very much, I'll keep that repository in mind in future.
15:20brainproxydnolen: 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:21dnolenibdknox: in your checkout can you look at src/clj/cljs/core.clj line 253?
15:21dnolenbrainproxy: there is not - and i agree that would be useful.
15:21brainproxymaybe not even something as fancy as clojuredocs, even just a list
15:22ibdknoxdnolen: (-dissoc! [tcoll key])
15:22y3dithanks uvtc
15:22dnolenibdknox: that's not the right file, not core.cljs
15:22antares_Just released Welle 1.0: https://twitter.com/clojurewerkz/status/205013459379818499 (more at http://clojureriak.info)
15:22ibdknoxoh sorry
15:22dnolenibdknox: the macros file, same directory as compiler.clj
15:23ibdknoxdnolen: https://www.refheap.com/paste/2831
15:23dnolenibdknox: do you see why I think that error is bizarre?
15:23ibdknoxhaha yes
15:23dnolenibdknox: there's the 3 argument case right there.
15:24Raynesibdknox: It'd be cool to have a clojure stacktrace pygments lexer.
15:24RaynesOne that did things like clj-stacktrace.
15:24ibdknoxRaynes: that would be neat
15:24dnolenibdknox: if that didn't work I would have seen errors myself when running the tests.
15:24RaynesBut I'll be damned if I plan on writing the Python to do it.
15:25amalloydnolen: related to the implicit &env, &form arguments?
15:25dnolenamalloy: how?
15:25dnolenamalloy: and if that was true, why aren't the other multiarity macros affected?
15:26amalloyoccasionally i've seen "incorrect" error messages about wrong number of args to macros
15:26amalloylike a three-arg macro being "omg i can't handle three args" because really it wants five
15:27dnolenamalloy: again I could believe that if +, -, etc didn't all work.
15:27amalloy*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:28dnolenibdknox: what version of Clojure are you running? 1.4.0?
15:28ibdknoxdnolen: yeah
15:28amalloybut suppose someone were calling (get x) - that *should* fail, and you might get this error message
15:28dnolenamalloy: oh huh that's probably it.
15:28TimMcSneaky.
15:28dnolenibdknox: look for (get x)
15:29dnolenibdknox: a typo in your own code
15:29ibdknoxlooking
15:29dnolenibdknox: wouldn't have come before
15:29amalloyright. an error in ibdknox's code that would be at runtime before, but is macro-time now
15:29ibdknoxthere are no runtime errors
15:30ibdknoxif I move off to the latest release everything is fine
15:30amalloyibdknox: if you never call the function there wouldn't be
15:30ibdknoxmm
15:30ibdknoxtrue
15:30ibdknoxwait
15:30ibdknoxcould it be that it's no longer respecting if I exclude get?
15:31ibdknoxdnolen: ^
15:31amalloyprobably
15:31dnolenibdknox: actually I just verified I get the same error if I write (fn [x] (get x))
15:31brainproxydnolen: 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:31ibdknoxamalloy: I bet that's what it is then
15:31dnolenbrainproxy: I have though I don't find such projects (adding a concurrency layer) that interesting.
15:32ibdknoxdnolen: that's it
15:32ibdknoxdnolen: you can no longer name something get
15:32amalloydnolen: 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:32dnolenamalloy: there is not such thing as :inline metadata, nor is it necessary.
15:33brainproxydnolen: you think the concepts are too limiting? not that helpful?
15:33dnolenibdknox: were you excluding get?
15:33ibdknoxyep
15:33dnolenbrainproxy: performance mostly.
15:33amalloyoh, really? i guess the feature's nonexistence would be a good reason not to use it
15:34dnolenamalloy: you just don't need it, compiler macros do what :inline did
15:34dnolenibdknox: can you paste your ns declaration? excluding macros is closed ticket
15:35ibdknoxmm
15:35amalloyi 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:35dnolenamalloy: yes
15:36ibdknoxdnolen: https://www.refheap.com/paste/2833
15:37brainproxydnolen: 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:37dnolenbrainproxy: that sounds interesting :)
15:38dnolenibdknox: hmm at the REPL that exclude w/ (get x) compiles fine
15:38brainproxydnolen: i think so.. will let you know if/when I have any luck w/ it
15:38ibdknoxdnolen: it was fixed by just changing the name from get
15:39dnolenibdknox: do you have multiple :requires, :refer-clojure, :uses etc ?
15:39ibdknoxdnolen: nope, that's the whole ns
15:39ibdknoxvery simple one
15:39ibdknoxdnolen: here's the file https://www.refheap.com/paste/2834
15:40pepijndevosamalloy: ohnoes, huggle is broken in lazybot.
15:41dnolenibdknox: why does it say clojure.core/get ? is that a typo?
15:42ibdknoxhah
15:42ibdknoxthat is
15:42amalloyhah, neue
15:43amalloyyou know you can just use new there, right?
15:43ibdknoxdnolen: switching to cljs.core/get doesn't fix it
15:43ibdknoxamalloy: habit
15:43ibdknoxamalloy: so used to not being able to name things new :)
15:43amalloyi like the spelling though. it's a cute workaround
15:44Borkdudeibdknox: german roots?
15:44ibdknoxBorkdude: stimmt
15:44dnolenibdknox: can you do me a favor
15:44ibdknoxBorkdude: though it works nicely with Helvetica Neue and such too
15:44dnolenibdknox: compile a project with just that file.
15:44ibdknoxsure
15:47ibdknoxdnolen: blows up with the same stacktrace
15:49drguildohas anyone else used seesaw?
15:49dnolenibdknox: checking it out here
15:50drguildooops
15:50drguildosorry!
15:50dnolenibdknox: hmm ... it successfully compiles
15:50drguildoi didn't think it'd spit it out here
15:51pepijndevosRaynes: Y U remove good stufz? https://github.com/flatland/lazybot/commit/9f3629b6abd84ab8c65ee978ecc08d305f743077
15:51dnolenibdknox: it definitely did not work for you in a project by itself?
15:51raekdrguildo: if you have a question, just go ahead and ask it
15:51ibdknoxdnolen: yeah, that was the only cljs file in it
15:52Raynespepijndevos: Bahaha.
15:52Bronsaare you sure you are both using the same clojurescript version? :)
15:52Raynespepijndevos: A lot of those were vulgar test commands from the early days of lazybot.
15:52pepijndevos$guards
15:52lazybotSEIZE HIM!
15:52drguildoi'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:52ibdknoxBronsa: both on master
15:52amalloyalso a lot of them didn't work at all
15:53amalloylike balance. really
15:53Raynesamalloy: No, they all worked.
15:53drguildocrap being other libraries
15:53amalloywell okay, by "a lot" i meant one
15:53Raynesamalloy: 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:54emezeskedrguildo: Your jar file, or your uberjar file?
15:54drguildoalso loading the resulting program takes ages
15:54drguildoemezeske, uberjar
15:54pepijndevosRaynes: Maybe I can reintroduce them by the weird x is y syntax?
15:54ibdknoxdnolen: maybe it's the way I'm including master?
15:54Raynespepijndevos: You mean the whatis plugin?
15:54ibdknoxdnolen: I'm just doing the extra-classpaths thing
15:54emezeskedrguildo: Of course that's going to be big, it contains all the dependencies for your entire project, including dependencies of dependencies, etc
15:55Raynespepijndevos: 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:55drguildoemezeske, so what are my options? i want to be able to run it standalone with as little unused/unneeded stuff as possible.
15:56drguildoemezeske, and that also doesn't explain why programs built with seesaw are so slow
15:56dnolen_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:56emezeskedrguildo: Well I can't speak for seesaw's performance.
15:56emezeskedrguildo: If you want a smaller uberjar, I guess have less dependencies?
15:57drguildoemezeske, i only depend on seesaw; i wouldn't be surprised if i depended on all the other stuff
15:57pepijndevosRaynes: I mean this one ???
15:57lazybotpepijndevos: How could that be wrong?
15:57emezeskedrguildo: You can see what seesaw depends on here: https://github.com/daveray/seesaw/blob/develop/project.clj
15:58emezeskedrguildo: Of course, any of its deps might have their own deps and so on
15:58drguildoemezeske, i guess it's just bloated
15:58Raynespepijndevos: That's completely random. No x is y.
15:58pepijndevosok
15:58drguildothey include the kitchen sink when i just want a more clojurey way of using swing
15:59raekdrguildo: ahead of time compiling your application should reduce the start up time greatly
15:59pepijndevosdrguildo: Yea... I think there should be a Object.toSwing protocol, just data as code, code as data, etc...
16:00drguildoraek, 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:00ibdknoxdnolen_: that seems to have worked
16:01raekdrguildo: is there noticeable performance degradation after it has started up?
16:01dnolen_ibdknox: I'd like to isolate what's different between my project and your project.
16:01drguildoraek, kinda impossible to tell because it's just a jlabel embedded in the main jframe
16:01raekdrguildo: clojure is always slow to start up without aot, basically
16:02raeksince you compile all code at startup
16:02dnolen_ibdknox: are you not using lein-cljsbuild? some custom build process here?
16:02ibdknoxdnolen_: yeah using noir.cljs
16:02ibdknoxdnolen_: one sec
16:02raekdrguildo: have you tried enabling aot compilation?
16:02drguildoraek, like i say, direct calls to swing using clojure are fine, seesaw is slow as hell compiling and running
16:03drguildoraek, nope
16:04drguildowouldn't lein uberjar compile the clojure code anyway?
16:04raekno
16:05ibdknoxdnolen_: it must be something to do with the difference in the way the classpath is set up
16:05ibdknoxnot sure how that could be true though
16:06uvtc,(def m {:a 1 :b 2}) (type m)
16:06clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
16:06uvtc,(def m {:a 1 :b 2}) (println (type m))
16:06clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
16:06uvtc&(def m {:a 1 :b 2}) (println (type m))
16:06lazybotjava.lang.SecurityException: You tripped the alarm! def is bad!
16:06ibdknoxdnolen_: either way, this issue is on my end
16:06dnolen_ibdknox: hmm I don't think so. you could only see that error if somehow that :excludes information was discarded before compilation.
16:06uvtc&(println (type {:a 1 :b 2}))
16:06lazybot⇒ clojure.lang.PersistentArrayMap nil
16:06ibdknoxdnolen_: oh
16:06drguildoare there any good clojure gui/swing libraries?
16:06uvtcWhy is that an array map, and not a hash map?
16:06dnolen_ibdknox: before expanding any macros we check to make sure that the macro hasn't been excluded.
16:07dnolen_ibdknox: it could only fail if something is messing around with cljs.compiler/namespaces atom
16:07ibdknoxdnolen_: not touching it
16:07emezeskeuvtc: I think because it's very small.
16:08Raynesdrguildo: https://github.com/daveray/seesaw
16:08emezeskeuvtc: I'm not sure where the threshold is, but smaller maps are created as ArrayMap and larger ones as HashMap
16:08uvtcemezeske, Interesting. Will experiment. Thanks!
16:08Bronsauvtc maps with more than 8 elements should be hash-maps
16:08drguildoRaynes, seesaw is slow and bloated
16:08emezeske&(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:08lazybot⇒ clojure.lang.PersistentHashMap
16:08emezeskeuvtc: ^
16:09Raynes...okay.
16:09RaynesIn that case, I guess not. :\
16:09uvtcemezeske, Ah, ok. Thanks guys (emezeske, Bronsa )
16:10help_pleasehi. 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:10drguildohttps://github.com/stathissideris/clarity
16:11Raynesdrguildo: Have you talked to daveray about your problems though? Opened issues on Github?
16:12drguildoRaynes, nope, i'm not sure how constructive my criticism would be
16:12gtrakdrguildo: you might learn something useful if you dig into it
16:12uvtcdrguildo, if the apps are just for Gnome, I recently heard about this: https://github.com/technomancy/lein-gnome
16:13drguildouvtc, i'm using windows and wouldn't want to do platform specific stuff anyway
16:13dnolen_ibdknox: I may have a fix for you ... one second
16:14uvtcdrguildo, how about using clojurescript and creating your app in the GUI? (sorry if that's already been suggested...)
16:15drguildouvtc, haven't really thought about it
16:16uvtcdrguildo, Aack! typo: s/GUI/browser/. Sorry. :)
16:19dnolen_ibdknox: try master now
16:33brainproxyanybody 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:35muhoois it true that ` is exactly equivalent to (comp list quote) ?
16:36gtrakbrainproxy: 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:36S11001001muhoo: no, 1st quote's not a function
16:38muhoowell then to (list (quote)), no way to comp macros,
16:38muhooor special forms. i'm just trying to understand what it *does*
16:38gtrakby morphology I mean erode/dilate
16:39aperiodicbrainproxy: andy fingerhut is the guy who puts it together; you could shoot him an email
16:39muhooseems like ` behaves the same as (list (quote ...)), but i might be oversimplifying
16:40brainproxyaperiodic: sweet thanks
16:40brainproxygtrak: sounds complicated :o
16:41mebaran151I'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:42amalloymuhoo: 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:43mebaran151muhoo: 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:45muhooamalloy: thanks, i'm just kind of thrashing around trying to understand stuff.
16:46muhoomebaran151: thanks, that looks good
16:46brainproxydnolen_: 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:46dnolen_brainproxy: is that different than this? http://himera.herokuapp.com/index.html
16:47muhooahh. that makes more sense. it's quote with full qualification
16:48TimMcmuhoo: And the possiblity of unquoting.
16:50brainproxydnolen_: nope .. had forgotten about that, though I have made frequent reference to himera's "synonyms" page
16:59uvtcI 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:59uvtcIt had the same styling as what's currently at http://himera.herokuapp.com/index.html .
17:01mebaran151hey 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:05uvtcAh ha! Found it: <http://himera.herokuapp.com/synonym.html&gt;
17:06dnolen_nice latest WebKit's support drawing without smoothing.
17:10jtoyfrom inside of a method, can I know the name of the method I am in?
17:11gtrakjtoy: why?
17:11gtrakmethods don't have names, vars do?
17:11jtoyi guess i need to use a macro for that
17:11joegalloyou mean in a proper java method? or were you speaking loosely about clojure functions?
17:12jtoyjoegallo: clojure function
17:13TimMcgtrak: Fns have names too!
17:13TimMcOr they can, at least.
17:13gtrakyea, just saw that, though I've never used it for anything
17:13jtoyi want do to this? (defn mymethod (log nameofthismethod))
17:13TimMcIt's useful for general recursion.
17:13jtoyand i want to add the (log nameofthismethod) into a bunch of methods without having to type the actual name of the method
17:14TimMcjtoy: This is for debugging, yeah?
17:14jtoyno, for logging some data
17:16gtrak&(.getClass (fn inscrutable [] (+ 1 2)))
17:16lazybot⇒ sandbox7529$eval10218$inscrutable__10223
17:17jtoygtrak: can I do that from inside inscrutable though?
17:17gtrakhmm, probably?
17:17jtoyhow, what would I pass to .getClass ?
17:18gtrakyou might have to have it close over itself
17:18TimMc&(((fn foooo [] (fn baaaar [] (.getClass #())))))
17:18lazybot⇒ sandbox7529$eval10258$foooo__10259$baaaar__10260$fn__10265
17:18gtrakoh yea, that works
17:18jtoywhat is #() ?
17:19gtrak&(fn inscrutable [] (.getClass inscrutable))
17:19lazybot⇒ #<sandbox7529$eval10280$inscrutable__10281 sandbox7529$eval10280$inscrutable__10281@45a218>
17:19jtoy&(#())
17:19lazybot⇒ ()
17:19amalloy,'#()
17:19clojurebot(fn* [] ())
17:19TimMcjtoy: It's the fastest way of getting a function you don't care about.
17:20TimMcs/getting/defining/
17:20tmciverTimMc: don't you care about *all* your functions? :)
17:26gtrakthough if you're referencing it by a symbol, you could just give back the name of the symbol..
17:27gtrak&(fn inscrutable [] (name inscrutable))
17:27lazybot⇒ #<sandbox7529$eval10319$inscrutable__10320 sandbox7529$eval10319$inscrutable__10320@14ed89a>
17:27gtrak&(fn inscrutable [] (name 'inscrutable))
17:27lazybot⇒ #<sandbox7529$eval10328$inscrutable__10329 sandbox7529$eval10328$inscrutable__10329@d40bb0>
17:27gtrak&(fn inscrutable [] (symbol inscrutable))
17:27lazybot⇒ #<sandbox7529$eval10344$inscrutable__10345 sandbox7529$eval10344$inscrutable__10345@8c7267>
17:27gtrakgrr!
17:28emezeske&((fn inscrutable [] (name 'inscrutable)))
17:28lazybot⇒ "inscrutable"
17:28muhoointeresting, lazybot doesn't allow (defn foo [] ) but it allows (fn foo [] ) ?
17:28emezeske&(name 'inscrutable)
17:28lazybot⇒ "inscrutable"
17:28emezeskemuhoo: lazybot doesn't let you def things
17:28brehautlazybot doesnt allow def (because it lets you munge a shared resource)
17:29gtrakemezeske: oh, duh
17:30emezeskegtrak: ^_^
17:32nDuff...it would, at least, prevent the restrictions on def and such from being needed.
17:32muhoowhat about startup time?
17:33muhoooh, copy, got it.
17:33nDuffmuhoo: 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:35gtrak&((fn inscrutable [] (.getClass inscrutable)))
17:35lazybot⇒ sandbox7529$eval10369$inscrutable__10370
17:37drguildohas anyone used proguard on a clojure jar?
17:37muhoodrguildo: i think the clojure android guys have
17:37drguildoi'm getting a ExceptionInInitializerError
17:38muhootime to get back to more practical work. like soon.
17:39mwillhiteanyone familiar with clj-time?
17:39emezeskemuhoo: 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:39mwillhiteIt seems from-sql-date should be in the 0.4.2 release, but clojure throws up on it
17:40joegallomwillhite: perhaps if you ask your question, then people who can answer it will pipe up
17:40joegallobeat me to it :)
17:40emezeskemuhoo: 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:40dnolenibdknox: did you get to try master?
17:41mwillhite:)
17:41mwillhitestill always good advice
17:41michaelr`so is hiccup relatively slow or i'm doing something bad in my code?
17:42emezeskemichaelr`: I've found hiccup to be very fast myself (although our use cases could differ)
17:42dnolenfrom O'Reilly themselves on CLJS book - https://twitter.com/oreillymedia/status/205006393604976641
17:42mwillhitewhen I try including that function like this in my namespace (ns ... (:use [clj-time.coerce :only (from-sql-data)])
17:42RaynesSo there is going to be a ClojureScript book?
17:42mwillhiteI get the following error: CompilerException java.lang.RuntimeException: Unable to resolve symbol: from-sql-date in this context, compiling:(NO_SOURCE_PATH:1)
17:42RaynesAlready?
17:42mwillhiteany ideas?
17:43hiredmanmichaelr`: 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:43mwillhitethe change was committed prior to the latest push to clojars
17:43michaelr`hmm
17:44michaelr`we have to go deeper ;)
17:49dnolenRaynes: why not? I wonder who's working on it
17:49Raynesdnolen: Because it's way, way, way too much of a moving target.
17:49RaynesWhat is our currently release? 0.2?
17:50dnolenRaynes: stuff underneath is moving, not the external api.
17:50Raynes*shrug*
17:51mebaran151michaelr`: I've found hiccup a lot faster than the old erb snippets I was used to
17:56rplevyit
17:56rplevyit is very odd that they would not have publically announced it
17:56rplevyan Aug 2012 release?
17:57rplevyand a twitter response as first mention?
17:57rplevymaybe a viral marketing technique haha
17:57fil512question for you smart people
17:58fil512testing, namespace, privacy
17:58rplevywhoever is working on it is being very secretive too, weird
17:58fil512to encapsulate, I want to use defn-
17:58fil512To keep ns clean, I put my tests in a seeparate namespace
17:58fil512And I use "use" to import the functions under test
17:58gtrakfil512: you know defn- doesn't really protect anything right?
17:59fil512But now how do I test the "private" methods?
17:59gtrak(#'ns/function args)
17:59fil512When I tried to call a "defn-" function, I got an IllegalStateException
18:00fil512Is that how most ppl write tests?
18:00gtrakfil512: you can get to the var and call it from there
18:00Chousukeonly for defn- functions I suppose
18:00rplevyfil512: there's a great idea in Joy of Clojure
18:00rplevycreate an impl ns
18:00rplevythe chapter with that in it is one of the free ones if you don't have the book but I recommend the book
18:00fil512I have the book
18:01fil512I just discovered defn- from reading this book and that is what prompted my question
18:01tremolofil512: you can use the @#'my.stuff/myvar form
18:01rplevyso 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:01ChousukeI think defn- is mostly there to prevent anyone from accidentally using your function
18:01rplevyproblem solved
18:01Chousukeyou shouldn't use it too much
18:02rplevyChousuke: it is for being declarative about your API
18:02Chousukedeclarative? :/
18:02rplevyI think so
18:02rplevyin my humble opinion
18:02emezeskeChousuke: defn- == "Don't use this function, it's liable to change, and isn't part of the public api"
18:03ChousukeI would use it for some small helper functions that don't really need to get tested but are not public API either.
18:03rplevyemezeske: exactly what I'm saying
18:03gtrakrplevy: if you want a declarative api, maybe use 'declare' too much :-)
18:03fil512so I split my ns into two ns? one "public" and the other "private?"
18:03Chousukeemezeske: defn doesn't imply the opposite either, though.
18:03rplevyI prefer (defn ^:private ...
18:03emezeskeChousuke: It does to me...
18:04rplevybecause you can use it with def, defmacro, etc
18:04Chousukeemezeske: public API is what you document it to be
18:04Chousukedefn implies nothing
18:04rplevydefn to me does imply public api, unless you are not saying that the ns is part of your api
18:04emezeskeChousuke: Right, and the API is documented by metadata
18:04emezeskeChousuke: If you don't mark something as :private, it will get used.
18:05tremolofil512: 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:05tremolo*from
18:05hiredmaneven if you mark it as private I will use it
18:05rplevyemezeske: that is by far the consensus in the community too
18:05emezeskehiredman: hahaha
18:05ivanis conjing arbitrary keys to a record undefined behavior? or supported?
18:05Chousukeemezeske: 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:05hiredmanI don't care how you've documented you api, what accessors you've declared or whatever
18:05hiredmanif I need it I will use
18:06hiredmanit
18:06fil512I 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:06emezeskehiredman: 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:06hiredmanand curse the name of anyone or thing that makes it harder to do
18:06trptcolini thought the preferred way was to cut & paste code from project to project
18:06trptcolin:trollface:
18:06hiredmantrptcolin: if I need to
18:06Chousukefil512: either works, it depends on what you need
18:07trptcolinhiredman: ditto
18:07fil512which option is more common?
18:07Chousukeif you have just a couple defn- functions you can just circumvent the "encapsulation" (there is none, in reality) and test it
18:07tremolofil512: if you're just testing, the @#'foo/bar approach is fine. in fact, it's recommended in the clojure/core style guide
18:07Chousukeotherwise, you might want a namespace that you document as "private"
18:07technomancyfil512: my approach is to mark internal defns with ^:internal metadata
18:07hiredmanhttps://github.com/hiredman/clojurebot/blob/424732436c34de48ca29f04a4f2f7a6ea02b613a/src/hiredman/triples.clj#L29
18:08technomancyit doesn't do anything to the compiler, but it communicates to the reader
18:08fil512the @#'foo/bar option looks messy
18:08fil512I like the two namespace option
18:08fil512are there conventions to indicate which namespaces are public and which private?
18:08emezeskeI like technomancy's approach.
18:09rplevyhiredman: 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:10fil512guess not
18:10fil512well gtg.
18:10fil512thanks for your help!
18:10ChousukeI like technomancy's approach too
18:10Chousukeyou can't prevent anyone from using your private functions, so why complicate things for yourself :P
18:11rplevyI like that idea
18:11hiredmanrplevy: *shrug*
18:11technomancyI hope it takes off so that doc tools know to ignore internal functions.
18:13rplevyI also augment fogus's impl ns idea by marking internal ns with ^:impl. "internal" is probably better, both for ns and for vars
18:15dwierengacan 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:17Chousukedwierenga: write a function, test the function in the repl immediately, and if it works, write more functions :p
18:18gtrakdwierenga: 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:18Chousukeyou can also define whatever temporary variables you need at any time, eg. a vector of test input
18:18dwierengaChousuke: ok... but i don't get how that's dramatically superior to just running your code..
18:18Chousukeyou 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:18Chousukedwierenga: it's faster and more flexible.
18:19Chousukeyou can also affect the behaviour of a running application with the repl
18:19technomancyreplaca's talk on Flow at the first conj might be a good starting point
18:19Chousukethat's not possible with compile and run style development
18:20dwierengagtrak: oh.. i use gvim on windows. haven't managed to get vim hooked up to the repl
18:20gtrakthat'll probably help, until you do, you're limited to copy/paste
18:21gtrakdwierenga: you should watch the game of life screencast maybe? it's a good example
18:22gtrakhttp://www.youtube.com/watch?v=lgsAztXDuH0
18:22dwierengagtrak: will do, thanks!
18:29dwierengagtrak: ok, yeah.. that's spiffiness i don't currently have.
18:30gtrakhe made the return vals show up inline, but the normal setup just shows it in the emacs minibuffer
18:30mwillhiteexit
18:37rlbgfredericks: 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:38rlbs/then/than/
18:42rplevyI 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:42technomancyclojure.tools.logging doesn't let you set the level at runtime, does it?
18:42technomancyrplevy: yes, definitely
18:44technomancybecause it can't be implemented consistently across some of the annoying backends?
18:45technomancyjava the albatross =\
18:46McMartinI miss tail call elimination every day
18:48rplevytechnomancy: 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:49technomancyrplevy: hm; can you open an issue?
18:49rplevyok I will do that
18:50technomancyI haven't tried customizing prep-tasks, but I can't think of a reason it shouldn't work
18:53amalloyrlb: i think you want partition
18:54amalloy&(let [coll '(1 3 2 5 4 7)] (keep-indexed (fn [i [a b]] (when (< a b) (inc i))) coll))
18:54lazybotjava.lang.UnsupportedOperationException: nth not supported on this type: Long
18:55amalloy&(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:55lazybot⇒ 5
19:03dnolenanother boost to satisfies? lands in CLJS master - the perf hit for calling fn through to protocol fn gets ever smaller.
19:09ieureHmm.
19:09ieureSo in this Compojure route
19:09ieureI have (parse-stream (reader (:body req)))
19:09ieureUsing [cheshire.core :only [parse-stream parse-string]] [clojure.java.io :only [reader]]
19:09ieureThis always returns null.
19:09ieureSeems wrong. Has anyone gotten this to work before?
19:10dakroneieure: try (parse-stream (input-stream (reader (:body req))))
19:10nDuffMy routes which need to refer to the body look like so: (PUT "/wherever" [:as {body :body}] ...)
19:10technomancyor parse-string on slurping the body
19:12ieuredakrone, java.lang.IllegalArgumentException: Cannot open <#<BufferedReader java.io.BufferedReader@3668ad91>> as an InputStream.
19:12ieureEr
19:12ieureMy fault on that
19:12ieureProbably
19:12ieureWhat I see in the request is :body #<HttpInput org.eclipse.jetty.server.HttpInput@65012945>
19:12dakroneieure: are you using clj-http?
19:12ieureHttpInput is a subclass of InputStream already
19:13carllercheso… this may sound insane, but is there a way to hook into the byte code loading of clojure.core functions?
19:13cjzwhat is the ^ in (def ^:dynamic x 1)
19:13ieuredakrone, No.
19:13ieurecjz, What's the name of the character, or what does it mean to Clojure?
19:13cjzwhat does it mean to Clojure
19:13ieurecjz, It's a reader macro
19:14ieurecjz, http://clojure.org/reader#The%20Reader--Macro%20characters
19:15dakroneieure: 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:15McMartinIs 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:15raekieure: readers are for text, input-streams are for binary data
19:15cjzthank you ieure
19:15ieurecjz, You
19:15ieure*You're welcome
19:16raekyou can turn an input-stream into a readed, but not the other way around
19:16raek*reader
19:16McMartinraek: 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:16McMartinI can obviously do that with .. in Clojure, but is there a Clojure-native way of doing it?
19:17raekMcMartin: yes, using the java api
19:17raekvia interop
19:17ieuredakrone, 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:17raek(ByteArrayInputStream. (.getBytes some-string "UTF-8))
19:17McMartinraek: 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:18McMartinI actually used input-stream there instead of ByteArrayInputStream. and it worked, though that might be more reflective
19:18raekyeah, that should work too
19:18dakroneieure: and (with-open [rdr (reader (:body req))] (parse-stream rdr)) doesn't work?
19:19raekinput-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:19ieuretechnomancy, (parse-string (slurp (:body req))) doesn't error out, but it returns null.
19:19raekits primary purpose is to eliminate most of the boilerplate code you need to write in java
19:20ieurelul
19:20dakroneieure: what is (slurp (:body req)) returning then? is it an actual string? just 'null'?
19:20raekclojure.java.io does not abstract away java io
19:21technomancyieure: better check to make sure req is what you think it is then
19:21ieuretechnomancy, I did.
19:21ieure:body #<HttpInput org.eclipse.jetty.server.HttpInput@798a6dd4>
19:21ieure:content-length 28
19:22technomancyhow about just (slurp (:body req))
19:23amalloyi'm hoping for "null // 21 character comments"
19:24tmciverreconnecting 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:25ieuretechnomancy, https://gist.github.com/d0944ab7cc5c198c6166
19:25ieureI don't think I'm crazy here.
19:26ieureThere's a (log/debug req) above that let form
19:26technomancylooks like an empty body
19:26technomancyI wonder if :content-length includes HTTP headers
19:26amalloyi have to say, it looks like the input is empty and someone is lying about content-length
19:26amalloytechnomancy: it shouldn't
19:27ieuretechnomancy, amalloy, I'm just using curl to send this request
19:27ieurecurl --trace-ascii shows it sending 28 bytes of body
19:27technomancythere's no good logging library for Java that allows you to set the level at runtime is there?
19:28technomancygiving up on clojure.tools.logging, thought I'd ask before I give up and just call println after checking *level*
19:28ieureOkay so
19:28ieureFor some reason
19:28ieureOmitting the content-type makes it all blow up
19:28emezesketechnomancy: I consistently feel like java has made logging a bigger ordeal than it needs to be
19:28dakronetechnomancy: we set it dynamically with log4j
19:29technomancydakrone: is it an ordeal?
19:30dakronetechnomancy: see pm
19:31technomancythanks dakrone
19:31technomancythe equivalent in j.u.Logging is a pit of despair
19:44kwertiitechnomancy: 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:45technomancythere's not really any good way to do dependencies using git (in any language)
19:45technomancyI mean there's checkout dependencies, but that's different
19:46kwertiiright.. I'm looking at the lein-git-deps plugin, which does mostly what I need (except for recursive dependencies)
19:46kwertiiRuby Bundler is very nice as far as Git deps go
19:46technomancynot according to the maintainers =\
19:46kwertiiheh. I never maintained it, just used it, and never ran into any issues
19:47kwertiiI can imagine it must be a pain
19:47tmciverI 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:47hiredmancalling ruby bundler "nice" is something that is sure yo get you sighed at
19:47hiredmanto
19:48kwertiihiredman: 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:49kwertiiI 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:50technomancyusing git for dependencies is really only appropriate during development
19:50technomancythat's what checkout deps are for
19:50hiredmanditch or fork
19:51technomancyif you have to deploy with an unreleased change, you need to cut your own release
19:51technomancy
19:52kwertiiWhat's the etiquette for that? fork it and push my own foo-prime release to clojars?
19:52emezeskekwertii: If you're just using it locally, you can just "lein install" it, without pushing to clojars
19:53hiredmankwertii: clojars will namespace non-canonical forks (aslong as the canonical version is there already)
19:53technomancyif you have your own private repo it's better to publish there
19:53kwertiihiredman: interesting. didn't know that. that sounds perfect
19:53technomancybut it's not necessary
19:53hiredmanmaven has group-ids and project-ids, lein typically keeps them the same, but they don't have to be
19:54hiredmanit is also pretty easy to run your own maven repo
19:54hiredmanyou can just copy the relevent bits of your .m2 to s3
19:55hiredmanif the library is written in clojure you can even just rewrite particular functions and redefine them
19:56kwertiihaving 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:58jtoyso 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:59hiredmanjtoy: you are kidding right?
19:59jtoyhiredman: im a clojure newb,
19:59hiredmanjtoy: have you read what you just linked to?
19:59jtoyyes
19:59hiredmantry again
19:59jtoyhe said the first example is preferred
20:00kwertiiSo 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:00jtoyhiredman: he says his blog post is wrong
20:00technomancykwertii: try `lein help deploying`
20:00kwertiitechnomancy: thanks
20:03jtoy?
20:09TimMcjtoy: 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:10jtoyTimMc: 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:13kwertiiadded instructions on deploying forks to my fork of lein-git-deps README. Thanks guys.
20:16TimMcjtoy: 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:17emezeskejtoy: 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:18emezeskejtoy: I agree with TimMc, though, in that it's pretty annoying. I generally prefer just passing a map in.
20:19jtoyemezeske: do you guys know a good blog page that explains that ? jstu so i can understand exactly how it works
20:20emezeskejtoy: I don't unfortunately.
20:20jtoyk,thx
20:22emezeskejtoy: Maybe this is helpful? Or at least gives you some more things to google: http://stackoverflow.com/questions/3337888/clojure-named-arguments
20:22jtoyemezeske: awesome!
20:24McMartinI got a lot of mileage out of map bindings but that's not quite what you're looking for here
20:24McMartinOoh, destructured rest
20:28jtoyso 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:29McMartinBetter was is later int he article:
20:29emezeskejtoy: You want to use :or I think
20:30McMartinYeah
20:30McMartinAlso, if-let is better than (let [foo (if (nil? exp) 'default exp)]...
20:31emezeske&((fn [& {:keys [a b c] :or {c 42}}] [a b c]) :a 1 :b 2)
20:31lazybot⇒ [1 2 42]
20:32emezeskejtoy: ^
20:36jtoyemezeske: cool, can I set multiple items with or like that? that seems like the best way to set everything up
20:37emezeskejtoy: Yep!
20:37emezeske&((fn [& {:keys [a b c] :or {c 42 d 100}}] [a b c]) :a 1 :b 2)
20:37lazybot⇒ [1 2 42]
20:37emezeske&((fn [& {:keys [a b c] :or {c 42 d 100}}] [a b c d]) :a 1 :b 2)
20:37lazybotjava.lang.RuntimeException: Unable to resolve symbol: d in this context
20:38emezeske&((fn [& {:keys [a b c d] :or {c 42 d 100}}] [a b c d]) :a 1 :b 2)
20:38lazybot⇒ [1 2 42 100]
20:38emezeskeThere we go
21:36timvisherhey all
21:36timvisherwhat mode is it that gets me the function argument possibilities in the mini-buffer in emacs?
21:36timvishermine seems to work 50/50 but i don't know how to debug because i'm not even sure what it is
21:40gfrederickslight-table-mode
21:42arohnertimvisher: slime-mode
22:03danlarkingreetings humans
22:04danlarkinI just pushed https://github.com/danlarkin/clabango
22:04amalloytimvisher: eldoc-mode
22:05timvisheramalloy: Yes! thank you so much
22:05timvishernow i just need to track down why it seems to randomly enable and disable itself
22:05foxdonutdanlarkin: no docs?
22:05danlarkinfoxdonut: well, there are tests :)
22:05danlarkinI know, terrible answer
22:06danlarkinno, no docs yet
22:07foxdonutdanlarkin: 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:08foxdonutmy 2c anyway.
22:08danlarkinyou're right
22:09danlarkinmaybe a brownie will write docs for me :)
22:10foxdonutheh
22:34Kowboyso, i have a good question
22:35Kowboyis it possible, in a test case, to mock a function called by the function you are testing?
22:35Kowboyhow would this be done?
22:36Kowboyso, the func I am testing is ns1/func1 and it calls ns2/func2 internally
22:36metellusKowboy: with binding
22:36KowboyI want to mock ns2/func2
22:37metellus(binding [func2 mocked-func2] (func1 a b))
22:37brehautthat only works for dynamic vars though
22:37metellusI knew I was missing something
22:37Kowboycrap
22:38metellussorry
22:38technomancyuse with-redefs
22:39technomancyor Rodney Leonard Stubbs: https://github.com/technomancy/rodney-leonard-stubbs
22:39brehauttechnomancy: your libs have the best names
22:39technomancy"He was the Thomas Edison of handing a dude his ass."
22:40Kowboytechnomancy, looking at this lein bug about proxy settings
22:40technomancyhttp://achewood.com/index.php?date=01272006
22:40technomancyKowboy: oh, great
22:40Kowboywas hoping to mock up classpath/get-proxy-settings
22:41Kowboysince System.setEnv() doesn't exist
22:41Rayneshttps://www.refheap.com/paste/2834 Oh my God oh my God oh my God! Light table code on refheap!
22:41clojurebotsharing 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:42gfrederickstechnomancy: that library makes me really want to make other libs with namespace of rodney.* or rodney.leonard.*
22:42technomancygfredericks: http://clojars.org/groups/robert
22:42McMartinI hope the Rodney Leonard Stubbs library is for ripping the entire middles out of functions.
22:43technomancyKowboy: with-redefs is your best bet there
22:44KowboyI'll give it a shot
22:44gfrederickstechnomancy: I assume you've applied for the .robert TLD
22:44gfredericksif anybody else gets it first sue'em
22:44Kowboyhere is one case where the JVM doesn't let you create the side-effect
22:49technomancy"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:50gfrederickstechnomancy: please write a library that makes us all prolific readers
22:50brehautjust dont write a library that makes me have to read stephenson
22:51technomancybrehaut: I think liebke covered that one?
22:51brehauthaha
22:51brehautmaybe he did
23:01amalloyoh, is avout a reference to anathem? i didn't see the relevance
23:07Kowboytechnomancy, 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:08Kowboyas -Dhttp.proxyHost=foo
23:08Kowboyetc.
23:08technomancyKowboy: yeah, that's the idea
23:08KowboyOK, I think I have it then, just need to test
23:10Kowboy (with-redefs [classpath/get-proxy-settings (constantly {:host "foo.com" :port "8080"})] ....)
23:10Kowboyseems to work
23:12Kowboyunit test passes! Now to install a build of lein2 and test it manually
23:12technomancyyou should be able to just run bin/lein test
23:12technomancyprovided you've bootstrapped your checkout
23:16Kowboywell I launched the repl, but forgot I don't have a proxy setting. DOH!
23:17Kowboybest place to test this would be at work, where they have a super insane firewall
23:17technomancyyeah, it's always hard to find people to test the proxy features =)
23:18KowboyI think I complained about proxy features before
23:18Kowboysomething about the downloading of lein's own deps
23:19eggsbywoah flask in light table, you rule ibdknox
23:20Kowboyah, it was lein plugin install that didn't use proxy settings
23:20Kowboyfixed 4 months ago
23:20Kowboybut yeah, I got hit by that one
23:21Kowboyso, would you prefer if I use rodney for mocking (classpath/get-proxy-settings)???
23:21lazybotKowboy: How could that be wrong?
23:22Kowboydid I confuse lazybot?
23:22brehauti dont think so??
23:22lazybotbrehaut: What are you, crazy? Of course not!
23:23amalloyi think lazybot gave you a pretty good answer tbh
23:25technomancyKowboy: no, if with-redefs works then that's simpler
23:25technomancyno need to pull in a library for this
23:25Kowboyok
23:50Kowboytechnomancy, I've pushed to my fork, but I'll test it tomorrow before I send you a pull
23:51technomancyKowboy: great; thanks!
23:57Kowboyok, I
23:58KowboyI'm out, see ya later