#clojure logs

2012-06-10

00:00Sgeo_getL aLens myMap -- comes out to 1
00:00Sgeo_No, I lied.
00:00Sgeo_getL aLens myMap -- Just 1
00:00Sgeo_getLn (mapLens "foo") myMap -- Nothing
00:01Sgeo_But that's more to do with the whole option type thing, which is cool, but Clojure is dynamically typed
00:01kovasbi guess the question is, what is one tried to achieve
00:01Sgeo_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
00:01kovasbdoes it have to do with nesting at all?
00:02Sgeo_kovasb, as you mentioned, you can compose lenses
00:02Sgeo_(aLens . bLens) for example
00:02Sgeo_getL (aLens . bLens) someMap would first get the value doing whatever bLens says to do, then whatever aLens says to do
00:03kovasbright
00:03frozenlockWow! 300ms to sort 10 string? That can't be right... Am I misusing the sort function? (sort -my-string-list)
00:03kovasbthere is certainly value in having these things be composable first-class entities
00:04kovasbthis is a subproblem of something I'm working on
00:07kovasbfrozenlock: is it the same if you run it a few times?
00:07Sgeo_Does comp only work on IFns, or is it more general?
00:08kovasbIFn is the generalization of functions, so I imagine thats where it stops
00:09kovasbwhat else could it work on?
00:09Sgeo_First thing that comes to mind is arrows
00:09Sgeo_But I'm sure there are simpler examples
00:09Sgeo_rotations.
00:09kovasbi don't know what an arrow is :)
00:10Sgeo_If you have a structure that represents a rotation, it would be nice to be able to compose them
00:10kovasbtotally
00:10frozenlockkovasb: As a mean, yes... but I've even got 1 full second
00:11kovasbfrozenlock: you are not low on memory or something?
00:11kovasbfrozenlock: this is with a fresh repl?
00:11frozenlockno and no
00:11kovasbsuggest trying with a fresh repl
00:12kovasb"is it repeatable"
00:12Sgeo_Arrows are sort of generalized functions... but I'm a bit iffy and confused on the subject myself
00:12Sgeo_And they're not needed to find examples of useful "Categories"
00:12Sgeo_Haskell term for something that implements id and (.)
00:13Sgeo_It comes from category theory, presumably, but I don't know category theory
00:13kovasbSgeo_: probably best to define a separate composition function in its own namespace
00:13kovasbunless you want your rotation thing to itself be a function
00:14Sgeo_Well, more that I want composition to be properly general
00:15kovasbthat would be pretty confusing
00:16kovasbright now, if you see (comp f1 f2 f3) that means you can take f1 and use it as a function directly
00:16johnmn3arg, how do you slurp from an input-stream?
00:16kovasblikewise with map, filter etc
00:16frozenlockOh I found the problem! Another function timed as 0.3 ms, but it's a lazy one. When I doall it, I obtain 300ms.
00:17Sgeo_......oh right
00:17kovasbyou could have something similar to comp as a protocol
00:17Sgeo_map is insufficiently general too
00:17kovasbhaha
00:18kovasbsounds like a theme ;)
00:18Sgeo_I _think_ filter's good.
00:19Sgeo_Haskell's map and . are also insufficiently general. fmap is the more general verson, and a good . is in Control.Category
00:19Sgeo_The Maybe type is a functor, but that's meaningless to you
00:20Sgeo_IO
00:20kovasbi mean, given the existing data structures it makes sense
00:20Sgeo_Wait, I'm entirely wrong
00:20kovasbif there are other more interesting data structures to operate on, should be possible to make it work
00:20Sgeo_It's the second argument that it's general on
00:21Sgeo_I assume Clojure's map is general on the second argument?
00:21kovasbit takes a seq
00:21Sgeo_Bah, do seqs need to implement more than just map?
00:21Sgeo_(If so: Not general enough! AHAHHAHHA *goes insane*)
00:22kovasbsees just return a list of values
00:22kovasbseqs
00:22Sgeo_What if I want to map over something that isn't a list.
00:22Sgeo_?
00:23kovasbif it implements ISeq, you are good
00:23Sgeo_I just mentioned my stupidity in another channel, and someone (to tease me) does map with a number as the first argument
00:24Sgeo_<shachaf> > map 3 ["hi","Sgeo_"]
00:24Sgeo_<lambdabot> [3,3]
00:24Sgeo_What's the best way to gain information about how I'd go about implementing ISeq?
00:25kovasbthe interface is pretty minimal
00:25Sgeo_Anyway, I have an example of something that's not a list of values but which map is useful for
00:25xeqia tree?
00:26Sgeo_No
00:26kovasbfirst, rest, cons
00:26Sgeo_An... this is not a concept that makes much sense in Clojure, but I'll try
00:26kovasbi would look at the implementation for various datastructures
00:26kovasbpossibly in clojurescript
00:26aduwhen I first learned about clojure, I thought rest and next were the same function
00:26Sgeo_In Haskell, IO is dealt with by having "actions" so to speak (IO values)
00:26kovasb(the clojure ones are often in java)
00:27Sgeo_So, putStrLn "Hello" does not actually do anything, but it's a value that, when "performed" will do something
00:27Sgeo_getLine is an IO value. It, when performed, gives back a value
00:27Sgeo_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
00:28Sgeo_In Haskell, I can fmap the appending function like this:
00:28Sgeo_fmap (\line -> lines ++ "!") getLine
00:28aduSgeo_: I'm very familiar with Haskell
00:28Sgeo_And that will give me an action that, when performed, does what I want
00:28Sgeo_kovasb, does this look like a sequence?
00:28Sgeo_Yet, map is useful for it
00:28Sgeo_Although, I guess you could have first be side-effecting
00:29kovasbhonestly i can't tell
00:30aduSgeo_: I think you put an extra 's' on lines
00:30Sgeo_adu, you are correct, oops
00:30Sgeo_>.>
00:31kovasbgotta run
00:31Sgeo_Although normally I'd just do (++"!"), but I think the full lambda form is clearer
00:31Sgeo_Bye kovasb
00:31kovasblaters!
00:31Sgeo_(For someone who is inexperienced with Haskell, I mean)
00:31aduSgeo_: so what are you trying to do with clojure?
00:32Sgeo_adu, right this moment, not much
00:32Sgeo_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
00:33Sgeo_I tend to do that more than I actually write code :/
00:33adu#(str % "!") might have been more clojure-esque
00:34aduSgeo_: understood, when trying to solve a problem, I generally think of the solution in 50 languages, and then pick the shortest one
00:35Sgeo_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)
00:35Sgeo_There was probably something in PLaneT, but I never thought to check
00:36Sgeo_Well, I needed to turn numbers like 1, 2, 3, 10, 20, into "001", "002", "003", "010", "020"
00:36aduthat's what some-util-lib:pad-number-string-with-zeros is for!
00:37aduI don't know if that actually exists
00:48devn,(map (comp #(apply str %) #(cons "00" %) seq str) (range 0 20))
00:48clojurebot("000" "001" "002" "003" "004" ...)
00:48devn^-ugly :\
00:51replacayou can use cl-format for that
00:52replaca,(map #(cl-format nil "~3,'0d" %) (range 0 20))
00:52clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: cl-format in this context, compiling:(NO_SOURCE_PATH:0)>
00:53replaca,(map #(clojure.pprint.cl-format nil "~3,'0d" %) (range 0 20))
00:53clojurebot#<CompilerException java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.pprint.cl-format, compiling:(NO_SOURCE_PATH:0)>
00:53devn,(use 'clojure.pprint)
00:53clojurebotnil
00:53devn,(map #(clojure.pprint.cl-format nil "~3,'0d" %) (range 0 20))
00:53clojurebot#<CompilerException java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.pprint.cl-format, compiling:(NO_SOURCE_PATH:0)>
00:53replaca,(map #(clojure.pprint/cl-format nil "~3,'0d" %) (range 0 20))
00:53clojurebot("000" "001" "002" "003" "004" ...)
00:53replacathere we go
00:53devn:)
00:53devncl-format is twisted magic
00:53devni love it, but i hate it as well
00:53replacaindeed :)
00:54Sgeo_Does Racket have cl-format?
00:54devnhonestly i stick to something like the above unless i want roman numerals ;)
00:54replacadunno. It's an implementation of common lisps format routine, so those of us who come from there are familiar with it
00:55Sgeo_I ... have seen it, but haven't done enough with CL to be used to it
00:55devnreplaca: fair enough, but i know CL folks who are very much anti-cl tricks
00:55Sgeo_I'm certain it could get the job do... oh, you just used it
00:55devnanti-cl formatter* tricks
00:55Sgeo_I'd be amused if it were TC
00:56Sgeo_But I think I asked once, and it isn't
00:57replacadevn: 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
00:57Sgeo_I have a million copies of emacs on here and I'm afraid to use any
00:57tomojwould it be difficult to make clojurescript export the exports from explicitly named deps?
00:57Sgeo_I should wipe them out and start fresh
00:58devnreplaca: yeah, im not trying to be opinionated, just trying to play the middle on that topic
00:58devni know there have been a few raging debates in the past on this topic
00:58devnso im a bit sensitive
00:59replacadevn: yeah, in clojure it seems that those who use it (a minority), use it and the rest leave it alone without much debate
00:59devn,(take 10 (map #(str "00" %) (iterate inc 0)))
00:59clojurebot("000" "001" "002" "003" "004" ...)
00:59devn^-that's better
00:59Sgeo_devn, no it's not
01:00devnlol
01:00replacawell, yeah if you always want two leading digits
01:00Sgeo_0010 is not what I need
01:00Sgeo_<Sgeo_> Well, I needed to turn numbers like 1, 2, 3, 10, 20, into "001", "002", "003", "010", "020"
01:01devni see no
01:01devnnow*
01:02replaca,(clojure.pprint/cl-format nil "~3,'0d" 10)
01:02clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.pprint>
01:03replacadid clojurebot restart?
01:03devn(use 'clojure.pprint)
01:03replaca,(clojure.pprint/cl-format nil "~3,'0d" 10)
01:03clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.pprint>
01:03replacaweird
01:03replaca,(use 'clojure.pprint)
01:03clojurebotnil
01:03devn(require '[clojure.pprint :as pp])
01:03replaca,(clojure.pprint/cl-format nil "~3,'0d" 10)
01:03clojurebot"010"
01:03devn,(require '[clojure.pprint :as pp])
01:03clojurebotnil
01:04devn(pp/cl-format nil "~3,'0d" 10)
01:04devn,(pp/cl-format nil "~3,'0d" 10)
01:04clojurebot"010"
01:04replacait did restart and devn didn't say "simon says"
01:04replaca:)
01:04devnheh
01:09amalloyreplaca: he restarts every so often (15 minutes?) in case someone has broken the repl
01:10hiredmanthe bot doesn't restart, it loads a fresh sandbox (new copy of clojure from a new classloader)
01:11Sgeo_Ugh, a deeper understanding of Clojure is going to require esoteric Java knowledge, isn't it?
01:11Sgeo_I want esoteric Clojure knowledge, not esoteric Java knowledge
01:16johnmn3frozenlock: https://www.refheap.com/paste/3077
01:16Sgeo_What's a ClassLoader?
01:18frozenlockjohnmn3: Thanks, I'll grab this nice addition :)
01:18johnmn3it doesn't yet conform to yours
01:18johnmn3yours allows one to provide filenames
01:18johnmn3zlurp just gobbles up all the contents of every file into one structure
01:19Sgeo_Will I need to learn Java file stuff to figure out how to do file stuff in Clojure?
01:19johnmn3Which is all I need for right now, because I just want the zip file to be one big resource bucket
01:19johnmn3Sgeo_: not for most things, as there are wrappers for most things.
01:19johnmn3it'll be helpful to learn, though.
01:22_atoSgeo_: http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/ClassLoader.html
01:24Sgeo_So, a ClassLoader is a way to dynamically create a class in a running instance of the JVM?
01:26_atoyes, 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.
01:27Sgeo_I assume that they're how a program that I ... uh, used a decompiler on loads classes from the Internet
01:27Sgeo_>.>
01:28Sgeo_Come to think of it, I'm not sure if it uses http or https
01:28Sgeo_And if it uses http, that's a problem
01:28Sgeo_I should check
01:28lpvbBetter to learn a pure functional programming language like haskell first or dive into clojure? Would haskell teach functional programming better since it's pure?
01:29Sgeo_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
01:32_atoOne 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.
01:33Sgeo__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?)
01:33hiredmanhttps://github.com/hiredman/polycosm
01:33Sgeo_Suppose there are two libraries called A, and some conflicting internal names, but different purposes.
01:33Sgeo_Let's call one of them A1 and the other A2.
01:34replacalpvb: I'm not sure that there's one right answer to that
01:34Sgeo_B relies only on A1, and C relies on A2.
01:34Sgeo_I want to create D, which relies on both B and C.
01:34Sgeo_Is D writable?
01:34Sgeo_As in, is there a solution to this dilemma
01:34_atoyes, check out hiredman's link
01:34replacalpvb: Haskell shows more pure functional concepts (and is quite pure) so from an academic point of view it's best
01:34hiredmanSgeo_: 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
01:35hiredmanlike you use X and Y, X and Y both require Z, but X wants Z 1.0 and Y wants Z 2.0
01:35replacalpvb: but Clojure makes it easier to do lots of practical work while still being "pure by default"
01:35Sgeo_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
01:36replacalpvb: so you *do* tend to write functional programs in Clojure
01:36Sgeo_hiredman, hmm
01:36Sgeo_I don't know anything about maven or lein
01:37hiredmanwhich 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
01:37Sgeo_hiredman, is it pure Clojure or are there Java parts?
01:37lpvbSo 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?
01:38lpvbsgeo_, What were you going to say?
01:38replacalpvb: 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
01:38Sgeo_Clojure the language isn't inherently lazy, it's just the collections.
01:38hiredmanSgeo_: does it matter? polycosm is in clojure, but it is built on top of the jboss module system, which is written in java
01:39lpvbI really like the type system of haskell
01:39Sgeo_He hasn't had exposure to Haskell's laziness, so assumed that Clojure's was the extent of it
01:39Vinzentlpvb, haskel is actually about types, not about functional programming
01:39lpvbhmm
01:39Sgeo_Vinzent, it's about both
01:39Sgeo_I would think
01:39lpvbyea isn't it both?
01:39replacaVinzent: I would say that Haskell is about both and Clojure is only about functional programming
01:40Vinzentlpvb, if all you want is to familiarize yourself with functional programming concepts, then probably scheme is the best choice
01:40Sgeo_Scheme still has mutation
01:40Sgeo_:/
01:40lpvbScheme has no relevance to me though...
01:40Sgeo_lpvb, I've heard good things about SICP
01:41lpvbI've heard about that too
01:41Sgeo_I intend to work through it at some point
01:41lpvbI'll order it tomorrow
01:41replacalpvb: the problem with all of these discussion is that the meaning of "functional" varies by person
01:41amalloylpvb: sicp is free online. feel free to order a dead-tree version, but you certainly don't have to wait for it to arrive
01:42lpvboh
01:42lpvbokay =)
01:42lpvbI love when knowledge is free
01:42replacato 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")
01:43VinzentSgeo_, replaca, sure, but it puts emphasis on types, so I guess it would just distract
01:43Sgeo_Vinzent, types are good
01:43Sgeo_>.>
01:43Sgeo_And null/nil/whatever must DIE
01:43replacaVinzent: depends what you're trying to see.
01:44Sgeo_Replace it with option types
01:44Sgeo_MUAHAHA
01:44replacaSgeo_: maybe? :)
01:44Sgeo_lol
01:44Sgeo_:)
01:45lpvbreplaca, 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?
01:45Vinzentreplaca, well, the guy was talking about functional programming
01:45replacaman, spending my Saturday night making Haskell puns. I've reached a new low. Why couldn't I have just chosen heroin. :)
01:46replacalpvb: 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.
01:47Sgeo_That definition doesn't imply lambdas, does it?
01:48replacaSgeo_: no, and lambdas are really syntactic sugar. Though it's hard to consider true functional programming without closures
01:48replacajust cause it gets too verbose and requires some kind of state containers
01:49Sgeo_I think I still need to adjust to the notion of a closure actually altering the variables it closed around
01:49replacabut you can even do clojures without lambdas
01:49Sgeo_freudian slip
01:49Sgeo_?
01:49replacaSgeo_: yeah, but in an imuutable worls that's not a problem
01:49Vinzentlpvb, CL has a good support for such computation (and has lambdas too), but it hardly can be called functional
01:50replacaSgeo_: yeah, sorry :)
01:50replacaVinzent: again, depends on your definition, but I wouldn't call it functional
01:50lpvbCL?
01:50clojurebotYou just made an ad hoc, informally -specified, bug-ridden, slow implementation of half of that.
01:50lpvboh
01:50Sgeo_<Sgeo_> Why does CL get called functional? <[name redacted]> it's sort of like how you call ancient greece democratic.
01:50lpvbderp
01:51Vinzentreplaca, yes, I'm saying the same thing
01:51lpvbI'll just call CL a bad functional language then?
01:51lpvbWhat's with all the black & white
01:51replacamost folks talk about languages like CL being "multi-paradigm" but I think that's never worked out too well
01:51Vinzentlpvb, no, it's just multiparadigm
01:52Vinzentreplaca, oh, come on :)
01:52lpvbFunctional being a subset of multiparadigm?
01:52Sgeo_What should I implement first? Maybe, or lenses?
01:52replacalpvb: I think most of us would consider strong support for immutable types (preferably as a default) as being part of "functional"
01:53Sgeo_I mean, maybe is a little less useful with a dynamically-typed language
01:53replacaVinzent: well, I mean in the sense of having large programs that are truly functional
01:53Sgeo_Although..... not useless.... since to _use_ it you need to acknowledge it
01:53Sgeo_Use a Just 5
01:53lpvbOne other question, does Scala make functional programming harder than Clojure by being multiparidigm?
01:53replacaVinzent: multi-paradign languages tend to break *all* the paradigms in practice
01:54Sgeo_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
01:54replacalpvb: yes, I think so
01:54Sgeo_replaca, does that sound like a good idea?
01:54Sgeo_Maybe in Clojure, which will force users to actually think about it?
01:54replacaSgeo_: no, I don't think so
01:54Sgeo_Blah?
01:55replacaSgeo_: well, there's multi-paradigm and then there's pure vs. impure
01:55Vinzentlpvb, scala makes any programming harder :)
01:55replacaSgeo_: Clojure is clearly impure functional with dynamic typing and is fairly opinionated about that
01:56Sgeo_Well, I wouldn't be making it statically typed, as such
01:56Sgeo_I wouldn't be triggering compile-time errors
01:56replacanow, you could implement other paradigms by leveraging the impurity, but it's usually a bad idea
01:56Sgeo_I want to correct the billion-dollar mistake
01:57replacaSgeo_: there has been work to implement monads (including Maybe) in Clojure
01:57Sgeo_Any work on lenses? I'll do that then
01:57replacaSgeo_: http://clojure.github.com/algo.monads/
01:57Sgeo_If I eventually get around to it lol
01:58replacaSgeo_: 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
01:58Sgeo_I did mention it earlier today
01:58replaca(lenses, that is)
01:58replacaSgeo_: I don't mean you :)
01:59Sgeo_Ah lol
01:59Sgeo_(source lenses)
02:00aduSgeo_: still here?
02:00Sgeo_adu, hi
02:00lpvbAnother question: what are some good resources on learning AI in the functional paradigm?
02:00aduPeter Norvig?
02:02replacalpvb: you know, I haven't seen too much there. There's a lot of logic stuff though (the "The Reasoned Schemer" and core.logic)
02:04lpvbPeter Norvig's AI 'bible' is done in Common Lisp, which I just recently learned isn't very functional =(
02:04adunonsense
02:05aduthat's like saying blenders aren't very sharp
02:06Sgeo_Eh, it's still more functional than mainstream languages
02:06Sgeo_Or, well, some
02:07lpvbI guess I'll just start AI with whatever paradigm the authors choose and port the algorithms to functional later
02:07Sgeo_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
02:08Sgeo_erm, port imperative algorithms
02:38adulpvb: you might also look at Prolog and Oz
02:40adulpvb: also http://groups.csail.mit.edu/mac/users/gjs/propagators/
02:40aduthe propagator model is poised to replace Turing machines and lambda calculus, according to its authors
02:41aduso, basically, you may not want to convert to functional
02:47lpvbadu: I like the mathematical relationship of functional
02:48aduit's very restrictive
02:49aduyou should read http://web.mit.edu/~axch/www/phd-thesis.pdf if you're interested in AI
02:49lpvbit's sufficient to be better than imperitive and OOP, which is all I ask for
02:50lpvbI'll take note
02:52lpvblooks like it models neurons & synapses?
02:52aduthe classical approaches are also good, but the propagator model subsumes most knowledge/inference systems out there
02:53lpvbAnd all this is really new stuff so there aren't any languages which implement this yet?
02:54adusee my previous link (...csail...)
02:54aduthat's an implementation of propagators in mit-scheme
02:55aduI've run it, it works
02:55lpvboh okay, I was skimming through it and wondering why there was scheme everywhere
02:55lpvblooks like an interesting read, thanks
02:55aduyw
02:57adulpvb: 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
03:01lpvbadu, no that's not the essence of what I got out of it
03:03adudid you read Chapter 7?
03:21michaelr525good morning
03:37Sgeo_Is there anything wrong with using Clojure Box for everything?
03:39borkdudeSgeo_ doesn't is still use clojure 1.2 or so?
03:39RaynesIt probably uses a lot of ancient things.
03:39Sgeo_borkdude, hmm, apparently
03:40Sgeo_I wonder if Lispcabinet is good
03:40borkdudeit still uses an older version of swank-clojure; when I used it it was very hard for me to get the classpath right etc
03:41Sgeo_http://lispcabinet.sourceforge.net/ has Clojure 1.4
03:41borkdudeSgeo_ why don't you use normal Emacs with emacs starter kit and clojure-mode
03:49Sgeo_borkdude, can I also do Racket from there?
03:51borkdudeSgeo_ It wouldn't surprise me, but I have no Racket experience whatsoever
03:53RaynesDoes racket use slime?
03:54RaynesIf not, then sure. You can do COBOL too if necessary.
03:59borkdudeI think blog posts and examples using leiningen 1.7 should now be updated stating that explicitly, it would save people a lot of time
03:59borkdudeif they first are trying to setup things
04:01borkdudeRaynes you can only use one language with slime?
04:02Raynesborkdude: 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.
04:07borkdudewere there any plans to use nrepl from emacs?
04:10Rayneshttps://github.com/technomancy/nrepl.el
04:10RaynesIf somebody takes it up, then yes.
04:10RaynesNobody so far has built on this sadly.
04:27alex_baranoskywhat are your favorite tools to diff large maps?
04:28alex_baranoskyimagine you were still using 1.2 and no leiningen
04:31borkdudealex_baranosky no idea… maybe use set.difference?
04:31hoeck1alex_baranosky: depends, I'd go with sets and keys & vals
04:33hoeck1alex_baranosky: sorting maps, printing their values in a defined way and piping the result to diff or colordiff may also produce usable results
04:35hoeck1alex_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
04:36alex_baranoskythat doesn't diff maps, right?
04:39hoeck1alex_baranosky: no, I'm still searching for a good tree diff algo
04:39hoeck1but depending on the nesting in your maps, sorted item seqs will do just fine
04:40alex_baranoskythis feels like something that should be a solved problem already
04:40alex_baranoskyI guess it is for leiningen users; they can use the leon diff plugin
04:41alex_baranoskyseeing the problem in test failures is less quick than it should be
04:42alex_baranoskyI'd like to give something two maps, or even two arbitrary structures, and have it give me back a annotated breakdown of the differences
04:47hoeck1alex_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
04:48alex_baranoskyis it one of those problems that seems simple enough but turns out to be really complicated once you've looked into it more deeply?
04:50hoeck1alex_baranosky: yes, I've skimmed over a dozen papers aimed at providing (partial) solutions to tree-diffs
04:51hoeck1the problem is to find a minimal sequence of edit commands to transform one tree into another
04:51hoeck1edit commands are at minimum insert and delete
04:51alex_baranoskymake sense
04:56hoeck1there is also this tool (proprietary): http://www.semanticdesigns.com/Products/SmartDifferencer/
04:58hoeck1not 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
05:28borkdudeCLJ Galgje (clj hangman): Hangman with words from the #clojure language, case sensitive: http://bit.ly/Kr58SZ
05:33Sgeo_I wonder if Clojure is a good language to start learning web dev with
05:33Sgeo_I mean, Smalltalk does have AIDA/Web...
05:33Sgeo_(I sort of have philisophical objections to Seaside)
05:34Sgeo_Although Seaside does seem nifty at first
05:59winkborkdude: nice. but with 3 letter words it's really nasty
06:01penthiefWhat significance does a trailing # have? eg. (fn [field# value#] ...)
06:04penthief...and is there a single page version of http://clojure.org/Reference
06:04AimHerehttp://clojure.org/cheatsheet might be useful for you
06:06AimHereAnd 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
06:07babilenpenthief: 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
06:07babilenpenthief: We'd need a real example though
06:10penthiefbabilen: Not real, but cutdown: (defmacro blah [fieldname] `(let [example# 42] 42)) It may be a project-specific convention.
06:10classcastI 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
06:11Sgeo_penthief, that # indicates to, essentially, make it a random name that can be referred to elsewhere in the macro with example#
06:11Sgeo_Sorry if this is a poor explanation
06:11babilenpenthief: Yeah, that's in a macro and essentially just means: generate me a unique name in the context of this macro.
06:11Sgeo_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
06:11classcasthow is it possible that my deftype Costs cannot be cast to itself?
06:12penthiefOK, that's clojure for some kind of gensym. Thanks!
06:12babilenpenthief: If you want to learn why this is important you might want to read something about "hygienic macros"
06:12babilenpenthief: It *is* gensym
06:13Sgeo_penthief, I think let over lambda describes a similar auto-gensym
06:15Sgeo_http://letoverlambda.com/index.cl/guest/chap3.html somewhere in there
06:45ludstonHey guys and gals. Does anyone here know anthing about .pid's?
06:46babilenludston: Pretend that somebody does and ask your real question. What is a ".pid's" ?
06:48ludstonbabilen: It's the file that starts a daemon. I'm trying to work out how to compile/write one
06:49michaelr525isn't it the file holding the process id of the given daemon?
06:49ludstonGoogle is not helping me. It's a small, but significant thing I don't want to spend too much time trying to understand
06:49ludstonmichaelr525: Yeah, that's the one
06:49babilenludston: 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.
06:50winkludston: you could look into (but not limited to): supervisord, circus, start-stop-daemon
06:50ludstonI have a clojure project that I want to run as a daemon on my server.
06:50michaelr525ludston: why don'
06:50michaelr525t
06:50babilenludston: 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.
06:50michaelr525you just `cat` some .pids to see what's inside?
06:51babilenludston: I am referring to https://github.com/arohner/lein-daemon btw -- What are you really trying to do?
06:51ludstonHmm
06:51michaelr525babilen: it think he should have given you the answer, since you know the question. ;)
06:52ludstonmichaelr525: There is something fundamental that I don't understand.
06:52ludstonI will have to get back to you.
06:52michaelr525ludston: maybe you should get back to babilen.. ;)
06:53ludstonHim too.
06:53ludstonbabilen: I'm trying to use lein-daemon to do the thing that lein-daemon does
06:55michaelr525lol
06:55babilenludston: 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?
06:55ludstonI'm running it on an Archlinux box on a Linode server
06:57ludstonWhen I try and run it, it's hangs for ages, and then gives an error relating to the pid file
06:58babilenludston: 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.
06:59ludstonI've done daemon stuff on Arch before
06:59babilenludston: 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
06:59ludstonIt's got this /etc/rc.conf file for starting daemons at boot
06:59babilenludston: But I am done coming up with questions to actually understand your problem
06:59ludstonThanks for you help
07:15ludstonThanks bablilen. It's fixed. It was a problem with config like you thought it was.
07:16ludston*babilen
07:36winkugh
07:39bweaverHi, 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?
07:39Bronsa,(clojure.lang.Var/cloneThreadBindingFrame)
07:39mittchelHello everyone :)
07:39clojurebot#<Frame clojure.lang.Var$Frame@6007b705>
07:41mittchelIs anyone familiar with seesaw?
07:42bweaverBronsa: sorry, I still don't understand what I'm doing wrong.
07:43Bronsa,clojure.lang.Var/cloneThreadBindingFrame
07:43clojurebot#<CompilerException java.lang.RuntimeException: Unable to find static field: cloneThreadBindingFrame in class clojure.lang.Var, compiling:(NO_SOURCE_PATH:0)>
07:43BronsacloneThreadBindingFrame is a static method
07:43Bronsanot a static field
07:43bweaverok
07:44Bronsayou cant (let [f clojure.lang.Var/cloneThreadBindingFrame] (f)) as you'd do with clojure functions
07:44Bronsajava methods aren't first order
07:45bweaverBronsa: 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
07:46bweaverI see it works for clojurebot, maybe I'm doing something silly
07:46Bronsawhich version of clojure are you using?
07:47bweaver*clojure-version* reports {:major 1, :minor 3, :incremental 0, :qualifier nil}
07:47Bronsaclojure.lang.Var/cloneThreadBindingFrame has been introduced in clojure-1.4.0
07:47bweavererg, ok
07:48bweaverSorry, thanks for the help Bronsa.
07:49Bronsayou're welcome :)
08:08mittchelhow am I able to lock the height of a text box in seesaw?
08:08mittchelwhen my window resizes its get very large in height.
08:14mittchelAnyone familiar with seesaw?:P
08:17borkdudemittchel maybe try Stackoverflow or @daveray (author of seesaw) with a link to your coee
08:18borkdudemittchel sorry, @darevay
08:19borkdudemittchel or the google group: https://groups.google.com/forum/?fromgroups#!forum/seesaw-clj
08:20mittchelWell I've to work on HUSACCT documents so maybe later if Ive the time
08:24kjellskiI was just looking at the core.flatten implementation and was wondering how someone would implement this without knowledge of tree-seq?
08:25AimHere4clojure has 1400 reimplementations of flatten
08:25borkdudesmth like this? http://nostoc.stanford.edu/jeff/llisp/15.html
08:26kjellskiAimHere: therefor I'm looking at it… didn't get it right… how am I able to look at the solutions?
08:27AimHerewell once you get it right, you can see the solutions of any users you select
08:28AimHereOf the solvers I have selected, only two use tree-seq
08:28kjellskiAimHere: … 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...
09:07mittchelAnyone with seesaw experience able to help?: http://stackoverflow.com/questions/10968710/seesaw-button-bind-windowbuilder
09:14borkdudemittchel maybe a link to github would help in ths stackoverflow post
09:18mittchelits a pain in the ass :D
09:29borkdudeis there anything that does (require some-ns) and (in-ns some-ns) in one go?
09:33raekborkdude: (doto 'some-ns require in-ns) :-)
09:33borkdude;-)
09:52dgrnbrgis there a guide/advice on maintaining a version of a lein plugin for lein1 & lein2?
10:15xeqidgrnbrg: check out https://github.com/sattvik/leinjacker
10:15xeqiit tries to handle some of the differences
10:17dgrnbrgxeqi: cool, thanks!
10:17dgrnbrgdo you know whether there's a compatibility api for :injections in lein2 with lein1?
10:30dgrnbrgIs there a way to have a project work on lein1 and lein2 when it has lein1 dev dependencies?
10:31ohpauleezdgrnbrg: Why are you shooting to support both?
10:31dgrnbrgohpauleez: I'm trying to write and test a lein plugin that I want to support both lein1 and lein2
10:32ohpauleezKibit supports both, you can look at how that plugin
10:32dgrnbrgand i have a test project that I'd like to make support both as well
10:32ohpauleezis built
10:32ohpauleezdgrnbrg: https://github.com/jonase/kibit
10:32clojureboteg, https://github.com/clojure/tools.logging is the new version of clojure.contrib.logging
10:33dgrnbrgohpauleez: i think that kibit is simpler than my plugin
10:33dgrnbrgI need to hook a bunch of leiningen internals
10:33dgrnbrgi'll try maintaining 2 copies of the test project for now
10:34ohpauleezI think that's best, and what I've seen most projects do that rely heavily on internal stuff
10:35dgrnbrgohpauleez: 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:35ohpauleeznot off the top of my head, but is should be no different than using travis on a standard project
10:37xeqitesting lein plugins has come up in #leiningen a couple times, I don't know that there is a good way
10:37dgrnbrgI 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:37dgrnbrgI also tried adding it to .lein/profiles.clj, but it still didn't pick it up
10:38dgrnbrgah, i found it--sorry
10:39dgrnbrgis there any good way to require leiningen.core and leiningen.core.main?
10:41xeqiI've seen stuff like https://github.com/technomancy/swank-clojure/blob/master/lein-swank/src/leiningen/swank.clj#L48 most often
10:41xeqiI imagine it would work similiarly for those ns
10:42dgrnbrgxeqi: that's what i'm trying to do, but there's so many code paths that differ lol :/
10:42xeqi1->2 is a pretty big rewrite of some parts
10:43dgrnbrgis there a way to do a conditional (binding […])?
10:43dgrnbrgbecause in lein1 i need to rebind the var, but lein2 i need to never mention it
10:44mthvedtdgrnbrg: will lein2 break if you bind the var?
10:44dgrnbrgcan you bind a var that doesn't exist?
10:45xeqi&(binding [x "asdf"] x)
10:45lazybotjava.lang.SecurityException: You tripped the alarm! pop-thread-bindings is bad!
10:45xeqi,(binding [x "asdf"] x)
10:45clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve var: x in this context, compiling:(NO_SOURCE_PATH:0)>
10:45mthvedti guess you can't
10:45xeqire: conditional binding, not that I know of built in
10:45mthvedtyou can write a macro that conditionally expands at compile time
10:48mthvedt,(macroexpand '(binding [foo "bar"] true))
10:48clojurebot(let* [] (clojure.core/push-thread-bindings (clojure.core/hash-map (var foo) "bar")) (try true (finally (clojure.core/pop-thread-bindings))))
10:48mthvedtyeah, i think you need your own macro
11:02dgrnbrgIn 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:15cshellhas anyone been able to get lein on windows work in the git bash shell?
11:16zomgAnyone happen to know how to make vim use Clojure syntax etc. in .cljs files?
11:16zomgIt 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:17dgrnbrgzomg: have you poked around in .vim/plugins/vimclojure/ftdetect?
11:17zomgI don't have that plugin to begin with it seems :)
11:18zomgUnless it's somewhere in the global vim files of the distro, which I wouldn't know of...
11:19zomgOh 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:19zomgDerp.
11:22zomgdgrnbrg: yep installing that and adding the cljs thing to the ftdetect script did the trick. Thanks
11:23dgrnbrgzomg: awesome! vim is tricky to figure out--i just hack and hack and pray
11:23dgrnbrgbut it usually works ok
11:24zomgYeah thankfully someone else usually has done most of the work with the syntax and indent scripts :D
11:28tomojis ^:private a noop in cljs?
11:35twhumeIs there a simple way to search a sequence to see if it contains another sequence?
11:36raektwhume: Midje (a testing framework) can do that
11:36raekat least for writing test cases
11:36twhumehmm, there isn't a nifty function kicking about in the core then...
11:37raekthere is a diff function in some newer namespace, I think
11:38raektwhume: 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:38twhumeI'm interested in ordering too :(
11:44borkdudeRoulette anyone? http://roulette-clojure.herokuapp.com/
11:45cshelltwhume: the subseq command doesn't help you?
11:45csheller, function
11:46twhumeHmm, 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:01rvgateUsing a map, how would i concate a string and a value together? so something like: {:id "value"+number}
13:01rvgateresult in: {:id "value1"}
13:02AimHere&(str "value" 69)
13:02lazybot⇒ "value69"
13:03dreishYou mean {:id (str "value" number)}?
13:04rlbrvgate: or (not pretty) something like this:
13:04rlb(into {} (map (fn [[k v]] [k (str v "1")]) {:id "value"})
13:05rlbmpd 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:06rvgateAimHere, rlb, dreish, thx all, i used dreish's method for simplicity/readability :)
13:10rlbAnd for something like (status mpd) -> {:volume 60 ...}, what would you prefer to have happen when the underlying socket unexpectedly closes?
13:48twopoint718&(.getWidth (javax.swing.JFrame.))
13:48lazybotjava.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it.
13:48twopoint718Okay, hah, these are bad examples to post :)
13:49twopoint718I was curious why I can do the above (it works)
13:49twopoint718But then ((juxt (memfn .getWidth) (memfn .getHeight)) (JFrame.)) doesn't
13:49xeqilazybot doesn't use xvfb-run?
13:50hyPiRionI don't see any reason to have a virtual framebuffer here.
13:50hyPiRiontwopoint718: what part fails?
13:51twopoint718The juxt expression gives: No matching method found: .getWidth for class javax.swing.JFrame
13:51metellustwopoint718: guessing based on the examples from http://clojuredocs.org/clojure_core/clojure.core/memfn, I'd say try removing the .s
13:52mittchelis anyone familiar with seesaw?
13:52hyPiRiontwopoint718: It's the memfn that produces the error.
13:52twopoint718mittchel: oops, yeah it was the periods, I had moved the code around. Good catch.
13:54mittchelI'm sorry did you really mean to mention me in that sentence? haha
13:54metellushis tab-complete aim seems to be a little off
13:55rlbis 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:56twopoint718mittchel: nope. It is one of those typo-laden days I guess.
13:56twopoint718hyPiRion: thanks!
14:03frozenlo`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:36pepijndevosWhy is dot commented out? https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L2665
14:40adupepijndevos: maybe because it never gets munged
14:40adusee L3293
14:42pepijndevosadu, hmpf, - -> _ is still in there though
14:43aduwell, maybe it should be commented too
14:43aduI've only been looking at the source for about 30 seconds, so I'm not an expert
14:43pepijndevos:)
14:44cshellOn a POST request, does Noir put the body into :params or is it in :body?
14:48xeqicshell: I would expect :body
14:48aduI thought it was :content
14:48cshellxeqi: thanks, I think that's correct - I think the other api I"m using hasn't been updated
14:52xeqicshell: theres also ring-json-params which is a middleware that sticks them into :parmas
14:54Raynes<3
14:55aduI'm currently making a site in webnoir
14:56SqeoI want to make a stupid little site in webnoir
14:56SqeoSeriously very little
14:56SqeoI could type it in one line of code, but I'd need to figure out Heroku
15:02Sqeo(defpage "/:code" {:keys [code]} {:status code})
15:02SqeoThat's all I want to do >.>
15:03ghengisso i've made this tool to graph calls between vars in a namespace, but i can't get it to work for multimethods
15:03ghengisthere doesn't seem to be any line number metadata
15:04ghengisbut obviously the stacktraces know, so I'm puzzled
15:07ghengisit needs to be able to locate and parse the code for multimethods
15:10technomancySqeo: there's a good site for that but I forget the name
15:11technomancysomething with a name that was cute but unfortunately not memorable enough
15:12Sqeotechnomancy, for doing what? Seeing arbitrary HTTP status codes?
15:12technomancyyeah, for constructing arbitrary responses and even failure conditions
15:12technomancyyou can request a response that has a long delay for testing timeouts or even something that gets cut off halfway through IIRC
15:12technomancynot much help if I don't remember the name though
15:12SqeoHmm, that sounds actually useful
15:13SqeoI just wanted to see the error messages that browsers would display for weird things like 402
15:13SqeoIs IE the only browser that has its own error messages for HTTP status codes?
15:13technomancythe browser generally just displays the response body
15:14Sqeotechnomancy, I think in some circumstances IE doesn't?
15:14technomancymaybe IE does something goofy; wouldn't be at all surprising
15:15Sqeo"Internet Explorer, however, will not display custom pages unless they are larger than 512 bytes, opting instead to display a "friendly" error page."
15:15Sqeohttp://en.wikipedia.org/wiki/HTTP_404
15:17technomancyhuh; I guess that's not a bad heuristic.
15:31nodenameI wonder if anyone can help with this (onCygwin): $ lein2 help Leiningen is a tool for working with Clojure projects.
15:31nodenameSeveral 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:32nodenameDo I even need leiningen-eclipse? I'm using cemerick's lein and ccw workflow as in the Starting Clojure video
15:32technomancynodename: looks like you're using a plugin that's out of date
15:33nodenametechnomancy: how to find out more?
15:33technomancysearch for documentation on the plugin I guess?
15:34nodenameon leiningen.eclipse, I guess...
15:34technomancyif the CCW docs don't mention it you should probably ditch it
15:37nodenameok next dumb q: how to lein2 uninstall lein-eclipse?
15:38technomancyjust remove it from your profiles.clj or project.clj
15:39SqeoCan I issue leiningen commands from the REPL?
15:40nodenameexcellent, thanks technomancy!
15:40technomancySqeo: not yet; that's supposedly coming as part of jark
15:40technomancywell, not from the repl, but from an interactive session
15:41SgeoDoes this have anything to do with Clojure being on JVM?
15:41nodenamemoving on: does lein-marginalia work with lein2?
15:41technomancynodename: yeah
15:41technomancySgeo: no, it has to do with project isolation, which is a good idea on any platform
15:45cemericknodename: if you mean lein-eclipse, yes, it's redundant at this point
15:45SgeoHmm, apparently, I wrote code a year or so back illustrating what I thought was a flaw with Clojure concurrency
15:45SgeoOr something
15:46nodenameI 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:46technomancyit should go in :plugins
15:46nodename?? is not plugins deprecated?
15:47technomancyno, :dev-dependencies is deprecated
15:47amalloywould technomancy tell you to do something deprecated??
15:47lazybotamalloy: What are you, crazy? Of course not!
15:47nodenamebtw lein2 usage of marg is not in the README.md
15:47SgeoAlthough..... I think it's more of a demonstration of it being easy to use the wrong reference type
15:48SgeoAnd/or an objection to instantaneous @
15:48Sgeohold on
15:49nodenamein ringmon/project.clj, for lein2 it became :profiles {:dev {: dependencies... for ring-jetty-adapter. But lein-marginalia is different?
15:51SgeoIs there any channel-preferred pastebin?
15:53amalloygist or refheap
15:54Raynesamalloy: The fact that you included gist means we aren't friends ow.
15:54Raynesnow*
15:54nodenameright, putting lein-marginalia in :plugins worked, thanks. So :dev-dependencies apparently has split into more than one thing in lein 2.0
15:54Sgeohttps://www.refheap.com/paste/4fd4fa18e4b0232cc152e706
15:54RaynesAnd ow, too, cause it hurts.
15:55SgeoYeah, I guess Clojure can't prevent people from being stupid
15:58borkdudeRaynes maybe it is time to make lazybot react on the word gist? just an idea ;)
16:05BronsaSgeo: i think you should have used `(constantly {:balance result})` instead of `#(%2) {:balance result}
16:05Bronsa`
16:05Bronsawithout the \n.
16:06SgeoBronsa, hmm, makes sense
16:06Bronsathath's why the agent fails
16:06Bronsabecause you are calling an array as a function with no args
16:06Bronsa,({:a 1})
16:06clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: PersistentArrayMap>
16:10borkdudetoday I saw someone write this: &&(#(do {:a % :b %2}) 1 2)
16:10Bronsalol
16:11borkdudeI mean ##(#(do {:a % :b %2}) 1 2)
16:11lazybot⇒ {:a 1, :b 2}
16:11borkdudethen I wondered, why aren't #(..) functions not having an implicit do, it would enable them to just return a direct datastructure
16:12borkdudelike so: #([1 2 3])
16:13Bronsathen you'd have to #((..)) in every case where you dont want to return a datastructure
16:13borkdudewould it break existing #() functionality if this was added?
16:13amalloyborkdude: because of #(f %)
16:13amalloyyou don't want that to be #(do f %)
16:13amalloyand if you decide it should instead be #(do (f %)), the implicit do has no effect
16:13borkdudeamalloy hmm yes...
16:14borkdudeI like writing (fn …) better anyway\
16:17Raynesborkdude: That'd be evil.
16:21technomancynodename: :dev-dependencies was two things in lein 1.x; that's why it caused so much trouble
16:21technomancysome code runs in the project at dev time, and some runs in leiningen
16:31cshellDoes 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:33Raynescshell: Where are you looking for it?
16:33technomancyin compojure it should be (POST "/whatever" {:as {:keys [body]}} ...)
16:33RaynesYeah, this isn't compojure.
16:34RaynesThat wont work.
16:34cshellRaynes: I'm looking in the body - it looks like noir is putting everything into :params
16:34Raynescshell: Where are you getting the body.
16:34Rayness/\./\?/
16:35cshellI've put middleware in that pulls it off the :body from the Rink request map
16:35cshellbut that's an empty inputstream
16:35cshellsomewhere in the adapter, before it gets to my middleware, it has put the information i need into :params
16:35RoxxiHey 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:36technomancyI thought noir was built on compojure; it doesn't re-use compojure's destructuring?
16:36cshellRoxxi: Is it in a maven repo?
16:36RoxxiNo, it's not.
16:36Raynescshell: 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:36technomancyRoxxi: if it's for a toy project, you can use lein-localrepo; otherwise you need to get it into a repo
16:36RaynesYour best bet is to get it in one. You can push it to clojars if it is open source.
16:36technomancyclojurebot: repeatability?
16:36clojurebotrepeatability is crucial for builds, see https://github.com/technomancy/leiningen/wiki/Repeatability
16:36RoxxiOk, I'll look at that, thanks.
16:37cshellRoxxi: Cloudbees gives you a private repo if you need one
16:37cshellfor free
16:37cshellThanks guys, I'll keep looking - once I figure out how to do it raw, I will ahve to do it with friend :)
16:37Roxxicshell: Is it easy to add another maven repo if I go that route?
16:37Raynescshell: https://groups.google.com/forum/?fromgroups#!topic/clj-noir/DAjtOKevN54 Example
16:38borkdudetechnomancy would it be a good idea to make a special option for jars you want to include manually, instead of using lein localrepo
16:38borkdudeor would it be a horrible idea
16:38technomancyborkdude: since that approach is only appropriate for toy projects I think not
16:39cshellRaynes: Thanks, when I do the slurp on it, there's nothing in the :body - somewhere it's creating the :params though
16:39technomancyborkdude: it would either encourage people to check jar files into git or encourage works-on-my-machine builds
16:39seancorfieldand he said it before i could even type that!
16:39Raynescshell: That's strange. Perhaps post about it on the mailing list if you don't figure it out.
16:39cshellRoxxi: 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:39cshellRaynes: will do, thanks!
16:40borkdudetechnomancy 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:40borkdudeinstall = get running
16:40technomancyborkdude: probably best to use s3-wagon-private
16:41technomancyonce you create a private bucket you can push things out with `lein deploy s3`
16:41borkdudetechnomancy but everyone who wants to build/run my project would have to do that?
16:41technomancyis it a private or public project?
16:42borkdudetechnomancy public
16:42borkdudetechnomancy it's a project which supports a variety of databases including oracle
16:43technomancyhm; if the license prohibits distributing it you would probably have to use lein-localrepo
16:44borkdudeok
16:45borkdudeit's this (student) project btw https://github.com/SuperfastJellyfishh/timesheet
16:46technomancyI think there's simply no good way to do public projects that depend on non-free code.
16:47technomancysomeone was trying to make things work smoothly with JavaFX and it was just a mess.
16:48borkdudetechnomancy any info on heroky and leiningen2? it still assumes 1.7 now I think?
16:49borkdudeI 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:49technomancyborkdude: 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:49technomancyabsence of info? hm; I thought it was pretty clear?
16:49borkdudetechnomancy custom buildpack?
16:50borkdudetechnomancy 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:50technomancyhttps://github.com/heroku/heroku-buildpack-clojure/tree/lein-2 <- you can set BUILDPACK_URL to use a newer version
16:50borkdudetechnomancy whle my students work with the eclipse plugin which generates version 2 projects (which are compatible mostly with 1 though)
16:50technomancyyeah, blogs are always going to be an issue
16:51borkdudetechnomancy the plugin install thing
16:52technomancythe plugin task actually tells you what's going on now
16:52technomancypoints you to the upgrade guide
16:52borkdudetechnomancy ah this is what is used on heroku to build projects?
16:52borkdudetechnomancy yes, that's very good!
16:52technomancyborkdude: yeah, it's the adapter between a language runtime and the platform
16:53borkdudetechnomancy I noticed I don't need to do anything than set the :main now in project.clj
16:53borkdudetechnomancy push to heroku and it works
16:53borkdudetechnomancy (noir)
16:53technomancyborkdude: yeah, the Procfile is technically no longer necessary for single-process-type apps
16:54borkdudetechnomancy how does it work actually, it says run server on port 8080, it gets ignored?
16:55technomancyif you don't have a procfile it just runs `lein trampoline run`
16:55technomancyit's up to -main to check (System/getenv "PORT")
16:55borkdudetechnomancy ah of course
16:56borkdudetechnomancy I never used that env variable, that's why I didn't think of it
17:00cshellRaynes: 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:00cshellRaynes: Found an implementation here: http://bit.ly/LgNvqh
17:08eightyso what's the idiomatic way to fill a vector in clojure? vectors are immutable, so guessing i need the assoc function?
17:08eightybasically 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:10cshellconj adds to a vector
17:12SgeoAre 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:13SgeoLike, 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:17SgeoHmm, hold on
17:17SgeoThere's no way to, from another thread, just block until an agent changes?
17:18Raynesalex_baranosky: Does lein-midje work with lein 2?
17:18cmajor7"jayq.core.document_ready is undefined" JS error. The clojurescript statement (via jayq) is "(document-ready (.-tooltip ($ "[rel=tooltip]")))"
17:19cmajor7what/why can it be?
17:19cmajor7later if I run "jayq.core.document_ready…" from a browser console there is no error
17:20amalloy&(doc add-watch) ;; Sgeo
17:20lazybot⇒ "([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:20Sgeoamalloy, but suppose I want the convenience of just blocking waiting for it to change
17:21amalloywell, there are two answers to this
17:21amalloyone is that that's not what agents do
17:21amalloythe 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:22amalloyhm, no documentation
17:22amalloyi 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:23technomancyI'm creating a "deprecated" section of the plugins wiki
17:23technomancyfor Leiningen
17:24technomancythere'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:24Raynesalex_baranosky: I don't think it does, though the readme seems to think it does.
17:24Raynesalex_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:25technomancyseancorfield: is the fw1 plugin deprecated now with lein-newnew?
17:28technomancyndimiduk: is the lein-hadoop plugin still necessary?
17:28ndimidukit's better than uberjar
17:28ndimidukand it's too slow
17:28ndimidukat least for us
17:29ndimidukwe build hadoop jars out of ant because the jar command is much faster than iterating through the deps in lein
17:29ndimidukbut it's still handy for small projects.
17:29technomancyhuh; ok. I'll leave it out of the deprecated section ten.
17:29technomancythen
17:30ndimiduki needs some love; i haven't moved my world to 2.0 yet
17:30technomancyso uberjar is a lot slower than ant's version even without the GC bug?
17:30ndimidukhmm
17:30ndimidukuberjar is not preferred because you get file collisions
17:30ndimiduklog4j.properties, for instance
17:31technomancyI think collisions no longer cause failures; they just cause files to get dropped
17:31ndimiduklein-hadoop was slow; i've not used it on a big project with 1.7.1
17:31technomancy(I believe 1.7 works this way; know that 2.x does)
17:31ndimidukyes, which is a problem
17:32technomancyyou'd need the ability to say later versions win?
17:32Mad_Masterhi, does anyone have experience with seesaw who can help me ?
17:32ndimidukand i haven't looked at MRv2 yet. it's handling of the bundled lib directory may be entirely different
17:36rlbIf 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:42Sgeohttp://www.slideshare.net/pcalcado/lisp-macros-in-20-minutes-featuring-clojure-presentation
17:42SgeoIs it just me or is the code on slide 20 wrongly indented?
17:43amalloyyes, it is. i assume it's hard to fit stuff on a slide
17:44amalloyit's also three years old. like, struct-maps? anything you learn reading that will have to be taken with a grain of salt
17:47SgeoIn Clojure, how acceptable/unacceptable is it to have a seq that gets data from the environment, and waits
17:47SgeoFor example, a seq that essentially contains all lines said in this channel
17:48SgeoI know Haskell has issues with lazy I/O, but is that more acceptable in Clojure?
17:48rlbSgeo: you mean like (line-seq (reader socket))?
17:48technomancyit's fine as long as it doesn't interact with dynamic binding
17:51kmicuwhere I can find change log for 0.0-790, 0.0-1376 org.clojure/google-closure-library?
17:57holohi
17:58holowhen running lein trampoline run -m sample.views.welcome i get: Exception in thread "main" java.lang.RuntimeException: java.lang.ClassNotFoundException: sample.views.welcome
17:58holo"lein run" poses no problem though
17:59holoi already cleaned classes/* and lib/* and then did lein clean; lein deps; lein run
18:03technomancyholo: can you provide a repro case?
18:12holotechnomancy, 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:14rvgateholo, i just happen to have pushed a clojure project to heroku today... you can skip that step
18:16holorvgate, 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:16technomancyholo: `lein run` in Procfile is enough
18:16rvgateholo, so did i... haha, but a classmate noted that it wasnt needed
18:16technomancyif you have :main specified
18:17holotechnomancy i have :main specified
18:18technomancyshould be set then
18:19holotechnomancy, i have :main sample.server
18:21holooops :) lein trampoline run -m sample.server works as it would be expected
18:22holorvgate, i wonder if you were also running the wrong namespace
18:22holotechnomancy, thanks!
18:22rvgateholo, not really... created a basic leiningen project
18:26holorvgate, about its utility, i found it here moments ago https://devcenter.heroku.com/articles/procfile
18:56gfrederickssomehow I cannot figure out how to require and instantiate a goog class in cljs
18:56gfredericksspecifically goog.ui.Slider
18:56Mad_Mastercan anyone help me with seesaw ?
18:57gfrederickscertainly (:require [goog.ui.Slider :as Slider]) (new Slider) doesn't work
18:57gfredericksbut neither does (:require [goog.ui :as ui]) (new ui/Slider)
18:57gfredericksas the require fails at runtime
18:58dnolengfredericks: (:require [goog.ui.Slider :as Slider]) (goog.ui.Slider.)
18:58dnolengfredericks: did you try ^
18:58dnolener
18:58gfredericksdnolen: nope; bout to now
18:58dnolen(:require [goog.ui.Slider]) (goog.ui.Slider.)
18:58dnolengfredericks: goog type ctors are not namespaces.
18:58dnolengfredericks: so what you originally did won't work.
18:59dnolengfredericks: GClosure structure in generally doesn't really map all that well to namespaces. There's an existing ticket about this.
18:59gfredericksdnolen: the :as is required
18:59gfredericksdnolen: but otherwise it worked perfectly, thanks
19:00dnolengfredericks: ah right, there's a ticket about that too.
19:00gfredericks:)
19:04gfredericksis 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:05dnolengfredericks: SVG, which is slow if you have many shapes.
19:05gfredericksokay, so "SVG" and "canvas" are disjoint things?
19:05dnolengfredericks: not related at all.
19:06gfredericksso most or all html5 graphics libs pertain to one or the other?
19:06dnolengfredericks: SVG is a DOM oriented graphics abstraction - canvas is just procedural drawing surface.
19:06gfredericksthat explains why I couldn't see my circles in the dom tree :)
19:07ambivalenthey how to start learning clojure, i set the enviroment in eclipse and im quite proficient in java
19:07gfredericksambivalent: lotta folk like 4clojure.com
19:08ambivalentthnx i saw a book - the joy of clojure but too many pages :)
19:10AimHereThe Joy of Clojure isn't a very big book
19:11gfredericksbut it has too many pages
19:11AimHereOnly about 340 or so
19:11holoambivalent, there is "clojure for beginners" with 67 pages, if the criterion is number of pages haha
19:12AimHereFor comparison, K&R is 270 pages, and that's about as concise as language books get
19:18holoi 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:18lpvbambivalent: http://java.ociweb.com/mark/clojure/article.html
19:19holoi was ignored in #heroku about this :o) so i'm trying my luck here
19:19lpvboh he quit
19:19gfredericks,(let [map! [{} #{} [] {[] #{}}]] (map map? map!))
19:19clojurebot(true false false true)
19:19AimHereSgeo, if this was a lisp-2, (map map? map) might have been viable
19:20SgeoAimHere, heh
19:25zakwilsonhttp://pastebin.com/bawmbjkV <-- Clojure tries to resist most of the badness that can happen in multithreaded code, but I wrote a deadlock anyway!
19:26SgeoYou know what would be interesting? (Not for actual programmign tasks)
19:26SgeoA language that prevented you from shooting yourself in the foot
19:27zakwilsonGreat idea. First, solve the halting problem.
19:27SgeoAlthough, in seriousness, it would be cool if a statically typed language had support for statically ensuring no deadlocks.
19:27Sgeo...and I don't mean the trivial way of doing that
19:27gfredericksif a language is turing complete then shooting yourself in the foot is a valid program
19:28Sgeozakwilson, ok: My language has no looping constructs. All programs halt.
19:28SgeoThere, I solved the halting problem ;)
19:28zakwilsonThen your language isn't Turing complete.
19:28SgeoDid I specify TCness?
19:29metellusif they all halt then there can't be any deadlocks, right?
19:29zakwilsonNo, but it's implied when you talk about a programming language.
19:29TimMcSgeo: Does your language have TCO, by the way?
19:29TimMc(#(% %) #(% %)) is non-halting with TCO.
19:30Jayunit100how to add several keys to a map with default values = 0 ?
19:31dnolen,(into {} (map vector [:a :b :c] (repeat 0)))
19:31clojurebot{:a 0, :b 0, :c 0}
19:31gfredericks,(reduce (fn [m k] (update-in m [k] #(or % 0))) {:a 2 :b 12} [:a :b :c :d])
19:31clojurebot{:d 0, :c 0, :a 2, :b 12}
19:31gfredericksJayunit100: that or dnolen's depending on what you meant exactly
19:32Jayunit100thank you mister nolen
19:33Jayunit100dnolen: ? 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:33Jayunit100ah yes i will have to try and see
19:35dnolenJayunit100: Himera does that. Though I don't know why you wouldn't just use lein-cljsbuild
19:37Jayunit100Well…. want to try deploying a simple clojurescript just for fun on a sandbox site
19:48gtrakgfredericks: https://gist.github.com/2907736
19:49gtrakit's making its way into a blogpost atm
19:53gfrederickswould 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:55dnolengfredericks: doesn't sound evil to me.
19:55gtrakIt still has to be in a different ns, though, right? you don't want circular deps
19:55gtrakeven if you type it inline...
19:56gfredericksgtrak: you talking about what I just said?
19:56gtrakyea
19:56gfredericksso you have foo.cljs and foo_macros.clj
19:56gfredericksin foo_macros you put (defmacro clj-eval [form] (eval form) nil)
19:57gfredericksthen in foo you can (clj-eval (defmacro some-macro [] ...)) (some-macro ...)
19:57gtrakright
19:57gfredericksI don't know what your question means then.
19:58gtrakyou can't do in foo: (defn a [] ..) foo_macro: (defmacro b [& body] (a b)), though
19:58gtrakso if you had a defmacro-macro, and did both of those in foo, it wouldn't work, ya?
19:59gfredericksyou can do in foo_macro: (defmacro b [& body] `(foo/a b))
19:59gfredericksor whatever
19:59gfredericksI think whenever you have clj-for-cljs macros that emit varish names you have to fully qualify them
19:59gfredericksor maybe there is some other cljs mechanism for expanding the symbols correctly
20:00gtrakah, you can spit out code that references the var, but you can't call it, that's not so bad I guess
20:01gtrakyou could just as well have a defn-clj macro
20:01gfredericksyou certainly can't call it because one's in cljs whereas you are running clojure at compile time
20:01gfrederickswhat would you do with a clj function?
20:02gtrakcall it from a macro?
20:02gfredericksyeah I guess that could be useful
20:02gfrederickshmmmmmmm
20:03gfrederickswhat does `foo resolve to in a cljs file?
20:03gfredericksand by resolve I mean...read as
20:03gfrederickser
20:03hiredman` is expanded by the reader
20:03gfredericksyou know what I mean
20:03gfrederickshiredman: yeah I'm just curious what ns would end up there
20:03splunkanybody have any references on creating network services with clojure? what would the event look like?
20:04splunkevent loop look like?
20:04Chousukegfredericks: see what '`foo becomes
20:05gfrederickshuh; it's user/foo
20:05gfredericksoh man I'm imagining all kinds of evil
20:30hiredmananyone know how you do a sql WHERE foo IN (...) with clojure.java.jdbc where … in via a prepared statement
20:37mittchelAnyone familiar with seesaw?
20:37brehaut~anyone
20:37clojurebotJust 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:37Mad_Masterlawl
20:37gfredericks~noone
20:37clojurebotIt's greek to me.
20:38amalloyhiredman: 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:39hiredman:/
20:39amalloyare 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:42Jayunit100is there a way to return a map from "for"
20:42Jayunit100by emitting [k v] pairs ?
20:43gfredericks,(into {} (for [x (range 3)] [x (str x)]))
20:43clojurebot{0 "0", 1 "1", 2 "2"}
20:44Jayunit100oh no ! the into again :)
20:44gfredericksblast it all
20:48amalloy,(into {} (map (juxt + str) (range 3))) ;; if every character costs you a drop of blood
20:48clojurebot{0 "0", 1 "1", 2 "2"}
20:49gfredericks,{0"0"1"1"2"2"} ;; if every character costs you a drop of blood
20:49clojurebot{0 "0", 1 "1", 2 "2"}
20:49gfredericksis whitespace-and-comma-less clojure turing complete?
20:50devnHow do you think about "Tell, Don't Ask." in Clojure?
20:52mthvedtlambda calculus is turing complete isn't it?
20:52gfredericksyes; can we do lamba calculus without whitespace?
20:52gfredericksor also lambda calculus
20:52gfrederickssilly greeks
20:53gfrederickswhoever decided "mbd" was a legal string of consonants
20:54mthvedtcan you do anything in clojure without whitespace?
20:54gfredericksyou can make maps from integers to strings apparently
20:54mthvedt,(cons[1][2])
20:54clojurebot([1] 2)
20:55mthvedt,((fn[x]x)1)
20:55clojurebot1
20:56mthvedtthat's enough to do lambda calculus
20:56gfredericksoh hm
20:56mthvedtor at least some combinatorial equivalent version thereof
20:56gfredericksso instead of (fn[a](fn[b](a b))) we would do...
20:56gfrederickswait can we do that?
20:57gfredericksyour (fn[x]x) isn't a very useful function
20:58gfrederickstry making a function that calls another function
20:59zakwilsonThe identity function is often useful.
21:00gfredericksyes yes but in this case not sufficient
21:00gfredericksI doubt the lambda calculus with only identity functions is turing complete
21:00Jayunit100i guess clojure.contrib.string is gone
21:00gfredericksJayunit100: clojure.string
21:01nodenameAny thoughts on this problem: Errors running builder 'Leiningen Builder' on project 'clevolution-gui'.
21:01clojurebotleiningen tutorial is at http://github.com/technomancy/leiningen/blob/master/TUTORIAL.md
21:01nodenameUnexpected exception while trying to update Leiningen Managed Dependencies for project clevolution-gui
21:01nodenameccw.util.eclipse$run_in_workspace cannot be cast to clojure.lang.IFn
21:01Jayunit100hmmmm so there is no more "substring" method ?
21:01Jayunit100or is there a better / different lib for that
21:01gfredericks,(doc subs)
21:01clojurebot"([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:01gfredericksthat's in clojure.core
21:02Jayunit100ahhh i mean ….
21:02Jayunit100(thanks though) --
21:02Jayunit100(substring? "a" "aaa")
21:02gtrakwhat's the best wordpress sourcecode=blah setting? clojure setting kinda sucks
21:02brehautre:lambda calculus https://github.com/fogus/skiing
21:04gfredericksbrehaut: well the K is doable, but don't think S or I
21:04gfrederickswait wait
21:05gfredericks(fn[a](fn[b](a b))) could be....
21:05gfredericks(fn[a](fn[b](((fn[]a))b)))
21:05gfredericksokay I think that does it
21:06gfredericks,'(fn[a](fn[b](((fn[]a))b)))
21:06clojurebot(fn [a] (fn [b] (((fn [] a)) b)))
21:06gfredericksyep
21:37amalloygfredericks: i think you can simulate spaces using ` and ~
21:38amalloybut then i guess you need defmacro, which needs a space
21:42cshellAre dynamic-scoped vars in Clojure basically just thread-safe global vars?
21:43cshellthread-safe/thread-local
21:47axle_512_any emacs users could help me with paredit navigation? Trying to navigate my clojure code efficiently
21:48amalloygotta be more specific, axle_512_
21:48amalloycshell: yes, but they also encourage using them in a "scoped" way - binding sets, does stuff, and then resets
21:49axle_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:50axle_512_and please forgive me for asking this emacs question in the clojure room :(
21:50amalloywell, sideways is C-M-f
21:51amalloyyou can use paredit-{forward,backward}-{up,down} for the rest, but i don't know the bindings for them
21:51cshellamalloy: thank you
21:51cshell:)
21:51axle_512_amalloy: yes, thanks!
21:52axle_512_amalloy: C-M-f and C-M-b are working for me to move sideways.
21:52axle_512_amalloy: I will experiment with the paredit-forward, backward, up, down.
22:12johnmn3can lein push a project to github?
22:17gfredericksjohnmn3: git doesn't do that for you?
22:17gfrederickstime to write a lein-git plugin that just shells out to git
22:18johnmn3gfredericks: yea, I just don't want to have to learn git.
22:19gfredericksah right. No I think you'll have a hard time using github without learning git.
22:19gfredericksdepending on what you're trying to do it might be pretty basic
22:20gfrederickse.g., github gives you instructions for pushing up a project
22:25gfredericks(def TAU (.-PI js/Math))
22:25gfrederickswait no
22:25gfredericks(def TAU (* 2 (.-PI js/Math)))
22:46cshellMan, 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:53Hodappcshell: I shall have to read this in detail.
22:53aduHodapp: reading details is fun
22:54Hodappit can also be boring as hell
22:54gfredericksboulderdash
22:58rorykHow 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:08jblomohas anyone seen cljs compile inconsistency where some clojure.core functions get incorrectly compiled as non-existent functions in the current namespace?
23:20gfredericksjblomo: are you using lein-cljsbuild?
23:21SgeoLispcabinet comes with lein?
23:21jblomono, using an in-process cljsc/build call
23:21jblomogfredericks:
23:21gfredericksk nm
23:22jblomohave you seen something similar?
23:24jblomohrm i think it might be the /build call. it seems to miss other changes to the scripts, too
23:28adulein on me, when you're not strong, and I'll be your friend...
23:34johnmn3hahah
23:34johnmn3https://clojars.org/zljdb
23:35johnmn3I should really put it on github, but I don't feel like setting git up on this win7 box at the moment
23:39SgeoGrah
23:39Sgeoclojars, I want to see source code or at least the API from the site
23:39SgeoI guess I can't do that
23:39jblomowhat's not best practice for converting a cljs lazy-seq to an array?
23:39jblomo(-> ls vec .array)?
23:40technomancySgeo: source for clojars itself?
23:40Sgeotechnomancy, source for a... jar, I guess, on clojars
23:40SgeoNot clojars itself
23:40SgeoSay, I want to get an understanding of how I'd use a particular thing
23:41technomancySgeo: most jars contain source inside them
23:41SgeoThat requires me downloading the jar
23:41SgeoAnd opening them from there
23:41SgeoAnd also, I don't even see a download link
23:41johnmn3which is why I should also put it on github
23:41johnmn3but that's for another time
23:43johnmn3Sgeo: http://clojars.org/repo/
23:44johnmn3http://clojars.org/repo/zljdb/zljdb/0.1.0-SNAPSHOT/zljdb-0.1.0-20120611.032241-1.jar
23:45johnmn3you're right though. There should be a download link on each jar's page
23:46technomancymore important would be to link to the source
23:46technomancynext-gen clojars will require it
23:47johnmn3will next-gen clojars host the source?
23:47technomancyno
23:47technomancywell, not apart from the jar file