#clojure logs

2011-11-04

00:02brehaut"Hacks and glory await!" lol
00:11aperiodictechnomancy: sending an EOF makes them both exit
00:12aperiodicunless C-d is not an EOF
00:23amalloybrehaut: i smell a new swank user?
00:23brehautamalloy: relatively :)
00:24brehautsince about the middle of october
00:25amalloytechnomancy: you're telling leo2007 that slime should be able to jump to the definition of "def"? that would surprise me
00:26nappingit would however be totally awesome
00:28amalloyespecially since no definition exists :P
00:31nappingit could open Compiler.java to the definition of class DefExpr
00:31nappingit looks like that's what backs DefExpr
00:32nappingbacks "def", rather
00:32amalloynapping: sure, that would be possible (though probably not worth the effort). what part of DefExpr do you jump to, though?
00:32nappingeval()?
00:33amalloymaybe. i was under the impression def's impl was tangled up in more than just DefExpr, but i guess it isn't
00:36nappingand defn seems to be a plain macro
00:36amalloynaturally. slime can jump to the impl of that, no problem
00:37nappingYeah, I was just worried some of those might be handled in Compiler.java
00:42nappingaww, slime-disassemble-symbol doesn't seem to work - speaking of trying way too hard to present a "definition"
00:53nappingtechnomancy: If I wanted to support slime-disassemble-symbol, would your swank-clojure be the place to hack it in?
01:08leo2007(macroexpand '(let [x 1] (+ x x))) => (let* [x 1] (+ x x))
01:08leo2007is that odd?
01:09brehautno
01:09brehautleo2007: why?
01:10leo2007let -> let*
01:10leo2007let* is not defined.
01:10brehautlet* is a special form
01:10brehautlet merely adds destructuring sugar and some compile time checks to the form
01:11leo2007ok, how to know that let* is a special form?
01:13brehautleo2007: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L43 ?
01:14nappingleo2007: the docs seem to lie, and claim let is a special form
01:14hiredmanthe idea is let is a special form, which happens to be implemented as a macro that expands to let*
01:15hiredmanso use let
01:15hiredmanat one point if was a macro that expanded to if*
01:15hiredmanno it doesn't
01:15hiredmannow
01:16brehauthiredman: am i right in thinking that previously the destructuring wasnt handle by destructure either (thats a 1.0 change?)
01:17amalloyoh, i misread that. thought you said "it" (ie, let) was a macro expanding to if*. i was really interested to hear an explanation of that until a reread disillusioned me
01:17nappinghiredman: it's nice to be able to see how the destructuring works by macroexpanding let
01:17leo2007hiredman: Thanks.
01:18hiredmanbrehaut: not sure, as far as I know destructuring was always handled by destructure
01:18leo2007but when I input let* in the repl I get ; Evaluation aborted on java.lang.Exception: Unable to resolve symbol: let* in this context.
01:18nappingI don't think the current documentation is precise enough to explain a few things like the difference between {:map-pattern goes-here} and [&{:map-pattern goes-here}]
01:18hiredmanleo2007: don't worry about it
01:18hiredmannapping: it's not a pattern
01:19leo2007hiredman: you mean don't worry about the fact that let* isn't resolvable?
01:19hiredmanyes
01:20hiredmanlet* only has meaning at the start of a list, like (let* ...)
01:20leo2007hiredman: thanks.
01:20napping"binding form", if you insist
01:20hiredmanand it doesn't not go through the normal resolution process
01:20hiredmannapping: it's not pattern matching
01:21leo2007BTW, do you get any doc by from `C-c C-d C-d def RET'
01:21hiredmanswank-clojure pulls docs from the meta data of vars, but special forms don't have vars to hang doc metadata on
01:21brehautnapping: pattern matching performs conditional logic, where destructuring just tries to upack data
01:22leo2007hiredman: thanks for the explanation.
01:22hiredmanso "special forms" are really macros, like let, so it does have a var to hang documentation on
01:22hiredmansome
01:23hiredmanit's a little inconsistency in the compiler, most likely it will change when every people get tired enough with the current compiler to rewrite it
01:24nappingbrehaut: I was confused by the behavior of maps - I thought the destructuring was supplying nils for missing things, but it seems that's just the map lookup
01:28nappingVectors are in between - the nils for excess members in the binder are filled in because it's calling the 3-argument nth
01:28hiredman,(get [] 1)
01:28clojurebotnil
01:31napping,(macroexpand-1 '(let [[x] []] x))
01:31clojurebot(let* [vec__181 [] x (clojure.core/nth vec__181 0 nil)] x)
01:32nappingThere's also the conditional behavior of throwing an exception if things don't match
01:33brehaut,(destructure '[[x] []])
01:33clojurebot[vec__208 [] x (clojure.core/nth vec__208 0 nil)]
01:33brehautyou dont need to hide it away in a let to expand it
01:49leo2007Is ` the same as backquote in other lisps?
01:54nappingmaybe?
01:54nappingIt's the quasiquote, but it's a bit different from other lisps I've seen
02:01callenjust got home from the bay area clojure meetup
02:02callenhad a good time, helped people get their environments setup, swank/lein working, etc.
03:16leo2007where is doall-seq?
03:16hiredmanwhat do you mean?
03:16leo2007I cannot find its doc?
03:17hiredmanwhat makes you think it exists?
03:17leo2007hiredman: no worries. I am reading its source.
03:17hiredman(I doubt that)
03:17leo2007hiredman: it was not part of clojure. My bad.
03:17hiredmansure
03:31amalloyi was surprised to learn recently that doall and dorun take an optional "how many" argument
03:35ibdknoxhah
03:35ibdknox,(doc dorun)
03:35clojurebot"([coll] [n coll]); When lazy sequences are produced via functions that have side effects, any effects other than those needed to produce the first element in the seq do not occur until the seq is consumed. dorun can be used to force any effects. Walks through the successive nexts of the seq, does not retain the head and returns nil."
03:35ibdknoxit's like magic
04:28licensermorning
04:43ejacksonmorning folks
04:45Blktgood morning everyoen
04:46Blkteveryone*
05:20licenser,(clojure.contrib.str-utils2/replace "\\" #"[\"\\]" (fn [x] (println x)))
05:20clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.contrib.str-utils2>
05:20licenser(clojure.contrib.str-utils2/replace "\\" #"[\"\\]" (fn [x] (str x)))
05:20licenser,(clojure.contrib.str-utils2/replace "\\" #"[\"\\]" (fn [x] (str x)))
05:20clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.contrib.str-utils2>
05:20licenserany idea why that happens? It looks like a bug or I just don't see what I do wrong here
05:21hiredmanuse clojure.string
05:21hiredmanand you need to load namespaces before you can use the functions in them
05:22licenser,(clojure.string/replace "\\" #"[\"\\]" (fn [x] (str x)))
05:22clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.string>
05:22hiredmanand you need to load namespaces before you can use the functions in them
05:22licenseroh that is a different error, for me it gives "String index out of range: 1"
05:23hiredman,(require 'clojure.string)
05:23clojurebotnil
05:23hiredman,(doc clojure.string/replace)
05:23clojurebot"([s match replacement]); Replaces all instance of match with replacement in s. match/replacement can be: string / string char / char pattern / (string or function of match). See also replace-first."
05:24hiredmanI would try out that regex and see if it matches anything
05:24licenserit works great if you don't pass "\\" as string
05:24licenserit does just fine
05:25hiredman,(re-find #"[\"\\] "\\")
05:25clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading string>
05:25hiredman,(re-find #"[\"\\] "\\\\")
05:25clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading string>
05:25hiredman,(re-find #"[\"\\]" "\\")
05:25clojurebot"\\"
05:25hiredman,(clojure.string/replace "\\" #"[\"\\]" (fn [x] x))
05:25clojurebot#<StringIndexOutOfBoundsException java.lang.StringIndexOutOfBoundsException: String index out of range: 1>
05:25hiredman,(clojure.string/replace "\\" #"([\"\\])" (fn [x] x))
05:26clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.lang.String>
05:26licenserhttp://pastebin.com/9VfyembL <- is what he gets
05:26licenserworks perfectly with "\""
05:26licenserjust not with "\\"
05:27hiredman,(clojure.string/replace "\\" #"([\"\\\\])" (fn [x] x))
05:27clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.lang.String>
05:27hiredman,(clojure.string/replace "\\" #"[\"\\\\]" (fn [x] x))
05:27clojurebot#<StringIndexOutOfBoundsException java.lang.StringIndexOutOfBoundsException: String index out of range: 1>
05:27licenser,(clojure.string/replace "\"" #"[\"\\]" (fn [x] (str (type x))))
05:27clojurebot"class java.lang.String"
05:27licenserit returns a string just fine but it seems odd
05:27hiredmandunno, check the source of replace
05:28hiredman,(clojure.string/replace "\\\\" #"[\"\\]" (fn [x] x))
05:28clojurebot#<StringIndexOutOfBoundsException java.lang.StringIndexOutOfBoundsException: String index out of range: 1>
05:36clgvGiven I have (defn+opts f [x | [opt-param1 [opt-param2 10]] ] ...) to define a function with optional parameters (and some more magic related to this) - where would you put the doc string for the parameters? I think it would become unreadable to put it directly to the parameter. I can only think of putting it into the meta map that 'defn supports anyway.
05:50licenserhiredman: actually it isn't a clojure thing, it is java that crashes with the regexp
05:50licenser]
05:52clgvlicenser: try (clojure.string/replace "\\\\" #"\\\\" "\\\\")
05:52clgv&(clojure.string/replace "\\\\" #"\\\\" "\\\\")
05:52lazybot⇒ "\\"
05:52clgvyou have to string-escape and regexp-escape as well
05:53licenseryap it is a trickery with the replace
05:53licenserthe string ins't really a string
05:53licenserit is interpreted by java
05:53ejacksoneeep, meta-regexps, that's all we need on a Friday morning :)
05:53licenseryap
05:53licenser
05:53licenserhussa for java
05:54licensercan't have \ or $ in the return string
05:54licenser(clojure.string/replace "\\" #"\\" "$") same here
05:55licenseroh heck the last argument gets really evaluated and every \\ changed :(
06:35licenserthere we go http://dev.clojure.org/jira/browse/CLJ-870 :) the replace thing described and reprted
08:30raph_amiardHi there
08:30raph_amiardI just had an idea this morning, and was pondering how doable it would be
08:30raph_amiardhere it is: How difficult do you think it would be to do a Lua version of clojurescript ?
08:31raph_amiardi've been browsing the code for a few hours, and the main difficulty i see at the moment is regarding the dependency to google's closure compiler
08:31raph_amiardsince no equivalent exists for Lua
08:31raph_amiardtell me what you think
08:31carkwasn't the google closure compiler there only for optimisation, dead code analysis ?
08:33carki think it's very doable. But be carefull when basing your implementation on clojurescript
08:33carki believe the persitent datastructures thing isn't completely done yet (no structure sharing) ... tho i might be mistaken
08:34leo2007is clojure-project-root-file useless?
08:35raph_amiardcark: Ok thank you
08:35raph_amiardit would be nice if there was a way to decouple the code generation part from the global compiler logic
08:36raph_amiardbut i'm not familiar enough with cljs code yet to see how easily it can be done
08:36raph_amiardfrom what i see closure is also there for a few other facilities like requiring libraries and namespaces, but this can clearly be done another way for lua
08:37carkand minification
08:37raph_amiardOTOH i wonder how much performance do you loose when the result is not optimized by closure
08:42clgvleo2007: what do you mean?
08:48chouserraph_amiard: analysis and code generation are already separated in the ClojureScript compiler
08:48chouserone is analyze, the other emit
08:50clgvI just noticed that it would be really handy to have a shortcut to create a runtime symbol when writing macros, i.e. what the following helper function does: (defn runtime-symbol [compiletime-symbol] (list 'symbol (str compiletime-symbol)))
08:50clgvor is there something like that?
08:51chouserclgv `(blah blah '~compiletime-symbol)
08:51clgvchouser: it's a bit more complicated since I have the symbols in a map that I create at macro expansion time
08:52chouserclgv: the normal way to get a symbol from compile time through to runtime is by quoting it
08:52clgvlike: (let [m (create-map ...)] '(bla ~m ...))
08:52leo2007clgv: it is not used.
08:53clgvleo2007: what excatly is not used?
08:53clgvproject.clj?
08:53leo2007clojure-project-root-file
08:54clgvleo2007: if you do not mean project.clj - I dont know what file you are talking of
08:59clgvchouser: ok, I looked it up in core, the arglist in defn used (list 'quote (sigs fdecl))
09:02leo2007clgv: I mean the variable clojure-project-root-file is not used.
09:02leo2007not its value
09:03clgvleo2007: oh ok nvm. I didn't know there is such a variable
09:11cmaya0neewbie
09:12cmaya0#beginner
09:12_uliseswhat's the testing framework of choice in general?
09:12Iceland_jackghgj
09:12Iceland_jack`.
09:13_ulisesI'm currently using clojure.test and have used stuart sierra's lazytest in the past though
09:13_ulisesany recommendations?
09:14cmaya0exit
09:15stuartsierra_ulises: Check out clojure.test.generative as well.
09:15clgv_ulises: personally I also used clojure.test. I read some things about midje which sounded intersting but didnt have the time to try it yet
09:15_ulisesnever heard of clojure.test.generative, will check it out, thanks
09:15chouser_ulises: lazytest is my current favorite
09:16_ulisesI quite liked lazytest too
09:16_ulisesmaybe I should just use that
09:16chouserI haven't looked at test.generative yet either.
09:18_uliseshum, if I want to use lazytest I have to use clojure-1.3.x?
09:19chouserbut you already wanted to use clojure-1.3.x, so that's ok! :-)
09:19_ulisesdid I? :-o
09:19_uliseschouser: you must know something I don't...
09:19chouser_ulises: you thought you wanted to use a previous version of Clojure?
09:20_uliseswell, I am using 1.2.0 ... but that's probably due to historical reasons
09:20_ulisesnow I need to check whether the other libs I'm using are 1.3.x ready...
09:36_ulisesright, I'm on 1.3.0 + lazytest and the world is a safe place again
09:36_ulisesthanks for the help
09:43lnostdal"...checking for updates from central-proxy" .. waiting waiting .. it's stuck .. how do i get lein to not check for updates; at least the remote ones, as i already have this package locally
09:52gfrederickslnostdal: I think it does that for snapshots?
09:54gfredericks$google maven don't update snapshots
09:54lazybot[java - How can I get Maven to stop attempting to check for updates ...] http://stackoverflow.com/questions/1348603/how-can-i-get-maven-to-stop-attempting-to-check-for-updates-for-artifacts-from-a
10:00raph_amiard[5~[6~[6~[B
10:01raph_amiardchouser: Ok thanks, i'm gonna read quite a bit more code to understand the structure of the compiler better
10:02chouserraph_amiard: I'll be talking about it some next week
10:02raph_amiardchouser: Do you think the performance will take a big hit if there isn't a similar optimizing pass like google closure does ?
10:03raph_amiardchouser: cool ! you mean at conj ?
10:03chouserraph_amiard: gclosure does more code size reduction (and specifically dead code removal) than any other runtime performance improvements
10:03chouseryes, at the conj
10:04raph_amiardchouser: ok thank you very much, i'll look forward to that :)
10:04chousergclosure does do some inlining, but usually just when it thinks it will result in less code, having little or nothing to do with how fast it will run.
10:05chouserraph_amiard: out of curiosity, why do you want lua?
10:05raph_amiardok that's good news for me
10:05raph_amiardwell a few reasons :
10:06raph_amiard1. Lua as an amazing jit that is very small at the same time, that could unlock possibility to have a quite fast clojure runtime in some reduced ressources situations
10:06raph_amiard2. Lua semantics are quite close to those of javascript
10:07raph_amiard3. i'm very interrested in compilers so i thought it would be a cool project to work on :)
10:07raph_amiardvery interested but not very experimented so i thought working on a partially existing project would be a good way to learn
10:09chouserfair enough
10:09chouserI've thought python, ruby (for their libs), or C (for native compiled code) would be interesting targets.
10:10raph_amiardit's true that lua hasn't the most thriving ecosystem library wise
10:11raph_amiardI would be interrested in compilation to C, the runtime would probably be an interresting thing to work on
10:12cemerickchouser: straight to C, or -> scheme -> C?
10:12raph_amiardi wondered also, what is there left to work on on clojurescript itself ?
10:13lucianraph_amiard: full compat with clojure proper? :)
10:13TimMcraph_amiard: But I can run Lua on my camera... so there's that.
10:14TimMcI would love to script my camera in Clojure.
10:14raph_amiardlucian: is that even possible ? given the semantics of javascript (notably regarding numerics) it would imply a tremendous performance impact
10:14raph_amiardTimMc: Yeah i like the idea because lua runs everywhere too
10:14lucianraph_amiard: likely. i was mostly joking
10:15lucianraph_amiard: if js ever gets sane numbers (which it looks like it might), maybe
10:17lnostdalgfredericks, yeah, but my snapshots are stored locally; i work on git checkouts .. it tries to check for snapshots on remote servers (which is pointless to begin with in this case), and sometimes these servers are down and the timeout takes forever apparently
10:17lnostdalLrcrafter21
10:18lnostdalok, that was one of my passwords .....
10:19clgvlnostdal: not anymore, but seems not really secure anyway ;)
10:21TimMclnostdal: "Uh, I mean... stupid cat!"
10:21clgvI use (resolve 'f) to get a var - how do I get the fulqualified symbol from it?
10:21lnostdalx)
10:21TimMc"Always stepping on my keyboard and sending [A-Z][a-z]{5,}[0-9]{2} to IRC!"
10:22TimMcclgv: `
10:22TimMcOr wait, what are you asking?
10:22tomahello
10:23TimMc,(name (resolve `+))
10:23tomais there a way to get same Lisp-like backtraces in Clojure?
10:23clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Var cannot be cast to clojure.lang.Named>
10:23clgvTimMc: nope. I have the symbol in a binding ;)
10:23TimMctoma: What is a Lisp-like backtrace?
10:23clgv&(resolve 'inc)
10:23lazybotjava.lang.SecurityException: You tripped the alarm! resolve is bad!
10:23clgv,(resolve 'inc)
10:23clojurebot#'clojure.core/inc
10:24clgvthere is the var that has a field sym. but is there a function?
10:24clgv$findfn 'inc 'clojure.core/inc
10:24lazybot[]
10:26TimMcclgv: I suppose a var doesn't know its name.
10:26TimMcWait, that's wrong too.
10:26clgv,(.sym (resolve 'inc))
10:26clojurebotinc
10:27clgvI could get it indirectly via the mappings
10:28TimMc,(.ns (resolve 'inc))
10:28clojurebot#<Namespace clojure.core>
10:28clgvlol k.
10:29TimMc,(-> 'inc resolve .ns .name)
10:29clojurebotclojure.core
10:29clgvbut I just came to the conclusion that I can also only use 'str on it.
10:29clgvif the var prefix is annoying I can remove it ;)
10:31chousercemerick: either way
10:32cemerickHaving a portable host is nice.
10:35chouserThat's what C is, right?
10:37cemericknot once you start touching libraries
10:37raph_amiardchouser: is there a place where i can find areas that still need work in clojurescript ?
10:37raph_amiardI have the release plans page on the wiki
10:37toma@TimMc, something that is not as criptic as the Java Backtrace
10:38devnraph_amiard: i would take a peek at jira
10:38tomasomething like the stack of clojure invocations, and not the java stuff
10:38TimMcraph_amiard: shuffle would be nice
10:40clgvtoma: you can filter the stacktrace elements that contain clojure files
10:40tomaclgv: the thing is that my stacktrace contains no clojure files
10:41gfrederickshmmm...clj-http considers a 304 response to be exceptional. Is that good behavior?
10:41clgvtoma: how did that happen?
10:41tomano matter if I use load, compile or type in the repl directly, there's nothing showing up
10:41tomathere's just something that looks like a terribly ugly java backtrace
10:42clgvtoma: try that in the REPL (filter #(-?>> % .getFileName (re-matches #".*\.clj")) (.getStackTrace *e))
10:42TimMctoma: That's different.
10:42TimMcYou've got a broken development environment, and you need to fix it. gist the error message
10:42TimMc~paste
10:42clojurebotpaste is http://gist.github.com/
10:42clgvtoma: for a better print you can combine println and clojure.string/join
10:43jweissif you accidentally pass with-redefs a macro, it permanently disables that macro, even after with-redefs is done
10:44jweiss,(with-redefs [cond identity] (cond 1))
10:44clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: cond requires an even number of forms>
10:44clgv,(version)
10:44clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: version in this context, compiling:(NO_SOURCE_PATH:0)>
10:45clgv,(clojure-version)
10:45clojurebot"1.3.0"
10:45jweissok that's weird, it seems to overwrite my macros, maybe not ones in core
10:45_ulisesany reason why (doc...) in a swank session would fail with "Unable to resolve symbol: doc in this context" using clojure 1.3.0?
10:45chouserraph_amiard: not sure. There are tickets for some things.
10:45_ulises,(doc alter-var-root)
10:45clojurebot"([v f & args]); Atomically alters the root binding of var v by applying f to its current value plus any args"
10:45_ulisesgack
10:45jweiss_ulises: try (require 'clojure.repl)
10:46jweissit's no longer there by default
10:46jweisser sorry (use 'clojure.repl)
10:46_ulisesah, that did it
10:46_ulisesso ... ok, things have changed ...
10:47tomaclgv: user=> (load "cookies") java.lang.RuntimeException: java.lang.ClassCastException: Cannot cast clojure.lang.Agent to java.lang.Number (cookies.clj:1) user=> (filter #(-?>> % .getFileName (re-matches #".*\.clj")) (.getStackTrace *e)) user=> java.lang.Exception: Unable to resolve symbol: -?>> in this context (NO_SOURCE_FILE:2)
10:47tomaThis is a joke...
10:47jweisscan anyone else reproduce my with-redefs issue? i don't think i can do it with the bots
10:48jweisswhat i see is after with-redefs the macro is no longer a macro
10:49clgvtoma: oh sorry. put (:use [clojure.contrib.core :only (-?>>)]) in your ns statement or with (use ' [clojure.contrib.core :only (-?>>)]) in repl
10:49clgvtoma: it's not from clojure.core and I didnt spot it when copying ;)
10:50leo2007there seems to be a bug somewhere in swank-clojure see this: http://paste.pound-python.org/show/14715
10:50leo2007ideas?
10:53jweiss,(fn? (deref #'cond))
10:53clojurebottrue
10:53jweissobviously i am not using the right test to see if something is really a fn
10:53jweissi want to use something that gives false for macros
10:54cemerick,(:macro (meta #'cond))
10:54clojurebottrue
10:56chouserjweiss: I reproduced your with-redefs on macros
10:56jweiss,(map (fn [v] (and (fn? v) (not (:macro (meta v))))) [#'cond #'apply])
10:56clojurebot(false false)
10:56jweisschouser: is that a bug?
10:57jweiss,(map (fn [v] (and (fn? v) (not (:macro (meta v))))) [#'cond #'apply #'juxt])
10:57clojurebot(false false false)
10:58jweiss,(:macro (meta #'apply))
10:58clojurebotnil
10:59chouserjweiss: it would be better if it didn't do that.
10:59jweiss,(map (fn [v] (and (fn? (deref v)) (not (:macro (meta v))))) [#'cond #'apply #'juxt])
10:59clojurebot(false true true)
11:00chouserhuh. .bindRoot explicitly clears the macro flag
11:01chouserseems complected to me. :-)
11:01chouserwith-redefs-fn could use alter-var-root instead to avoid the problem.
11:02jweisschouser: i'm curious why my example with cond didn't do the same thing
11:03chousersorry, which example?
11:03jweiss,(with-redefs [cond identity] (cond 1))
11:03clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: cond requires an even number of forms>
11:04chouser,(:macro (meta #'cond))
11:04clojurebottrue
11:04chouser,(clojure-version)
11:04clojurebot"1.3.0"
11:05chouserjweiss: that exception is being thrown at macroexpand time
11:06chouserbefore the code generated by with-redefs has a chance to do anything to the var at all
11:06jweisschouser: ok, i don't want to break the bot here, probably good thing i didn't
11:07jweissi think (with-redefs [cond identity] (cond 1 2)) would have done it
11:07chouser,(alter-meta! #'cond assoc :macro true)
11:07clojurebot{:macro true, :ns #<Namespace clojure.core>, :name cond, :arglists ([& clauses]), :added "1.0", ...}
11:07chouser,(with-redefs [cond identity] (cond 1 2))
11:07clojurebot2
11:07chouser,(:macro (meta #'cond))
11:07clojurebotnil
11:07chouser,(cond 1 2)
11:07clojurebotnil
11:07chouserbroken
11:07chouser,(alter-meta! #'cond assoc :macro true)
11:08clojurebot{:macro true, :ns #<Namespace clojure.core>, :name cond, :arglists ([& clauses]), :added "1.0", ...}
11:08chouser(cond 1 2)
11:08chouser,(cond 1 2)
11:08clojurebot2
11:08chouserfixed. :-)
11:08jweissok at least just replacing the meta fixes it :)
11:08chouser,(alter-meta! #'cond assoc :added "2.0")
11:08clojurebot{:macro true, :ns #<Namespace clojure.core>, :name cond, :arglists ([& clauses]), :added "2.0", ...}
11:08chouserconfused.
11:21ThreeCupsI've got a (lazy) sequence of values. I want to iterate through the values passing each one to a predicate. As soon as the predicate returns true, I'd like my fn to return true. I know there's an awesome way to do this in clojure, I just can't seem to figure it out. The fn would be something like this
11:21ThreeCups(defn contains-any [xs f] "Returns true as soon as f(x) is true" ...)
11:23ThreeCupsUmm... I think I'm looking for (some)
11:23ThreeCups,(some #(= 4 %) [1 2 3 4])
11:23clojurebottrue
11:24ThreeCups,(some #(= 4 %) [1 2 3])
11:24clojurebotnil
11:24ThreeCupsIt's amazing how after asking a question, the answer becomes apparent :)
11:25babilenYeah, everybody should have a rubber duck on the desk
11:28jcromartieI just switched Emacs to use Myriad
11:28jcromartieproportional font FT_?
11:28jcromartieW or L to be determined
11:34TimMcThreeCups: ##(some #{4} [1 2 3 4])
11:34lazybotjava.lang.RuntimeException: Can't take value of a macro: #'sandbox6471/dot
11:34TimMcwut
11:34TimMc,(some #{4} [1 2 3 4])
11:34clojurebot4
11:35BorkdudeI am trying to get a clojure dev environment on a fresh Cocoa Emacs 24
11:36BorkdudeI used marmalade to get clojure-mode, slime etc
11:36BorkdudeWhen I do: slime-connect, it says: Symbol's value as variable is void: slime-clj
11:36BorkdudeAny help?
11:37clgv&(alter-meta! #'cond assoc :added "2.0")
11:37lazybotjava.lang.RuntimeException: Can't take value of a macro: #'sandbox6471/dot
11:43TimMcclgv: lazybot wouldn't allow that anyway, pretty sure
11:44clgvTimMc: yep that was my guess. but that exception is a bit strange ;)
11:44BorkdudeGuess I shouldn't have installed slime-clj or slime-fuzzy
11:45clgvI wonder if you can make a clojure sandbox were everything is allowed based on sessions with timeout
11:55clgvwhere has -?> from clojure.contrib.core gone in clojure 1.3?
11:58clgvah clojure.core.incubator
12:02ohpauleezIs there a shorter hand for something like this: (dissoc (assoc m new-key (m old-key)) old-key)
12:02ohpauleezI want to swap the key in a map
12:03ohpauleezAlso, hi everyone, I know I haven't been in here for awhile… heads down at a new startup writing clojure (I'm excited to share details at conj)
12:04ejacksonexciting !
12:05ohpauleezyes, I'm having a blast! (VP of Engineering) and we're hiring!
12:05ibdknoxohpauleez: threading will make it clearer, but that's about it
12:05ibdknoxohpauleez: what company?
12:06ohpauleezibdknox: Yeah, I was going to switch it over to thread but the repetition seemed a little weird to me
12:06ohpauleezTutorspree
12:06hiredmanhttp://clojure.github.com/clojure/clojure.set-api.html#clojure.set/rename-keys
12:07ohpauleez(the actually technology behind the scenes is intense- way fun and pretty ambitious)
12:07ibdknoxTutorspree uses clojure?
12:07ibdknoxinteresting
12:08ohpauleezYes, Clojure is used for all of machine learning/collective intelligence, emailing, messaging, and search services
12:08ohpauleezPython is used in some services
12:08ohpauleez(image resizing, CDN)
12:08ibdknoxI'll be interested to hear what you're doing with machine learning
12:09ohpauleezhiredman: thanks!
12:09TimMcohpauleez: Wow, cool company!
12:10ohpauleezibdknox: Given the 333 people in this channel, who's the best person to teach you Clojure? How about Physics? Who's the best person to ask for advice about starting a data company? … and how do your learning styles differ in all of those situations?
12:10TimMcI like that your jobs page talks about your technology stack and employee compensation.
12:10ohpauleezTimMc: Thanks!
12:11TimMcVery up-front.
12:11ohpauleezThat's the old stack (we need to update it)
12:12TimMcI don't see CLojure on that page!
12:12TimMcah
12:12ohpauleezthe new stack is Python, Clojure, Php, Mongo, Redis, RabbitMQ
12:12TimMcI assume that telecommuting is not an option...
12:12ohpauleezit totally is
12:13ohpauleezgiven the candidate (we have one employee in Virginia)
12:13TimMcnice
12:13chewbrancaohpauleez: out of curiousity, whta are you guys using for machine learning in clojure? custom libs or existing tools?
12:13lucianohpauleez: i guess not non-US though?
12:14ohpauleezchewbranca: Some hand rolled, a lot of mahout
12:14chewbrancaohpauleez: ahhh cool
12:14ohpauleezlucian: I'd have to talk to people in charge of hiring, no idea
12:15lucianohpauleez: ok. it does sound interesting (i'm a python dev learning clojure)
12:16ibdknoxI'm a Clojure dev forgetting python :D
12:16ohpauleezlucian: Awesome, welcome! I made the transition a few years ago. I couldn't be happier
12:16lucianibdknox: i'd have a hard time forgetting python, in some ways it still is superior
12:16ibdknoxlucian: oh?
12:16drewrI still use python a lot for quick execution time
12:17ohpauleezand the war begins… gentleman, here are your flamethrowers
12:17ohpauleez:)
12:17ibdknoxhaha, no I'm mostly just curious
12:17theignoratiis (with-out-str (print-dup data *out*)) a good way of transforming data into a string for a cache like memcached or is there a more efficient way?
12:17lucianibdknox: ignoring all matters of homoiconicity, i still find python's syntax nicer
12:17lucianohpauleez: i like both anyway
12:17hiredman~python
12:17clojurebotpython is ugly
12:18ibdknoxlucian: ah, that is purely personal preference and what you "grew up" with. I can buy that.
12:18theignorati~perl
12:18clojurebotexcusez-moi
12:18theignoratio
12:18tnkspython's syntax is fine. . . but their lambda-support is pretty replete.
12:18lucianibdknox: or rather, i'm not yet convinced that indentation-sensitive syntax is incompatible with homoiconicity
12:18dnolenohpauleez: clojure.set/rename-keys if someone didn't already mention that.
12:18TimMctnks: replete with what?
12:18luciantnks: yeah, i like CoffeeScript's take on uit
12:19ibdknoxhaha
12:19ohpauleezdnolen: yeah, hiredman linked me to it. Thanks man.
12:19ibdknox$dict replete
12:19lazybotibdknox: adjective: Abundantly supplied; abounding: a stream replete with trout; an apartment replete with Empire furniture.
12:20ibdknox:)
12:20tnksTimMc: I agree with Python's restriction that lambdas should only be expressions, but if I recall (it's been a while), they syntactic constraints were too strong.
12:20ibdknoxSo as TimMc said, replete with what?
12:20tnksTimMc: no variable setting in a Python lambda, right?
12:20TimMcNo idea.
12:20tnksGuido's response was to just use named functions all the time.
12:21tnksso his anonymous functions are way basic.
12:21luciantnks: to be fair, in python the need is less strong than in JS or lisps
12:21lucianbut i would much prefer def to be an expression as well
12:21tnkslucian: that's not a good argument.
12:21tnksPython is a dynamically type-checked language, just like them all.
12:22luciantnks: sure. i'd like f = def(a, b): ...
12:22tnksPython's strengths are it's library support. . . SciPy and NumPy are strong.
12:22juhu_chapaHi guys! What do you think about the inclusion of lambda expressions on java 8?
12:23lucianjuhu_chapa: i think it's unlikely to affect clojure much, if at all
12:23chousertheignorati: no, that's not good. Not even correct, I'm afraid.
12:23tnksjuhu_chapa: what kind of reaction were you expecting?
12:23chousertheignorati: use this instead: (binding [*print-dup* true] (pr-str data))
12:24tnksthe only hope I'd have would be for cross-JVM-language lambda support, if that's possible.
12:24chousernot sure how efficient that is, but it should be correct, anyway.
12:24tnksbut I'm not holding out for that.
12:24hiredmanI would see if you can get bye with just pr-str
12:25hiredman*print-dup* is verbose and isn't actually always correct
12:25chouserhiredman: oh really?
12:25hiredmanI know I've seen it generate calls to 'create' static methods for classes that didn't have it in 1.2
12:26hiredmanmaybe for map entries
12:26chouserew
12:28juhu_chapatnks: I like clojure, I am just curious if clojure will take the new native support on jvm to improve itself.
12:28chouserhiredman: those would be worth ticketing, I would think.
12:28hiredman,(binding [*print-dup* true] (pr-str (first {:a 1})))
12:28clojurebot"#=(clojure.lang.MapEntry/create [:a 1])"
12:28hiredmanyeah, well, I was busy
12:29chouserheh
12:29hiredman,(clojure.lang.MapEntry/create [:a 1])
12:29clojurebot#<CompilerException java.lang.IllegalArgumentException: No matching method: create, compiling:(NO_SOURCE_PATH:0)>
12:29tnksjuhu_chapa: yeah, but isn't Clojure even slow to care about invokedynamic?
12:29hiredmanactually, I almost feel like I've seen a ticket for this
12:29tnksI wonder if there will be the same attitude about other new JVM features.
12:30theignoratihiredman how would I use pr-str only if I need to send the data to a cache though
12:31hiredmanhttp://dev.clojure.org/jira/browse/CLJ-761
12:31hiredmantheignorati: it depends on how much information you want to keep about the original structure
12:32hiredman*print-dup* tries to preserve as much as possible
12:32stuarthallowaytnks: features have costs and benefits, and are incorporated when somebody establishes the benefits win, and is willing to do the work
12:34chouserhiredman: thanks.
12:35theignoratiok I don't need things like metadata
12:37TimMcstuarthalloway: When Clojure code is distributed as source, I suppose the compiler can choose (based on current JVM) what features to avail itself of?
12:38stuarthallowayTimMc: in principle, for the parts writtein in Clojure
12:38stuarthallowayI am working on something like that right now, to detect and use Joda
12:38stuarthallowaywhich isn't even a Java feature, but the idea is the same
12:42TimMcnice
12:42TimMcI like the idea of distributing programs as source anyway.
12:42TimMc...but this just puts the icing on it.
12:45tnksstuarthalloway: I agree. . . just commenting on the state of the my perception of the community's perception of return on investment.
12:46stuarthallowaytnks: don't think we have any good measure on what the community thinks
12:47TimMcSo AOT has to rely on the least common denominator of JVM features.
12:47stuarthallowayTimMc: no
12:47TimMcReally?
12:47stuarthallowayjust the work to conditionalize it is different
12:47TimMcew
12:47stuarthallowayI am AOTing the Joda stuff
12:47TimMcDidn't know that was even possible.
12:47stuarthallowayif you don't have it, and don't ask for it, you will be fine
12:48stuarthallowaydynamic linking is powerful
12:49TimMcFancy.
12:52tnksstuarthalloway: are you talking about a Joda.org project?
12:52stuarthallowayhttp://joda-time.sourceforge.net/quickstart.html
12:52tnksokay, I'm coming into this conversation half-way, catching up.
12:55tnksyeah, scrolled up a little, but didn't figure it out; something about AOTing code distributed as source and Joda Time.
12:56tnksI missed the connection of the Joda project to AOTing.
12:56tnks(unless that's the project that's being compiled)
12:57stuarthallowaytnks: code that uses Joda
12:57stuarthallowaytnks: since all of Clojure's clj currently is AOT compiled, I am allowing it for consistency
12:57stuarthallowayand for anyone who relies on it
13:00tnksstuarthalloway: got it, thanks.
14:16arohneribdknox: if I have a pre-route of "/user/*", is there a way to parse the * out of that?
14:16arohneror some other way to make a pre-route match "/user/:username"?
14:17ibdknoxarohner, the latter should work
14:17ibdknoxarohner, I think you can get the * too, but can't remember what compojure does with that off the top of my head
14:17arohnerI'm getting nil for :username when I try that
14:18ibdknoxyeah, you're given the whole req in pre-routes
14:18ibdknoxneed to get params then :username
14:20arohneribdknox: that works, thanks
14:21ibdknoxarohner, np, btw there's a #noir channel now too if you ever want to chat more about it :)
14:23seancorfieldi'm hoping to have FW/1 up and running (on Clojure) soon
14:23seancorfieldthen we can have a battle of the web frameworks :)
14:24Raynesseancorfield: He will win. He has me.
14:24seancorfieldlol
14:24seancorfieldit'll take me a good long while to get all of FW/1's functionality ported from CFML to Clojure
14:24seancorfieldand I don't have a fancy website for it - just a github wiki :(
14:25seancorfieldbut last night i got the template view stuff working to my satisfaction
14:26ibdknoxoo what's FW/1?
14:26seancorfieldFramework One - a lightweight convention-based MVC framework i wrote for CFML over the last two years
14:27seancorfieldi started a port to Clojure back in June but got bogged down with Enlive
14:27ibdknoxcool
14:27seancorfieldafter chatting to cemerick at strange loop, i figured out how to move forward
14:29ibdknoxI look forward to seeing it! :)
14:30ejacksonany chance of taking a look at the conj ?
14:30seancorfieldthe cfml version is documented here https://github.com/seancorfield/fw1/wiki
14:31seancorfieldthe difference in the clojure version will be that views (and layouts) will be plain html and it'll rely on enlive to inject dynamic data via a controller method
14:32seancorfieldbut otherwise i think i can make all of it work nearly identically
14:32seancorfieldand i have a strong community of CFers using FW/1 so I'll be able to drag some of them over to Clojure on the strength of a FW/1 port i think...
14:33technomancy(defn map-map [m k-fn v-fn] (zipmap (map k-fn (keys m)) (map v-fn (vals m)))) ; <- someone's already implemented that, right?
14:33technomancyI mean like it's in contrib or something but for some reason hasn't been promoted?
14:33seancorfield~8,000 downloads and ~450 users on the mailing list... lots of potential new clojure users! :)
14:33clojurebotThat is the one thing Clojure can not do.
14:34ibdknoxlol
14:34technomancyI wonder if it should go in incubator
14:35technomancythere's not really much in incubator
14:35seancorfieldthere's a bunch of useful still in old contrib that should go in core.incubator imo
14:35seancorfieldbut my opinion's not worth much :)
14:35amalloytechnomancy: no offense but i hope it doesn't. mapping over maps is something that should usually be discouraged, and isn't hard to hand-roll when you need it anyway
14:36technomancyamalloy: happens a lot when you are accepting command-line args
14:36technomancyyou want to keywordize your {:as opts} map
14:36amalloytechnomancy: clojure.walk/keywordize-keys?
14:37technomancyo rly?
14:37ibdknox,(doc clojure.walk/keywordize-keys)
14:37clojurebotTitim gan éirí ort.
14:37seancorfieldheh, wish i'd known about that...
14:37amalloy,(require 'clojure.walk)
14:37clojurebotnil
14:37ibdknox,(doc clojure.walk/keywordize-keys)
14:37clojurebot"([m]); Recursively transforms all map keys from strings to keywords."
14:37technomancymostly I just feel like zipmap is too low-level; every single time I use it I really am just reimplementing map-map
14:37amalloyincidentally i think i just added something to useful that gets you halfway there, technomancy
14:38seancorfieldmind you, i need keywordize-keys with lowercasing and i also need stringize-keys with uppercasing
14:38amalloy(into {} (map (collude kfn vfn) m))
14:38technomancyI heard we weren't supposed to use clojure.walk anyway =)
14:38seancorfieldcollude?
14:39amalloyseancorfield: <amalloy> incidentally i think i just added something to useful that gets you halfway there ;; it was collude, though name and API haven't settled yet
14:39amalloyi think we decided to call it knit instead? it's a sibling to juxt
14:40seancorfieldwill it work on arbitrary vector elements or just pairs?
14:40amalloyany size
14:41seancorfieldnice
14:41seancorfieldfor one of the standard contribs?
14:41amalloyseancorfield: https://github.com/flatland/useful
14:41amalloyi'm not really interested in being bogged down by jira and all the other process surrounding contrib
14:42stuartsierratechnomancy: I harped on that a little too strongly.
14:42seancorfieldah yes, the useful library...
14:42seancorfieldit's... useful :)
14:42hiredmanneeds unrolling to a million arities
14:43stuartsierraamalloy: Other than JIRA, what are the blockers for you?
14:44amalloystuartsierra: not allowed to take pull requests, required CA. have to use maven instead of cake/lein (i think?)
14:44RaynesAll of those things plus another one on top. Don't know what it is yet, but I'll think of it.
14:44stuartsierraWell, we're not going to be able to change the CA any time soon. That's kind of the defining feature of contrib.
14:45amalloyyep. i realize those are useful requirements for contrib
14:45amalloybut i don't have any compelling reason to put my own libraries in contrib, so...
14:45ibdknoxhaving to use maven is a bit annoying
14:45RaynesWe don't really think less of contrib for it -- we just don't really want that process for our libraries.
14:45stuartsierraMaven isn't forever, just happened to be the best choice at the time.
14:46stuartsierraLein has been improving in the area of deployment, so it might be an adequate replacement before long.
14:46ibdknoxthat being said, I think a lot of libs *shouldn't* be contrib libs
14:46stuartsierraThat's cool too.
14:46Raynesstuartsierra: Can I use a picture of you in my talk?
14:47stuartsierrayes
14:47RaynesExcellent.
14:47stuartsierraFair is fair.
14:47ibdknoxthough I think we should be better about informing the community of libs that exist, whether they be contrib or otherwise
14:48stuartsierraThat's a big messy problem that will take time to solv.
14:48ibdknoxstuartsierra, absolutely
14:48ibdknoxit's worth solving though, I think
14:48stuartsierratotally
14:49technomancyintegrating clojuresphere features into clojars would be a big leap in that direction
14:49Raynestechnomancy: +1
14:49ibdknoxyeah
14:49ibdknoxwho maintains clojars? is it you technomancy?
14:49technomancyibdknox: close enough
14:50technomancyibdknox: technically it's _ato, but he's not around much
14:50technomancyI have a branch that makes it a lot easier to hack on that I need to merge in
14:50technomancyright now it's pretty rube-goldberg
14:51amalloytechnomancy: there. https://github.com/flatland/useful/commit/4d74158#L1R50 now behaves the way i claimed it would :P
14:52technomancyhuh; cool
14:52ibdknoxtechnomancy, yeah, it's a little haphazard looking
14:52technomancyibdknox: maybe by the conj I can get it tidied up
14:54ibdknoxtechnomancy, cool. Maybe this can be a project I tackle in the near future
14:54ibdknoxI should make my todo-list public
14:54ibdknoxhaha
14:54ibdknoxand then let people vote on them :D
14:55amalloyibdknox: r--rw-rw- plz
14:55gfredericksibdknox: should we vote on the "make my todo-list public" item first?
14:55ibdknoxhaha
14:55ibdknoxgfredericks, yes
14:55amalloyi guess r-xrw-rw- is more appropriate
14:55ibdknoxamalloy, darn, I thought I was going to get away with doing no work ;)
14:55amalloy*chuckle*
14:56ibdknoxyou know, it's kind of a neat idea
14:56ibdknoxI may actually do that
14:56ibdknoxit'd be a good way to see what people care about
14:58gfredericksI'm going to just demand that the todo-list be integrated with every social site I can find
14:59ibdknoxlol
14:59gfredericksI should be able to log in with my arbitrary combinations of identities
14:59gfrederickss/my //
15:01technomancythere aren't any clojure-aware loc-count programs that don't penalize you for docstrings, are there?
15:02ibdknoxare there even any clojure-aware loc-count programs?
15:03technomancysorta
15:03cemerickwho counts loc?
15:03technomancyat least, you can trick sloccount into doing it, but I think it treats it as CL
15:03technomancycemerick: for, uh... bragging rights?
15:03cemerickheh
15:03ibdknoxduh
15:03cemerickyeah, shoulda thought of that
15:03cemerickI want to get paid by the loc, too.
15:04ibdknoxI wrote 100,000 lines. (each char on a different line)
15:04TimMcIs there any mechanism for manipulating surface syntax? e.g. leaving #() intact, etc.
15:04technomancythe other problem is that even if you don't get penalized for docstrings themselves, adding docstrings forces you to put your arglist on a new line
15:04technomancythat always bothered me
15:04TimMccemerick: You will be paid for every line you can delete (and still have tests pass.)
15:04cemerickTimMc: not if you're using the reader
15:04technomancyTimMc: that's what I'm talking about
15:05technomancyon the other hand, deleting code is so much fun that you don't really need extra incentive
15:05TimMctechnomancy: Right. It just occurred to me that in Clojure you don't work directly with the AST -- you're just closer than in braces languages.
15:05cemerickTimMc: not sure what you're up to, but parsely might help you (ccw uses it)
15:06TimMccemerick: Oh, just thinking about measuring number of forms, things like that -- alternatives to line count.
15:06cemerickah
15:06TimMcCode golf.
15:06cemerickseems like you should get tagged for reader sugar in such cases
15:07technomancyTimMc: https://github.com/pjstadig/procrustes exists but is pretty rudimentary
15:07cemerickstill the same number of "function points" to use another mostly-silly term
15:07TimMcSomething that turned #(a b c) into (# a b c) would be fine for that purpose.
15:07TimMcgood name
15:13abrooks~ seen rhickey
15:13clojurebotNo entiendo
15:13abrooks~seen rhickey
15:13clojurebotIt's greek to me.
15:13abrooksClearly I'm doing it wrong...
15:15Raynes$seen rhicky
15:15lazybotI have never seen rhicky.
15:15RaynesI'm not sure that plugin still works.
15:15ibdknox$seen ibdknox
15:15lazybotibdknox was last seen talking on #clojure 27 milliseconds ago.
15:16RaynesHuh. I guess it does work.
15:16RaynesNifty.
15:16seancorfield$seen rhickey
15:16lazybotrhickey was last seen quitting 3 weeks ago.
15:16clojurebotCool story bro.
15:16seancorfieldsay it's not true - rich never quits! :)
15:17RaynesOh. I guess it works better if I spell his name right.
15:19TimMc~guards
15:19clojurebotSEIZE HIM!
15:19amalloyTimMc: you do work with the AST. you just don't work with the lexer
15:20amalloysorta. maybe that's not true. but having (fn* [] (gensym)) be the AST for #(gensym) seems reasonable to me
15:21gfredericksyeah it's not going to distort counts too much
15:21amalloygfredericks: it only distorts counts at all if you define your counts in such a way that you think that's a distortion...?
15:22TimMcbingo
15:22gfredericksamalloy: yeps
15:22TimMcIt doesn't count form.
15:22TimMc*forms
15:23TimMc,#(#(#(#(#()))))
15:23clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Nested #()s are not allowed>
15:23TimMcOh, right.
15:23gfredericks,(count (read-string "`````e"))
15:23clojurebot2
15:23gfredericks,(count (flatten (read-string "`````e")))
15:23clojurebot1202
15:23TimMcaugh
15:24gfredericksthats probably the only weird case
15:24amalloyheh, that one i can sympathize with
15:24gfredericksbut `````e in your code is not recommended in most cases
15:24TimMc,`````e
15:24clojurebot(clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/seq)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/concat)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/list)) (clojure.core/list (clojure.core/seq #))))) (clojure.core/list (clojure.core/seq (clojure.core/concat (clo...
15:24stuartsierra,(let [a (atom 0)] (clojure.walk/postwalk (fn [x] (swap! a inc) x) '(dotimes [i 5] (println "Hello"))) @a)
15:24clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.walk>
15:24Raynes&``````e
15:24lazybot⇒ (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/seq)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/concat)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/li... failed to gist: Connection reset
15:25RaynesHah. Huge.
15:25stuartsierra,(require 'clojure.walk)
15:25clojurebotnil
15:25stuartsierra,(let [a (atom 0)] (clojure.walk/postwalk (fn [x] (swap! a inc) x) '(dotimes [i 5] (println "Hello"))) @a)
15:25clojurebot8
15:25gfredericksRaynes: if you use seven backticks the reader will blow the stack
15:25TimMc,```````e
15:25clojurebot#<CompilerException java.lang.StackOverflowError, compiling:(NO_SOURCE_PATH:0)>
15:26ibdknoxwoah
15:26ibdknoxwhat's this that I'm seeing about a time literal?
15:26stuartsierraStu & Rich have been discussing it.
15:26TimMc"If you do X, bad thing Y will happen!" "Oh, let me try that..."
15:26stuartsierra(Stu Halloway that is.)
15:26gfredericksstuartsierra: are there any other languages with such a thing?
15:27stuartsierradunno
15:27ibdknoxnot any common ones
15:27gfredericksI think it sounds cool
15:27amalloyC++11x, i think?
15:27ibdknoxsounds like s slope to me
15:27ibdknoxa*
15:27amalloyer, C++11 and/or C++0x. probably not both :P
15:27cemerickibdknox: slope to doom?
15:27cemerick:-P
15:27ibdknoxcemerick, yes.
15:27cemerickYeah, I think I agree.
15:28ibdknoxwhy is ms not good enough?
15:28ibdknoxif we're going to talk about a portable time format
15:28ibdknoxwe should be talking a number
15:28stuartsierraportable, but not human-readable
15:28amalloyi'd rather open up the reader so that i can add my own time literal
15:29amalloyor, anyway, so that other people can. i don't especially want one
15:29ibdknoxstuartsierra, sure, but the argument seems to be aimed at being able to serialize?
15:29TimMcProposal: Measure everything in beats: http://www.timeanddate.com/time/internettime.html
15:31stuartsierraMeasure in flamewars.
15:32TimMcAlso, I'll open a JIRA to discuss the implications of Time Cube: Cubic Creation of 4 corner
15:32TimMcseparate simultaneous 24
15:32TimMchour Days within 1 Earth
15:32TimMcrotation
15:32TimMcugh, why did he have line breaks in there
15:34technomancyURL literals; hm. I could warm up to the idea.
15:35wastreltime cube
15:35RaynesWe totally need Swing literals. A literal for every class.
15:36ibdknox:(
15:36TimMcemoticon literals
15:37RaynesOh, yes.
15:37amalloy&:P
15:37lazybot⇒ :P
15:37amalloyi think we already have those
15:38TimMc&;-) ; :-(
15:38lazybotjava.lang.RuntimeException: EOF while reading
15:38stuartsierraProgrammers are literal enough, they don't need to be made more literal.
15:48gfredericks|8] is almost a literal :/
15:49Raynes&[8]
15:49lazybot⇒ [8]
15:49RaynesClose enough.
15:50stuartsierraI wonder why people who want reader macros don't just write ordinary macros?
15:51stuartsierraOr even #=()
15:51gfredericksstuartsierra: reader macros stick out more?
15:51stuartsierraI guess
15:51amalloystuartsierra: i agree that's often sufficient. but the same argument applies to #(foo %)
15:51stuartsierrayeah
15:51stuartsierrasave 2 characters, save the world
15:52amalloystuartsierra: and especially, reader macros don't have to be otherwise-valid sexps
15:52stuartsierrayeah
15:53amalloyeg, i couldn't write a (date 11/4/11) macro
15:53RaynesYou save characters proportional to the number of arguments your fn takes. :D
15:53stuartsierraBut you could write (date "11/4/11")
15:53amalloy*wince*
15:53gfredericks#{4 5 6} is nicer than (hash-map 4 5 6) partly because it looks like a data structure rather than a function call
15:53stuartsierraactually, I'm not sure if the compiler allows that
15:53amalloystuartsierra: it does
15:53stuartsierraok
15:55cemerickman, we're gonna be in line-noise territory shortly
15:56stuartsierracemerick: You're talking to the guy who embedded Perl in Common Lisp.
15:56Raynescemerick: Perljure.
15:56stuartsierraThe Common Lisp crowd still hasn't forgiven me.
15:56cemerickstuartsierra: Sounds ghastly.
15:57amalloyit's pretty cool that CL has a package with reader macros for regexes that parse/read as functions
15:57cemerickActually, CL is already sorta line noise if you're looking at a lib with comprehensive conditional evaluation macro usage.
15:57stuartsierracemerick: absolutely
15:57duck1123perl in lisp, for code that's so unreadable, it collapses in on itself
15:57stuartsierra+this -that +(something else)
15:57stuartsierraAs bad as #ifdef in C
15:58amalloyugh yes
15:58cemerick2014 Clojure: #@2010-12-18 #&http://apple.com #~127.0.0.1
15:58stuartsierra#+CLR #-JVM #+JS
15:58cemerickcemerick, spreader of fud
15:58amalloycemerick: don't forget @#&http://google.com to slurp
15:59cemerickstuartsierra: disaster
15:59stuartsierraI really want something better than read-time conditionals. But I don't know what it is.
16:00cemerickSometimes doing nothing is the better thing.
16:02seancorfieldi'm not entirely sure how the proposal for read-time conditionals would help the jvm/clr ports...?
16:03seancorfieldhow would you ensure implementations defined the right features anyway?
16:03stuartsierraI think it would have to be coarser than features: just one conditional symbol per platform.
16:03seancorfield(cond #+:jvm (do-java-stuff) #+:clr (do-clr-stuff)) ???
16:03lazybotseancorfield: Yes, 100% for sure.
16:04stuartsierraseancorfield: yes, but without the cond
16:04stuartsierrado-java-stuff would only be read on JVM platforms, do-clr-stuff would only be read on CLR platfroms.
16:04seancorfieldoh... so #+:something foo would yield foo if :something was defined?
16:04stuartsierrayes
16:04stuartsierraand be ignored otherwise
16:05seancorfieldand what would those "features" actually be represented by in the code?
16:05stuartsierradunon
16:05stuartsierradunon
16:05stuartsierraerg
16:05stuartsierradon't know
16:05seancorfieldthe link to the CL stuff indicates keywords
16:05stuartsierrathat's a likely candidate
16:05seancorfieldso some magic keywords would exist on each platform?
16:06stuartsierrayep
16:06stuartsierraActually, each platform would have a reader that recognizes certain magic keywords.
16:06hiredmanif the reader could just do clojure datatypes, then you wouldn't need readtime conditionals
16:06seancorfieldand ignores ones it doesn't recognize...
16:07seancorfieldstill makes me shudder... memories of C / C++...
16:07stuartsierrahiredman: You mean deftypes?
16:07hiredmanI mean clojure datatypes, symbols, maps, vectors, lists, sets, keywords, etc
16:08hiredmanparts of the reader do stuff like resolve classes, etc, instead of passing through symbols
16:08stuartsierraoh I see
16:08hiredmanbut, I dunno, that ship has sailed
16:08stuartsierrano, the reader does not do name resolution
16:08hiredmanit does some
16:08stuartsierra,(read-string "java.lang.doesNotExist")
16:08clojurebotjava.lang.doesNotExist
16:09stuartsierra,(read-string "this-namespace/does-not-exist")
16:09clojurebotthis-namespace/does-not-exist
16:10stuartsierraThe only time I can think of where the reader does name resolution is syntax-quote and #+()
16:10stuartsierra,(read-string "`foo")
16:10clojurebot(quote sandbox/foo)
16:10hiredmanright
16:10hiredman#+() ?
16:10stuartsierraI meant #=() not #+()
16:10hiredmanright
16:11hiredmansyntax quote could be rewritten as a macro to get it out of the reader
16:11stuartsierrayeah, that might be a good idea in general
16:11stuartsierraI've always thought it was a bit odd.
16:11hiredmanyes
16:12hiredmanwell, the reader code for it is very gnarly
16:22Raynesmefesto: I need your real name. I want to credit you for awesome JS in tryclj.com in my talk at the conj, but I don't know your name. :<
16:27TimMc,(class (read-string "java.lang.Foo"))
16:27clojurebotclojure.lang.Symbol
16:28TimMcmlimotte: What are you up to with classloaders?
16:30mlimotte@TimMc I need to add a JAR, but it's running in a context in which I can't change the original class-path. The job is started by a separate mechanism.
16:30mefestoRaynes: that JS isn't too awesome but thanks! :)
16:30mefestoRaynes: Allen Johnson
16:38technomancyso scala's literal XML support is widely regarded as a mistake
16:38cemerickyes. Of catastrophic proportions.
16:38technomancydoes anyone know the reasoning behind that and whether the same logic would apply to literal instants or URLs?
16:38TimMcWhy, did they make the mistake of actually making people use brackets?
16:39TimMcxexprs
16:39cemericktechnomancy: fogus would know, he was apparently deep in scala when that went in
16:39ibdknoxI just fundamentally don't understand this
16:39ibdknoxwhy?
16:39clojurebotibdknox: because you can't handle the truth!
16:39ibdknoxwhy do this at all?
16:40cemerickinstants and URLs are likely more…durable concepts than XML though.
16:40ibdknoxI'm also not sure why Rich continually says "this is not a place for opinion"
16:40technomancyit would make a _lot_ more sense to wait till the fate of JSR 310 is decided.
16:40TimMc<(><juxt><identity/><inc/></juxt><lit>5</lit></(>
16:40ibdknoxthen why have the fucking list?
16:40cemerickibdknox: certainly seems like a ton of trouble for not much in return
16:41technomancyibdknox: the list is for ex cathedra pronouncements, obvs: http://p.hagelb.org/pharaoh.jpg =)
16:41ibdknoxtechnomancy, lol
16:42ibdknoxthe fact that most of the opinions voiced by those not in core are against it should be a sign
16:42cemerickibdknox: huh, hadn't seen that msg yet :-(
16:46TimMclink?
16:46clojurebotyour link is dead
16:46ibdknoxI wish it was understood that the point at which you have ambitions for a wide audience, the thing you build is no longer yours.. it's the audience's.
16:46hiredman~botsnack
16:46clojurebotThanks! Can I have chocolate next time
16:46amalloyTimMc: http://groups.google.com/group/clojure-dev/browse_thread/thread/940c4225b439367e/caeaa290d4991515?show_docid=caeaa290d4991515
16:46hiredman~botsmack
16:46clojurebotOwww!
16:46technomancyhiredman: ok, now I believe you
16:46hiredman:)
16:47technomancyif I want to embed exceptions in a pr-str'd Clojure code... is my best bet really to base64-encode from java.io.Serializable serialization?
16:48technomancyclj-stacktrace can turn them into maps but not back
16:48Raynesmefesto: Cool.
16:49hiredmanor consider switching whole hog to java serialization
16:49technomancy=\
16:50technomancyor add reconstructing Exceptions to clj-stacktrace I guess
16:55hiredmanrich should really just throw open the door to reader macros, and then clojure/core can publish a blessed set of the same
16:58technomancyuuuuuuuuuuuugh data.codec sets warn-on-reflection
16:58technomancywtf
16:58cemericktechnomancy: A quick pull request'll fix that.
16:58technomancywill it?
16:58cemerickgoodness, no.
16:58technomancyit's a contrib
16:58cemerickSorry for getting your hopes up. :-P
16:58amalloycemerick: ended up all wet?
16:58cemerickapparently
16:58ibdknoxlol
16:58technomancyyeah I don't know why I believed that for half a second.
16:58technomancyApache Software Foundation to the rescue!
16:58technomancynever thought I'd be saying _that_ un-ironically =)
16:58ibdknoxlol
16:58amalloytechnomancy: good news though, the last w-o-r jira issue was released in just a month or two
16:58technomancyamalloy: was that tools.namespace?
16:58amalloyyeah
16:58stuartsierramea culpa
16:58amalloythat's the one i'm referring to, anyway. don't know if it was actually the most recent one
16:59cemerickhiredman: I had the same thought, but oh well.
16:59amalloyhiredman: i think i'd like that, but i'm willing to believe that open reader macros would decrease general readability
17:00amalloyit just seems silly to not open reader macros *and* add a reader macro for instants
17:00cemerickI don't think 5 people writing reader macros would make things any better/worse than N people writing reader macros.
17:01hiredman"feedback wanted" "..." "denied!"
17:01danlarkinI hereby come out against instant literals
17:01danlarkinnote the time and date!
17:01hiredman"Let's avoid another opinion-fest."
17:01hiredmanugh, come on rich
17:01fliebelMeh, I think we're nearing the end. Unless we're going APL, we are pushing the limits of ASCII, this one is already codenamed curse-whatever.
17:03technomancydanlarkin: UTC or EDT?
17:03technomancydanlarkin: seconds, milliseconds, or nanoseconds?
17:03danlarkintechnomancy: UTC-8
17:03danlarkinpitcairn islands
17:03danlarkin:p
17:03technomancyYESSSS
17:03technomancybest timezone evar
17:04fliebelw-wait, what if we designate #@ as user-reader-macro prefix :(
17:05technomancyanyone care to golf this further? http://p.hagelb.org/serializable-throw.html
17:06amalloytechnomancy: don't need the let
17:07technomancyamalloy: also it doesn't even work. I'm dumb
17:07amalloynice
17:08fliebeltechnomancy: What does it do? return a throw statement for byte arrays?
17:09technomancyfliebel: return a throw call that can be serialized with pr-str
17:10technomancyshould work if you refresh
17:11technomancypretty gnarly, but as long as you never manually inspect the pr-str output it's not bad
17:11goodieboyI'm experimenting with clojure.walk, and I can't seem to figure out how to make this work: https://gist.github.com/1340490
17:11goodieboyI don't want that double wrapped list (2nd item in the root)
17:12goodieboyhow can I "apply" the map to the parent list instead of returning a list of lists?
17:14amalloy(-> (ByteArrayOutputStream.) (doto (-> (ObjectOutputStream.) (.writeObject x))) (->> (.toByteArray) (.encode (Base64.)) (String.))) ; technomancy: lol?
17:14technomancyamalloy: dang
17:14technomancyI guess I didn't mean actual golf, but that's not bad =)
17:14amalloytechnomancy: it's probably longer than the version with a let
17:14RaynesPet peeve: when people do things like (-> (ByteArrayOutputStream.))
17:15technomancypeople do that?
17:15RaynesSometimes.
17:15RaynesI think you've done that. I seem to recall it in sherlock. I might be wrong.
17:15danlarkinno one good does that
17:15ibdknoxlol
17:15danlarkinbad coders write bad code
17:15TimMcThat does not support your point.
17:16danlarkinthat is my tautology of the day
17:16danlarkinTimMc: haha true
17:17goodieboymaybe it's not possible to unwrap the list into the parent using walk? hmm.
17:18amalloybut i do enjoy the mental exercise of converting lets into horrible mazes of doto/->/->>
17:18stuartsierragoodieboy: clojure.walk cannot splice
17:19technomancyamalloy: clojure-refactoring can automate that IIRC
17:19stuartsierraunless you modify the other list
17:19technomancybut where's the fun?
17:19amalloytechnomancy: even doto?
17:19technomancyprobably not doto
17:19goodieboystuartsierra: you mean afterward?
17:19stuartsierrayes
17:19amalloythat's the fun part
17:21technomancystuartsierra: is there any particular reason thrown? is part of the clojure.test/is macro rather than being its own defmacro?
17:21goodieboystuartsierra: ok i see. So if i have cases like this, but nested even deeper, would this be a totally separate second pass using walk to remove the wrapping list?
17:21stuartsierratechnomancy: I thought it was a good idea at the time.
17:22technomancyfair 'nuff
17:22stuartsierragoodieboy: I'd suggest using something other than clojure.walk.
17:22stuartsierramaybe zippers
17:24goodieboystuartsierra: ok i'll check zippers out
17:24ibdknoxwow
17:24stuartsierratechnomancy: I was young and foolish then.
17:25ibdknoxRich has just pretty much guaranteed I never contribute to Clojure proper.
17:25technomancydrunk on the power of macros, I'll warrant
17:25stuartsierrayou said ti
17:25stuartsierra*it
17:28hiredmanclojurebot: irc?
17:28clojurebotTitim gan éirí ort.
17:28hiredmanclojurebot: #clojure
17:28clojurebotthis is not IRC, this is #clojure. We aspire to better than that.
17:32TimMcHence no ops?
17:33amalloyTimMc: chouser isn't afraid to smack down anyone who dissents
17:34amalloyhm. that sorta sounds like i mean chouser actually doesn't like people disagreeing with him. just intended a whimsical way to mention he has ops
17:34Raynes"Why don't you consider the problem a bit more before wasting our time with these knee-jerk questions and bike-shedding? This is not the IRC."
17:34RaynesHeh.
17:35RaynesI guess we know why he hasn't been in here in 3 weeks.
17:35cemerickjesus christ
17:35ibdknoxyeah
17:36ibdknoxlike I said
17:36technomancy...
17:36ibdknoxI'm done.
17:36brehautwhat in the hells have i missed
17:36ibdknoxI will not be a part of something lead by that.
17:36amalloybrehaut: rich still disapproves of opinions
17:36Rayneshttps://groups.google.com/forum/#!topic/clojure-dev/lAxCJbQ5Nn4
17:36RaynesThat whole thread makes me think a bit differently of ol' RIch.
17:39danlarkincemerick: I don't know what you secretly did to rich... stole his car, something like that... to justify those replies
17:40RaynesI heard he killed his kittens.
17:40danlarkincemerick just left :/ oh well
17:41jcromartiedraaaaama
17:41TimMc"What is the point of this question? Are you asking someone else to do the research, or volunteering?"
17:41TimMcFriggin' belligerant.
17:42fliebelare we still talking about the reader macro?
17:42RaynesPretty much everything he said there is mean and uncalled for. It all boils down to him quite literally saying that the community's opinions do not matter here.
17:42gfredericksfliebel: more about the thread about the reader macro
17:42technomancyso... how bout OCaml? I hear it's nice this time of year.
17:42technomancyMaybe Factor? it's pretty, uh... dynamic.
17:42dakroneHaskell!
17:42amalloyfliebel: probably will be until #@2014-12-13T21:39:45.618-08:00
17:42brehautCat!
17:43fliebeltechnomancy: Forht!
17:43fliebelThinking Forth says pretty much the same thing Rich said about simplicity :)
17:43cees_Forth is a step back in time :-)
17:43gfredericksJava is a new enterprise-friendly language that runs on the same virtual machine as clojure!
17:43brehauthttp://www.haskell.org/haskellwiki/Wadlers_Law
17:44jcromartieEvery language has these moments...
17:44technomancygfredericks: you mean I can leverage all my valuable JVM expertise?
17:44gfrederickstechnomancy: exactly. And with a little RT.var, you can even use your favorite clojure libraries!
17:45technomancygfredericks: SIGN ME UP
17:45brehauttechnomancy: even better, you can hire clojure programmers and slowly transition them to writing java code
17:45sridso I was asked to rewrite my clojure project (using aleph/lamina) in something with low-memory footprint (because we'll be shipping the product in a VM). what is a good language for writing concurrent applications with low footprint?
17:46brehautsrid: haskell if you can avoid the space leaks?
17:46sridspace leaks?
17:46RaynesThe Doctor can take care of those.
17:46brehautmemory leaks that occur in the presence of pervasive non-strict evaluation
17:47amalloysrid: how small a footprint?
17:47jcromartiesrid: how low?
17:47jcromartieer, yup
17:47gfredericksis it really this hard to log request headers for debugging in tomcat?
17:48brehautgfredericks: isnt tomcat the web server that makes eveything really hard?
17:48sridamalloy: the clojure app consumed 240M (with 1.8G virtual) on the VM with 1G memory. it was the largest memory consumption compared to other processes!
17:48amalloysrid: you need to tell it how much memory to use so it knows to gc
17:48amalloyeg, 4clojure has been happily running for weeks with <256MB of virtual and 150MB of resident
17:48jcromartiesrid: Erlang uses a fraction of the memory of Java/Clojure
17:48sridamalloy: oh? how do I do that?
17:48jcromartiedepends on the case, of course
17:48jcromartiesometimes it might use more
17:49jcromartiebut most of the time, it's much less
17:49amalloyjava -Xmx80m ...other-args...
17:49amalloylimits the java object heap to 80MB, and then the jvm uses several dozen megs for its own internal purposes
17:50amalloyotherwise the heap tends to grow bigger and bigger because the jvm doesn't know you need the space for anything else
17:50amalloy(as opposed to because it actually needs the space - it just doesn't bother to gc)
17:50sridamalloy: thanks, i'll give this a try now and see if others come to accept the new memory usage.
17:51leo2007Is there offline reference documentation?
17:51amalloy(doc doc)
17:51clojurebot"([name]); Prints documentation for a var or special form given its name"
17:51brehaut(doc apropos)
17:51clojurebot"([str-or-pattern]); Given a regular expression or stringable thing, return a seq of all definitions in all currently-loaded namespaces that match the str-or-pattern."
17:51brehaut(doc find-doc)
17:51clojurebot"([re-string-or-pattern]); Prints documentation for any var whose documentation or name contains a match for re-string-or-pattern"
17:51jcromartiesrid: what does your app do?
17:52ibdknoxis there a version of doc that gives data back as opposed to printing?
17:52jcromartiesrid: it would be interesting to see how little memory you can get away with... you might be surprised
17:52technomancyibdknox: (comp :doc meta)?
17:52amalloy&(-> first var meta :doc)
17:52lazybot⇒ "Returns the first item in the collection. Calls seq on its\n argument. If coll is nil, returns nil."
17:52sridjcromartie: its similar to heroku pulse https://github.com/heroku/pulse plus other things (reading form database)
17:52ibdknoxsorry
17:52ibdknoxI guess find-doc is more interesting
17:52jcromartiesrid: you probably don't keep much in memory at all, then
17:53ibdknox(thinking about tools)
17:53amalloyi'm kinda annoyed that clojure 1.3 seems to make it harder to get docs without printing them, not easier
17:53fliebelamalloy: harder? how?
17:53hiredmanfiddled with how the whole thing works
17:54raekleo2007: yes: git clone https://github.com/clojure/clojure.git && cd clojure && git checkout gh-pages
17:55raekhrm, you can also do "git clone -b gh-pages https://github.com/clojure/clojure.git&quot;
17:56amalloyfliebel: https://github.com/clojure/clojure/blob/master/src/clj/clojure/repl.clj has cool stuff like documentation on special forms
17:56amalloyand you can only get at it with a macro, even though it could easily be a function; and it prints instead of returning something
17:58ibdknoxwow, how did I never know about pst
17:58hiredmanthe file format from outlook?
17:58amalloyibdknox: it's been getting gradually promoted i think
17:59ibdknoxhaha no, ##(doc pst)
17:59lazybotjava.lang.RuntimeException: Unable to resolve var: pst in this context
17:59ibdknox(require 'clojure.repl)
17:59ibdknox,(require 'clojure.repl)
17:59clojurebotnil
17:59ibdknox,(doc clojure.repl/pst)
17:59clojurebot"([] [e-or-depth] [e depth]); Prints a stack trace of the exception, to the depth requested. If none supplied, uses the root cause of the most recent repl exception (*e), and a depth of 12."
18:00technomancyibdknox: check out clj-stacktrace's pst dude
18:00technomancyhttp://technomancy.us/i/clj-stacktrace.png
18:01ibdknoxtechnomancy, yeah, but I'm not cool enough to have clj-stacktrace autoloaded into all my repls
18:01technomancyibdknox: plugin installerate and it's everywhere
18:02ibdknoxhah
18:02TimMcjcromartie: Thanks for the reminder that this shitfit too, shall pass.
18:02ibdknoxtechnomancy, there's some magic I can do to automatically require it too right?
18:02technomancyindeed: http://technomancy.us/154
18:03stuartsierrag'night folks
18:05ibdknoxtechnomancy, awesome. thanks.
18:05technomancyenjoy
18:23flognikrhi -- I am running emacs 23.3.1 on OS X. I was able to install swank-clojure (which installed clojure-mode and slime), I also ran "lein plugin install swank-clojure 1.3.3", but when I try "M-x clojure-jack-in" the "jack-in" is nowhere to be found. I must be missing something very obvious…
18:24technomancyflognikr: do you mean Emacs doesn't know about the command M-x clojure-jack-in?
18:24flognikrtechnomancy: correct.
18:24technomancythat must mean that your clojure-mode is an old version
18:25flognikraha. it came via the package.el install -- so I'll try downloading it directly… thanks!
18:26technomancyyeah, probably package.el is configured to use the old elpa repo rather than marmalade; manual install would fix that
18:35TimMc"This week in "Them's Forkin' Words!"..."
18:35ibdknoxlol
18:35ibdknox:/
18:36TimMcIf you want to see a main dev *really* behaving badly, check this out: https://bugs.launchpad.net/calibre/+bug/885027
18:36TimMcPuts this in perspective.
18:36ibdknoxI guess it's a matter of consequences
18:36ibdknoxlosing support over time is not a good trend
18:43technomancyhttp://mako.cc/copyrighteous/images/trophy.png
18:43TimMcThe actual danger is of alienating your core contributors.
18:44ibdknoxTimMc, yeah that's what I meant. The support of the people who really want to push the language forward and into more hands
18:45ibdknoxtechnomancy, I had to look up who that was :p
18:45brehautwho is Jörg Shilling?
18:45ibdknoxhttp://en.wikipedia.org/wiki/J%C3%B6rg_Schilling
18:48mjwhittmm, bug tracker flame wars... so toasty
18:54TimMcmjwhitt: Really needs a reddit-style interface.
18:54TimMcOf course, that would have the downside of hiding all the "I didn't read any of the other comments but here is my opinion" comments.
19:02ibdknoxhaha
19:02ibdknoxone of my friends just saw that thread
19:02ibdknoxresponse:
19:02ibdknox"sad little king of a sad little hill"
19:05TimMcahaha
19:06TimMcUnfortunately it's a damn useful hill to many people.
19:06ibdknoxdefinitely is for me. :)
19:08brehauti imagine thats the case for a good proportion of the #clojure loiterers :P
19:08TimMcWait, are we calling Calibre or Clojure a hill?
19:10hiredmangiven the number of times people have felt like I was being harsh or a jerk on the list, and I didn't really think I was, I dunno
19:10ibdknoxClojure
19:10dnolenwell fwiw, I don't think cemerick really read the design page on the instant literal very closely.
19:11dnolenand rhickey is not patient w/ folks that don't do their homework. probably a holdover from teaching C++ at NYU
19:11ibdknoxdnolen, it doesn't matter
19:11ibdknoxdnolen, you don't treat people that way
19:11ibdknoxperiod.
19:11RaynesI don't think the "angry genius" argument applies here.
19:12brehautibdknox: but this is LISP!
19:12dnolenibdknox: eh, I'm not sure if it matters, rhickey is not the "community" guy.
19:12hiredmanclojurebot: irc is only for opionfests
19:12clojurebotYou don't have to tell me twice.
19:12sridamalloy: i let the new process run with 80m resident limit for next 2 days, but how would "-Xmx80m" help given that that "mx" takes 64M as default? http://download.oracle.com/javase/1.4.2/docs/tooldocs/windows/java.html
19:12TimMchaha
19:13ibdknoxdnolen, he is the "Clojure" guy it absolutely matters
19:13TimMchiredman: You can be quite abrasive, but it's different. Here, Rich is not just being rude, but also attacking people's value as contributors.
19:13hiredmansrid: those docs are way old
19:13amalloysrid: its default is closer to something like infinity
19:13ibdknoxif every single time someone asks for feedback about DESIGN and he comes in and says it's not about opinion
19:13dnolenibdknox: he's the designer, he's like the Steve Jobs of Clojure. it doesn't matter.
19:13TimMcIt's all in the public view.
19:13ibdknoxthen let's get rid of clojure-dev
19:13ibdknoxand call this what it is
19:14Raynesrhicky-dev
19:14Raynesrhickey-dev ; damn.
19:14RaynesWhy do I keep spelling his name wrong?
19:14sridhiredman: right you are. amalloy seems to be more like 1/4th of total memory (capped by 1g) http://stackoverflow.com/questions/1030256/java-app-that-uses-a-lot-of-memory-use-xmx/1030353#1030353
19:15ibdknoxdnolen, he needs help, he needs the community, you only get to be steve when you need nothing
19:16TimMcclojurebot: rhicky is |reply| Raynes, you did it again...
19:16clojurebotIn Ordnung
19:16ibdknoxlol
19:17dnolenibdknox: people throwing around unresearched opinions on a dev list helps no one. I suppose rhickey could have said "read the design page again please", but I'm not sure that would have come across any better.
19:17ibdknoxdnolen, I read the page. I think it's a bad idea.
19:18dnolenibdknox: it seems fine to me, I don't need it and it doesn't affect me. clearly other people do.
19:19dnolenbut then again perhaps I will need it later - then great.
19:19ibdknoxRegardless, the exchange has real consequences
19:19ibdknoxmaybe they don't matter
19:19ibdknoxenough of these and they will
19:19hiredmanthe only people on the thread that spoke it favor were rich and stu
19:19hiredmanin
19:20ibdknoxand that should've been a clue
19:21dnolennah alex miller is not again, not sean devlin, nor sean corfield - once they understood what was being discussed.
19:21dnolenreading and printing.
19:24dnolenJSON is a weak exchange format, and ClojureScript <-> Clojure reveals we can have something way more expressive.
19:24hiredmandnolen: thats not true, devlin said "do you also want some code that does x?" and "java.util.Date has problems"
19:24hiredmanneither of which is a ringing endorsement
19:24dnolenhiredman: the discussion is not about java.util.Date
19:25hiredmandnolen: why not? that is a proposed part the instant interval reader
19:25dnolenit's about data exchange - making that easier for common types. moving date strings from server side to client side sucks.
19:25hiredmanit will by default result in java.util.Date
19:26hiredmanwhy are some parts of the proposal off limits?
19:26dnolenhiredman: seems to me the discussion was exactly about hashing out what to use JVM side.
19:27hiredmanthere are a number of different parts: what to use for parsing, what in memory presentation to use, how would this be used?
19:27hiredmanetc
19:27moogatronicdnolen: omg.. i spent the 2 years prior to now implementing a time keeping system in java… joda was the only thing that made it not absolute catastropic torture/failure
19:28dnolenhiredman: all valid points of discussion, none of that was being ignored as far as I could tell.
19:28hiredman 58.875 dnolen hiredman: the discussion is not about java.util.Date
19:29dnolenhiredman: what I meant was the discussion was to hash out such details that is all. start the discussion about a particular type and possibly extending it to other common exchange types.
19:30dnolenanyways, again seems to me perfectly legitimate given ClojureScript.
19:30ibdknoxdnolen, so the discussion should never be about the validity of an idea?
19:30ibdknoxwe should always assume that's a given?
19:30moogatronicmaybe i'm blind, but that thread seems perfectly normal and civil to me.
19:30dnolenibdknox: I just don't see what's contentious. Yes I want it to be easier move data between server and client. That's a common source of pain.
19:31ibdknoxdnolen, I mean in a general sense. That seems to be the implication with all the threads lately
19:32ibdknoxrather, the threads Rich has come into
19:32hiredmandnolen: *shrug*, we actually json encode a lot of stuff and just turn dates into milliseconds, hasn't really been a pain
19:32ibdknoxsame here
19:32ibdknoxthe only safe way to pass dates around has always been millis
19:32hiredmandnolen: I don't understand why you keep saying we should be discussing the types?
19:33hiredmanI agree that in some sense it is not important, because it is pluggable to a degree, but the default does matter
19:33TimMcmoogatronic: Rich's responses to Chas were pretty ugly at several points.
19:33brehautwhy does the wire format have to be the same thing as the reader syntax?
19:34hiredmanwell, json types are not particularly rich
19:34dnolenibdknox: it's the only safe way because you don't have common reader support at both ends.
19:34hiredmanno sets
19:34dnolenhiredman: and only strings for keys. argh.
19:34moogatronicTImMc: I just read it as 'straight-shooting'. It's tricky to read into intent and emotion when you're doing it from text and not face to face.
19:34moogatronicI tend toward the 'cylon' cide of things emotionally though, and lots of people think I'm an asshole when I mean no harm.. =)
19:35brehauthiredman, dnolen: definitely no argument that json / js arent ideal
19:35moogatronicTimMc: but i see your point.
19:36dnolenTimMc: I don't disagree but cemerick loves rhetoric. rhickey tolerance for that is famously low has been since day one.
19:36TimMcdnolen: So there's some backstory here?
19:36moogatronicMy benchmark for asshole is the old Hibernate forums.
19:36moogatronicand the creator's postings… =)
19:37dnolenTimMc: ML and IRC are full of such examples.
19:37scottjmoogatronic: doesn't seem to have hurt hibernate's adoption :)
19:37brehautmeh, everyone is an arsehole somewhere on the internet
19:37scottj(ok true hibernate could potentially be more popular if the forums were nice)
19:39dnolentime instants for maps keys, sounds useful to me.
19:39hiredmanjava.util.Dates (a mutable object) as a key
19:39hiredmangreat
19:40hiredmanset! as a way to swap around reader macros isn't really composable either
19:42hiredmanreally just seems halfbaked, a lot of thought into what the language implementer wants to implement and provide, little thought into how it would be used
19:42mdeboardAnyone have a link handy to the "Where did all my favorite libraries go?" link?
19:42ibdknox$google where did contrib go?
19:42lazybot[Where Did Clojure.Contrib Go - Clojure Design - Clojure Development] http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
19:43mdeboardThanks
19:43mdeboardGuess the Compojure "hello world" tut needs updating
19:44dnolenhiredman: I guess don't see how that's any different from set! for unchecked math or removing asserts
19:44seancorfieldi was a bit surprised at rich's tone but i think he's gotten a bit tired of some of the recent discussion threads getting non-technical
19:44ibdknoxif you ask a question about design
19:45ibdknoxit cannot be purely technical
19:45TimMcI can't get a good sense of what he wants.
19:45ibdknoxin any case
19:45hiredmandnolen: it's not purely a compile time setting
19:45ibdknoxit sounds like he just shouldn't be a part of the community
19:45TimMcI don't know where to look to find out.
19:45ibdknoxif he can't handle this
19:45moogatronicibdknox: I'm not sure your assertion is true. Design does not imply non-technicality necessarily.
19:46ibdknoxmoogatronic, yes it does.
19:46moogatronichow so?
19:46ibdknoxmoogatronic, design has "feel"
19:46ibdknoxfeel is inherently non-technical
19:46moogatronicIF you design an algorithm, are you using "feel"? or Technical metrics?
19:46ibdknoxI say this having been a part of the language designs for C# and VB
19:46mdeboardRich doesn't seem like a very feely guy
19:47moogatronic(i'm not arguing for the superiority of Feel vs not Feel Btw….)
19:47ibdknoxthis isn't an algorithm this is an interface
19:47ibdknoxand interfaces are feel-oriented
19:47hiredmanseancorfield: you go to chime in about the various bodies and committees you've been part of?
19:47hiredmanare you going
19:47moogatronicWell, i was speaking purely to your assertion of Design implying "feel" necessarily.
19:48moogatronicibdknox: but I understand your poitn here… I live in a house with an HCI PhD student. =)
19:48ibdknoxmoogatronic, :)
19:48moogatronic(my wife)
19:48mdeboardnil
19:50moogatronicYou could theoretically design an "interface generator", based on some sort of generative algorithm, use a subjective fitness function initially to discover common "feel", and then implement a purely technical "design" that executes your "feel" approximation….? =)
19:50ibdknoxlol
19:50ibdknox:p
19:51seancorfieldhiredman: why would i? :)
19:51hiredmanI dunno, you usually do, and ibdknox did, so I figured you might feel the need
19:51hiredmanwanted to leave you an opening just in case
19:51amalloymoogatronic: that's how ibdknox composes each message he sends to #clojure! how did you guess?
19:52ibdknoxdamnit! my secret is out
19:52moogatronicsource or it didn't happen. (isn't happening). =)
19:52seancorfieldi don't feel strongly enough about time literals - and with a pluggable reader i'm happy (or happy enough)
19:52seancorfieldi expect i'll feel more strongly about subsequent literals...
19:53hiredmanbut the plugin mechanism proposed isn't particularly nice
19:53mdeboardibdknox: Does your "feeling" module have a pluggable backend?
19:53mdeboardWait.
19:53mdeboardForget I said that.
19:53seancorfieldno, but i made that point about tools.logging too and got shouted down :(
19:54ibdknoxmy issue is primarily the way that exchange went down. I think adding a time literal is dangerous from a precedent standpoint and I feel like it hasn't been well thought through
19:54ibdknoxmdeboard, hahaha
19:54ibdknoxmdeboard, way to raise the level of discourse ;)
19:54hiredmanlike, if I set! *instant-reader* to something returns joda dates instead of java datas, I suddenly lose round tripping unless I also define a print method that generates the proscribed format
19:54mdeboardYeah, I'll just be over here.
19:54jcromartiethere are just too many things that we *could* have literals for
19:55jcromartiebut are we talking about reader macros here, or what?
19:55hiredmanand while I can using binding to limite the scope of changes to *instant-reader* changes to printing for objects is global
19:55hiredmanetc, etc, etc
19:55dnolenhiredman: but that's the case anyway w/ all Clojure types.
19:56hiredmandnolen: there is nothing I can bind that will change the type of a something that would be read in as a symbol
19:56dnolenhiredman: it also seemed to me that support for Joda was on the table, if it's there, no?
19:57hiredmandnolen: for parsing
19:57hiredmanthe default in memory representation has been declared to be j.u.Date
19:57moogatronici'm not clear on how you could support or not support joda, it seems you'd have to go all or none. j.u.D doesn't have partials and instants.
19:57hiredmanright
19:57dnolenibdknox: I think with rhickey, case is, it's been thought through.
19:57hiredmanthis "instant" literal is just date times
19:58technomancyI wonder if they realize that JSR 310 is backwards-compatible
19:58hiredmanso you don't have all the other rich time constructs from joda
19:58ibdknoxdnolen, I appreciate his intelligence, but his creation is no longer his. His actions now affect everyone. It shouldn't just be him thinking through it.
19:59hiredmanand stuartsierra is making bad suggestions like it should allow any timezone when printed, but always UTC in memory
19:59hiredmanwhich is a. dumb and b. impossible
19:59technomancyhaha, seriously?
19:59hiredmanbecause the representation in memory is dictated by *instant-reader*
20:00hiredmanfor reals man
20:00hiredmanhttp://dev.clojure.org/pages/viewpage.action?pageId=950382&amp;focusedCommentId=4063247#comment-4063247
20:00hiredmanugh
20:00hiredmanUGH
20:00dnolenibdknox: hmm … my feeling is that the creator usually has a much more complete picture of what's at stake.
20:01moogatronichiredman: I had to implement anytime zone when printed and UTC in memory/persisted. That seems like a pretty common requirement.
20:01ibdknoxdnolen, than any one person? sure. Than all the people close to the core of the language? certainly not.
20:01ibdknoxdnolen, why do presidents always have some form of cabinet?
20:01dnolenibdknox: Clojure's been around for 3 years, I still think only rhickey really understands the internals that well.
20:02moogatronicibdknox: difusion of responsibility when something goes wrong.
20:02ibdknoxhaha
20:02ibdknoxthat too
20:02hiredmanmoogatronic: sure, you really want UTC everywhere if you can manage it, but rich is, as far as I can tell trying to avoid mandating the in memory representation here
20:02hiredmanso, if you allow people to change the in memory representation you cannot mandate the timezone
20:03ibdknoxdnolen, I don't disagree, but that doesn't conflict with my point
20:03hiredmanand mandating UTC for the serialized representation (which is largely what is at stake here) makes it at least kind of sane
20:03seancorfieldi was much mollified when rich said this is really only to support data transport - in clojure - rather than become the entry point to a whole date/time library
20:04ibdknoxdnolen, that being said, correctness has little to do with perception. I was put off by that thread, which means I suspect others were too... and that makes me sad.
20:04hiredmanseancorfield: the datetime library you choose to use could set! *instant-reader* to return a type it likes, and suddenly instants are a different type everywhere
20:04seancorfieldi, personally, would like the default to be Joda Time but with the reader hook i can live with that (and it sounds like if you have Joda Time on your classpath, this feature will switch to it automatically which will suit me fine)
20:05technomancyseancorfield: why not wait for JSR 310?
20:05amalloy$google JSR 310
20:05lazybot[JSR-310 — Java.net] http://jsr-310.java.net/
20:05hiredmanseancorfield: no no that is not the switch, joda time will only be used for parsing, unless you or a library you uses changes *instant-reader*
20:06hiredmanthe switch with joda time is only for parsing
20:06hiredmaneither use joda time or use some stupid java xml date thing
20:06seancorfieldhiredman: yes, and if it sets it to joda time, i'm happy - if it does something else, i won't use the library... printing will need to be compatible with parsing so i assume the smart folks on clojure/core will handle that :)
20:07seancorfieldtechnomancy: sounds like jsr 310 could also be used as a reader hook (and printer), yes?
20:08technomancyseancorfield: it's the successor to joda
20:08seancorfieldsince the actual in-memory data type is irrelevant, the issue is really the #@iso-string literal, yes?
20:09hiredmanthe in memory data type is relevant, but to a lesser degree
20:09hiredmanibdknox: rereading the thread I find myself less shocked at rich's response, and acutally I still haven't read anything chas wrote, his emails are always tld;
20:10dnolenhiredman: I agree. the info bandwidth of the internet is classic source of fail.
20:12seancorfield(use 'clj-time.coerce) (let [jdate (from-date #@2011-11-04T23:07:53Z)] (do-joda-stuff jdate)) ;; happy with j.u.Date as default representation :)
20:12hiredmanbut you load some other code, and suddenly you get back a map of {:day … :year …}
20:13hiredmancause some idiot thought that would be a good idea
20:13seancorfieldhuh? where would the map come from?
20:13hugodI was just about to ask if it broke composability of libraries
20:13hiredmanmy point is, this opens the door to all the problems of reader macros, while still limiting us to the reade macros core adds
20:14hiredmanseancorfield: someone did a set! on *instant-reader* to replace it with something that returns a map representation of datas
20:14hiredmandates
20:14seancorfieldlike i said, if a library does something dumb like that, just don't use that library - this sort of extension point requires sane collaboration and i think the community will self-police that
20:14hiredmanhugod: it will if people are dumb about it
20:14dnolenhiredman: same if someone left a set! unchecked-math flag in there code and broke all your big int math right?
20:14seancorfieldexactly dnolen
20:15hiredmandnolen: sure, and just because have one distasteful thing doesn't mean we want two
20:16dnolenhiredman: my assumption is any library worth using will set and restore, just like you do w/ unchecked math. seems like a non-issue in real life.
20:16hiredmandnolen: but to round trip you can't do that
20:17dnolenhiredman: sorry, I'm slow, why not?
20:18hiredmanthe simplest way to ensure scoping like that for reading is with (binding [*instant-reader* ...] (read ...)) but there is nothing similar for scoping changes to printing of dates
20:19dnolenhiredman: but doesn't everything prints the same dictated by the reader support, what's the issue?
20:20hiredmanhmmm
20:21hiredmanthats true
20:22hiredmanbut if they don't setup a print method for the in memory representation they use
20:25dnolenhiredman: my feeling is that everyone sane will just use Joda for in memory rep, and there will be a common print method for that. ClojureScript side, everything is mutable anyway, ClojureScript is just running on convention.
20:26hiredmanso why not just use joda time or JSR 310? if that is what everyone should be doing?
20:26technomancythe answer is probably android, even though it shouldn't be.
20:27hiredmanpffft
20:27technomancyyeah =\
20:37dnolenhttp://www.eclipse.org/Xtext/xtend/#multipledispatch same example as Clojure, coincidence?
20:37hiredmanwhat the hell
20:37hiredmanwe really needed another one of those
20:39dnolen"Switch expression 'cause pattern matching is complicated"
20:39dnolenthey meant "complected", get it right.
20:41amalloyi glanced at the intro movie with "package my.company", 'public class Greeter", "public void greetABunchOfPeople(List<String> people)" and so forth. was thinking: okay, here's the gross java, show me the two lines of code you use to generate this
20:42amalloywait...this is the awesome low-boilerplate language they're advertising?
20:42dnolenhaha
20:43gfredericksamalloy: ditto.
20:47mdeboardMan I really wish they didn't call the Clojure conference "Clojure conj"
20:48mdeboardmakes it really hard to google `conj` :\
20:57seancorfieldand the unconference is the Clojure Disj (according to some wag on the ML)
20:57seancorfieldClojure/West is easier to google for :)
21:11TimMcamalloy: haha
21:11TimMcthat's pretty amazingly... non-novel
21:33djanatynhmm, trying to get my slime working with clojure
21:46seancorfieldwhere did the name "slime" come from? and "swank"?
21:46TimMcslime is an acronym
21:46TimMcswank... dunno
21:47TimMc___ LISP Inferior Mode for Emacs, I think
21:47cemerickSuperior, IIRC
21:47mdeboard"SLIME: LISP Inferior Mode for Emacs"
21:47mdeboardThat's what it should be, anyway.
21:50TimMcmdeboard: I think you're right...
21:50TimMcLIME would just be too silly and unprofessional a name
21:51mdeboardTell that to an 18th-century sailor, body racked by scurvy
21:51mdeboardwracked*
21:51mdeboardor someone taking shots of tequila
21:54djanatynokay, getting clojure working with slime is more difficult than I thought >_>
21:54mdeboardGod I am so unbelievably tempted to rewrite my employer's web back end in Clojure via Noir (vice Python via Django)
21:54mdeboarddjanatyn: Via emacs or what
21:54mdeboarddjanatyn: That is, is the problem with emacs or what
21:54amalloySuperior Lisp Interaction Mode for Emacs
21:54mdeboardamalloy: I like mine better.
21:54leo2007good morning.
21:54djanatynmdeboard: I think the problem is just with me, and my low level of experience with slime
21:55djanatynI've been using lispbox because my attempts to set up slime with my regular emacs were unsuccessful
21:56mdeboarddjanatyn: It sounds like you're making the same mistakes I did when I was first getting going with Clojure
21:56mdeboarddjanatyn: If you're installing Slime or invoking slime manually in any way you're doing it wrong
21:57mdeboarddjanatyn: You don't need to install anything on your system but leiningen, nor anything in emacs except clojure-mode
21:58mdeboard(Well, you need jdk for leiningen, but yeah.)
21:58djanatynoh, okay.
21:58djanatynso, I shouldn't be using slime with clojure? :\
21:58mdeboarddjanatyn: I wasted two days and a lot of energy before I realized that.
21:58djanatynor, does leiningen do something cool
21:59mdeboarddjanatyn: You will be using slime, but you do not need to install or invoke it manually
21:59mdeboarddjanatyn: Leiningen abstracts all that away.
21:59djanatynoh, okay
21:59djanatynsweet!
21:59djanatynthank you for your advice.
21:59mdeboarddjanatyn: np, it is confusing when starting out
21:59djanatynokay, cloning leiningen
21:59mdeboardnope
22:00mdeboarddon't do that
22:00djanatyn:)
22:00djanatynhow should i install leiningen?
22:00mdeboardhttps://github.com/technomancy/leiningen follow the instructions
22:00mdeboardunder "Installation"
22:00djanatynaaaah
22:02amalloymdeboard: leiningen requires the jdk? really?
22:02ibdknoxLIES
22:02mdeboardlol :(
22:02amalloyi'm still not sure whether you mean the jre or there's some actual jdk dependency i don't know about
22:04djanatynsweet!
22:04djanatynso, now that I have lein installed, what do I do now?
22:05mdeboardamalloy: Well, I had to install the jdk when insalling to this computer. Said it needed javac :-\
22:05mdeboarddjanatyn: Do you have clojure-mode installed in emacs
22:06mdeboardDamn hiccup is sweet.
22:06djanatynmdeboard: yep!
22:06mdeboarddjanatyn: Ok, well just keep following the instructions at the github repo :P
22:06ibdknoxmdeboard: yes it is
22:07mdeboard`lein new <proj name>`
22:07mdeboardibdknox: I scoffed at Hiccup when I first heard about it
22:07ibdknoxhow foolish! lol
22:07mdeboardYeah.
22:07mdeboardsrs
22:09djanatynhmm, I'm *almost* connecting, but getting some errors for some reason
22:10djanatynwoah, lein is pretty awesome
22:10mdeboarddjanatyn: Don't let technomancy hear you say that
22:10ibdknoxdjanatyn: very awesome
22:11ibdknoxtechnomancy never comes around these parts ;)
22:11djanatynah, I thought making an application with clojure would be harder than this ^_^;
22:11mdeboarddjanatyn: You probably didn't do `lein deps` in your new project directory
22:11ibdknoxdjanatyn: that's what we're here for :)
22:11ibdknoxand much needed comic relief.
22:12mdeboardunless dnolen is here, I don't talk when he's here. damn, he scary
22:12djanatynooh, a fatal error, fun
22:12dnolenmdeboard: what?
22:12mdeboarddnolen: I didn't know you were actually here.
22:13mdeboarddjanatyn: Fatal error where, when running lein deps?
22:13djanatynyeah
22:13ibdknoxdnolen: I'm excited to hear about predicate dispatch soon :)
22:13dnolen:O
22:13djanatyn# Problematic frame:
22:13djanatyn# J clojure.asm.ClassWriter.toByteArray()[B
22:14ibdknoxhaah
22:14moogatronicdnolen: I saw you tweet that D. Friedman was coming to the conj, is he presenting?
22:17mdeboarddjanatyn: I've never encountered that particular error. Total flail here, but maybe `lein upgrade`... also, it's been awhile but I think you may need to `lein plugin install swank-clojure "1.3.0"`
22:18djanatynthank you for your help
22:18zerokarmaleftmdeboard: 1.3.3 is the latest
22:18mdeboardzerokarmaleft: oic, thanks
22:18zerokarmaleftat least last time i checked :x
22:18amalloymdeboard: dno<TAB> is an easier way to find out :P
22:18djanatynhmm, still getting errors
22:19mdeboardamalloy: Right? I'm an idiot.
22:19djanatynah, but now lein deps will run
22:19djanatyn:\
22:20mdeboarddjanatyn: Yeah so from my rudimentary understanding never having touched the JVM before Clojure, `lein deps` sets the runtime conditions of the JVM that will be used for your project as dictated in `project.clj`. When you use clojure-jack-in, you need to do it from a buffer containing the file from that project.
22:21djanatynI have minimal experience with the JVM
22:21djanatynmost of my time with programming has been with perl and python, and I'm taking a java class at my high school which I don't like very much
22:21djanatynI do, however, like the JVM a lot
22:21djanatynI've been reading practical common lisp and playing with common lisp for a while, and started reading SICP too
22:21mdeboarddjanatyn: Yeah so open up like `/<your project>/src/<your project>/core.clj` then do clojure-jack-in
22:22djanatynso I decided that tonight I should finally try clojure, which I've been wanting to try for a long time
22:22djanatynAh, okay!
22:22djanatynI was trying to use M-x slime-connect, maybe that was a bad idea :)
22:22mdeboardYeah you should really never have to even type "slime" unless you're trying like C-x b slime-repl
22:23mdeboardwell, not never, but as a beginner
22:23amalloymdeboard: C-c C-z
22:23mdeboardamalloy: orite
22:23amalloyand also, M-x ido-mode
22:23mdeboardI don't know wat that is, but I already have it enabled
22:25amalloymdeboard: makes the buffer/filename prompts better, so you can type in like "repl"
22:25djanatyn:\
22:25mdeboardOh, is that what that is?
22:25mdeboardIs that what does that*
22:26mdeboarddjanatyn: No luck"
22:26mdeboards/"/?
22:26clojurebotamespaces are (more or less, Chouser) java packages. they look like foo.bar; and corresponde to a directory foo/ containg a file bar.clj in your classpath. the namespace declaration in bar.clj would like like (ns foo.bar). Do not try to use single segment namespaces. a single segment namespace is a namespace without a period in it
22:26mdeboardwhat
22:26mdeboards/"/?
22:26clojurebotamespaces are (more or less, Chouser) java packages. they look like foo.bar; and corresponde to a directory foo/ containg a file bar.clj in your classpath. the namespace declaration in bar.clj would like like (ns foo.bar). Do not try to use single segment namespaces. a single segment namespace is a namespace without a period in it
22:26djanatynokay, I ran `lein repl` in the directory of the project which ran successfully
22:26djanatynand I opened up and saved core.clj, which worked fine with syntax highlighting and everything
22:26mdeboardcool
22:27mdeboardthen..
22:27seancorf`if i have a macro in one namespace and want to make an alias for it in another namespace?
22:27djanatynM-x clojure-jack-in ran, but then it said it exited abnormaly with code 1
22:28djanatynand the buffe3r said "that's not a task. use "lein help" to list all tasks"
22:28djanatynthat's weird
22:28djanatynit tried to run lein jack-in, I think
22:28mdeboardoh right, uhm
22:28djanatynshould lein jack-in be a task?
22:28mdeboarddjanatyn: I had this exact issue the other day
22:29mdeboardwhen reinstalling on a fresh machine
22:29djanatynwell, I sure am lucky today :D
22:29moogatronicwas core.clj still open when you ran M-X clojure-jack-in ?
22:29mdeboarddjanatyn: This is going to sound hacky but restart emacs
22:29moogatronicor whatever source from the lein project ...
22:29djanatynmoogatronic: yes, I ran it from inside the core.clj buffer
22:30djanatynI just defined a simple function, (defn square [x] (* x x))
22:30mdeboardmoogatronic: That's not it, it has something to do with the emacs shell session not having access to the lein binary or something
22:30mdeboarddjanatyn: Did you try restarting emacs
22:30djanatynshould I be running `lein repl` in another terminal?
22:30djanatynmdeboard: doing that now
22:30mdeboardno
22:31djanatynokay,
22:31moogatroniclein is in your shell search path?
22:31moogatronic… i would assume.
22:31moogatronic=)
22:31djanatynyeah, I got the same error
22:31djanatynit's in /usr/bin
22:32zerokarmaleftdjanatyn: lein repl is basic readline-enabled repl, lein swank starts a swank server which slime connects to, but M-x clojure-jack-in calls lein swank for you
22:32djanatynokay, I think I found what might be the problem
22:32moogatronici was about to suggest- -
22:32moogatronicdoes lein swank work
22:33djanatynyes, `lein swank` works
22:34djanatynoh, sweet!
22:34djanatynwell
22:34djanatynIf I run `lein swank` in a terminal I Can connect with M-x slime-connect
22:34moogatronicif that work,s you can just M-x slime-connect
22:34djanatynkinda hacky but it works
22:34mdeboardmeh
22:34djanatynoh, wow :D
22:34moogatronicto get going anyway
22:34djanatynyeah, that's awesome
22:35moogatronicac-slime and autocomplete are pretty nice too
22:35mdeboarddjanatyn: what happens when you do M-x shell-command lein jack-in
22:35moogatronicfor learning
22:35djanatynworst-case-scenario, I could define an elisp function in my .emacs to do it for me
22:35djanatynthis is much better than clooj :D
22:36airolsondjanatyn: one thing that confused me was having to "jack in" from a file in your project
22:36seancorf`figured it out: (def ^:macro alias @#'names/macr)
22:36airolsondjanatyn: i.e. you had to have a file from your project open in the currently-focused buffer
22:37airolsondjanatyn: I usually opened my project's project.clj and then did M-x clojure-jack-in
22:37amalloyseancorf`: that doesn't copy as much as you'd like. eg, the eldoc arglists will be wrong
22:37amalloy(well. won't exist at all)
22:37seancorf`don't need the docs, just the functionality (i think)
22:38mdeboarddjanatyn: I still personally prefer C-x C-e to evaluate in the clojure buffer vice the repl
22:38amalloyhttps://github.com/amalloy/useful/blob/f/core/src/useful/core.clj#L5 - might as well copy all the meta
22:39djanatynI like defining functions in a buffer, and then compiling with C-c C-k
22:39mdeboardYou'll do it my way and like it
22:39djanatynand then I play around with them in the REPL
22:39mdeboardJust kidding, I have a headache
22:39mdeboardGod I really, really love Noir & Hiccup
22:45mdeboardPleasantly surprised at arbitrary tags with Hiccup, e.g. (html [:banana "PB&J Time"]) == <banana>PB&J Time</banana>
22:45mdeboardthat's hot
22:46tensorpuddingtrying to get in with clojure again
22:46tensorpuddingi installed lein from debian's package
22:46tensorpuddingbut it can't find clojure, it seems
22:46mdeboardtensorpudding: `lein new <new project>`, `cd <new project>`, `lein deps` ?
22:47tensorpuddingi have a working project
22:47tensorpuddinglein deps fails
22:47mdeboardwith what error
22:47tensorpudding<huge backtrace> Could not find the main class: clojure.main. Program will exit.
22:48mdeboardand you're doing lein deps in the project dir I assume
22:48tensorpuddingyes
22:48tensorpuddingthis error is the same for every lein command i use though
22:48mdeboardtensorpudding: Yeah using apt for leiningen seems sketchy to me
22:49mdeboardwhat's `which lein` say?
22:49tensorpuddingi'd rather dispose of the munging with source packages and that stuff
22:49tensorpuddingit's /usr/bin/lein
22:49tensorpuddingit's a sh script
22:49tensorpuddingthat's been modified by someone
22:49mdeboardtensorpudding: lein upgrade doesn't work does it
22:49duck1123what version is it, isn't the apt lein old?
22:50tensorpuddingself-upgrades are removed, says the comments
22:50mdeboardoy
22:50djanatynso, is there a good tutorial for getting started with clojure?
22:50tensorpuddingit fails with the same problem, in any case
22:50duck1123I'd just install it the right way
22:50mdeboardtensorpudding: I would remove that apt package and do it the proper way
22:50spoon16djanatyn: watch the videos on clojure.org
22:51tensorpuddingsomeone has surely posted a bug to b.d.o by now
22:51tensorpuddingif it's actually broken
22:52duck1123tensorpudding: chances are, something in your dev dependencies is screwing things up
22:52duck1123do you get this in all projects?
22:52tensorpuddingyes
22:52tensorpuddingi get it with lein new too
22:53mdeboardtensorpudding: Why not just remove the apt package and install according to instructions at the Leiningen github page
22:53djanatynhmm, since I'm connected now, how do I pull up a repl?
22:53tensorpuddingbecause it's messy
22:53duck1123well, I'd start by getting an up to date lein.
22:53mdeboarddjanatyn: C-c C-z
22:53mdeboardtensorpudding: It's not messy at all
22:53seancorf`amalloy: you're right that i don't have enough metadata :)
22:53mdeboardtensorpudding: How is it messy?
22:53tensorpuddingand because i don't like installing packages that don't work, without figuring out why, and filing a bug
22:53djanatyn-_-
22:53djanatynit opened up sbcl
22:53mdeboarddjanatyn: Do that sequence from a Clojure buffer
22:54mdeboardOr hell it may not work because you didn't use clojure-jack-in
22:54tensorpuddinginstalling source to /usr/local is always messy
22:54tensorpuddingyou can't remove it easily
22:54tensorpuddingit can conflict with installed packages
22:54djanatynah, I've got (setq inferior-lisp-program "/usr/bin/sbcl") in my .emacs
22:54djanatynI've been thinking of installing debian and working with a fresh install recently
22:55djanatynmaybe clojure will motivate me to do it this weekend
22:55duck1123just put it in ~/bin/lein then add ~/bin to your path
22:55mdeboardtensorpudding: Have you actually read the installation instructions?
22:55tensorpuddingthat is a local install
22:55mdeboardAnyway, not my thing to defend, hope it works out for you :)
22:55duck1123djanatyn: I'm a big fan of just running lein swank and then M-x slime-connect
22:56tensorpuddingi also have to upgrade it by hand
22:57tensorpuddingoh hmm
22:57djanatyn...y'know what
22:57djanatynmaybe I'll just use clooj for a little bit
22:59tensorpuddingfine, i'll install lein by hand
23:00tensorpuddingit better not complain about my clojure install though
23:00tensorpuddingi don't want to install that by hand
23:00mdeboardThere's really nothing "manual" about leiningen
23:00mdeboardat all
23:00scottjkids have it so easy these days
23:01duck1123tensorpudding: if you're installing clojure, you're probably doing it wrong as well
23:01djanatyn\o/
23:01seancorf`hmm, i must be doing something wrong with that alias-ns code...
23:01tensorpuddinginstalling from source is doing it wrong
23:02djanatynso, since I'm using clojure, I don't have to deal with nasty java stuff - I can just use java libraries for fun?
23:02tensorpuddinglast i used clojure you couldn't get by without java
23:02mdeboarddjanatyn: Or when needed
23:02duck1123clojure gets pulled in as a dependency of your project. You shouldn't need to install it
23:02mdeboarddjanatyn: If programming is fun, you are doing it wrong. It should be painful and ceremonial like god intended
23:03tensorpuddingwell, whatever
23:03djanatynxD
23:03tensorpuddingi don't mind if it gets pulled in separately
23:03djanatynyou sound like my java teacher
23:03mdeboardlol
23:03djanatynshe's been learning python recently
23:03djanatynher code is fun to look at
23:03djanatynshe tries to write java in her python
23:04djanatynso, if I wanted to get user input in clojure, what would I do?
23:04duck1123I just got back form a talk by the 7 languages in 7 weeks guy. He saved the best for last
23:04djanatynmake a new Scanner object like in java?
23:04mdeboarddjanatyn: No
23:04djanatynor use cool clojure streams or something?
23:04djanatynlike in common lisp
23:05mdeboardhttp://stackoverflow.com/questions/1114690/how-to-get-user-input-in-clojure
23:05mdeboarddjanatyn: Caution, this will not work in slime-repl
23:05mdeboardbut will in lein-repl
23:05mdeboarder, lein repl
23:05tensorpuddingproject management in clojure is weird
23:06mdeboardI agree with that
23:06scottjif not having your hair set on fire is weird
23:07duck1123the other languages I use are Java (Maven) and Ruby (RVM + Bundler) which are pretty similar
23:07tensorpuddingi do most of my coding as late in python
23:07tensorpuddingthough more recently i've been using google go
23:08mdeboardtensorpudding: Ditto. pip + virtualenv is a different animal.
23:08tensorpuddingi didn't use pip
23:08tensorpuddingmy packages had used distutils
23:10tensorpuddinghow new does my clojure-mode have to be so that i can use jack-in
23:10tensorpuddingwait, my old packages have a swank-clojure dep that's too old
23:11tensorpuddingi have no beard
23:11duck1123try ignoring that warning
23:12tensorpuddingugh, what do i have to do for M-x clojure-jack-in
23:12tensorpuddingright, my clojure-mode is 4 major releases behind
23:12mdeboardtensorpudding: Have you recompiled your kernel yet
23:12mdeboardSorry
23:12tensorpuddingi don't recompile my kernel
23:13duck1123are you using elpa?
23:13tensorpuddingsorry, do you have the idea that i'm a greybeard because i use emacs?
23:13tensorpuddingi thought most clojure people used it
23:13tensorpuddingor at least, technomancy does
23:13tensorpuddingduck1123, i have marmalade configured
23:13jliI'm trying to understand when it's safe to use atoms. in the memoize example (http://clojure.org/atoms), isn't it possible to do some work multiple times?
23:13mdeboardBut seriously, bring all your packages up-to-date, `lein plugin install swank-clojure "1.3.3"`, `lein deps` then try `clojure-jack-in`
23:14tensorpuddingi brought swank-clojure up to date
23:14tensorpuddingbut doing that doesn't change the behavior of emacs's clojure mode
23:14jlibetween the @mem and the (apply f args), couldn't another call to memoize have already added the result of (apply f args) to mem?
23:14jliin this case it's safe, but work is still duplicated
23:14mdeboardtensorpudding: Right, you'll still need to update clojure-mode
23:14tensorpuddingyes
23:15tensorpuddingi need to remember how to upgrade in elpa
23:15duck1123i on the line then x
23:15tensorpuddingah, right, mark with U
23:16tensorpuddingthen hit x
23:16amalloyjli: correct
23:16amalloyi sketched out a version of memoize that doesn't have this problem, somewhere
23:17ibdknoxamalloy: did it use transactions or something?
23:17amalloyibdknox: no, just less-dumb atoms
23:17amalloyiirc
23:17mdeboardOoh wow Noir prints exceptions really nicely
23:18tensorpuddinghooray
23:18ibdknoxthat's worth being impressed about ;)
23:18amalloyibdknox, jli: https://gist.github.com/1252810
23:18tensorpuddingoh man, new clojure-mode is weird-looking
23:19amalloythough that version has its own problems: it fails for false/nil values. not sure what i was thinking there
23:19ibdknoxhaha
23:19amalloyoh, no, i see
23:20amalloyi'm putting the delay into the atom, so that's never false. then i force it
23:20ibdknoxyeah that makes sense
23:20tensorpuddingthe functions in my project don't seem to be available
23:20tensorpuddingfrom slime
23:21duck1123try requiring them
23:21tensorpuddingi forgot how require works
23:21duck1123(require 'my.namespace.core) or C-c C-k in the file
23:21amalloyibdknox: a neat gist of mine i stumbled upon while looking for that one: https://gist.github.com/1288628 is a handy trick
23:22tensorpuddingright, gotta quote the thing
23:22tensorpuddingi hoped that starting a repl on the project meant that their namespace would be included already
23:22ibdknoxamalloy: I feel like I don't use delays enough
23:22amalloy~delay
23:22clojurebotHuh?
23:22ibdknoxnot that they should be used all the time
23:23amalloyaw. i was hoping he'd know some clever quip
23:23ibdknoxlol
23:23duck1123ibdknox: now I'm thinking the same thing
23:23duck1123amalloy: wait for it
23:23amalloyibdknox: yeah same here. i think i've only found three good uses for delays, and i just showed you two of them
23:23ibdknoxhaha
23:24amalloythe other one is https://github.com/flatland/useful/blob/develop/src/useful/seq.clj#L175
23:25amalloyuseful for something like (some even? (lazy (compute-thing) (compute-other-thing)))
23:32jliso, I have a work queue. I want to take an item off and do some side-effecty thing, but never do work twice. I was thinking of wrapping everything in swap!, but apparently side-effects shouldn't go in swap! ?
23:32duck1123jli: if you send to an agent, that agent is run only at the end
23:35amalloynot true
23:35duck1123no?
23:35amalloyonly for refs
23:35duck1123ahh
23:36spoon16I'm reading some CLJ and I see an instance where the author is doing (ns (:gen-class)) and then all the methods are defined as (defn -methodName)
23:36spoon16does the "-" in the defn mean something in this case?
23:37spoon16s/methods/functions
23:37amalloyspoon16: see the docs for gen-class
23:37mdeboardWow, Noir is amazing. I'm really thunderstruck.
23:37mdeboardWhat's the word the British use
23:37mdeboardgobsmacked
23:37amalloymdeboard: he's in california, not england. you can just say "whoa...dude..."
23:38ibdknoxwhoever wrote it must be awesome...
23:38ibdknoxamalloy: you say he lives in CA?
23:38mdeboardoh, holy shit.
23:38mdeboardlol.
23:38amalloyibdknox: i've never managed to run into him. he must be some kind of recluse
23:38mdeboardI've been looking at webnoir
23:39mdeboardNoir isn't bad, if you like that sort of thing.
23:39ibdknoxamalloy: srsly, I hear he's never actually seen the day star.
23:39duck1123amalloy: I hear he's in #clojure from time to time
23:39mdeboard-_-
23:39amalloyhe'll probably wear a bag over his head at the conj to protect his identity
23:39mdeboardOk, ok
23:40mdeboardibdknox: I like. Really a sea change from Django. Though the stuff I'm most floored by is really Hiccup-related
23:40mdeboardDjango/Flask/every Python framework ever
23:40ibdknoxI can't take credit for hiccup :)
23:40scottjibdknox: noir is awesome, especially hiccup and compojure :)
23:41scottjand ring too! that's genius
23:41ibdknoxlol
23:41ibdknoxscottj: it's true
23:41mdeboardThe best part about Noir is leiningen
23:41scottjand the stacktraces too! (I haven't looked to see if you use the lib for that)
23:42ibdknoxscottj: I use a parser, but I do work on them past that to make them nicer
23:42scottjI wish everyone would just stop praising ibdknox's work on noir and korma so he'd get back to pinot :)
23:43ibdknoxscottj: soon, soon. I'll get to it after the conj
23:43scottjibdknox: what security concerns should I have about remotes?
23:43mdeboardI thought someone else wrote Korma
23:43ibdknoxscottj: I have no idea, I haven't tried to do anything evil with them yet
23:44scottjmdeboard: it's true, ibdknox used up all his color scheme sense on noir
23:44mdeboardIs this still idiomatic for db connections http://en.wikibooks.org/wiki/Clojure_Programming/Examples/JDBC_Examples#MySQL
23:44ibdknoxscottj: :p
23:44mdeboardThere's a color version of Scheme?
23:44mdeboardwhat
23:44mdeboardoh
23:44mdeboardderp
23:44mdeboardwow
23:45amalloyat least it's not yellow on orange
23:45ibdknox~rimshot
23:45clojurebotBadum, *ching*
23:45mdeboardPerfect color scheme for autumn
23:46mdeboardibdknox: Do you come from Ruby land or something
23:46ibdknoxdepends on which part of my life you're talking about :)
23:47ibdknoxmost recently I was the program manager for VB and C# in Visual Studio
23:47mdeboardyikes
23:47ibdknoxprevious to that I built websites in PHP/Python/Ruby
23:47mdeboardAre there any plans to handle db connections with Korma?
23:47ibdknoxit already does?
23:47mdeboardOh.
23:48scottjibdknox: you know what would be awesome is if korma did sql
23:48mdeboardlol.
23:48ibdknoxhahaha
23:48mdeboardWow shut up
23:48mdeboardI couldn't see the docs button :|
23:48ibdknoxlol
23:48amalloynot your favorite color scheme NOW, eh?
23:48mdeboardhahaha
23:49mdeboardI'm going back to #Python, at least I'm smarter than everyone there
23:49ibdknoxMust be running on a CRT monitor
23:49amalloyibdknox: next time: "yeah, hang on, one sec...okay, implemented that for you"
23:49mdeboardibdknox: Yeah, hold on let me degauss
23:49ibdknoxamalloy: damnit, another wasted opportunity
23:51mdeboardfor what, just out of curiosity? impress a newb?
23:51mdeboardI'm pretty impressed by all the Clojure luminaries that hang out in here, so it won't take much
23:51ibdknoxfor being sarcastic and funny :)
23:52mdeboard"Hey Matt I got dressed by myself this morning!" "Wowwwwwww that's AWESOME!!!"
23:52ibdknoxmdeboard: just wait til you get to CLJS and pinot
23:52ibdknoxthen you can have hiccup... on the client side
23:53mdeboardasynchronous server-side cloud nosql?
23:53ibdknox+ photo sharing
23:53mdeboardI don't know what hiccup on the client side would do for me
23:53ibdknoxinstead of generating html with strings if you want to add new stuff to the DOM
23:54ibdknoxyou can create DOM objects with my implementation of hiccup
23:54ibdknoxand then bind events and such to them
23:54mdeboardWowwww that's AWESOME!!! But seriously, neat. I don't do much with/have much interest in DOM manip./front-end stuff
23:55ibdknoxa lucky one
23:56mdeboardStuff like uh... Cascalog interests me more but I don't have a use case. Noir is a great fulcrum for learning more Clojure in general though.
23:56ibdknoxthat was the thought
23:56ibdknoxit seems to have worked out pretty well
23:56tensorpuddingwhy does clojure-mode indent lines beginning with ; so insanely
23:57mdeboardtensorpudding: use ;;
23:57mdeboardtensorpudding: I didn't answer your question, I know, but that's the solution
23:57tensorpuddingis ; not valid for comments anymore?
23:57mdeboardtensorpudding: I think ; is for in-line comments
23:58tensorpuddingthis tutorial i'm reading suggest otherwise, but whatevs
23:58mdeboard`(do-stuff '(1 2 3)) ; this does stuff`
23:58scottjtensorpudding: I think other lisp modes, at least with paredit, do the same thing with ;
23:58tensorpuddingoh
23:58tensorpuddingright
23:58tensorpuddingesk is using paredit now
23:58tensorpuddingit must be responsible
23:59goodieboyI have an sexp like '(prn "TEST") -- is "eval" to only way to execute this?