#clojure log - Dec 08 2014

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

0:51 zarkone: hello. Lets say i have fn "begin": (begin "hello"). The result of `(begin "hello") will be (my-ns/begin "hello"). It's good. But now i do this: (def x '(begin "hello")). How can I expand "x" with backquote to get (my-ns/begin "hello"), not just (begin "hello") ?

0:51

1:12 rs0: zarkone: you should explain what you're actually trying to do

1:12 amalloy: zarkone: i'm not totally sure i understand the question, but that sounds like a thing that you don't need to do

1:13 wei: is there a better way to express this?(case v

1:13 1 (wrap-action (foo))

1:13 2 (wrap-action (bar))

1:13 amalloy: so, indeed, go into why you think you should do it

1:13 wei: 3 (wrap-action (baz))

1:13 (qux))

1:13 amalloy: wei: (if-let [f (case v 1 foo, 2 bar, 3 baz, nil)] (wrap-action (f)) (qux))?

1:14 wei: better formatting: https://gist.github.com/yayitswei/ce4dd59cdb5b6f9aa5be

1:14 amalloy: clever. works for me, thanks

1:15 amalloy: also consider whether you would be better off having a map like {1 foo 2 bar 3 baz} somewhere, which you can use to look stuff up in here, especially if you can reuse that

1:23 zarkone: rs0: amalloy: I want to pass the body into macro and expand the symbol namespaces

1:23 i can give example, just a minute

1:26 http://pastebin.com/v1TpzmW2

1:26 rs0: zarkone: well, you don't need the ` reader macro to do that

1:27 ,(resolve 'update-in)

1:27 clojurebot: #'clojure.core/update-in

1:27 rs0: ,(let [x 'update-in] (resolve x))

1:27 clojurebot: #'clojure.core/update-in

1:27 amalloy: why are you def'ing a quote, instead of a function? it doesn't make sense

1:29 zarkone: amalloy: you mean, instead of def '... use defn?

1:29 why i didn't think about it..?

1:29 amalloy: yeah, of course. i can't see any reason you'd rather have an expression that needs to be eval'd, instead of just a function to call

1:31 zarkone: i just didn't rest enough and do stupid >.< i'll try it now, thank you very much amalloy, rs0

1:35 first time i didn't even get it, it's all worked in CIDER repl. But when i `lein run` i've got this error about unbound symbol.. Seems like this approach resolves my problem, but I still do not get nested quotion

1:54 TEttinger: why did I get a notice from clojurebot 5 hours ago? [17:46;12] <clojurebot> Gabh mo leithscéal?

2:03 amalloy: TEttinger: a notice isn't a private message

2:04 he sent it to the whole channel; if your client is representing that as a private message, get a new client :P

2:12 TEttinger: no, I got it as a notice I just don't know why it would send a "message not understood" to the whole channel

2:12 normally it sends those in the channel, so...

2:19 amalloy: TEttinger: for some reason he responds to ~def as a notice

2:19 there was a ~def he didn't understand, so...

2:19 TEttinger: huh

2:20 what is ~def ?

2:23 amalloy: ~def +

2:23 TEttinger: oh nice amalloy!

2:26 domokato: justin_smith: i'm talking about :import in ns, to import a java class, which I am then calling a static method on, and core.typed thinks there's an error on that line (No such namespace: <classname>), which yeah, makes no sense

2:37 Empperi: is there a simple way to do "lazy import" for java classes?

2:38 meaning I want to determine when they should be imported but I don't want to pollute all of my functions in this one namespace with (java-imports) -calls

2:38 I know I can use (import)

2:39 why would I want to do this: right now this one library does logging at class load time and when it happens my logging configurations haven't been initialized yet

2:39 and it pushes a bunch of debug level loggings before I manage to set the level to info

2:40 other option would be to require that namespace which imports that java library lazily via (require) but then I'd have to remember to do that everywhere where that namespace is required

2:40 which sucks

2:41 third option is to create an abstraction layer namespace which can be eagerly required but which will lazily require the actual namespace which does the work but in this case I'd have to duplicate the API and that sucks even more

2:46 test: justin_smith: yeah I understand. Thanks

2:48 * otti <3 clojure

2:58 thearthur: Am I right in thinking that syntax-quote (`) doesn't have a name by which you can build calls to it in other macros?

3:01 andyf: I don?t think so. It is dont at read-time, so not sure how you would build calls to it, anyway?

3:02 s/dont/done/

3:05 thearthur: there would have to be some other macro that ` gets resolved to by the reader that provides some other interface to the same code

3:05 Empperi: managed to solve my problem I described above btw

3:05 so bygones and so forth

3:05 :)

3:07 gratimax: how do transducers have an advantage over reducers for iteration?

3:07 andyf: thearthur: What are you trying to do that simply using a syntax-quoted form in a macro or function would not achieve?

3:11 thearthur: andyf: I'm just asking to make sure i don't spread lies on stackoverflow

3:11 where I claimed that this can't be done without eval

3:13 andyf: Not sure, but since it is read time, it could be done via something like read-string from a string.

3:13 zarkone: thearthur: actually, your answer gave me answers for all my questions about macro for now, thanks =)

3:16 thearthur: this code i paste in comment to your answer works in repl but fails when i `lein run`. I didn't get why at first, now i understand it

3:25 Rhainur1: I'm trying to figure out how to write code "the Clojure way" as I have no prior lisp experience

3:25 http://hastebin.com/iruyayemix.lisp

3:26 this feels very imperative to me, with the nested ifs

3:26 how can I improve this code?

3:27 andyf: Rhainur1: I get a page that says "application error" when I try to follow that link

3:28 Rhainur1: http://hastebin.com/raw/iruyayemix

3:28 what about that

3:29 andyf: ^

3:29 andyf: better. no error.

3:29 gratimax: Rhainur1: seems pretty much fine

3:30 maybe (if (and (not (nil? user)) (crypt/compare password (user :password)) user nil)

3:30 Rhainur1: here's my improved version: http://hastebin.com/teyohuvuwe.lisp

3:30 gratimax: almost the same as that except I used some?

3:30 gratimax: yeah brain fart there

3:30 Rhainur1: and (if) defaults to nil if the else branch is not supplied

3:30 so I removed that as well

3:31 gratimax: it's late

3:33 Rhainur: so here's my final version with indentation and what not: https://gist.github.com/Rhainur/c47bbd7391285762be88

3:33 anything I can improve on there?

3:34 fairuz: Hey guys. Using liberator + compojure, how can I add custom header to the response? Thanks

3:34 gratimax: Rhainur: seems fine

3:34 Rhainur: gratimax: cheers, thanks for the help

3:34 gratimax: fairuz: iirc it's in ring.util.response

3:51 fairuz: gratimax: ah ok

3:54 hmm I'm using ring-jetty-adaptor, when I'm trying to return a big (not that big) json response, it failed. I just get 500 server error on the front end.

3:54 weird

3:54 Any limitation on the response size?

4:12 oh nvm, it's the Liberator's debugging trace

4:12 somehow it traced my result data in there

4:12 too biug

4:12 *big

4:12 gratimax: fairuz: check for any stack traces

4:12 actually I didn't see your latest messages, nvm

4:13 fairuz: Just disabled the trace in the header and it's all good

4:13 gratimax: not sure what you mean, but alright

4:15 sm0ke: is there any other way to create a map from vector beside `into`

4:15 Empperi: reduce?

4:15 clojurebot: reduce accumulates the men from the boys

4:16 Empperi: lol

4:16 gratimax: lol

4:16 sm0ke: oh man! `into` is so f***ng slow!!

4:17 it incurs 10x cost to convert a list of 100000 rows into a map each!

4:17 using into

4:20 hurmm actually not

4:20 seems like it needed a `doall` to reveal the other side :p

4:21 Empperi: ,(reduce #(assoc %1 (first %2) (second %2)) {} [[:key "val"] [:another "dude"]])

4:21 clojurebot: {:another "dude", :key "val"}

4:21 Empperi: dunno if that's going to be any faster though

4:21 most likely not

4:22 especially since into uses reduce internally

4:22 but it does use conj instead of assoc

4:22 so some difference at least .)

4:23 sm0ke: i am going to see if transient helps me

4:23 so basically i have a java map which i want to convet to clojure map with some deserialization and keywordifying

4:24 and it takes my runtime from 1.5 sec to 10.5 seconds

4:24 that does not sounds good to me

4:24 and all i am doing is the same old map. into stuff

4:24 oh each entity is a java map

4:35 ok de/serialization is the culprit here

4:35 without deser its ~3 sec

4:39 nippy isnt so fast afterall

4:51 ,(into {} (map (fn [[k v]] [(keyword k) v]) (java.util.HashMap. {"a" 1})))

4:51 clojurebot: {:a 1}

4:51 sm0ke: any better way to do this?

4:51 ,(time (into {} (map (fn [[k v]] [(keyword k) v]) (java.util.HashMap. {"a" 1}))))

4:51 clojurebot: "Elapsed time: 0.514304 msecs"\n{:a 1}

4:52 sm0ke: ,(time (into {} (map (fn [[k v]] [(keyword k) v]) (java.util.HashMap. {"a" 1}))))

4:52 clojurebot: "Elapsed time: 0.283097 msecs"\n{:a 1}

4:52 sm0ke: wth this takes .5 msec on my machine!

4:52 ,*clojure-version*

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

4:56 zot: is there any way to "recognize" when running within the repl, so that I can handle exit/errors differently while manually testing?

4:57 i found the *command-line-args* hack, and wondered if something better exists

5:02 sm0ke: zot: you can put a dependency in your profiles.clj which would be only present in repl

5:03 e.g. lein-pprint

5:03 then pprint should be resolvable only in repl unless you have it in the ns imports also

5:04 ,(resolve 'pprint)

5:04 clojurebot: nil

5:04 zot: sm0ke: clever :)

5:24 rurumate_: ,(require '[clojure.core.match :refer [match])

5:24 clojurebot: #<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>

5:24 rurumate_: ,(require '[clojure.core.match :refer [match]))

5:24 clojurebot: #<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>

5:25 rurumate_: ,(require '[clojure.core.match :refer [match]])

5:25 clojurebot: #<FileNotFoundException java.io.FileNotFoundException: Could not locate clojure/core/match__init.class or clojure/core/match.clj on classpath.>

5:25 rurumate_: no match?

5:30 https://www.refheap.com/94569

5:35 ordnungswidrig: &require '[clojure.core.match :refer [match]])

5:35 lazybot: ⇒ #<core$require clojure.core$require@445cfd0a>

5:35 ordnungswidrig: &(require '[clojure.core.match :refer [match]])

5:35 lazybot: java.io.FileNotFoundException: Could not locate clojure/core/match__init.class or clojure/core/match.clj on classpath:

5:50 tsdh: Is there a way to call Clojure fns from Java which doesn't require AOT-compilation? AOT-compilation doesn't work for me currently because of CLJ-1544...

6:05 sm0ke: tsdh: yes, use RT.var

6:06 ,(clojure.lang.RT/var "clojure.core" "inc")

6:06 clojurebot: #'clojure.core/inc

6:06 sm0ke: ,(.invoke (clojure.lang.RT/var "clojure.core" "inc") 1)

6:06 clojurebot: 2

6:10 tsdh: sm0ke: Well, that works for Clojure builtins but if I want to refer to vars of a custom project for which I've created an uberjar. Then, e.g., RT.load("my.ns") complains that my.ns_init.class or my.ns.clj are not in the CLASSPATH although the uberjar containing the latter is in the classpath.

6:19 sm0ke: tsdh: yes because you need to require it first

6:19 clgv: tsdh: then IFn require = (clojure.lang.RT/var "clojure.core" "require"); IFn symbol = ...; require.invoke( symbol.invoke( "my.ns" ) ); IFn myfn = Clojure.var( ... );

6:19 sm0ke: RT.var("clojure.core","require").invoke(Symbol.inter("cheshire.core"))

6:19 e.g.

6:20 clgv: ah thats the new api in 1.6?

6:21 clgv: sm0ke: it is the official API since 1.6 correct

6:22 sm0ke: is there an uptodate wrapper for kryo?

6:22 tsdh: clgv: Let's see if that does the trick...

6:23 clgv: tsdh: definitely, as long as your namespace implementation is on the classpath

6:25 ah, you can use `read` to get rid of the symbol part above. -> require.invoke( Clojure.read( "my.ns" ) ) will work as well

6:26 tsdh: clgv: Indeed. Great, thank you!

6:35 clgv: tsdh: oh I saw a typo above. replace "clojure.lang.RT" with "Clojure"

6:35 tsdh: I copied sm0ke's example ;)

6:35 tsdh: http://clojure.github.io/clojure/javadoc/clojure/java/api/Clojure.html

6:36 zot: re core.async: it says all over the docs to use transformer, instead of deprecated func X (filter<, etc.); does this mean use pipeline(-async) with a transducer? or something else?

6:37 tsdh: clgv: Yes, that's what I'm using now. :-)

7:17 noncom: what is the font you think is best for programming in clojure? (typeface/size) ?

7:22 clgv: noncom: any monospace font that pleases you ;)

7:22 kungi: noncom: I love Consolas 12

7:22 noncom: What clgv said :-)

7:23 clgv: noncom: Eclipse says that I am using "Monospace 10" ;)

7:26 hipsterslapfight: SourceCodePro-Light

7:29 noncom: thanks for the answers :)

7:29 wink: DejaVu Sans Mono 12 it seems

7:29 good enough I didn't change it :P

7:29 but I don't use different fonts for different languages either

7:29 TEttinger: unifont, how else will you see the valid identifier ☃

7:29 noncom: :D

7:30 TEttinger: Envy Code R is quite nice

7:31 http://damieng.com/blog/2008/05/26/envy-code-r-preview-7-coding-font-released

7:38 rritoch: Hi, What do you all think about adding the ability to create custom numeric types in clojure? I'm working on a pet project that needs U1 (unsigned byte), U2 (unsigned short),and U4 (unsigned int) types but quickly found that clojure doesn't currently allow custom implementation of numeric functions (add,sub,mul,div,inc, etc.) but it would be relatively easy to add.

7:39 Currently clojure defaults to long data type operations for numeric types it isn't familiar with, but adding an additional interface for numeric types meant for use directly with clojure would be relatively easy.

7:41 TEttinger: rritoch, but... the jvm doesn't even support unsigned types IIRC

7:41 rritoch: TEttinger, it doesn't need to

7:42 TEttinger: so this isn't an efficiency thing but a type checking?

7:42 rritoch: I followed how the numeric operations work, and they're not compiled, they're interpreted

7:43 TEttinger: pretty sure at some point they call java + and -

7:43 rritoch: Yeah, they do, eventually

7:43 But instead of calling +/- if the numeric type implements some specific interface it could call operations on the numeric object.

7:44 noncom: oh there was a huge war on adding ^int and ^float primitives to clojure. i was craving for 4-byte types support for doing opengl stuff

7:44 most of the community and the official frowned at the idea

7:44 so if you do a library, i will be one of the first users of it :)

7:44 but it will remain a library, they won't add it into the core

7:44 (i thnk)

7:44 rritoch: noncom: hehe, ok well I've already forked clojure, so keep your eyes out

7:44 noncom: (i think)

7:45 rritoch: https://github.com/rritoch/clojure

7:45 noncom: oh, was just going to ask for the link :()

7:45 rritoch: Currently the only new feature is namespace isolation

7:45 noncom: :)

7:45 rritoch: But the next feature I'm woring on is custom numeric types so I can work directly with unsigned numbers

7:45 noncom: so, you're having big plans on forking clojure ?

7:46 wanna make it more robust/versatile ?

7:46 rritoch: This isn't a big plan, I hope common sense takes hold and they use my changes

7:46 Otherwise, this will become a hard fork of clojure

7:46 noncom: this is really nice twist in the whole story!

7:47 dnolen_: rritoch: unlikely to happen re: numeric changes

7:47 rritoch: Not really, lots of people are using their own custom hard forks of clojure

7:49 According to GITHub clojure has been forked 691 times, I'm not sure how many of those remained hard forks though

7:49 noncom: i am not into using the forks (except for the android one), but this one is definitely very interesting. robust primitives support is a big win.

7:50 TEttinger: github requires you to have your own fork to submit pull requests, so I imagine a lot of it is for that

7:50 rritoch: But since I'm adding new features to clojure that aren't possible with the current runtime, these are truly hard forks.

7:50 dnolen_: noncom: just to clarify - the debate was not about ^int ^float, it was about primitive taking functions, 64 bit math by default, and the policy around arbitrary precision numbers

7:50 clgv: noncom: I have started a library for better primitive support (more than 4 arguments, allows byte float, etc.)

7:50 TEttinger: clgv: link? :D

7:51 clgv: noncom: but I want to add the support for primitive lambda calling before I publish it

7:51 ericelliott: Where can I find a good list of the various kinds of functions in fp? For instance, those that iterate over lists like map, and predicates that take a list and return a bool like filter? A definitive reference with a good functional programming glossary would be great. =)

7:51 clgv: TEttinger: ^^

7:51 TEttinger: oh ok clgv

7:51 noncom: dnolen_: yes, and much of the argument was refering to technical difficulties and obesity that such a support would imply.. i know.. but sad anyways :)

7:52 rritoch: Anyhow, I should the numeric types finished and the clojure changes ready within a week or so. That is about how long it took me to figure out how to isolate namespaces.

7:52 clgv: TEttinger: holidays are coming, so I guess there will be some hours to get that done :)

7:53 TEttinger: ericelliott: I'm not sure where you'd start in categorizing, but you have everything from many->usually one item (like reduce), many -> many (map), many->less of the same sequence (like filter), higher order functions (like comp and juxt), stuff like frequencies that is sorta unusual...

7:54 noncom: clgv: that is also a good news.. will be waiting for it to be announced :)

7:56 rritoch: Does anyone know what the status of vector functions is at?

7:57 I noticed in the core that there is a lot of code there for vector mathematics, but it's all commented out.

7:57 TEttinger: might have gone to core.vector

7:57 err, matrix https://github.com/mikera/core.matrix

7:58 rritoch: Anyhow, vector mathematics is the battle that lead me to clojure. I wanted to add dot product operators, and it lead to a lot of drama.

7:58 TEttinger: add to what?

7:58 rritoch: Pike

7:59 With clojure everything is either a function or macro so it isn't an issue, I can add any function I want for the most part. But the changes I'm talking about making now are about changing the way numeric functions behave depending on what objects they're operating on.

8:00 This is nothing knew, C++ has been doing it for almost as long as I've been programming.

8:01 Anyhow, the defense used by Pike developers was that they didn't want to include any support for features above high-school math

8:01 A problem that has NEVER happend in any LISP language development.

8:06 Considering the similarity between the new transducers, and einstein notation, (Differential Geometry), I don't expect to run into those types of issues with clojure developers :)

8:07 Once these transducers are in a stable release I'm considering trying to make a library to apply differential gemetry capability using transducers, it seems completely possible.

8:09 I'm not sure if I'll use einstein notation or not though, that uses a lot of implied symols, which may lead to severely unreadable code.

8:09 Either way, differential geometry with scilab and matlab is still difficult, but I think transducers should greatly simplify the task.

8:35 clgv: haha no "features above high-school math"? roflmao

8:35 I have to write that down

8:37 rritoch: clgv: No need, I'll pm you the link

8:37 It is part of internet "history"

8:40 vivekramaswamy: Hello all, I am newbie to clojure, a quick question, why does this work (:a #{:a :b :c}), but this does not work (1 #{1 2 3})

8:41 rritoch: I found the thread, I just can't seem to find the original comment, only my response

8:43 dnolen_: vivekramaswamy: keywords work as functions, numbers do not

8:44 triss: hey all. I'm having real issues building the clojurescript bit of a project

8:44 once compiled and loaded in to a browser I'm told:

8:45 ReferenceError: goog is not defined

8:46 where do I find the goog.blahblah dependencies for clojurescrpt?

8:46 dnolen_: triss: sounds like you are not including the script tags for google closure, have you looked Getting Started on the ClojureScript wiki? It's pretty precise about what needs to be done.

8:46 triss: cheers dnolen I'll take another peek

8:47 dnolen_: triss: https://github.com/clojure/clojurescript/wiki/Quick-Start#development-mode

8:47 triss: https://github.com/clojure/clojurescript/wiki/Quick-Start#production-mode

8:47 note that the markup is *not* the same

8:47 vivekramaswamy: thanks dnolen_ makes sense

8:48 brucehauman: $fortune

8:48 lazybot: "JoeTheClown: hey there!"

8:49 brucehauman: $getmail

8:56 someplace: what's a good way to split a string into substrings of n elements? partition returns lists of chars, is there a way to convert those to strings?

8:57 ordnungswidrig: someone: &(map #(apply str %) (partition 2 "123456789"))

8:57 ah, this was for @someplace actually

8:58 ,(map #(apply str %) (partition 2 "123456789"))

8:58 clojurebot: ("12" "34" "56" "78")

8:58 ordnungswidrig: thanks, clojurebot

8:59 someplace: could've sworn I'd tried that.. thanks!

9:06 triss: ok, I've just started the clojurescript quick start from here: https://github.com/clojure/clojurescript/wiki/Quick-Start

9:06 I can compile things but not run them. I've created the web page and hello.cljs files exactly as specified

9:08 but when i open the html file in firefox I'm told: ReferenceError: goog is not defined

9:08 I can't see out/goog/base.js anywhere

9:11 rritoch: I just had a reasonable question about the namespace isolation I made to see if it solves the problem of dependencies that conflict with eachother. In the code I didn't actually manipulate classloaders at all so when entering an environment if you need separate classloaders you still need to bind separate dynamicclassloaders to Complier/LOADER and the Thread's currentContextLoader.

9:14 Should I be adding classloader manipulation, or leave it in the hands of developers? When I first made this feature it was intended for use with OSGi or some similar classloader manipulation. Would it be better to leave this in the hands of developers or to associate specific classloaders with each isolated namespace?

9:15 Technically it is possible to make a library to handle the environment switch and apply appropriate classloaders, so I figured it would just introduce more bugs if I toyed with the classloaders during the switch.

9:15 mavbozo`: triss: you can try to add (:require [goog.dom.classes]) in your namespace declaration

9:21 triss: ah mavbozo thats great

9:21 many thanks

9:21 so that puts everything from goog. in to my compiled js file?

9:22 mavbozo`: triss: i got that problem also when trying clojurescript. it turns out you have to declare require goog to make clojurescript compiler includes goog js library

9:23 in this tutorial by one of clojurescript maintainer http://swannodette.github.io/2013/11/07/clojurescript-101/ ,

9:24 in ns declaration there is require goog.dom

9:24 (ns async-tut1.core

9:24 (:require [goog.dom :as dom]))

9:25 triss: I'l take a peek thanks man

9:50 ehiggs: Hi all. I'm having trouble using cider-jack-in in emacs. I suspect this is due to me using lein from local dir instead of the lein command in the path. Is there a way to configure cider to use a particular lein script or should I just fiddle my path

9:51 mgaare: ehiggs: you can set cider-lein-command

9:58 ehiggs: mgaare: thanks. (setq cider-lein-command "...") ; in my ~/.emacs.d/init.el right?

9:58 mgaare: yes, that should do the trick

10:00 ehiggs: thanks. I'm crusty with emacs. had to restart it to get it working. :/

10:10 ordnungswidrig: ehiggs: I nobody looks, I edit my init.el with vi :-)

10:10 s/I nobody/If nobody/

10:19 timvisher-xubunt: i find that after i (austin-exec), if i don't do something basic like (+ 1 1) before loading a file, i get a massive amount of warnings spit out at the repl, and usually have to kill a bunch of threads. is there anything i can do to avoid that?

10:23 also, using cider 0.8.1 and austin-exec, i can't C-x C-e and see the results in either the repl window or the minibuffer. i have to C-c M-p all the time if i want to see the results of something. any way to fix that?

11:15 gfredericks: &(re-matches #"(?)" "") ;; any guesses what this means?

11:15 lazybot: ⇒ ""

11:15 clgv: it's questionable ;)

11:23 gfredericks: oh great; (?i) etc are position-sensitive

11:23 cursork: gfredericks: (? would normally indicate an inline modifier? e.g. (?i) for case-insensitive

11:24 gfredericks: right

11:25 llasram: gfredericks: Oh, so they change the global state for the remainder of the regex?

11:25 Glenjamin: inline modifiers generally mean "from here onwards", yah

11:25 llasram: "global" -> for the whole regex

11:25 Glenjamin: or do they :s

11:25 bah, i can never remember

11:26 llasram: Ah, seems not to escape match groups

11:26 ,(re-seq #"(?:(?i)foo)foo" "FOOfoo")

11:27 clojurebot: ("FOOfoo")

11:27 llasram: ,(re-seq #"(?:(?i)foo)foo" "fooFOO")

11:27 clojurebot: nil

11:27 Glenjamin: accprding to http://www.regular-expressions.info/java.html it's global for the regex

11:27 gfredericks: llasram: yep, and I think you can toggle them as often as you want

11:28 Glenjamin: oh, actually it only mentions putting it at the beginning

11:28 cursork: I only ever use (?i:foo) style myself...

11:52 sm0ke: i am using carbonite fork of sritchie, and when put in a web request facing call i get randomly java.lang.ArrayIndexOutOfBoundsException: -1

11:52 google says this has something to do with kryo being non thread safe

11:52 justin_smith: sm0ke: any stack trace with that?

11:52 sm0ke: anyone else faced this?

11:54 justin_smith: let me paste one

11:57 weird stack trace i am getting with this project

11:57 some dep is pulling soe fancy stack trace formatter

12:03 https://www.refheap.com/94580

12:03 ^^ justin_smith

12:04 if you see just before test.ns/thaw call which is nothing but read-bytes from carbonite

12:04 there is a into <- map <- reduce etc kind of thing going on

12:05 so basically there is a map which vals being deserialized

12:05 justin_smith: I just asked in case that showed something simple, but yeah, looks like you are right, it appears to be a problem in kyro, which i know nothing about

12:06 sm0ke: hurmm kryo is crazy fast for sure, just switched from nippy to it

12:06 i takes almost negligible overhead even for million calls

12:07 daviid: hello. i trigger lots of clojure pthreads [from guile/scheme] all executing imagej based code, here is an example of 1 of them, as reported by ps aux | grep clojure:

12:07 sm0ke: just that the api sucks

12:07 daviid: david 13275 0.0 0.0 4328 760 pts/0 S 13:50 0:00 /bin/sh -c cd /usr/lpdi/projects/clojure/jars; java -cp clojure.jar:ij-core.jar clojure.main /usr/lpdi/projects/clojure/watershed/watershed.clj /tmp/t50/pp pp-19-am-prep1 pp-19-am-prep2-ws png

12:07 david 13276 0.5 0.2 11263932 95536 pts/0 Sl 13:50 0:02 java -cp clojure.jar:ij-core.jar clojure.main /usr/lpdi/projects/clojure/watershed/watershed.clj /tmp/t50/pp pp-19-am-prep1 pp-19-am-prep2-ws png

12:07 clgv: sm0ke: which kryo version do you use?

12:07 puredanger: sm0ke: I'm the original author of carbonite

12:07 although I'm unlikely to be of much help at this point :)

12:07 sm0ke: puredanger: thanks for the reply, yep i saw you repo first

12:08 but doesnt seem to be update for a while

12:08 puredanger: certainly not by me :)

12:08 sm0ke: sritichie's fork otoh seems to be used in flambo too

12:08 daviid: i have 2 quizz: (1) is there a better way to launch java, for example a java server instead of many java -cp .. [must be, please excuse my ignorance, tx for hints]

12:08 sm0ke: puredanger: do you plan on brining it to life again?

12:08 its sure as hell rocking

12:08 puredanger: I'm not using it for anything so not really working on it

12:08 daviid: (2) these processes tend to sleep and i don't understand why, any one as a clue?

12:09 puredanger: sm0ke: it was the result of some stuff I was using internally at a former employer

12:10 clgv: sm0ke: what exactly do you need? "write once, read often"?

12:10 puredanger: sm0ke: at this point, I'd expect sritchie's version to be the more canonical one than mine

12:10 sm0ke: clgv: well yes its just a single value being fetched and deserialized

12:11 clgv: just a toy case i am working on

12:11 clgv: sm0ke: maybe you are interested in this lib https://github.com/guv/frost

12:13 sm0ke: clgv: thanks i will take a look

12:14 although i still think i just need some ThreadLocal wrapping

12:14 not sure of what though

12:14 i invsted the day working with carbonite and the results are delightful

12:14 EvanR: ,(function? identity)

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

12:15 EvanR: ,(satisfies? IFn identity)

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

12:16 Bronsa: ,(ifn? identity)

12:16 clojurebot: true

12:16 Bronsa: ,(fn? identity)

12:16 clojurebot: true

12:16 clgv: sm0ke: if you need to share the same "freezer" for multiple threads you can use one that performs locking

12:17 Bronsa: puredanger: I guess CLJ-1593 should be declined then?

12:17 sm0ke: oh so the registry is nothing but Kryo itself

12:17 stuartsierra: Error using CIDER: Lisp nesting exceeds `max-lisp-eval-depth' https://gist.github.com/stuartsierra/c5866f95513070da7f06 Anybody seen this?

12:17 sm0ke: hurm just need a thread local for it!

12:19 puredanger: Bronsa: well, I think the intent still exists, just may need to change form. I'm not going to really cleanup any PAM-related issues until after we get farther along on this in 1.8

12:19 clgv: sm0ke: java.util.ThreadLocal

12:20 sm0ke: clgv: yep on it

12:20 clgv: erm java.lang.ThreadLocal, I think ^^

12:21 sm0ke: you can use proxy and wrap it in an IDeref

12:21 sm0ke: yea so i think just replacing to (def kryo-registry (doto (ThreadLocal.) (.set (co/default-registry))))

12:21 should do the trick

12:21 Bronsa: puredanger: ok

12:24 sm0ke: clojurebot: why use a proxy?

12:24 clojurebot: Excuse me?

12:25 sm0ke: oops for clgv

12:26 justin_smith: stuartsierra: you can set the max depth in elisp - basically someone was coding as if elisp has tco, and it doesn't

12:26 andyf_: Bronsa: Do you happen to have anything in t.a(.j) libs for marking ASTs with something like a ?path? to that AST, e.g. a vector that could be passed to get-in and the root AST to reach a particular node?

12:27 stuartsierra: justin_smith: Yes, too much recursion in elisp is a good bet. But that gist is at the end of a long repeated sequence. I assume it's an infinite loop in elisp, but I don't know where or why.

12:27 Bronsa: andyf_: no; should be easy to add as a prewalk pass though

12:28 justin_smith: stuartsierra: you could look for something unique to cider in that trace somewhere, and set it to debug-on-entry, you'll likely see the issue pretty quickly if you step through it

12:29 andyf_: Bronsa: Yep. It seems to need something in walk itself to pass the next portion of the path to the pre/post functions, though, unless I'm missing something obvious. I will try an implementation that way.

12:29 Bronsa: andyf_: if you give me 5 minutes I can sketch it for you

12:30 brucehauman: bbloom: you here?

12:30 andyf_: If there's nothing else you would rather work on, sure :) I was just trying to avoid writing it if it iwas already there.

12:30 stuartsierra: justin_smith: OK, will try that if it reappears, thanks.

12:30 EvanR: is there a form that lets me put an assert, and an expression it evaluates to if passed

12:30 (do (assert..) foo) ?

12:31 justin_smith: stuartsierra: I don't know if you've used the step debugger, but debug-on-entry is an M-x command that takes a lisp function name as an arg, pretty straightforward

12:32 stuartsierra: justin_smith: Was just looking that up. :) I haven't debugged Elisp much, but given how much I hack around with it I probably should.

12:33 justin_smith: it's a pretty nice integrated experience actually - the cursor moves through the source file following the code, the results of each nested evaluation show up in the minibuffer, etc.

12:33 and it goes by sexps, not lines

12:36 stuartsierra: justin_smith: cool, thanks

12:36 * stuartsierra steps away

12:40 Bronsa: andyf_: http://sprunge.us/RVec?clj

12:41 andyf_: Grazie! Yeah, definitely simpler on its own like this than trying to mingle it with walk.

12:42 Bronsa: andyf_: you still have to call it in a prewalk

12:44 timvisher-xubunt: is clojurescript :require-macros deprecated at this point?

12:44 using (:require [clojure.core.async :refer-macros [go])) produces errors for me

12:46 bbloom: brucehauman: yeah, what's up?

12:46 Bronsa: andyf_: http://sprunge.us/VdBe?clj alternative version that uses the index-vector-nodes pass

12:47 brucehauman: bbloom: you have a second to talk about what your set up is? I really want to understand a bit better.

12:52 sm0ke: ThreadLocal seems to be the trick indeed, i cannot break it even for more than ~40k deser per sec

12:53 but it brough me to a weird conclusion that (.set..) on Threadlocal is not blocking

12:55 bbloom: brucehauman: yeah i can talk, but i may be a liiiitttle slow on individual responses

12:55 multitasking

12:56 sm0ke: here a tip if someone is interested https://gist.github.com/kul/15a6cdb8862586248473

12:57 brucehauman: bbloom: my assumtion is that you are working on clj (not cljs) files a lot and that is causing cljsbuild to race? Is that right?

12:57 bbloom: brucehauman: yeah, i have a fair number of macros

12:57 brucehauman: i'm using figwheel right now on one major project that's basically ~3 cljs files and ~2 clj files

12:58 1 cljs file is the pretty simple frontend driver page

12:58 the other 2 files are paired w/ their macro files & are pretty heavy algorithms, transformations, etc

12:58 brucehauman: bbloom: yeah that is the problem then. Cljsbuild deletes the whole build (all cljs deps) if a clj file changes

12:58 bbloom: 1 depends on the other too, so it's really only an A->B->C where B & C also have macros

12:59 brucehauman: grumble grumble

12:59 brucehauman: i know it's far from your fault (hell, it's more my fault!) but the cljs tooling blows

12:59 brucehauman: bbloom: it would be better if it only delted libs on the source-paths

12:59 bbloom: i know that dnolen_ is interested in speeding up cljs builds

13:00 i keep meaning to invest some time of my own in to it too

13:00 i probably would have done so already if figwheel didn't get me through a week or two of work on a new project :-)

13:00 brucehauman: bbloom: thanks man.

13:00 dnolen_: brucehauman: bbloom: this just sounds like lein-cljsbuild broken in this regard

13:00 instead of complaining submit patches

13:01 brucehauman: dnolen_: absolutely

13:01 bbloom: dnolen_: oh c'mon man, that's not fair: you know i contribute

13:01 rurumate: is it possible, using clojure.match, to match the case that 2 arguments are equal / not equal? see https://www.refheap.com/94569

13:01 bbloom: complaining is just part of my process :-)

13:01 rritoch: Hi, this is a bit of a Java question, related to a thread I saw on clojure-dev. I noticed in the code there is a lot of casting native types to the number class such as int a; (Number)a; As far as I know this isn't valid java code either and should be (Number)(new Integer(a)), can someone clairify this issue and if this could be why some code doesn't run on android?

13:01 dnolen_: bbloom: patches to ClojureScript are great - but patches to lein-cljsbuild are great too :)

13:02 rurumate: rritoch: can you point to "the code"?

13:02 bbloom: dnolen_: but i kinda just want the cljs compiler to be better -- i'm not sure why cljsbuild needs to be a separate thing beyond maybe a trivial lein alias or two

13:03 dnolen_: bbloom: I'd rather the tools were smarter about using the cljs compiler

13:03 rritoch: rurumate: Ok, one moment, I need to check git because I'm reprogramming this class to get a new feature.

13:03 rurumate: rritoch: which project?

13:03 bbloom: dnolen_: it's not clear to me what cljs needs to do -- and i've looked at the source. there seems to be lots of redundancy with closure.clj

13:04 dnolen_: bbloom: all the big enhancements to the compiler have tickets in JIRA right now

13:04 bbloom: i dunno if that's 1) historical 2) b/c ppl don't understand clojure.clj or 3) b/c it isn't extensible in the right way

13:04 s/clojure.clj/closure.clj/ # sheesh

13:04 dnolen_: a) AOT clojurescript b) cache analysis c) cache core.cljs analysis & output d) allow for in memory caching (no disk)

13:05 brucehauman: dnolen_: quick question. does the cljs compiler block until all files are written?

13:05 dnolen_: brucehauman: there is no parallel writing of files if that's what you mean

13:05 rritoch: rurumate: Here is one example. https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Numbers.java#L3807-L3809

13:05 brucehauman: dnolen_: I’m just wondering if the call to build ends after all files are written to disk

13:06 dnolen_: bbloom: as far as the macro issue, there's absolutely no need for lein-cljsbuild to be so block headed about it

13:06 liflash: hi, i'm using cljs-ajax and whenever i send a post request i get a 'syntax error' in the js console of the browser, even though the body of the handler function is called correctly. any ideas?

13:06 dnolen_: analysis contains the macro dependency informatino

13:06 blowing away the compilation environment on clj files changes is ridiculous

13:06 rritoch: rurumate: As for my coding, I'm trying to add support for custom numeric types.

13:07 alandipert: altho it can’t be known statically what a clj macro depends on because var dynamism, no?

13:07 dnolen_: brucehauman: I would expect so yes

13:07 rritoch: rurumate: It certainly isn't sanctioned by anyone, but I noticed a lot of code like this that my IDE reports as invalid code.

13:07 brucehauman: dnolen_: could you point me to how I would get at the analysis data?

13:08 dnolen_: brucehauman: sure, even better if you write up a patch that makes a public api for common operations for everyone :D

13:08 brucehauman: dnolen_: that would be very useful

13:08 rritoch: rurumate: The code compiles though, which makes me think this illegal numeric casting from native types to numbers is why clojure has issues in ARM.

13:08 bbloom: brucehauman: have you been contributing to cljsbuild too?

13:08 brucehauman: dnolen_: I’m interested because I need that data

13:09 bbloom: not yet …

13:09 bbloom: but it’s inevitable

13:09 bbloom: I’ve read all the sourece

13:09 bbloom: brucehauman: like i said, i'm still not sure what it does that the core compiler doesn't do .. besides maybe the file watching

13:09 brucehauman: bbloom: I have had to hack the heck out of it

13:10 bbloom: brucehauman: if i don't understand it, it's either 1) unnecessary or 2) unnecessarily complex :-)

13:10 rritoch: rurumate: I'm not sure so I figured I'd run the idea here to see what people thought about this, and how this code is compiling or functioning, other than possible a fluke that most runtimes don't support native types and always use the object equivalents internally.

13:10 dnolen_: brucehauman: https://github.com/swannodette/hello-cljsc/blob/master/src/hello_cljsc/core.clj

13:10 brucehauman: I wrote a whole intro to the ClojureScript compiler

13:10 brucehauman: dnolen_: I remeber that, and I remeber thinking I would go through it ...

13:10 dnolen_: brucehauman: basically everything is stored in a single atom

13:11 bbloom: on other past cljs projects, i ignore cljsbuild and just use the compiler directly & that's worked pretty well for my needs -- so i think it's worth figuring out if we can delete a lot of code...

13:11 brucehauman: dnolen_: coolness

13:11 dnolen_: [::namespaces some-ns] will give you the namespace map

13:11 brucehauman: it includes everything

13:11 er

13:11 [:cljs.analyzer/namespaces some-ns]

13:11 brucehauman: dnolen_: I will look into it

13:12 bbloom: brucehauman: dnolen_: thanks guys

13:12 brucehauman: dnolen_: thanks

13:12 bbloom: thanks to you as well man

13:13 bbloom: brucehauman: dnolen_: let me know if i can help somehow

13:13 rurumate: rritoch: that cast sure does look a bit unfamiliar

13:14 rritoch: rurumate: Ok, I'll post to dev and see what they think. It can't hurt even if I'm wrong.

13:14 rurumate: rritoch: can you cite a source for the ARM problemms?

13:14 hiredman: rritoch: what? why in the world would that have anything to do with arm?

13:16 rritoch: rurumate: It was posted on clojure-dev https://groups.google.com/forum/#!topic/clojure-dev/C2od-z36Tc4

13:16 hiredman: rritoch: that is android

13:16 rritoch: the issue with android is it is not a real jvm

13:17 rritoch: hiredman: Did you look at the code I'm talking about though?

13:17 hiredman: the (Number) cast there uses autoboxing

13:17 the long is autoboxed to a Long and then cast to Number

13:18 rritoch: hiredman: Ok thanks. This is my first time hearing of autoboxing... I always use new NumericType(num) syntax.

13:19 hiredman: rritoch: use the valueOf method if you are going to do that

13:19 rritoch: hiredman: Mostly because my IDE complains

13:20 hiredman: http://stackoverflow.com/questions/2974561/new-integer-vs-valueof

13:21 rritoch: java IDEs often try to pretend the more dynamic features of the jvm and java don't exist

13:21 Deraen: liflash: You could try cljs-http instead of cljs-ajax: https://github.com/r0man/cljs-http

13:21 zB0hs: hey everyone, I'm new to clojure and was interested in hearing from a few people about their favorite clojure/clojurescript learning resources. ive done some googling but wanted to ask here as well

13:21 timvisher-xubunt: is there any way to tell if i core.async/chan has anything in it?

13:21 and maybe even what it is?

13:21 i'm not asking for production code but just trying to debug something

13:22 i believe there should be something on a channel but (go (println (<! the-chan))) isn't printing anything

13:22 i'm probably way off base as far as how to use this though :)

13:22 liflash: thx Deraen , you think it's a problem within cljs-ajax? why do you prefer cljs-http?

13:23 dnolen_: timvisher-xubunt: if it's not printing anything then there's nothing there :)

13:23 timvisher-xubunt: according to the tutorial, i should be able to <!! but that doesn't appear to be defined in cljs.core.async?

13:23 justin_smith: timvisher-xubunt: remember that println may not be going to the same value of *out* in a go block as it would in your top level repl

13:23 oh, but in cljs this may be a moot point

13:23 dnolen_: timvisher-xubunt: in all seriousness the best way is to provide your inspectable channels that satisfy the protocols, the existing implementations are very opaque

13:24 hiredman: rritoch: fyi, you keep refering to native types, the jvm has primitive types, which are not the hardware native types of any platform, they are definided in the jvm spec

13:24 timvisher-xubunt: dnolen_: are there alternate implementations that are inspectable?

13:24 to which protocols do you refer?

13:24 dnolen_: timvisher-xubunt: I don't know haven't looked

13:24 timvisher-xubunt: you're going to have to goto the source

13:24 timvisher-xubunt: dnolen_: ok :)

13:26 am i right that there's no way to take from channels outside a go block in cljs?

13:26 dnolen_: zB0hs: Clojure Programming, Joy of Clojure, Clojure Cookbook

13:27 zB0hs: no definitive resource for ClojureScript, largely because it's primarily about understanding compiler options and client side web development (not significantly different language wise and getting closer as time passes)

13:27 hiredman: and there are actual jvms for arm, which run clojure great

13:27 zB0hs: dnolen_ those were all on my radar. great to hear them listed. thanks!

13:28 dnolen_ also hearing you on jsj and reading your blog got me interested in this realm so thanks for that too!

13:28 dnolen_: zB0hs: videos from Clojure conferences are also very informative starting points for methodology, libraries, best practicies etc.

13:28 zB0hs: https://www.youtube.com/user/ClojureTV

13:29 hiredman: android is a terrible bate and switch, it has been sort of pretending to be java / a jvm runtime for years, but is now shedding that pretense

13:30 dnolen_: zB0hs: cool, I'd focus on Clojure stuff to start, ClojureScript is great but you got bogged down in configuration details way too fast if you're not careful

13:30 s/got/get

13:31 Deraen: liflash: I had some problems with cljs-ajax when I tried to use it, never found the reason. Also I like that cljs-http code is easier to read.

13:41 timvisher-xubunt: i don't understand the behavior here: https://gist.github.com/feb385d634143e08114a

13:41 it looks like there's some sort of buffering between when the body of the go block gets executed and when i put things onto the channel

13:42 almost as though the channel is of size 2 and takes don't happen until something is forced out of the channel by something else putting something on to it

13:42 does that make any sense?

13:44 which also looks about right as far as what i was seeing before. if i >! again onto my input channel, then my output channel gets some stuff

13:44 ppppaul: can i use instants in clojurescript?

13:44 dnolen_: ppppaul: yes

13:46 ppppaul: dnolen_, do you know of a link to help me do so?

13:46 is the ns cljs.instant?

13:46 dnolen_: ppppaul: I thought you were talking about instant literals, are you not?

13:47 ,(java.util.Date.)

13:47 clojurebot: #inst "2014-12-08T18:44:53.846-00:00"

13:47 dnolen_: ppppaul: ^

13:47 timvisher-xubunt: yeah, consistently i don't see my printlns until after i put something new onto the input channel. i'm probably misderstanding something about println and the async nature of taking from a channel?

13:47 nonrecursive: zB0hs: there’s also http://aphyr.com/posts/301-clojure-from-the-ground-up-welcome http://learnxinyminutes.com/docs/clojure/ http://yogthos.github.io/ClojureDistilled.html

13:47 zB0hs: nonrecursive: noted... i will check them out. thanks!

13:47 nonrecursive: np :)

13:48 ppppaul: ok. nothing was showing up on light table so i thought i was using them wrong

13:48 cfleming: dnolen_: I got some answers to my debug protocol questions BTW - I had to go to IRC in the end.

13:48 dnolen_: cfleming: for the browser debugging protocol stuff?

13:48 cfleming: dnolen_: yeah

13:49 dnolen_: Using the protocol will allow code hot swapping while stopped at a breakpoint

13:49 dnolen_: So you could have an active REPL on a system that's being debugged - pretty cool

13:50 dnolen_: cfleming: very cool

13:50 cfleming: cfleming: Access to the standard developer tools is a problem, but there's https://github.com/sidorares/crmux, so I can expose a proxy

13:50 puredanger: rritoch: re your earlier questions on numerics, Java does autoboxing/unboxing between primitives and objects so the code you reference is valid Clojure

13:50 cfleming: arg, talking to myself again

13:50 ppppaul: is there a cljs.instant ns?

13:51 puredanger: rritoch: sorry, valid *Java*

13:52 rritoch: puredanger: Thanks, hiredman already explained the autoboxing. It wasn't something I'm familar with because my IDE doesn't like it.

13:53 puredanger: then your IDE is old ;) autoboxing was added in Java 5 (? I think?)

13:53 bja_: ppppaul: doesn't seem like it. I've used: https://github.com/andrewmcveigh/cljs-time before to reasonable effect

13:54 rritoch: puredanger: Anyhow, this entire feature of making custom numeric types is to make it easier to manipulate bytecode but I always assumed android had a compliant JVM so that does add a new twist to my projects as I never even thought to test against android.

13:56 hiredman: http://en.wikipedia.org/wiki/Dalvik_%28software%29 http://en.wikipedia.org/wiki/Android_Runtime

13:56 puredanger: rritoch: when Android came out it used Dalvik and only supported pre-Java 5 iirc, not sure if that was added later. And I gather now they are using ART instead of Dalvik which has had a few incompatibility issues with Clojure gen'ed code (some Clojure's fault, some theirs as I understand it).

13:57 hiredman: puredanger: really? I mean, if the code clojure generates follows the jvm spec, and they reject it, is that clojure's fault?

13:59 timvisher-xubunt: i'm guessing that stdout is not being flushed prior to the next Read, so it only looks like the printlns are being delayed

13:59 puredanger: hiredman: no, although I gather some code we generate may not necessarily conform to the spec (see http://dev.clojure.org/jira/browse/CLJ-1472 - I haven't really dug into it yet)

14:02 hiredman: puredanger: I have yet to see any evidence that the generated byte code doesn't conform to the spec

14:02 (I've grepped the jvm spec for monitor and not found any evidence)

14:02 puredanger: as I said, I haven't read it closely enough to say.

14:03 so I'm leaving it in the "suspicious" category till I can :)

14:05 hiredman: looking at the linked android issue, it sounds like they are fixing it on their end

14:05 https://code.google.com/p/android/issues/detail?id=80687

14:07 dnolen_: timvisher-xubunt: your gist doesn't make any sense to me btw, I've never seen that behavior

14:09 Bronsa: hiredman: the first patch in that clojure ticket seems to be reasonable

14:10 timvisher-xubunt: dnolen_: i was misinterpreting it. i can just hit return at the next prompt and the printlns show up

14:10 probably some combination of cider 0.8.1 and what i'm doing

14:11 dnolen_: first time i'm doing anything with core.async so i'm pretty behind the 8-ball :)

14:11 hiredman: Bronsa: well, it introduces other issues (which could be fixed)

14:12 Bronsa: because the compiler sometimes hoists a try/catch out in to another function, you can end up with the monitor-enter and monitor-exit in different functions, which android also doesn't like

14:12 (actually thinking about it, I am not sure that could be fixed easily)

14:14 (again, not that I've seen anything in any documentation that forbids that)

14:14 Bronsa: hiredman: right but I haven't seen anything in the jvm spec that says monitor enters/exit needs to be in the same method

14:15 hiredman: right

14:15 Bronsa: but android tools complain if they are not

14:15 which is what the whole ticket is about, so changing things to make android tools happy, in a way that makes android tools unhappy, seems like a bad idea

14:16 Bronsa: hiredman: I mean, it seems like they complain about it even the way it is now -- error for error at least in the jdk that patch makes the behaviour more accurate

14:16 hiredman: does it?

14:17 Bronsa: hiredman: the way locking is implemented now doesn't take into account monitor-enter failing at aquiring the lock

14:18 which according to the spec can only happen if the object ref is null

14:18 uhm, but null makes monitor-exit throw aswell so maybe it's not actually an issue

14:18 hiredman: right

14:19 https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-2.html#jvms-2.11.10 is actually interesting

14:19 the structured locking stuff may require that monitorenter and exits line up in a single method

14:21 puredanger: We used to split things up like this in Terracotta bytecode instrumentation and Unsafe has mechanisms for it as well (if you need it from Java) so it's not that weird

14:21 Bronsa: hiredman: 2 seems to imply that some jvms might consider the bytecode emitted for (locking nil) invalid

14:23 hiredman: Bronsa: for a literal nil

14:25 ppppaul: do multimethods work in clojurescript?

14:25 benmoss: ppppaul: yep

14:25 ppppaul: :D

14:34 {blake}: Is there are a Clojure lib for managing session =resources=, i.e., when a user logs in and certain resources are allocated, some code to keep track and free those resources after a certain idle period?

14:36 justin_smith: {blake}: if you make sure the only handles to those resources are in that user's session, then setting the session to nil at a later time would be sufficient to let the jvm know it can reclaim those resources

14:38 {blake}: justin_smith: Ahh...okay, so I'm missing a step. What is the "user's session"? Right now I have a login that sets the user's name and carries that through (using ring.middleware wrap-session). There's something more full-featured I should be using?

14:38 justin_smith: {blake}: well, that depends on how you are asking wrap-session to store the session

14:39 in-memory should be the default

14:39 {blake}: I don't have much of anything.

14:40 just a "(sesh/wrap-session)" call in my app handler.

14:40 And an assoc on the :session key to put in the user's name.

14:41 And I was just going to create a set to hold that user's data.

14:41 Which I would, I guess, free at some point of idleness.

14:41 justin_smith: right. It may be that the right thing to do is to implement your own in-memory session, so that you can do periodic cleanup: https://github.com/ring-clojure/ring/wiki/Sessions see the last heading, session stores

14:42 ticking: is anybody manipulating xml with clojure? clojure.xml and clojure.data.xml are both currently broken. The first doesn't escape properly and can't handle whitespace, the second can't handle namespaces and whitespace.

14:42 {blake}: justin_smith: Cool. I hadn't quite read that far, thanks.

14:42 justin_smith: {blake}: you could use an atom to hold the sessions, and clear out the older sessions from the atom, for example

14:42 {blake}: (inc justin_smith)

14:42 lazybot: ⇒ 154

14:43 {blake}: justin_smith: Do I need an atom? I guess it makes sense to have it.

14:43 justin_smith: ticking: what do you mean by "can't handle whitespace"

14:43 {blake}: ticking: I've parsed some very complex xml in Clojure.

14:43 chouser: ticking: If you need robust namespace support, you'll probably need to use a Java library directly via interop.

14:43 justin_smith: {blake}: you need some kind of thread safe store for lookup, that can hold arbitrary clojure resources

14:44 chouser: ticking: Though there is ongoing work to add good namespace support to data.xml

14:44 {blake}: So I could put my set into the atom and manage that. OK.

14:45 justin_smith: {blake}: given how sessions work, I would think an atom wrapping a map from identifier to set

14:45 where each identifier looks up a unique user session

14:46 ticking: justin_smith {blake} chouser: whitespace is always trimmed as content so "> <" is always nil. And the namespacing doesn't have to be sophisticated but shouldn't blow up once you read and emit something with schema reference in the head.

14:47 {blake}: justin_smith: I'm not getting the division of responsibility. When I use "(wrap-session handler}" what's being stored?

14:48 ticking: You want to distinguish between nil and blank? I may have had that issue, I don't recall.

14:48 justin_smith: {blake}: that will invoke the default session (in-memory, iirc) which maps from some unique ID of that client to their session state

14:48 {blake}: justin_smith: Yeah, in memory by default. But what is the session state? Is it just what's stored in the :session map that gets passed around?

14:49 ticking: {blake}: yeah, the StAX parser clojure.data.xml uses can do this, but the code that feeds it data from a stream breaks it. There is a year old patch for this but it never got integrated thanks to a missing CA...

14:49 justin_smith: right, the server looks it up when it gets the request, and attaches it to the :session key so your handler can use it

14:50 {blake}: justin_smith: So it's not going back to the client? Could I use that instead of an atom? (Just trying to figure out the limits.)

14:51 justin_smith: {blake}: the client just gets the id used for lookup. Clearly you can't store your jvm data on the client :)

14:51 {blake}: ticking: It's been a few months (and it was the first serious project I had) but I did roll some of my own code for breaking stuff down--Oh, yeah, I remember now I had to do something to make the branches symmetrical because of the nils.

14:51 justin_smith: {blake}: you can use a cookie store to serialize the data, but that doesn't manage the resources, for obvious reasons

14:52 {blake}: the in-memory store can hold the resources, so then all you need to do to release them is reset the storage for that key

14:52 as long as you don't hold onto them elsewhere, of course

14:52 rritoch: I have successfully implemented generic types -> https://github.com/rritoch/clojure/commit/da081acfadcf427e4ef38db8c681e127aa9ed344 (but I do have to revert some of my changes because they weren't needed), regardless it functions properly even if not as expected.

14:54 {blake}: justin_smith: Right now, I have "(assoc (resp/redirect "/") :session {:user username})" after my log in to associate the user name with the current session. So I could do "(assoc (resp/redirect "/view/whatever") :session {:work workbookstructure})"?

14:54 ticking: {blake}: yeah, it making me a bit sad that the xml libs are in such a bad state

14:54 {blake}: ticking: It's a JSON world...

14:55 ticking: {blake}: yeah if I had any controll over the data that I get, I'd use EDN ;P

14:56 {blake}: ticking: The bright side, at least in my case, is that it was pretty easy to fill in the gaps. I wrote (with a lot of help from folks here) routines to fill in the gaps.

14:56 rritoch: Err, I mean custom numeric types.

14:56 amalloy: {blake}: you probably want assoc-in, right? don't overwrite the whole dang session, just add the :work key?

14:57 {blake}: amalloy: Thank you, I would've screwed that up.

14:57 (inc amalloy)

14:57 lazybot: ⇒ 203

14:57 {blake}: Crap, I missed the Rich Hickey cardboard cutout presentation ceremony.

14:58 amalloy: {blake}: it turned out there was a mixup and they sent rich a cutout of me

14:58 justin_smith: {blake}: yeah, that's the idea. But if you want to ensure timely cleanup, you either need to implement your own store (that you can easily access), or find some means to access and clear the default store (if that exists, it's not very prominent in the documentation)

14:58 joshuafcole: hahaha

14:58 {blake}: amalloy: ha!

14:59 rritoch: It gives me problems with my unsigned types though since an unsinged type can't be negated and negate is how subtraction is implemented so this needs some more adjustments to fully support unsigned types.

15:00 {blake}: justin_smith: OK. I think I gotta review all the compojure materials I have. It's hard for me to believe they didn't cover this. (But it's so hard to make that stuff stick without a live project.)

15:00 justin_smith: {blake}: I don't think the session store is meant to be easy to access outside the context of a request. Which makes sense, but you have an overriding concern. You may or may not need to design your own store for that purpose.

15:01 {blake}: justin_smith: Yeah, I basically just want to free the memory up after an hour of idleness or so.

15:02 justin_smith: https://github.com/ring-clojure/ring-session-timeout <- if this doesn't do what you want, something in its source should let you know how to do it

15:02 "Middleware that times out idle sessions after a specified number of seconds."

15:02 sounds right to me!

15:03 {blake}: justin_smith: Yep. Perfect! Thanks again!

15:04 justin_smith: {blake}: that isn't quite right though... it only times out a session if it is being accessed

15:04 {blake}: justin_smith: lolwut?

15:04 justin_smith: if you had some resource in a session, and the user does not come back for months, the data would stay in their session until they come back and the timeout is triggered

15:04 there is nothing in the code that checks the store

15:04 {blake}: justin_smith: Heh. I'm trying to imagine the use of that.

15:04 justin_smith: the use of what?

15:05 daviid: let me try again :) i'm looking for help/tips/tricks/hints facing this [terrible] problem: clojure scripts, run using java -cp ..., triggered from guile [but i don't think it matters] are going in sleep mode, for ever, especially if i run the parent script [that prepares and handles the triggered threads] remotely, through an ssh -CX session, and i just don't know why and what i could do to debug.

15:05

15:05 {blake}: Holding on to something forever? Unless...it's checked on again?

15:05 daviid: here is the code: the command 'watershed-cmd', and the scheme code that runs it [for info], then in the same paste, below, all threads entered sleep mode after a short while, for ever [as i write, i'm still waiting for a short test case that locally runs in a couple of min on my not so fast laptop

15:05

15:05 http://paste.lisp.org/display/144632

15:06 justin_smith: {blake}: well, that's what that timeout session middleware does. As I mentioned before, you need some way to scour all sessions (not just the current) and scrub all the old ones.

15:06 and this doesn't actually do that

15:06 {blake}: justin_smith: OK, but under what circumstances would one say "Hold on to these resources as long as the person never comes back"?

15:07 justin_smith: {blake}: you never say that

15:07 but that is what it does

15:07 it only does the cleanup when they send a request

15:07 {blake}: So, maybe meant to be used with something else, then.

15:07 daviid: i'm not saying it is clojure by the way, it could be the kernel, java, ssh related and/or the combination of these, but the problem is real

15:08 justin_smith: {blake}: it's for security - even if the session gets stolen it is only usable for a limited time. It's not meant for conserving resources.

15:08 amalloy: daviid: is your clojure program trying to read from a disconnected stdin?

15:09 {blake}: justin_smith: OK, got it. Security isn't really a concern.

15:09 daviid: amalloy: let me paste the clojure script, give me a second

15:09 amalloy: or just declining to write to its stdout? it sounds like guile is blocking forever, which would make sense if no output is ever written while it waits to read a line

15:12 daviid: amalloy: here is the code: http://paste.lisp.org/display/144632#2

15:13 {blake}: Ooh, I may have just thought of a better way to handle this.

15:13 justin_smith: {blake}: yeah, looking at the source, the memory store is pretty simple, it's just an atom over a map as I was mentioning above: https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/middleware/session/memory.clj problem is that that atom is hidden in a lexical closure, so you can't query it arbitrarily https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/middleware/session.clj#L94

15:14 amalloy: okay, so you never write to its stdout at all, right? does that mean that guile will be left waiting forever for read-line, or does that throw an exception of some sort when the process ends?

15:15 daviid: amalloy: not sure, let me try to write something to stdout from clojure, how do i do that?

15:15 amalloy: daviid: um, it's println. just what you're doing in the error case

15:15 justin_smith: {blake}: actually, no - if you changed your code so your bind the call to (memory-store a) where a is an atom you made, then you can access the sessions as the values in that atom whenever you like

15:15 daviid: ok, trying

15:15 justin_smith: {blake}: I finally noticed it allows you to pass in your own atom, that would be the right way to do it

15:16 {blake}: justin_smith: Good to know.

15:16 But I think I've come up with a simple handling. The deal is that my users are accessing Excel spreadsheets, which I'm parsing and creating interfaces from. And since I'm updating as they type, I don't want to repeat the reading/parsing step every time. There's really no state.

15:16 daviid: amalloy: i thought, naively, that system/exit did write something

15:16 {blake}: So if I just keep the spreadsheets, parsed and pure in memory, I can stub out the read/parse thing entirely. And to hell with saving state.

15:16 amalloy: daviid: System/exit is ripping the plug out of the wall

15:17 {blake}: <--anti-statist

15:17 justin_smith: {blake}: aha - so your issue is knowing when you can release that interface to the spreadsheet

15:17 if you even need to at all that is...

15:17 {blake}: justin_smith: No, it's just a matter of eliminating the read/parse step. Everything else can be done from scratch every time.

15:18 justin_smith: {blake}: you could memoize the function that does the read/parse

15:18 {blake}: Because "everything else" is just "populate inputs" and "update outputs".

15:18 justin_smith: that may be the simple way to do it

15:18 {blake}: justin_smith: Ooh. Even better.

15:18 justin_smith: as long as the read/parse results don't grow into a store of unweildy size, of course

15:18 {blake}: justin_smith: I'd need a way to dirty that. De-memoize it.

15:19 justin_smith: They gotta be in memory for any of it work anyway. I mean, unless they come up with hundreds and hundreds of these, I can't see it being too big a problem.

15:19 justin_smith: core.memoize has stuff for that https://github.com/clojure/core.memoize

15:20 amalloy: this doesn't sound like a problem that memoization will help much. like, these things are changing all the time, right, as users are typing at them?

15:20 {blake}: justin_smith: And it even has caching strategies so I can deal with it if they do have bunches of them.

15:21 amalloy: you kinda need an in-memory model of them; you don't want to keep calling (read-from-disk), writing out one byte, and then dirtying the cache so that the next read-from-disk actually goes to disk anyway

15:21 {blake}: amalloy: Well, it's basically A (source) + B (input) = C (output). "A" doesn't change and is the time-intensive part.

15:21 amalloy: mmmm. but you said you need to dirty it

15:22 {blake}: amalloy: "A" can change under a relatively extraordinary occurence, i.e., someone replaces the spreadsheet.

15:22 amalloy: But not on the same order of magnitude as typing inputs.

15:22 Sorry, I was switching scales there without mentioning it.

15:22 amalloy: okay. a cache of A seems fine

15:23 {blake}: I think so. I just have to refresh the cache in that one case.

15:23 amalloy: i wouldn't use clojure.core/memoize. core.memoize + core.cache are, to me, a confusing labyrinth that doesn't seem to accomplish much; but if you think it makes your life easier than doing it from scratch feel free

15:25 {blake}: Bummer. Well, I could just store the raw sheets in a map.

15:25 There's a built-in memoize distinct from core.memoize?

15:31 justin_smith: {blake}: there is, it just has no option to prune the memoized results

15:31 daviid: amalloy: that did not solve my problem, all java threads hangs the same way [i added this (println "ok") just before (System/exit 0)

15:35 amalloy: *shrug* sounds like something weird is happening in your image library. debug with the ancient method of "binary search by println" to see where it gets stuck, then figure out why, i guess

15:38 EvanR: .oO(automatic println bisector debugger)

15:38 hfaafb: ;)

15:39 daviid: amalloy: i could comment all imagej lines and see

15:40 justin_smith: daviid: tools.trace is very handy if you don't want to have to insert / remove printlns by hand. I have it in my :dev profile in ~/.lein/profiles.clj

15:41 daviid: justin_smith: tx

15:41 EvanR: do you still have to insert / remove traces by hand

15:41 justin_smith: EvanR: no, you call a function which wraps the functions in trace output

15:41 EvanR: all functions?

15:41 justin_smith: EvanR: that can be done per function, or in one go to every function in a namespace

15:42 EvanR: that sounds pretty handy

15:42 justin_smith: you probably wouldn't want to do it in all functions in all namespaces :)

15:42 amalloy: justin_smith: daviid is running via java -cp with exactly two jars, clojure.main, and doing everything at the top level of his namespace. i think adding more libraries is a level of sophistication that will just make things harder

15:42 timvisher-xubunt: shouldn't i be able to reference events/KeyCode after (:require [goog.events :as events]) considering KeyCode is a public enumeration according to http://docs.closure-library.googlecode.com/git/namespace_goog_events.html

15:42 justin_smith: amalloy: ahh, I was not aware. being able to use tools.trace is enough reason to start using lein or at least maven, I think.

15:45 * daviid is writing a dummy.clj script that just println, give him a sec we'll see

15:45 {blake}: justin_smith: I think the memory problem goes away. The only thing that persists in memory is one copy of the original workbook. All else is transient.

15:46 timvisher-xubunt: it seems that events/KeyCodes and events/KeyNames are both undefined

15:46 justin_smith: {blake}: awesome

15:49 timvisher-xubunt: goog/events/keycodes.js is in the closure-library jar i'm using...

15:51 i'm only doing whitespace optimizations so it should be present in the output

15:52 ah, but it's not.

15:52 interesting.

15:54 dnolen_: timvisher-xubunt: (:require [goog.events.KeyCodes]) or (:import [goog.events KeyCodes])

15:55 just requiring goog.events is not enough

15:57 timvisher-xubunt: dnolen_: just figured that out. i can't tell what's different between KeyCodes and, for instance, EventType though.

16:00 daviid: amalloy_: it indeed does not hang on dummy.clj, which i added before to call watershed, so you tend to think it is imagej, let me see if i can upgrade

16:01 {blake}: justin_smith: Life without state is good.

16:04 arohner: I don't suppose there's a test.check lib for generating ring requests, is there?

16:04 weavejester: arohner: Not that I know of, but that would be rather interesting.

16:04 arohner: Maybe you could use Herbert?

16:04 daviid: imagej is written in java, which is why i use clojure, i'm a very basic imagej user and have no knowledge at all of java. i wonder why it works when not remote. it probably is because of X [although i do not open any window...

16:05 benmoss: how would one go about making a clojure library available in clojurescript?

16:05 cljx?

16:05 daviid: java do not like ssh -CX session i gues

16:05 arohner: weavejester: interesting, thanks

16:06 mdrogalis: benmoss: Yeah.

16:07 benmoss: sad that even if you dont need any feature expressions its still the only way to accomplish it

16:09 mdrogalis: benmoss: I could be wrong, but I think that's how it's usually done.

16:09 daviid: i ment imagej do not like ssh -X sessions, but why does it not complain/bug inste4ad of hagging?

16:09 dnolen_: benmoss: hopefully to be sorted out before 1.7.0 goes out

16:10 benmoss: hope so!

16:24 hlship: Are there official docs about &env and &form (used with defmacro)? Are these officially supported?

16:24 mkr: I try to parse a page and create a nested table of contents from the h1..h6 tags als ol->li->ol... list.

16:24 https://gist.github.com/kremers/40032730ae36a8816901

16:25 dnolen_: hlship: there aren't official docs, but yes they are officially supported

16:25 mkr: Is there a better way? I don't get the "last" element with (for) so I need something that offers sequencial processing like reduce?

16:35 stuartsierra: &form is pretty obvious: the macro form, before expansion. &env is a map of local symbol bindings: the keys are symbols, the values are compiler details that aren't very useful to a macro writer.

16:35 lazybot: java.lang.RuntimeException: Unable to resolve symbol: form in this context

16:49 amalloy: stuartsierra: can you think of a reason that a macro writer would need access to &form except to inspect metadata? it seems that you could otherwise just reconstruct the form by consing the macro name to the supplied arguments

16:49 {blake}: amalloy: So, what do you do if you don't use memoize?

16:49 stuartsierra: @amalloy I've used it to get at the metadata.

16:50 Also, you can't tell how many arguments there were if the macro has & args.

16:50 amalloy: stuartsierra: huh? of course you can

16:51 stuartsierra: Nevermind.

16:51 I was thinking of something else.

16:51 amalloy: the one place nobody ever looks for metadata is the macro name itself: (^String mymacro x y z)

16:52 i remember suggesting at one point that this would be the way to get a better-hinted memfn, if memfn were supplemented to support like (^String memfn length); looking at it now, though, i don't know why i preferred that to (memfn ^String length)

16:57 {blake}: i mean, store stuff in a map, and change it when it needs to change. it's a pretty vague answer, but then it was a pretty vague question

16:57 {blake}: amalloy: So, you just as an atom and take it on a case-by-case basis, is what I'm getting at. In other words, you don't really do anything in a general sense.

16:57 er "use an atom"

16:58 Since the purpose of "memoize" is to try to come up with a general purpose approach.

16:58 amalloy: i mean, memoize is a fine function to use on occasion, i'm not saying you should never use it

16:58 but it doesn't solve the problem you actually have right now

16:58 {blake}: amalloy: Fair 'nuff.

17:12 puredanger: hlship: I took a note to doc this on clojure.org somewhere

17:30 crash_ep: In Clojure, is there a function that takes another function f, and an argument x, and just calls (f x) ? Apply isn't quite what I want because in my case x is a collection.

17:31 hfaafb: yes its called... a function call

17:31 justin_smith: #(% x)

17:31 where x is your collection

17:31 amalloy: hfaafb: there's no need for scorn; funcall is a useful function, even though clojure doesn't have it

17:32 justin_smith: #(% %2)

17:32 justin_smith: that works too

17:32 crash_ep: I need a named function. I have defined a helper to do this, but was surprised not to be able to find something here.

17:32 justin_smith: depending where you know x, and where you are creating that function

17:32 EvanR: (def foo (fn [f] (fn [x] (f x))))

17:32 amalloy: crash_ep: you need a named function? nonsense; why?

17:32 crash_ep: For use in condp

17:32 justin_smith: condp does not require named functions

17:32 amalloy: justin_smith: the question said "takes an argument x..."

17:33 justin_smith: amalloy: ahh, you are right

17:33 EvanR: ,(let [$ (fn [f x] (f x))] ($ inc 1))

17:33 clojurebot: 2

17:34 crash_ep: (condp funcall my-collection test-expr :>> result-fn :test-expr :>> result-fn)

17:34 EvanR: wait, isnt (a b) syntax invoking IFn interface, so whats the relevant "call" method?

17:35 (partial that foo)

17:35 crash_ep: amalloy: oh, you are saying that I could just pass #(%1 %2) instead of funcall there?

17:36 I suppose so, but maybe I will just stick with the funcall helper since it will be more readable.

17:36 EvanR: ,(#(%1 %2) inc 1)

17:36 clojurebot: 2

17:36 crash_ep: EvanR: thank you. glad to know this is an option

17:36 justin_smith: &(condp #(%1 %2) [] empty? :empty)

17:36 lazybot: ⇒ :empty

17:38 justin_smith: &(condp #(%1 %2) [1] seq :not-empty empty? :empty)

17:38 lazybot: ⇒ :not-empty

17:38 marrrk: Hello! When I do something like lein new chestnut abcde how does leiningen infer what version to use. Or better yet, can I specify the version to use?

17:39 justin_smith: marrrk: all versions of deps are specified project.clj

17:39 as regards the chestnut template itself, there is no way to choose, you get the most recent

17:39 *specified IN project.clj

17:41 marrrk: The most recent stable one?

17:41 Argh, it is the first question in the FAQ. Sorry, guys.

17:41 justin_smith: the most recent deployed, I don't think templates have a concept of "stable" at all

17:42 marrrk: This is not going to be easy.

17:43 EvanR: not going to be easy, made hard

17:45 ajmccluskey: ,(update-in {:cats 42} [] dissoc :cats)

17:45 clojurebot: {nil nil, :cats 42}

17:46 amalloy: ajmccluskey: a classic

17:46 ajmccluskey: amalloy: haha, I was pretty sure someone would have done this first. Just checking.

17:46 EvanR: ,(dissoc {:cats 42})

17:46 clojurebot: {:cats 42}

17:47 rasmusto: oh weird

17:47 amalloy: if assoc-in and update-in had a contract, it would include "don't use an empty keyseq"

17:47 EvanR: nice, i'm glad that got fixed

17:47 EvanR: ,(dissoc {:cats 42} :cats)

17:47 clojurebot: {}

17:47 ajmccluskey: amalloy: right. I spent the last 20 minutes trying to work out if that made sense. Lesson learned - no empty key seqs.

17:48 EvanR: ,(assoc-in [] {:a 'b} 3)

17:48 clojurebot: #<UnsupportedOperationException java.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap>

17:48 EvanR: ,(assoc-in {:a 'b} [] 3)

17:48 clojurebot: {nil 3, :a b}

17:48 EvanR: seems legit

17:49 amalloy: what got fixed?

17:50 amalloy: (dissoc m) used to be an arity exception

17:50 EvanR: and now its a silent no op?

17:51 amalloy: EvanR: yeah

17:54 wait, am i wrong? git-blame for dissoc says the 1-arity case has been around since at least 2008

17:56 EvanR: unfix it

17:57 the less useless things it can mistake for valid code the better

17:57 amalloy: EvanR: no, it's a feature, not a bug. consider: you have a map, and i have a list of keys i'd like you to remove from the map

17:58 (apply dissoc m ks) seems like the obvious way to do it

17:58 but if (dissoc m) were an error, that could suddenly break if some jerk gave you an empty list of keys

17:58 EvanR: ,(dissoc {:a 1} :a)

17:58 clojurebot: {}

17:58 hfaafb: ,(dissoc {} :a)

17:58 clojurebot: {}

17:58 EvanR: ,(dissoc {:a 1 :b 2} :a :b)

17:58 clojurebot: {}

17:59 rasmusto: dissoc-in?

17:59 EvanR: well, var arg style isnt the obvious way to me

17:59 * rasmusto wants dissoc-in

17:59 amalloy: EvanR: reduce would be fine too, but i think apply is better

17:59 EvanR: well, now anything with var args now must have a pointless 0 arg case

18:00 stuartsierra: core.incubator has dissoc-in https://github.com/clojure/core.incubator/blob/16aed877cdfa24371099b0d13877d2716908cc91/src/main/clojure/clojure/core/incubator.clj#L62

18:00 EvanR: if not using var args, paying the price for failure to catch errors at runtime

18:00 rasmusto: stuartsierra: nice! good to know

18:00 EvanR: i guess using var args could be seen as a cut your losses

18:02 probably better would be a dissoc that took the list of keys to dissoc in the first place

18:02 then you dont even need apply

18:03 justin_smith: but then you need to build a list whether you need one or not, and can't use partial evaluation as effectively

18:03 amalloy: EvanR: that's always a trade-off you can choose to make, of course. why not do the same for every function? (+ (list 1 2)) is surely more legible than (+ 1 2)

18:03 EvanR: no, its a different function from dissoc, which would take exactly 1 key

18:03 and crash otherwise, because you intended to have 1

18:04 amalloy: binary + is a bad example, youre talking about the traditional vararg +

18:04 and the assertion is "surely being able to (+ a b c d e f) is better"

18:05 in response, no i wasnt talking about var-arg uncurrying everything

18:06 FriedBob: If one were to feed ~8mb of text to https://github.com/dkuntz2/clojure-markov-chains/blob/master/markov.clj about how long might oen expect it to run before getting output? Quad core A6-3400M w/ 4gig RAM

18:07 ffwacom: 3.50

18:07 FriedBob: 3.5 what? Minutes, hours, days?

18:07 EvanR: someone should run an empirical experiment somehow to find out

18:07 dunno who

18:07 ffwacom: FriedBob: 3.50

18:08 FriedBob: It's been running about 20 minutes so far, was just startnig to wonder if I shoudl keep waiting, ro try to find a potential problem

18:08 EvanR: might want to check if its in an infinite loop somehow

18:08 justin_smith: {"word1 word2" "word3"} is a very memory-inefficient way to do trigrams

18:08 SagiCZ1: which function returns true if pred is false for any in the collection?

18:09 EvanR: every? identity

18:09 justin_smith: (complement every?)

18:09 EvanR: er

18:09 SagiCZ1: justin_smith: thats it, thanks

18:10 EvanR: damn bools

18:11 justin_smith: ,((complement every?) even? [0 2 4 5])

18:11 clojurebot: true

18:11 justin_smith: ,((complement every?) even? [0 2 4])

18:11 clojurebot: false

18:12 SagiCZ1: ,(map boolean [true false nil () "hello"))

18:12 clojurebot: #<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>

18:12 SagiCZ1: ,(map boolean [true false nil () "hello"])

18:12 clojurebot: (true false false true true)

18:13 marrrk: Is it okay to ask about clojurescript here anyway?

18:13 justin_smith: 0 is another one that trips up some newcomers

18:13 EvanR: ,(if 0 1 2)

18:13 clojurebot: 1

18:13 justin_smith: marrrk: yeah, this place is more active than #clojurescript I think

18:13 SagiCZ1: ,(boolean 0)

18:13 clojurebot: true

18:13 SagiCZ1: good tip

18:13 EvanR: ,(if "" 1 2)

18:14 clojurebot: 1

18:14 EvanR: only nil and false?

18:14 justin_smith: only nil and false

18:14 SagiCZ1: ~only-nil-and-false

18:14 clojurebot: I don't understand.

18:14 marrrk: justin_smith: Do you have a good guess where I have to put .sass or otherwise .scss files with chestnut in order for them to get picked compiled?

18:14 tsantos: If I have an existing map and I want to map a function to each of the values, what’s a good way? This springs to mind: (zipmap (keys orig-map) (map #(do-something %) (vals orig-map)))

18:15 ffwacom: Reduce?

18:15 justin_smith: tsantos: ##(into {} (for [[k v] {:a 0 :b 1 :c 2}] [k (inc v)]))

18:15 lazybot: ⇒ {:c 3, :b 2, :a 1}

18:16 tsantos: So why is into better? That’s what I have right now in my code.

18:16 justin_smith: tsantos: you walk the collection twice to do the zip-map

18:16 dbasch: justin_smith: SagiCZ1 not-any?

18:16 tsantos: Ah! Thanks.

18:17 EvanR: ive written so many (into {} (doall (for [[k v] m] ...))) ... wish i could be arsed to reuse the function i wrote for this. its very common and has a just fine name map-values

18:17 stuartsierra: reduce-kv

18:17 justin_smith: EvanR: the doall is redundant because {} cannot be lazy

18:17 EvanR: its a map

18:18 the construction of the map will happen but not necessarily side effects

18:18 justin_smith: the act of creating the hash is eager

18:18 the doall does nothing

18:19 EvanR: ok, i lied, but in both cases, i think you can get unevaluated seqs deep in the result map

18:19 justin_smith: EvanR: you need clojure.walk or your own tree walker to fix that

18:19 a top level doall won't do anything there

18:19 EvanR: yes, even without doall, its a pain to type that little program

18:20 justin_smith: (doc reduce-kv)

18:20 clojurebot: "([f init coll]); Reduces an associative collection. f should be a function of 3 arguments. Returns the result of applying f to init, the first key and the first value in coll, then applying f to that result and the 2nd key and value, etc. If coll contains no entries, returns init and f is not called. Note that reduce-kv is supported on vectors, where the keys will be the ordinals."

18:21 EvanR: you can implement map and filter with reduce, but the operation i think were both talking about is a map, which is more readable and easier to type when admitted

18:21 justin_smith: ,(reduce-kv (fn [m k v] (assoc m k (inc v))) {} {:a 0 :b 1 :c 2})

18:21 clojurebot: {:a 1, :b 2, :c 3}

18:21 EvanR: (map-values inc {:a 0 :b 1 : c})

18:21 something

18:22 amalloy: map-values should really take its arguments in the other order

18:22 EvanR: any map-like operation seems like should take the function first, like map on sequences

18:23 amalloy: nah. because now you lose the ability to write (update-in mymap [x y z] map-values inc)

18:23 EvanR: i didnt understand that version of update-in above either, with four args

18:23 amalloy: functions that operate on *sequences* take the sequences last; other kinds of collections are generally first

18:24 EvanR: you mean to do (update-in mymap [x y z] (partial map-values inc)) ?

18:24 tsantos: So this is a decent map-values? (defn map-values [func map] (into {} (for [[k v] map] [k (func v)])))

18:25 Bronsa: EvanR: (update-in m p f a) is like writing (update-in m p #(f % a))

18:25 EvanR: heh, then swap the % and a in the implementation of update-in ;)

18:25 amalloy: boy are you missing out, EvanR, if you didn't know update-in takes varargs

18:26 EvanR: if partialing was more convenient, then having the "real variables" go last is better

18:26 and the more fixed context go first

18:26 justin_smith: &(swap! (atom {:a 0}) update-in [:a] + 42)

18:26 lazybot: ⇒ {:a 42}

18:27 EvanR: so theres more to the parentheses-less sub style?

18:27 very weird

18:27 justin_smith: swap! and update-in are both var-args

18:27 EvanR: to my untrained eye that swap! looks like gobble-de-gook

18:28 tsantos: oh, wow. update-in is awesome.

18:28 amalloy: EvanR: swap!, update-in, conj, assoc, dissoc: all these functions participate in this

18:28 why don't you swap the argument order for all of those? (dissoc k m) instead of (dissoc m k) makes partialing easier too

18:28 EvanR: its weird, im more used to putting composing functions in order, grouping the expressions which form their own operation

18:29 amalloy: if convenient partialing were the only design consideration, language design would be a lot easier

18:29 EvanR: yeah dissoc k m would be the shiz, to me

18:29 amalloy: EvanR: that is so gross i just barfed

18:29 weavejester: In Clojure, functions that operate on single values tend to have the value go first, while with collections the collection is last.

18:30 EvanR: the one which is less often needed first could be easily arrived at with flip

18:30 amalloy: you mess up arrowing that way too: i'd much rather write (-> m (assoc :x y) (dissoc :k)) than (dissoc :k (assoc :x y m))

18:30 weavejester: s/collections/sequences

18:30 EvanR: yeah i can see how the arrow is in that shape

18:30 weavejester: amalloy: well, non-keyed collections.

18:31 EvanR: its java headed

18:31 amalloy: weavejester: i think you're just drawing the wrong distinction; sequences go last, all other collections go first

18:31 EvanR: if the collection went last, the arrow would be function composition instead, and not a macro

18:31 weavejester: It's more because it makes sense to write (assoc m k1 v1, k2 v2, ...) and (dissoc m k1 k2 ...)

18:32 amalloy: weavejester: you weren't here earlier: EvanR thinks varargs are the devil

18:32 weavejester: amalloy: Hm... I guess that's true. (conj vector value) has the collection go first.

18:32 EvanR: i was just saying that if i want to use a var arg function in 1 arg case, a dedicated 1-arg version would help catch typos better

18:32 amalloy: weavejester: right. conj participates in the unified update model, just like assoc, dissoc, etc

18:33 EvanR: and that's not unreasonable. feel free to define your own one-arg-only versions

18:38 stuartsierra: *Sequence* functions (map, filter, reduce) take the sequence last. Almost everything else, including collection functions, takes the "primary" argument first.

18:38 `(cons item sequence)` is a sequence function whereas `(conj coll item)` is a collection function.

18:38 EvanR: collection means map ?

18:38 because everything else seems to be a sequence

18:39 stuartsierra: Collection means vector, map, or set.

18:39 amalloy: EvanR: set, vector...

18:39 stuartsierra: wellllll, collection is open-ended

18:39 justin_smith: ,(map coll? [{} [] #{} ()])

18:39 clojurebot: (true true true true)

18:39 stuartsierra: yeah yeah

18:39 ,(coll? (seq [1 2 3]))

18:39 clojurebot: true

18:39 EvanR: maps go first, everything else goes last

18:39 stuartsierra: bah

18:39 EvanR: Sequences go last, everything else goes first. :)

18:40 justin_smith: EvanR: #{} is not a sequence either

18:40 EvanR: ok sets

18:41 any reason for this distinction as far as mapping filtering and reducing goes?

18:42 stuartsierra: EvanR: partly historical from other Lisps, I think

18:43 Rich Hickey had a deeper justification which he posted on the mailing list many years ago. I can't find it at the moment.

18:45 This came up around the time `clojure.string` was created out of the ashes of `clojure.contrib.str-utils{,2,3}`

18:49 Aha! Here it is https://groups.google.com/forum/#!msg/clojure/iyyNyWs53dc/Q_8BtjRthqgJ

18:50 I was young and foolish then.

18:53 amalloy: oh man, i forgot about this thread. i remember being quite amused last time i read the last message

18:54 also, i think you mean "exuberant", not "foolish"

19:19 dbasch: I was amused by the (if … true false) :P

19:24 pdk: (if (bool x) true false)

19:31 amalloy: pdk: "bool"? get back to your crazy 1970s languages. around here, we use whole words

19:31 pdk: i'm sorry

19:31 (if (ean x) true false)

19:34 dbasch: amalloy: seq called, wants its uence back

19:34 amalloy: &(doc sequence)

19:34 lazybot: ⇒ "([coll] [xform coll] [xform coll & colls]); Coerces coll to a (possibly empty) sequence, if it is not already one. Will not force a lazy seq. (sequence nil) yields (), When a transducer is supplied, returns a lazy sequence of applications of the transform to the ite... https://www.refheap.com/94592

19:35 amalloy: speaking of, seque is one function whose name i can't ever spell right

19:35 i just have to keep going, sequeue. it's like banana: easy to start spelling, but hard to stop

19:36 dbasch: seq seque sequence make clojure a language for all times

19:37 amalloy: now we need lazy-seque

19:37 pdk: just rename it sequins

19:37 then all your code can sparkle

19:37 dbasch: so many good examples and I had to pick seq

19:37 cfleming: amalloy: The one that always gets me is Seqable - I always write it Sequable

19:42 dbasch: the one keyword I always hated with a passion is (http) “referer”

19:45 cfleming: dbasch: Ah, yes, a classic

19:58 YKY: can I access LinkedLists defined in Java, in clojure? any solution would be nice

19:59 timvisher-xubunt: i'm assuming the 'use transformer' note in the filter(>|<) docs for core.async mean 'use transducer'?

20:04 dbasch: YKY: of course you can. What specifically would you like to do?

20:06 YKY: say I have LinkedList defined in Java

20:06 I want to access it in clojure

20:07 like a clojure seq

20:07 amalloy: YKY: just seq over it

20:07 YKY: Lets swap

20:07 amalloy: seq works on anything Iterable

20:07 YKY: oops wrong window

20:08 how about clojure sets

20:09 amalloy: how about them indeed? that's not really a question

20:10 YKY: is there a type in java that corresponds to clojure sets?

20:12 and can I also export the list back to Java?

20:15 lasergoat: ,(into #{} (java.util.HashSet. #{1 2 3}))

20:15 clojurebot: #{1 3 2}

20:15 lasergoat: is a roundtrip conversion between a clojure set and a java set

20:17 more generally, java collections can usually take a java.util.Collection as a constructor argument, and clojure collections implement that interface

20:17 so you can do (SomeJavaCollection. any-clojure-collection)

20:18 similarly, clojure’s into can take any collection, so you can go the other direction

20:18 YKY: sounds great =)

20:19 amalloy: lasergoat: notably, you usually dont' need to do either conversion at all

20:20 since both collection libraries use interfaces

20:20 YKY: why not?

20:20 I see

20:20 amalloy: you can seq over a HashSet, and java can call .get on a PersistentHashSet

20:20 or .contains or whatever

20:21 lasergoat: right, clojure set (i think) implements java’s set interface (this: https://docs.oracle.com/javase/7/docs/api/java/util/Set.html), and clojure’s set functions take java sets as readily as clojure sets

20:22 YKY: the thing is, java does not support "tail" on LinkedLists

20:22 I don't know why

20:22 there's just no tail function

20:24 gfredericks: YKY: I think because it's a mutable list instead of immutable, the concept makes less sense

20:24 furthermore it's doubly-linked

20:26 lasergoat: i’d expect a doubly linked list to keep a tail pointer, actually

20:27 YKY: so which java list structure is best suited for import to clojure?

20:27 amalloy: it does

20:27 gfredericks: lasergoat: what does tail mean there?

20:27 amalloy: LinkedList/getLast

20:27 but i don't think that's actually what YKY meant by tail

20:27 YKY: getLast is not "tail"

20:27 tail = rest

20:28 anyway, which Java List structure should I use?

20:28 dbasch: YKY: it depends on what you’re doing in Java really, there’s no generic answer to your question

20:28 amalloy: YKY: none of them? any of them? it really doesn't matter

20:28 YKY: so clojure would not even make a copy of it

20:28 ?

20:29 lasergoat: oh, like cdr. yeah, ok, i was thinking what amalloy was thinking

20:29 amalloy: lasergoat: i wasn't, it was just you :P

20:30 * lasergoat hangs head in shame

20:30 dbasch: YKY: what exactly are you trying to do? Clojure won’t do anything you don’t tell it to do

20:31 meaning, you can instantiate a java list and use it as a mutable object in clojure just like in java

20:31 YKY: I have a Java LinkedList or ArrayList (have not decided)

20:32 and I want to run my clojure code over the List

20:32 just wonder which kind is best

20:32 gfredericks: YKY: it's up to you if you want to use interop to process as a java collection or bother to do a full copy into a clojure collection

20:32 YKY: the copying will take roughly the same amount of time no matter what java collection you use

20:32 dbasch: YKY: best for what?

20:33 YKY: well, the Java LinkedList does not have a "rest" function

20:33 in my clojure code I definitely used "rest" somewhere

20:33 so the question is whether the clojure code would run at all

20:33 lasergoat: no, all the clojure sequence stuff works on java lists

20:33 dbasch: ,(rest (java.util.LinkedList. [1 2 3]))

20:33 gfredericks: ,(def yky (doto (java.util.List.) (.add 3) (.add 4)))

20:33 lasergoat: ,(rest (LinkedList. [1 2 3]))

20:33 clojurebot: (2 3)

20:33 #<CompilerException java.lang.IllegalArgumentException: No matching ctor found for interface java.util.List, compiling:(NO_SOURCE_PATH:0:0)>

20:33 #<CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: LinkedList, compiling:(NO_SOURCE_PATH:0:0)>

20:34 gfredericks: ,(def yky (doto (java.util.LinkedList.) (.add 3) (.add 4)))

20:34 clojurebot: #'sandbox/yky

20:34 amalloy: YKY: i advise you just don't worry about it, and pretend the java list is a clojure list until something happens that suggests otherwise

20:34 gfredericks: ,(rest yky)

20:34 clojurebot: (4)

20:34 YKY: OK that's great =)

20:34 amalloy: which is what i said when you first asked: seq works on lists

20:34 dbasch: YKY: in clojure structures don’t “have” functions

20:34 functions work on structures (if they can)

20:35 YKY: seems that the clojure developers have taken care of that

20:35 dbasch: of course classes have methods, which you can call as functions in Clojure

20:37 asias: Hey everyone! Does someone mind telling me when records should be used over stadard maps?

20:37 gfredericks: infrequently

20:37 amalloy: asias: when all other options are obviously no good

20:37 asias: amalloy: records are a last resort?

20:38 gfredericks: ~records |are| a last resort

20:38 clojurebot: Roger.

20:38 amalloy: not really. but they shouldn't be anywhere close to a first resort, so i err on the side of uh...word...

20:38 gfredericks: asias: my only frequent use of records is with stuartsierra/component

20:40 asias: gfredricks: thanks!

20:41 gfredericks: thanks!

20:41 amalloy: asias: your client will tab-complete usernames

20:41 justin_smith: gfredericks: I think we can generalize that to "records are useful with libs that take arguments that must implement some given protocol"

20:42 asias: amalloy: oh i didn't realize that... thanks!

20:43 gfredericks: justin_smith: sometimes just reify

20:43 justin_smith: fair enough

20:43 asias: justin_smith: so the performance difference generally isn't substantial enough to warrant using records over maps?

20:44 amalloy: asias: i remember the sad old days of typing usernames by hand before i knew any better. i try to spare everyone else that

20:44 justin_smith: asias: it can be, but it's a sweet spot between maps and deftype that only gets hit every so often

20:44 amalloy: asias: no. i can think of only one case in my uh, four years of clojure where i needed a record for performance

20:45 you mostly use them because they're named, concrete types, which can implement interfaces and things, and that's necessary sometimes

20:45 asias: when is that neccessary outside of java interop?

20:46 amalloy: rarely. but y'know, protocols

20:46 justin_smith: asias: protocols are a useful way to let clients implement concrete functionality

20:46 gfredericks: ~protocols

20:46 clojurebot: http://whiley.org/2012/02/29/a-problem-of-decoupling/ describes a problem solvable by protocols

20:47 justin_smith: there are also multimethods, but protocols are less flexible / perform better

20:48 asias: justin_smith: amalloy: thanks a bunch!

20:48 amalloy: justin_smith: there are also functions

20:49 justin_smith: amalloy: indeed

20:54 perplexa: just found 60 year old color pictures of my family :D

20:55 crash_ep: If I just want to return a seq of items from a function, which is better – (list a b c) or (vector a b c) ? Or is there something else I should choose?

20:55 amalloy: [a b c]

20:55 crash_ep: s/seq/sequence/

20:55 amalloy: is that a style point or does the vector literal have some other advantage over the function call?

20:56 amalloy: i don't think it's faster or anything. it just looks silly to call vector manually

20:56 justin_smith: vector literals are a huge readability bonus

20:56 crash_ep: I find in some cases a vector literal looks too much like a binding form. As I skim clojure code, my mind picks out brackets and says "there's a name declaration happening here"

20:57 gfredericks: might want to get over that one; I think it's pretty ubiquitous

20:57 justin_smith: the upper-left / lower-right division breaks it up pretty well

20:57 crash_ep: i

20:57 i'll give it a try

20:58 amalloy: justin_smith: upper-right/lower-left, right? or are you talking about something different than i am?

20:58 you must be. i think what i'm saying is weird and silly

20:59 justin_smith: a vector literal will be more likely on the right hand or near the bottom, a binding form that is a vector is more likely along the top and left

20:59 of a given block

21:00 ie. lhs vs rhs of let blocks, return value vs. incoming args...

21:00 amalloy: justin_smith: i dunno though, i think the return value is often further left than the arguments

21:01 (defn some-long-function-name [x y] (when (foo x) [a b c]))

21:01 gfredericks: o_O

21:01 ooooh

21:01 with same-line-args style

21:01 which is clearly worth going to war over

21:01 justin_smith: yeah, I rarely use that style, because comment strings

21:01 gfredericks: (dec same-line-args)

21:01 lazybot: ⇒ -1

21:01 amalloy: similarly for with-style bindings

21:01 and even (when-let [...]) pushes stuff pretty far to the right

21:02 justin_smith: true, it's a heuristic and not a rule to be sure

21:02 gfredericks: &(re-matches #"({0,0}{0})" "")

21:02 lazybot: ⇒ ["" ""]

21:02 justin_smith: but when I look at random code blocks and draw that imaginary diagonal line, it's fairly accurate

21:04 crash_ep: See, I find the [c] on line 118 to be a little hard to read: http://cl.ly/image/3L0l1g3j0f0C

21:04 not hard to read, but… it looks almost like a parameter declaration

21:18 justin_smith: tbaldridge: I'm checking out pixie, looks interesting so far. I wonder what that awesome color graphic would be without all the warning messages

21:57 gfredericks: &(re-matches #"{0}?" "")

21:57 lazybot: ⇒ ""

22:01 gfredericks: &(re-matches #"x++{0}?{0}+{0}?" "x")

22:01 lazybot: ⇒ "x"

22:05 gfredericks: (test.check has very strange things to teach you about regexes if only you are willing to listen)

22:07 reiddraper: gfredericks is the test.check whisperer

22:27 dwysocki: is it possible to generate documentation with codox for a project with AOT compiled classes?

22:28 I've even tried removing the leiningen directive to use aot, and it crashes with the error: "Could not load codox writer codox.writer.html"

22:30 I'm not actually certain that it's due to my AOT compiled classes, but that's the only possibility I can think of that I haven't ruled out

22:46 jarjar_prime: Is there anyway to use different middleware with some routes? I don't want teh OPTIONS header to require authentication headers :-|

22:46 (for compojure)

23:35 dwysocki: I guess it's impossible to have anything AOT compiled and still generate codox documentation

23:36 I need to use :gen-class for a couple things, though

23:36 is there no way to skip over those namespaces?

23:37 rritoch: dwysocki: What are you using to compile with?

23:37 dwysocki: leiningen

23:37 rritoch: dwysocki: Ie. what OS

23:37 dwysocki: arch linux

23:38 justin_smith: how would the OS affect this at all?

23:38 rritoch: dwysocki: Ok that is odd, I use gen-class and gen codox without a problem, but only from linux

23:38 dwysocki: hmm

23:38 well

23:38 I *believe* this is the source of the problem

23:39 rritoch: dwysocki: It's either codox or marginelia, but one of them won't work on windows so I always need to generate docs from linux

23:39 dwysocki: I managed to generate codox for some of my other projects, which don't use :gen-class

23:39 but perhaps that's not the actual cause

23:40 rritoch: justin_smith: One moment, I'll pastebin a windows failure, again I don't remember if it was codox or marginilia that I can't use with windows.

23:41 justin_smith: I use both for all my docs since they're compatible and are both useful

23:41 dwysocki: for what it's worth, here's my error message

23:41 http://pastebin.com/h6f95zct

23:43 rritoch: dwysocki: Hmm, what version are you using?

23:44 dwysocki: of codox? 0.8.10

23:45 rritoch: Ok, nota version issue, that's the same version I use

23:46 justin_smith: It is codox that fails on windows

23:48 http://pastebin.com/Vsrm4xrt

23:49 justin_smith: shit, once again the over-eagerness of devs who don't even use windows to use System.separator, causing bugs

23:49 I think that's what it is ata least

23:49 *at

23:49 rritoch: justin_smith: Probably

23:51 TEttinger: doesn't / work on windows vista and newer?

23:51 justin_smith: right

23:51 but people try to use \

23:51 even in URLS

23:51 rritoch: dwysocki: It seems your missing a file someplace

23:51 justin_smith: because it's windows

23:51 and it's not even people who use windows who are making this mistake

23:51 TEttinger: oh man

23:51 rritoch: dwysocki: try lein do jar -U, doc

23:52 dwysocki: That should re-download all of your depenendencies

23:52 dwysocki: I get the same error when I do that

23:53 also, I've deleted and re-downloaded all of my dependencies about a dozen times now lol

23:53 thinking that maybe changing something and re-downloading deps would magically fix it

23:53 on the bright side, I just successfully generated docs with marginalia

23:54 so at worst I have that

23:54 TEttinger: nice dwysocki!

23:54 what is codox?

23:54 dwysocki: auto doc generation

23:54 TEttinger: ah

23:54 justin_smith: TEttinger: it's what generates html docs, I think ring uses it for example

23:54 dwysocki: a bit nicer than what the clojure team uses

23:54 justin_smith: it's the one with the side bar with ns names you can click

23:55 dwysocki: marginalia is kinda weird though

23:55 justin_smith: marginalia works best if you write your code for marginalia

23:55 dwysocki: it basically just re-formats your source code

23:55 justin_smith: semi-literate style

23:55 dwysocki: not entirely sure what literate style means

23:55 justin_smith: dwysocki: literate programming

23:56 dwysocki: I heard that phrase for the first time today, while searching about codox and marginalia

23:56 rritoch: dwysocki: Now that I think about it, I hadissues with codox myself, did you set an output-dir?

23:56 justin_smith: dwysocki: it's a school of thought where code is primarily for other humans to read. Mixing of extended description of the code with the implementation, usually with TeX formatting

23:56 dwysocki: rritoch: no, I just let it default to docs/

23:56 rritoch: dwysocki: I use {:output-dir "doc/codox"}

23:56 dwysocki: justin_smith: I see

23:57 rritoch: dwysocki: I also change the src-linenum-anchor-prefix and src-dir-uri to properly link to github

23:57 dwysocki: rritoch: yeah I was going to play with that stuff later

23:57 rritoch: dwysocki: Based on your error though, setting a output-dir may help

23:58 dwysocki: I don't think the directory's the problem, though

23:58 really?

23:58 rritoch: dwysocki: I didn't look at the sources of codox, but I know it works for me, on linux at least, and I use a lot of gen-classes

23:59 dwysocki: what exactly do you use gen-classes for?

23:59 I'm using it to extend antlr4 classes

23:59 using antlr4 might actually be the problem

23:59 rritoch: dwysocki: Can't say, NDI

23:59 dwysocki: ah

23:59 rritoch: err, NDA

Logging service provided by n01se.net