#clojure logs

2014-12-08

00:51zarkonehello. 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") ?
00:51zarkone
01:12rs0zarkone: you should explain what you're actually trying to do
01:12amalloyzarkone: i'm not totally sure i understand the question, but that sounds like a thing that you don't need to do
01:13weiis there a better way to express this?(case v
01:13wei 1 (wrap-action (foo))
01:13wei 2 (wrap-action (bar))
01:13amalloyso, indeed, go into why you think you should do it
01:13wei 3 (wrap-action (baz))
01:13wei (qux))
01:13amalloywei: (if-let [f (case v 1 foo, 2 bar, 3 baz, nil)] (wrap-action (f)) (qux))?
01:14weibetter formatting: https://gist.github.com/yayitswei/ce4dd59cdb5b6f9aa5be
01:14weiamalloy: clever. works for me, thanks
01:15amalloyalso 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
01:23zarkoners0: amalloy: I want to pass the body into macro and expand the symbol namespaces
01:23zarkonei can give example, just a minute
01:26zarkonehttp://pastebin.com/v1TpzmW2
01:26rs0zarkone: well, you don't need the ` reader macro to do that
01:27rs0,(resolve 'update-in)
01:27clojurebot#'clojure.core/update-in
01:27rs0,(let [x 'update-in] (resolve x))
01:27clojurebot#'clojure.core/update-in
01:27amalloywhy are you def'ing a quote, instead of a function? it doesn't make sense
01:29zarkoneamalloy: you mean, instead of def '... use defn?
01:29zarkonewhy i didn't think about it..?
01:29amalloyyeah, 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
01:31zarkone i just didn't rest enough and do stupid >.< i'll try it now, thank you very much amalloy, rs0
01:35zarkonefirst 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
01:54TEttingerwhy did I get a notice from clojurebot 5 hours ago? [17:46;12] <clojurebot> Gabh mo leithscéal?
02:03amalloyTEttinger: a notice isn't a private message
02:04amalloyhe sent it to the whole channel; if your client is representing that as a private message, get a new client :P
02:12TEttingerno, I got it as a notice I just don't know why it would send a "message not understood" to the whole channel
02:12TEttingernormally it sends those in the channel, so...
02:19amalloyTEttinger: for some reason he responds to ~def as a notice
02:19amalloythere was a ~def he didn't understand, so...
02:19TEttingerhuh
02:20TEttingerwhat is ~def ?
02:23amalloy~def +
02:23TEttingeroh nice amalloy!
02:26domokatojustin_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
02:37Empperiis there a simple way to do "lazy import" for java classes?
02:38Empperimeaning 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
02:38EmpperiI know I can use (import)
02:39Empperiwhy 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
02:39Empperiand it pushes a bunch of debug level loggings before I manage to set the level to info
02:40Empperiother 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
02:40Empperiwhich sucks
02:41Empperithird 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
02:46testjustin_smith: yeah I understand. Thanks
02:58thearthurAm I right in thinking that syntax-quote (`) doesn't have a name by which you can build calls to it in other macros?
03:01andyfI don?t think so. It is dont at read-time, so not sure how you would build calls to it, anyway?
03:02andyfs/dont/done/
03:05thearthurthere would have to be some other macro that ` gets resolved to by the reader that provides some other interface to the same code
03:05Empperimanaged to solve my problem I described above btw
03:05Empperiso bygones and so forth
03:05Empperi:)
03:07gratimaxhow do transducers have an advantage over reducers for iteration?
03:07andyfthearthur: What are you trying to do that simply using a syntax-quoted form in a macro or function would not achieve?
03:11thearthurandyf: I'm just asking to make sure i don't spread lies on stackoverflow
03:11thearthurwhere I claimed that this can't be done without eval
03:13andyfNot sure, but since it is read time, it could be done via something like read-string from a string.
03:13zarkonethearthur: actually, your answer gave me answers for all my questions about macro for now, thanks =)
03:16zarkonethearthur: 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
03:25Rhainur1I'm trying to figure out how to write code "the Clojure way" as I have no prior lisp experience
03:25Rhainur1http://hastebin.com/iruyayemix.lisp
03:26Rhainur1this feels very imperative to me, with the nested ifs
03:26Rhainur1how can I improve this code?
03:27andyfRhainur1: I get a page that says "application error" when I try to follow that link
03:28Rhainur1http://hastebin.com/raw/iruyayemix
03:28Rhainur1what about that
03:29Rhainur1andyf: ^
03:29andyfbetter. no error.
03:29gratimaxRhainur1: seems pretty much fine
03:30gratimaxmaybe (if (and (not (nil? user)) (crypt/compare password (user :password)) user nil)
03:30Rhainur1here's my improved version: http://hastebin.com/teyohuvuwe.lisp
03:30Rhainur1gratimax: almost the same as that except I used some?
03:30gratimaxyeah brain fart there
03:30Rhainur1and (if) defaults to nil if the else branch is not supplied
03:30Rhainur1so I removed that as well
03:31gratimaxit's late
03:33Rhainurso here's my final version with indentation and what not: https://gist.github.com/Rhainur/c47bbd7391285762be88
03:33Rhainuranything I can improve on there?
03:34fairuzHey guys. Using liberator + compojure, how can I add custom header to the response? Thanks
03:34gratimaxRhainur: seems fine
03:34Rhainurgratimax: cheers, thanks for the help
03:34gratimaxfairuz: iirc it's in ring.util.response
03:51fairuzgratimax: ah ok
03:54fairuzhmm 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.
03:54fairuzweird
03:54fairuzAny limitation on the response size?
04:12fairuzoh nvm, it's the Liberator's debugging trace
04:12fairuzsomehow it traced my result data in there
04:12fairuztoo biug
04:12fairuz*big
04:12gratimaxfairuz: check for any stack traces
04:12gratimaxactually I didn't see your latest messages, nvm
04:13fairuzJust disabled the trace in the header and it's all good
04:13gratimaxnot sure what you mean, but alright
04:15sm0keis there any other way to create a map from vector beside `into`
04:15Empperireduce?
04:15clojurebotreduce accumulates the men from the boys
04:16Empperilol
04:16gratimaxlol
04:16sm0keoh man! `into` is so f***ng slow!!
04:17sm0keit incurs 10x cost to convert a list of 100000 rows into a map each!
04:17sm0keusing into
04:20sm0kehurmm actually not
04:20sm0keseems like it needed a `doall` to reveal the other side :p
04:21Empperi,(reduce #(assoc %1 (first %2) (second %2)) {} [[:key "val"] [:another "dude"]])
04:21clojurebot{:another "dude", :key "val"}
04:21Empperidunno if that's going to be any faster though
04:21Empperimost likely not
04:22Empperiespecially since into uses reduce internally
04:22Empperibut it does use conj instead of assoc
04:22Empperiso some difference at least .)
04:23sm0kei am going to see if transient helps me
04:23sm0keso basically i have a java map which i want to convet to clojure map with some deserialization and keywordifying
04:24sm0keand it takes my runtime from 1.5 sec to 10.5 seconds
04:24sm0kethat does not sounds good to me
04:24sm0keand all i am doing is the same old map. into stuff
04:24sm0keoh each entity is a java map
04:35sm0keok de/serialization is the culprit here
04:35sm0kewithout deser its ~3 sec
04:39sm0kenippy isnt so fast afterall
04:51sm0ke,(into {} (map (fn [[k v]] [(keyword k) v]) (java.util.HashMap. {"a" 1})))
04:51clojurebot{:a 1}
04:51sm0keany better way to do this?
04:51sm0ke,(time (into {} (map (fn [[k v]] [(keyword k) v]) (java.util.HashMap. {"a" 1}))))
04:51clojurebot"Elapsed time: 0.514304 msecs"\n{:a 1}
04:52sm0ke,(time (into {} (map (fn [[k v]] [(keyword k) v]) (java.util.HashMap. {"a" 1}))))
04:52clojurebot"Elapsed time: 0.283097 msecs"\n{:a 1}
04:52sm0kewth this takes .5 msec on my machine!
04:52sm0ke,*clojure-version*
04:52clojurebot{:interim true, :major 1, :minor 7, :incremental 0, :qualifier "master"}
04:56zotis there any way to "recognize" when running within the repl, so that I can handle exit/errors differently while manually testing?
04:57zoti found the *command-line-args* hack, and wondered if something better exists
05:02sm0kezot: you can put a dependency in your profiles.clj which would be only present in repl
05:03sm0kee.g. lein-pprint
05:03sm0kethen pprint should be resolvable only in repl unless you have it in the ns imports also
05:04sm0ke,(resolve 'pprint)
05:04clojurebotnil
05:04zotsm0ke: clever :)
05:24rurumate_,(require '[clojure.core.match :refer [match])
05:24clojurebot#<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>
05:24rurumate_,(require '[clojure.core.match :refer [match]))
05:24clojurebot#<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>
05:25rurumate_,(require '[clojure.core.match :refer [match]])
05:25clojurebot#<FileNotFoundException java.io.FileNotFoundException: Could not locate clojure/core/match__init.class or clojure/core/match.clj on classpath.>
05:25rurumate_no match?
05:30rurumate_https://www.refheap.com/94569
05:35ordnungswidrig&require '[clojure.core.match :refer [match]])
05:35lazybot⇒ #<core$require clojure.core$require@445cfd0a>
05:35ordnungswidrig&(require '[clojure.core.match :refer [match]])
05:35lazybotjava.io.FileNotFoundException: Could not locate clojure/core/match__init.class or clojure/core/match.clj on classpath:
05:50tsdhIs 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...
06:05sm0ketsdh: yes, use RT.var
06:06sm0ke,(clojure.lang.RT/var "clojure.core" "inc")
06:06clojurebot#'clojure.core/inc
06:06sm0ke,(.invoke (clojure.lang.RT/var "clojure.core" "inc") 1)
06:06clojurebot2
06:10tsdhsm0ke: 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.
06:19sm0ketsdh: yes because you need to require it first
06:19clgvtsdh: then IFn require = (clojure.lang.RT/var "clojure.core" "require"); IFn symbol = ...; require.invoke( symbol.invoke( "my.ns" ) ); IFn myfn = Clojure.var( ... );
06:19sm0keRT.var("clojure.core","require").invoke(Symbol.inter("cheshire.core"))
06:19sm0kee.g.
06:20sm0keclgv: ah thats the new api in 1.6?
06:21clgvsm0ke: it is the official API since 1.6 correct
06:22sm0keis there an uptodate wrapper for kryo?
06:22tsdhclgv: Let's see if that does the trick...
06:23clgvtsdh: definitely, as long as your namespace implementation is on the classpath
06:25clgvah, you can use `read` to get rid of the symbol part above. -> require.invoke( Clojure.read( "my.ns" ) ) will work as well
06:26tsdhclgv: Indeed. Great, thank you!
06:35clgvtsdh: oh I saw a typo above. replace "clojure.lang.RT" with "Clojure"
06:35clgvtsdh: I copied sm0ke's example ;)
06:35clgvtsdh: http://clojure.github.io/clojure/javadoc/clojure/java/api/Clojure.html
06:36zotre 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?
06:37tsdhclgv: Yes, that's what I'm using now. :-)
07:17noncomwhat is the font you think is best for programming in clojure? (typeface/size) ?
07:22clgvnoncom: any monospace font that pleases you ;)
07:22kunginoncom: I love Consolas 12
07:22kunginoncom: What clgv said :-)
07:23clgvnoncom: Eclipse says that I am using "Monospace 10" ;)
07:26hipsterslapfightSourceCodePro-Light
07:29noncomthanks for the answers :)
07:29winkDejaVu Sans Mono 12 it seems
07:29winkgood enough I didn't change it :P
07:29winkbut I don't use different fonts for different languages either
07:29TEttingerunifont, how else will you see the valid identifier ☃
07:29noncom:D
07:30TEttingerEnvy Code R is quite nice
07:31TEttingerhttp://damieng.com/blog/2008/05/26/envy-code-r-preview-7-coding-font-released
07:38rritochHi, 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.
07:39rritochCurrently 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.
07:41TEttingerrritoch, but... the jvm doesn't even support unsigned types IIRC
07:41rritochTEttinger, it doesn't need to
07:42TEttingerso this isn't an efficiency thing but a type checking?
07:42rritochI followed how the numeric operations work, and they're not compiled, they're interpreted
07:43TEttingerpretty sure at some point they call java + and -
07:43rritochYeah, they do, eventually
07:43rritochBut instead of calling +/- if the numeric type implements some specific interface it could call operations on the numeric object.
07:44noncomoh 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
07:44noncommost of the community and the official frowned at the idea
07:44noncomso if you do a library, i will be one of the first users of it :)
07:44noncombut it will remain a library, they won't add it into the core
07:44noncom(i thnk)
07:44rritochnoncom: hehe, ok well I've already forked clojure, so keep your eyes out
07:44noncom(i think)
07:45rritochhttps://github.com/rritoch/clojure
07:45noncomoh, was just going to ask for the link :()
07:45rritochCurrently the only new feature is namespace isolation
07:45noncom:)
07:45rritochBut the next feature I'm woring on is custom numeric types so I can work directly with unsigned numbers
07:45noncomso, you're having big plans on forking clojure ?
07:46noncomwanna make it more robust/versatile ?
07:46rritochThis isn't a big plan, I hope common sense takes hold and they use my changes
07:46rritochOtherwise, this will become a hard fork of clojure
07:46noncomthis is really nice twist in the whole story!
07:47dnolen_rritoch: unlikely to happen re: numeric changes
07:47rritochNot really, lots of people are using their own custom hard forks of clojure
07:49rritochAccording to GITHub clojure has been forked 691 times, I'm not sure how many of those remained hard forks though
07:49noncomi 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.
07:50TEttingergithub requires you to have your own fork to submit pull requests, so I imagine a lot of it is for that
07:50rritochBut since I'm adding new features to clojure that aren't possible with the current runtime, these are truly hard forks.
07:50dnolen_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
07:50clgvnoncom: I have started a library for better primitive support (more than 4 arguments, allows byte float, etc.)
07:50TEttingerclgv: link? :D
07:51clgvnoncom: but I want to add the support for primitive lambda calling before I publish it
07:51ericelliottWhere 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. =)
07:51clgvTEttinger: ^^
07:51TEttingeroh ok clgv
07:51noncomdnolen_: yes, and much of the argument was refering to technical difficulties and obesity that such a support would imply.. i know.. but sad anyways :)
07:52rritochAnyhow, 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.
07:52clgvTEttinger: holidays are coming, so I guess there will be some hours to get that done :)
07:53TEttingerericelliott: 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...
07:54noncomclgv: that is also a good news.. will be waiting for it to be announced :)
07:56rritochDoes anyone know what the status of vector functions is at?
07:57rritochI noticed in the core that there is a lot of code there for vector mathematics, but it's all commented out.
07:57TEttingermight have gone to core.vector
07:57TEttingererr, matrix https://github.com/mikera/core.matrix
07:58rritochAnyhow, 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.
07:58TEttingeradd to what?
07:58rritochPike
07:59rritochWith 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.
08:00rritochThis is nothing knew, C++ has been doing it for almost as long as I've been programming.
08:01rritochAnyhow, the defense used by Pike developers was that they didn't want to include any support for features above high-school math
08:01rritochA problem that has NEVER happend in any LISP language development.
08:06rritochConsidering 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 :)
08:07rritochOnce 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.
08:09rritochI'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.
08:09rritochEither way, differential geometry with scilab and matlab is still difficult, but I think transducers should greatly simplify the task.
08:35clgvhaha no "features above high-school math"? roflmao
08:35clgvI have to write that down
08:37rritochclgv: No need, I'll pm you the link
08:37rritochIt is part of internet "history"
08:40vivekramaswamyHello 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})
08:41rritochI found the thread, I just can't seem to find the original comment, only my response
08:43dnolen_vivekramaswamy: keywords work as functions, numbers do not
08:44trisshey all. I'm having real issues building the clojurescript bit of a project
08:44trissonce compiled and loaded in to a browser I'm told:
08:45trissReferenceError: goog is not defined
08:46trisswhere do I find the goog.blahblah dependencies for clojurescrpt?
08:46dnolen_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.
08:46trisscheers dnolen I'll take another peek
08:47dnolen_triss: https://github.com/clojure/clojurescript/wiki/Quick-Start#development-mode
08:47dnolen_triss: https://github.com/clojure/clojurescript/wiki/Quick-Start#production-mode
08:47dnolen_note that the markup is *not* the same
08:47vivekramaswamythanks dnolen_ makes sense
08:48brucehauman$fortune
08:48lazybot"JoeTheClown: hey there!"
08:49brucehauman$getmail
08:56someplacewhat'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?
08:57ordnungswidrigsomeone: &(map #(apply str %) (partition 2 "123456789"))
08:57ordnungswidrigah, this was for @someplace actually
08:58ordnungswidrig,(map #(apply str %) (partition 2 "123456789"))
08:58clojurebot("12" "34" "56" "78")
08:58ordnungswidrigthanks, clojurebot
08:59someplacecould've sworn I'd tried that.. thanks!
09:06trissok, I've just started the clojurescript quick start from here: https://github.com/clojure/clojurescript/wiki/Quick-Start
09:06trissI can compile things but not run them. I've created the web page and hello.cljs files exactly as specified
09:08trissbut when i open the html file in firefox I'm told: ReferenceError: goog is not defined
09:08trissI can't see out/goog/base.js anywhere
09:11rritochI 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.
09:14rritochShould 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?
09:15rritochTechnically 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.
09:15mavbozo`triss: you can try to add (:require [goog.dom.classes]) in your namespace declaration
09:21trissah mavbozo thats great
09:21trissmany thanks
09:21trissso that puts everything from goog. in to my compiled js file?
09:22mavbozo`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
09:23mavbozo`in this tutorial by one of clojurescript maintainer http://swannodette.github.io/2013/11/07/clojurescript-101/ ,
09:24mavbozo`in ns declaration there is require goog.dom
09:24mavbozo`(ns async-tut1.core
09:24mavbozo` (:require [goog.dom :as dom]))
09:25trissI'l take a peek thanks man
09:50ehiggsHi 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
09:51mgaareehiggs: you can set cider-lein-command
09:58ehiggsmgaare: thanks. (setq cider-lein-command "...") ; in my ~/.emacs.d/init.el right?
09:58mgaareyes, that should do the trick
10:00ehiggsthanks. I'm crusty with emacs. had to restart it to get it working. :/
10:10ordnungswidrigehiggs: I nobody looks, I edit my init.el with vi :-)
10:10ordnungswidrigs/I nobody/If nobody/
10:19timvisher-xubunti 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:23timvisher-xubuntalso, 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:15gfredericks&(re-matches #"(?)" "") ;; any guesses what this means?
11:15lazybot⇒ ""
11:15clgvit's questionable ;)
11:23gfredericksoh great; (?i) etc are position-sensitive
11:23cursorkgfredericks: (? would normally indicate an inline modifier? e.g. (?i) for case-insensitive
11:24gfredericksright
11:25llasramgfredericks: Oh, so they change the global state for the remainder of the regex?
11:25Glenjamininline modifiers generally mean "from here onwards", yah
11:25llasram"global" -> for the whole regex
11:25Glenjaminor do they :s
11:25Glenjaminbah, i can never remember
11:26llasramAh, seems not to escape match groups
11:26llasram,(re-seq #"(?:(?i)foo)foo" "FOOfoo")
11:27clojurebot("FOOfoo")
11:27llasram,(re-seq #"(?:(?i)foo)foo" "fooFOO")
11:27clojurebotnil
11:27Glenjaminaccprding to http://www.regular-expressions.info/java.html it's global for the regex
11:27gfredericksllasram: yep, and I think you can toggle them as often as you want
11:28Glenjaminoh, actually it only mentions putting it at the beginning
11:28cursorkI only ever use (?i:foo) style myself...
11:52sm0kei am using carbonite fork of sritchie, and when put in a web request facing call i get randomly java.lang.ArrayIndexOutOfBoundsException: -1
11:52sm0kegoogle says this has something to do with kryo being non thread safe
11:52justin_smithsm0ke: any stack trace with that?
11:52sm0keanyone else faced this?
11:54sm0kejustin_smith: let me paste one
11:57sm0keweird stack trace i am getting with this project
11:57sm0kesome dep is pulling soe fancy stack trace formatter
12:03sm0kehttps://www.refheap.com/94580
12:03sm0ke^^ justin_smith
12:04sm0keif you see just before test.ns/thaw call which is nothing but read-bytes from carbonite
12:04sm0kethere is a into <- map <- reduce etc kind of thing going on
12:05sm0keso basically there is a map which vals being deserialized
12:05justin_smithI 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:06sm0kehurmm kryo is crazy fast for sure, just switched from nippy to it
12:06sm0kei takes almost negligible overhead even for million calls
12:07daviidhello. 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:07sm0kejust that the api sucks
12:07daviiddavid 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:07daviiddavid 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:07clgvsm0ke: which kryo version do you use?
12:07puredangersm0ke: I'm the original author of carbonite
12:07puredangeralthough I'm unlikely to be of much help at this point :)
12:07sm0kepuredanger: thanks for the reply, yep i saw you repo first
12:08sm0kebut doesnt seem to be update for a while
12:08puredangercertainly not by me :)
12:08sm0kesritichie's fork otoh seems to be used in flambo too
12:08daviidi 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:08sm0kepuredanger: do you plan on brining it to life again?
12:08sm0keits sure as hell rocking
12:08puredangerI'm not using it for anything so not really working on it
12:08daviid(2) these processes tend to sleep and i don't understand why, any one as a clue?
12:09puredangersm0ke: it was the result of some stuff I was using internally at a former employer
12:10clgvsm0ke: what exactly do you need? "write once, read often"?
12:10puredangersm0ke: at this point, I'd expect sritchie's version to be the more canonical one than mine
12:10sm0keclgv: well yes its just a single value being fetched and deserialized
12:11sm0keclgv: just a toy case i am working on
12:11clgvsm0ke: maybe you are interested in this lib https://github.com/guv/frost
12:13sm0keclgv: thanks i will take a look
12:14sm0kealthough i still think i just need some ThreadLocal wrapping
12:14sm0kenot sure of what though
12:14sm0kei invsted the day working with carbonite and the results are delightful
12:14EvanR,(function? identity)
12:14clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: function? in this context, compiling:(NO_SOURCE_PATH:0:0)>
12:15EvanR,(satisfies? IFn identity)
12:15clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: IFn in this context, compiling:(NO_SOURCE_PATH:0:0)>
12:16Bronsa,(ifn? identity)
12:16clojurebottrue
12:16Bronsa,(fn? identity)
12:16clojurebottrue
12:16clgvsm0ke: if you need to share the same "freezer" for multiple threads you can use one that performs locking
12:17Bronsapuredanger: I guess CLJ-1593 should be declined then?
12:17sm0keoh so the registry is nothing but Kryo itself
12:17stuartsierraError using CIDER: Lisp nesting exceeds `max-lisp-eval-depth' https://gist.github.com/stuartsierra/c5866f95513070da7f06 Anybody seen this?
12:17sm0kehurm just need a thread local for it!
12:19puredangerBronsa: 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:19clgvsm0ke: java.util.ThreadLocal
12:20sm0keclgv: yep on it
12:20clgverm java.lang.ThreadLocal, I think ^^
12:21clgvsm0ke: you can use proxy and wrap it in an IDeref
12:21sm0keyea so i think just replacing to (def kryo-registry (doto (ThreadLocal.) (.set (co/default-registry))))
12:21sm0keshould do the trick
12:21Bronsapuredanger: ok
12:24sm0keclojurebot: why use a proxy?
12:24clojurebotExcuse me?
12:25sm0keoops for clgv
12:26justin_smithstuartsierra: you can set the max depth in elisp - basically someone was coding as if elisp has tco, and it doesn't
12:26andyf_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:27stuartsierrajustin_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:27Bronsaandyf_: no; should be easy to add as a prewalk pass though
12:28justin_smithstuartsierra: 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:29andyf_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:29Bronsaandyf_: if you give me 5 minutes I can sketch it for you
12:30brucehaumanbbloom: you here?
12:30andyf_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:30stuartsierrajustin_smith: OK, will try that if it reappears, thanks.
12:30EvanRis there a form that lets me put an assert, and an expression it evaluates to if passed
12:30EvanR(do (assert..) foo) ?
12:31justin_smithstuartsierra: 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:32stuartsierrajustin_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:33justin_smithit'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:33justin_smithand it goes by sexps, not lines
12:36stuartsierrajustin_smith: cool, thanks
12:40Bronsaandyf_: http://sprunge.us/RVec?clj
12:41andyf_Grazie! Yeah, definitely simpler on its own like this than trying to mingle it with walk.
12:42Bronsaandyf_: you still have to call it in a prewalk
12:44timvisher-xubuntis clojurescript :require-macros deprecated at this point?
12:44timvisher-xubuntusing (:require [clojure.core.async :refer-macros [go])) produces errors for me
12:46bbloombrucehauman: yeah, what's up?
12:46Bronsaandyf_: http://sprunge.us/VdBe?clj alternative version that uses the index-vector-nodes pass
12:47brucehaumanbbloom: you have a second to talk about what your set up is? I really want to understand a bit better.
12:52sm0keThreadLocal seems to be the trick indeed, i cannot break it even for more than ~40k deser per sec
12:53sm0kebut it brough me to a weird conclusion that (.set..) on Threadlocal is not blocking
12:55bbloombrucehauman: yeah i can talk, but i may be a liiiitttle slow on individual responses
12:55bbloommultitasking
12:56sm0kehere a tip if someone is interested https://gist.github.com/kul/15a6cdb8862586248473
12:57brucehaumanbbloom: 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:57bbloombrucehauman: yeah, i have a fair number of macros
12:57bbloombrucehauman: i'm using figwheel right now on one major project that's basically ~3 cljs files and ~2 clj files
12:58bbloom1 cljs file is the pretty simple frontend driver page
12:58bbloomthe other 2 files are paired w/ their macro files & are pretty heavy algorithms, transformations, etc
12:58brucehaumanbbloom: yeah that is the problem then. Cljsbuild deletes the whole build (all cljs deps) if a clj file changes
12:58bbloom1 depends on the other too, so it's really only an A->B->C where B & C also have macros
12:59bbloombrucehauman: grumble grumble
12:59bbloombrucehauman: i know it's far from your fault (hell, it's more my fault!) but the cljs tooling blows
12:59brucehaumanbbloom: it would be better if it only delted libs on the source-paths
12:59bbloomi know that dnolen_ is interested in speeding up cljs builds
13:00bbloomi keep meaning to invest some time of my own in to it too
13:00bbloomi probably would have done so already if figwheel didn't get me through a week or two of work on a new project :-)
13:00brucehaumanbbloom: thanks man.
13:00dnolen_brucehauman: bbloom: this just sounds like lein-cljsbuild broken in this regard
13:00dnolen_instead of complaining submit patches
13:01brucehaumandnolen_: absolutely
13:01bbloomdnolen_: oh c'mon man, that's not fair: you know i contribute
13:01rurumateis it possible, using clojure.match, to match the case that 2 arguments are equal / not equal? see https://www.refheap.com/94569
13:01bbloomcomplaining is just part of my process :-)
13:01rritochHi, 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:01dnolen_bbloom: patches to ClojureScript are great - but patches to lein-cljsbuild are great too :)
13:02rurumaterritoch: can you point to "the code"?
13:02bbloomdnolen_: 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:03dnolen_bbloom: I'd rather the tools were smarter about using the cljs compiler
13:03rritochrurumate: Ok, one moment, I need to check git because I'm reprogramming this class to get a new feature.
13:03rurumaterritoch: which project?
13:03bbloomdnolen_: 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:04dnolen_bbloom: all the big enhancements to the compiler have tickets in JIRA right now
13:04bbloomi 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:04bblooms/clojure.clj/closure.clj/ # sheesh
13:04dnolen_a) AOT clojurescript b) cache analysis c) cache core.cljs analysis & output d) allow for in memory caching (no disk)
13:05brucehaumandnolen_: quick question. does the cljs compiler block until all files are written?
13:05dnolen_brucehauman: there is no parallel writing of files if that's what you mean
13:05rritochrurumate: Here is one example. https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Numbers.java#L3807-L3809
13:05brucehaumandnolen_: I’m just wondering if the call to build ends after all files are written to disk
13:06dnolen_bbloom: as far as the macro issue, there's absolutely no need for lein-cljsbuild to be so block headed about it
13:06liflashhi, 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:06dnolen_analysis contains the macro dependency informatino
13:06dnolen_blowing away the compilation environment on clj files changes is ridiculous
13:06rritochrurumate: As for my coding, I'm trying to add support for custom numeric types.
13:07alandipertaltho it can’t be known statically what a clj macro depends on because var dynamism, no?
13:07dnolen_brucehauman: I would expect so yes
13:07rritochrurumate: It certainly isn't sanctioned by anyone, but I noticed a lot of code like this that my IDE reports as invalid code.
13:07brucehaumandnolen_: could you point me to how I would get at the analysis data?
13:08dnolen_brucehauman: sure, even better if you write up a patch that makes a public api for common operations for everyone :D
13:08brucehaumandnolen_: that would be very useful
13:08rritochrurumate: 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:08bbloombrucehauman: have you been contributing to cljsbuild too?
13:08brucehaumandnolen_: I’m interested because I need that data
13:09brucehaumanbbloom: not yet …
13:09brucehaumanbbloom: but it’s inevitable
13:09brucehaumanbbloom: I’ve read all the sourece
13:09bbloombrucehauman: like i said, i'm still not sure what it does that the core compiler doesn't do .. besides maybe the file watching
13:09brucehaumanbbloom: I have had to hack the heck out of it
13:10bbloombrucehauman: if i don't understand it, it's either 1) unnecessary or 2) unnecessarily complex :-)
13:10rritochrurumate: 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:10dnolen_brucehauman: https://github.com/swannodette/hello-cljsc/blob/master/src/hello_cljsc/core.clj
13:10dnolen_brucehauman: I wrote a whole intro to the ClojureScript compiler
13:10brucehaumandnolen_: I remeber that, and I remeber thinking I would go through it ...
13:10dnolen_brucehauman: basically everything is stored in a single atom
13:11bbloomon 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:11brucehaumandnolen_: coolness
13:11dnolen_[::namespaces some-ns] will give you the namespace map
13:11dnolen_brucehauman: it includes everything
13:11dnolen_er
13:11dnolen_[:cljs.analyzer/namespaces some-ns]
13:11brucehaumandnolen_: I will look into it
13:12bbloombrucehauman: dnolen_: thanks guys
13:12brucehaumandnolen_: thanks
13:12brucehaumanbbloom: thanks to you as well man
13:13bbloombrucehauman: dnolen_: let me know if i can help somehow
13:13rurumaterritoch: that cast sure does look a bit unfamiliar
13:14rritochrurumate: Ok, I'll post to dev and see what they think. It can't hurt even if I'm wrong.
13:14rurumaterritoch: can you cite a source for the ARM problemms?
13:14hiredmanrritoch: what? why in the world would that have anything to do with arm?
13:16rritochrurumate: It was posted on clojure-dev https://groups.google.com/forum/#!topic/clojure-dev/C2od-z36Tc4
13:16hiredmanrritoch: that is android
13:16hiredmanrritoch: the issue with android is it is not a real jvm
13:17rritochhiredman: Did you look at the code I'm talking about though?
13:17hiredmanthe (Number) cast there uses autoboxing
13:17hiredmanthe long is autoboxed to a Long and then cast to Number
13:18rritochhiredman: Ok thanks. This is my first time hearing of autoboxing... I always use new NumericType(num) syntax.
13:19hiredmanrritoch: use the valueOf method if you are going to do that
13:19rritochhiredman: Mostly because my IDE complains
13:20hiredmanhttp://stackoverflow.com/questions/2974561/new-integer-vs-valueof
13:21hiredmanrritoch: java IDEs often try to pretend the more dynamic features of the jvm and java don't exist
13:21Deraenliflash: You could try cljs-http instead of cljs-ajax: https://github.com/r0man/cljs-http
13:21zB0hshey 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:21timvisher-xubuntis there any way to tell if i core.async/chan has anything in it?
13:21timvisher-xubuntand maybe even what it is?
13:21timvisher-xubunti'm not asking for production code but just trying to debug something
13:22timvisher-xubunti believe there should be something on a channel but (go (println (<! the-chan))) isn't printing anything
13:22timvisher-xubunti'm probably way off base as far as how to use this though :)
13:22liflashthx Deraen , you think it's a problem within cljs-ajax? why do you prefer cljs-http?
13:23dnolen_timvisher-xubunt: if it's not printing anything then there's nothing there :)
13:23timvisher-xubuntaccording to the tutorial, i should be able to <!! but that doesn't appear to be defined in cljs.core.async?
13:23justin_smithtimvisher-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:23justin_smithoh, but in cljs this may be a moot point
13:23dnolen_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:24hiredmanrritoch: 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:24timvisher-xubuntdnolen_: are there alternate implementations that are inspectable?
13:24timvisher-xubuntto which protocols do you refer?
13:24dnolen_timvisher-xubunt: I don't know haven't looked
13:24dnolen_timvisher-xubunt: you're going to have to goto the source
13:24timvisher-xubuntdnolen_: ok :)
13:26timvisher-xubuntam i right that there's no way to take from channels outside a go block in cljs?
13:26dnolen_zB0hs: Clojure Programming, Joy of Clojure, Clojure Cookbook
13:27dnolen_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:27hiredmanand there are actual jvms for arm, which run clojure great
13:27zB0hsdnolen_ those were all on my radar. great to hear them listed. thanks!
13:28zB0hsdnolen_ also hearing you on jsj and reading your blog got me interested in this realm so thanks for that too!
13:28dnolen_zB0hs: videos from Clojure conferences are also very informative starting points for methodology, libraries, best practicies etc.
13:28dnolen_zB0hs: https://www.youtube.com/user/ClojureTV
13:29hiredmanandroid 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:30dnolen_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:30dnolen_s/got/get
13:31Deraenliflash: 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:41timvisher-xubunti don't understand the behavior here: https://gist.github.com/feb385d634143e08114a
13:41timvisher-xubuntit 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:42timvisher-xubuntalmost 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:42timvisher-xubuntdoes that make any sense?
13:44timvisher-xubuntwhich 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:44ppppaulcan i use instants in clojurescript?
13:44dnolen_ppppaul: yes
13:46ppppauldnolen_, do you know of a link to help me do so?
13:46ppppaulis the ns cljs.instant?
13:46dnolen_ppppaul: I thought you were talking about instant literals, are you not?
13:47dnolen_,(java.util.Date.)
13:47clojurebot#inst "2014-12-08T18:44:53.846-00:00"
13:47dnolen_ppppaul: ^
13:47timvisher-xubuntyeah, 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:47nonrecursivezB0hs: 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:47zB0hsnonrecursive: noted... i will check them out. thanks!
13:47nonrecursivenp :)
13:48ppppaulok. nothing was showing up on light table so i thought i was using them wrong
13:48cflemingdnolen_: I got some answers to my debug protocol questions BTW - I had to go to IRC in the end.
13:48dnolen_cfleming: for the browser debugging protocol stuff?
13:48cflemingdnolen_: yeah
13:49cflemingdnolen_: Using the protocol will allow code hot swapping while stopped at a breakpoint
13:49cflemingdnolen_: So you could have an active REPL on a system that's being debugged - pretty cool
13:50dnolen_cfleming: very cool
13:50cflemingcfleming: Access to the standard developer tools is a problem, but there's https://github.com/sidorares/crmux, so I can expose a proxy
13:50puredangerrritoch: re your earlier questions on numerics, Java does autoboxing/unboxing between primitives and objects so the code you reference is valid Clojure
13:50cflemingarg, talking to myself again
13:50ppppaulis there a cljs.instant ns?
13:51puredangerrritoch: sorry, valid *Java*
13:52rritochpuredanger: Thanks, hiredman already explained the autoboxing. It wasn't something I'm familar with because my IDE doesn't like it.
13:53puredangerthen your IDE is old ;) autoboxing was added in Java 5 (? I think?)
13:53bja_ppppaul: doesn't seem like it. I've used: https://github.com/andrewmcveigh/cljs-time before to reasonable effect
13:54rritochpuredanger: 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:56hiredmanhttp://en.wikipedia.org/wiki/Dalvik_%28software%29 http://en.wikipedia.org/wiki/Android_Runtime
13:56puredangerrritoch: 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:57hiredmanpuredanger: really? I mean, if the code clojure generates follows the jvm spec, and they reject it, is that clojure's fault?
13:59timvisher-xubunti'm guessing that stdout is not being flushed prior to the next Read, so it only looks like the printlns are being delayed
13:59puredangerhiredman: 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:02hiredmanpuredanger: I have yet to see any evidence that the generated byte code doesn't conform to the spec
14:02hiredman(I've grepped the jvm spec for monitor and not found any evidence)
14:02puredangeras I said, I haven't read it closely enough to say.
14:03puredangerso I'm leaving it in the "suspicious" category till I can :)
14:05hiredmanlooking at the linked android issue, it sounds like they are fixing it on their end
14:05hiredmanhttps://code.google.com/p/android/issues/detail?id=80687
14:07dnolen_timvisher-xubunt: your gist doesn't make any sense to me btw, I've never seen that behavior
14:09Bronsahiredman: the first patch in that clojure ticket seems to be reasonable
14:10timvisher-xubuntdnolen_: i was misinterpreting it. i can just hit return at the next prompt and the printlns show up
14:10timvisher-xubuntprobably some combination of cider 0.8.1 and what i'm doing
14:11timvisher-xubuntdnolen_: first time i'm doing anything with core.async so i'm pretty behind the 8-ball :)
14:11hiredmanBronsa: well, it introduces other issues (which could be fixed)
14:12hiredmanBronsa: 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:12hiredman(actually thinking about it, I am not sure that could be fixed easily)
14:14hiredman(again, not that I've seen anything in any documentation that forbids that)
14:14Bronsahiredman: right but I haven't seen anything in the jvm spec that says monitor enters/exit needs to be in the same method
14:15hiredmanright
14:15hiredmanBronsa: but android tools complain if they are not
14:15hiredmanwhich 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:16Bronsahiredman: 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:16hiredmandoes it?
14:17Bronsahiredman: the way locking is implemented now doesn't take into account monitor-enter failing at aquiring the lock
14:18Bronsawhich according to the spec can only happen if the object ref is null
14:18Bronsauhm, but null makes monitor-exit throw aswell so maybe it's not actually an issue
14:18hiredmanright
14:19hiredmanhttps://docs.oracle.com/javase/specs/jvms/se7/html/jvms-2.html#jvms-2.11.10 is actually interesting
14:19hiredmanthe structured locking stuff may require that monitorenter and exits line up in a single method
14:21puredanger 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:21Bronsahiredman: 2 seems to imply that some jvms might consider the bytecode emitted for (locking nil) invalid
14:23hiredmanBronsa: for a literal nil
14:25ppppauldo multimethods work in clojurescript?
14:25benmossppppaul: yep
14:25ppppaul: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:36justin_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:38justin_smith{blake}: well, that depends on how you are asking wrap-session to store the session
14:39justin_smithin-memory should be the default
14:39{blake}I don't have much of anything.
14:40{blake}just a "(sesh/wrap-session)" call in my app handler.
14:40{blake}And an assoc on the :session key to put in the user's name.
14:41{blake}And I was just going to create a set to hold that user's data.
14:41{blake}Which I would, I guess, free at some point of idleness.
14:41justin_smithright. 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:42tickingis 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:42justin_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:42lazybot⇒ 154
14:43{blake}justin_smith: Do I need an atom? I guess it makes sense to have it.
14:43justin_smithticking: what do you mean by "can't handle whitespace"
14:43{blake}ticking: I've parsed some very complex xml in Clojure.
14:43chouserticking: If you need robust namespace support, you'll probably need to use a Java library directly via interop.
14:43justin_smith{blake}: you need some kind of thread safe store for lookup, that can hold arbitrary clojure resources
14:44chouserticking: 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:45justin_smith{blake}: given how sessions work, I would think an atom wrapping a map from identifier to set
14:45justin_smithwhere each identifier looks up a unique user session
14:46tickingjustin_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{blake}ticking: You want to distinguish between nil and blank? I may have had that issue, I don't recall.
14:48justin_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:49ticking{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:49justin_smithright, 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:51justin_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:51justin_smith{blake}: you can use a cookie store to serialize the data, but that doesn't manage the resources, for obvious reasons
14:52justin_smith{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:52justin_smithas long as you don't hold onto them elsewhere, of course
14:52rritochI 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:54ticking{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:55ticking{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:56rritochErr, I mean custom numeric types.
14:56amalloy{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{blake}(inc amalloy)
14:57lazybot⇒ 203
14:57{blake}Crap, I missed the Rich Hickey cardboard cutout presentation ceremony.
14:58amalloy{blake}: it turned out there was a mixup and they sent rich a cutout of me
14:58justin_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:58joshuafcolehahaha
14:58{blake}amalloy: ha!
14:59rritochIt 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:00justin_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:02justin_smithhttps://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:02justin_smith"Middleware that times out idle sessions after a specified number of seconds."
15:02justin_smithsounds right to me!
15:03{blake}justin_smith: Yep. Perfect! Thanks again!
15:04justin_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:04justin_smithif 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:04justin_smiththere 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:04justin_smiththe use of what?
15:05daviidlet 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:05daviid
15:05{blake}Holding on to something forever? Unless...it's checked on again?
15:05daviidhere 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:05daviid
15:05daviidhttp://paste.lisp.org/display/144632
15:06justin_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:06justin_smithand 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:07justin_smith{blake}: you never say that
15:07justin_smithbut that is what it does
15:07justin_smithit only does the cleanup when they send a request
15:07{blake}So, maybe meant to be used with something else, then.
15:07daviidi'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:08justin_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:08amalloydaviid: 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:09daviidamalloy: let me paste the clojure script, give me a second
15:09amalloyor 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:12daviidamalloy: 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:13justin_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:14amalloyokay, 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:15daviidamalloy: not sure, let me try to write something to stdout from clojure, how do i do that?
15:15amalloydaviid: um, it's println. just what you're doing in the error case
15:15justin_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:15daviidok, trying
15:15justin_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{blake}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:16daviidamalloy: 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:16amalloydaviid: System/exit is ripping the plug out of the wall
15:17{blake}<--anti-statist
15:17justin_smith{blake}: aha - so your issue is knowing when you can release that interface to the spreadsheet
15:17justin_smithif 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:18justin_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:18justin_smiththat may be the simple way to do it
15:18{blake}justin_smith: Ooh. Even better.
15:18justin_smithas 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{blake}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:19justin_smithcore.memoize has stuff for that https://github.com/clojure/core.memoize
15:20amalloythis 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:21amalloyyou 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:21amalloymmmm. 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{blake}amalloy: But not on the same order of magnitude as typing inputs.
15:22{blake}Sorry, I was switching scales there without mentioning it.
15:22amalloyokay. a cache of A seems fine
15:23{blake}I think so. I just have to refresh the cache in that one case.
15:23amalloyi 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{blake}There's a built-in memoize distinct from core.memoize?
15:31justin_smith{blake}: there is, it just has no option to prune the memoized results
15:31daviidamalloy: that did not solve my problem, all java threads hangs the same way [i added this (println "ok") just before (System/exit 0)
15:35amalloy*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:38EvanR.oO(automatic println bisector debugger)
15:38hfaafb;)
15:39daviidamalloy: i could comment all imagej lines and see
15:40justin_smithdaviid: 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:41daviidjustin_smith: tx
15:41EvanRdo you still have to insert / remove traces by hand
15:41justin_smithEvanR: no, you call a function which wraps the functions in trace output
15:41EvanRall functions?
15:41justin_smithEvanR: that can be done per function, or in one go to every function in a namespace
15:42EvanRthat sounds pretty handy
15:42justin_smithyou probably wouldn't want to do it in all functions in all namespaces :)
15:42amalloyjustin_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:42timvisher-xubuntshouldn'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:42justin_smithamalloy: 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{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:46timvisher-xubuntit seems that events/KeyCodes and events/KeyNames are both undefined
15:46justin_smith{blake}: awesome
15:49timvisher-xubuntgoog/events/keycodes.js is in the closure-library jar i'm using...
15:51timvisher-xubunti'm only doing whitespace optimizations so it should be present in the output
15:52timvisher-xubuntah, but it's not.
15:52timvisher-xubuntinteresting.
15:54dnolen_timvisher-xubunt: (:require [goog.events.KeyCodes]) or (:import [goog.events KeyCodes])
15:55dnolen_just requiring goog.events is not enough
15:57timvisher-xubuntdnolen_: just figured that out. i can't tell what's different between KeyCodes and, for instance, EventType though.
16:00daviidamalloy_: 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:04arohnerI don't suppose there's a test.check lib for generating ring requests, is there?
16:04weavejesterarohner: Not that I know of, but that would be rather interesting.
16:04weavejesterarohner: Maybe you could use Herbert?
16:04daviidimagej 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:05benmosshow would one go about making a clojure library available in clojurescript?
16:05benmosscljx?
16:05daviidjava do not like ssh -CX session i gues
16:05arohnerweavejester: interesting, thanks
16:06mdrogalisbenmoss: Yeah.
16:07benmosssad that even if you dont need any feature expressions its still the only way to accomplish it
16:09mdrogalisbenmoss: I could be wrong, but I think that's how it's usually done.
16:09daviidi ment imagej do not like ssh -X sessions, but why does it not complain/bug inste4ad of hagging?
16:09dnolen_benmoss: hopefully to be sorted out before 1.7.0 goes out
16:10benmosshope so!
16:24hlshipAre there official docs about &env and &form (used with defmacro)? Are these officially supported?
16:24mkrI try to parse a page and create a nested table of contents from the h1..h6 tags als ol->li->ol... list.
16:24mkrhttps://gist.github.com/kremers/40032730ae36a8816901
16:25dnolen_hlship: there aren't official docs, but yes they are officially supported
16:25mkrIs there a better way? I don't get the "last" element with (for) so I need something that offers sequencial processing like reduce?
16:35stuartsierra&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:35lazybotjava.lang.RuntimeException: Unable to resolve symbol: form in this context
16:49amalloystuartsierra: 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:49stuartsierra@amalloy I've used it to get at the metadata.
16:50stuartsierraAlso, you can't tell how many arguments there were if the macro has & args.
16:50amalloystuartsierra: huh? of course you can
16:51stuartsierraNevermind.
16:51stuartsierraI was thinking of something else.
16:51amalloythe one place nobody ever looks for metadata is the macro name itself: (^String mymacro x y z)
16:52amalloyi 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:57amalloy{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{blake}er "use an atom"
16:58{blake}Since the purpose of "memoize" is to try to come up with a general purpose approach.
16:58amalloyi mean, memoize is a fine function to use on occasion, i'm not saying you should never use it
16:58amalloybut it doesn't solve the problem you actually have right now
16:58{blake}amalloy: Fair 'nuff.
17:12puredangerhlship: I took a note to doc this on clojure.org somewhere
17:30crash_epIn 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:31hfaafbyes its called... a function call
17:31justin_smith#(% x)
17:31justin_smithwhere x is your collection
17:31amalloyhfaafb: there's no need for scorn; funcall is a useful function, even though clojure doesn't have it
17:32amalloyjustin_smith: #(% %2)
17:32justin_smiththat works too
17:32crash_epI need a named function. I have defined a helper to do this, but was surprised not to be able to find something here.
17:32justin_smithdepending where you know x, and where you are creating that function
17:32EvanR(def foo (fn [f] (fn [x] (f x))))
17:32amalloycrash_ep: you need a named function? nonsense; why?
17:32crash_epFor use in condp
17:32justin_smithcondp does not require named functions
17:32amalloyjustin_smith: the question said "takes an argument x..."
17:33justin_smithamalloy: ahh, you are right
17:33EvanR,(let [$ (fn [f x] (f x))] ($ inc 1))
17:33clojurebot2
17:34crash_ep(condp funcall my-collection test-expr :>> result-fn :test-expr :>> result-fn)
17:34EvanRwait, isnt (a b) syntax invoking IFn interface, so whats the relevant "call" method?
17:35EvanR(partial that foo)
17:35crash_epamalloy: oh, you are saying that I could just pass #(%1 %2) instead of funcall there?
17:36crash_epI suppose so, but maybe I will just stick with the funcall helper since it will be more readable.
17:36EvanR,(#(%1 %2) inc 1)
17:36clojurebot2
17:36crash_epEvanR: thank you. glad to know this is an option
17:36justin_smith&(condp #(%1 %2) [] empty? :empty)
17:36lazybot⇒ :empty
17:38justin_smith&(condp #(%1 %2) [1] seq :not-empty empty? :empty)
17:38lazybot⇒ :not-empty
17:38marrrkHello! 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:39justin_smithmarrrk: all versions of deps are specified project.clj
17:39justin_smithas regards the chestnut template itself, there is no way to choose, you get the most recent
17:39justin_smith*specified IN project.clj
17:41marrrkThe most recent stable one?
17:41marrrkArgh, it is the first question in the FAQ. Sorry, guys.
17:41justin_smiththe most recent deployed, I don't think templates have a concept of "stable" at all
17:42marrrkThis is not going to be easy.
17:43EvanRnot going to be easy, made hard
17:45ajmccluskey,(update-in {:cats 42} [] dissoc :cats)
17:45clojurebot{nil nil, :cats 42}
17:46amalloyajmccluskey: a classic
17:46ajmccluskeyamalloy: haha, I was pretty sure someone would have done this first. Just checking.
17:46EvanR,(dissoc {:cats 42})
17:46clojurebot{:cats 42}
17:47rasmustooh weird
17:47amalloyif assoc-in and update-in had a contract, it would include "don't use an empty keyseq"
17:47amalloyEvanR: nice, i'm glad that got fixed
17:47EvanR,(dissoc {:cats 42} :cats)
17:47clojurebot{}
17:47ajmccluskeyamalloy: right. I spent the last 20 minutes trying to work out if that made sense. Lesson learned - no empty key seqs.
17:48EvanR,(assoc-in [] {:a 'b} 3)
17:48clojurebot#<UnsupportedOperationException java.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap>
17:48EvanR,(assoc-in {:a 'b} [] 3)
17:48clojurebot{nil 3, :a b}
17:48EvanRseems legit
17:49EvanRamalloy: what got fixed?
17:50amalloy(dissoc m) used to be an arity exception
17:50EvanRand now its a silent no op?
17:51amalloyEvanR: yeah
17:54amalloywait, am i wrong? git-blame for dissoc says the 1-arity case has been around since at least 2008
17:56EvanRunfix it
17:57EvanRthe less useless things it can mistake for valid code the better
17:57amalloyEvanR: 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:58amalloy(apply dissoc m ks) seems like the obvious way to do it
17:58amalloybut if (dissoc m) were an error, that could suddenly break if some jerk gave you an empty list of keys
17:58EvanR,(dissoc {:a 1} :a)
17:58clojurebot{}
17:58hfaafb,(dissoc {} :a)
17:58clojurebot{}
17:58EvanR,(dissoc {:a 1 :b 2} :a :b)
17:58clojurebot{}
17:59rasmustodissoc-in?
17:59EvanRwell, var arg style isnt the obvious way to me
17:59amalloyEvanR: reduce would be fine too, but i think apply is better
17:59EvanRwell, now anything with var args now must have a pointless 0 arg case
18:00stuartsierracore.incubator has dissoc-in https://github.com/clojure/core.incubator/blob/16aed877cdfa24371099b0d13877d2716908cc91/src/main/clojure/clojure/core/incubator.clj#L62
18:00EvanRif not using var args, paying the price for failure to catch errors at runtime
18:00rasmustostuartsierra: nice! good to know
18:00EvanRi guess using var args could be seen as a cut your losses
18:02EvanRprobably better would be a dissoc that took the list of keys to dissoc in the first place
18:02EvanRthen you dont even need apply
18:03justin_smithbut then you need to build a list whether you need one or not, and can't use partial evaluation as effectively
18:03amalloyEvanR: 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:03EvanRno, its a different function from dissoc, which would take exactly 1 key
18:03EvanRand crash otherwise, because you intended to have 1
18:04EvanRamalloy: binary + is a bad example, youre talking about the traditional vararg +
18:04EvanRand the assertion is "surely being able to (+ a b c d e f) is better"
18:05EvanRin response, no i wasnt talking about var-arg uncurrying everything
18:06FriedBobIf 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:07ffwacom3.50
18:07FriedBob3.5 what? Minutes, hours, days?
18:07EvanRsomeone should run an empirical experiment somehow to find out
18:07EvanRdunno who
18:07ffwacomFriedBob: 3.50
18:08FriedBobIt'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:08EvanRmight want to check if its in an infinite loop somehow
18:08justin_smith{"word1 word2" "word3"} is a very memory-inefficient way to do trigrams
18:08SagiCZ1which function returns true if pred is false for any in the collection?
18:09EvanRevery? identity
18:09justin_smith(complement every?)
18:09EvanRer
18:09SagiCZ1justin_smith: thats it, thanks
18:10EvanRdamn bools
18:11justin_smith ,((complement every?) even? [0 2 4 5])
18:11clojurebottrue
18:11justin_smith ,((complement every?) even? [0 2 4])
18:11clojurebotfalse
18:12SagiCZ1,(map boolean [true false nil () "hello"))
18:12clojurebot#<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>
18:12SagiCZ1,(map boolean [true false nil () "hello"])
18:12clojurebot(true false false true true)
18:13marrrkIs it okay to ask about clojurescript here anyway?
18:13justin_smith0 is another one that trips up some newcomers
18:13EvanR,(if 0 1 2)
18:13clojurebot1
18:13justin_smithmarrrk: yeah, this place is more active than #clojurescript I think
18:13SagiCZ1,(boolean 0)
18:13clojurebottrue
18:13SagiCZ1good tip
18:13EvanR,(if "" 1 2)
18:14clojurebot1
18:14EvanRonly nil and false?
18:14justin_smithonly nil and false
18:14SagiCZ1~only-nil-and-false
18:14clojurebotI don't understand.
18:14marrrkjustin_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:14tsantosIf 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:15ffwacomReduce?
18:15justin_smithtsantos: ##(into {} (for [[k v] {:a 0 :b 1 :c 2}] [k (inc v)]))
18:15lazybot⇒ {:c 3, :b 2, :a 1}
18:16tsantosSo why is into better? That’s what I have right now in my code.
18:16justin_smithtsantos: you walk the collection twice to do the zip-map
18:16dbaschjustin_smith: SagiCZ1 not-any?
18:16tsantosAh! Thanks.
18:17EvanRive 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:17stuartsierrareduce-kv
18:17justin_smithEvanR: the doall is redundant because {} cannot be lazy
18:17EvanRits a map
18:18EvanRthe construction of the map will happen but not necessarily side effects
18:18justin_smiththe act of creating the hash is eager
18:18justin_smiththe doall does nothing
18:19EvanRok, i lied, but in both cases, i think you can get unevaluated seqs deep in the result map
18:19justin_smithEvanR: you need clojure.walk or your own tree walker to fix that
18:19justin_smitha top level doall won't do anything there
18:19EvanRyes, even without doall, its a pain to type that little program
18:20justin_smith(doc reduce-kv)
18:20clojurebot"([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:21EvanRyou 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:21justin_smith,(reduce-kv (fn [m k v] (assoc m k (inc v))) {} {:a 0 :b 1 :c 2})
18:21clojurebot{:a 1, :b 2, :c 3}
18:21EvanR(map-values inc {:a 0 :b 1 : c})
18:21EvanRsomething
18:22amalloymap-values should really take its arguments in the other order
18:22EvanRany map-like operation seems like should take the function first, like map on sequences
18:23amalloynah. because now you lose the ability to write (update-in mymap [x y z] map-values inc)
18:23EvanRi didnt understand that version of update-in above either, with four args
18:23amalloyfunctions that operate on *sequences* take the sequences last; other kinds of collections are generally first
18:24EvanRyou mean to do (update-in mymap [x y z] (partial map-values inc)) ?
18:24tsantosSo this is a decent map-values? (defn map-values [func map] (into {} (for [[k v] map] [k (func v)])))
18:25BronsaEvanR: (update-in m p f a) is like writing (update-in m p #(f % a))
18:25EvanRheh, then swap the % and a in the implementation of update-in ;)
18:25amalloyboy are you missing out, EvanR, if you didn't know update-in takes varargs
18:26EvanRif partialing was more convenient, then having the "real variables" go last is better
18:26EvanRand the more fixed context go first
18:26justin_smith&(swap! (atom {:a 0}) update-in [:a] + 42)
18:26lazybot⇒ {:a 42}
18:27EvanRso theres more to the parentheses-less sub style?
18:27EvanRvery weird
18:27justin_smithswap! and update-in are both var-args
18:27EvanRto my untrained eye that swap! looks like gobble-de-gook
18:28tsantosoh, wow. update-in is awesome.
18:28amalloyEvanR: swap!, update-in, conj, assoc, dissoc: all these functions participate in this
18:28amalloywhy don't you swap the argument order for all of those? (dissoc k m) instead of (dissoc m k) makes partialing easier too
18:28EvanRits weird, im more used to putting composing functions in order, grouping the expressions which form their own operation
18:29amalloyif convenient partialing were the only design consideration, language design would be a lot easier
18:29EvanRyeah dissoc k m would be the shiz, to me
18:29amalloyEvanR: that is so gross i just barfed
18:29weavejesterIn Clojure, functions that operate on single values tend to have the value go first, while with collections the collection is last.
18:30EvanRthe one which is less often needed first could be easily arrived at with flip
18:30amalloyyou 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:30amalloyweavejester: s/collections/sequences
18:30EvanRyeah i can see how the arrow is in that shape
18:30weavejesteramalloy: well, non-keyed collections.
18:31EvanRits java headed
18:31amalloyweavejester: i think you're just drawing the wrong distinction; sequences go last, all other collections go first
18:31EvanRif the collection went last, the arrow would be function composition instead, and not a macro
18:31weavejesterIt's more because it makes sense to write (assoc m k1 v1, k2 v2, ...) and (dissoc m k1 k2 ...)
18:32amalloyweavejester: you weren't here earlier: EvanR thinks varargs are the devil
18:32weavejesteramalloy: Hm... I guess that's true. (conj vector value) has the collection go first.
18:32EvanRi 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:32amalloyweavejester: right. conj participates in the unified update model, just like assoc, dissoc, etc
18:33amalloyEvanR: and that's not unreasonable. feel free to define your own one-arg-only versions
18:38stuartsierra*Sequence* functions (map, filter, reduce) take the sequence last. Almost everything else, including collection functions, takes the "primary" argument first.
18:38stuartsierra`(cons item sequence)` is a sequence function whereas `(conj coll item)` is a collection function.
18:38EvanRcollection means map ?
18:38EvanRbecause everything else seems to be a sequence
18:39stuartsierraCollection means vector, map, or set.
18:39amalloyEvanR: set, vector...
18:39amalloystuartsierra: wellllll, collection is open-ended
18:39justin_smith,(map coll? [{} [] #{} ()])
18:39clojurebot(true true true true)
18:39stuartsierrayeah yeah
18:39stuartsierra,(coll? (seq [1 2 3]))
18:39clojurebottrue
18:39EvanRmaps go first, everything else goes last
18:39stuartsierrabah
18:39stuartsierraEvanR: Sequences go last, everything else goes first. :)
18:40justin_smithEvanR: #{} is not a sequence either
18:40EvanRok sets
18:41EvanRany reason for this distinction as far as mapping filtering and reducing goes?
18:42stuartsierraEvanR: partly historical from other Lisps, I think
18:43stuartsierraRich Hickey had a deeper justification which he posted on the mailing list many years ago. I can't find it at the moment.
18:45stuartsierraThis came up around the time `clojure.string` was created out of the ashes of `clojure.contrib.str-utils{,2,3}`
18:49stuartsierraAha! Here it is https://groups.google.com/forum/#!msg/clojure/iyyNyWs53dc/Q_8BtjRthqgJ
18:50stuartsierraI was young and foolish then.
18:53amalloyoh man, i forgot about this thread. i remember being quite amused last time i read the last message
18:54amalloyalso, i think you mean "exuberant", not "foolish"
19:19dbaschI was amused by the (if … true false) :P
19:24pdk(if (bool x) true false)
19:31amalloypdk: "bool"? get back to your crazy 1970s languages. around here, we use whole words
19:31pdki'm sorry
19:31pdk(if (ean x) true false)
19:34dbaschamalloy: seq called, wants its uence back
19:34amalloy&(doc sequence)
19:34lazybot⇒ "([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:35amalloyspeaking of, seque is one function whose name i can't ever spell right
19:35amalloyi just have to keep going, sequeue. it's like banana: easy to start spelling, but hard to stop
19:36dbaschseq seque sequence make clojure a language for all times
19:37amalloynow we need lazy-seque
19:37pdkjust rename it sequins
19:37pdkthen all your code can sparkle
19:37dbaschso many good examples and I had to pick seq
19:37cflemingamalloy: The one that always gets me is Seqable - I always write it Sequable
19:42dbaschthe one keyword I always hated with a passion is (http) “referer”
19:45cflemingdbasch: Ah, yes, a classic
19:58YKYcan I access LinkedLists defined in Java, in clojure? any solution would be nice
19:59timvisher-xubunti'm assuming the 'use transformer' note in the filter(>|<) docs for core.async mean 'use transducer'?
20:04dbaschYKY: of course you can. What specifically would you like to do?
20:06YKYsay I have LinkedList defined in Java
20:06YKYI want to access it in clojure
20:07YKYlike a clojure seq
20:07amalloyYKY: just seq over it
20:07YKYLets swap
20:07amalloyseq works on anything Iterable
20:07YKYoops wrong window
20:08YKYhow about clojure sets
20:09amalloyhow about them indeed? that's not really a question
20:10YKYis there a type in java that corresponds to clojure sets?
20:12YKYand can I also export the list back to Java?
20:15lasergoat,(into #{} (java.util.HashSet. #{1 2 3}))
20:15clojurebot#{1 3 2}
20:15lasergoatis a roundtrip conversion between a clojure set and a java set
20:17lasergoatmore generally, java collections can usually take a java.util.Collection as a constructor argument, and clojure collections implement that interface
20:17lasergoatso you can do (SomeJavaCollection. any-clojure-collection)
20:18lasergoatsimilarly, clojure’s into can take any collection, so you can go the other direction
20:18YKYsounds great =)
20:19amalloylasergoat: notably, you usually dont' need to do either conversion at all
20:20amalloysince both collection libraries use interfaces
20:20YKYwhy not?
20:20YKYI see
20:20amalloyyou can seq over a HashSet, and java can call .get on a PersistentHashSet
20:20amalloyor .contains or whatever
20:21lasergoatright, 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:22YKYthe thing is, java does not support "tail" on LinkedLists
20:22YKYI don't know why
20:22YKYthere's just no tail function
20:24gfredericksYKY: I think because it's a mutable list instead of immutable, the concept makes less sense
20:24gfredericksfurthermore it's doubly-linked
20:26lasergoati’d expect a doubly linked list to keep a tail pointer, actually
20:27YKYso which java list structure is best suited for import to clojure?
20:27amalloyit does
20:27gfrederickslasergoat: what does tail mean there?
20:27amalloyLinkedList/getLast
20:27amalloybut i don't think that's actually what YKY meant by tail
20:27YKYgetLast is not "tail"
20:27YKYtail = rest
20:28YKYanyway, which Java List structure should I use?
20:28dbaschYKY: it depends on what you’re doing in Java really, there’s no generic answer to your question
20:28amalloyYKY: none of them? any of them? it really doesn't matter
20:28YKYso clojure would not even make a copy of it
20:28YKY?
20:29lasergoatoh, like cdr. yeah, ok, i was thinking what amalloy was thinking
20:29amalloylasergoat: i wasn't, it was just you :P
20:30dbaschYKY: what exactly are you trying to do? Clojure won’t do anything you don’t tell it to do
20:31dbaschmeaning, you can instantiate a java list and use it as a mutable object in clojure just like in java
20:31YKYI have a Java LinkedList or ArrayList (have not decided)
20:32YKYand I want to run my clojure code over the List
20:32YKYjust wonder which kind is best
20:32gfredericksYKY: 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:32gfredericksYKY: the copying will take roughly the same amount of time no matter what java collection you use
20:32dbaschYKY: best for what?
20:33YKYwell, the Java LinkedList does not have a "rest" function
20:33YKYin my clojure code I definitely used "rest" somewhere
20:33YKYso the question is whether the clojure code would run at all
20:33lasergoatno, all the clojure sequence stuff works on java lists
20:33dbasch,(rest (java.util.LinkedList. [1 2 3]))
20:33gfredericks,(def yky (doto (java.util.List.) (.add 3) (.add 4)))
20:33lasergoat,(rest (LinkedList. [1 2 3]))
20:33clojurebot(2 3)
20:33clojurebot#<CompilerException java.lang.IllegalArgumentException: No matching ctor found for interface java.util.List, compiling:(NO_SOURCE_PATH:0:0)>
20:33clojurebot#<CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: LinkedList, compiling:(NO_SOURCE_PATH:0:0)>
20:34gfredericks,(def yky (doto (java.util.LinkedList.) (.add 3) (.add 4)))
20:34clojurebot#'sandbox/yky
20:34amalloyYKY: 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:34gfredericks,(rest yky)
20:34clojurebot(4)
20:34YKYOK that's great =)
20:34amalloywhich is what i said when you first asked: seq works on lists
20:34dbaschYKY: in clojure structures don’t “have” functions
20:34dbaschfunctions work on structures (if they can)
20:35YKYseems that the clojure developers have taken care of that
20:35dbaschof course classes have methods, which you can call as functions in Clojure
20:37asiasHey everyone! Does someone mind telling me when records should be used over stadard maps?
20:37gfredericksinfrequently
20:37amalloyasias: when all other options are obviously no good
20:37asiasamalloy: records are a last resort?
20:38gfredericks~records |are| a last resort
20:38clojurebotRoger.
20:38amalloynot really. but they shouldn't be anywhere close to a first resort, so i err on the side of uh...word...
20:38gfredericksasias: my only frequent use of records is with stuartsierra/component
20:40asiasgfredricks: thanks!
20:41asiasgfredericks: thanks!
20:41amalloyasias: your client will tab-complete usernames
20:41justin_smithgfredericks: I think we can generalize that to "records are useful with libs that take arguments that must implement some given protocol"
20:42asiasamalloy: oh i didn't realize that... thanks!
20:43gfredericksjustin_smith: sometimes just reify
20:43justin_smithfair enough
20:43asiasjustin_smith: so the performance difference generally isn't substantial enough to warrant using records over maps?
20:44amalloyasias: i remember the sad old days of typing usernames by hand before i knew any better. i try to spare everyone else that
20:44justin_smithasias: it can be, but it's a sweet spot between maps and deftype that only gets hit every so often
20:44amalloyasias: no. i can think of only one case in my uh, four years of clojure where i needed a record for performance
20:45amalloyyou mostly use them because they're named, concrete types, which can implement interfaces and things, and that's necessary sometimes
20:45asiaswhen is that neccessary outside of java interop?
20:46amalloyrarely. but y'know, protocols
20:46justin_smithasias: protocols are a useful way to let clients implement concrete functionality
20:46gfredericks~protocols
20:46clojurebothttp://whiley.org/2012/02/29/a-problem-of-decoupling/ describes a problem solvable by protocols
20:47justin_smiththere are also multimethods, but protocols are less flexible / perform better
20:48asiasjustin_smith: amalloy: thanks a bunch!
20:48amalloyjustin_smith: there are also functions
20:49justin_smithamalloy: indeed
20:54perplexajust found 60 year old color pictures of my family :D
20:55crash_epIf 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:55amalloy[a b c]
20:55crash_eps/seq/sequence/
20:55crash_epamalloy: is that a style point or does the vector literal have some other advantage over the function call?
20:56amalloyi don't think it's faster or anything. it just looks silly to call vector manually
20:56justin_smithvector literals are a huge readability bonus
20:56crash_epI 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:57gfredericksmight want to get over that one; I think it's pretty ubiquitous
20:57justin_smiththe upper-left / lower-right division breaks it up pretty well
20:57crash_epi
20:57crash_epi'll give it a try
20:58amalloyjustin_smith: upper-right/lower-left, right? or are you talking about something different than i am?
20:58amalloyyou must be. i think what i'm saying is weird and silly
20:59justin_smitha 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:59justin_smithof a given block
21:00justin_smithie. lhs vs rhs of let blocks, return value vs. incoming args...
21:00amalloyjustin_smith: i dunno though, i think the return value is often further left than the arguments
21:01amalloy(defn some-long-function-name [x y] (when (foo x) [a b c]))
21:01gfrederickso_O
21:01gfredericksooooh
21:01gfrederickswith same-line-args style
21:01gfrederickswhich is clearly worth going to war over
21:01justin_smithyeah, I rarely use that style, because comment strings
21:01gfredericks(dec same-line-args)
21:01lazybot⇒ -1
21:01amalloysimilarly for with-style bindings
21:01amalloyand even (when-let [...]) pushes stuff pretty far to the right
21:02justin_smithtrue, it's a heuristic and not a rule to be sure
21:02gfredericks&(re-matches #"({0,0}{0})" "")
21:02lazybot⇒ ["" ""]
21:02justin_smithbut when I look at random code blocks and draw that imaginary diagonal line, it's fairly accurate
21:04crash_epSee, I find the [c] on line 118 to be a little hard to read: http://cl.ly/image/3L0l1g3j0f0C
21:04crash_epnot hard to read, but… it looks almost like a parameter declaration
21:18justin_smithtbaldridge: I'm checking out pixie, looks interesting so far. I wonder what that awesome color graphic would be without all the warning messages
21:57gfredericks&(re-matches #"{0}?" "")
21:57lazybot⇒ ""
22:01gfredericks&(re-matches #"x++{0}?{0}+{0}?" "x")
22:01lazybot⇒ "x"
22:05gfredericks(test.check has very strange things to teach you about regexes if only you are willing to listen)
22:07reiddrapergfredericks is the test.check whisperer
22:27dwysockiis it possible to generate documentation with codox for a project with AOT compiled classes?
22:28dwysockiI'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:30dwysockiI'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:46jarjar_primeIs there anyway to use different middleware with some routes? I don't want teh OPTIONS header to require authentication headers :-|
22:46jarjar_prime(for compojure)
23:35dwysockiI guess it's impossible to have anything AOT compiled and still generate codox documentation
23:36dwysockiI need to use :gen-class for a couple things, though
23:36dwysockiis there no way to skip over those namespaces?
23:37rritochdwysocki: What are you using to compile with?
23:37dwysockileiningen
23:37rritochdwysocki: Ie. what OS
23:37dwysockiarch linux
23:38justin_smithhow would the OS affect this at all?
23:38rritochdwysocki: Ok that is odd, I use gen-class and gen codox without a problem, but only from linux
23:38dwysockihmm
23:38dwysockiwell
23:38dwysockiI *believe* this is the source of the problem
23:39rritochdwysocki: 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:39dwysockiI managed to generate codox for some of my other projects, which don't use :gen-class
23:39dwysockibut perhaps that's not the actual cause
23:40rritochjustin_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:41rritochjustin_smith: I use both for all my docs since they're compatible and are both useful
23:41dwysockifor what it's worth, here's my error message
23:41dwysockihttp://pastebin.com/h6f95zct
23:43rritochdwysocki: Hmm, what version are you using?
23:44dwysockiof codox? 0.8.10
23:45rritochOk, nota version issue, that's the same version I use
23:46rritochjustin_smith: It is codox that fails on windows
23:48rritochhttp://pastebin.com/Vsrm4xrt
23:49justin_smithshit, once again the over-eagerness of devs who don't even use windows to use System.separator, causing bugs
23:49justin_smithI think that's what it is ata least
23:49justin_smith*at
23:49rritochjustin_smith: Probably
23:51TEttingerdoesn't / work on windows vista and newer?
23:51justin_smithright
23:51justin_smithbut people try to use \
23:51justin_smitheven in URLS
23:51rritochdwysocki: It seems your missing a file someplace
23:51justin_smithbecause it's windows
23:51justin_smithand it's not even people who use windows who are making this mistake
23:51TEttingeroh man
23:51rritochdwysocki: try lein do jar -U, doc
23:52rritochdwysocki: That should re-download all of your depenendencies
23:52dwysockiI get the same error when I do that
23:53dwysockialso, I've deleted and re-downloaded all of my dependencies about a dozen times now lol
23:53dwysockithinking that maybe changing something and re-downloading deps would magically fix it
23:53dwysockion the bright side, I just successfully generated docs with marginalia
23:54dwysockiso at worst I have that
23:54TEttingernice dwysocki!
23:54TEttingerwhat is codox?
23:54dwysockiauto doc generation
23:54TEttingerah
23:54justin_smithTEttinger: it's what generates html docs, I think ring uses it for example
23:54dwysockia bit nicer than what the clojure team uses
23:54justin_smithit's the one with the side bar with ns names you can click
23:55dwysockimarginalia is kinda weird though
23:55justin_smithmarginalia works best if you write your code for marginalia
23:55dwysockiit basically just re-formats your source code
23:55justin_smithsemi-literate style
23:55dwysockinot entirely sure what literate style means
23:55justin_smithdwysocki: literate programming
23:56dwysockiI heard that phrase for the first time today, while searching about codox and marginalia
23:56rritochdwysocki: Now that I think about it, I hadissues with codox myself, did you set an output-dir?
23:56justin_smithdwysocki: 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:56dwysockirritoch: no, I just let it default to docs/
23:56rritochdwysocki: I use {:output-dir "doc/codox"}
23:56dwysockijustin_smith: I see
23:57rritochdwysocki: I also change the src-linenum-anchor-prefix and src-dir-uri to properly link to github
23:57dwysockirritoch: yeah I was going to play with that stuff later
23:57rritochdwysocki: Based on your error though, setting a output-dir may help
23:58dwysockiI don't think the directory's the problem, though
23:58dwysockireally?
23:58rritochdwysocki: 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:59dwysockiwhat exactly do you use gen-classes for?
23:59dwysockiI'm using it to extend antlr4 classes
23:59dwysockiusing antlr4 might actually be the problem
23:59rritochdwysocki: Can't say, NDI
23:59dwysockiah
23:59rritocherr, NDA