# #clojure log - Mar 12 2012

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

0:01 uvtc: antares_, is there supposed to be a newline at the end of your public key?

0:01 antares_: uvtc: no

0:02 I think it will be ignored but typically public keys don't have newlines

0:02 uvtc: antares_, Thank you. Though, it's still not working for me, there was a newline (maybe I mistakenly put it there at some point) and I removed it.

0:03 antares_: uvtc: did you check your key permissions?

0:03 uvtc: antares_, No.

0:03 antares_: uvtc: ssh will only use them if key files are 600

0:03 not readable by anyone but the owner

0:03 uvtc: Public key as well?

0:04 My pub key is 644. Changing and trying again.

0:04 antares_: uvtc: no, public key permissions can be anything

0:04 it is public, after all

0:05 uvtc: antares_, Ah, *ehem*, of course. :) Hm. Yeah, the private one is 600.

0:05 Tried updating my pub key in the clojars "profile" page. No change.

0:12 When I created my Clojars account, was it supposed to send me some sort of confirmation email?

0:13 technomancy: emails are only sent on password resets IIRC

0:19 franks42: trying again this reworded Q: is there any available function that returns a ns-form-like statement that includes all the requires/imports/refers/aliases that would give me the current context in the REPL?

0:19 uvtc: technomancy, thanks.

0:19 arohner: franks42: no, but you could write one

0:21 does swank allow you to eval a single function in a file? if so, how does it eval in the right context?

0:23 arohner: franks42: yes, C-x C-e. I think it reads the ns declaration at the top of the file, not sure

0:25 uvtc: antares_, Thanks for all the help. Will probably try again tomorrow.

0:26 $mail antares_ Thanks for all the help. Will probably try again tomorrow. 0:26 lazybot: Message saved. 0:27 franks42: arohner: I do understand that you can write such a function from the all-ns, ns-refers, ns-aliases, ns-imports... just have the feeling that I'm not the first who stumbled upon that requirement 0:28 arohner: franks42: I haven't heard of anyone wanting to write that before, and I've been here for almost 4 years 0:28 franks42: ...and when you're only working inside the repl, there is no ns-declaration to parse 0:29 arohner: I typically work in a file, and use swank to eval the file as I'm working 0:29 no need to determine an ns declaration from the repl context 0:31 franks42: arohner: understood - my requirement comes from executing clojure statements independently in new repl sessions where the second invocation has to eval in the same context as the one before 1:41 clifford: Hi, how would I setup slime to work with datomic? 2:57 aperiodic:$mail uvtc after a few hours of being afk, i tried again, and both of my keys (one for my original account, another for a new one i made to try to get around this) are still rejected. thanks for the suggestion, though

2:57 lazybot: Message saved.

2:59 wmealing: aperiodic, this is your ssh keys ?

3:00 someone else was having problems too, so its not just you

3:00 antares_, iirc.

3:01 aperiodic: i thought it was uvtc

3:03 yeah, looks like it from skimming the logs... and it appears to be resolved for him

3:04 i still have one thing left to try before i start setting up a local clojars instance

3:19 well, i just created a new clojars.org user account, and a new user account on my linux vm with a fresh rsa identity. i still can't ssh into clojars

3:20 wmealing: imho file a bug

3:20 dont know with who

3:24 aperiodic: i'll open an issue on the gh project

3:27 justicefries: so what's the advantage of using say, SLIME with noir?

3:27 I have SLIME up and running

3:28 with swank-clojure.

3:32 guns: justicefries: why with noir in particular? SLIME is useful in of itself

3:33 justicefries: that's what I'm jumping into - what I'm trying to figure out, I suppose, is how SLIME fits into the workflow.

3:33 i'm modifying/injecting code at runtime directly, but I have to edit files separately, correct? so it's a faster feedback/debugging tool

3:36 guns: justicefries: I am building a site with noir and I've been able to use an atom instead of a database for storing data, which I can then access from my editor

3:36 That's a first time experience for me with a web app

3:37 justicefries: oh, nice.

3:39 uvtc: $mail aperiodic The scp/ssh problem still exists for me as well. I'll ask again here tomorrow about it. I've also tried creating new keys, but that didn't help. Incidentally, looks like we're both on Ubuntu. Looking at the gist you posted in your bug report, we may be having the same problem. 3:39 lazybot: Message saved. 3:44 aperiodic:$mail uvtc you should comment on the issue! so technomancy doesn't think i'm crazy :). i'm gonna stop bashing my head against this issue now, and hopefully there'll be a response in the morning.

3:44 clojurebot: Cool story bro.

3:44 lazybot: Message saved.

3:44 aperiodic: thanks, clojurebot

3:45 guns: that was cool

3:49 * wmealing laughs

5:01 justicefries: okay, suddenly I get SLIME/Swank

5:16 is anyone about for a quick swank-clojure question?

5:17 bsteuber: justicefries: just ask ans we#ll see ^^

5:17 *and

5:17 justicefries: great. trying to use it to start up a vanilla noir server, and I try to hit the localhost:8080

5:17 and there's no server starting,a nd I'm not sure why.

5:17 I opened the file, and then C-x C-e on the -main function.

5:17 oh, I probably have to call -main, huh?

5:17 that did it.

5:26 bsteuber: ^^

5:26 justicefries: the benefit seems less pronounced in noir, where files update on save anyway.

5:27 bsteuber: yes that's really nice for dev

5:28 justicefries: but I suppose it's not a bad idea to be able to jack into a swank session on prod. :)

5:30 bsteuber: indeed

5:30 justicefries: I understand!

5:31 now I just need to figure out the best way to minify/concat CSS/JS in Clojure, or just use Uglifier. :D

5:33 doesn't seem to be a reality.

5:33 bsteuber: clojurescript with advanced mode is great for js

5:33 justicefries: that makes sense.

5:33 yeah, from what clojure-toolbox says everything available hasn't been updated in ever.

5:34 which is fine.

5:34 bsteuber: we are using conpass to generate css, but this is from ruby land

5:34 compass

5:34 justicefries: man, compass drives me insane.

5:34 scss + bourbon is good.

5:35 a combo like that in clojure would rule.

5:35 bsteuber: what's the difference between bourbon and compass?

5:36 justicefries: I can actually get bourbon to work, and it handles cross-browser polyfills

5:36 compass requires structural changes to the app

5:36 unless it's changed recently.

5:37 bsteuber: I see

5:37 but yes, I'd also wish to have a great pure clojure solution

5:38 justicefries: github.com:paraseba/cssgen seems to come close.

5:38 unfortunately, GitHub is vomiting on it.

5:38 bsteuber: I think I tried that but stopped for some reason

5:38 but it's been a while, so maybe it improved in the meantime

5:38 justicefries: last commit 3 months ago...

5:38 I'unno, maybe I'll take a crack at an initial version this weekend.

5:39 I like how Jade renders out CSS.

5:41 ah and cssgen doesn't seem like it's runtime.

5:42 seems like there needs to be a ring middleware for this.

5:43 bsteuber: you want to gen css at runtime?

5:43 justicefries: initially. I think it's a good start, and then focus on making it more asset-pipeliney later.

5:43 especially in dev mode.

5:43 bsteuber: well I have compass watch the scss

5:44 save the file and refreshing the browser is not so much work

5:44 justicefries: true, it's nice that both express.js and rails and sinatra can all have that baked right in though.

5:48 bsteuber: so you actually do write js?

5:48 instead of cljs, I mean

5:48 justicefries: as of right now yeah. I'll probably switch over.

5:49 bsteuber: yes you should, it's so nice to have clj in the browser

5:49 justicefries: I do a lot of workshops with canvas and such, which should really be in pure JS or coffeescript at worst.

5:49 the engine I'm building I'd like to move over to cljs though

5:50 bsteuber: cljs still has some childhood issue like even less readable error messages

5:50 justicefries: sure.

5:50 bsteuber: but once you get the hang of it it's far more productive

5:50 justicefries: coffeescript has that problem too

5:50 bsteuber: of course, being clj :)

5:51 justicefries: i'm still getting the clojure epiphanies.

5:51 they're coming more and more though.

5:51 coming over from ruby with a bit of erlang.

5:51 bsteuber: the thing bothering most are no errors or anything when using unbound variables

5:51 lucian: i find CS's errors ok, given how close it is to JS

5:52 sourcemap will help, though

5:52 bsteuber: sourcemap?

5:54 justicefries: also re: the CSS, bsteuber, you could probably make the same argument re: cljs, unless you're precompiling that.

5:54 guard/compass/etc is nice and all.

5:55 bsteuber: justicefries: which argument do you mean?

5:55 justicefries: doing it as a middleware in dev.

5:55 you probably don't want to be compiling CLJS on the fly.

5:56 bsteuber: ah

5:56 yes, that's why lein cljsbuild replaced noir-cljs I guess

5:56 because doing the recompiling with your build tool is more flexible

5:58 justicefries: yeah I'm trying to figure out how much I fully agree with that...I mean, I really love what asset pipeline and friends did.

5:58 it's buggy, it can be weird.

5:58 but for the 90% case it's great, and in production you pre-compile with a task.

5:59 justicefries: to have a namespace with all of your cljs (or mixed in with JS, too) in it and a namespace for all of your <insert CSS template type here>.

5:59 bsteuber: tach

5:59 justicefries: maybe?

5:59 i'unno we'll see what I can cook up this week.

6:00 bsteuber: why do you need these namespaces?

6:00 justicefries: probably don't, just trying to think of organization patterns and it's 4AM here. :D

6:00 lucian: bsteuber: https://wiki.mozilla.org/DevTools/Features/SourceMap

6:02 bsteuber: thanks, that might be useful

6:52 wmealing: user=> (ns-public 'clojure.string) <- a few tutorials talk about something similar, clojure 1.3.0

6:53 this form outputs nothing

6:53 CompilerException java.lang.RuntimeException: Unable to resolve symbol: ns-public in this context, compiling:(NO_SOURCE_PATH:1)

6:53 well, not nothing, a runtime exception, see above.

6:54 ordnungswidrig: wmealing: ,(ns-publics 'clojure.string)

6:54 ,(ns-publics 'clojure.string)

6:54 clojurebot: {trim #'clojure.string/trim, lower-case #'clojure.string/lower-case, split #'clojure.string/split, join #'clojure.string/join, upper-case #'clojure.string/upper-case, ...}

6:54 wmealing: ok, so it doesn't work for me, what did i do wrong ?

6:55 ordnungswidrig: wmealing: ns-publics not ns-public

7:01 wmealing: different error, but i'lls ee if i can figure it out.

7:50 y3di: has anyone checked out riemann? http://aphyr.github.com/riemann/

8:26 wmealing: is the use of eval considered bad practice ?

8:27 Lajla: I never got how that can be implemented

8:27 Lajla: Doesn't that mean that every program that uses that basically includes a clojure compiler in it?

8:27 wmealing: hey hey gtk :)

8:27 Lajla: How does eval work with scope anyway?

8:28 Like, if you eval something with def in it, does that affect the global scope?

8:28 wmealing: i guess it evals it, in the current scope ?

8:30 Lajla: Surely that violates lexial scope if def and other stuff is allowed?

8:31 (eval (if some-runtime-data '(def x 3) '(def y 4)))

8:32 wmealing: why dont you try it ? see what happens

8:32 Lajla: Don't have clojure installed, don't know clojure, I just come here to worship shadows it seems.

8:32 I am actually a hated schizophrene here who usually just sprouts word salads you know.

8:34 wmealing: ah

8:34 whats stopping you ?

8:34 Lajla: lack of TCO I guess.

8:35 wmealing: not following how that relates.

8:35 bits on your disk are that precious ?

8:35 Lajla: Dunno, there's a reason many lispers don't really like Clojure, I'm one of them. I checked it out, didn't like what I got, left and the channel never got from autojoin and they never banned me for my mental insanity.

8:35 Ohhh

8:35 I thought stopping me from learning clojure well.

8:35 Ehhh

8:36 I geuss I could install it

8:36 I guess just laziness, had it on my old computer never re-installed.

8:36 wmealing: you can't bash something properly, till you really know it.

8:36 otherwise you're not doing justice to the bashing

8:36 Lajla: True

8:36 adamspgh: Lajla: I highly recommend leiningen for getting Clojure.

8:36 Lajla: but I'm not bashing

8:36 leiningen?

8:36 clojurebot: http://github.com/technomancy/leiningen

8:37 adamspgh: Just grab the "lein" script and run it "lein repl" and you are in clojure.

8:37 wmealing: if you know erlang, its the rebar of clojure

8:37 Lajla: I'm not one of those people that enjoys bashing fo rth esake of elitism, I just read the start, wasn't a fan and didn't continue

8:37 wmealing, rebar?

8:37 I'm not a fan of Erlang either honestly.

8:37 wmealing: project manager, test runner, etc

8:37 everything has its suck points

8:37 Lajla: True

8:38 I actually dislike every language I would say, I just dislike some more than others, issue is, I see no reason to use clojure when scheme exists.

8:38 wmealing: the trick is to find something where the points dont bother you

8:38 Lajla: Clojure has some advantages though.

8:38 wmealing: java interop

8:38 Lajla: Something about clojure I really really really like is the fact that nil and the empty list are destinct

8:38 wmealing: i dont know the lispy languages well enough to say what is crap, and what isnt

8:38 Lajla: Having them as the same object is just an historic artifact, as well as the fact that lists are a proper datatype.

8:39 wmealing: can you modify scheme to do that ?

8:39 macro it up ?

8:39 Lajla: Well, lists in scheme are not a native type

8:39 lucian: Lajla: http://tryclj.com/

8:39 Lajla: you have pairs and you have the empty list, and you make them from that

8:39 wmealing: pairs like (1,2) ?

8:39 Lajla: Like (1 . 2)

8:39 that's how you write it there

8:40 wmealing: so you'd compose it like (1 . 2 ) . 3) ?

8:40 lucian: which is (cons 1 (cons 2 '()))

8:40 Lajla: (1 . (2 . (3 . ())))

8:40 wmealing: ah

8:40 lucian: scheme is by far the cleanest lisp, but clojure has some clear advantages

8:40 Lajla: No, (1 . 2) is a pair of two numbers, the list (1 2) is identical to the pair of 1 and the pair of 2 and ()

8:40 lucian: the data type literals are really useful

8:40 Lajla: (1 . (2 . ()))

8:41 wmealing: ok

8:41 Lajla: lucian, I agree that some things about clojure are superior, a lot of things about scheme are just historical artefacts

8:41 Like, you can feed any pair structure to map in scheme

8:41 if it's not a well formed list, the behaviour is not defined per se on a conforming implementation

8:41 The scheme standard does not mandate that it verifies it is a conforming list

8:41 Though, most implementations of scheme test list? in constant type

8:42 time*

8:42 Well, not always of course

8:42 lucian: the only things i dislike about clojure are jvm and non-hygienic macros

8:42 * wmealing nods

8:43 lucian: but they're also partly things i like

8:43 wmealing: do you guys get paid to write lisps in your day job ?

8:43 Lajla: lucian, not the lack of TCO?

8:43 lucian: i get paid (extremely little) to write python (which i quite like)

8:43 Lajla: I think that's even a problem for the author itself, the lack of TCO.

8:43 Hmm, Python is also a language I find very hard to work with.

8:44 lucian: Lajla: nah, that's not a big deal i think. i even like that recur is an explicit tail call

8:44 Lajla: Well, mutual recursion is still an issue.

8:44 I use mutual recursion quite often in my scheme.

8:44 lucian: for which you have trampolines

8:44 you do? you may be unusual

8:44 dan_b: I view 'recur' as a signal that perhaps I should be using map or soemthing instead

8:44 Lajla: What if your mutually recursive function wants to return a function?

8:45 In a lot of cases when imperative programmers think they need to use tail recursion, they actually need to use map yeah

8:48 lucian, hmm, what do you think of mutually recursive parsers for context-free languages?

8:48 lucian: Lajla: i think they're uncommon enough that explicit trampolines aren't a great cost

8:49 Lajla: lucian, well, I mean, as a general design philosophy.

8:49 It seems like the most straight-forward way to make them namely.

8:50 lucian: i've never written one, so my opinion isn't very relevant

8:50 one could write it with multimethods perhaps more simply

8:51 Lajla: I don't know, this seems like the simplest and most intuitive way for me to write one.

8:51 Most of my functional code is mutually recursive, I can't see how it's that uncommon

8:51 lucian: we probably have different enough backgrounds to disagree

8:51 Lajla: Especially in code which deals with physical stuff

8:51 Because you're defining physical formulae into each other anyway.

8:51 I guess.

8:51 lucian: functional code is uncommon in the first place

8:51 Lajla: Hmm

8:52 So you don really have a functional background outside of clojure?

8:53 lucian: not really, and i'm only slowly learning clojure

8:53 i do use vaguely functional concepts in python a lot, but i'm used to relying on side-effects

8:54 vijaykiran: eh

8:55 Lajla: Ahhh, I guess.

8:55 Well, it's not that common in functional code I guess if not a necessicity in some ways

8:56 lucian: sure, but i started with pascal/c

8:56 i still hate that shit

8:56 stirfoo: not to go off topic too far, but is anyone looking into clojure-py?

8:56 lucian: stirfoo: i'm curious of doing it on PyPy properly

8:57 stirfoo: lucian: it looks like a interesting project. Lisp with batteries included.

8:58 Lajla: Doesn't CL pretty much have enough batteries to power las vegas?

8:58 stirfoo: no

8:58 lucian: stirfoo: it couldn't call into python automatically

8:58 stirfoo: what you'd need is either more work into PyPy, or to generate python source code instead, like cljs

8:58 stirfoo: neither does scheme, or clojure, Python has the batteries.

8:58 Lajla: Scheme has batteries depending on what scheme standard you work with

8:58 lucian: with clojure, you have tons of batteries, but they're in very hard to open packaging and many sharp edges :)

8:59 Lajla: there are layers and layers upon standards

8:59 lucian: Lajla: that's different orders of magnitude of batteries

8:59 Lajla: the smallest core has about enough batteries to power a watch.

8:59 lucian: like opening files vs html parsing

8:59 scheme tends to have more of the former and few of the latter

9:00 Lajla: The further SFRI's all include that stuff.

9:00 opening files is part of R5RS

9:00 People often read R5RS, conclude 'Hey, 40 page document, this language is very small', while most implementations support standards which reac way beyond R5

9:01 lucian: nowhere near the ecosystem python/ruby/java have

9:02 Lajla: I'm pretty sure it is because everyone can just add an SRFI

9:02 THere is some pretty silly and specific stuff in there

9:03 lucian: again, doesn't compare in breadth with anything else out there

9:03 not even racket's planet comes close

9:03 Lajla: How would you know?

9:03 lucian: i thought it was obvious

9:03 it's orders of magnitude difference

9:05 Lajla: We're still talking about the batteries of standard python versus all the SRFI's out there right?

9:05 wmealing: [org.clojure.contrib/complete "1.3.0-SNAPSHOT"] <-- what is the correct syntax for 1.3 ?

9:05 for the project.clj ?

9:05 lucian: Lajla: no, i meant stdlib+pypi vs srfi+racket's planet

9:06 Lajla: what the language ships with is almost irrelevant

9:06 tsdh: wmealing: See http://dev.clojure.org/display/doc/Clojure+Contrib

9:06 wmealing: It seems, complete hasn't been ported to clojure 1.3...

9:06 Lajla: stdlib? as in, C?

9:06 lucian: Lajla: the python standard library

9:07 pypi is the python package index

9:07 wmealing: so i'd need to import each one.. ok

9:07 Lajla: Ah, oki.

9:08 h0x5f3759df: Hi, I'm writing breadth first search, Is it a good idea to use meta data for the intermittent data like "color of node", parent of node, distance from root?

9:12 stirfoo: doesn't the zip code use meta data in a similar fashion?

10:02 beffbernard: I have a question regarding slime. Is there a way to have C-x C-e direct it's output to the slime buffer instead of the minibuffer?

10:02 justicefries: morning.

10:03 beffbernard: Morning

10:05 dgrnbrg: So, I have a clojure program and a python program that I want to chill together, and make RPC calls from the python program to the clojure program. What's the easiest way to do this? I'm thinking of printing clojure data structures, and writing a simple server w/ java io libs in clojure

10:10 wmealing: why not json ?

10:10 dgrnbrg: That'd work too

10:10 did server-socket die in clojure 1.3?

10:13 stirfoo: beffbernard: C-u C-x C-e will output in the active buffer. Don't know if that will help.

10:19 ,(namespace 'fu///b:a:r///baaz)

10:19 clojurebot: "fu///b:a:r//"

10:20 stirfoo: trying to put into words what constitutes a valid lisp symbol is nigh on impossible

10:21 llasram: stirfoo: There's been some discussion on the mailing list about this. I think the consensus is that "what the functions happen to accept" is *not* the definition of what is valid

10:22 stirfoo: sure as hell isn't as easy as [_a-zA-Z][a-zA-Z0-9_] ;)

10:23 llasram: I've been looking at the reader, line by line. It's a process of subtraction. If nothing else matches it *may* be a symbol. But then it has three more functions that try to determine if it's a symbol.

10:24 llasram: I think it's hard because rhickey is being intentionally liberal to allow for future extensions

10:25 http://clojure.org/reader has a fairly tight definition of what constitutes a valid symbol

10:25 TimMc: s/liberal/conservative/ depending on how you look at it

10:25 stirfoo: common lisp is far more liberal

10:25 TimMc: Be liberal in what you accept, conservative in what you produce.

10:25 llasram: but includes the text "other characters will be allowed eventually, but not all macro characters have been determined"

10:25 TimMc: right

10:25 TimMc: What's-his'face's Law

10:26 So it depends on whether you're writing a syntax consumer (reader, highlighter) or producer (macros, regular code...)

10:27 stirfoo: The synbol '/ is amusing. It's special-cased.

10:28 llasram: I was just noticing that -- need ([/]|...) to match symbols :-)

10:28 TimMc: &/

10:28 lazybot: ⇒ clojure.core//

10:34 stirfoo: TimMc: yes, it's pulled out early because it would complicate matchSymbol()

10:35 It's really interesting code to read. Rich has a mind that operates on a level that I just can't comprehend.

10:39 dgrnbrg: How do I get cheshire? It doesn't have a prefix, and [cheshire "3.0.0"] doesn't seem to work for me

10:40 ah, I can't speel

10:40 TimMc: stirfoo: You might think that about me, too -- if I failed to document my code. :-P

10:41 stirfoo: TimMc: haha, yes, the docs are a bit, ummm sparse, in the clojure source.

10:42 Every now and then he'll toss a bone

10:56 % is another weird one. %foo is perfectly fine as a symbol as long as it's not found within an anonymous function. But fo%o is actually parsed as two symbols because % is a terminating macro character.

10:57 such is the land of lisp ;)

11:18 Lajla: stirfoo, more like such is the land of clojure which is pretty ambiguous of what it conisders symbols

11:19 ,(symbol? (symbol "can I haz spaces?"))

11:19 clojurebot: Lajla: Excuse me?

11:19 Lajla: Oh you again

11:19 $(symbol? (symbol "can I haz spaces?")) 11:19 What was the other bot again 11:19 Oh well 11:19 You get the idea 11:23 lake: How can I reference the file (by full path) that clojure is running. My goal is to print the source file when the file is executed. 11:23 evaluated, i mean. :p 11:23 TimMc: lake: Just write a quine! :-P 11:23 dgrnbrg: is there a way to pass lein run a supplemental classpath? 11:23 lake: TimMc: ah, yes, good idea! 11:24 TimMc: those things are awesome 11:24 TimMc: lake: There's some sort of var you can grab during compilation that has path info. 11:25 lake: TimMc: thanks, looking for it 11:30 dgrnbrg: technomancy: is there a way to add a colon-separated list of hundreds of jars to lein from the command line? 11:30 (I have a script that dynamically generates this list) 11:30 lake: TimMc: yes, so *file* is what I wanted. 11:36 rvid: What version of leiningen should I be using? I think homebrew gives me 1.6.2. Is that the latest? 11:38 TimMc: rvid: Latest is 1.7.something 11:38 and 2.0 is coming out soonish 11:39 rvid: ahh. alright 11:41 uvtc: Hi #clojure. I've been working on a brief beginner's guide to Clojure lately, and have a first draft up: http://www.unexpected-vortices.com/clojure/brief-beginners-guide/ 11:42 Please let me know what you think. Either here, or via email (address is on that front page). Corrections would be most appreciated. The last chapter (chp 11, on creating libs) still probably needs some details, but I'm stuck at the moment as I'm unable to upload to Clojars. 11:42 TimMc: Oh hey, now I get your IRC nick. 11:43 uvtc: TimMc, :) 11:44 gfredericks: I just upgraded to the newest version of lein-ring (0.6.0) and now lein-ring crashes saying it can't find leiningen/core/eval.clj 11:44 lein ring server-headless crashes rather 11:45 TimMc: gfredericks: What lein version? 11:45 gfredericks: 0.7 11:45 er 11:45 whatever is latest 11:45 TimMc: 1.7 11:45 point something 11:45 gfredericks: point something 11:46 maybe I need ring instead of ring-core 11:46 nope same thing 11:47 I upgraded lein-ring because it had an incompatibility with my never version of hiccup 11:47 why it needs hiccup I'm not sure 11:49 tmciver: uvtc: I haven't actually read any of your guide but one quick and minor criticism: consider narrowing the content area; maybe it's just me but I find it difficult to read text that spans the entire browser window. 11:51 TimMc: uvtc: "3. Installing Clojure" should really start with "You don't!" or something. 11:54 uvtc: tmciver, Thanks. I think that a narrower format is definitely the way to go for shorter articles. However, I think the full-width format works ok for longer docs where users will resize their window how they like it. 11:55 si14: hi, #clojure. Can you tell me how to improve this function? https://gist.github.com/d387a930cf1cba1f023a :) 11:57 gfredericks: (map #(update-in % [:y] (partial - height)) tiles) is...a different way to do it 11:57 I don't know if that'd be an improvement or not :/ 12:02 uvtc: TimMc, re. installing: Though I think that would be humorous, coming from Perl/Python/Ruby, I think that new users are scratching their heads at first re. installation, so I wanted to be plain vanilla clear here. 12:08 TimMc, (but added that it's taken care of automatically) 12:09 TimMc: Since it is a common sticking point for newcomers, I think it would be good to shake them out of that notion as quickly as possible. 12:14 uvtc: Have you played with lein-oneoff? 12:14 uvtc: TimMc, no. 12:15 TimMc, (reading about it...) 12:19 Are all lein plugins installed thusly: lein plugin install plugin-name plugin-version? 12:21 TimMc: I believe so. 12:21 tmciver: uvtc: yes, with plugin-version in quotes, I believe. 12:21 TimMc: Dunno about in lein 2 12:21 uvtc: TimMc, tmciver, thanks. 12:21 TimMc, lein-oneoff looks simpler than my advice of putting the clojure jar somewhere and creating that tiny script. 12:22 TimMc: yep 12:22 uvtc: Using it would also allow me to put your quip about not installing Clojure on the installing page. Will try it out! Thanks! 12:22 TimMc: :-) 12:28 uvtc: One thing that gets me about lein ... when it can't find a jar in the first place it looks (or finds that it's missing and needed), it says "Unable to find resource ...". I keep thinking there's a problem, but there isn't. 12:29 raek: uvtc: as other probably has said, the "fiddle with the clojure jar manually" approach is _not_ the way most peoplr use clojure 12:29 TimMc: That's Maven, really. 12:29 raek: it might be relevant to some people with more advanced setups 12:30 gfredericks: does anybody have experience with tmux conflicting with emacs bindings, specifically e.g. C-right from paredit? 12:30 raek: but does not belong in a beginner's guide at all, IMHO 12:30 uvtc: raek, thanks. 12:30 raek: a beginner's guide should show the "least friction" way of doing things 12:31 which is: use Leinginen. seriously. 12:31 technomancy: uvtc: yeah, leiningen doesn't have much control over the output of the maven libraries for dependency fetching 12:31 raek: *Leiningen 12:31 technomancy: gfredericks: I have the slurp stuff rebound 12:31 TimMc: uvtc: "Emacs shares a number of keyboard combinations with the Bash shell, which makes it easy to move back and forth between the two." <-- Did you know you can do shopt -o vi? 12:32 technomancy: gfredericks: I recommend M-) 12:32 gfredericks: technomancy: is there a simple characterization of which bindings conflict with tmux that you know of? 12:32 uvtc: TimMc, Do not try to entrance me with your sorcerers vimly ways. 12:32 TimMc, ;) 12:32 TimMc: Oh, I'm more of a notepadder. :-P 12:32 technomancy: gfredericks: anything fancy on a control character is unlikely to get conveyed correctly, and from a terminal's perspective, arrow keys are just control sequences 12:32 uvtc: TimMc, No, I didn't know that. 12:33 gfredericks: technomancy: okay, thanks 12:33 technomancy: do you know why lein-ring would crash trying to load leiningen.eval? 12:33 raek: seeing "~/opt" makes me think of all the trouble the riddell.us tutorials have caused to clojure beginners... 12:33 lazybot: The riddell.us tutorials are much more highly-ranked on Google than they deserve to be. They're old and way too complicated. If you're trying to install Clojure...don't! Instead, install Leiningen (https://github.com/technomancy/leiningen/tree/stable) and let it manage Clojure for you.beginners... 12:34 technomancy: gfredericks: leiningen.core.eval is new in lein2 12:34 gfredericks: technomancy: so it has an undocumented dependency on lein2? 12:35 technomancy: sounds like it =\ 12:35 weave jester! 12:35 is this in a release or a snapshot? 12:35 gfredericks: release; 0.6.0 12:36 I haven't tried reproducing on a bare project yet 12:37 TimMc: That sounds uncomfortable. 12:37 gfredericks: indeed 12:37 justicefries: technomancy, question about your emacs-starterkit-js. is it not supposed to do auto-indent? 12:38 * gfredericks reads leiningen/wiki/Upgrading 12:38 technomancy: justicefries: that part of the starter kit isn't really maintained 12:38 justicefries: ooh okay. 12:39 good to know. 12:39 I will go find a javascript mode! 12:40 technomancy: gfredericks: I'll fix lein-ring for backwards-compatibility 12:40 uvtc: raek: Will get rid of most (or all) of the references to ~/opt. 12:41 technomancy: I actually already have a patch for it; I just wasn't quite ready to PR it 12:43 gfredericks: technomancy: w00h00! 12:44 technomancy: gfredericks: you can do "lein install" from my fork in the mean time 12:44 though actually you should just try lein2 =P 12:45 gfredericks: technomancy: I installed lein2; I guess to get it to work I have to upgrade the project.clj 12:45 * gfredericks installs lein-precate 12:45 technomancy: good thing lein-precate does that for you automatically =D 12:46 Bronsa: why is (let [] (deftype A []) (A.)) failing= 12:47 gfredericks: I think hiccup hates me 12:47 TimMc: Bronsa: Does it work if you use do instead of let? 12:47 Bronsa: yeah 12:47 dnolen_: anybody played around with lein-cljsbuild's REPL support? 12:47 Bronsa: is it a bug or an expected behaviour? 12:48 TimMc: Bronsa: I'd say the latter. 12:48 technomancy: clojurebot: gilardi scenario? 12:48 clojurebot: Huh? 12:49 Bronsa: found your blog post 12:49 gfredericks: how can I view a mvn dependency tree for my dev deps? 12:49 oh nevermind 12:49 technomancy: clojurebot: The Gilardi Scenario is where you can't compile a form because the form contains definitions needed to compile itself: http://technomancy.us/143 12:49 clojurebot: You don't have to tell me twice. 12:50 TimMc: gfredericks: lein pom && mvn dependency:tree 12:50 gfredericks: TimMc: the pom has dev-deps? 12:50 TimMc: Oh! Hm. 12:50 It should, actually. 12:52 gfredericks: I forgot there were jars hiding in .lein-plugins 12:54 okay so my lein2 ring server-headless is failing because someone is trying to use old hiccup (the page-helpers ns in particular) 12:55 however grepping lib for 'page_helpers' and 'page-helpers' gives nothing 12:56 ibdknox: gfredericks: is it a noir app? 12:56 gfredericks: no; compojure I think 12:56 the app itself is actually part of a dep 12:56 ibdknox: oh 12:57 dunno then 12:57 uvtc: TimMc, raek, Ok, got rid of ~/opt. 12:58 TimMc: yay 12:58 uvtc: TimMc, updated install doc too. 12:59 zamaterian: gfredericks, TimMc dev-deps is scoped as test in lein 1.x (disclaimer my only patch to lein :) 13:02 TimMc: uvtc: ~/elisp, is that like ~/.emacs.d? 13:03 uvtc: TimMc, Yes. I've always used ~/elisp. I guess some people use ~/.emacs.d? Seems to make more sense to have the directory visible... 13:04 gtrak: visible? why? you know it's there 13:04 dnolen_: anyone had trouble with lein-cljsbuild browser repl features? 13:05 ibdknox: dnolen_: are you doing lein trampoline cljsbuild ... 13:06 dnolen_: ibdknox: yeah 13:06 ibdknox: I've only ever tried the listen one 13:06 but that seemed to work 13:06 dnolen_: ibdknox: yeah listen isn't working for me, if I start the browser repl by hand it works ok 13:07 jonasen: anyone familiar with custom dispatch functions in clojure.pprint? 13:07 dnolen_: ibdknox: I did install cljsbuild 0.1.2 from source ... 13:08 ibdknox: dnolen_: I wouldn't think that would make a difference, though if the cljs compiler got AOT'd when you installed, all sorts of terrible things would happen 13:09 dnolen_: ibdknox: hmm, would lien install have triggered AOT? 13:09 ibdknox: dnolen_: not sure, lein run does 13:09 uvtc: gtrak, I'll use whatever's more customary in the Emacs world. Which is more common? ~/elisp or ~/.emacs.d? 13:10 joegallo: the latter, imho 13:10 dnolen_: ibdknox: did emezeske put cljsbuild up somewhere? 13:10 ibdknox: it's on clojars 13:12 gfredericks: so lein-deps dumps an old hiccup into my lib/dev, and I'm not sure how to figure out how it got there 13:13 the dependency:tree ignores the dev deps I think 13:15 TimMc: Does the pom have the dev-deps? 13:15 gfredericks: I've tracked it down to the lein-ring plugin 13:16 rvid: Is lein-swank and swank-clojure the same thing? 13:16 technomancy: rvid: lein-swank runs in leiningen; swank-clojure runs in your project 13:16 two parts of the same project 13:16 gfredericks: TimMc: yeah the pom.xml has them, but based on the docs it seems that dependency:tree is broken for specifying alternate scopes 13:17 so I'm hopping around github following the dependencies around 13:17 rvid: technomancy: i'm running into this problem https://github.com/technomancy/swank-clojure/issues/104 13:17 dnolen_: ibdknox: huh, got it from clojars, same thing, REPL starts but it doesn't seem to be connected to browser 13:18 rvid: I have [lein-swank "1.4.3"] in my .lein/profiles.clj. and i'm using leiningen 2 13:18 am i missing something? 13:18 gfredericks: ah yes that is it. 13:18 technomancy: rvid: that may not have made it into a release yet 13:18 ibdknox: dnolen_: weird. I'm not sure, it worked for me so long as I had the (repl/start ..) thing in my cljs 13:18 rvid: ahh. alright. thanks 13:19 gfredericks: the culprit is lein-ring depending on ring-devel 1.0.2 13:19 dnolen_: ibdknox: you mean repl/connect ? 13:19 ibdknox: dnolen_: ah, yeah that 13:20 dnolen_: trying it now 13:22 dnolen_: worked for me on os x 13:22 lein 1.7 13:22 uvtc: gtrak, joegallo: changed ~/elisp to ~/.emacs.d. Thanks. 13:22 dnolen_: ibdknox: k, perhaps an issue with cljsbuild + lein2 13:22 ibdknox: ah, prehaps 13:23 Iceland_jack: How would you convert a string encoded in hex to ascii? 13:23 similar to Python's <str>.decode('hex') 13:31 dnolen_: ibdknox: thx for trying that, definitely a lein-cljsbuild + lein2 issue, work fines with lein 1.7 13:32 Iceland_jack: (map char (map (fn [[a b]] (Integer/parseInt (str a b) 16)) (partition 2 cipher))) works fine I suppose 13:34 uvtc: Oh shoot. I was hoping to get more feedback on the Brief Beginner's Guide before it was linked to from r/clojure or HN, but it seems that's already happened. 13:35 ibdknox: uvtc: link? 13:38 TimMc: uvtc: Better comment to let people know it's a WIP 13:39 (patches accepted, etc.) 13:39 s/accepted/welcome/, that's the phrase 13:40 ibdknox: uvtc: I think the one thing you could do that shouldn't be too hard and would provide instant benefit is syntax highlighting 13:41 dnolen_: ibdknox: so when you work with lein-cljsbuild, are cljs files inside jars picked up? 13:41 ibdknox: dnolen_: yes 13:41 uvtc: ibdknox, Argh! That's right --- I'd made a note for myself last night to update my version of Pandoc that syntax highlights Clojure ... will get on that. 13:41 Also, anyone have a graphic I could use on the main front page? It needs something. 13:47 TimMc: uvtc: Big, fat Clojure symbol. 13:47 uvtc: TimMc, Can I just swipe it like that? 13:47 TimMc: Like, 2000px tall. 13:47 NO idea. I think other people have? 13:48 ibdknox: no you can't 13:48 technomancy: it's trademarked 13:48 ibdknox: not without permission 13:48 uvtc: Well, if there's any graphic designers out there, you'd better save me from myself before I break out the colored pencils and my digital camera. :) 13:56 TimMc: Copyrighted *and* trademarked, I'm sure. 13:58 and maybe a patent for "Mechanism for showing both a yin-yang and a lambda at the same time" 13:59 uvtc: TimMc, Right. Won't try to copy it. 14:00 Does Clojure have any unofficial logos? Hm. 14:00 TimMc: Maybe if you can combine some other functional programming and philosophical/religious symbology? 14:01 amalloy: it almost seems like "a photo of rich hickey" answers both of the last two questions here 14:01 TimMc: snrk 14:01 uvtc: hahahaha. 14:09 bitrot: uvtc: Why not a glider? (http://www.catb.org/hacker-emblem/). It also looks like a form from a Go board. 14:12 TimMc: +1 14:13 uvtc: bitrot, I like to think of the beginner's guide as a sort of "here's your helmet, off you go!" sort of document... 14:15 * zamaterian thinks glider looks like Go :) 14:17 TimMc: As long as no one thinks of Google's Go language. 14:17 gf3: hey ibdknox, did you see my issue/question on fetch re: security? 14:18 rvid: hey, anybody know how i can force leiningen to use swank-clojure 1.5.0-SNAPSHOT? 14:19 ibdknox: gf3: remotes are just specialized routes, basically, so you'd use what you do for web pages in general :) 14:19 gf3: ibdknox: so let's say I'd like to handle it generally, I'd use a pre-route with the specialised /pinotwhatever route? 14:20 rvid: I have it under dev-dependencies but it downloads 1.4.0 every time I launch swank :( 14:20 ibdknox: gf3: yeah 14:20 actually 14:20 that won't currently work 14:20 hm 14:21 zamaterian: In clojure 1.4 is there any changes to the ns macro regarding :use vs :require ? 14:21 ibdknox: gf3: using a pre-route would require a change to fetch 14:21 probably a good one 14:21 amalloy: require now has a refer option in 1.4, i think 14:21 gf3: ibdknox: mmm 14:21 ibdknox: such that remotes are no longer middleware, but just a normal route themselves 14:22 gf3: ibdknox: that sounds like a good change 14:22 ibdknox: also, I'd love to chat with you sometime about noir-cljs 14:22 ibdknox: gf3: what about it? :) 14:23 gf3: ibdknox: just about some strategies, for example requiring/watching an entire directory causes some dependency resolution issues 14:24 ibdknox: hm, I haven't run into anything 14:25 gf3: ibdknox: one solution might be to do as lein does, and define a :main 14:25 ibdknox: wait, what? 14:26 noir-cljs is a lib, defining a main would suggest you're using it outside of a project? 14:27 gf3: ibdknox: no i mean as a config option to noir-cljs 14:27 ibdknox: it seems that closure compiler doesn't re-arrange things when you just sic it on a directory, so sometimes your (:require)s are out of order 14:28 ibdknox: gf3: woah, do you have a repro case? 14:28 gf3: I've certainly never seen that and I've been doing basically everything you can in terms of dependencies in CLJS 14:28 gf3: ibdknox: sure 14:29 ibdknox: btw, this is what I was proposing → http://cloud.gf3.ca/EwOr 14:29 ibdknox: and that would tell CLJS what exactly? 14:29 that'd have to make its way into the compiler, wouldn't it? 14:32 gf3: ibdknox: well it would compile that file, instead of all of src-dir 14:32 ibdknox: these are the kinds of errors: http://cloud.gf3.ca/EwJD 14:33 ibdknox: are you absolutely certain you have everything right? Those errors usually indicate something got typo'd in an ns decl 14:33 in this case, scm-js.common 14:34 gf3: ibdknox: 100%, check this out 14:34 ibdknox: so I comment out my requires to [scm-js.common :as common] 14:34 ibdknox: and this is the very end of my bootstrap.js → http://cloud.gf3.ca/Ew3u 14:35 ibdknox: interesting 14:35 if you put up something I can run that does this, I'll gladly take a look 14:36 gf3: ibdknox: sure thing, I'll see if I can make a reduced test case 14:36 ibdknox: but in the meantime, what would you recommend to secure my remotes? 14:37 ibdknox: you'd have to do the check inline and just return nil. You could wrap that in a macro easily 14:37 I'll fix fetch tonight 14:38 to enable the pre-route 14:38 gf3: ibdknox: wow thanks, no rush though, just wanted your thoughts 14:39 ibdknox: no worries, it's an easy fix and the right thing to do 14:39 originally I didn't do that so that others outside of Noir could use it 14:39 but it's probably not worth that 14:44 technomancy: aperiodic: ping 14:47 uvtc: technomancy, thanks for the help last night. I noticed that aperiodic filed a bug at ato/clojars-web, and since I also wasn't able to connect, I commented on the bug. 14:48 technomancy: uvtc: I think I may have found the bug 14:49 uvtc: technomancy, yay! If you've got anything you'd like me to try, please fire away. 14:50 technomancy: uvtc: can you try again? 14:50 dnolen_: ibdknox: k got everything working. lein-cljsbuild really solves a lot of problems. 14:51 uvtc: technomancy, Seems to have worked! 14:51 technomancy, Thank you! What was the bug? 14:52 technomancy: cool 14:52 there were two authorized_keys files in the data dir; clojars was configured to write updates to the wrong one 14:52 ibdknox: dnolen_: yeah :) I started building a noir template the other day for cljs projects. lein new cljstemplate cool & lein run = working clojurescript project 14:52 technomancy: I'm not sure why they are both there 14:52 ibdknox: using noir-cljs it handles all the watching and such automatically 14:53 technomancy: maybe _ato can comment on that when he comes online later 14:53 dnolen_: ibdknox: what is cljstemplate? 14:53 ibdknox: dnolen_: it'll be a lein-newnew (or lein 2 new) project template later tonight :) 14:53 dnolen_: basically the same as lein noir new some-proj 14:54 uvtc: technomancy, As I previously mentioned, yesterday I was trying to give clojars my key. It failed to accept the key multiple times, but then later in the day it mysteriously accepted my key. 14:54 ibdknox: dnolen_: except it includes all the cljs trimmings 14:54 no one will be able to complain about not having a starting point for a new project anymore ;) 14:55 dnolen_: ibdknox: excellent! 14:55 uvtc: ibdknox, wheee! :) 14:55 ibdknox: dnolen_: as a side note, I started on a neat little thing yesterday, extrapolating from bret victor's ideas on code and came up with a visual way to write programs 14:56 dnolen_: ibdknox: another screencast forthcoming? 14:56 ibdknox: dnolen_: with the idea that code is simply the serialization mechanism for programs 14:56 dnolen_: hopefully 14:58 gtrak: on a related note, I heard labview just recently got refs, ibdknox ever use labview? 15:00 gfredericks: is it plausible that the latest lein-ring fails when you specify a port? 15:00 (in particular fails for never converting the string-arg to an int) 15:01 gtrak: kind of a messy gui programming language: http://drivex.com/software/1280/labview.jpg 15:07 y3di: is clojure generally faster than python and ruby 15:07 gtrak: yes 15:08 one advantage is you can easily work at any point up and down the abstraction stack, which is much harder in python imo, so it's as fast as java if you want it to be 15:09 y3di: is it easier to write fast code (on the first attempt) in clojure or java? 15:09 this is obviously probably subjective 15:10 TimMc: Depends what you are writing. 15:10 gtrak: i mean... if you're using immutable data structures, I'd argue your programs are doing different things, I think you/others have got it framed wrong 15:11 clojure itself doesn't have a lot of dynamicity in its runtime, there isn't any overhead like that 15:11 y3di: hmmm, you're probably right. I've only grasped the tip of the clojure language 15:11 what do you mean dynamicity? 15:11 * gfredericks wonders what's at the tip 15:11 pjstadig: ,*clojure-version* 15:11 clojurebot: {:interim true, :major 1, :minor 4, :incremental 0, :qualifier "master"} 15:11 gfredericks: interim; 15:11 pjstadig: ,(bigdec (inc (bigint Long/MAX_VALUE))) 15:11 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Value out of range for long: 9223372036854775808> 15:12 pjstadig: :( 15:12 gfredericks: is that some alternative to SNAPSHOT? 15:12 gtrak: y3di, well, I mean, when you write python, you have all this object layer __call__ stuff, but clojure just has normal java function calls, and vars are a slight overhead in the dynamic case, multi-methods counts as a dynamicity, though you only pay for it if you use it 15:12 TimMc: ,(clojure-version) 15:12 clojurebot: "1.4.0-master-SNAPSHOT" 15:13 gfredericks: huh 15:13 pjstadig: bigdec is broken on 1.3/1.4 15:13 it doesn't handle clojure.lang.BigInt 15:14 hiredman: ,(bigdec (bigint 1)) 15:14 gtrak: y3di, I guess I really mean run-time indirection 15:14 clojurebot: 1M 15:14 TimMc: ,(inc (bigint Long/MAX_VALUE)) 15:14 clojurebot: 9223372036854775808N 15:14 pjstadig: hiredman: it coerces a Number to long 15:14 TimMc: ew 15:15 pjstadig: which causes the error i just got 15:15 teasupplies: Inux 15:15 pjstadig: it handles java.math.BigInteger 15:15 but not clojure.lang.BigInt, which is what you get now in 1.4 15:15 TimMc: &(bigdec (inc (bigint Long/MAX_VALUE))) 15:15 lazybot: java.lang.IllegalArgumentException: Value out of range for long: 9223372036854775808 15:15 TimMc: and 1.3 15:16 pjstadig: sure 15:16 amalloy: file a jira ticket? should be handled by 1.5 :P 15:17 gtrak: y3di, a clojure fn-call is just calling an IFn method on an instance of a class generated by the compiler, quite fast 15:23 emezeske: [5~q 15:23 oops! 15:26 pjstadig: ,(bigdec (inc (biginteger Long/MAX_VALUE))) 15:26 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Value out of range for long: 9223372036854775808> 15:26 pjstadig: eh 15:27 ,(bigdec (biginteger (inc (bigint Long/MAX_VALUE)))) 15:27 clojurebot: 9223372036854775808M 15:27 pjstadig: now isn't that much nicer? 15:28 yoklov: is there any way I can def multiple vars at once using destructuring? 15:28 i'm writing a small data processing script and i currently have something like (def foo (first a-seq)) (def bar (rest a-seq)) 15:30 joegallo: just my immediate thought -- it seems a bit odd that you're doing defs there. is this in a .clj file or hacking at the repl? 15:30 yoklov: eh, mostly at the repl 15:30 joegallo: k 15:31 you know about let's destructuring, right? you could use that at the call site 15:31 that is, rather than (some-other-thing foo bar) ; where foo and bar come from your defs 15:31 you could (let [[foo & bar] a-seq] (some-other-thing foo bar)) 15:32 so foo and bar only exist inside the let, and you don't have to def them at all 15:32 yoklov: right, i'm aware 15:32 joegallo: okay, then i have no suggestion 15:33 yoklov: lol, thats okay, it's certainly bad form to def so many things like this, its largely for convenience so that if i acciedentally cause the repl to start printing out this enormous vector i can halt it and restart without losing what i've done so far 15:33 so two defs is fine, just was curious if i could do something shorter there 15:34 TimMc: yoklov: repl-y can Ctrl-C without losing the repl 15:34 so I hear 15:34 yoklov: repl-y? i've been using lein repl which… sort of stinks 15:35 brehaut: repl-y is the new lein 2 repl (as well as stand alone), its much better 15:35 yoklov: hm. 15:46 ibdknox: gtrak: never heard of labview 15:48 gtrak: ah, yeah that seems way messier than what I was thinking 15:50 gtrak: we did a lot of work in it for EE stuff, sensors and such, they have really cool DACS and ADCs actually, but the software sucks :-) 16:06 ewok-lord: hello clojureites 16:07 AimHere: You sure it's not clojurists? 16:07 ewok-lord: Pedantic Semantics. I'm in the right place :) anyways I'm writing my first proper clojure prog 16:08 uvtc: clojurians? 16:08 AimHere: clodjers 16:08 ewok-lord: To automate the creation of little projects because I often find myself making a folder inside my dev folder and making a project folder and adding a file and making it executable and only then writing it 16:09 A CLI utility and I'm using this project to learn clojure 16:09 And become a proficient clojurista 16:10 gfredericks: clojoids 16:11 ewok-lord: Always be clojing (GGR reference) 16:12 * dan_b is wondering whether someone should be collecting these aphorisms and sending slime patches to augment its current collection of startup messages 16:12 dan_b: after all, "lemonodor-fame"? lemonodor was last updated ~ 2008 16:13 llasram: Hasn't technomancy effectively forked SLIME at this point? 16:13 dnolen: llasram: no 16:13 TimMc: gfredericks: conjurers 16:13 dnolen: llasram: we're stuck on a version from 2010 16:13 llasram: dnolen: Ok, fair enough then 16:13 gfredericks: clojerms 16:14 yoklov: so, i'm dealing with some dates (in unix time). when i do (Date. 1254089974) i get #<Date Thu Jan 15 07:21:29 EST 1970>. This is wrong, it should be something like #<Date Sun Sep 27 10:19:34 EST 2009>. Am I doing something obviously wrong? 16:14 dan_b: I wonder if I still have a commit bit for the original 16:14 yoklov: multiply by 1000? 16:14 yoklov: eitehr java or js counts in milliseconds, I can't remember which 16:14 amalloy: java 16:14 yoklov: yeah that fixed it 16:14 thanks a ton 16:15 mdeboard: 16:10 <ewok-lord> Always be clojing (GGR reference) 16:15 lol 16:16 TimMc: hhe 16:17 * gfredericks knows heck if what GGR is 16:18 uvtc: gfredericks, "always be closing" , famous movie scene 16:19 technomancy: yoklov: java.util.Date is the worst class in the entire JDK 16:19 gfredericks: oh this must be one of those times when people ten years older than me talk about movies from when I was six. 16:19 technomancy: arguably the very act of using it counts as "doing something wrong" 16:19 uvtc: gfredericks, hahahaha 16:20 gfredericks: those people always have such high opinions of the movies from that time period 16:20 AimHere: Either that or low opinions of modern movies 16:20 llasram: Like /The Artist/? I mean, Best Actor for a one line part? 16:21 gfredericks: such an odd coincidence that as your taste improves everything seems to get worse 16:21 technomancy: gfredericks: alternate explanation: http://www.smbc-comics.com/index.php?db=comics&id=2253#comic 16:21 mdeboard: p sure "always be closing" and "coffee's for closers" is one of those lines like "frankly whoever, i don't give a hoot, don't pollute" or "number 5 alive" that stands apart from its movie 16:21 gfredericks: technomancy: yeah I was thinking along those lines :) 16:25 yoklov: technomancy: yeah, that seems about right. theres no alternative though, is there? 16:26 technomancy: yoklov: if you have to do date calculations you need to use joda-time. clj-time is supposedly a pretty good wrapper for it. 16:27 yoklov: i see, thanks. 16:29 TimMc: gfredericks: Glengarry Glen Ross 16:29 if I have the spelling right 16:29 (probably not) 16:29 aperiodic: technomancy: both of my keys work now. thanks! 16:30 * TimMc chooses to imagine that aperiodic has a keyboard with only 2 keys 16:30 aperiodic: lol 16:30 i'm pretty into chording 16:30 TimMc: rhythm-based keybindings 16:30 mdeboard: lol 16:31 amalloy: with ten modifier keys, you only need two character keys 16:31 mdeboard: leiningen-DDR 16:31 TimMc: nice 16:32 yoklov: i'd definitely be happier if i had footpedals for M and C 16:35 llasram: yoklov: http://www.kinesis-ergo.com/fs-savant-elite.htm 16:35 jsabeaudry: llasram, Ah you beat me to it! 16:35 Damn! 16:35 llasram: heh 16:36 amalloy: i have M/C footpedals, but mostly forget to use them 16:36 jsabeaudry: llasram, Are you using a kinesis keyboard? 16:36 TimMc: amalloy: ! 16:36 llasram: jsabeaudry: I am. I've never tried the pedals though. Switched to a standing workspace at about the same time, and seemed like it would be too awkward 16:36 technomancy: yeah, I wish foot pedals could work with standing desks 16:36 TimMc: Oof, yeah. 16:36 llasram: amalloy: I guess they aren't all that useful? 16:37 amalloy: and unless you have piano training (i don't), it's impossible to be as fast as you could with regular modifier keys; the footpedals are really just for if a finger gets tired 16:37 * gfredericks found a major bug in lein-ring and so created a pull request instead of just whining about it 16:38 llasram: Maybe you cloud drill at it? Seems like it wouldn't be any harder than just learning a new keyboard / layout 16:38 s,cloud,could, 16:38 (not you == amalloy, but just someone inclined to try foot pedals) 16:38 yoklov: your foot has to travel further than your finger though 16:39 amalloy: llasram: the difference is that it's easier to coordinate between two (three) fingers than between fingers and feet 16:39 gfredericks: I can imagine that due to the much longer nerve-distance between foot and hand that it might be a whole nother matter to coordinate them 16:39 llasram: Fair enough. What we need are toe pedals 16:39 emezeske: I think speedwise the biggest problem with footpedals would be the coordination 16:39 TimMc: I have a standing workstation, but I work barefoot. 16:39 technomancy: toe pedals 16:39 TimMc: I could see having a pressure pad for each big toe. 16:39 Raynes: amalloy: Yeah, your feet are surprisingly detached from your body. 16:39 amalloy: wut. that's news to me. did you cut off my feet? 16:39 TimMc: Eh, it's all about training. 16:39 ibdknox: I have a solution for all of this. Just use vim ;) No more modifiers necessary! 16:39 yoklov: standing sounds really nice. i sit for way too much of my day 16:39 emezeske: ibdknox: Problem solved. 16:39 TimMc: ibdknox: Don't mode me in. ;-) 16:40 Raynes: amalloy: I could. 16:40 amalloy: NOMODES 16:40 TimMc: (bro) 16:40 ibdknox: lol 16:40 Raynes: ibdknox: Or evil-mode. 16:40 mdeboard: Cannot evaluate symbol "bro" in this context 16:40 Raynes: Modifier keys not always necessary. 16:40 TimMc: You could use sticky-keys. 16:42 llasram: Maybe attach electrodes to one's facial muscles 16:43 For input, that is 16:43 Left ear twitch == hyper+super 16:48 TimMc: EEG-based keyboard. 16:48 arohner: w/ emacs package manager, how do I upgrade an installed package? 16:49 metajack: arohner: I just do it the same way as I install them. 16:49 jaen: okay, I thought the thing about emacs being an operating system was mostly in jest 16:49 not so sure now ; d 16:49 arohner: jaen: a significant chunk of the users in this channel are *in* IRC emacs, and send email from emacs 16:50 I would make emacs my web browser if I could 16:50 amalloy: w3-mode? 16:50 TimMc: jaen: Package manager, mail client, file manager, window manager... 16:50 amalloy: or www-mode or whatever it's called 16:50 technomancy: amalloy: deprecated for like seven years 16:50 amalloy: :( 16:50 TimMc: also you can apparently program in it? 16:50 jaen: I can't get past all this escape-meta-alt-control-shift stuff to be honest 16:50 gfredericks: emacs is the ultimate complection 16:51 arohner: amalloy: I want a modern browser, like webkit 16:51 jaen: Though say org-mode looks really awesome 16:51 technomancy: xembed is probably the way forward there 16:51 jaen: TimMc: wait, window manager? : D 16:51 TimMc: sure 16:51 gfredericks: \forall X,Y \in things (emacs complects X and Y) 16:51 TimMc: iling, of course 16:51 arohner: metajack: I try to install magit-1.1.1, and it says 1.0.0 is already installed 16:51 jaen: I thought they'd use screen for that or somesuch ; d 16:51 TimMc: in the same sense that screen and tmux and window managers :-P 16:52 jaen: yeah, what I thought ; d 16:52 still, funny 16:52 TimMc: jaen: It's not much worse than learning the standard keyboard shortcuts for an OS. 16:52 arohner: technomancy: would that allow emacs to control my web browsing keys? 16:53 TheStroker: list 16:53 technomancy: arohner: I think so 16:56 mefesto_work: when running clojure ring apps is deploying as war files the typical approach or are they usually ran as individual processes with the ring-jetty-adapter? 16:57 deploying to production 16:57 technomancy: depends on your background 16:57 usually people who are used to war files go on making war files and people comfortable managing server processes keep doing that =) 16:58 mefesto_work: IMHO, managing them as individual processes seems easier 16:58 ibdknox: it's way easier ;) 16:58 mefesto_work: we've been using jboss for a long time 16:59 but lately more and more of our internal apps are clojure and i've just been hosting them as individual processes and it's been soo much nicer :) 16:59 ok, how about running these things directly from leiningen? good/bad why? 16:59 ibdknox: lein trampoline run 16:59 ftw 16:59 technomancy: mefesto_work: in lein 1.x you can set LEIN_NO_DEV=y and use lein trampoline run 16:59 mefesto_work: i've been using lein uberjar and running the self contained jar so far... 17:00 technomancy: if you don't set LEIN_NO_DEV then you get dev-deps and dev-resources on the classpath, which is a no no 17:00 mefesto_work: technomancy: you say lein 1.x ... so 2.0 you just setup the profile you want? 17:00 aperiodic: trampoline quarantines lein's jvm from the server processes's? 17:00 technomancy: yeah 17:01 mefesto_work: something like lein prod run ? 17:01 technomancy: aperiodic: it exits leiningen's jvm 17:01 mefesto_work: right 17:01 aperiodic: is that just for safety, or are there performance benefits to that? 17:01 mefesto_work: very nice 17:01 ibdknox: mefesto_work: fwiw, I just run all my sites with lein and put nginx in front of it 17:01 technomancy: aperiodic: memory savings mostly 17:01 there aren't really any safety issues 17:01 also access to stdin 17:01 mefesto_work: ibdknox: precisely what i was wanting to do 17:02 hhutch: ibdknox: for auto deploying to servers (with pallet), wouldn't you rather have a bundled uberjar and not have to depend on lein getting deps ? 17:02 technomancy: hhutch: it's important to freeze everything you need for your project at build time, yeah 17:02 whether that's an uberjar or tarring up the project along with the corresponding .m2 is up to you 17:02 ibdknox: hhutch: it depends on what matters to you 17:03 I don't really care if lein gets the deps for me 17:03 technomancy: clojurebot: repeatability? 17:03 clojurebot: repeatability is crucial for builds, see https://github.com/technomancy/leiningen/wiki/Repeatability 17:04 hhutch: i get nervous about clojars/external maven repos 17:04 ibdknox: well, I also don't change deps enough to encounter issues there 17:04 hhutch: it's fine when i'm in front of the keyboard, but for automated deployments .. ? 17:05 technomancy: hhutch: lein2 allows you to set the local repo on a per-profile basis 17:05 so your prod profile can have :local-repo ".m2/repository" 17:05 then you can have "lein with-profile prod tar" just tar up the project dir and you're set 17:06 hhutch: right, but is there something about jar you don't like that using that method solves? 17:06 s/jar/uberjar 17:06 technomancy: hhutch: sometimes it can be nice to have the ability to run other tasks from a deployed checkout 17:06 but there's nothing wrong with uberjar; that's probably the most straightforward way to do it 17:07 hhutch: technomancy: well, seeing i already have a pallet interface to lein, you're probably right, it would probably be pretty useful to be able to run plugin commands from the shell 17:08 technomancy: on the other hand having lein in production means you're more likely to screw around when you really shouldn't =) 17:08 hhutch: :) 17:08 ibdknox: technomancy: that's the way to win ;) 17:09 * technomancy keeps ibdknox away from his production apps 17:09 ibdknox: haha 17:09 technomancy: as if I have any 17:09 ibdknox: in my "younger years" I did it once or twice 17:10 it was so nerve wracking I decided it wasn't worth whatever perceived benefits there were 17:10 technomancy: I was always tempted to push out hotfixes over our AMQP repl 17:11 ibdknox: "Oh I'll just ssh into prod and modify the config ..." 17:11 lol 17:11 TimMc: PHP, the king of hotfixes. 17:12 ibdknox: oh yes, it was PHP 17:13 TimMc: Edit on the server until it works, occasionally take a backup to local disk. 17:13 That's how the big companies do it, I am sure. 17:13 pastjean: TimMc: i can tell you yes 17:14 emezeske: I have a buddy that does PHP on FTP sites. I love his common pattern of "hmm, I need to run a script. I will write in in PHP, upload it as a CGI, and then hit it via HTTP to run it" 17:14 mefesto_work: ibdknox: for your nginx/lein setup; how do you minimize downtime when deploying a new version of an app? 17:14 ibdknox: TimMc: I was working on newbalance at the time... so 17:14 TimMc: emezeske: Been there. 17:14 ibdknox: mefesto_work: depends on how you want to do it 17:14 technomancy: ibdknox: how much faster is nginx vs jetty for static files? 17:15 emezeske: TimMc: I'm glad that's in the past tense! 17:15 TimMc: Now I have a local site and a production site, with a Makefile that does deployment. :-) 17:15 I'm comfortable there for personal projects. 17:15 ibdknox: technomancy: anecdotally, a lot 17:16 mefesto_work: I've used two methods, one is crazier than the other 17:16 technomancy: ibdknox: enough that you do it because you found you needed it, or just out of habit? 17:16 ibdknox: technomancy: jetty is "fast enough" for anything most people are building 17:16 so mostly habbit 17:16 I also just like reverse proxying so I can run multiple on one box 17:17 mefesto_work: ibdknox: i was thinking of placing a new version on a different set of ports and gracefully reloading nginx and when all traffic is off the old versions, shutting those processes down but that seems teadious :) 17:17 bsteuber: did someone already build a clj-data->html formatter? 17:17 hiredman: jetty runner! 17:17 mefesto_work: ibdknox: but that's just for simple changes (no db updates) 17:17 ibdknox: mefesto_work: that's the easy way and I do that most of the time. I was working on a project called sherpa that was going to do that automagically, but got sidetracked 17:18 mefesto_work: the other way to do it is with start and shutdown signals from the servers 17:18 I have them talk using unix pipes :) 17:19 mefesto_work: ibdknox: not sure i follow, the new versions are listening for signals for the old version processes? 17:20 app v2 waits to receive a shutdown signal from app v1 process? 17:23 ibdknox: yep 17:41 sjl: is there a standard way to implement a "stand-alone ring app", similar to Django's apps? 17:41 i.e. install this library and say what URL to use as a base 17:42 weavejester: sjl: If I'm understanding you right, you pretty much get that for free... 17:42 hiredman: I don't think there is a standard way, but I think you would it as a middleware 17:42 sjl: weavejester: I don't think I'm explaining it well enough 17:42 weavejester: sjl: Could you explain a little more? Maybe I'm misunderstanding. 17:43 sjl: weavejester: here's an example: http://metrics-clojure.readthedocs.org/en/latest/ring.html#exposing-metrics-as-json 17:43 weavejester: basically I added a ring middleware to my metrics-clojure library that will expose your metrics as JSON at /metrics 17:43 ibdknox: so routes as a library? 17:43 hiredman: like, if you were to want to take3rd party ring handler and root it under url X, and that rin handler used the Location: header, it is kind of painful 17:44 take a 3rd 17:44 and then that 17:44 sjl: weavejester: In this case it's just one URL, so I can just parse the URI, see if it equals the URI, and if not pass it through to the orig handler 17:44 weavejester: sjl: Do you have a handler that the middleware wraps? 17:45 sjl: weavejester: sure. I guess the thing I'm wondering is how to do routing "right" inside of a middleware 17:45 weavejester: In Compojure, you can just write: (context "/foo" [] your-handler) 17:45 sjl: should I just use Compojure to create a "sub-handler" that I can pass the req map to if it matches the base URL? 17:45 or Moustache or whatever 17:46 weavejester: sjl: In Compojure, context will do that for you. 17:46 e.g if you have (defroutes handler (GET "/" [] "Hello World") (route/not-found "Not Found")) 17:47 sjl: weavejester: yeah, but I'd want the app to be usable with Noir, etc. Basically any ring app, which means it needs to be "invoked" through middleware 17:47 weavejester: Then (context "/foo" [] handler) will mean that "/" becomes "/foo" 17:47 I'm not sure if Noir has a mechanism for doing it. 17:48 ibdknox: weavejester: you can drop compojure routes in directly 17:48 :) 17:48 weavejester: I would be inclined to expose it as a handler, and as some middleware. 17:48 ibdknox: But is there an equivalent to the context macro? 17:48 ibdknox: you can just use the context macro in the the thing you give me 17:49 it will add it to my call to (defroutes ..) 17:49 sjl: weavejester: does that context thing strip off the /foo before passing it along? 17:49 weavejester: ibdknox: Like… (defpage "/foo" [] (context "/foo" blah)) 17:49 ibdknox: you use a different thing instead of defpage 17:49 weavejester: sjl: Yes. It actually keeps the :uri the same, but adds :context and :path-info keys 17:49 sjl: ah, ok 17:50 weavejester: sjl: Compojure (and Noir) check :path-info first, then :uri 17:50 ibdknox: Ooh, which different thing? 17:50 sjl: I see 17:50 ibdknox: weavejester: it's actually called compojure-route haha 17:50 (had to look it up) 17:50 weavejester: ibdknox: Ohhh - hah 17:50 added for this very purpose :) 17:51 weavejester: Maybe ring should have a "wrap-context" in 1.2. So far :context and :path-info are de-facto standards, rather than officially part of Ring. 17:52 Although, I guess they don't need to be part of the Ring SPEC 17:53 As :cookies and :session aren't part of the SPEC either, but just added by middleware 17:53 ibdknox: it would be nice to have a standard though 17:53 weavejester: Well, the SPEC is just for the basic HTTP request that comes out of the adapter, or whatever. 17:54 ibdknox: yea 17:54 I guess I was more agreeing with your original statement, that having a wrap-context would be nice :) 17:54 weavejester: There's currently a private wrap-context in Compojure. 17:55 Adding wrap-context to Ring 1.2 would make Compojure even smaller. 17:55 ibdknox: soon it'll disappear :p 17:55 and then there will just be ring haha 17:55 the inverse of how things started 17:55 everything was compojure before, right? 17:55 weavejester: ibdknox: Haha 17:56 ibdknox: it's like an hour glass ;) 17:56 weavejester: ibdknox: Yeah. Compojure started out without any abstraction 17:56 ibdknox: Then Mark came up with the Ring SPEC 17:56 ibdknox: I couldn't see the point at first, until I tried it and discovered how much better it worked. 17:57 ibdknox: haha :) 17:57 weavejester: it's the little things 17:58 weavejester: Ring is by far the best web abstraction layer I know of 17:58 But I'm a little biased ;) 17:58 ibdknox: agreed 17:58 it's so damn cool to be able to say, I want NIO now 17:58 let me just run netty 17:58 done 17:58 I can't think of many other platforms that make a webapp so damn portable 17:59 jcrossley3: ibdknox: wasn't ring inspired by rack? 18:00 emezeske: jcrossley3: which in turn was inspired by WSGI :) 18:00 weavejester: Ring is inspired a lot by Rack 18:00 ibdknox: definitely 18:00 weavejester: It's kinda weird that Rack seems almost functional, rather than OOP. 18:00 As the Rack apps are effectively Procs. 18:01 sjl: weavejester: ibdknox: does something like this look like roughly what I'd need? http://cljbin.com/paste/4f5e7202e4b004260b29166c 18:01 jcrossley3: ibdknox: so by "many other platforms" you meant "more than 2"? ;) 18:01 ibdknox: jcrossley3: I didn't think there was a good NIO for rack? 18:02 sjl: looks like it 18:02 weavejester: context takes a binding vector/map 18:02 The idea being that contexts can have parameters 18:03 e.g. (context "/user/:id" [id] …) 18:03 sjl: ibdknox: hmm... how would I avoid making the user import from three different places without coupling the lib to Noir? 18:03 jcrossley3: ibdknox: here's one: http://kevwil.github.com/aspen/ 18:04 ibdknox: jcrossley3: pretty new :p 18:04 jcrossley3: my point still stands though 18:04 there's far more than just ruby in this world 18:05 and most platforms haven't enabled that :) 18:05 jcrossley3: ibdknox: understood 18:05 ibdknox: haha trying to do that on .net? 18:06 either way though, it's just cool :D 18:06 weavejester: sjl: Why would you need to couple the lib to Noir? 18:06 sjl: weavejester: so I could deal with the compojure-route call in my own app 18:06 without making them import it 18:06 arohner: did swank clojure recently add support for clearing the NS when doing C-c C-k, or am I imagining things? 18:06 ibdknox: sjl: I don't think it's so bad to include compojure-route 18:06 sjl: you can hide the context call 18:06 technomancy: arohner: I don't think so 18:07 arohner: technomancy: would you like a patch that does that? 18:07 weavejester: sjl: Sorry, I still don't understand why... 18:07 technomancy: arohner: if it did it on C-c C-l that would be cool 18:07 C-c C-l already forces a reload of all namespaces the current one requires 18:08 sjl: weavejester: hang on, let me make another example 18:08 arohner: technomancy: is that the only difference between C-c C-k and C-c C-l ? 18:08 weavejester: sjl: If you *just* expose the route/handler, then people using Noir or Compojure can use it anyway they choose. 18:08 technomancy: arohner: it's the only difference I know of 18:08 weavejester: sjl: If you want some middleware to make it a little easier, you can, but the handler on its own is sufficient. 18:08 technomancy: oh, C-c C-l prompts for a filename 18:09 ibdknox: weavejester: I think he just wanted to limit the number of things a person has to include in the noir case 18:09 weavejester: they'll need to use compojure-route and his thing and context 18:09 weavejester: he could hide the context call easy enough, bringing it down to two 18:09 weavejester: ibdknox: Ohh 18:10 I'd be tempted to make a metrics-clojure/noir library for that... 18:10 ibdknox: I wouldn't even worry about it, adding that extra use doesn't seem bad at all :) 18:11 weavejester: ibdknox: I was thinking that maybe a user of some random framework wouldn't want Noir arbitrarily added to the classpath :) 18:12 sjl: ibdknox: weavejester: this version should work for Ring in general, even with Noir/Compojure, right? http://cljbin.com/paste/4f5e7486e4b004260b29166d 18:12 weavejester: ibdknox: It seems a little off for a generic Ring library to depend on Noir directly. 18:12 sjl: s/with/without/ 18:12 ibdknox: weavejester: oh no no, not in the lib, just on the noir user's side 18:12 weavejester: ibdknox: Ohhhh 18:12 ibdknox: weavejester: I, as chris, use (compojure-route ..) and we're good to go 18:12 weavejester: ibdknox: Oh, that's completely fine! 18:13 ibdknox: yeah 18:13 it's easy all around 18:13 weavejester: sjl: If you're using Compojure already, you can do something like... 18:13 sjl: yeah, I don't want to make my users import from three kind-of-related libraries to use the app 18:13 * weavejester forks the paste and fiddles. 18:15 sjl: (that paste would require compojure be on the classpath, but the end users don't need to care about compojure if they're using something else) 18:15 the more I think about this the more I think that middleware is the only way to go, because it's the only extension point you really have in generic ring. 18:15 right? 18:16 weavejester: sjl: http://cljbin.com/paste/4f5e7583e4b004260b29166e 18:16 sjl: Handlers are also generic Ring 18:16 I also wouldn't wrap around handler/site prematurely. Frameworks like Noir already do that. 18:17 sjl: ah, so (routes) takes a generic ring handler as a "fallback" at the end? 18:17 weavejester: sjl: No, no. *All* Compojure routes are generic ring handlers. 18:18 sjl: The only difference is that routes can optionally return nil, which means "go onto the next route" 18:18 sjl: so "route" is just a synonym for "handler" 18:19 weavejester: sjl: A route is a handler that can return nil. 18:19 sjl: So all handlers are routes, but not all routes are handlers (technically) 18:19 sjl: As Ring will throw an error if a handler returns nil. 18:20 sjl: ok, I think I mostly understand, at least enough for what I need 18:20 thanks 18:20 zzach: Is there an equivalent for the Common Lisp function position (index of a list element) in Clojure? In CL: (position 7 '(5 6 7 8)) -> 2 18:21 hiredman: :( 18:25 jjido: zzach: don't remember right now, try indexOf. did you search the doc? 18:27 jsabeaudry: zzach, Are you working on improving hyperpolyglot? 18:29 zzach, (.indexOf (into [] '(5 6 7 8)) 7) is what I can come up with 18:29 hiredman: jsabeaudry: :( 18:29 jsabeaudry: &(.indexOf (into [] '(5 6 7 8)) 7) 18:29 lazybot: ⇒ 2 18:29 zzach: jjido, jsabeaudry: thanks, http://stackoverflow.com/questions/4830900/how-do-i-find-the-index-of-an-item-in-a-vector also seems to contain several solutions. 18:29 TimMc: That's funny, I don't think I've ever needed to do that. 18:29 hiredman: a list is a collection and supports indexOf just as 18:29 jsabeaudry: hiredman, oh whoops 18:30 hiredman: but just don't do linear time operations like that 18:30 jsabeaudry: hiredman, We should add that to hyperpolyglot 18:31 technomancy: that list is... really misleading 18:32 there's so much stuff there that's just plain wrong 18:32 hiredman: yep 18:34 ibdknox: wow, yeah that list is terrible 18:34 hiredman: the conflation of property lists and metadata on symbols is just horrible 18:35 ibdknox: even simple things are wrong lol like .length instead of count 18:35 hiredman: maybe its a really old list? 18:35 ibdknox: it says clojure 1.2 18:36 TimMc: lol @ atom 18:36 hiredman: using String/format instead of format 18:37 TimMc: This comparison page is overall kind of neat, but there should be a lot fewer forced comparisons. 18:37 sjl: weavejester: hrm, I tried something like your paste and get a traceback on all URLs: http://pastebin.com/btU6XPbN 18:40 weavejester: sjl: Is base-uri nil? 18:40 sjl: weavejester: nope, println confirms too 18:41 weavejester: sjl: Odd... 18:42 sjl: Let me get back to you on that one. I don't see anything obviously wrong. 18:42 ibdknox: if it turns out to be my fault 18:42 just let me know 18:42 sjl: ibdknox: the only noir-specific thing is add-middleware... that shouldn't cause a problem 18:43 ibdknox: ah, probably not then 18:43 jsabeaudry: TimMc, I found it really useful coming from a background of common lisp 18:43 weavejester: It might be that context doesn't work with symbols or something. 18:44 sjl: weavejester: yeah, just tried that, that's the problem 18:44 replacing base-uri with a string literal works 18:46 weavejester: so I need to define the context URL at compile time? :\ 18:46 weavejester: sjl: That sounds like a bug. Put an issue on the Compojure repo and I'll try and fix it. 18:47 jodaro: ugh 18:49 sjl: weavejester: thanks, done 19:36 blendie: (*) 19:37 !(*) 19:37 Any clojure bot here? :o) 19:37 qbg: &(*) 19:37 lazybot: ⇒ 1 19:38 blendie: &(+ *1) 19:38 lazybot: java.lang.ClassCastException: Cannot cast clojure.lang.Var$Unbound to java.lang.Number

19:38 hiredman: ,(*)

19:38 clojurebot: 1

19:39 blendie: &(+ 1 2)

19:39 lazybot: ⇒ 3

19:43 tolstoy: Using lein 2, I have src/leiningen/dist.clj as a nice custom task. Doesn't work. Has something changed to discourage project-only plugins?

19:45 Adding it to the :plugins doesn't seem an option. It's not deployed anywhere.

19:47 sorenmacbeth: what's the recommended way to import Java classes programmically? i.e. I have some class that stores other classes I want to import (Thrift)

19:48 just use (import)

19:49 tolstoy: sorenmacbeth: I've been able to import interactively, if that helps.

19:49 lein repl

19:50 tmciver: Hi Soren. Yup, IIRC

19:50 tolstoy: (import '[java.util Date])

19:50 sorenmacbeth: yeah, I can do that fine. Specifically, I'm trying to walk the metadata of a Thrift object and import those classes

19:51 amalloy: why would you import them?

19:52 tolstoy: Is there a mailing list for leiningen?

19:52 sorenmacbeth: amalloy: I'm trying to write some macros to pull apart the objects

19:52 amalloy: $google leiningen google group 19:52 lazybot: [leiningen | Google Groups] http://groups.google.com/group/leiningen 19:53 hiredman: sorenmacbeth: why are you doing thrift stuff in a macro? 19:54 sorenmacbeth: hiredman: I want to programmatically create a bunch of functions to access the objects and fields from my schema 19:55 amalloy: you don't need to import anything to do that 19:55 sorenmacbeth: so if I update the schema, functions to access those new objects will be created automatically 19:55 amalloy: yes, I suppose not. I could just us the fully qualified namespace 19:55 amalloy: just use the fully-qualified classnames, if you're doing it programmatically 19:56 sorenmacbeth: amalloy: cheers. overlooked the obvious answer 19:56 francisl: hello, is read-json from clojure.data.json the right function to parse url-encode-form from a post? 19:56 technomancy: tolstoy: Leiningen 2 enforces isolation between itself and your project much better now. you should spin tasks out into plugins if you can. 19:57 if you have to keep it in your project dir for whatever reason you can add something like lein-src to .lein-classpath 19:57 tolstoy: technomancy: Ah, I was just composing a mailing list question about this. 19:57 hiredman: francisl: absolutely not 19:58 tolstoy: technomancy: Where's the info about .lein-classpath? Is that auto-generated? 19:59 technomancy: tolstoy: the docs may not be up to snuff on that; it's just a file in the project root that gets appended to Leiningen's own classpath 19:59 you write it yourself 19:59 tolstoy: technomancy: Ah, okay. I'll give the that a try. 19:59 technomancy: tolstoy: I can't think of a good use case for bundling a task with a project though apart from "we don't have time to do it properly right now" 20:00 tolstoy: technomancy: This is just a simple task to help with our deployment scenario. I want to avoid asking others to run various things to "set up their environment". Esp. since I'm leaving the company and no one else does Clojure. 20:01 technomancy: I'll probably just stick with the older lein, but now I'm just curious. ;) 20:02 technomancy: I have a bash script that checks out the project, calls "lein dist" and thus knows where to get artifacts. I could actually make that script do what "dist" did easily enough. 20:03 technomancy: sure; it's pretty common to ship scripts with the project to handle things that are outside the scope of the JVM 20:04 francisl: hiredman: any cluewhere should I look? 20:04 tolstoy: technomancy: Well, this is in addition to the run.sh. ;) Calls uberjar, moves the script into place…. blah blah. I'm sure there's a better way, if I'd found the right research path at the time. ;) 20:05 technomancy: sure; just wanted to make sure I wasn't missing any solid use cases 20:06 tolstoy: technomancy: With "ant" and other sorts of tools, you can add interesting targets pretty much ad-hoc. That seems to be missing. 20:06 technomancy: Or not? 20:06 technomancy: tolstoy: yes, that's intentional 20:07 hiredman: :/ 20:07 tolstoy: technomancy: Part of the hair-not-on-fire bit? ;) 20:07 technomancy: in my experience one-off tasks are always the result of not thinking through a generalized approach 20:07 but I understand sometimes you don't have time to DTRT, so .lein-classpath is there for that 20:08 hiredman: francisl: I don't know where to start, I'd suggest doing some research on what json is and what url encoding is 20:08 technomancy: but in many cases a generalized approach is not required 20:09 francisl: I just want something that parse the json, it works perfectly fine with my python and node version 20:10 technomancy: hiredman: I'd be willing to reverse my position given a solid counterexample 20:10 I just haven't found any yet 20:10 hiredman: technomancy: because who wants to trot out their one off tasks as an example? 20:11 that is kind of the point, you just need a little hack, you write it and forget it 20:12 forcing people to publish there little hacks seems like either lein will be less useful, or clojars will end up with a lot more noise (little jars no one uses) 20:12 their 20:12 technomancy: hiredman: that's why it's possible but not encouraged to use one-offs 20:13 hiredman: how useful would shell scripting being if you always had to consider the general case? 20:14 technomancy: shell scripting is kind of gross, just like writing a classpath by hand is kind of gross. 20:15 but there are times when it's the best thing for the time, sure 20:16 tolstoy: My one-off just created a "dist" directory, moved the uberjar artifact to it, and a run.sh script, then set the executable on the run.sh script. I can make the thing that called "lein dist" do that work, I guess. But that was my use case. 20:16 hiredman: technomancy: the other thing to keep in mind, is how many lein plugins started as one offs? and if it is harder to start a one off, how many existing plugins wouldn't exist? 20:18 technomancy: if the extra overhead is "echo lein-src > .lein-classpath && mkdir -p lein-src/leiningen" then probably not many 20:18 bsteuber: anyone knows if there's already some nice cljs test library around? 20:18 technomancy: granted documentation is an issue 20:18 hiredman: I am trying to pin point what my exact objection is 20:18 and I think it is a lack of separation of mechanism and policy 20:18 technomancy: mixing the project and leiningen classpath is nasty 20:19 basic stuff like "lein compile :all" doesn't work 20:19 hiredman: sure 20:20 tolstoy: I suppose you could symbolic link .lein-classpath so other devs could have a hope of finding the additional source. 20:20 hiredman: but it could be a flag in project.clj (defaulting to the good behaviour) or use an additional classpath key or something 20:21 technomancy: :plugins [[lein-tar "1.0.0"] "lein-src/leiningen/dist.clj" [...]] <- something like that? 20:22 tolstoy: technomancy: Actually, that's what I tried (or similar) after reading the new Plugins.md. 20:22 hiredman: that is interesting, maybe specify a directory instead of a clj file 20:23 technomancy: yeah, I was thinking of using load-file, but that's bogus given that require would be called later. 20:23 a dir in :plugins wouldn't be bad 20:24 actually that could also cover the fact that checkout deps don't work with :eval-in-leiningen 20:24 hmm 20:38 ivan: I guess I'm late to the party, but live-cljs is really cool 20:44 bsteuber: ivan: it can't be said enough times :) 20:49 muhoo: i still haven't written a major project in clj yet, but i'm really enjoying using it as my go-to language whenever i need calculations or, with incanter, now visualizations. 20:50 and for data munging, hands down, it's my new favorite, displacing python. even for some sysadmin tasks, though i find bash faster for a lot of those 20:51 tmciver: muhoo: I've never used incanter but can it be used to generate pure image files to be generated on a server and sent back to a client or does it only display data in Swing? 20:51 hiredman: yes, you can generate images 20:51 muhoo: the cool thing about incanter is the "live" capability 20:51 tmciver: hiredman: cool. I'll be using that in the near future. 20:51 muhoo: sliders 20:52 that's what got me hooked 20:52 tmciver: muhoo: yes, I was playing around with some of your code you refheap'd the other night; very cool. 20:52 muhoo: this: https://refheap.com/paste/1048 20:52 tmciver: yes 20:52 technomancy: tmciver: I used incanter to live-generate the images in http://lein-survey.herokuapp.com/results 20:52 muhoo: (see, i learned how to use letfn :-) 20:53 tmciver: technomancy: is that why it's taking so long to load? ;) 20:53 technomancy: hah 20:53 tmciver: done. Very cool. 20:54 technomancy: coming out of idling state 20:59 gfredericks: do ^ and$ not specify the beginning/end of line in a java/clojure regex?

20:59 (in a multiline context)

21:01 hiredman: gfredericks: java regexs don't do multilines unless you specify a flag to turn them on

21:01 gfredericks: hiredman: okay, so I'll have to drop down to interop to create the regex?

21:01 hiredman: no

21:02 you can pass flags to java regexs

21:02 ,(re-find #"(?i)foo" "FOO")

21:02 clojurebot: "FOO"

21:03 gfredericks: oh that kind of flag

21:03 hiredman: ,(re-find #"foo" "FOO")

21:03 clojurebot: nil

21:03 gfredericks: very good

21:03 hiredman: multiline might be m

21:03 drewr: you want Pattern.DOTALL (?s)

21:03 gfredericks: ,(re-find "(?s)^\w+$" "foo\nbar\nbaz") 21:03 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unsupported escape character: \w> 21:03 gfredericks: ,(re-find #"(?s)^\w+$" "foo\nbar\nbaz")

21:03 clojurebot: nil

21:04 gfredericks: ,(re-find #"(?m)^\w+$" "foo\nbar\nbaz") 21:04 clojurebot: "foo" 21:04 gfredericks: drewr: you sure? 21:04 hmm, but this is curious: ##(re-seq #"(?m)^\w+$" "foo\nbar\baz")

21:04 lazybot: ⇒ ("foo")

21:04 drewr: ,(re-find #"(?s).*" "foo\nbar\nbaz")

21:04 clojurebot: "foo\nbar\nbaz"

21:04 gfredericks: oh ha

21:05 hmm, but this is curious: ##(re-seq #"(?m)^\w+$" "foo\nbar\nbaz") 21:05 lazybot: ⇒ ("foo" "bar" "baz") 21:05 gfredericks: there it is 21:05 hiredman: thanks! 21:06 drewr: gfredericks: sorry, yes, with ^ and$ you want multiline

21:06 I always need dotall and assumed that's what you were after

21:06 but didn't scroll up

21:15 Frozenlock: Is there a way to make a jar file which contains only the functions I use? Multiple MOs for a single hello world seems excessive...

21:19 hiredman: Frozenlock: do you expect the size of programs in bytes to scale linearly to functionality?

21:20 in which case a large hello world program would be a problem, because it would show that you have almost infinite overhead

21:21 but in what other case would a large (in bytes) hello world progrem be a problem?

21:21 (maybe if you are a vendor selling "hello world" on mobild devices?)

21:21 mobile

21:23 Frozenlock: I was expecting its size to be proportional to the number of libraries and function I was using.

21:23 gfredericks: 1) Clojure

21:31 arohner: what is the convention for where to put cljs files in a noir project?

21:31 jweiss: ,(some (complement #{1 2}) [1 2 3])

21:31 clojurebot: true

21:31 * jweiss figured the complement would have reversed the predicate

21:31 gfredericks: jweiss: didn't it?

21:31 3 is not #{1 2}

21:33 jweiss: gfredericks: right, silly me, i was expecting it to reverse the final result, which is obviously wrong :)

21:33 gfredericks: :)

21:33 jweiss: that's what we use (not) for :P

21:36 jweiss: gfredericks: yeah, i was using a list of one item, so i thought that would work... still a little confused why it didn't

21:36 gfredericks: sounds like it would

21:36 jweiss: ,(some (complement #{1 2}) [1])

21:36 clojurebot: nil

21:37 jweiss: hm, yeah must be something else going on then

21:37 but i'll just use 'not' anyway

21:54 gfredericks: people deploy their eulers to clojars?

22:12 TimMc: Multiple times, apparently.

22:29 netrealm: DEPLOY ALL THE THINGS!!!

22:32 alex_baranosky: has github gone nuts to anyone else?

22:32 TimMc: Check their status site.

22:32 Raynes: Partial service outage.

22:42 alex_baranosky: github looks good now

23:11 technomancy: Frozenlock: there are tree-shakers for the jvm like proguard, but they can't get you any smaller than clojure.jar itself, which is ~3MB for Clojure 1.3

23:20 devn: alek_b: howdy

23:20 alek_b: have time to chat?

23:20 sorenmacbeth: is there a quick way to go from [1 2 [3 4] 5] => ["1" "2" ["3" "4"] "5"]

23:21 like apply, expect it would applied to inner sequences as well?

23:22 Frozenlock: technomancy: thanks! I'll look into that.

23:22 aperiodic: sorenmacbeth: seems like a good use-case for clojure.walk

23:28 sorenmacbeth: aperiodic: can't get walk to work for me

23:30 #(walk str identity [1 2 3 [4 5] 6])

23:30 ["1" "2" "3" "[4 5]" "6"]

23:30 devn: &(walk str #(map str %) [1 2 [3 4] 5])

23:30 lazybot: java.lang.RuntimeException: Unable to resolve symbol: walk in this context

23:31 devn: &(use 'clojure.walk)

23:31 lazybot: ⇒ nil

23:31 devn: &(walk str #(map str %) [1 2 [3 4] 5])

23:31 lazybot: ⇒ ("1" "2" "[3 4]" "5")

23:31 devn: d'oh

23:34 jkkramer: ,(postwalk #(if (number? %) (str %) %) [1 2 3 [4 5 6] 7])

23:34 devn: (prewalk #(if (number? %) (str %) %) [1 2 [3 4] 5])

23:34 lol damnit.

23:34 beat me to it

23:34 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: postwalk in this context, compiling:(NO_SOURCE_PATH:0)>

23:34 jkkramer: :)

23:34 devn: &(prewalk #(if (number? %) (str %) %) [1 2 [3 4] 5])

23:34 lazybot: ⇒ ["1" "2" ["3" "4"] "5"]

23:35 devn: jkkramer: should it be pre or post?

23:35 sorenmacbeth: cheers!

23:36 devn: sorenmacbeth: check out postwalk-demo and prewalk-demo

23:36 they will print you the transformations so you can decide which you want

23:36 jkkramer: devn: I don't think it matters for this case

23:36 devn: jkkramer: yeah i think you're right

23:36 but perhaps his example is contrived and he has a reason to choose pre-order traversal or vice versa

23:37 sorenmacbeth: it's contrived, but only slightly. my data structure is a method call on a java objects that returns a short

23:38 I want to turn those shorts into strings, so I don't think pre or post matters

23:46 devn: sorenmacbeth: fwiw (walk #(if (number? %) (str %) (map str %)) identity [1 2 [3 4] 5]) seems faster

23:47 &(walk #(if (number? %) (str %) (map str %)) identity [1 2 [3 4] 5])

23:47 lazybot: ⇒ ["1" "2" ("3" "4") "5"]

23:47 devn: but you don't preserve the inner vector

23:49 sorenmacbeth: ah, I see

23:50 aperiodic: i think that only works one level deep, though

23:50 devn: aperiodic: yeah you're right

23:50 it's a different of ~0.02ms between the two

23:50 not a whole lot, and that is not a full benchmark by any stretch

23:50 aperiodic: prematurely optimize much? ;)

Logging service provided by n01se.net