#clojure log - Jun 10 2012

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

0:00 Sgeo_: getL aLens myMap -- comes out to 1

0:00 No, I lied.

0:00 getL aLens myMap -- Just 1

0:00 getLn (mapLens "foo") myMap -- Nothing

0:01 But that's more to do with the whole option type thing, which is cool, but Clojure is dynamically typed

0:01 kovasb: i guess the question is, what is one tried to achieve

0:01 Sgeo_: But I have generic getL and setL, which work with lenses to have a generalized way to get and set parts of data in a data structure

0:01 kovasb: does it have to do with nesting at all?

0:02 Sgeo_: kovasb, as you mentioned, you can compose lenses

0:02 (aLens . bLens) for example

0:02 getL (aLens . bLens) someMap would first get the value doing whatever bLens says to do, then whatever aLens says to do

0:03 kovasb: right

0:03 frozenlock: Wow! 300ms to sort 10 string? That can't be right... Am I misusing the sort function? (sort -my-string-list)

0:03 kovasb: there is certainly value in having these things be composable first-class entities

0:04 this is a subproblem of something I'm working on

0:07 frozenlock: is it the same if you run it a few times?

0:07 Sgeo_: Does comp only work on IFns, or is it more general?

0:08 kovasb: IFn is the generalization of functions, so I imagine thats where it stops

0:09 what else could it work on?

0:09 Sgeo_: First thing that comes to mind is arrows

0:09 But I'm sure there are simpler examples

0:09 rotations.

0:09 kovasb: i don't know what an arrow is :)

0:10 Sgeo_: If you have a structure that represents a rotation, it would be nice to be able to compose them

0:10 kovasb: totally

0:10 frozenlock: kovasb: As a mean, yes... but I've even got 1 full second

0:11 kovasb: frozenlock: you are not low on memory or something?

0:11 frozenlock: this is with a fresh repl?

0:11 frozenlock: no and no

0:11 kovasb: suggest trying with a fresh repl

0:12 "is it repeatable"

0:12 Sgeo_: Arrows are sort of generalized functions... but I'm a bit iffy and confused on the subject myself

0:12 And they're not needed to find examples of useful "Categories"

0:12 Haskell term for something that implements id and (.)

0:13 It comes from category theory, presumably, but I don't know category theory

0:13 kovasb: Sgeo_: probably best to define a separate composition function in its own namespace

0:13 unless you want your rotation thing to itself be a function

0:14 Sgeo_: Well, more that I want composition to be properly general

0:15 kovasb: that would be pretty confusing

0:16 right now, if you see (comp f1 f2 f3) that means you can take f1 and use it as a function directly

0:16 johnmn3: arg, how do you slurp from an input-stream?

0:16 kovasb: likewise with map, filter etc

0:16 frozenlock: Oh I found the problem! Another function timed as 0.3 ms, but it's a lazy one. When I doall it, I obtain 300ms.

0:17 Sgeo_: ......oh right

0:17 kovasb: you could have something similar to comp as a protocol

0:17 Sgeo_: map is insufficiently general too

0:17 kovasb: haha

0:18 sounds like a theme ;)

0:18 Sgeo_: I _think_ filter's good.

0:19 Haskell's map and . are also insufficiently general. fmap is the more general verson, and a good . is in Control.Category

0:19 * Sgeo_ looks for a good example

0:19 Sgeo_: The Maybe type is a functor, but that's meaningless to you

0:20 IO

0:20 kovasb: i mean, given the existing data structures it makes sense

0:20 Sgeo_: Wait, I'm entirely wrong

0:20 kovasb: if there are other more interesting data structures to operate on, should be possible to make it work

0:20 Sgeo_: It's the second argument that it's general on

0:21 I assume Clojure's map is general on the second argument?

0:21 kovasb: it takes a seq

0:21 Sgeo_: Bah, do seqs need to implement more than just map?

0:21 (If so: Not general enough! AHAHHAHHA *goes insane*)

0:22 kovasb: sees just return a list of values

0:22 seqs

0:22 Sgeo_: What if I want to map over something that isn't a list.

0:22 ?

0:23 kovasb: if it implements ISeq, you are good

0:23 Sgeo_: I just mentioned my stupidity in another channel, and someone (to tease me) does map with a number as the first argument

0:24 <shachaf> > map 3 ["hi","Sgeo_"]

0:24 <lambdabot> [3,3]

0:24 What's the best way to gain information about how I'd go about implementing ISeq?

0:25 kovasb: the interface is pretty minimal

0:25 Sgeo_: Anyway, I have an example of something that's not a list of values but which map is useful for

0:25 xeqi: a tree?

0:26 Sgeo_: No

0:26 kovasb: first, rest, cons

0:26 Sgeo_: An... this is not a concept that makes much sense in Clojure, but I'll try

0:26 kovasb: i would look at the implementation for various datastructures

0:26 possibly in clojurescript

0:26 adu: when I first learned about clojure, I thought rest and next were the same function

0:26 Sgeo_: In Haskell, IO is dealt with by having "actions" so to speak (IO values)

0:26 kovasb: (the clojure ones are often in java)

0:27 Sgeo_: So, putStrLn "Hello" does not actually do anything, but it's a value that, when "performed" will do something

0:27 getLine is an IO value. It, when performed, gives back a value

0:27 Now, suppose I want to build an IO value, that, when performed, will get a line then give back the line with "!" at the end

0:28 In Haskell, I can fmap the appending function like this:

0:28 fmap (\line -> lines ++ "!") getLine

0:28 adu: Sgeo_: I'm very familiar with Haskell

0:28 Sgeo_: And that will give me an action that, when performed, does what I want

0:28 kovasb, does this look like a sequence?

0:28 Yet, map is useful for it

0:28 Although, I guess you could have first be side-effecting

0:29 kovasb: honestly i can't tell

0:30 adu: Sgeo_: I think you put an extra 's' on lines

0:30 Sgeo_: adu, you are correct, oops

0:30 >.>

0:31 kovasb: gotta run

0:31 Sgeo_: Although normally I'd just do (++"!"), but I think the full lambda form is clearer

0:31 Bye kovasb

0:31 kovasb: laters!

0:31 Sgeo_: (For someone who is inexperienced with Haskell, I mean)

0:31 adu: Sgeo_: so what are you trying to do with clojure?

0:32 Sgeo_: adu, right this moment, not much

0:32 Trying to get a grasp of it, and of course I can't help comparing it to other languages and other stuff floating in my head

0:33 I tend to do that more than I actually write code :/

0:33 adu: #(str % "!") might have been more clojure-esque

0:34 Sgeo_: understood, when trying to solve a problem, I generally think of the solution in 50 languages, and then pick the shortest one

0:35 Sgeo_: I recently tried to do something in Racket, then discovered its printf was not sufficient, so I ended up falling back to my typical fall-back (Python)

0:35 * adu hates printf

0:35 Sgeo_: There was probably something in PLaneT, but I never thought to check

0:36 Well, I needed to turn numbers like 1, 2, 3, 10, 20, into "001", "002", "003", "010", "020"

0:36 adu: that's what some-util-lib:pad-number-string-with-zeros is for!

0:37 I don't know if that actually exists

0:48 devn: ,(map (comp #(apply str %) #(cons "00" %) seq str) (range 0 20))

0:48 clojurebot: ("000" "001" "002" "003" "004" ...)

0:48 devn: ^-ugly :\

0:51 replaca: you can use cl-format for that

0:52 ,(map #(cl-format nil "~3,'0d" %) (range 0 20))

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

0:53 replaca: ,(map #(clojure.pprint.cl-format nil "~3,'0d" %) (range 0 20))

0:53 clojurebot: #<CompilerException java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.pprint.cl-format, compiling:(NO_SOURCE_PATH:0)>

0:53 devn: ,(use 'clojure.pprint)

0:53 clojurebot: nil

0:53 devn: ,(map #(clojure.pprint.cl-format nil "~3,'0d" %) (range 0 20))

0:53 clojurebot: #<CompilerException java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.pprint.cl-format, compiling:(NO_SOURCE_PATH:0)>

0:53 replaca: ,(map #(clojure.pprint/cl-format nil "~3,'0d" %) (range 0 20))

0:53 clojurebot: ("000" "001" "002" "003" "004" ...)

0:53 replaca: there we go

0:53 devn: :)

0:53 cl-format is twisted magic

0:53 i love it, but i hate it as well

0:53 replaca: indeed :)

0:54 Sgeo_: Does Racket have cl-format?

0:54 devn: honestly i stick to something like the above unless i want roman numerals ;)

0:54 replaca: dunno. It's an implementation of common lisps format routine, so those of us who come from there are familiar with it

0:55 Sgeo_: I ... have seen it, but haven't done enough with CL to be used to it

0:55 devn: replaca: fair enough, but i know CL folks who are very much anti-cl tricks

0:55 Sgeo_: I'm certain it could get the job do... oh, you just used it

0:55 devn: anti-cl formatter* tricks

0:55 Sgeo_: I'd be amused if it were TC

0:56 But I think I asked once, and it isn't

0:57 replaca: devn: sure, but it depends what you decide is a trick. I personally love using the iterators because it seems natural to me, but I see why some don't like them

0:57 Sgeo_: I have a million copies of emacs on here and I'm afraid to use any

0:57 tomoj: would it be difficult to make clojurescript export the exports from explicitly named deps?

0:57 Sgeo_: I should wipe them out and start fresh

0:58 devn: replaca: yeah, im not trying to be opinionated, just trying to play the middle on that topic

0:58 i know there have been a few raging debates in the past on this topic

0:58 so im a bit sensitive

0:59 replaca: devn: yeah, in clojure it seems that those who use it (a minority), use it and the rest leave it alone without much debate

0:59 devn: ,(take 10 (map #(str "00" %) (iterate inc 0)))

0:59 clojurebot: ("000" "001" "002" "003" "004" ...)

0:59 devn: ^-that's better

0:59 Sgeo_: devn, no it's not

1:00 devn: lol

1:00 replaca: well, yeah if you always want two leading digits

1:00 Sgeo_: 0010 is not what I need

1:00 * devn stares blankly

1:00 Sgeo_: <Sgeo_> Well, I needed to turn numbers like 1, 2, 3, 10, 20, into "001", "002", "003", "010", "020"

1:01 devn: i see no

1:01 now*

1:02 replaca: ,(clojure.pprint/cl-format nil "~3,'0d" 10)

1:02 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.pprint>

1:03 replaca: did clojurebot restart?

1:03 devn: (use 'clojure.pprint)

1:03 replaca: ,(clojure.pprint/cl-format nil "~3,'0d" 10)

1:03 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.pprint>

1:03 replaca: weird

1:03 ,(use 'clojure.pprint)

1:03 clojurebot: nil

1:03 devn: (require '[clojure.pprint :as pp])

1:03 replaca: ,(clojure.pprint/cl-format nil "~3,'0d" 10)

1:03 clojurebot: "010"

1:03 devn: ,(require '[clojure.pprint :as pp])

1:03 clojurebot: nil

1:04 devn: (pp/cl-format nil "~3,'0d" 10)

1:04 ,(pp/cl-format nil "~3,'0d" 10)

1:04 clojurebot: "010"

1:04 replaca: it did restart and devn didn't say "simon says"

1:04 * Sgeo_ replaces replaca with setf car

1:04 replaca: :)

1:04 devn: heh

1:09 amalloy: replaca: he restarts every so often (15 minutes?) in case someone has broken the repl

1:10 hiredman: the bot doesn't restart, it loads a fresh sandbox (new copy of clojure from a new classloader)

1:11 Sgeo_: Ugh, a deeper understanding of Clojure is going to require esoteric Java knowledge, isn't it?

1:11 I want esoteric Clojure knowledge, not esoteric Java knowledge

1:16 johnmn3: frozenlock: https://www.refheap.com/paste/3077

1:16 Sgeo_: What's a ClassLoader?

1:18 frozenlock: johnmn3: Thanks, I'll grab this nice addition :)

1:18 johnmn3: it doesn't yet conform to yours

1:18 yours allows one to provide filenames

1:18 zlurp just gobbles up all the contents of every file into one structure

1:19 Sgeo_: Will I need to learn Java file stuff to figure out how to do file stuff in Clojure?

1:19 johnmn3: Which is all I need for right now, because I just want the zip file to be one big resource bucket

1:19 Sgeo_: not for most things, as there are wrappers for most things.

1:19 it'll be helpful to learn, though.

1:22 _ato: Sgeo_: http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/ClassLoader.html

1:24 Sgeo_: So, a ClassLoader is a way to dynamically create a class in a running instance of the JVM?

1:26 _ato: yes, that's one thing a classloader can do. All classes are loaded by classloaders (there is bootstrap loader written in C to get around the chicken and egg problem that classloaders are themselves instances of classes). So for example they're also used in applets to load classes from URLs instead of from the local filesystem.

1:27 Sgeo_: I assume that they're how a program that I ... uh, used a decompiler on loads classes from the Internet

1:27 >.>

1:28 Come to think of it, I'm not sure if it uses http or https

1:28 And if it uses http, that's a problem

1:28 I should check

1:28 lpvb: Better to learn a pure functional programming language like haskell first or dive into clojure? Would haskell teach functional programming better since it's pure?

1:29 Sgeo_: Also, the program, by default, seems to install to run as administrator, to overcome the fact that it puts data files in where it's installed due to how old it is

1:32 _ato: One of the more interesting uses of classloaders is sandboxing. When code tries to find a class it does so by querying its own classloader. Since you can have multiple classloaders, that means you can have multiple conflicting versions of the same library in the JVM at once as long as they were loaded by different classloaders.

1:33 Sgeo_: _ato, multiple..... hmmmm..... does JVM and/or clojure have the ability to handle this situation? (It might not be necessary, since apparently domain names are used to name stuff?)

1:33 hiredman: https://github.com/hiredman/polycosm

1:33 Sgeo_: Suppose there are two libraries called A, and some conflicting internal names, but different purposes.

1:33 Let's call one of them A1 and the other A2.

1:34 replaca: lpvb: I'm not sure that there's one right answer to that

1:34 Sgeo_: B relies only on A1, and C relies on A2.

1:34 I want to create D, which relies on both B and C.

1:34 Is D writable?

1:34 As in, is there a solution to this dilemma

1:34 _ato: yes, check out hiredman's link

1:34 replaca: lpvb: Haskell shows more pure functional concepts (and is quite pure) so from an academic point of view it's best

1:34 hiredman: Sgeo_: I've never had that happen in practice, the thing I've seen is you end up wanting two different versions of a particular dependency

1:35 like you use X and Y, X and Y both require Z, but X wants Z 1.0 and Y wants Z 2.0

1:35 replaca: lpvb: but Clojure makes it easier to do lots of practical work while still being "pure by default"

1:35 Sgeo_: lpvb, I've encountered someone who know Clojure and not Haskell, and as such, doesn't quite understand that Clojure the language isn't... ok, I shouldn't argue about this

1:36 replaca: lpvb: so you *do* tend to write functional programs in Clojure

1:36 Sgeo_: hiredman, hmm

1:36 I don't know anything about maven or lein

1:37 hiredman: which is what I wrote polycosm for, I want to use clojure 1.4 but I have a dependency on a library that is locked to 1.2, so I want clojure 1.4 and 1.2 to live side by side

1:37 Sgeo_: hiredman, is it pure Clojure or are there Java parts?

1:37 lpvb: So if I'm still wrapping my head around functional programming, I guess I'll go with haskell and move on to Clojure when I need practical work?

1:38 sgeo_, What were you going to say?

1:38 replaca: lpvb: Haskell includes the Hindley-Milner type stuff and Clojure is fully dynamic, so if you're interested in that, Haskell may be a better bet

1:38 Sgeo_: Clojure the language isn't inherently lazy, it's just the collections.

1:38 hiredman: Sgeo_: does it matter? polycosm is in clojure, but it is built on top of the jboss module system, which is written in java

1:39 lpvb: I really like the type system of haskell

1:39 Sgeo_: He hasn't had exposure to Haskell's laziness, so assumed that Clojure's was the extent of it

1:39 Vinzent: lpvb, haskel is actually about types, not about functional programming

1:39 lpvb: hmm

1:39 Sgeo_: Vinzent, it's about both

1:39 I would think

1:39 lpvb: yea isn't it both?

1:39 replaca: Vinzent: I would say that Haskell is about both and Clojure is only about functional programming

1:40 Vinzent: lpvb, if all you want is to familiarize yourself with functional programming concepts, then probably scheme is the best choice

1:40 Sgeo_: Scheme still has mutation

1:40 :/

1:40 lpvb: Scheme has no relevance to me though...

1:40 Sgeo_: lpvb, I've heard good things about SICP

1:41 lpvb: I've heard about that too

1:41 Sgeo_: I intend to work through it at some point

1:41 lpvb: I'll order it tomorrow

1:41 replaca: lpvb: the problem with all of these discussion is that the meaning of "functional" varies by person

1:41 amalloy: lpvb: sicp is free online. feel free to order a dead-tree version, but you certainly don't have to wait for it to arrive

1:42 lpvb: oh

1:42 okay =)

1:42 I love when knowledge is free

1:42 replaca: to me it includes immutability, to others it includes HM typing and to some it means only higher-order functions (in which case Lisp, Scheme and JavaScript are all "functional")

1:43 Vinzent: Sgeo_, replaca, sure, but it puts emphasis on types, so I guess it would just distract

1:43 Sgeo_: Vinzent, types are good

1:43 >.>

1:43 And null/nil/whatever must DIE

1:43 replaca: Vinzent: depends what you're trying to see.

1:44 Sgeo_: Replace it with option types


1:44 replaca: Sgeo_: maybe? :)

1:44 Sgeo_: lol

1:44 :)

1:45 lpvb: replaca, why not just keep it simple and go with "functional programming performs computation on immutable data" and just seperate languages that have good and bad support for aiding that?

1:45 Vinzent: replaca, well, the guy was talking about functional programming

1:45 replaca: man, spending my Saturday night making Haskell puns. I've reached a new low. Why couldn't I have just chosen heroin. :)

1:46 lpvb: sure, you've pretty much hit my definition. But not everyone thinks that is sufficient and some think it too rigorous. And they have valid points.

1:47 Sgeo_: That definition doesn't imply lambdas, does it?

1:48 replaca: Sgeo_: no, and lambdas are really syntactic sugar. Though it's hard to consider true functional programming without closures

1:48 just cause it gets too verbose and requires some kind of state containers

1:49 Sgeo_: I think I still need to adjust to the notion of a closure actually altering the variables it closed around

1:49 replaca: but you can even do clojures without lambdas

1:49 Sgeo_: freudian slip

1:49 ?

1:49 replaca: Sgeo_: yeah, but in an imuutable worls that's not a problem

1:49 Vinzent: lpvb, CL has a good support for such computation (and has lambdas too), but it hardly can be called functional

1:50 replaca: Sgeo_: yeah, sorry :)

1:50 Vinzent: again, depends on your definition, but I wouldn't call it functional

1:50 lpvb: CL?

1:50 clojurebot: You just made an ad hoc, informally -specified, bug-ridden, slow implementation of half of that.

1:50 lpvb: oh

1:50 Sgeo_: <Sgeo_> Why does CL get called functional? <[name redacted]> it's sort of like how you call ancient greece democratic.

1:50 lpvb: derp

1:51 Vinzent: replaca, yes, I'm saying the same thing

1:51 lpvb: I'll just call CL a bad functional language then?

1:51 What's with all the black & white

1:51 replaca: most folks talk about languages like CL being "multi-paradigm" but I think that's never worked out too well

1:51 Vinzent: lpvb, no, it's just multiparadigm

1:52 replaca, oh, come on :)

1:52 lpvb: Functional being a subset of multiparadigm?

1:52 Sgeo_: What should I implement first? Maybe, or lenses?

1:52 replaca: lpvb: I think most of us would consider strong support for immutable types (preferably as a default) as being part of "functional"

1:53 Sgeo_: I mean, maybe is a little less useful with a dynamically-typed language

1:53 replaca: Vinzent: well, I mean in the sense of having large programs that are truly functional

1:53 Sgeo_: Although..... not useless.... since to _use_ it you need to acknowledge it

1:53 Use a Just 5

1:53 lpvb: One other question, does Scala make functional programming harder than Clojure by being multiparidigm?

1:53 replaca: Vinzent: multi-paradign languages tend to break *all* the paradigms in practice

1:54 Sgeo_: You'd get a runtime error from trying to treat it like 5, instead of compile-time error, but that error will occur more often

1:54 replaca: lpvb: yes, I think so

1:54 Sgeo_: replaca, does that sound like a good idea?

1:54 Maybe in Clojure, which will force users to actually think about it?

1:54 replaca: Sgeo_: no, I don't think so

1:54 Sgeo_: Blah?

1:55 replaca: Sgeo_: well, there's multi-paradigm and then there's pure vs. impure

1:55 Vinzent: lpvb, scala makes any programming harder :)

1:55 replaca: Sgeo_: Clojure is clearly impure functional with dynamic typing and is fairly opinionated about that

1:56 Sgeo_: Well, I wouldn't be making it statically typed, as such

1:56 I wouldn't be triggering compile-time errors

1:56 replaca: now, you could implement other paradigms by leveraging the impurity, but it's usually a bad idea

1:56 Sgeo_: I want to correct the billion-dollar mistake

1:57 replaca: Sgeo_: there has been work to implement monads (including Maybe) in Clojure

1:57 Sgeo_: Any work on lenses? I'll do that then

1:57 replaca: Sgeo_: http://clojure.github.com/algo.monads/

1:57 Sgeo_: If I eventually get around to it lol

1:58 replaca: Sgeo_: I'm not sure. None that I know of explicitly but something in the back of my head tells me I heard someone mention it once

1:58 Sgeo_: I did mention it earlier today

1:58 replaca: (lenses, that is)

1:58 Sgeo_: I don't mean you :)

1:59 Sgeo_: Ah lol

1:59 (source lenses)

2:00 adu: Sgeo_: still here?

2:00 Sgeo_: adu, hi

2:00 lpvb: Another question: what are some good resources on learning AI in the functional paradigm?

2:00 adu: Peter Norvig?

2:02 replaca: lpvb: you know, I haven't seen too much there. There's a lot of logic stuff though (the "The Reasoned Schemer" and core.logic)

2:04 lpvb: Peter Norvig's AI 'bible' is done in Common Lisp, which I just recently learned isn't very functional =(

2:04 adu: nonsense

2:05 that's like saying blenders aren't very sharp

2:06 Sgeo_: Eh, it's still more functional than mainstream languages

2:06 Or, well, some

2:07 lpvb: I guess I'll just start AI with whatever paradigm the authors choose and port the algorithms to functional later

2:07 Sgeo_: For what it's worth, even Haskell makes it somewhat simple to port imperative languages to it, although of course such ports aren't in functional style

2:08 erm, port imperative algorithms

2:38 adu: lpvb: you might also look at Prolog and Oz

2:40 lpvb: also http://groups.csail.mit.edu/mac/users/gjs/propagators/

2:40 the propagator model is poised to replace Turing machines and lambda calculus, according to its authors

2:41 so, basically, you may not want to convert to functional

2:47 lpvb: adu: I like the mathematical relationship of functional

2:48 adu: it's very restrictive

2:49 you should read http://web.mit.edu/~axch/www/phd-thesis.pdf if you're interested in AI

2:49 lpvb: it's sufficient to be better than imperitive and OOP, which is all I ask for

2:50 I'll take note

2:52 looks like it models neurons & synapses?

2:52 adu: the classical approaches are also good, but the propagator model subsumes most knowledge/inference systems out there

2:53 lpvb: And all this is really new stuff so there aren't any languages which implement this yet?

2:54 adu: see my previous link (...csail...)

2:54 that's an implementation of propagators in mit-scheme

2:55 I've run it, it works

2:55 lpvb: oh okay, I was skimming through it and wondering why there was scheme everywhere

2:55 looks like an interesting read, thanks

2:55 adu: yw

2:57 lpvb: but if you think it's just an abstraction of brains, then you're missing the point, that you can implement concurrent algorithms without worrying about TIME

3:01 lpvb: adu, no that's not the essence of what I got out of it

3:03 adu: did you read Chapter 7?

3:21 michaelr525: good morning

3:37 Sgeo_: Is there anything wrong with using Clojure Box for everything?

3:39 borkdude: Sgeo_ doesn't is still use clojure 1.2 or so?

3:39 Raynes: It probably uses a lot of ancient things.

3:39 Sgeo_: borkdude, hmm, apparently

3:40 I wonder if Lispcabinet is good

3:40 borkdude: it still uses an older version of swank-clojure; when I used it it was very hard for me to get the classpath right etc

3:41 Sgeo_: http://lispcabinet.sourceforge.net/ has Clojure 1.4

3:41 borkdude: Sgeo_ why don't you use normal Emacs with emacs starter kit and clojure-mode

3:49 Sgeo_: borkdude, can I also do Racket from there?

3:51 borkdude: Sgeo_ It wouldn't surprise me, but I have no Racket experience whatsoever

3:53 Raynes: Does racket use slime?

3:54 If not, then sure. You can do COBOL too if necessary.

3:59 borkdude: I think blog posts and examples using leiningen 1.7 should now be updated stating that explicitly, it would save people a lot of time

3:59 if they first are trying to setup things

4:01 Raynes you can only use one language with slime?

4:02 Raynes: borkdude: It's hard (nearly impossible) to, for example, use SLIME with both Clojure and Common Lisp. I suppose it's because you use an ancient version of SLIME with Clojure because it's impossible to follow SLIME development because they never release anything.

4:07 borkdude: were there any plans to use nrepl from emacs?

4:10 Raynes: https://github.com/technomancy/nrepl.el

4:10 If somebody takes it up, then yes.

4:10 Nobody so far has built on this sadly.

4:27 alex_baranosky: what are your favorite tools to diff large maps?

4:28 imagine you were still using 1.2 and no leiningen

4:31 borkdude: alex_baranosky no idea… maybe use set.difference?

4:31 hoeck1: alex_baranosky: depends, I'd go with sets and keys & vals

4:33 alex_baranosky: sorting maps, printing their values in a defined way and piping the result to diff or colordiff may also produce usable results

4:35 alex_baranosky: here is an example of a diff in clojure: https://github.com/hoeck/seq-diff but beware, its not optimized in any way so it may be unusable slow for non-tiny sequences

4:36 alex_baranosky: that doesn't diff maps, right?

4:39 hoeck1: alex_baranosky: no, I'm still searching for a good tree diff algo

4:39 but depending on the nesting in your maps, sorted item seqs will do just fine

4:40 alex_baranosky: this feels like something that should be a solved problem already

4:40 I guess it is for leiningen users; they can use the leon diff plugin

4:41 seeing the problem in test failures is less quick than it should be

4:42 I'd like to give something two maps, or even two arbitrary structures, and have it give me back a annotated breakdown of the differences

4:47 hoeck1: alex_baranosky: this seems to be a very hard problem, though a really useful one once solved properly, e.g. this would enable to create syntax sensitive diffs of code

4:48 alex_baranosky: is it one of those problems that seems simple enough but turns out to be really complicated once you've looked into it more deeply?

4:50 hoeck1: alex_baranosky: yes, I've skimmed over a dozen papers aimed at providing (partial) solutions to tree-diffs

4:51 the problem is to find a minimal sequence of edit commands to transform one tree into another

4:51 edit commands are at minimum insert and delete

4:51 alex_baranosky: make sense

4:56 hoeck1: there is also this tool (proprietary): http://www.semanticdesigns.com/Products/SmartDifferencer/

4:58 not sure if they really implemented a tree diff yor just a normal sequence diff and implemented each special case on top of a heuristic detection of move-node, rename-node and such

5:28 borkdude: CLJ Galgje (clj hangman): Hangman with words from the #clojure language, case sensitive: http://bit.ly/Kr58SZ

5:33 Sgeo_: I wonder if Clojure is a good language to start learning web dev with

5:33 I mean, Smalltalk does have AIDA/Web...

5:33 (I sort of have philisophical objections to Seaside)

5:34 Although Seaside does seem nifty at first

5:59 wink: borkdude: nice. but with 3 letter words it's really nasty

6:01 penthief: What significance does a trailing # have? eg. (fn [field# value#] ...)

6:04 ...and is there a single page version of http://clojure.org/Reference

6:04 AimHere: http://clojure.org/cheatsheet might be useful for you

6:06 And I'm not sure if trailing # has any significance; "The Reader" section of that reference doesn't say symbols can have '#' characters in them, but it seems to act as just any other character in a symbol

6:07 babilen: penthief: Might be symbol generation in macros -- See http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/gensym and http://clojure.org/reader and http://www.learningclojure.com/2010/09/clojure-macro-tutorial-part-i-getting.html

6:07 penthief: We'd need a real example though

6:10 penthief: babilen: Not real, but cutdown: (defmacro blah [fieldname] `(let [example# 42] 42)) It may be a project-specific convention.

6:10 classcast: I get this really weird ClassCastException from one of my deftypes: java.lang.ClassCastException: org.voelkel.aco.problem_definitions.vrptw.data.Costs cannot be cast to org.voelkel.aco.problem_definitions.vrptw.data.Costs

6:11 Sgeo_: penthief, that # indicates to, essentially, make it a random name that can be referred to elsewhere in the macro with example#

6:11 Sorry if this is a poor explanation

6:11 babilen: penthief: Yeah, that's in a macro and essentially just means: generate me a unique name in the context of this macro.

6:11 Sgeo_: But if you didn't use # there, then if you used the macro and happened to use example within it or outside of it, stuff could break

6:11 classcast: how is it possible that my deftype Costs cannot be cast to itself?

6:12 penthief: OK, that's clojure for some kind of gensym. Thanks!

6:12 babilen: penthief: If you want to learn why this is important you might want to read something about "hygienic macros"

6:12 penthief: It *is* gensym

6:13 Sgeo_: penthief, I think let over lambda describes a similar auto-gensym

6:15 http://letoverlambda.com/index.cl/guest/chap3.html somewhere in there

6:45 ludston: Hey guys and gals. Does anyone here know anthing about .pid's?

6:46 babilen: ludston: Pretend that somebody does and ask your real question. What is a ".pid's" ?

6:48 ludston: babilen: It's the file that starts a daemon. I'm trying to work out how to compile/write one

6:49 michaelr525: isn't it the file holding the process id of the given daemon?

6:49 ludston: Google is not helping me. It's a small, but significant thing I don't want to spend too much time trying to understand

6:49 michaelr525: Yeah, that's the one

6:49 babilen: ludston: What kind of daemon? AFAIK daemons are typically started by init scripts (sysvinit unix) or ... -- I still fail to see how this is related to clojure.

6:50 wink: ludston: you could look into (but not limited to): supervisord, circus, start-stop-daemon

6:50 ludston: I have a clojure project that I want to run as a daemon on my server.

6:50 michaelr525: ludston: why don'

6:50 t

6:50 babilen: ludston: If you are referring to lein-daemon and the PID file (i.e. the file that will contain the PID after a daemon is started) then please say that.

6:50 michaelr525: you just `cat` some .pids to see what's inside?

6:51 babilen: ludston: I am referring to https://github.com/arohner/lein-daemon btw -- What are you really trying to do?

6:51 ludston: Hmm

6:51 michaelr525: babilen: it think he should have given you the answer, since you know the question. ;)

6:52 ludston: michaelr525: There is something fundamental that I don't understand.

6:52 I will have to get back to you.

6:52 michaelr525: ludston: maybe you should get back to babilen.. ;)

6:53 ludston: Him too.

6:53 babilen: I'm trying to use lein-daemon to do the thing that lein-daemon does

6:55 michaelr525: lol

6:55 babilen: ludston: Why don't you use lein-daemon as it does what lein-daemon does? On which platforms do you want to run that daemon? Should it start on boot or do you want to start it manually? Which init system is used on the boxes you deploy to?

6:55 ludston: I'm running it on an Archlinux box on a Linode server

6:57 When I try and run it, it's hangs for ages, and then gives an error relating to the pid file

6:58 babilen: ludston: And do you want the daemon to start during boot? Which init system is used on the box? I would recommend to ask in #archlinux about the recommended way to write an init script if that is what you are trying to do. On Debian you would base it on /etc/init.d/skeleton after reading /etc/init.d/README, but that probably doesn't hold true on Arch.

6:59 ludston: I've done daemon stuff on Arch before

6:59 babilen: ludston: Ah - You have a problem using lein-daemon? Please provide more details (i.e. code/configuration, the *exact* command you run as well as the error message) -- paste it to, for example, http://refheap.com

6:59 ludston: It's got this /etc/rc.conf file for starting daemons at boot

6:59 babilen: ludston: But I am done coming up with questions to actually understand your problem

6:59 ludston: Thanks for you help

7:15 Thanks bablilen. It's fixed. It was a problem with config like you thought it was.

7:16 *babilen

7:36 wink: ugh

7:39 bweaver: Hi, i'm trying to use `clojure.lang.Var/cloneThreadBindingFrame` but keep getting the error "Unable to find static field: cloneThreadBindingFrame". Am I missing an import?

7:39 Bronsa: ,(clojure.lang.Var/cloneThreadBindingFrame)

7:39 mittchel: Hello everyone :)

7:39 clojurebot: #<Frame clojure.lang.Var$Frame@6007b705>

7:41 mittchel: Is anyone familiar with seesaw?

7:42 bweaver: Bronsa: sorry, I still don't understand what I'm doing wrong.

7:43 Bronsa: ,clojure.lang.Var/cloneThreadBindingFrame

7:43 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to find static field: cloneThreadBindingFrame in class clojure.lang.Var, compiling:(NO_SOURCE_PATH:0)>

7:43 Bronsa: cloneThreadBindingFrame is a static method

7:43 not a static field

7:43 bweaver: ok

7:44 Bronsa: you cant (let [f clojure.lang.Var/cloneThreadBindingFrame] (f)) as you'd do with clojure functions

7:44 java methods aren't first order

7:45 bweaver: Bronsa: I must still be doing something wrong. In a fresh repl, (clojure.lang.Var/cloneThreadBindingFrame) produces the error ava.lang.RuntimeException: java.lang.NoSuchFieldException: cloneThreadBindingFrame

7:46 I see it works for clojurebot, maybe I'm doing something silly

7:46 Bronsa: which version of clojure are you using?

7:47 bweaver: *clojure-version* reports {:major 1, :minor 3, :incremental 0, :qualifier nil}

7:47 Bronsa: clojure.lang.Var/cloneThreadBindingFrame has been introduced in clojure-1.4.0

7:47 bweaver: erg, ok

7:48 Sorry, thanks for the help Bronsa.

7:49 Bronsa: you're welcome :)

8:08 mittchel: how am I able to lock the height of a text box in seesaw?

8:08 when my window resizes its get very large in height.

8:14 Anyone familiar with seesaw?:P

8:17 borkdude: mittchel maybe try Stackoverflow or @daveray (author of seesaw) with a link to your coee

8:18 mittchel sorry, @darevay

8:19 mittchel or the google group: https://groups.google.com/forum/?fromgroups#!forum/seesaw-clj

8:20 mittchel: Well I've to work on HUSACCT documents so maybe later if Ive the time

8:24 kjellski: I was just looking at the core.flatten implementation and was wondering how someone would implement this without knowledge of tree-seq?

8:25 AimHere: 4clojure has 1400 reimplementations of flatten

8:25 borkdude: smth like this? http://nostoc.stanford.edu/jeff/llisp/15.html

8:26 kjellski: AimHere: therefor I'm looking at it… didn't get it right… how am I able to look at the solutions?

8:27 AimHere: well once you get it right, you can see the solutions of any users you select

8:28 Of the solvers I have selected, only two use tree-seq

8:28 kjellski: AimHere: … so this wouldn't help… I don't want to paster clojure.core in there… feels kinda lame… thanks borkdude, that's what I was looking for...

9:07 mittchel: Anyone with seesaw experience able to help?: http://stackoverflow.com/questions/10968710/seesaw-button-bind-windowbuilder

9:14 borkdude: mittchel maybe a link to github would help in ths stackoverflow post

9:18 mittchel: its a pain in the ass :D

9:29 borkdude: is there anything that does (require some-ns) and (in-ns some-ns) in one go?

9:33 raek: borkdude: (doto 'some-ns require in-ns) :-)

9:33 borkdude: ;-)

9:52 dgrnbrg: is there a guide/advice on maintaining a version of a lein plugin for lein1 & lein2?

10:15 xeqi: dgrnbrg: check out https://github.com/sattvik/leinjacker

10:15 it tries to handle some of the differences

10:17 dgrnbrg: xeqi: cool, thanks!

10:17 do you know whether there's a compatibility api for :injections in lein2 with lein1?

10:30 Is there a way to have a project work on lein1 and lein2 when it has lein1 dev dependencies?

10:31 ohpauleez: dgrnbrg: Why are you shooting to support both?

10:31 dgrnbrg: ohpauleez: I'm trying to write and test a lein plugin that I want to support both lein1 and lein2

10:32 ohpauleez: Kibit supports both, you can look at how that plugin

10:32 dgrnbrg: and i have a test project that I'd like to make support both as well

10:32 ohpauleez: is built

10:32 dgrnbrg: https://github.com/jonase/kibit

10:32 clojurebot: eg, https://github.com/clojure/tools.logging is the new version of clojure.contrib.logging

10:33 dgrnbrg: ohpauleez: i think that kibit is simpler than my plugin

10:33 I need to hook a bunch of leiningen internals

10:33 i'll try maintaining 2 copies of the test project for now

10:34 ohpauleez: I think that's best, and what I've seen most projects do that rely heavily on internal stuff

10:35 dgrnbrg: ohpauleez: do you know any lein plugins using travis-ci to test? I'd like to automate the integration tests on my plugin, which is a reporting-based plugin

10:35 ohpauleez: not off the top of my head, but is should be no different than using travis on a standard project

10:37 xeqi: testing lein plugins has come up in #leiningen a couple times, I don't know that there is a good way

10:37 dgrnbrg: I put my plugin into the :plugins vector in the project.clj of the lein2 project, but lein2 says it's not a plugin--I also did lein2 deps to no avail.

10:37 I also tried adding it to .lein/profiles.clj, but it still didn't pick it up

10:38 ah, i found it--sorry

10:39 is there any good way to require leiningen.core and leiningen.core.main?

10:41 xeqi: I've seen stuff like https://github.com/technomancy/swank-clojure/blob/master/lein-swank/src/leiningen/swank.clj#L48 most often

10:41 I imagine it would work similiarly for those ns

10:42 dgrnbrg: xeqi: that's what i'm trying to do, but there's so many code paths that differ lol :/

10:42 xeqi: 1->2 is a pretty big rewrite of some parts

10:43 dgrnbrg: is there a way to do a conditional (binding […])?

10:43 because in lein1 i need to rebind the var, but lein2 i need to never mention it

10:44 mthvedt: dgrnbrg: will lein2 break if you bind the var?

10:44 dgrnbrg: can you bind a var that doesn't exist?

10:45 xeqi: &(binding [x "asdf"] x)

10:45 lazybot: java.lang.SecurityException: You tripped the alarm! pop-thread-bindings is bad!

10:45 xeqi: ,(binding [x "asdf"] x)

10:45 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve var: x in this context, compiling:(NO_SOURCE_PATH:0)>

10:45 mthvedt: i guess you can't

10:45 xeqi: re: conditional binding, not that I know of built in

10:45 mthvedt: you can write a macro that conditionally expands at compile time

10:48 ,(macroexpand '(binding [foo "bar"] true))

10:48 clojurebot: (let* [] (clojure.core/push-thread-bindings (clojure.core/hash-map (var foo) "bar")) (try true (finally (clojure.core/pop-thread-bindings))))

10:48 mthvedt: yeah, i think you need your own macro

11:02 dgrnbrg: In lein1, I could hook eval-in-project and wrap the form in a (do…) to add some code that ran after the form. This technique doesn't appear to be working when I use lein2 and the test task, even though i've bound exit-after-tests to false

11:15 cshell: has anyone been able to get lein on windows work in the git bash shell?

11:16 zomg: Anyone happen to know how to make vim use Clojure syntax etc. in .cljs files?

11:16 It works for me .clj so I'm assuming I just need to tell it that a .cljs file is a .clj file but not entirely sure how to do that

11:17 dgrnbrg: zomg: have you poked around in .vim/plugins/vimclojure/ftdetect?

11:17 zomg: I don't have that plugin to begin with it seems :)

11:18 Unless it's somewhere in the global vim files of the distro, which I wouldn't know of...

11:19 Oh wait I'm silly. I don't have that on this box but I had it on the other box where I was working earlier...

11:19 Derp.

11:22 dgrnbrg: yep installing that and adding the cljs thing to the ftdetect script did the trick. Thanks

11:23 dgrnbrg: zomg: awesome! vim is tricky to figure out--i just hack and hack and pray

11:23 but it usually works ok

11:24 zomg: Yeah thankfully someone else usually has done most of the work with the syntax and indent scripts :D

11:28 tomoj: is ^:private a noop in cljs?

11:35 twhume: Is there a simple way to search a sequence to see if it contains another sequence?

11:36 raek: twhume: Midje (a testing framework) can do that

11:36 at least for writing test cases

11:36 twhume: hmm, there isn't a nifty function kicking about in the core then...

11:37 raek: there is a diff function in some newer namespace, I think

11:38 twhume: if you just want to make sure that all elements of A are in B, without taking the order into account you can just use sets

11:38 twhume: I'm interested in ordering too :(

11:44 borkdude: Roulette anyone? http://roulette-clojure.herokuapp.com/

11:45 cshell: twhume: the subseq command doesn't help you?

11:45 er, function

11:46 twhume: Hmm, that looks like it'd be good for pulling a range out of a sorted collection; mine isn't sorted tho, and I'm after a match against a sequence of values, not a range...

13:01 rvgate: Using a map, how would i concate a string and a value together? so something like: {:id "value"+number}

13:01 result in: {:id "value1"}

13:02 AimHere: &(str "value" 69)

13:02 lazybot: ⇒ "value69"

13:03 dreish: You mean {:id (str "value" number)}?

13:04 rlb: rvgate: or (not pretty) something like this:

13:04 (into {} (map (fn [[k v]] [k (str v "1")]) {:id "value"})

13:05 mpd has an idle command which causes mpd to report status events on the socket until/unless you issue a noidle. Any thoughts about how that should be represented in a clojure client lib?

13:06 rvgate: AimHere, rlb, dreish, thx all, i used dreish's method for simplicity/readability :)

13:10 rlb: And for something like (status mpd) -> {:volume 60 ...}, what would you prefer to have happen when the underlying socket unexpectedly closes?

13:48 twopoint718: &(.getWidth (javax.swing.JFrame.))

13:48 lazybot: java.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it.

13:48 twopoint718: Okay, hah, these are bad examples to post :)

13:49 I was curious why I can do the above (it works)

13:49 But then ((juxt (memfn .getWidth) (memfn .getHeight)) (JFrame.)) doesn't

13:49 xeqi: lazybot doesn't use xvfb-run?

13:50 hyPiRion: I don't see any reason to have a virtual framebuffer here.

13:50 twopoint718: what part fails?

13:51 twopoint718: The juxt expression gives: No matching method found: .getWidth for class javax.swing.JFrame

13:51 metellus: twopoint718: guessing based on the examples from http://clojuredocs.org/clojure_core/clojure.core/memfn, I'd say try removing the .s

13:52 mittchel: is anyone familiar with seesaw?

13:52 hyPiRion: twopoint718: It's the memfn that produces the error.

13:52 twopoint718: mittchel: oops, yeah it was the periods, I had moved the code around. Good catch.

13:54 mittchel: I'm sorry did you really mean to mention me in that sentence? haha

13:54 metellus: his tab-complete aim seems to be a little off

13:55 rlb: is it OK to create more than one line-seq on an underlying reader/socket (over time)? i.e. if you want to use a line-seq to pull X lines off of a socket, then later use another line-seq to pull the next Y lines?

13:56 twopoint718: mittchel: nope. It is one of those typo-laden days I guess.

13:56 hyPiRion: thanks!

14:03 frozenlo`: Is there any way to get only a list of keys from congomongo? I could do (keys my-db), but this would require congo to send the entire database to clojure... not the most efficient way to do it I hope.

14:36 pepijndevos: Why is dot commented out? https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L2665

14:40 adu: pepijndevos: maybe because it never gets munged

14:40 see L3293

14:42 pepijndevos: adu, hmpf, - -> _ is still in there though

14:43 adu: well, maybe it should be commented too

14:43 I've only been looking at the source for about 30 seconds, so I'm not an expert

14:43 pepijndevos: :)

14:44 cshell: On a POST request, does Noir put the body into :params or is it in :body?

14:48 xeqi: cshell: I would expect :body

14:48 adu: I thought it was :content

14:48 cshell: xeqi: thanks, I think that's correct - I think the other api I"m using hasn't been updated

14:52 xeqi: cshell: theres also ring-json-params which is a middleware that sticks them into :parmas

14:53 * adu <3 noir

14:54 Raynes: <3

14:55 adu: I'm currently making a site in webnoir

14:56 Sqeo: I want to make a stupid little site in webnoir

14:56 Seriously very little

14:56 I could type it in one line of code, but I'd need to figure out Heroku

15:02 (defpage "/:code" {:keys [code]} {:status code})

15:02 That's all I want to do >.>

15:03 ghengis: so i've made this tool to graph calls between vars in a namespace, but i can't get it to work for multimethods

15:03 there doesn't seem to be any line number metadata

15:04 but obviously the stacktraces know, so I'm puzzled

15:07 it needs to be able to locate and parse the code for multimethods

15:10 technomancy: Sqeo: there's a good site for that but I forget the name

15:11 something with a name that was cute but unfortunately not memorable enough

15:12 Sqeo: technomancy, for doing what? Seeing arbitrary HTTP status codes?

15:12 technomancy: yeah, for constructing arbitrary responses and even failure conditions

15:12 you can request a response that has a long delay for testing timeouts or even something that gets cut off halfway through IIRC

15:12 not much help if I don't remember the name though

15:12 Sqeo: Hmm, that sounds actually useful

15:13 I just wanted to see the error messages that browsers would display for weird things like 402

15:13 Is IE the only browser that has its own error messages for HTTP status codes?

15:13 technomancy: the browser generally just displays the response body

15:14 Sqeo: technomancy, I think in some circumstances IE doesn't?

15:14 technomancy: maybe IE does something goofy; wouldn't be at all surprising

15:15 Sqeo: "Internet Explorer, however, will not display custom pages unless they are larger than 512 bytes, opting instead to display a "friendly" error page."

15:15 http://en.wikipedia.org/wiki/HTTP_404

15:17 technomancy: huh; I guess that's not a bad heuristic.

15:31 nodename: I wonder if anyone can help with this (onCygwin): $ lein2 help Leiningen is a tool for working with Clojure projects.

15:31 Several tasks are available: ... leiningen.eclipse Problem loading: Could not locate clojure/contrib/duck_streams__init.class or clojure/contrib/duck_streams.clj on classpath:

15:32 Do I even need leiningen-eclipse? I'm using cemerick's lein and ccw workflow as in the Starting Clojure video

15:32 technomancy: nodename: looks like you're using a plugin that's out of date

15:33 nodename: technomancy: how to find out more?

15:33 technomancy: search for documentation on the plugin I guess?

15:34 nodename: on leiningen.eclipse, I guess...

15:34 technomancy: if the CCW docs don't mention it you should probably ditch it

15:37 nodename: ok next dumb q: how to lein2 uninstall lein-eclipse?

15:38 technomancy: just remove it from your profiles.clj or project.clj

15:39 Sqeo: Can I issue leiningen commands from the REPL?

15:40 nodename: excellent, thanks technomancy!

15:40 technomancy: Sqeo: not yet; that's supposedly coming as part of jark

15:40 well, not from the repl, but from an interactive session

15:41 Sgeo: Does this have anything to do with Clojure being on JVM?

15:41 nodename: moving on: does lein-marginalia work with lein2?

15:41 technomancy: nodename: yeah

15:41 Sgeo: no, it has to do with project isolation, which is a good idea on any platform

15:45 cemerick: nodename: if you mean lein-eclipse, yes, it's redundant at this point

15:45 Sgeo: Hmm, apparently, I wrote code a year or so back illustrating what I thought was a flaw with Clojure concurrency

15:45 Or something

15:46 nodename: I put lein-marginalia "0.7.1" in my :profiles {:dev {:dependencies just like ring/ring-jetty-adapter is in https://github.com/technomancy/ringMon/blob/master/project.clj, and do lein2 deps, but then I get marg is not a task

15:46 technomancy: it should go in :plugins

15:46 nodename: ?? is not plugins deprecated?

15:47 technomancy: no, :dev-dependencies is deprecated

15:47 amalloy: would technomancy tell you to do something deprecated??

15:47 lazybot: amalloy: What are you, crazy? Of course not!

15:47 nodename: btw lein2 usage of marg is not in the README.md

15:47 Sgeo: Although..... I think it's more of a demonstration of it being easy to use the wrong reference type

15:48 And/or an objection to instantaneous @

15:48 hold on

15:49 nodename: in ringmon/project.clj, for lein2 it became :profiles {:dev {: dependencies... for ring-jetty-adapter. But lein-marginalia is different?

15:51 Sgeo: Is there any channel-preferred pastebin?

15:53 amalloy: gist or refheap

15:54 Raynes: amalloy: The fact that you included gist means we aren't friends ow.

15:54 now*

15:54 nodename: right, putting lein-marginalia in :plugins worked, thanks. So :dev-dependencies apparently has split into more than one thing in lein 2.0

15:54 Sgeo: https://www.refheap.com/paste/4fd4fa18e4b0232cc152e706

15:54 Raynes: And ow, too, cause it hurts.

15:55 Sgeo: Yeah, I guess Clojure can't prevent people from being stupid

15:58 borkdude: Raynes maybe it is time to make lazybot react on the word gist? just an idea ;)

16:05 Bronsa: Sgeo: i think you should have used `(constantly {:balance result})` instead of `#(%2) {:balance result}

16:05 `

16:05 without the \n.

16:06 Sgeo: Bronsa, hmm, makes sense

16:06 Bronsa: thath's why the agent fails

16:06 because you are calling an array as a function with no args

16:06 ,({:a 1})

16:06 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: PersistentArrayMap>

16:10 borkdude: today I saw someone write this: &&(#(do {:a % :b %2}) 1 2)

16:10 Bronsa: lol

16:11 borkdude: I mean ##(#(do {:a % :b %2}) 1 2)

16:11 lazybot: ⇒ {:a 1, :b 2}

16:11 borkdude: then I wondered, why aren't #(..) functions not having an implicit do, it would enable them to just return a direct datastructure

16:12 like so: #([1 2 3])

16:13 Bronsa: then you'd have to #((..)) in every case where you dont want to return a datastructure

16:13 borkdude: would it break existing #() functionality if this was added?

16:13 amalloy: borkdude: because of #(f %)

16:13 you don't want that to be #(do f %)

16:13 and if you decide it should instead be #(do (f %)), the implicit do has no effect

16:13 borkdude: amalloy hmm yes...

16:14 I like writing (fn …) better anyway\

16:17 Raynes: borkdude: That'd be evil.

16:21 technomancy: nodename: :dev-dependencies was two things in lein 1.x; that's why it caused so much trouble

16:21 some code runs in the project at dev time, and some runs in leiningen

16:31 cshell: Does anyone know how to get the raw post body in noir? I'm trying to work with the Google Identity Toolkit but I have nothing in the :body of the post request I'm receiving

16:33 Raynes: cshell: Where are you looking for it?

16:33 technomancy: in compojure it should be (POST "/whatever" {:as {:keys [body]}} ...)

16:33 Raynes: Yeah, this isn't compojure.

16:34 That wont work.

16:34 cshell: Raynes: I'm looking in the body - it looks like noir is putting everything into :params

16:34 Raynes: cshell: Where are you getting the body.

16:34 s/\./\?/

16:35 cshell: I've put middleware in that pulls it off the :body from the Rink request map

16:35 but that's an empty inputstream

16:35 somewhere in the adapter, before it gets to my middleware, it has put the information i need into :params

16:35 Roxxi: Hey guys, if I have a third party jar that I need to include in my leiningen project, how do I add it to my classpath?

16:36 technomancy: I thought noir was built on compojure; it doesn't re-use compojure's destructuring?

16:36 cshell: Roxxi: Is it in a maven repo?

16:36 Roxxi: No, it's not.

16:36 Raynes: cshell: https://github.com/ibdknox/noir/blob/master/src/noir/request.clj It should be in the :body key in this map. I'm not sure why your middlware isn't seeing it.

16:36 technomancy: Roxxi: if it's for a toy project, you can use lein-localrepo; otherwise you need to get it into a repo

16:36 Raynes: Your best bet is to get it in one. You can push it to clojars if it is open source.

16:36 technomancy: clojurebot: repeatability?

16:36 clojurebot: repeatability is crucial for builds, see https://github.com/technomancy/leiningen/wiki/Repeatability

16:36 Roxxi: Ok, I'll look at that, thanks.

16:37 cshell: Roxxi: Cloudbees gives you a private repo if you need one

16:37 for free

16:37 Thanks guys, I'll keep looking - once I figure out how to do it raw, I will ahve to do it with friend :)

16:37 Roxxi: cshell: Is it easy to add another maven repo if I go that route?

16:37 Raynes: cshell: https://groups.google.com/forum/?fromgroups#!topic/clj-noir/DAjtOKevN54 Example

16:38 borkdude: technomancy would it be a good idea to make a special option for jars you want to include manually, instead of using lein localrepo

16:38 or would it be a horrible idea

16:38 technomancy: borkdude: since that approach is only appropriate for toy projects I think not

16:39 cshell: Raynes: Thanks, when I do the slurp on it, there's nothing in the :body - somewhere it's creating the :params though

16:39 * seancorfield waits for technomancy to say it would be a horrible idea :)

16:39 technomancy: borkdude: it would either encourage people to check jar files into git or encourage works-on-my-machine builds

16:39 seancorfield: and he said it before i could even type that!

16:39 Raynes: cshell: That's strange. Perhaps post about it on the mailing list if you don't figure it out.

16:39 cshell: Roxxi: It should be easy to add another repo, I haven't done so but I imagine it's just a key in the project.clj - technomancy can help

16:39 Raynes: will do, thanks!

16:40 borkdude: technomancy so if I want to write a how to install this project which uses the (horrible) oracle jdbc drive that isn't in maven, what is the way to do it?

16:40 install = get running

16:40 technomancy: borkdude: probably best to use s3-wagon-private

16:41 once you create a private bucket you can push things out with `lein deploy s3`

16:41 borkdude: technomancy but everyone who wants to build/run my project would have to do that?

16:41 technomancy: is it a private or public project?

16:42 borkdude: technomancy public

16:42 technomancy it's a project which supports a variety of databases including oracle

16:43 technomancy: hm; if the license prohibits distributing it you would probably have to use lein-localrepo

16:44 borkdude: ok

16:45 it's this (student) project btw https://github.com/SuperfastJellyfishh/timesheet

16:46 technomancy: I think there's simply no good way to do public projects that depend on non-free code.

16:47 someone was trying to make things work smoothly with JavaFX and it was just a mess.

16:48 borkdude: technomancy any info on heroky and leiningen2? it still assumes 1.7 now I think?

16:49 I hope in a year everyone has migrated (their example code) to leiningen2, the absence of info on what version is used caused a lot of confusion with my students

16:49 technomancy: borkdude: you can make it work with a custom buildpack. there's still a bug if you need access to plugins at runtime; once that's fixed I'll make a wider announcement.

16:49 absence of info? hm; I thought it was pretty clear?

16:49 borkdude: technomancy custom buildpack?

16:50 technomancy on heroku it says 1.7 yes, but on a lot of blogs people write it was just written in a time when there was only version 1

16:50 technomancy: https://github.com/heroku/heroku-buildpack-clojure/tree/lein-2 <- you can set BUILDPACK_URL to use a newer version

16:50 borkdude: technomancy whle my students work with the eclipse plugin which generates version 2 projects (which are compatible mostly with 1 though)

16:50 technomancy: yeah, blogs are always going to be an issue

16:51 borkdude: technomancy the plugin install thing

16:52 technomancy: the plugin task actually tells you what's going on now

16:52 points you to the upgrade guide

16:52 borkdude: technomancy ah this is what is used on heroku to build projects?

16:52 technomancy yes, that's very good!

16:52 technomancy: borkdude: yeah, it's the adapter between a language runtime and the platform

16:53 borkdude: technomancy I noticed I don't need to do anything than set the :main now in project.clj

16:53 technomancy push to heroku and it works

16:53 technomancy (noir)

16:53 technomancy: borkdude: yeah, the Procfile is technically no longer necessary for single-process-type apps

16:54 borkdude: technomancy how does it work actually, it says run server on port 8080, it gets ignored?

16:55 technomancy: if you don't have a procfile it just runs `lein trampoline run`

16:55 it's up to -main to check (System/getenv "PORT")

16:55 borkdude: technomancy ah of course

16:56 technomancy I never used that env variable, that's why I didn't think of it

17:00 cshell: Raynes: The way to get back to it is to do (hiccup.page-helpers/encode-params (:params req)) - that gets it back in the form it came in

17:00 Raynes: Found an implementation here: http://bit.ly/LgNvqh

17:08 eighty: so what's the idiomatic way to fill a vector in clojure? vectors are immutable, so guessing i need the assoc function?

17:08 basically i'm iterating over entries in a zipfile via java interop, and on each loop i want to add the filename to a vector.

17:10 cshell: conj adds to a vector

17:12 Sgeo: Are there any idiomatic Clojure IRC libraries, both because I want to write IRC bots and because I want to know the idiomatic way to do stuff that, say, C# does with events

17:13 Like, in idiomatic Clojure, would it make sense to have mouse position be an agent, and somehow either subscribe to the agent or retrieve the current value, depending?

17:17 Hmm, hold on

17:17 There's no way to, from another thread, just block until an agent changes?

17:18 Raynes: alex_baranosky: Does lein-midje work with lein 2?

17:18 cmajor7: "jayq.core.document_ready is undefined" JS error. The clojurescript statement (via jayq) is "(document-ready (.-tooltip ($ "[rel=tooltip]")))"

17:19 what/why can it be?

17:19 later if I run "jayq.core.document_ready…" from a browser console there is no error

17:20 amalloy: &(doc add-watch) ;; Sgeo

17:20 lazybot: ⇒ "([reference key fn]); Alpha - subject to change. Adds a watch function to an agent/atom/var/ref reference. The watch fn must be a fn of 4 args: a key, the reference, its old-state, its new-state. Whenever the reference's state might have been changed, any regis... https://www.refheap.com/paste/3083

17:20 Sgeo: amalloy, but suppose I want the convenience of just blocking waiting for it to change

17:21 amalloy: well, there are two answers to this

17:21 one is that that's not what agents do

17:21 the other is that i have a function that lets you do this for any reference type: https://github.com/flatland/useful/blob/develop/src/useful/state.clj#L51

17:22 hm, no documentation

17:22 i guess this isn't quite what you want anyway. it assumes you are waiting for something in particular to happen, not for "any change"

17:23 technomancy: I'm creating a "deprecated" section of the plugins wiki

17:23 for Leiningen

17:24 there's a bunch of stuff for vimclojure; is it fair to say lein-tarsier is the way forward on that and the others are deprecated?

17:24 Raynes: alex_baranosky: I don't think it does, though the readme seems to think it does.

17:24 alex_baranosky: Also, if it did actually work, that README would be wildly incorrect anyways. You don't `lein plugin install` plugins in lein 2, you put then in :plugins, and there is no :dev-dependencies in lein 2 either.

17:25 technomancy: seancorfield: is the fw1 plugin deprecated now with lein-newnew?

17:28 ndimiduk: is the lein-hadoop plugin still necessary?

17:28 ndimiduk: it's better than uberjar

17:28 and it's too slow

17:28 at least for us

17:29 we build hadoop jars out of ant because the jar command is much faster than iterating through the deps in lein

17:29 but it's still handy for small projects.

17:29 technomancy: huh; ok. I'll leave it out of the deprecated section ten.

17:29 then

17:30 ndimiduk: i needs some love; i haven't moved my world to 2.0 yet

17:30 technomancy: so uberjar is a lot slower than ant's version even without the GC bug?

17:30 ndimiduk: hmm

17:30 uberjar is not preferred because you get file collisions

17:30 log4j.properties, for instance

17:31 technomancy: I think collisions no longer cause failures; they just cause files to get dropped

17:31 ndimiduk: lein-hadoop was slow; i've not used it on a big project with 1.7.1

17:31 technomancy: (I believe 1.7 works this way; know that 2.x does)

17:31 ndimiduk: yes, which is a problem

17:32 technomancy: you'd need the ability to say later versions win?

17:32 Mad_Master: hi, does anyone have experience with seesaw who can help me ?

17:32 ndimiduk: and i haven't looked at MRv2 yet. it's handling of the bundled lib directory may be entirely different

17:36 rlb: If I want to serialize output from multiple threads to a socket, would it be reasonable to just use java bits, or is there a better clojure idiom?

17:42 Sgeo: http://www.slideshare.net/pcalcado/lisp-macros-in-20-minutes-featuring-clojure-presentation

17:42 Is it just me or is the code on slide 20 wrongly indented?

17:43 amalloy: yes, it is. i assume it's hard to fit stuff on a slide

17:44 it's also three years old. like, struct-maps? anything you learn reading that will have to be taken with a grain of salt

17:47 Sgeo: In Clojure, how acceptable/unacceptable is it to have a seq that gets data from the environment, and waits

17:47 For example, a seq that essentially contains all lines said in this channel

17:48 I know Haskell has issues with lazy I/O, but is that more acceptable in Clojure?

17:48 rlb: Sgeo: you mean like (line-seq (reader socket))?

17:48 technomancy: it's fine as long as it doesn't interact with dynamic binding

17:51 kmicu: where I can find change log for 0.0-790, 0.0-1376 org.clojure/google-closure-library?

17:57 holo: hi

17:58 when running lein trampoline run -m sample.views.welcome i get: Exception in thread "main" java.lang.RuntimeException: java.lang.ClassNotFoundException: sample.views.welcome

17:58 "lein run" poses no problem though

17:59 i already cleaned classes/* and lib/* and then did lein clean; lein deps; lein run

18:03 technomancy: holo: can you provide a repro case?

18:12 holo: technomancy, i feel ashamed that i make you lose time with such a simple question. i don't know yet how to make it reproducable without copying the entire sample into the web. for starters, i'm trying to "Declare process types with Foreman/Procfile" as indicated on https://devcenter.heroku.com/articles/clojure. is it mandatory that i do this?

18:14 rvgate: holo, i just happen to have pushed a clojure project to heroku today... you can skip that step

18:16 holo: rvgate, that's great! i have to confess i was clueless about the utility of the step, but i was trying to follow every step. thanks!

18:16 technomancy: holo: `lein run` in Procfile is enough

18:16 rvgate: holo, so did i... haha, but a classmate noted that it wasnt needed

18:16 technomancy: if you have :main specified

18:17 holo: technomancy i have :main specified

18:18 technomancy: should be set then

18:19 holo: technomancy, i have :main sample.server

18:21 oops :) lein trampoline run -m sample.server works as it would be expected

18:22 rvgate, i wonder if you were also running the wrong namespace

18:22 technomancy, thanks!

18:22 rvgate: holo, not really... created a basic leiningen project

18:26 holo: rvgate, about its utility, i found it here moments ago https://devcenter.heroku.com/articles/procfile

18:56 gfredericks: somehow I cannot figure out how to require and instantiate a goog class in cljs

18:56 specifically goog.ui.Slider

18:56 Mad_Master: can anyone help me with seesaw ?

18:57 gfredericks: certainly (:require [goog.ui.Slider :as Slider]) (new Slider) doesn't work

18:57 but neither does (:require [goog.ui :as ui]) (new ui/Slider)

18:57 as the require fails at runtime

18:58 dnolen: gfredericks: (:require [goog.ui.Slider :as Slider]) (goog.ui.Slider.)

18:58 gfredericks: did you try ^

18:58 er

18:58 gfredericks: dnolen: nope; bout to now

18:58 dnolen: (:require [goog.ui.Slider]) (goog.ui.Slider.)

18:58 gfredericks: goog type ctors are not namespaces.

18:58 gfredericks: so what you originally did won't work.

18:59 gfredericks: GClosure structure in generally doesn't really map all that well to namespaces. There's an existing ticket about this.

18:59 gfredericks: dnolen: the :as is required

18:59 dnolen: but otherwise it worked perfectly, thanks

19:00 dnolen: gfredericks: ah right, there's a ticket about that too.

19:00 gfredericks: :)

19:04 is there an html5-graphics way to create geometric shapes and update them without redrawing the whole picture? I know raphael.js presented this abstraction, but I don't know if that was the case at the lower level too. I'm using monet and am not sure how to animate something without just redrawing everything each time.

19:04 * dnolen is finally putting time into cKanren

19:05 dnolen: gfredericks: SVG, which is slow if you have many shapes.

19:05 gfredericks: okay, so "SVG" and "canvas" are disjoint things?

19:05 dnolen: gfredericks: not related at all.

19:06 gfredericks: so most or all html5 graphics libs pertain to one or the other?

19:06 dnolen: gfredericks: SVG is a DOM oriented graphics abstraction - canvas is just procedural drawing surface.

19:06 gfredericks: that explains why I couldn't see my circles in the dom tree :)

19:07 ambivalent: hey how to start learning clojure, i set the enviroment in eclipse and im quite proficient in java

19:07 gfredericks: ambivalent: lotta folk like 4clojure.com

19:08 ambivalent: thnx i saw a book - the joy of clojure but too many pages :)

19:10 AimHere: The Joy of Clojure isn't a very big book

19:11 gfredericks: but it has too many pages

19:11 AimHere: Only about 340 or so

19:11 holo: ambivalent, there is "clojure for beginners" with 67 pages, if the criterion is number of pages haha

19:12 AimHere: For comparison, K&R is 270 pages, and that's about as concise as language books get

19:16 * Sgeo is vaguely amused by map map?

19:18 holo: i can't get any way of getting "foreman start" to start the application, it says there is no procfile. i just followed every step in https://devcenter.heroku.com/articles/clojure

19:18 lpvb: ambivalent: http://java.ociweb.com/mark/clojure/article.html

19:19 holo: i was ignored in #heroku about this :o) so i'm trying my luck here

19:19 lpvb: oh he quit

19:19 gfredericks: ,(let [map! [{} #{} [] {[] #{}}]] (map map? map!))

19:19 clojurebot: (true false false true)

19:19 AimHere: Sgeo, if this was a lisp-2, (map map? map) might have been viable

19:20 Sgeo: AimHere, heh

19:25 zakwilson: http://pastebin.com/bawmbjkV <-- Clojure tries to resist most of the badness that can happen in multithreaded code, but I wrote a deadlock anyway!

19:26 Sgeo: You know what would be interesting? (Not for actual programmign tasks)

19:26 A language that prevented you from shooting yourself in the foot

19:27 zakwilson: Great idea. First, solve the halting problem.

19:27 Sgeo: Although, in seriousness, it would be cool if a statically typed language had support for statically ensuring no deadlocks.

19:27 ...and I don't mean the trivial way of doing that

19:27 gfredericks: if a language is turing complete then shooting yourself in the foot is a valid program

19:28 Sgeo: zakwilson, ok: My language has no looping constructs. All programs halt.

19:28 There, I solved the halting problem ;)

19:28 zakwilson: Then your language isn't Turing complete.

19:28 Sgeo: Did I specify TCness?

19:29 metellus: if they all halt then there can't be any deadlocks, right?

19:29 zakwilson: No, but it's implied when you talk about a programming language.

19:29 TimMc: Sgeo: Does your language have TCO, by the way?

19:29 (#(% %) #(% %)) is non-halting with TCO.

19:30 Jayunit100: how to add several keys to a map with default values = 0 ?

19:31 dnolen: ,(into {} (map vector [:a :b :c] (repeat 0)))

19:31 clojurebot: {:a 0, :b 0, :c 0}

19:31 gfredericks: ,(reduce (fn [m k] (update-in m [k] #(or % 0))) {:a 2 :b 12} [:a :b :c :d])

19:31 clojurebot: {:d 0, :c 0, :a 2, :b 12}

19:31 gfredericks: Jayunit100: that or dnolen's depending on what you meant exactly

19:32 Jayunit100: thank you mister nolen

19:33 dnolen: ? Is there a web service that would compile clojure script for me, directly, so that I don't have to use the lein builder?

19:33 ah yes i will have to try and see

19:35 dnolen: Jayunit100: Himera does that. Though I don't know why you wouldn't just use lein-cljsbuild

19:37 Jayunit100: Well…. want to try deploying a simple clojurescript just for fun on a sandbox site

19:48 gtrak: gfredericks: https://gist.github.com/2907736

19:49 it's making its way into a blogpost atm

19:53 gfredericks: would it work to write a (defmacro-macro) in clj as a cljs macro and have it simply eval its contents in clj such that you could write clj-for-cljs macros in your cljs file? And would this be evil?

19:53 * gfredericks is not seriously considering doing it

19:55 dnolen: gfredericks: doesn't sound evil to me.

19:55 gtrak: It still has to be in a different ns, though, right? you don't want circular deps

19:55 even if you type it inline...

19:56 gfredericks: gtrak: you talking about what I just said?

19:56 gtrak: yea

19:56 gfredericks: so you have foo.cljs and foo_macros.clj

19:56 in foo_macros you put (defmacro clj-eval [form] (eval form) nil)

19:57 then in foo you can (clj-eval (defmacro some-macro [] ...)) (some-macro ...)

19:57 gtrak: right

19:57 gfredericks: I don't know what your question means then.

19:58 gtrak: you can't do in foo: (defn a [] ..) foo_macro: (defmacro b [& body] (a b)), though

19:58 so if you had a defmacro-macro, and did both of those in foo, it wouldn't work, ya?

19:59 gfredericks: you can do in foo_macro: (defmacro b [& body] `(foo/a b))

19:59 or whatever

19:59 I think whenever you have clj-for-cljs macros that emit varish names you have to fully qualify them

19:59 or maybe there is some other cljs mechanism for expanding the symbols correctly

20:00 gtrak: ah, you can spit out code that references the var, but you can't call it, that's not so bad I guess

20:01 you could just as well have a defn-clj macro

20:01 gfredericks: you certainly can't call it because one's in cljs whereas you are running clojure at compile time

20:01 what would you do with a clj function?

20:02 gtrak: call it from a macro?

20:02 gfredericks: yeah I guess that could be useful

20:02 hmmmmmmm

20:03 what does `foo resolve to in a cljs file?

20:03 and by resolve I mean...read as

20:03 er

20:03 hiredman: ` is expanded by the reader

20:03 gfredericks: you know what I mean

20:03 hiredman: yeah I'm just curious what ns would end up there

20:03 splunk: anybody have any references on creating network services with clojure? what would the event look like?

20:04 event loop look like?

20:04 Chousuke: gfredericks: see what '`foo becomes

20:05 gfredericks: huh; it's user/foo

20:05 oh man I'm imagining all kinds of evil

20:30 hiredman: anyone know how you do a sql WHERE foo IN (...) with clojure.java.jdbc where … in via a prepared statement

20:37 mittchel: Anyone familiar with seesaw?

20:37 brehaut: ~anyone

20:37 clojurebot: Just a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."

20:37 Mad_Master: lawl

20:37 gfredericks: ~noone

20:37 clojurebot: It's greek to me.

20:38 amalloy: hiredman: i think you have to have a fixed number of args and use ? with do-prepared, or else build your statement from a string once you know how many ?s to put in

20:39 hiredman: :/

20:39 amalloy: are there any sql engines that make that possible with unknown number of args? i've only used jdbc and php/mysql, but afaik none of them do it

20:42 Jayunit100: is there a way to return a map from "for"

20:42 by emitting [k v] pairs ?

20:43 gfredericks: ,(into {} (for [x (range 3)] [x (str x)]))

20:43 clojurebot: {0 "0", 1 "1", 2 "2"}

20:44 Jayunit100: oh no ! the into again :)

20:44 gfredericks: blast it all

20:48 amalloy: ,(into {} (map (juxt + str) (range 3))) ;; if every character costs you a drop of blood

20:48 clojurebot: {0 "0", 1 "1", 2 "2"}

20:49 gfredericks: ,{0"0"1"1"2"2"} ;; if every character costs you a drop of blood

20:49 clojurebot: {0 "0", 1 "1", 2 "2"}

20:49 gfredericks: is whitespace-and-comma-less clojure turing complete?

20:50 devn: How do you think about "Tell, Don't Ask." in Clojure?

20:52 mthvedt: lambda calculus is turing complete isn't it?

20:52 gfredericks: yes; can we do lamba calculus without whitespace?

20:52 or also lambda calculus

20:52 silly greeks

20:53 whoever decided "mbd" was a legal string of consonants

20:54 mthvedt: can you do anything in clojure without whitespace?

20:54 gfredericks: you can make maps from integers to strings apparently

20:54 mthvedt: ,(cons[1][2])

20:54 clojurebot: ([1] 2)

20:55 mthvedt: ,((fn[x]x)1)

20:55 clojurebot: 1

20:56 mthvedt: that's enough to do lambda calculus

20:56 gfredericks: oh hm

20:56 mthvedt: or at least some combinatorial equivalent version thereof

20:56 gfredericks: so instead of (fn[a](fn[b](a b))) we would do...

20:56 wait can we do that?

20:57 your (fn[x]x) isn't a very useful function

20:58 try making a function that calls another function

20:59 zakwilson: The identity function is often useful.

21:00 gfredericks: yes yes but in this case not sufficient

21:00 I doubt the lambda calculus with only identity functions is turing complete

21:00 Jayunit100: i guess clojure.contrib.string is gone

21:00 gfredericks: Jayunit100: clojure.string

21:01 nodename: Any thoughts on this problem: Errors running builder 'Leiningen Builder' on project 'clevolution-gui'.

21:01 clojurebot: leiningen tutorial is at http://github.com/technomancy/leiningen/blob/master/TUTORIAL.md

21:01 nodename: Unexpected exception while trying to update Leiningen Managed Dependencies for project clevolution-gui

21:01 ccw.util.eclipse$run_in_workspace cannot be cast to clojure.lang.IFn

21:01 Jayunit100: hmmmm so there is no more "substring" method ?

21:01 or is there a better / different lib for that

21:01 gfredericks: ,(doc subs)

21:01 clojurebot: "([s start] [s start end]); Returns the substring of s beginning at start inclusive, and ending at end (defaults to length of string), exclusive."

21:01 gfredericks: that's in clojure.core

21:02 Jayunit100: ahhh i mean ….

21:02 (thanks though) --

21:02 (substring? "a" "aaa")

21:02 gtrak: what's the best wordpress sourcecode=blah setting? clojure setting kinda sucks

21:02 brehaut: re:lambda calculus https://github.com/fogus/skiing

21:04 gfredericks: brehaut: well the K is doable, but don't think S or I

21:04 wait wait

21:05 (fn[a](fn[b](a b))) could be....

21:05 (fn[a](fn[b](((fn[]a))b)))

21:05 okay I think that does it

21:06 ,'(fn[a](fn[b](((fn[]a))b)))

21:06 clojurebot: (fn [a] (fn [b] (((fn [] a)) b)))

21:06 gfredericks: yep

21:37 amalloy: gfredericks: i think you can simulate spaces using ` and ~

21:38 but then i guess you need defmacro, which needs a space

21:42 cshell: Are dynamic-scoped vars in Clojure basically just thread-safe global vars?

21:43 thread-safe/thread-local

21:47 axle_512_: any emacs users could help me with paredit navigation? Trying to navigate my clojure code efficiently

21:48 amalloy: gotta be more specific, axle_512_

21:48 cshell: yes, but they also encourage using them in a "scoped" way - binding sets, does stuff, and then resets

21:49 axle_512_: I'm looking for commands that let me navigate by s-expression. I'm familiar with C-M-f and C-M-p … but that seems to only navigate top level s-expressions. I want to drill down the tree to descendants or back up to ancestors… or sideways to siblings. Is such a thing possibles?

21:50 and please forgive me for asking this emacs question in the clojure room :(

21:50 amalloy: well, sideways is C-M-f

21:51 you can use paredit-{forward,backward}-{up,down} for the rest, but i don't know the bindings for them

21:51 cshell: amalloy: thank you

21:51 :)

21:51 axle_512_: amalloy: yes, thanks!

21:52 amalloy: C-M-f and C-M-b are working for me to move sideways.

21:52 amalloy: I will experiment with the paredit-forward, backward, up, down.

22:12 johnmn3: can lein push a project to github?

22:17 gfredericks: johnmn3: git doesn't do that for you?

22:17 time to write a lein-git plugin that just shells out to git

22:18 johnmn3: gfredericks: yea, I just don't want to have to learn git.

22:19 gfredericks: ah right. No I think you'll have a hard time using github without learning git.

22:19 depending on what you're trying to do it might be pretty basic

22:20 e.g., github gives you instructions for pushing up a project

22:25 (def TAU (.-PI js/Math))

22:25 wait no

22:25 (def TAU (* 2 (.-PI js/Math)))

22:46 cshell: Man, Chapter 4 in Clojure Programming is the best chapter I've ever read on Clojure Concurrency - I am finally starting to understand them - so well written

22:53 Hodapp: cshell: I shall have to read this in detail.

22:53 adu: Hodapp: reading details is fun

22:54 Hodapp: it can also be boring as hell

22:54 gfredericks: boulderdash

22:58 roryk: How do I copy and paste over a form to the REPL from one window to another using swank-clojure in emacs? C-M-x compiles it and outputs it to *Messages* but I want it to get run in the REPL and display there.

23:08 jblomo: has anyone seen cljs compile inconsistency where some clojure.core functions get incorrectly compiled as non-existent functions in the current namespace?

23:20 gfredericks: jblomo: are you using lein-cljsbuild?

23:21 Sgeo: Lispcabinet comes with lein?

23:21 jblomo: no, using an in-process cljsc/build call

23:21 gfredericks:

23:21 gfredericks: k nm

23:22 jblomo: have you seen something similar?

23:24 hrm i think it might be the /build call. it seems to miss other changes to the scripts, too

23:28 adu: lein on me, when you're not strong, and I'll be your friend...

23:34 johnmn3: hahah

23:34 https://clojars.org/zljdb

23:35 I should really put it on github, but I don't feel like setting git up on this win7 box at the moment

23:39 Sgeo: Grah

23:39 clojars, I want to see source code or at least the API from the site

23:39 I guess I can't do that

23:39 jblomo: what's not best practice for converting a cljs lazy-seq to an array?

23:39 (-> ls vec .array)?

23:40 technomancy: Sgeo: source for clojars itself?

23:40 Sgeo: technomancy, source for a... jar, I guess, on clojars

23:40 Not clojars itself

23:40 Say, I want to get an understanding of how I'd use a particular thing

23:41 technomancy: Sgeo: most jars contain source inside them

23:41 Sgeo: That requires me downloading the jar

23:41 And opening them from there

23:41 And also, I don't even see a download link

23:41 johnmn3: which is why I should also put it on github

23:41 but that's for another time

23:43 Sgeo: http://clojars.org/repo/

23:44 http://clojars.org/repo/zljdb/zljdb/0.1.0-SNAPSHOT/zljdb-0.1.0-20120611.032241-1.jar

23:45 you're right though. There should be a download link on each jar's page

23:46 technomancy: more important would be to link to the source

23:46 next-gen clojars will require it

23:47 johnmn3: will next-gen clojars host the source?

23:47 technomancy: no

23:47 well, not apart from the jar file

Logging service provided by n01se.net