#clojure log - Oct 08 2012

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

0:09 Gosh: is there a way to create local variables?

0:09 i meant private*

0:09 like defn- for functions

0:24 Sgeo: Gosh, yes

0:24 Set the private metadata

0:24 (def ^:private foo 5)

0:25 Or (def ^{:private true} foo 5)

0:37 Gosh: thanks

0:38 Sgeo: You're welcome

0:48 callen: what are the main differences between using Noir and a normal Jetty server?

0:48 is there any reason not to use Netty?

0:48 oh I see, Jetty is actually faster most of the time, interesting.

0:52 Gosh: I am wondering if, when Java will support lambda expressions, will we be able to use #() instead of proxies?

0:59 Sgeo: Gosh, well, there's still a lot of old APIs that would be written in terms of accepting an instance of a class that implements an interface...

0:59 Bluh, mouthful

1:00 New APIs would probably accept fns directly, but old ones might not, but that depends if Java might provide some convenience for dealing with the situation

1:00 I should note that I'm not particularly a Java person

1:00 frio: i wonder if they'll simply equate a newstyle lambda with a callable Sgeo

1:01 (Callableis the standard Java interface for a closure, basically)

1:03 Sgeo: frio, what about APIs that don't accept Callable? I believe that all Clojure fns are Callable, aren't they, so in situations where an API does accept Callable, there should already be no need for reify

1:04 frio: yeah, true enough.

1:16 Sgeo: Wait, all Clojure fns being Callable doesn't make sense

1:17 ,(supers #(+ 1 1))

1:17 clojurebot: #<ClassCastException java.lang.ClassCastException: sandbox$eval27$fn__28 cannot be cast to java.lang.Class>

1:17 Sgeo: ,((comp supers class) +)

1:17 clojurebot: #{clojure.lang.IMeta clojure.lang.AFunction clojure.lang.IFn clojure.lang.AFn java.io.Serializable ...}

1:19 Sgeo: Hmm, apparently it can be

1:20 I don't entirely get what happens if you .call a function that requires arguments

1:20 ,(.call (fn [x] x))

1:21 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: sandbox$eval81$fn>

1:21 Sgeo: Ah

1:33 amalloy: last time i read the java lambda proposal, it was syntactic sugar over one-method interfaces

1:36 so {x => x + 1} or whatever their syntax is gets "expanded" to new MyFunctionType<Integer, Integer>() {public int call(int x) {return x + 1;}} // based on the expected interface

2:08 john2x: is there a color library for clojure? or the preferred way to convert between color values (hex to rgb, vice versa, etc.)

2:34 hyPiRion: john2x: ##(Integer/parseInt "AABBCC" 16) ?

2:34 lazybot: ⇒ 11189196

2:35 hyPiRion: ,(format "%x" 0xAABBCC)

2:35 clojurebot: "aabbcc"

2:36 john2x: hyPiRion: for rgb, i was thinking something more like [128 128 128]

2:37 i already wrote a helper function for rgb-to-hex, and I'm about to write one for the reverse, but maybe there's already a wheel for this.

2:39 hyPiRion: I'm not aware of any, I'm afraid.

3:03 Amaryl: Hi!

3:04 The book "Clojure programming" talk about the Clojure programming language, but does not even explain what is a closure :(

3:04 I see this example in the book

3:04 (defn doubler [f] (fn [& args] (* 2 (apply f args))))

3:04 is this a closure?

3:18 hyPiRion: Amaryl: yes, indeed it is

3:18 It's the same as (defn doubler [f] (let [f f] (fn [& args] (* 2 (apply f args)))))

3:19 amalloy: hyPiRion: in what way is that an interesting comparison? anytime f is in scope, you can add as many instances of (let [f f]) as you want

3:22 augustl: is there a way to make lein-ring use one handler for dev and another when running as a .war in prod?

3:24 hyPiRion: amalloy: Closures are "more visible" when shown within a let

3:27 Or well, closures are introduced as (let [foo ...] (fn [...] (... foo ...)))

3:53 Amaryl: Thanks hyPiRion

4:22 wei_: is there yet a clojurescript library that wrap the google closure animation libs?

4:22 or for doing any kind of animation, for that matter

7:54 Cheiron: Hi, is it idiomatic to let inside a let?

7:55 adu: from my experience from other lisps, only if it's a different type of let, like letrec or let*

7:59 pandeiro: is it possible to output just a 'blank' js file with only gclosure + cljs.core with lein-cljsbuild?

7:59 Cheiron: edu: i have this http://pastie.org/4932599

8:00 first i need to log, then start operations

8:01 in my sample, the log might not even issued if operations throw exceptions

8:05 Wasserkraftwerk: Cheiron, do you play StarCraft?

8:06 Cheiron: Wasserkraftwerk: should I ?

8:06 Wasserkraftwerk: Not really, just wondering.

8:07 Gosh: How do you cast to a java class in clojure?


8:09 clgv: Gosh: you dont. you can use type hints to tell the compiler which method to use

8:42 Gosh: (def ^Foo test (-> obj .method .toFoo))

8:42 (-> test .someFooMethod) => No matching method found: someFooMethod for class $Proxy1

8:43 I would like to cast to Foo after calling toFoo method

8:43 toFoo returns an Object

8:44 an object of class Object*

8:45 gfredericks: things are generally considered objects at runtime in clojure. If the method exists on the actual class of the object in question then it should work fine

8:45 for some reason your .toFoo method is returning a $Proxy1 instead of a Foo

8:55 Gosh: works now, forgot to pass some arguments to someFoo method >_>

8:55 I dont even need ^Foo hint anymore, nice

9:00 gfredericks: yeah it's generally not needed

9:10 _ulises: I've just installed nrepl (been using slime/swank for a good while now) and I'm a bit lost as to how to do things. In my previous setup I'd C-x C-k to compile a clj file and if I changed namespaces in the REPL I'd have everything ready. When I try to do this using nrepl I get a bunch of class not found exceptions.

9:11 I've started nrepl using jack-in however this never asked me for a project directory or anything so it's not surprising it's not finding anything.

9:48 kral: namaste

9:59 antoineB: hello, is "(def ^{:dynamic true :private true} *global-var* nil)" is ok, for a var which shouldn't be seen outside namespace?

10:00 chouser: sure

10:00 or (def ^:dynamic ^:private *global-var* nil)

10:01 antoineB: ok

10:01 so "^:" is some sugar for ^{:... true} ?

10:02 Bronsa: yes

10:02 but it's only available for >=clojure-1.3.0

10:06 antoineB: i do some clojure script

10:06 Cheiron_: hi, what is the diff between map and mapcat? mapcat will call concat but .. so what? what is the impact

10:07 gfredericks: Cheiron_: you get a flatter sequence than with map

10:07 assuming your map function returns a sequence itself

10:07 ,(map range [1 2 3])

10:07 clojurebot: ((0) (0 1) (0 1 2))

10:07 gfredericks: ,(mapcat range [1 2 3])

10:07 clojurebot: (0 0 1 0 1 ...)

10:08 Cheiron_: gfredericks: eye c!

10:08 gfredericks: ~yay

10:08 clojurebot: Pardon?

10:08 casion: I see

10:08 gfredericks: clojurebot: yay is sweet

10:08 clojurebot: c'est bon!

10:08 casion: wee

10:08 Cheiron_: gfredericks: muchas gracias

10:08 gfredericks: Cheiron_: no probalo

10:09 Cheiron_: clojurebot: if you make yourself more than just a man, if you devote yourself to an ideal, then you will become something else entirely

10:09 clojurebot: hiredman is slightly retarded

10:09 casion: LOL

10:09 gfredericks: ~rimshot

10:09 clojurebot: Badum, *tish*

10:39 doomlord: is there an existing macro for repeated application: (((f)a)b)c) = (??? f a b c) ... kind of like -> but backwards

10:40 if not, any suggestions on what you'd call that

10:40 casion: doomlord: your example is confusing to me

10:40 doomlord: use case: accessing nested datastructurse

10:41 casion: doomlord: you'd just use -> for that

10:42 doomlord: isn't that repeated *functoins*; i'm after repeatedly treating the return value *as* a function, and applying given arguments

10:42 joly``: "curried-application"?

10:42 doomlord: yeah

10:43 the use case i have in mind is accessing nested datastructures - which i gather are 'funcallable' in clojure

10:44 eg (def a { :foo [10 20 30] } ) (print ((a :foo)1) => 10 ... simple example, but with more nesting i might make myself a macro if one doesn't exist

10:44 eg (def a { :foo [10 20 30] } ) (print ((a :foo)1) => 20 ... simple example, but with more nesting i might make myself a macro if one doesn't exist

10:46 joly``: ,(get-in {:a {:b 1} :c {:d 2}} [:a :b])

10:46 clojurebot: 1

10:46 casion: ,(let [a {:foo [10 20 30]}] (-> a :foo first))

10:46 clojurebot: 10

10:47 doomlord: oh thanks.. What i was missing is that :foo is also an acessor function

10:48 gfredericks: ,(let [a {:foo [10 20 30]}] (get-in a :foo 1))

10:48 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword>

10:48 doomlord: (-> a :foo (nth 1))

10:48 antoineB: is it possible to make a private def visible for a special namespace?

10:49 gfredericks: ,(let [a {:foo [10 20 30]}] (get-in a [:foo 1]))

10:49 clojurebot: 20

10:49 doomlord: (let [a {:foo[10 20 30]}] (-> :foo (nth 1)))

10:49 ,(let [a {:foo[10 20 30]}] (-> :foo (nth 1)))

10:49 clojurebot: #<UnsupportedOperationException java.lang.UnsupportedOperationException: nth not supported on this type: Keyword>

10:49 doomlord: ,(let [a {:foo[10 20 30]}] (->a :foo (nth 1)))

10:49 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ->a in this context, compiling:(NO_SOURCE_PATH:0)>

10:49 doomlord: ,(let [a {:foo[10 20 30]}] (-> a :foo (nth 1)))

10:49 clojurebot: 20

10:50 gfredericks: antoineB: that would be a rather complicated visibility model if you could. Maybe rethink your namespace structure?

10:51 antoineB: gfredericks: is have a macro that use private def (and i use clojurescript)

10:51 so i need to put macro apart

10:53 gfredericks: even in clj-jvm you can't have macros that expand to call private things

10:53 antoineB: ok

10:56 casion: I thought you could refer to private defs?

10:56 gfredericks: antoineB: I think best practice is to have a public API that just consists of functions, and then write simple macros for sugar that defer to the functions (which are public)

10:57 casion: the expansion has to be valid code in the ns where it expands

10:57 so depends on the details really

10:59 casion: https://www.refheap.com/paste/5600

10:59 is there something wrong with my understanding there?

11:00 gfredericks: casion: all that looks normal to me -- what weren't you expecting?

11:01 casion: gfredericks: maybe I'm misunderstanding the discussion?

11:01 gfredericks: casion: we're talking about macroexpansion

11:01 what I was saying you can't do is

11:02 priv> (defmacro my-pub-macro [] `(privfun))

11:02 pubbie> (priv/my-pub-macro)

11:02 because the expansion isn't valid in pubbie even though it's defined in priv

11:02 * gfredericks runs outside to play with his offspring

11:07 Frozenlock: How can I add a file in the uberjar? In this case I would like to include an image.

11:08 And is there some special path I need to use if I intend to slurp it?

11:09 gfredericks: /resources

11:09 Frozenlock: Oh, so simple :)

11:09 thanks!

11:09 gfredericks: then you can find it with clojure.java.io/resource (either in an uberjar or in the expanded lein project)

11:22 Frozenlock: (ns bacnet-logger.systray

11:22 (:use [clojure.string :only (split join)]

11:22 [seesaw.core]

11:22 [seesaw.swingx]

11:22 [seesaw.dev :only (show-options)]

11:22 [seesaw.mig])

11:22 (:require [seesaw.bind :as b]))

11:22 casion: ...

11:22 Frozenlock:


11:22 (import '(java.awt.SystemTray)

11:22 casion: refheap myabe?

11:22 Frozenlock: '(java.awt.event ActionListener))


11:23 (defn create-image

11:23 [path description]

11:23 casion: or not

11:23 Frozenlock: (-> (javax.swing.ImageIcon. (clojure.java.io/resource path) description)

11:23 (.getImage)))



11:23 Sorry

11:23 * Frozenlock hides in a corner

11:23 Frozenlock: No, wrong buffer

11:23 I'm so sorry!

11:23 casion: :)

11:23 Frozenlock: I should disable paste for my erc buffer

11:24 casion: seesaw doesn't have systemtray bindings?

11:24 Frozenlock: Not that I know of.. But I would be very happy if it did.

11:25 duck1123: Doesn't ERC have a plugin that disallows long pastes? Might be worth looking into

11:26 casion: Frozenlock: at the very least I think making your own seesaw widget for it would be beneficial

11:27 Frozenlock: it has seesaw.icon though, so that's something :)

11:30 Frozenlock: Right! No need for my silly create-image then!

11:51 doomlord: can clojure & the jvm utilize SIMD instructions

11:52 S11001001: doomlord: not directly

11:53 doomlord: i guess its not a priority in the use cases (web concurency?) what made me ask is that SIMD is a form of parallelism, and functoinal programming is good at expresing parallelism.

11:54 fractaloop: SIMD is directl parallelism. Clojure is better at things like concurrency from what I've gathered

11:56 antares_: doomlord: there is a new project in OpenJDK that explores using SIMD and GPUs in the JVM. There are also OpenCL bindings and such, although not very mature.

11:58 doomlord: (there is an example of a customized lisp being used for low-level work, naughty-dog GOAL on the ps2, although i gather it was more game-scripting with souped up inline asm)

11:58 is/was

11:59 fractaloop: If you need any serious performance, write it in C/C++ for the dirty work and control it from higher up (Clojure)

11:59 Trying to shoehorn low level optimizations into a very high level language is a recipe for pain

12:00 doomlord: its low level opt that got me interested in FP :) but there is no silver bullet

12:01 casion: doomlord: you could mess with ocaml

12:02 doomlord: ocaml did look interesting too, as did microsoft f# but i prefer something more crossplatform

12:03 kilon: fp ? as functional programming ?

12:03 doomlord: yes

12:03 kilon: i see

12:03 casion: ocaml is pretty well cross-platform

12:03 fractaloop: doomlord: What kind of work are you doing? Is it the kind of stuff you want GPU level parallelism for?

12:03 kilon: i thought you mean fp as free pascal

12:03 *meant

12:03 Sgeo: I should do something productive

12:03 fractaloop: Sgeo: A noble goal for early Monday

12:04 arrdem: pfft productivity....

12:04 doomlord: i'm a c/c++ programmer just looking to try a different language; keeping my mind open. would be nice to write *something* in something else.

12:04 of course it might just be that the combo of c++ (with embedded lua) isn't broken

12:05 kilon: learning new languages is fun

12:05 fractaloop: I'm a C/C++/Java coder and moved to Ruby

12:05 It was a relatively easy transition. Clojure/Lisp is another beast entirely

12:05 kilon: i learned smalltalk and lisp this year and brush up my pascal knowledge too after 10 years

12:05 arrdem: doomlord: I would say if you really want to try something else, look at using Scheme instead of Lua for scripting within C/C++ apps

12:05 doomlord: its the macros that appeal to me in lisp

12:06 casion: fractaloop: I tried ruby before clojure and it was just… very strange to me

12:06 arrdem: it's not really clean, but doing Scheme/Clisp -> C bindings is easiser that extending the JVM and hooking in from Clojure

12:06 doomlord: fair enough

12:06 casion: I was constantly confused by why things were done how they are in ruby

12:07 Sgeo: casion, if you try Smalltalk, Ruby will anger you even more

12:07 doomlord: i can see the sense to c++ & scheme

12:07 fractaloop: casion: Convention is a lot of it. Ruby basically lets you do anything which is too powerful a tool for many coders. People go crazy implementing harebrained software that is impossible to unwind

12:08 dustingetz: is that any different than macros?

12:08 fractaloop: I'm learning Clojure mainly because because of Storm and Pallet

12:08 arrdem: what fractaloop said. A good friend of mine spent several hellish months debugging a Ruby webserver that used eval all over the place and was almost impossible to unwind

12:08 gfredericks: dustingetz: quite. macros are compile-time

12:08 dustingetz: their effects are a one-time thing and can be completely laid bare with macroexpand

12:09 casion: fractaloop: that's sort of the feeling I got. There was a lot of times I thought people were solving problems that didn't exist as well

12:09 gfredericks: compare with the ruby approach of "redefine anything at any time from anywhere"

12:09 Sgeo: arrdem, it's eval that's the problem? So I guess Tcl would be similar?

12:09 casion: a lot of times I'd ask questions and be told that's not really what I want to do because in the future I _may_ want to do something else

12:09 that mindset is on vhe verge of infuriating for someone coming from C

12:10 doomlord: after using various combinations of #defines & templates in c++ i figure lisp macros would probably do that sort of thing more elegantly... declaring structures with serialization & UI definitons embedded, that sort of thing

12:10 casion: I've come to love clojure because you can embrace abstraction, or ignore it when it doesn't make sense… and that's OK

12:11 doomlord: lisps the macros are the draw, but i also really like the way type inference works in haskell(& ml?)

12:11 fractaloop: casion: Yea, I work someone that uses the metaprogramming shit all the time. It fucks our code up and makes it untestable. So obnoxious.

12:11 dustingetz: why do they use it?

12:11 what are their thoughts?

12:11 fractaloop: Hence why I'm in #clojure and not #ruby =P

12:11 gfredericks: fractaloop: have you ever seen `def method_missing _; nil; end`?

12:12 fractaloop: gfredericks: Thankfully no.

12:12 casion: fractaloop: 90% of the time I want to do something, I want to do that. Not the 50 other things that may also be related to that

12:12 gfredericks: I don't think that's even possible in clojure

12:12 dustingetz: i mean, some of my OOP colleagues say the same thing about FP code

12:12 casion: seems ruby programmers always want to make sure their code can do those 50 other things, even if it will never happen

12:12 arrdem: Sgeo: perhapse, I have no experience with either directly. From the accounting I heard the issue was more that the Rubyist who perpetrated the server to start with used eval all over the place and did inline code generation which made debugging much harder than it needed to be because the server was constantly injecting more code into itself

12:12 fractaloop: casion: Trufax

12:13 casion: I messed with python a bit as well, and I found it rather pleasant except it was just too ridiculously slow

12:13 * arrdem takes offense as a recovering pythonista

12:14 fractaloop: Hehehe

12:14 casion: maybe there's something where python is reasonable or 'fast'

12:14 fractaloop: I was always scared of Python because of the 'pythonic way'

12:14 casion: but everything I do, it's slow as fuck

12:15 fractaloop: I actually liked that. I like that clojure has a similar emphasis on producing idiomatic code as well

12:15 arrdem: what with JVM bootup overhead I find that my Clojure scripts really aren't faster than my Cpython equivalents

12:15 but that's __only__ for once-off scripts. Big stuff Clojure and Java are way faster

12:15 casion: arrdem: most everything I do is lots of crunching on 1 process

12:15 arrdem: casion: yerp. and python is really slow at that I can't deny it.

12:18 fractaloop: Have y'all read Pragmatic Programmers "Programming Clojure" >

12:18 ?

12:18 casion: fractaloop: yes

12:18 arrdem: with p>.85

12:18 casion: that was my favorite clojure book

12:18 fractaloop: I like the PP. Was considering it's purchase

12:19 Bosses wont buy it for me though because we're all Ruby apparently =(

12:19 casion: I should also complain about ruby being slow, just to be fair

12:19 so consider that done :)

12:20 S11001001: everything's slow

12:20 except C. C is too fast

12:20 arrdem: S11001001: RAW METAL OR NOTHING

12:20 casion: ruby and python take slow to a new level of wtf

12:20 jrajav: *cue jokes about assembly and/or magnets*

12:20 Iceland_jack: casion: and yet they are used so what of it

12:21 casion: Iceland_jack: they're slow?

12:21 fractaloop: Yea...Ruby is painfully slow >_<

12:21 casion: not sure what else would be 'of it'

12:22 Iceland_jack: It goes to show that obviously it doesn't matter that much for many tasks

12:22 casion: and it does for some

12:23 Sgeo: Is Common Lisp optimized for speed faster than Clojure?

12:23 casion: CL is usually a good bit faster than clojure

12:24 fairly sure 'always' would apply

12:24 arrdem: Sgeo: it should be... CL can build straight to C and then benifit from ICC etc. while we're stuck with the JVM JIT

12:24 S11001001: straight to assembly

12:24 * Sgeo is wondering why he didn't stick with CL

12:25 S11001001: I think there are more CLs that *don't* go through C than do

12:25 arrdem: because lack of libraries and lein

12:25 fractaloop: Because Java is badass.

12:25 Or at least, helpful.

12:25 Sgeo: Hmm. It's not very functional, and lack of libraries, and quicklisp is a sort of closed environment

12:25 lucian: CL also tends to have crappy GCs

12:25 the jvm is a pain in the ass, though

12:26 Sgeo: Want to put something on QuickLisp? You have to contact the maintainer of QL, and when they add it, it will usually be a month before it becomes available

12:26 arrdem: I was on CL before Clojure.. and my first reaction to the CLJ world was "holy **** a Lisp with actual usable libraries"

12:27 besides, we get all the Java libraries for free

12:27 Sgeo: Although cl-cont > delimc and I'm guessing that whatever monadic libaries exist for CL > the Clojure monadic stuff

12:27 doomlord: i wold have thought the JVM would have had the most developped garbage collectors,due to how widespread it is no idea in practice though

12:28 lucian: doomlord: it does tend to have the best GCs, yes

12:28 most languages don't even let you choose

12:29 doomlord: i really like the idea of seperating front & back end

12:29 lucian: s/languages/runtimes/

12:29 doomlord: like with LLVM for c++

12:30 casion: Sgeo: why don't you just use haskell?

12:31 Sgeo: Easy macros and easy to change running programs

12:31 There is Template Haskell for macros, and there are tricks to change running Haskell programs if you're careful about designing it, but...

12:31 casion: Sgeo: seems like you spend more time trying to recreate things that haskell has than the time those things would save you

12:31 doomlord: nice, clojure can destructure function arguments

12:32 kilon: pascal is as fast as C too

12:32 Sgeo: Don't underestimate my desire for easy macros.

12:32 antares_: ohpauleez: heya

12:33 ohpauleez: antares_: Hello

12:33 antares_: so, clojure-doc.org is "officially" announced and ready for others to join: https://groups.google.com/forum/?fromgroups=#!topic/clojure/ixtfzCHCOWI

12:33 dnolen: doomlord: you can destructure anywhere where binding is supported - let, fn args, binding, doseq, etc

12:35 magnars: idiomatic way of taking a list of maps with an id [ {:id 1} {:id 2} ] and turn it into a map on those ids { 1 {:id 1} 2 {:id 2} } ?

12:36 arrdem: ,(let [s [{:id 1} {:id 2}]] (zip-map (map #(:id %) s) s))

12:36 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: zip-map in this context, compiling:(NO_SOURCE_PATH:0)>

12:36 arrdem: damn

12:36 ,(let [s [{:id 1} {:id 2}]] (zipmap (map #(:id %) s) s))

12:36 clojurebot: {2 {:id 2}, 1 {:id 1}}

12:36 magnars: arrdem: many thanks!

12:37 arrdem: magnars: no problem.. surprised it worked, first time I've used zipmap XP

12:37 antares_: ohpauleez: I'm curious if you have thoughts about the suggested workflow and if clojure/core will or won't have any recommendations

12:37 Sgeo: #(:id %) isn't that just :id

12:38 arrdem: Sgeo: maybe...

12:38 ,(let [s [{:id 1} {:id 2}]] (zipmap (map :id s) s))

12:38 clojurebot: {2 {:id 2}, 1 {:id 1}}

12:38 arrdem: evidently

12:38 dnolen_: Sgeo: cl-cont isn't that great, it's simple code walker - delimc is exactly the same.

12:38 Sgeo: dnolen_, but I imagine that cl-cont doesn't have that bug where you must bring all symbols directly in

12:39 dnolen_: Sgeo: I don't know, I never used it serious. I personally never cared for CL package control.

12:41 ohpauleez: antares_: I'd make the landing page a little easier to navigate (Where category listing link to the doc collections they contain). I think workflow is fine - I don't think clojure/core has any opinion about the workflow, so I think you're all set to go

12:43 antares_: ohpauleez: understood. The UI certainly needs work. We already have some ideas about how to make it a bit better. But writing content is by far more important right now.

12:43 casion: antares_: how will discussion about article content be handled?

12:43 antares_: casion: on the mailing list and in pull requests

12:45 casion: antagon: on the clojure mailing list or is there a cds list?

12:45 antares_: casion: on the main Clojure ML

12:46 there will be no separate list because docs is a problem of every clojure user and the process must be visible to everybody

12:46 I also always disliked the closed clojure-dev jazz

12:46 casion: antares_: do you think it would be useful to link to article discussions on the article page?

12:46 antares_: casion: maybe. Don't focus on details yet, we need to start writing the content.

12:47 everything other than writing and/or making it easier for people to start writing is secondary right now

12:47 casion: antares_: I was planning on contributing, but I was curious how things would be handled if someone says 'maybe this is better?' and I wanted to participate in such a discussion

12:49 antares_: casion: I think it's not any different from similar discussions about code

12:50 casion: antares_: my experience with any form of online collaboration is extremely limited, so forgive if I'm asking a question that seems overtly basic

12:50 antares_: casion: no problem. I understand that. And collaborative writing and editing is difficult because there are no fast and hard rules about "what is good".

12:50 casion: I've worked alone, or in person with another 1-2 people since the 90s… this is all rather new to me :)

12:51 antares_: but there is no way around this

12:52 casion: I guess I'll need to explore the pull system on github more

12:53 ohpauleez: casion: Writers also are in #clojuredocs

12:53 you can always ask such questions there

12:53 casion: excellent

13:12 uvtc: casion: ping

13:13 pandeiro: anyone know if lein-cljsbuild can be configured to produce a vanilla js file w/ just goog-closure and clojurescript core?

13:14 dnolen: pandeiro: you just mean no optimizations right?

13:17 antares_: mpenet: sorry for my comment on your CDS PR but I really think Casyn is not a library newcomers will be able to use.

13:18 cassaforte has its issues, but it is not different from clojure.java.jdbc and something like monger or neocons in the way you use it

13:19 pandeiro: dnolen: yeah i need to inject the clojurescript api into a phantomjs-rendered page, so i just want a vanilla representation to be compiled from the same version of cljs that lein-cljsbuild is using

13:20 ...i can do that manually by creating a dummy ns with no forms and then compile it; wanted to know if there is some other way

13:27 wingy: clj-http doesn't seem to parse the request json body for you .. should i use cheshire to do that?

13:27 dakrone: wingy: clj-http will if you ask it to

13:27 otherwise, you can do it manually with cheshire if you'd like

13:29 sundbp: question: let's say i want a multimethod foo with implementations for 2 different "situations". i define the multimethod (defmulti) in namespace x, then i add the 2 defmethods in namespace y and z that are related to the 2 sitautions. does that 1) work? and 2) is it weird to spread defmethods for the same defmulti over several namespaces?

13:29 mpenet: antares_: That is fine, I understand your goals, and why you'd prefer that.

13:30 gfredericks: sundbp: that ability is half of the point of multimethods

13:31 wingy: dakrone: :as :json did the trick

13:31 I should RTFM

13:31 sundbp: mpenet, gfredericks: good!

13:32 antares_: mpenet: cool. that page certainly is somewhat controversial for library developers. But "just" users benefit from it dearly.

13:32 sundbp: was just making sure i hadn't misunderstood it completely

13:33 mpenet: antares_: yes, I understand we don't want it to become a listing of all clj libs out there

13:33 antares_: so, who wants to write the books guide :) it's the lowest hanging fruit!

13:34 just list all the 6-7 books out there, with links to Kindle/PDF/ePub editions in popular stores, and mention what versions of Clojure they cover

13:35 sundbp: slight follow up: if i then in namespace A require ns x, but not y and z - will invocations of the multimethod in A be obvlivious to the implementations that exist in x and y? obviously y and z need to get "loaded" somehow before they're known, but is it independent or tied to namespace require/use.

13:36 gfredericks: there's nothing magic about it; so whenever the ns the defmethods are in is loaded normally

13:37 sundbp: gfredericks: ok, so for namespace A to invoke the multimethod and be able to dispatch to the implementations in y and z it needs to reference x, y and z.

13:38 magnars: I have a list of ~20k items that I want to make a map of. I'm reducing over a transient map to do this. However, I get the wonderful OutOfMemoryError Java heap space ... any ideas?

13:38 gfredericks: sundbp: yep

13:38 sundbp: or at least you need to be confident that they're already loaded somehow or another

13:39 sundbp: gfredericks: excellent. then it is indeed no magic or special things surrounding it and initial intutiotion holds. thanks for verifying

13:39 gfredericks: magnars: not without seeing the code

13:39 sundbp: gfredericks: (not in front of repl so couldn't verify it manually)

13:40 gfredericks: sundbp: maybe it is a lazy seq of large objects and you run out of memory while realizing it?

13:40 magnars: gfredericks: http://pastie.org/5019878

13:43 gfredericks: sundbp: sorry confused you with magnars :)

13:44 magnars: that's pretty straightforward. The only idea I have is the one I missent to sundbp above.

13:44 magnars: gfredericks: ah, yes, it is a lazy seq of objects - they're not very large, but they are plentiful. However, I didn't run out of heap space prior to trying this mapping. However, I guess working with these sizes I should expect to increase the heap size.

13:48 Frozenlock: Once my app is in a jar, when I execute it, it exports files to my home folder. How could I export to the same folder as the .jar?

13:51 * gfredericks would google for "java how I find out where I at in a jar"

13:51 Frozenlock: oh right, that's a java thing, not clojure

14:23 thorbjornDX: is it common to have a side-effecting function that takes in some map, produces a side-effect, then returns the same map that was passed in? I feel like I'm breaking some golden rule or something

14:24 arrdem: thorbjornDX: I don't think so... it's unusual but I don't see it as evil

14:24 nDuff: thorbjornDX: Do you have a ! in the name to indicate that you're side-effecting?

14:25 thorbjornDX: ...if so, I'd be OK with it.

14:25 thorbjornDX: nDuff: I will in 5 minutes :)

14:27 arrdem: my code flow looks something like this (-> (func-that-produces-map) dosomethingwithit! dosomethingelsewithit! ...)

14:28 arrdem: (doc doto)

14:28 clojurebot: "([x & forms]); Evaluates x then calls all of the methods and functions with the value of x supplied at the front of the given arguments. The forms are evaluated in order. Returns x. (doto (new java.util.HashMap) (.put \"a\" 1) (.put \"b\" 2))"

14:28 arrdem: ,(doc doto)

14:28 clojurebot: "([x & forms]); Evaluates x then calls all of the methods and functions with the value of x supplied at the front of the given arguments. The forms are evaluated in order. Returns x. (doto (new java.util.HashMap) (.put \"a\" 1) (.put \"b\" 2))"

14:28 arrdem: not wrong, just not how I would think to structure it.

14:29 thorbjornDX: arrdem: ah, I think this is what I'm looking for

14:30 arrdem: thanks for the info :)

14:31 arrdem: thorbjornDX: no problem. #clojure is where I found that one too, just passing it on

15:04 wingy: dont complect!

15:05 made me use cheshire and form-decode to decode the response body from clj-http instead

15:06 tomoj: is there any reason for the analyzer to add :require-macros/:use-macros ns's to deps for analysis?

15:07 this means if you have (:require-macros [foo.bar :as b]) in foo/bar.cljs, you get a stackoverflow

15:07 (when-not macros? (swap! deps conj lib)) seems to fix it but can't tell if it breaks something else

15:08 SegFaultAX|work: wingy: I made this for you: http://cdn.memegenerator.net/instances/400x/28015188.jpg

15:08 Iceland_jack: haha

15:08 SegFaultAX|work: Re: Complect ^

15:08 wingy: SegFaultAX|work: i dont get it though

15:08 SegFaultAX|work: wingy: :O have you not seen Mean Girls?

15:08 wingy: no :)

15:09 * gfredericks has not seen mean girls

15:09 SegFaultAX|work: That movie is hilarious.

15:09 Even if you're not a 14 year old girl.

15:10 jrajav: Or a 22 year old girl trying to pass as a 14 year old girl

15:10 dnolen: tomoj: hmm file a ticket - I don't see any reason for macro files to be considered for analysis.

15:11 arrdem: SegFaultAX|work: oh gods that movie

15:11 wingy: or a 27 year old guy trying to be a 14 year old girl

15:11 SegFaultAX|work: arrdem: Are you a fan as well?

15:11 arrdem: there was no part of that movie where I didn't want to shoot myself

15:12 SegFaultAX|work: Haha. Isn't that the point?

15:12 wingy: now i have to watch it

15:54 bonega: Anyone know why Heroku's foreman ignores crossover-cljs? Thought it did something like "lein compile :all"

15:56 tomoj: bonega: see https://github.com/heroku/heroku-buildpack-clojure/blob/master/bin/compile

15:57 ivan: so have you guys discovered the OQL Console in VisualVM? It is pretty cool.

15:59 zilti: When I try to compile a sample cljs, all I get from "lein cljsbuild once" is "Could not locate clojure/instant__init.class or clojure/instant.clj on classpath", what could be the reasons for that?

16:00 cemerick: bonega: depends on what buildback rev you use, but you can override whatever the default is with a bin/build script.

16:01 bonega: from what I can see it should do something like "lein with-profile production compile :all"

16:01 zilti: Oh. I suddenly have clojure 1.3 in the deps... hmm

16:02 bonega: doing it manually includes the crossovers, but not with foreman

16:03 using a :hook [lein-cljsbuild]

16:04 :hooks [leiningen.cljsbuild]

16:04 akhudek: zilti: try https://github.com/xeqi/lein-pedantic

16:04 I almost feel the above plugin should be default

16:04 duck1123: it's a tad too pedantic IMO

16:05 akhudek: perhaps, but knowing the actual versions of libraries you are using seems pretty crucial for reliability

16:06 duck1123: if it had a warn-only option, it would be more useful

16:07 Sgeo: Would be nice if two different versions of libraries could be used at the same time

16:07 xeqi: duck1123: set :pedantic :warn in the project or user profile

16:07 nDuff: Sgeo: For Java libraries, that can be done if you're in an OSGi container.

16:08 Sgeo: ...for Clojure libraries, even in OSGi, not so much, unless you have two completely separate Clojure environments.

16:08 zilti: akhudek: Thanks!

16:08 duck1123: xeqi: very nice. I didn't see that when I first checked it out

16:08 nDuff: (but OSGi _can_ be used to maintain separate Clojure environments within one JVM. In theory, anyhow).

16:09 * nDuff hopes Sgeo has a _lot_ of PermGen space if that's a thing that'll be going on, though.

16:09 Sgeo: PermGen?

16:09 xeqi: duck1123: I think I added it in 0.0.3

16:10 zilti: cssgen caused the problem

16:10 xeqi: for anyone using it, I just released 0.0.5

16:11 cemerick: do you still have your project with the args error? could you check ^ and see if it still happens?

16:13 akhudek: I'm glad to hear you find it useful

16:15 akhudek: xeqi: thanks for your work on it! I have some projects with pretty big dependency lists that it really helped sort out

16:17 duck1123: does lein-pedantic let me know when exclusions are no longer needed?

16:17 cemerick: xeqi: gah, I can't repro now.

16:18 weird :-/

16:18 bonega: Is there a way to choose :builds in :cljsbuild using :profile?

16:18 xeqi: duck1123: nope

16:18 clojurebot: Cool story bro.

16:18 xeqi: cemerick: heh, thanks for trying

16:19 cemerick: I've upgraded the pedantic dep though; will make noise if anything else crops up

16:25 johnmn3: good day

16:25 zilti: Hmm now that's weird. lein-pedantic tells me that I have a ring/ring-servlet dependency which I don't have and I can't find that dependency in any of my dependencies...

16:26 johnmn3: anyone working on clojure on android?

16:26 dnolen: johnmn3: there are few people that do, not sure if they hangout much on IRC

16:27 johnmn3: dnolen: thanks. do you know if it is usable to make apps with?

16:28 dnolen: johnmn3: seems so, but from what I understand Clojure is a bit demanding in terms of GC so it doesn't work well for some kinds of apps you might want to do.

16:29 nDuff: johnmn3: from what I understand, clojurescript is more appropriate on Android at this point

16:29 (using phonegap or another mechanism for doing Android apps in JavaScript)

16:29 johnmn3: nDuff: that makes sense

16:31 cemerick: zilti: do `lein deps :tree`, and you'll find out where it's coming from

16:31 zilti: cemerick: Well, I'll try that too but I found out it happens only when using "lein ring uberwar", not when using "lein deps" so it must be caused there

16:33 cemerick: zilti: makes sense; wars are servlet-specific, so lein-ring adds the corresponding dep when producing any kind of war: https://github.com/weavejester/lein-ring/blob/master/src/leiningen/ring/war.clj#L224

16:34 duck1123: xeqi: Using the latest version, it's complaining about my cljsbuild deps, but I don't have that in my project. (I have lein-cljsbuild as a plugin, but I don't specify cljsbuild directly)

16:35 tomoj: &(class (empty (clojure.lang.ArraySeq/create (into-array [1 2 3]))))

16:35 lazybot: ⇒ clojure.lang.PersistentList$EmptyList

16:35 xeqi: duck1123: its probably added by the plugin

16:35 tomoj: is that correct?

16:35 xeqi: zilti, duck1123: plugins adding dependencies does keep lein-pedantic from being as nice as I want :/

16:36 cemerick: way of the world, it seems

16:38 xeqi: yeah, I wonder if I can do some funny middleware stuff to track it and give a different message; maybe a superset of xeqi/lein-pedantic#7

16:38 lazybot: identifying parent sources of dependencies -- https://github.com/xeqi/lein-pedantic/issues/7 is open

16:40 wingy: off topic from clojure: does anyone here use the Twitter API (https://dev.twitter.com/docs/auth/creating-signature)

16:41 it looks very intimidating to implement it in clj or other langs

16:42 duck1123: wingy: oauth can be a pain, but there are some good clojure oauth libs out there

16:43 wingy: duck1123: i found this https://github.com/mattrepl/clj-oauth

16:43 Bronsa: https://github.com/Bronsa/neurotic

16:44 wingy: duck1123: facebook login was a breeze to implement .. dont get why its that hard for twitter

16:44 perhaps its not using oauth2 ?

16:45 duck1123: no, 1.0a

16:46 wingy: ok

16:46 facebook is using oauth 2 .. perhaps that is why its so simple

16:47 that library link i pasted uses twitter as an example .. lets hope it will work :)

16:47 devth: find myself doing: (some (fn [x] (when (re-find #"foo" x) x)) ["this is a bar" "this is a foo"]) lately (just using regex as an example). notice the anon fn has to use when and return the actual value since `some` returns the result of the matching fn instead of the value that matched. better way?

16:48 TimMc: tomoj: That is a little surprising...

16:48 duck1123: wingy: https://github.com/mattrepl/clojure-twitter

16:49 tomoj: TimMc: agreed. seems pretty consistent though that (empty seq) is ()

16:49 TimMc: tomoj: The docs for empty say "the same category" -- maybe that means list vs. vector vs. ....

16:50 so empty is preserving the access semantics, but not the JVM type.

16:50 tomoj: yeah makes sense

16:50 wingy: duck1123: looks nice

16:50 but i prefer making raw http requests

16:51 duck1123: wingy: at the very least, it's a reference

16:51 wingy: yeah

16:56 callen: https://www.refheap.com/paste/5606 k, what the hell is going on? Why am I getting an NPE?

16:57 is it because I'm multiplying a non-number?

16:57 duck1123: when n = 0, factorial returns nil

16:57 callen: n/m, fixed it.

16:57 duck1123: yeah, I figured that's why I asked about the non-number

16:58 duck1123: added an else case and it works fine now. Thank you.

17:13 bonega: Not completely done, but feel free to check out my Clojurescript Tetris running at Heroku: http://clojure-tetris.herokuapp.com/

17:14 And thanks everybody for answering questions

17:15 fractaloop: bonega: impressive

17:15 ordnungswidrig: bonega: good work!

17:16 tomoj: sweet

17:16 dnolen: bonega: nice!

17:16 akhudek: ibdknox: is it possible to run light table without X11? e.g. run on a local dev server and connect to it from other hosts?

17:20 bonega: thanks, I will try to do a short writeup on the mailinglist

17:20 later

17:23 Sgeo: Hmm

17:23 Maybe I could fork that to make the Tetris-like game I made in my game programming class in a more accessible language

17:25 bonega: Do you mean forking just the clojurescript part or? Go for it anyhow

17:26 Sgeo: I don't entirely understand Clojurescript

17:26 Does the game require a server-side component, or is it all client-side? If the latter, how does the Clojure code get run?

17:27 bonega: all clientside

17:28 basically all the clojure code is compiled to javascript

17:28 Sgeo: main.clj looks like Compojure code, which is serverside

17:28 bonega: ah, yeah sorry

17:28 but that's mostly to get a server running

17:29 tomoj: more puzzling is core.clj

17:29 bonega: it's not a part of the tetris program by my definition, just there to serve some javascript to a clent

17:30 tomoj: why doesn't the compiler blow up when it doesn't find core.cljs?

17:30 bonega: core.clj is crossover

17:30 originally a standard clojure project

17:30 tomoj: aha

17:30 gfredericks: so being a crossover it is also a cljs file

17:30 bonega: I share code with :crossover in lein-cljsbuild

17:31 tomoj: gfredericks: thanks for the CLJS-383 patch, saved my day

17:31 bonega: it automatically gets moved to a special folder and then compiled to js with the rest of the cljs

17:31 gfredericks: tomoj: yeah? you just applied it locally?

17:33 tomoj: yeah I've been using HEAD for.. ever :/

17:33 gfredericks: tomoj: I'm curious about the mechanics of using your own cljs with lein-cljsbuild because I haven't been able to

17:34 tomoj: I almost feel like it would be wrong to tell you

17:34 I just have :source-paths ["src/clj" "vendor/clojurescript/src/clj" "vendor/clojurescript/src/cljs"]

17:34 gfredericks: hm; fascinating

17:34 thanks :)

17:35 how did the issue manifest for you?

17:35 just curious

17:38 dnolen: gfredericks: btw, CLJS-383 - on the ticket what do you mean about errors under advanced compilation?

17:38 tomoj: I hadn't actually run into it but I have a function with arglists ([x] [x y] [x y z] [x y z & ws])

17:38 the last piece is (apply f x y z ws)

17:39 Sgeo: What's the point of having ` without ~ and ~@ ?

17:39 tomoj: so I guess if I had passed the right number of args in my test with +, it would have blown up

17:39 Sgeo: (Reading about cljs)

17:40 gfredericks: tomoj: are you set up to run script/test in the cljs project?

17:40 I only ran with v8

17:41 Sgeo: it expands symbols into their fully-qualified form

17:41 which is nearly always what you want when you write a macro in one ns and use it in another

17:42 Sgeo: interestingly it's possible to use ~ and ~@ without `

17:42 tomoj: gfredericks: yes, but also only for v8

17:42 gfredericks: tomoj: so when you run it with my patch do you get any failures?

17:43 tomoj: running

17:44 do I have to tell it to try advanced or does it try automatically?

17:44 gfredericks: I never told it anything special

17:45 tomoj: https://gist.github.com/c3d73e2fa792f89672b3

17:46 gfredericks: tomoj: yeah I believe that's what I saw

17:46 tomoj: had no idea how to investigate it

17:47 tomoj: also the spooky thing was how it went away when I changed the added tests from ABC to ABCB

17:48 but maybe that's just advanced compilation being unpredictable

17:49 dnolen: gfredericks: I doubt that

17:49 gfredericks: dnolen: which part?

17:49 tomoj: hard to imagine debugging that!

17:49 dnolen: gfredericks: advanced compilation being unpredictable

17:50 gfredericks: I suspect this may have something to do w/ optimizations that kick in during when :static-fns true, which implicit under :advanced

17:50 gfredericks: dnolen: you must be better at predicting than me

17:50 dnolen: gfredericks: tomoj: can you all try :simple w/ :static-fns true ?

17:51 * gfredericks tries to whip up an env

17:52 tomoj: looks like you can just modify line 10 of script/test

17:53 dnolen: tomoj: yep

17:53 tomoj: no exception :'(

18:02 * gfredericks will be building v8 for a while

18:04 tomoj: the error seems to occur on line 1373-ish of the tests

18:05 the (assert (= (meta (with-meta (reify IFoo (foo [this] :foo)) {:foo :bar})) {:foo :bar}))

18:08 dnolen: tomoj: hmm, I'll try looking into it later.

18:18 wingy: how do i create a timestamp in clj?

18:19 (java.util.Date.) gives me a formatted date string

18:19 or perhaps not a string but not the timestamp

18:19 antares_: ,(System/currentTimeMillis)

18:19 gfredericks: wingy: looks like a timestampish thing to me

18:19 clojurebot: 1349734381827

18:20 gfredericks: wingy: the java.util.Date has millisecond resolution at least

18:20 or it does on my machine anyways

18:20 wingy: gfredericks: how? it returns this to me: "2012-10-08T22:13:43.570-00:00"

18:20 gfredericks: I have clojure 1.4 and it prints as: #inst "2012-10-08T22:14:32.898-00:00"

18:21 wingy: that's a bunch of time info in there; not sure how you're interpreting it

18:21 wingy: but i need the seconds since Unix Epoch 1970

18:21 gfredericks: okay then definitely antares_'s suggestion :)

18:21 wingy: yeah

18:22 gfredericks: I mistinterpreted "a formatted date string"

18:22 wingy: "This value should be the number of seconds since the Unix epoch at the point the request is generated, and should be easily generated in most programming languages." antares answer gave me ms

18:22 gfredericks: tomoj: oh weirder; I just ran the tests on a different machine with v8 and got no errors o_O

18:22 (did not modify the advanced settings)

18:23 &(/ (System/currentTimeMillis) 1000)

18:23 lazybot: ⇒ 67486735241/50

18:23 gfredericks: er

18:23 antares_: wingy: you can get that from a java.util.Date instance, too: http://docs.oracle.com/javase/7/docs/api/java/util/Date.html#getTime(), but it is in milliseconds everywhere

18:23 gfredericks: &(div (System/currentTimeMillis) 1000)

18:23 lazybot: java.lang.RuntimeException: Unable to resolve symbol: div in this context

18:23 gfredericks: &(quot (System/currentTimeMillis) 1000)

18:23 lazybot: ⇒ 1349734722

18:23 wingy: yeah

18:24 antares_: so you have to divide by 1000 like gfredericks shows

18:24 wingy: yeah

18:30 tomoj: gfredericks: strange

18:55 doomlord: does the clojure compiler do much type-inference (immutability making it easier?).. eg does a small literal vector boil down to a tuple and will large homogeneous vectors forgo per item type information

18:58 antares_: doomlord: it does some type inference but not for collection contents. There is no special tuple type on the JVM.

19:01 doomlord: i was hoping tuples are anonymous classes/structs .. (i dont even know..does the jvm have PlainOldData in addition to classes..)

19:03 antares_: doomlord: it has primitives (int, long, etc) and array types, everything else is classes

19:03 hiredman: and, at the jvm, level, there are no anonymous classes

19:04 doomlord: it could generate names i suppose

19:04 hiredman: anonymous classes are a mechanism in the java language

19:04 doomlord: right, which is what javac does

19:05 clojure's reify and proxy do the same

19:06 SegFaultAX|work: hiredman: Does the JVM just generate a name for an anonymous class?

19:06 hiredman: https://github.com/hiredman/tuples is a project for providing something like a cross between tuples and vectors

19:06 SegFaultAX|work: no, the java compiler does

19:07 some.package.Foo$1 etc

19:07 the jvm just knows about named classes

19:07 SegFaultAX|work: Interesting! Today I learned...

19:08 hiredman: Is there ever a time where that might actually matter?

19:08 hiredman: SegFaultAX|work: the tuples link?

19:08 SegFaultAX|work: hiredman: No, the implementation detail of anon classes.

19:09 antares_: SegFaultAX|work: if you are inspecting things in the debugger, it will matter to you

19:09 hiredman: I don't see that it really makes any kind of difference

19:09 antares_: technically, probably not, anonymous classes are not really special

19:09 SegFaultAX|work: I see. Interesting.

19:09 antares_: so, the only special thing about them is that they have generated names

19:10 SegFaultAX|work: Wow, that tuple implementation is fast.

19:10 doomlord: how does the tuple imlementation work, broadly..

19:11 hiredman: it generates classes with fields, and gives each field indexed access

19:12 it also generates an implementation of most of the interfaces that vectors implement for the tuples, so they are sort of vector like

19:13 SegFaultAX|work: hiredman: That is one big 'ol macro. :)

19:14 hiredman: based on the idea that, while clojure's vectors are pretty fast (using a tree of nodes and arrays) the jvm is more likely to recognize and optimize a single instance + fields

19:19 anyway, I don't think tuples is particular that great, but it is an example of the kind of tricks you can play with clojure's interfaces and macros

19:27 arrdem: is there a clean way to get a subset of a map?

19:28 gfredericks: &(doc select-keys)

19:28 lazybot: ⇒ "([map keyseq]); Returns a map containing only those entries in map whose key is in keys"

19:28 arrdem: (inc gfredericks )

19:28 lazybot: ⇒ 3

19:28 * gfredericks holds up some fingers and says "I'm this many!"

19:29 arrdem: don't make me do it again....

19:30 gfredericks: eek! karma inflation!

19:31 arrdem: ,(println "(" (rand-nth ["inc" "dec"]) " gfredericks)")

19:31 clojurebot: ( inc gfredericks)

19:31 arrdem: troll'df

19:31 gfredericks: "...back in my day, you could buy a leiningen feature for a nickel of karma!"

19:31 arrdem: ,(println (str "(" (rand-nth ["inc" "dec"]) " gfredericks)"))

19:31 clojurebot: (inc gfredericks)

19:31 lazybot: ⇒ 10

19:32 arrdem: wat

19:32 gfredericks: oh the original one referred to "gfredericks " apparently

19:32 arrdem: (inc 3)

19:32 lazybot: ⇒ 1

19:32 gfredericks: haha

19:32 (inc 3)

19:32 lazybot: ⇒ 2

19:32 gfredericks: (inc 3)

19:32 lazybot: ⇒ 3

19:32 * arrdem flips table

19:32 gfredericks: (inc 3)

19:32 lazybot: ⇒ 4

19:32 gfredericks: that's better

19:33 amalloy: you can tell gfredericks participates in "mess with the bots" games because his name with a space after it has already gotten karma twice

19:33 gfredericks: I really have no explanation for that

19:33 amalloy: gfredericks: really? i remember it happening

19:34 gfredericks: amalloy: then I have a poor memory

19:34 was it intentional?

19:34 amalloy: dweebs going like: ,(doseq [nick '(gfredericks whoever blah)] (println "(inc" nick ")"))

19:36 gfredericks: aw man I hate being a dweeb

19:36 arrdem: ,; (doseq [x (range)] (println (str "(" (rand-nth ["inc" "dec"]) " gfredericks)")))

19:36 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

19:39 Sgeo: ,(do); blah blah blah

19:39 clojurebot: nil

19:41 arrdem: clojurebot: everyone I see

19:41 clojurebot: Excuse me?

19:41 arrdem: ,(everyone-I-see)

19:41 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: everyone-I-see in this context, compiling:(NO_SOURCE_PATH:0)>

19:42 hiredman: ,*clojure-version*

19:42 clojurebot: {:interim true, :major 1, :minor 4, :incremental 0, :qualifier "master"}

19:42 Sgeo: ,(println "foo" "bar")

19:42 clojurebot: foo bar

19:42 Sgeo: ,(str "foo" "bar")

19:42 clojurebot: "foobar"

19:42 arrdem: ,(use 'hiredman.clojurebot.core)(everyone-I-see)

19:42 clojurebot: arrdem: Pardon?

19:42 arrdem: dang.

19:44 TimMc: &(use 'hiredman.clojurebot.core) :-P

19:44 lazybot: java.io.FileNotFoundException: Could not locate hiredman/clojurebot/core__init.class or hiredman/clojurebot/core.clj on classpath:

19:46 hyPiRion: ,(use (symbol (str "hiredman.clojurebo" "t.core")))

19:46 clojurebot: #<RuntimeException java.lang.RuntimeException: java.io.FileNotFoundException: Could not locate hiredman/clojurebot/core__init.class or hiredman/clojurebot/core.clj on classpath: >

19:46 hiredman: ,*clojure-version* ; take the hint

19:46 clojurebot: {:interim true, :major 1, :minor 4, :incremental 0, :qualifier "master"}

19:46 arrdem: ,*ns*

19:46 clojurebot: #<Namespace sandbox>

19:47 hiredman: https://github.com/hiredman/clojurebot/blob/master/project.clj#L5

19:49 arrdem: ,(ns-map *ns*)

19:49 clojurebot: {sorted-map #'clojure.core/sorted-map, read-line #'clojure.core/read-line, re-pattern #'clojure.core/re-pattern, keyword? #'clojure.core/keyword?, unchecked-inc-int #'clojure.core/unchecked-inc-int, ...}

19:49 amalloy: arrdem: would you mind doing your clojurebot tomfoolery in a PM with him?

19:49 arrdem: amalloy: I was just about to call it as a matter of fact

19:50 and my appologies, I usually do

19:50 hyPiRion: ,(everyone-I-see)

19:51 clojurebot: ()

19:54 gfredericks: O_O

20:08 TimMc: heh

20:13 KaOSoFt: Hello. Is there a shared (as in accepted by a majority) set of public coding conventions for Clojure? You know, like variable and function naming, for instance.

20:14 gfredericks: if "public" means "documented somewhere" then that decreases the likelihood a lot

20:14 akhudek: KaOSoFt: http://dev.clojure.org/display/design/Library+Coding+Standards

20:14 antares_: KaOSoFt: http://dev.clojure.org/display/design/Library+Coding+Standards. Function and local names are-dasherized.

20:15 gfredericks: decreases it to 100%

20:15 KaOSoFt: Déjà vu...

20:16 gfredericks: KaOSoFt: for any specific questions there are lots of people in #clojure with opinions they like sharing

20:16 KaOSoFt: Oh, my bad, I jumped to Volkmann’s tutorial without reading the whole Clojure documentation.

20:16 jrajav: ANY specific questions?

20:16 gfredericks: jrajav: totes

20:17 any question on any topic whatsoever never fails to elicit at least 4 simultaneous responses

20:18 KaOSoFt: gfredericks: that I just saw, heh. Thanks, I’ll keep digging through documentation and REPL in the meantime, while I get accostumed to functional programming, and Clojure, of course.

20:24 antares_: KaOSoFt: take a look at http://clojure-doc.org/articles/tutorials/getting_started.html. It's a work in progress but already pretty good for basics. And clojure-doc.org is where (hopefully) most of people will collaborate on tutorials and doc guides.

20:26 KaOSoFt: antares_: Hmm... is that one mentioned in the official documentation? I jumped to Volkmann’s because it was mentioned in the Getting Started of the official documenation.

20:26 In any case, thank you. I’ll check it out right away.

20:27 moses: Hi, how would I execute something like "cat foo | anotherprocess" using sh from clojure.java.shell?

20:28 antares_: KaOSoFt: it is the next generation doc site that everyone can contribute to.

20:36 Mordus: Hi, I'm having trouble figuing out how to use clojure.java.shell http://pastie.org/5021571

20:38 brehaut: Mordus: perhaps look at https://github.com/Raynes/conch/

20:38 Mordus: Thank you brehaut.

20:56 technomancy: moses: I think you can provide an input string to sh

21:05 johnmn3: I have an off topic question about programming careers. Where should I ask? or anyone here willing to answer over PM?

21:06 SegFaultAX|work: johnmn3: Just ask.

21:08 johnmn3: my sister wants to change careers and do programming. She has a biology degree. She's contemplating going back to school to get a masters in comp sci. I'm telling her to just learn programming on her own (with my help) and just try to break into the industry that way.

21:08 rather than taking a 30,000 student loan.

21:08 thoughts?

21:09 SegFaultAX|work: johnmn3: I think you're on the right track. She also needs to determine if she a) likes writing software and probably more importantly b) is /capable/ of writing software.

21:09 She might try it and find out that she hates it. Or sucks at it. Or both.

21:09 dlitvak: johnmn3: Comp Sci is not programming...

21:09 they are VERY VERY different

21:09 SegFaultAX|work: johnmn3: Furthermore, since she already has a degree, she already has a good foundation in at least the lower level maths required by a standard CS degree.

21:10 dlitvak: a lot of brilliant programmers are not CS

21:10 akhudek: These are good comments. If she really does enjoy programming and can learn it, then the second most important thing is for her to show potential employers that she can actually do it.

21:10 SegFaultAX|work: dlitvak: That's really a secondary point to his main question, I think.

21:10 akhudek: open source projects are one good way to do this

21:11 also, she should absolutely do some of the new free online CS courses

21:11 dlitvak: SegFaultAX|work: of course it is secondary... but it is not worth to get a CS degree if you dont feel like studying CS... and you just want to code

21:12 akhudek: I think there is a near complete CS curriculum that someone put together that consists only of open and free online courses.

21:13 johnmn3: okay, you all have pretty much affirmed my feelings on the matter

21:14 if she gets a job doing and likes it and wants to continue, perhaps her employer can pay for her masters

21:14 akhudek: dlitvak: respectfully disagree with that. CS theory is important for all good programmers. You don't have to do a formal program to learn the basics though.

21:15 dlitvak: akhudek: i actually study systems engineering and wish i studied CS... but... because i like CS... not because it is useful for me as a developer

21:16 as a developer i think that the most important thing to do... is be a nerd... love your tools... experiment

21:16 try to learn new things every dya

21:16 s/dya/day/

21:16 johnmn3: great comments guys. I just told my sister what you all said

21:16 appreciate it

21:17 dlitvak: last week i spent a couple of hours learning couchdb to make a wrapper for my document db ODM

21:17 and it was awesome to experiment with a new database

21:18 it was a pain on the butt... but it was awesome

21:18 antares_: johnmn3: I do have a degree in CS (and math) but for a lot of what is called "software development" today all you need is curiosity

21:19 johnmn3: curiosity and interest in building things, maybe. You can pick up HTML, CSS, and some JS + basic Web and networking skills in a few months, all without spending tens of thousands and being bored out of your mind.

21:19 johnmn3: okay

21:19 saying she gets those basic understandings down.. basic web dev

21:20 and a project or two on github

21:20 will a web dev shop hire her as an entry level developer, seeing as how she already has a biology degree

21:21 ?

21:21 antares_: johnmn3: that's a good start. I don't think the biology degree will matter much but as long as she is willing to show that she can build at least some Web apps and does not slack off, I think it won't be a problem in a few months.

21:22 johnmn3: and of course, I'm going to make her learn clojure /clojurescript ;)

21:22 zackzackzack: Any particularly good services/open source projects for monitoring a noir server?

21:22 johnmn3: that way she knows how to do it right too :)

21:27 lancepantz: johnmn3: where is she have a friend starting a program in seattle she may be interested in

21:28 he also knows some similar programs in other places that may be good for her

21:28 johnmn3: actually, the DC Metropolitan area, but in the long run, she'll be looking for telework situations

21:29 antares_: johnmn3: http://railsgirls.com/dc

21:29 lancepantz: johnmn3: he suggested http://hungryacademy.com/

21:33 johnmn3: whats the catch? they pay you while you're in the academy? We'll look into it.

21:33 Awesome leads though, thanks!

21:33 she's looking at them now

21:34 lancepantz: buddy says they treat it like an internship at livingsocial at that specific one

21:34 but you dont have to work there afterwards

21:34 antares_: johnmn3: there is no catch. They filter out the best people, those people join their team (and they have a lot of time to evaluate them, too). It is way more reliable than getting someone (even with some experience) off the street.

21:35 lancepantz: anyways, my friend is in techstars starting a company that solves this problem, he knows the options very well if you'd like for me to put them in touch

21:37 johnmn3: That would be awesome!

21:38 please send any contact info to johnmn3@gmail.com

21:38 lancepantz: k, i'll send an introduction

21:40 antares_: johnmn3: there is also http://girldevelopit.com/chapters, no DC chapter as far as I can see but it's probably only a matter of time

21:44 johnmn3: This has been very instructive... very encouraging. My sister thanks you

21:44 lancepantz: johnmn3: I just sent you an introduction email

21:44 fwiw, i don't have a degree in engineering

21:44 and it's been a very successful career for me

21:45 i just like to learn stuff :/

21:45 and get a thrill out of it

21:45 johnmn3: good deal!

21:45 I'll be tying my sister into the conversation in my reply. Thanks a lot!

21:49 tomoj: &(loop [recur inc] (recur 4))

21:49 lazybot: Execution Timed Out!

21:49 tomoj: I am actually very happy about that...

21:52 gfredericks: tomoj: recur is a special form so you shouldn't be able to shadow it

21:52 TimMc: ,recur

21:52 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: recur in this context, compiling:(NO_SOURCE_PATH:0)>

21:53 gfredericks: ,(let [recur identity] (recur 5))

21:53 clojurebot: #<CompilerException java.lang.IllegalArgumentException: Mismatched argument count to recur, expected: 0 args, got: 1, compiling:(NO_SOURCE_PATH:0)>

21:53 tomoj: huh?

21:53 ,(recur)

21:53 clojurebot: Execution Timed Out

21:53 TimMc: Fascinating.

21:54 gfredericks: &(recur)

21:54 lazybot: Execution Timed Out!

21:54 TimMc: &(let [recur 5] recur)

21:54 lazybot: ⇒ 5

21:54 gfredericks: the day we found out the bots were recurrable

21:54 TimMc: It's not a special form, it's a captured symbol.

21:54 tomoj: (eval '(recur))

21:54 gfredericks: TimMc: what?

21:55 TimMc: I think the loop macro captures it.

21:55 gfredericks: what makes you think that?

21:55 TimMc: &(loop [] (let [recur 5] recur))

21:55 lazybot: ⇒ 5

21:55 gfredericks: special forms are only special at the front of a list

21:55 TimMc: Hrm.

21:55 gfredericks: &(loop [] (let [recur identity] (recur 10)))

21:55 lazybot: java.lang.IllegalArgumentException: Mismatched argument count to recur, expected: 0 args, got: 1

21:55 TimMc: &(let [do 5] do)

21:55 lazybot: ⇒ nil

21:55 TimMc: ^ not really

21:56 tomoj: do is a weirdo

21:56 gfredericks: what the heck is that

21:56 &(let [if 5] if)

21:56 lazybot: ⇒ 5

21:56 TimMc: Mayyybe.

21:56 gfredericks: tomoj: what is different about do?

21:56 (&let [let* 10 fn* 12 loop* 16] [let* fn* loop*])

21:57 &(let [let* 10 fn* 12 loop* 16] [let* fn* loop*])

21:57 lazybot: ⇒ [10 12 16]

21:57 Sgeo: ,(special? 'do)

21:57 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: special? in this context, compiling:(NO_SOURCE_PATH:0)>

21:57 tomoj: gfredericks: I dunno, I just remember it does that weird thing

21:57 maybe it's really a bug

21:57 TimMc: So maybe loop only captures 'recur in call position.

21:58 gfredericks: TimMc: why not just it's a special form?

21:58 tomoj: &(let [do 5] [do])

21:58 lazybot: ⇒ [5]

21:58 gfredericks: it works with fns too

21:58 Sgeo: ,(special-symbol? 'do)

21:58 tomoj: what does "capture" mean?

21:58 clojurebot: true

21:58 Sgeo: ,(special-symbol? 'if)

21:58 clojurebot: true

21:58 Sgeo: ,(special-symbol? 'fn*)

21:58 clojurebot: true

21:58 gfredericks: TimMc: clojure.org/special_forms lists it

21:58 TimMc: Hrmph.

21:58 Sgeo: &(let [let* 5] let*])

21:58 lazybot: java.lang.RuntimeException: Unmatched delimiter: ]

21:58 Sgeo: &(let [let* 5] let*)

21:58 lazybot: ⇒ 5

21:59 Apage43: hmm

21:59 TimMc: I guess it has to be special, never mind.

21:59 gfredericks: ,(doc special-symbol?)

21:59 Apage43: using aleph + compojure seems to be -working- okay, but it keeps printing out scary stack traces

21:59 clojurebot: "([s]); Returns true if s names a special form"

21:59 Sgeo: ,(special-symbol? 'let)

21:59 clojurebot: false

21:59 TimMc: ,(:added (meta (var special-symbol?)))

22:00 clojurebot: "1.0"

22:00 Sgeo: Wait, special symbols have vars?

22:00 gfredericks: TimMc: no matter how many decades I've spent with clojure there's always another thing in core I haven't heard of

22:00 Sgeo: That... I thought they didn't

22:00 tomoj: no, special-symbol? has a var

22:00 Sgeo: ,#'do

22:00 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve var: do in this context, compiling:(NO_SOURCE_PATH:0)>

22:00 Sgeo: Oh, derp

22:09 TimMc: Oh man, I'd forgotten how infuriating it is to try to debug lein plugins.

22:09 (or build tools in general, really)

22:15 Apage43: … :/ I attached clojure.tools.trace to the problem fn and the problem went away

22:15 oh, no I lied

22:15 I commented out the problem and the problem went away, different thing

22:20 Sgeo: Ooh, clojure.tools.trace looks useful

22:20 I could use that

22:20 antares_: Apage43: that's the spirit!

22:21 Apage43: figured out my problem, didn't have a default route

22:21 amalloy: tomoj: capture, in the sense of implicitly imbuing a symbol with meaning

22:21 Apage43: so compojure was spitting back out an essentially empty ring response in the event nothing matched, and aleph doesn't like that

22:45 TimMc: technomancy: I tried updating lein-otf for lein 2.x, but I'm encountering an issue with trying to get the loader code into the uberjar. leiningen.uberjar/uberjar appears to ignore the project file I pass it...

22:45 I know that doesn't make any sense.

22:51 zerokarmaleft: TimMc: thanks again btw, your map/reduce suggestion worked like a charm with some minor changes

22:51 TimMc: Great!

22:52 technomancy: WTF, the project map's metadata is another project map? I'm so confused!

23:01 amalloy: TimMc: i don't really follow closely, but isn't lein2 brimming over with metadata? i think project maps contain in their metadata something like "what the project map looked like before profiles were applied"

23:06 TimMc: amalloy: Yes, that seems to be correct.

23:06 The damnedest thing is that the resulting project.clj *only* has the old :main value in :without-profiles in the project's metadata, but it is somehow getting plucked out.

23:09 halgari: what's the best way to remove reflection from an aget on an Object array?

23:09 (aget (make-array 32) 1) ; causes a reflection warning

23:09 err....that should be: (aget (make-array Object 32) 1)

23:12 TimMc: I finally had to go stomping around in :without-profiles to get uberjar to see the right :main. :-(

23:29 callen: anyone set up an auto-reloading ring server in Clojure?

23:33 akhudek: the lien-ring plugin will do this automatically for dev and seems to work.

23:37 TimMc: halgari: Still need an answer?

23:38 &(class (make-array Object 32))

23:38 lazybot: ⇒ [Ljava.lang.Object;

23:38 TimMc: I believe ^"[Ljava.lang.Object;" should do it.

23:41 halgari: @TimMc that did it, thanks. I was missing the ; from the string

23:52 callen: akhudek: dev what?

Logging service provided by n01se.net