#clojure logs

2014-11-26

01:48zRecursive(doc ->)
01:48clojurebot"([x & forms]); Threads the expr through the forms. Inserts x as the second item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the second item in second form, etc."
04:12scizoIs there anyone here that might have some pointers on why the readers from data_readers.clj are not being used?
04:12scizoThey are being loaded into *data-readers*.
04:13scizoBut I am still getting the error clojure.lang.ExceptionInfo: No reader function for tag
04:47dan_bsorry if this has been asked a zillion times - does anyone know what happened to the aleph wiki? apparently there used to be such a thing at https://github.com/ztellman/aleph/wiki/
04:48dan_bor failing that, anyone point me at some code for doing http streaming with aleph?
05:53sqdmy core.async code involving lots of subscriptions and go loops seems to continue running even if i stop the original data source channel. is there a simple pattern for looping over a channel that stops nicely when the channel is closed?
05:54sqdi currently have a lot of (go (while (do-something (<! ch)))) loops
05:57sqdi guess i could do something with the nil value returned by <! on closed channels
05:58ordnungswidrigsdq: yes, that's the common pattern, sth. like (go (loop (if-let [x (<! ch)] (do something) (recur)))
06:09sqdordnungswidrig: thanks
06:22justin_smithsqd: yeah, you should be basing your recursion on what comes from the channel, because closed channels return nil and you can end up in an infinite loop if "do-something" doesn't return nil from a nil input with the while version
06:25daniel_can anyone explain why #'app is always used to get the server to pickup changes to the app definition?
06:26daniel_i unserstand that #'app is the var and app is a symbol pointing to the var
06:26justin_smithdaniel_: when a var is passed to the server process, then resolution of that var is done at each invocation of the var
06:26justin_smithdaniel_: if you pass the function, that function cannot ever change
06:26justin_smiththe same function is used every time
06:27daniel_and a symbol is a function which calls itself and looks up the var
06:27justin_smithdaniel_: at the time that the server is invoked
06:28justin_smithnot inside the functions making up the server
06:28justin_smithso it's a one time lookup
06:28daniel_i see, and then the result is 'cached'?
06:28justin_smiththe args are fully resolved before the function is even called
06:28justin_smithone sec, it's a bit noisy to do with the bots, I will make a refheap
06:33justin_smithhttps://www.refheap.com/94025 daniel_: demonstrated here
06:34justin_smithan http server is like bar in that example, it takes a callable thing and calls it later
06:34justin_smithnotice that when passed a var, what bar does changes when the var changes
06:34justin_smithbut when passed a function, it does not change
06:36mavbozo(inc justin_smith)
06:36lazybot⇒ 148
06:39justin_smiththis is useful at dev time, but there is an overhead for the repeated var lookup. In fact there is a performance trick to bind frequently accessed functions as function args or let bindings over a loop to reduce var lookups and boost speed.
06:39justin_smithusually this won't be your bottleneck though, but it's useful to know for when it might be
06:44daniel_overhead was going to be my next question
06:45daniel_ok makes sense
06:46daniel_symbols are immutable, vars aren't
06:46justin_smithfunctions are immutable
06:47justin_smithsymbols are resolved to functions before other functions see them
06:47justin_smith(or other (usually non-var) values)
06:50daniel_somehow i thought that a symbol pointed to a var which pointed to a function
06:50daniel_and that if you changed the function that a var pointed to, the symbol pointed to that same var so would also change
06:50thearthurjust to put it anohter way, when you create an instance of the server, that specific instance has a pointer to the function to call on reach request. If you make another instnce of the server it could use a different function.
06:51daniel_but you can't change a function, you create a new one
06:51thearthurif you pass it a var *as* it's function then it will still call the same "function" (the var) every time, and the var will forward this to the current function
06:52daniel_so the symbol has already resolved to the first function, it only resolves the var once
06:53thearthuryes, if you pass a symbol that resolves to a function, by way of a var, then the var is only resolved once
06:56daniel_maketh perfect sense
07:25katoxoops, a deep trap to fall in http://cemerick.com/2010/08/19/case-insensitive-filesystems-vs-aot-compiled-clojure/
07:25akaI'm a long time vim user and am looking to use emacs as my clojure IDE... any suggested reading or links?
07:26katoxin which one can get by using this lib https://github.com/qerub/camel-snake-kebab in lein deps
07:26pandeiroaka: C-h i
07:26weavejes_aka: Are you planning on using evil mode?
07:27akaI just decided to give emacs a go. Not sure if I should or not.
07:27akaIt would probably get me going faster but I wonder if it would be better in the long run to just go full throttle emacs
07:27justin_smithaka: cider is notoriously problematic to update, if you ever decide to change versions after installing, clojure-mode and all related compiled elisp (elc) files should be deleted or else things will break in really weird ways
07:27pandeirojustin_smith: don't scare the guy!
07:28justin_smithaka: I switched to evil mode, because the chord keys were killing my fingers
07:28justin_smithpandeiro: one should be afraid of cider. It's easy to break.
07:28weavejesterjustin_smith: I haven't had *that* many problems with cider. The main issue is that cider defaults to the snapshot version.
07:28justin_smithpandeiro: not hyperbole or dissing. I use it. It's just not easy to change versions.
07:28justin_smithweavejester: I have had all sorts of problems with cider.
07:28akaI do love my vim navigation
07:29justin_smithweavejester: and not from snapshots.
07:29weavejesterNow that 0.8 is released, I've been considering using melpa-stable instead
07:29akais there an alternative to cider that I should consider?
07:29akaahh the joys of jumping into something new
07:29justin_smithweavejester: I had to back off from 0.7.0 to 0.6.0 to get things working.
07:29weavejesteraka: Not really. I think it's still the best tool for the job.
07:29akaokay cool
07:29pandeiroaka: cider's growing pains are mostly behind it i think; i'd jump in
07:29weavejesterjustin_smith: Have you tried 0.8.0?
07:30akaokay cool
07:30justin_smithnot since it hit stable.
07:30weavejesteraka: evil-mode is a pretty good Vi emulation layer.
07:30pandeiroaka: and seriously, C-h i -- the most amazing thing about emacs is the self-documenting part imo
07:30justin_smithweavejester: I briefly tried it in the development state, things were broken, I switched to an earlier version
07:30akapandeiro: thank you :)
07:31akaweavejester: does evil-mode interfere with any of emacs key bindings?
07:31weavejesteraka: Not that I've noticed.
07:32akaokay cool
07:32justin_smithaka: only some, and you can go into emacs mode for those. (ie. Ctrl-e in insert mode)
07:32akagood to know
07:32justin_smithand of course you can hit Esc $ instead of Ctrl-e
07:33weavejesteraka: My emacs.d directory is here if you happen to want to use it for ideas, or as a starting point: https://github.com/weavejester/dotfiles/tree/master/emacs.d
07:33akaIf I'm not careful I will enter paralysis by analysis mode. I better just jump in.
07:33akaahh perfect thank you
07:33weavejesteraka: Which OS are you using?
07:34akafor the most part Ubuntu
07:34akasome OS X
07:34akabut most my dev is in the terminal of an ubuntu server
07:35weavejesteraka: I use the emacs GUI, so I haven't tried it at the terminal
07:35akaI might go the emacs gui route first
07:35akadev locally on my mbp
07:36justin_smithaka: you can edit remote files via the emacs GUI version with tramp. It works nicely.
07:36justin_smithaka: under the hood it connects via ssh, and makes the changes remotely when you save. IIRC it does this using ed.
07:36weavejesteraka: Though having just tried it, the terminal version of my emacs setup works pretty well. The only think I'd disable is the menu-bar.
07:36akaweavejester: noted
07:37weavejesterSince I use OSX, there's no reason not to have the menu bar on for the GUI mode, since it's ubiquitous anyway.
07:37weavejesterOh, and I use cask
07:38weavejesterSo you need to run "brew install cask" or whatever it is under Ubuntu, and then "cd ~/.emacs.d && cask install"
07:38pandeiroweavejester: aka: i use cask too but wouldnt recommend it at this point
07:38pandeiroit's just one more moving part
07:38weavejesterpandeiro: Wouldn't it be hard to know what packages you've installed without it?
07:38pandeiroonce you're fluent in emacs and managing your packages more carefully, there's more to gain by having something like that
07:39weavejesterTrue...
07:39pandeiroweavejester: not when they're right there in init.el
07:39akaso ignore cask for now?
07:39justin_smithaka C-x C-f ssh://user@host:/path/to/file
07:39weavejesterMaybe I should make a simplified version of my config.
07:39pandeiroweavejester: aka: for instance - https://github.com/pandeiro/dotemacs/blob/master/init.el#L6
07:39weavejesteraka: I just mention it because I use cask in my config.
07:39akaany suggested way of installing emacs on OSX? just brwe install ?
07:40pandeirothe important part there is the package.el boilerplate for including the third-party repos and the simple way of iterating over packages and installing
07:40weavejesterbrew install emacs will work. There's also a mac-emacs version I prefer
07:40weavejesterbrew tap railwaycat/emacsmacport && brew install emacs-mac
07:40akak thx
07:41pandeiroaka: btw that emacs config is ancient and the packages are not what i use, just pointing to the boilerplate part and the iteration mechanism in elisp
07:41mavbozois aquamacs good for clojure? cos i saw rich hickey use it in last clojure conj
07:41akathanks for all the info and help guys
07:41akaI'll soon be flaming vim users!
07:42akajk I still love me some vim
07:42weavejesterEmacs is my OS, Vi is still my editor ;)
07:43justin_smithaka: after a little while using vi, followed by a long time with emacs (and a bit of the signs of rsi coming on) I like the emacs features, and the vi keybindings
07:43justin_smithso evil seems like it will be good...
07:44weavejesterDoes anyone happen to use paxedit, out of interest?
07:44justin_smithno, this is the first I have heard of it
07:44weavejesterIt's a more context-aware paredit
07:44weavejesterApparently :)
07:45akaI love vim's text object motions... glad I will still get them in emacs
07:45akathat will make the transition much faster
07:46akado you guys use paredit?
07:46akaor similar?
07:46mavbozosmartparens
07:46pandeiroweavejester: i still use paredit and probably only 25% of its functions but just C-k alone is gold
07:46justin_smithyes, paredit and evil don't interact as nicely as I would like, but paredit does some cool stuff if you stay in regular emacs, or insert mode
07:47weavejesterjustin_smith: I've gotten quite far with evil-paredit and some of my own movement functions.
07:47kungiDoes anyone use ediff for git merging?
07:47justin_smithoh, I had not heard of evil-paredit
07:47weavejesterjustin_smith: It's not as useful as it sounds :)
07:48kungiweavejester: evil-paredit is great :-)
07:48weavejesterjustin_smith: It just ensures that vim commands don't break paredit.
07:48justin_smithmakes sense
07:49weavejesterI'm still working on my evil/paredit setup, but I do have: https://github.com/weavejester/dotfiles/blob/master/emacs.d/init.el#L113
07:49weavejesterI might try out paxedit on the weekend.
07:51akayou guys likely saved me a shit load of time
07:53kungiweavejester: Thanks for the config example
08:20clgv(inc #clojure)
08:20lazybot⇒ 8
08:41rurumate,n
08:41rurumate[2:33:12 PM] Samuel Geiger: origin:release/1.1.0
08:41rurumate[2:33:33 PM] Samuel Geiger: bitte da nur noch sachen rein mergen wenn die Tickets dazu fix Version 1.1.0 haben
08:41clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: n in this context, compiling:(NO_SOURCE_PATH:0:0)>
08:41rurumateoops
08:42clgvrurumate: you are german as well?
08:42rurumatethank you gnu/linux for completely sucking at copy paste
08:42rurumateclgv: of course not, why do you ask
08:42clgv:P
08:42rurumateso here's a question,
08:42rurumate,(an-jvm/analyze '(fn [n] (when (pos? n) (recur (dec n)))))
08:42clojurebot#<CompilerException java.lang.RuntimeException: No such namespace: an-jvm, compiling:(NO_SOURCE_PATH:0:0)>
08:42rurumateone moment
08:44rurumate,(clojure.tools.analyzer.jvm/analyze '(fn [n] (when (pos? n) (recur (dec n)))))
08:44clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.tools.analyzer.jvm>
08:44rurumateok so that doesn't even work
08:44justin_smithneither of the bots have that lib
08:44rurumatecan we add clojore.tools.analyzer.jvm to clojurebot, please?
08:45rurumateanyway that wasn't the question
08:45rurumateI'll make a paste of the output
08:47rurumatedang, how do I pprint to a file?
08:47rurumateI know I can bind *out*, any faster way?
08:48mavbozo(spit f (with-out-str (pprint ))
08:50rurumatemavbozo: brilliant, thank
08:51rurumateso this is the output of (clojure.tools.analyzer.jvm/analyze '(fn [n] (when (pos? n) (recur (dec n))))): https://www.refheap.com/94028
08:52rurumatewhy are there more than one blocks with the same loop-id?
08:53justin_smithit looks like all of the blocks have the same loop id?
08:53Bronsarurumate: only the method node has :loop-id, the other instances of :loop-id are in the :env of the method body nodes, to propagate it until
08:54Bronsauntil it reaches a recur or another loop/fn
08:54rurumateoh, of course
08:54rurumateI forgot about the env
08:54rurumatethese trees are huge, how do you navigate / search them?
08:55rurumatefor instance how do I find all :loop-id nodes, along with their paths (get-in style)
08:55Bronsarurumate: I usually just use -> and explore the nodes via `keys`
08:55rurumateif I had that I'd quicky see that all but one have :env in their path
08:56rurumateBronsa: you can't really do exhaustive search that way, unless you already know where you want to look
08:56rurumateit's just too much work
08:56arav93Is anyone familiar with core.typeD?
08:57Bronsarurumate: well you have the AST quickref that you can use to see what info is in what nodes + what children a node has
08:57Bronsarurumate: if you want to query the AST there's also a datomic datalog interface
08:58rurumateBronsa: I was hoping for some tricks with nested maps in general
08:58rurumateoh datalog
08:58rurumatedatomic, is that open source?
08:58Bronsano
08:58rurumatethere must be something. it's just some trees, and we have lisp
09:11rurumateBronsa: here it is with all the :env removed https://www.refheap.com/94029
09:12sqdis there a function similar to core.async/reduce that yields everytime the source channel yields? e.g. to create a counter
09:13rurumateBronsa: the's a node with :loop-id loop_14182 appears only once, but nothing refers to it
09:13rurumateshouldn't something point to that?
09:14martinklepschI'm trying to get a clostache template working that contains a fair chunk of JSON that's generated via chesire. now one field in that json contains a <script> tag and I can't figure out how to properly escape double quotes - or maybe it's something completely differnt
09:15Bronsarurumate: .. the env points to that ...
09:15avrakotosHi all. Clojure noob here. Downloaded Counterclockwise and trying to simply create a clojure project. But I get an Exception when creating it. "unable to find valid certification path to requested target - Reason: Exception while creating new project. "
09:15rurumateheh
09:16Bronsarurumate: were you expecting a :loop-id field on the :recur node?
09:16clgvavrakotos: what did you download?
09:16rurumateBronsa: yes
09:16martinklepschdoes anyone have experience with chesire/clostache and encoutered similar problems?
09:16Bronsarurumate: I mean, I can add that but it's not going to add any info that's not already there
09:16rurumateBronsa: so it's in the :env of the :recur node?
09:16Bronsarurumate: yes
09:16avrakotosclgv: I first tried using the counterclockwise plugin for eclipse. Got the same error there. Then I downloaded the counterclockwise standalone exe and also got that error
09:17rurumateok cool thanks Bronsa
09:17clgvavrakotos: which os? I tried the latest standalone on linux 64 bit last week
09:17avrakotosclgv: win 7 64 bit
09:18clgvavrakotos: can you post a complete stacktrace on refheap.com?
09:18avrakotosclgv: does the counterclockwise or leiningen need to connect to some online server?
09:19ordnungswidrigavrakotos: leiningen will self-install on the first invocation
09:19clgvavrakotos: oh right it might be the leiningen integration that wants to download the default clojure dependency
09:19avrakotosclgv: I am currently at work?
09:19avrakotosclgv: whops
09:20avrakotosclgv: i am at work, and we have a proxy, so that is probably it then
09:20clgvavrakotos: check the docs, I believe there are proxy settings. maybe the same you'd use for eclipse in general
09:21avrakotosclgv: Its probably the proxy then. Thanks for the help =)
09:23ordnungswidrigavrakotos: looks like an ssl issue to me.
09:30atankanowthis may be a bigger modeling question but ... let's say i have a set of steps nicely set up with the thread last operation, e.g. (->> data (step-1 arg1) (step-2 arg1) (step-3)); now i realize steps 1 and 2 need to be run for a set of configurations, e.g. (for [k (configs)] (step-1 arg1 k)) ... ; is there an idiomatic way to handle this? I've considered (1) wrapping for loop around step-1 and step-2 and then flattening the r
09:30atankanow(2) passing step-1 and step-2 to a reducing function
09:35weavejesteratankanow: Are your functions side effectful?
09:36atankanowhmmm ....
09:37atankanowthey do rely on IO (state of the filesystem)
09:37weavejesterYou're relying on the return value, though?
09:38weavejesterIf so it sounds like you want a reduce
09:39atankanowyes ... i want the return values, so i can use reduce to get a single list as output
09:40atankanowso "for" is idiomatically for side-effecting fns
09:41FrozenlockI think it's 'doseq' if you just want the side effects.
09:45atankanowcompletely unrelated discussion, what is your IRC client of choice?
09:46clrndirssi
09:46mavbozoemacs's erc
09:46schmiremacs rcirc
09:46avrakotosordnungswidrig: It was indeed an SSL issue. We have a server that terminates all HTTPS traffic into the company. I had to use a proxy. Works now :) Thanks for the help
09:53Frozenlockatankanow: emacs's erc
09:57weavejesterI've been trying out Textual 5
10:01atankanowclojure was the only thing that could make me switch from vim -> emacs, but now that i'm in this universe I'm not sure how to get out ... i'm trying emacs circe now
10:08rurumateBronsa: :fn-method and :recur both have :loop-id
10:08rurumatesee https://www.refheap.com/94036
10:09rurumateneither of these are part of an :env
10:10Bronsarurumate: right so you dissoc'ed it wrongly before :P I don't recall all the node fields by heart myself
10:11rurumatebut why you want to leave atankanow? emacs is love, emacs is life
10:12rurumateBronsa: I'm confuse. There are now 2 nodes with the same node id. Just how does tools.emitter figure out where the jump is supposed to go?
10:12rurumate*with the same loop id
10:13Bronsarurumate: the only loop targets are :fn-method, :method and :loop
10:13Bronsarurumate: the loop-id in those is a label, the loop-id in :recur signals the loop target
10:14Bronsarurumate: no loop target will have the same loop-id ever. multiple recurs inside the same loop target will have the same loop-id however
10:18rurumateBronsa: thanks for these important info
10:18rurumateis there a wiki or something about these rules?
10:21Bronsarurumate: it's documented in the quickspec for t.a.jvm
10:22rurumateI see. Thanks for taking the time to answer Bronsa
10:23rurumateBronsa: so there is no need to go search for loop-id inside the :env, right?
10:24Bronsaright. it's just internal info that the analyzer uses for some passes
10:24rurumatecool. I feel I'm making some progress. This sure is fun
10:25clgvrurumate: what are you trying to do?
10:25Bronsarurumate: sorry if I said otherwise before -- I was hacking t.a and didn't check before replying
10:25rurumatenothing particular, just interested in tools.analyzer
10:27clgvlearning exercises
10:28clgvwhat is usually used to escape arbitrary text before displaying it in an html? some function from hiccup?
10:28clgvah there is hiccup.util/escape
10:29rurumateclgv: if you're on emacs, try string-edit
10:30rurumatenot sure if that suits your use case though
10:30clgvrurumate: it's data loaded on runtime
10:34mikerodis there anything wrong with using `reduce-kv` to build data structures other than maps?
10:34mikerode.g. reduce-kv (fn [c k v] (conj c [k (inc v)])) [] {:a 10 :b 20}) ;= [[:b 21] [:a 11]]
10:35mikerodI believe it is an optimized way to reduce over a map
10:35mikerodHowever, does it need to *produce* a map for any particular reason?
10:35mikerodI typically only see examples of the form: (reduce-kv (fn [m k v] (assoc m k (inc v))) {} {:a 10 :b 20})
10:36mikerodWhich ;= {:a 11, :b 21}
10:36mikerodI'm guessing the answer to my question is "no, it doesn't matter"
10:36clgvmikerod: you can build anything you like with it
10:36clgvmikerod: you are right, it saves overhead when reducing over a map
10:37mikerodclgv: thanks, I was just clarifying on that due to lack of examples suggesting otherwise. It'd make sense that you may want to reduce over a map into some non-coll at all sometimes even, so that makes sense.
10:37clgvmikerod: building vectors or calculating aggregated values should be pretty common as well
10:39clgvmikerod: in the above example you can get more speed with a transient result map
10:40mikerodclgv: ah yes, (persistent! (reduce-kv (fn [m k v] (assoc! m k (inc v))) (transient {}) {:a 10 :b 20}))
10:41clgvmikerod: exactly
10:41clgvmikerod: btw. if you need that pattern more often, the helper function `update-vals` wants to be written ;)
10:47Glenjamini tend to call it fmap, based on the function from algo generic
10:47gfredericksplumbing.core/map-vals
10:47Glenjaminhttps://github.com/clojure/algo.generic/blob/master/src/main/clojure/clojure/algo/generic/functor.clj#L33
10:51mikerodclgv: hah that is true. I guess I have often done something liek this: (zipmap (keys m) (map my-fn (vals m)))
10:52mikerodbut for some reason `zipmap` does not use transients I suppose
10:52SparkySparkyBoomhttps://www.refheap.com/0a02d2f005f8c1fce9d3fc45e
10:52SparkySparkyBoomhow would i make it so that i can pass a list as arguments of a function
10:54SparkySparkyBoomah i figured it out
10:54SparkySparkyBoomthe apply function works
10:55Bronsamikerod: there's a ticket in JIRA for making zipmap use transients
10:56Bronsahttp://dev.clojure.org/jira/browse/CLJ-1005
10:56Bronsamikerod: vote if you're interested
10:57mikerodBronsa: thanks, yes I'd like this
11:00fairuzhey guys, using liberator, how to set the Access-Control-Allow-Origin in the response header? I'm now getting the cors problem
11:00CookedGryphonHas anyone else come across the problem that midje's test runner is giving an exit code of 0 when errors are thrown in core.test tests?
11:00CookedGryphonI just deployed a buggy release thanks to this :(
11:01clgvmikerod: but in your case a zipmap with transients would be less efficent than the transient reduce-kv anyway
11:01mikerodclgv: I figured that'd be the case
11:02clgvwoah, you cant get a java 6 jdk without an oracle account?
11:02mikeroddue to the kv-reduce protocol impl on maps
11:02clgvI just wanted to check if my java 6 compatibility claim is actually true
11:03clgvhumm for java 8 you need no account...
11:05ghadishaybanBronsa: zipmap with iterators & transients now... but needs 1.7
11:06Bronsanice
11:07Bronsaghadishayban: how much of a speedup do iterators have over seqs?
11:07ghadishaybanthat will depend on iterators being more pervasive, which was bumped to 1.8 i think
11:08ghadishaybana few iterators right now are built upon the seqs, rather than the other way around
11:12ghadishaybanless alloc is good
11:12ghadishaybanthe whole reason I made a transducible context for Iterables (while totally gross) is so that zipmap can consume it
11:13ghadishaybansomething like (zipmap cols (iterable some-transducer values)) could realize no seqs
11:16ghadishaybanthe whole Seq/Iterator/Reduce trinity is increasingly hard to implement
11:17ghadishaybanreferring to the CLJ-1603 ticket for IReduceInit-able cycle & iterate. the lazy seq version is so elegant:
11:17ghadishayban,(source cycle)
11:17clojurebotSource not found\n
11:17ghadishayban (lazy-seq
11:17ghadishayban (when-let [s (seq coll)]
11:17ghadishayban (concat s (cycle s)))
11:18ghadishaybanA shorter transducer version: (sequence cat (repeat coll))
11:18Glenjaminwatch out, cat isn't lazy - which may or may not be a problem
11:19ghadishaybanthat's probably tolerable in the cycle case, but you're right it's not 100% equiv
11:20ghadishaybanBut a version that is IReduceInit & preserves compatibility with core/cycle is going to have to be a giant implementation
11:20ghadishaybanAnd with a giant implementation you lose the favorite property of "obviously correct"
11:21ghadishayban,(conj (supers clojure.lang.LazySeq) clojure.lang.IReduceInit)
11:21clojurebot#{clojure.lang.ISeq clojure.lang.IReduceInit clojure.lang.IPersistentCollection java.io.Serializable java.util.List ...}
11:29sqdis there a straightforward way to request all yields from a core.async channel during the last n milliseconds?
11:44thearthursqd: I don't think that exists
11:46razum2umwhat is more efficient if I don't care about type https://www.refheap.com/b85d84209383136ce1506c895
11:47stuartsierrarazum2um: probably subvec but I wouldn't expect there to be all that much difference
11:49razum2umstuartsierra: btw, is count on vector O(1)? (-> [1 2 3 4] (subvec 1 (dec (count [1 2 3 4])))) would be faster?
11:49Glenjamin,(counted? [])
11:49clojurebottrue
11:49Glenjamini think that means yes
11:50Glenjamin(doc counted?)
11:50clojurebot"([coll]); Returns true if coll implements count in constant time"
11:50stuartsierrarazum2um: Yes, count on vector is constant-time.
11:50razum2umstuartsierra: Glenjamin: thx!
11:51stuartsierraAs always: profile first, find the hotspots, then try to optimize.
11:55razum2umstuartsierra: btw, what do you think about profiling lazyseqed-code with timbre https://github.com/ptaoussanis/timbre/issues/87 ?
11:56technomancy~paredit guide is making it easier to grok with purty pictures http://danmidwood.com/content/2014/11/21/animated-paredit.html
11:56clojurebotAck. Ack.
12:08mikoshello
12:08mikosanyone got any recommendations on where to start learning about Clojure + sockets?
12:08mikosi am trying to write an rtsp client
12:12clgvis there a way to set a backlink to the main project (from a nested folder) in a REAME.md in agithub repository
12:12clgv?
12:12clgvsince the relative path ends up in "blob/master" and returns a 404
12:13arrdemclgv: I think you can say "/README.md" and github will figure it out.
12:13andyf_clgv: absolute path?
12:13clgvarrdem: I want to link to the project root, not only the readme
12:14clgvandyf_: that's problematic for forking right?
12:16andyf_clgv: perhaps. I don?t know if there is a way to do it that meets all of your desires, just ?a way"
12:16clgvandyf_: hm ok. guessed so
12:17andyf_clgv: have you read this? https://github.com/blog/1395-relative-links-in-markup-files
12:17clgvthey seem to have forgotten that special case
12:17clgvyeah
12:18clgvhmm well I'll link to the README then
12:19jro_I've [incanter "1.5.5"] in ~/.lein/profiles.clj. After starting the repl and user=> (use 'incanter.core) I will get an exception: CompilerException java.lang.NoClassDefFoundError: x (wrong name: X),
12:21jro_any pointers where to start to resolve the problem?
12:22arohnermikos: clojure sockets are just java sockets
12:23arohnermikos: there might be sockets lib for clojure, but I haven't used any
12:24fatwuHello!
12:27aravindhwhat is the defafcto webframework used in clojure that has good community support? I am looking to build an order processing system for an ecommerce client. also what is the database access library used? yesql seems simple to me. any suggestions?
12:40dbaschjro_: can you post your profiles.clj on refheap? How are you running the repl?
12:43jro_https://www.refheap.com/94042 I can run incanter by setting up a project, and running the repl from its root
12:44jro_I'm using lein repl and leiningen 2.4.1 on java8
12:55technomancywhy not upgrade lein? =)
12:57andyf_jro_: Incanter is not a Leiningen plugin, so if you put it in your ~/.lein/profiles.clj by going to the :user key of the top level map, then the :plugins key, then adding it to that vector, that will not work.
12:58andyf_jro_: It should work if you add it to a :dependencies vector in a profile that is active when you start 'lein repl'
13:01jro_andyf_: it is in the :dependencies -vector, and other deps works fine.
13:02AlwaysBCodinganyone know if you can have multi-arity protocol functions? i.e. SomeProtocol (someFunction [this options]) but I want to be able to call someFunction without a second arg and have the options default to {}
13:02jro_(use 'incarter.core) seems to launch separate JVM, maybe this causes some problems. However, I'm bit happier now, when it works in a separate project.
13:22RaynesYa know
13:22RaynesCoffeescript isn't the worst thing ever.
13:22RaynesI tried to h8 but it reminds me enough of Python that I'm comfortable.
13:24arrdemRaynes: this is clojure ontopic :P
13:24RaynesI'm aware.
13:25arrdemk
13:25RaynesI figure we're allowed to discuss other languages.
13:25RaynesEspecially when one of them is regarding a Clojure compilation target ;)
13:26arrdemfair enough
13:27justin_smith$mail aravindh the Clojure community tends to prefer a selection of libs over frameworks. That said, friend is highly recommended for authentication if you can figure out how to use it, and you can use crossclj.info to get some sense of what libs are widely used. IMHO something as simple as yesql, while recent is likely to be less hassle than a widely used DSL like korma.
13:27lazybotMessage saved.
13:28dnolen_AlwaysBCoding: such things can be done around the protocol w/ a regular function
13:29atankanowif you're just talking about multi-arity, you can overload protocol functions, calling a fn of greater arity with default values
13:58edwping
13:59arrdempong
14:00mikosthanks, arohner, i'll read into java sockets
14:13gfrederickswoah
14:13gfredericksI just used ;; to comment out a line of #_#_#_
14:14shemyou rascal!
14:18l1xjustin_smith: thanks for the help yesterday
14:18l1xjustin_smith: https://github.com/l1x/hasta-la-vista/blob/master/src/hasta_la_vista/core.clj#L159
14:18l1xif you have time and you think i could improve on the code please let me know
14:18l1xit runs 1000 times faster than the previous python code
14:18l1xso i am happy
14:18justin_smithwow, nice
14:20danielcomptonl1x: idiomatic Clojure would be to import the Java classes so you don't need to reference their fully qualified name
14:20danielcomptonl1x: also, java.lang is automatically imported so java.lang.Long can be shortened to Long
14:20justin_smithand java.lang.* are always already imported, so you can use ^Long instead of ^java.lang.Long
14:21l1xdanielcompton: which line are you referring to with the first sentence?
14:21l1xthanks!
14:21l1xi am modifying those
14:21danielcomptonl1x: https://github.com/l1x/hasta-la-vista/blob/master/src/hasta_la_vista/core.clj#L147-L155
14:21justin_smithl1x: that refers to all x.y.z class references
14:21l1xso i can skip java.lang
14:21danielcomptonl1x: but theres other places there as well
14:21l1xfrom the type hints
14:22danielcomptonl1x: yep
14:22justin_smithl1x: right, and you can use import to avoid x.y other places
14:22l1xlike this? java.lang.System
14:23justin_smith(:import (clojure.lang PersistentHashMap PersistentArrayMap ...)) then later you only need to use PersistentHashMap etc. and you can leave out the clojure.lang
14:23justin_smithl1x: yeah, that can always just be System
14:23justin_smithsince it is in java.lang
14:23l1xalright i am changing those
14:24justin_smithin general nothing in your namespace other than a require / import should have to have a . in the middle
14:25danielcomptonl1x: https://www.refheap.com/94046
14:25danielcomptonl1x: Cursive Clojure has great support for those kinds of imports
14:26l1xjustin_smith: thanks!
14:26l1xdanielcompton: thanks too!
14:26l1xthank you guys I am cleaning it up
14:29Mendaxlol
14:29Mendaxmorgan freenode
14:29MendaxThat is hilarious
14:29justin_smithl1x: another small thing - you may want to consider moving the definition of work-chan into the inner let block in -main, it helps readability (and often correctness as well) to put a binding into the narrowest scope in which it is used (reduces the amount of context needed as a reader, reduces the number of places something weird can happen)
14:30l1xyes sir!
14:31MendaxIs this an off topic room?
14:32dnolen_Mendax: no
14:33Mendaxwhat do you all talk about in this channel yhen?
14:34clrndMendax, we talk about parentheses
14:34Mendaxo I c'
14:37l1xMendax: mostly about parentheses and immutability
14:37l1xwhy
14:39l1xjustin_smith & danielcompton
14:40l1xhttps://github.com/l1x/hasta-la-vista/blob/master/src/hasta_la_vista/core.clj
14:40l1xthanks guys!
14:47justin_smith also - those "better names for the core.async functions" aren't better names for other people reading the code - we use and often see <! >! <!! >!!, and we aren't familiar with your names at all
14:48justin_smithit makes it a bit more complex to actually figure out what that code is doing
14:49l1xwell yes, but i have non clojure co-workers
14:49l1xand their #1 complaint was <!
14:49justin_smithand the choice to use pmap inside the threads is something I don't quite get (not that I know it's wrong, just sets off my spider-sense)
14:49justin_smithl1x: OK
14:49l1xhmm
14:50l1xhow does pmap work?
14:50justin_smithit puts each job on a future, and gives you the results of all the futures
14:50justin_smithso it's another layer of dispatching to threads
14:50l1xhmmm
14:51l1xso i might just use map and see how it impacts the performance
14:51justin_smithwhich may not be helping perf. Compare just using a doseq instead of doall pmap, since this is already being spread across N threads.
14:51justin_smithnot map, doseq
14:51l1xsorry i meant doseq :)
14:51justin_smithmap is for results, and clearly that is for side effects
14:51l1xcool!
14:51l1xyes
14:52justin_smithdefinitely test the difference, but you may lose more from the pmap overhead than you gain from yet another layer of threading.
14:52l1xabsolutely
14:52l1xdo you know how could i bring all the imported Java code to the same log4j format?
14:53justin_smithyou may need a properties file for that? not sure.
14:53l1xhttps://www.refheap.com/94048
14:53l1xthis is how it behaves
14:53l1xit seems to be ignoring the properties file
14:55justin_smithl1x: where does the properties file end up relative to the classpath?
14:58l1xthis is the 1 million dollar question
14:58l1xi tried everything
15:01justin_smithl1x: I think the secret could be that other logging.properties files are in artifacts you are using, there may be some trick to sorting that out and/or you could submit bug reports to the libs that are providing a logging.properties file that shadows yours
15:01l1xhmm
15:01justin_smithl1x: you could try specifying -Djava.util.loggin.config.file=...
15:01l1xi was thinking about an override
15:01justin_smithas an arg to the jvm
15:01justin_smith^^ see above for overriding the file
15:01l1xi see
15:02l1xcool!
15:02l1xthank you
15:02justin_smithyou can add -D args to :jvm_opts in lein, but would need to provide them manually for an uberjar
15:03justin_smithabove, it is logging.config not loggin.config, obviously
15:27l1xi am running the jvm with this but it ignores it, thanks anyways
15:27justin_smithweird - yeah, I am not sure exactly how that stuff works. You may want to check out clj-logging-config
15:28l1xyep
15:28l1xthanks anyways!
16:31sdegutisI'm tempted to make a cascading if-let macro.
16:32sdegutisIt would allow multiple forms, and would just if-let all of them recursively.
16:32sdegutisWhy doesn't if-let already do that?
16:34crash_epThe documentation for pipeline/pipeline-async/pipeline-blocking gives insight into how clojure.core (the team) envisions core.async being used in practice for side-effecting work. That is to say, both input and output channels should generally be parameters to the function.
16:34crash_ep(I'm still trying to build an intuition for design guidelines in core.async)
16:36sdegutisOh right, everyone's taken the day off for Thanksgiving.
16:38cflemingsdegutis: Someone posted to the mailing list with one of those earlier today, I think.
16:39cflemingsdegutis: I'm pretty sure one of Christophe Grand's util libs has one, too.
16:39sdegutiscfleming: well now I feel a little validated :)
16:39andyf sdegutis: cascading if-let comes up once or twice a year on Google group. People disagree on what is "natural behavior" iirc. That and straightforward to write your own
16:40cflemingandyf: Right, some of the semantics are a little non-obvious I think, or at least there are design choices to be made there
16:40sdegutisandyf: I can see the argument that it might not be intuitive to a first-time user of if-let to transform it into a recursively cascading if-let
16:41sdegutisThat said, I see the use for a transformative-cascading version, and it seems like it belongs in clojure.core even if under a new name.
16:41technomancythere's contention whether multiple clauses should be anded or ored together
16:41sdegutisMaybe (if-lets ...)
16:41sdegutistechnomancy: I don't see where and or or come into play here.
16:41andyfsdegutis: Not just that, but disagreements on and/or behavior or something like that
16:41cflemingsdegutis: https://github.com/cgrand/utils#if-let-and-when-let
16:41sdegutis(if-lets [a 1, b 2] ...) -> (if-let [a 1] (if-let [b 2] ...))
16:42andyfsdegutis: What belongs in core is not our call to make
16:42sdegutisandyf: that's preposterous, clojure is open source
16:43sdegutisandyf: if it were C# or Swift, then sure
16:43technomancylol
16:43sdegutisif this isn't a democracy i dont know what is
16:44cflemingClojure is more your benevolent dictatorship
16:45danneuback when i thought clojure was open source, i tried fixing a typo
16:45sdegutisgithub.com/clojure/clojure is, sure
16:45sdegutisthats 1 of 683 forks
16:46cflemingI'd call that more anarchy than democracy :-)
16:46sdegutisfair enough
16:48technomancyI'm pretty sure we have landed gentry
16:50andyfEvery open source project is open to arbitrary changes via forking and every one has decision makers who decided what goes in or not
16:50danneu'open source' generally refers to the interpretation that's just strict enough to disqualify the modified noun from being, indeed, 'open source'.
16:50sdegutisandyf: good point
16:50sdegutisdanneu: wat
16:54sdegutisbtw jfyi my test has been failing all mourning because it was an incorrect test
16:54andyfI don't know danneu's experience, but many who attempt to contribute to Clojure find the process slower than their liking
16:56justin_smithcrash_ep: have you looked at the theory underlying core.async, CSP?
16:57justin_smithhttp://en.wikipedia.org/wiki/Communicating_sequential_processes
17:01dbaschjustin_smith: better yet http://www.usingcsp.com/cspbook.pdf
17:02justin_smithcool - that was hidden at the bottom of the wiki page
17:02justin_smith
17:02justin_smith(dec evil)
17:02lazybot⇒ -1
17:04dbaschI had to read that in school (and pay for the book) in the 90s
17:05justin_smithI've been looking at Kahn Process Networks lately (which are an incompatible async formalism)
17:05justin_smiths/are/is
17:07dbaschinteresting, apparently amazon is looking for clojure people http://lispjobs.wordpress.com/2014/11/25/clojure-software-development-engineers-amazon-com/
17:07crash_epjustin_smith: I'm starting to learn more about it (CSP)
17:08crash_epClojure's implementation of the ideas seems more flexible/powerful than some of its predecessors, so I'm not sure how much of my time I should dedicate to looking at the more historical coverage of CSP vs reading modern actual core.async-using source code/examples.
17:09justin_smithI find that looking at the initial assumed constraints is useful, it lets me look out for "oh, that's why that isn't possible" or "oh, it's a big deal that this is possible, let's look at why it was done that way"
17:10justin_smithalso, core.async was made by people who think it is a good idea to read the old papers before implementing things :)
17:12justin_smithso, whether they are right or wrong on that account, things they make likely reflect that opinion
17:17crash_epdbasch: justin_smith: I'll take a look at Hoare's book, thanks for the link
17:21kenrestivodbasch: i have to wonder how many of these corporations are actually looking for engineers to write clojure, versus looking for engineers who know and like clojure, to be deployed writing/maintaining java or ruby or python?
17:23justin_smithkenrestivo: I would hope that would be too dysfunctional even for the tech world
17:23dbaschin the case of Amazon I would assume there’s a particular project championed by someone who likes Clojure
17:23dbaschAmazon doesn’t have trouble attracting good people in general
17:24winkI love how the ad doesn't even say that the position is in the us. which it probably is
17:25technomancyjustin_smith: I've definitely heard of it happening
17:25technomancysomeone putting "smalltalk" on the list of requirements for a job completely unrelated to smalltalk just to filter out the noise
17:25teslanickThere's a fifth column where I work who want to get Clojure as an accepted tech. I'm the lone frontend guy in the back like, "and clojurescript!"
17:26justin_smithtechnomancy: I hope they got a guy who knows like - smalltalk, fortran, cobol and nothing else and had to pay him to learn javascript
17:27technomancyI hope it didn't take too long for whomever they found to realize they'd been hoodwinked =\
17:27cflemingkenrestivo: From that ad: "Our stateless event-driven compute engine for dynamic data transforms is built entirely in Clojure"
17:27justin_smiththat actually sounds fun to work on!
17:28technomancy"dynamic data transforms" could describe nearly anything
17:28technomancy"we have a dynamic data transform that turns HTTP requests into HTTP responses, wooo"
17:28cflemingThat said, pretty much everything I hear about Amazon makes it sound like a pretty awful place to work.
17:28technomancyI've heard it varies wildly by team
17:29hfaafbi hear the same as technomancy
17:29mavbozodynamic-data transforms or dynamic data-transforms ?
17:29cflemingThat makes sense - Google is similar. That's probably true of most large companies, although the Amazon horror stories at the bottom end are pretty bad.
17:30technomancymavbozo: I just assume it means "throws type exceptions at runtime" =)
17:30sdegutisIs it possible to load a given (io/resource clojure-file) and get back all the top-level forms within it without evaluating them?
17:30dbaschany sufficiently large company will have asshole managers who will make some people’s lives miserable
17:30justin_smithsdegutis: that is what read / read-string are for
17:31sdegutisFor example, if clojure-file contains "[:foo bar] (baz quux)" -- I'd like to get [[:foo 'bar] '(baz quux)] or something equivalent.
17:31hyPiRionsdegutis: (read-string (str "[" (slurp (io/resource clojure-file)) "]")) is the hacky way I do it
17:31technomancy(take-while (partial not= ::eof) (repeatedly #(read rdr false ::eof))) or something like that
17:31sdegutishyPiRion: ahhh
17:31justin_smithor you can make a buffered-reader and collect the results of read until it is empty
17:31sdegutistechnomancy: that's terrifying
17:31danneusdegutis: i found a lazy edn-seq reader on stackoverflow once that i used for that purpose
17:32sdegutistechnomancy: somehow less terrifying than hyPiRion's
17:32sdegutis*more
17:32technomancysdegutis: reciting from my memory of a certain section of leiningen code that has been replaced
17:33danneuhttp://stackoverflow.com/questions/15234880/how-to-use-clojure-edn-read-to-get-a-sequence-of-objects-in-a-file
17:33sdegutisTerrifying. Okay I'll use it.
17:33technomancylive on the edge
17:33technomancyextreme programming
17:34kenrestivoi once wrote something similar to hyPiRion's hack above, for datomic schema updates
17:34mavbozoreactive programming
17:34andyfA loop of reads is terrifying?
17:34kenrestivoin fact, i vaguely remember seeing something like that in the day-of-datomic example code, but my memory is fuzzy
17:34hyPiRionI'm pretty sure I've used that piece of code more than once.
17:35sdegutisReactive programming is for those who live in a reactor.
17:35kenrestivoradioactive programming is for people who are fans of imagine dragons
17:35sdegutisAnyway, now I'm in Java land -- lots of "bla cannot be cast to java.io.some.obnoxious.class.hierarchy.hey.i.wonder.whats.on.reddit"
17:36technomancyCatGifException
17:38hyPiRionWe were afraid of a NotEnoughPoniesException at the end of the conj
17:39sdegutissounds like you all had fun at your social gathering
17:39teslanickpublic static void someNonsenseOnReddit() throws ExceptionalCatGifException ?
17:40justin_smithUnrecoverableClickedOnSpaceDicksKillItWithFierError
17:40teslanick[sic]
17:41sdegutisI am DETERMINED to probably figure this out maybe!
17:41sdegutisOr at least to try to not give up right away.
18:12sdegutisIs (load) just (read) + (eval) ?
18:15Bronsasdegutis: conceptually, yes, the clojure impl of load is a bit more than that though
18:15andyfIt tries to avoid reloading a namespace that is already loaded, but essentially yes
18:16gfredericksdoes it?
18:16gfredericksI thought that was the difference between load and require
18:16andyfBronsa's answers here take precedence over mine :-)
18:16Bronsagfredericks: yeah you're right
18:16gfredericks$karma andyf
18:16lazybotandyf has karma 9.
18:16gfredericks$karma Bronsa
18:16lazybotBronsa has karma 73.
18:17gfrederickshuh yep, Bronsa takes precedence.
18:17andyfKarma shmarma :-). He knows more of this than I do
18:19andyfI was reading RT.load source and got confused by meaning of local ' loaded'
18:19gfredericks(inc shmarma)
18:19lazybot⇒ 1
18:19gfredericks$karma schmarma
18:19lazybotschmarma has karma 0.
18:19gfredericks$karma shmarma
18:19lazybotshmarma has karma 1.
18:20andyfNot to be confused with shawarma
18:21andyfNow someone is writing a bot ' karma cage match' to arbitrate disputes, I bet
18:22gfredericksit's no coincidence that amalloy has the most karma and is also right all the time
18:25andyfWow. Cage match on Wikipedia leads to "professional wrestling match types", of which there are more than I would have imagined. Don't go there
18:25justin_smithwe could totally make a $cagematch command for lazybot (fn cagematch [a b] (if (> (rand-int (karma a) (karma b))) "a wins" "b wins"))
18:26justin_smitherr, wait, I messed that up
18:26justin_smith(if (> (rand-int (karma a)) (rand-int (karma b))) ...)
18:26andyfToo late. It has already been shipped
18:26justin_smithhaha
18:36mgaareif I have a set of records, any way to get this to work: (record-set "somestring") => record where (.toString record) = "somestring"?
18:38justin_smithmgaare: so you want to redefine that record type to have a new to-string method?
18:39mgaarejustin_smith: I want to override the lookup mechanism used in sets to use toString for that record type, rather than hashing and whatever else it does now
18:41justin_smithmgaare: to change how sets use it, you have to change .equals and .hashCode
18:41justin_smiththis may be easier with a deftype than a defrecord? may not be
18:41mgaareright on. thanks!
18:43mgaareI think you can do (defrecord Thingy Object (equals [this that] ...) (hashCode [this] ...))
18:43justin_smithyeah, that will likely work
18:46andyfgfredericks: Thx for comments on Eastwood issue. I should have some time this long weekend to try out some things
18:47hyPiRionOh, it's Thanksgiving for you Americans tomorrow
18:48andyfTis the season to eat well and start Christmas shopping
18:51gfredericksovereating & shopping: it's what George Washington commanded us to do
19:02ffwacom'(+ 1 1)
19:02ffwacom,(+ 1 1)
19:02clojurebot2
19:02ffwacom,((partial - 1) 0)
19:02clojurebot1
19:02ffwacomwait
19:02ffwacomnevermind
19:04andyfAnyone have favorite sorted collection variants besides github.com/amalloy/ordered data.priority-map and flatland.useful.map/ordering-map ?
19:04andyfI'm looking for most useful variants to link from cheatsheet
19:28subtone100clojure jobs dealio front paging on hacker news… http://lispjobs.wordpress.com/2014/11/25/clojure-software-development-engineers-amazon-com/
19:50{blake}Idiomatic way of converting string to Boolean, Number or Date (or leaving as string)? Should I just do a defmulti or does something already exist.
19:51andyfIf only arg is string, defmulti will not help, will it?
19:51gfrederickswell the dispatch can be anything
19:51gfredericksbut sounds clunky regardless
19:52andyfDate formats are legion. Which do you want to support?
19:52andyfWhich kind of numbers: ints only? Negative allowed? Ratios? Floating point?
19:53gfredericks(inc andyf) ;; closing in on Bronsa
19:53lazybot⇒ 10
19:53{blake}andyf: Well, maybe that's the answer. I'm getting this stuff from a web form, and it's all being formatted so maybe I put it in the right format at that end.
19:53dbaschandyf: I haven’t dated in a long time, but I heard friends talk about speed dating
19:53gfredericks(dec dbasch)
19:53lazybot⇒ 20
19:54dbaschgfredericks: oh, date formats as in YYMMDD. Never mind.
19:54andyfI get inc for badgering someone with questions? Hmmm
19:55{blake}Do you? Do you? Do you? Do you? (This isn't working...)
19:55dbasch{blake}: hold it, or you’ll get a dec for bad jokes :P
19:55gfredericksandyf: I was considering saying something about the requirements being ambiguous but you dove right in
19:55{blake}dbasch: That's the price we pay for comedy.
19:55dbasch{blake}: freedom costs a dec o five
19:56gfredericksall the incs are like saving up for making puns
19:56{blake}dbasch: lol... (there are three types of people...)
19:57zRecursive(doc inc)
19:57andyfI heard a fun variant on the Cognicast podcast recently: there are only 2 hard problems in computer science: cache invalidation, naming, and off-by-one bugs
19:57clojurebot"([x]); Returns a number one greater than num. Does not auto-promote longs, will throw on overflow. See also: inc'"
19:57{blake}Well, I was thinking the REPL...it does something like what I'm talking about. The R&P parts.
19:58gfredericks"there's two hard problems in computer science: we only have one joke and it's not funny."
19:59dbaschandyf: that joke is at least a decade old, probably older
20:00{blake}Wait..it's a joke?
20:00andyf{blake}: You could use clojure.edn/read-string and check class of return value, but it may not work for dates, and may allow many more number formats than you wish
20:00technomancyoh dear https://www.atlassian.com/jirajr
20:00andyfdbasch: Even the last phrase?
20:01dbaschandyf: https://www.google.com/search?q=naming+things+and+off+by+one+errors&amp;safe=off&amp;espv=2&amp;biw=1536&amp;bih=1235&amp;source=lnt&amp;tbs=cdr%3A1%2Ccd_min%3A%2Ccd_max%3A12%2F31%2F2002&amp;tbm=#safe=off&amp;tbs=cdr:1%2Ccd_max:12%2F31%2F2002&amp;q=%22naming+things+and+off+by+one+errors%22
20:02gfrederickstechnomancy: Pivotal Tracker Tikes
20:02andyfI'm glad I don't know all of the jokes yet
20:03dbaschtechnomancy: we need clojunior
20:03gfredericksdon't like that it's called "contains?" -- then just call it "stuff".
20:03{blake}andyf: Date-wise...this is coming in off a web-page which I control. Seems like that should help somehow.
20:04dbasch(poop Exception. “I want a pony!”)
20:05dbaschI can’t even get jokes to be syntactically correct
20:06andyfLooks like the merch is really for sale, but I assume jirajr is an atlassian-approved bit of humor?
20:06dbaschandyf: look at the date of the youtube video
20:22kenrestivoi'm partial to "there are only 10 kinds of people: those who understand binary and those who do not"
20:23andyfThere is a clojure.core/partial joke in there somewhere
20:23dbaschkenrestivo: don’t forget the ones who understand ternary, or any other bases
20:24andyfWait, date formats as in YYMMDD. Are you from 1990?
20:25dbaschandyf: I wish, that would make me 24 years old
20:25dbaschbut yes, I grew up in the days of YY
20:26kenrestivoi've seen a y2k bug in the wild only once. it was on a kid's computer math game, made in 1994. when used in 2007 it showed dates as 1907
20:26andyfI was actually semi-worried around New Year's Eve 2000. Not for planes falling out of the sky, but for the economy going wonky
20:26kenrestivothat happened in 2001 :-/
20:26kenrestivowhich was actually the millenium :-P
20:27justin_smithkenrestivo: my tandy 102 works great, modern batteries can make it last over a week on a set of aa cells, it's indestructable, but it thinks this is 1914
20:28justin_smithalso, it has the last significant piece of software written by bill gates on it (a text editor)
20:30{blake}Nothing wrong with YY. We're well into the 2000s now. And nothing of import happened in the 19xxes.
20:31andyfDude, do you even history?
20:31{blake}Stop living in the past.
20:31dbaschthe past is for log files. in #clojure we live in the present
20:31kenrestivono dude
20:31kenrestivowe live IN THE FUTURE
20:32hfaafblogs are stateful
20:32dbasch(dec logs)
20:32lazybot⇒ -1
20:32andyfShudders to think what would happen if nothing older than 10 years ago was known
20:33hfaafbNodeJS is what happened
20:33hfaafb#rekt
20:33dbaschwe wouldn’t know that the Concorde existed, and flew for the last time 11 years ago today
20:33dbaschwe didn’t have Clojure but we had commercial supersonic flights
20:33hfaafbGod bless America
20:35{blake}Er, Concorde was British.
20:35dbaschit was Anglo-French
20:40vermadoes clojuredocs have an API?
20:40vermastuff to query examples etc?
20:40justin_smithgrimoire has that
20:40andyfYes, but I think it accesses data from about SEp 2014
20:40justin_smith$grim clojure.core/+
20:40lazybothttp://grimoire.arrdem.com/1.6.0/clojure.core/+
20:41andyfSearch github for cd-client lib
20:41vermanice
20:41vermathanks guys
20:41andyfThere is an issue for ClojureDocs to update it, but not done yet
20:42vermaso when you say data from sep 2014, what does that mean? like a snapshot was taken?
20:42vermathe docs and examples are continously growing aren't they?
20:42vermaandyf: ^
20:43andyfIt appears to me that a snapshot was taken and that is what API accesses. Updates are occurring to HTML version
20:44vermaoh
20:44andyfProbably snapshot is from when they updated HTML version to clojure 1. 6.0 around sep 2014
20:44vermanice, I can always iframe stuff
20:45vermajust trying to make a nodewebkit app for quick documentation and samples, kind of like dash but very clojure specific and sources data live from the interwebs.
20:45andyfI pull my own snapshot via their API every month or so, and it has stopped updating for a while , even though HTML keeps updating since then
20:45vermaand playing with freactive along the way
20:46vermaandyf: what do you do with the snapshot?
20:46andyfGenerate stats for clojure cheatsheet tooltips
20:47vermawhich clojure cheatsheet?
20:47andyfAlso put up a text file of snap on github in case someone wants offline accessible version for cd-client
20:47vermanice
20:48andyfThe ones here: jafingerhut.github.io
20:48justin_smith~cheatsheet
20:48clojurebotCheatsheets with tooltips can be found at http://jafingerhut.github.com/ .
20:48ennGiven a java.lang.class like clojure.core$map, is there a straightforward way to get the clojure.lang.Var clojure.core/map?
20:48gfredericksjust heuristics I Think
20:48gfredericksso...no.
20:49ennok
20:50justin_smithgfredericks: well, you could filter all-ns / ns-publics
20:50justin_smithbut that's way ugly
20:50vermaandyf: nice!
20:50gfredericksjustin_smith: clever though
20:52gfredericks,(for [ns (all-ns) [_ v] (ns-publics ns) :when (= clojure.core$map @v)] v)
20:52clojurebot()
20:52gfredericks,(for [ns (all-ns) [_ v] (ns-publics ns) :when (= clojure.core$map (class @v))] v)
20:52clojurebot(#'clojure.core/map)
20:53gfredericksenn: ^ marginally better than string wrangling
20:53gfredericks(inc justin_smith)
20:53lazybot⇒ 149
20:53ennoh, nice. That might not be too ugly for this application. Thank you!
20:54justin_smiththe problem is you are walking every var in every namespace
20:54justin_smithterrible algorithm
20:54andyfCaching!
20:55justin_smithhaha
20:55andyf(No invalidation required, thus avoiding hard problem)
20:55justin_smithandyf: if you never redefine vars, sure
20:55andyfHard problem avoided by putting fingers in ears and singing
20:56gfredericksredefining is a problem even if you don't cache
20:56gfredericksdepending on your requirements at least
20:56justin_smithgfredericks: it's no longer the value of any var, so isn't found - what's the problem?
20:56justin_smithyeah, depending on requirements that could still be an issue
20:56gfredericksmaybe you wanted to find it anyways
20:57justin_smiththen you want a reverse registry for all namespaces
20:57gfredericksI have clojure.core$map and I want #'clojure.core/map whether or not anybody's redefined it
20:57gfredericksI was about to claim I couldn't think of a use case for this but maybe handling stack traces?
20:59ennYes, exactly
21:00andyfI recall reading something recently about project that modifies stack traces but forgetting its name
21:00justin_smithyeah, for something like stacktraces you don't need a super efficient algorithm anyway - something broke, do a linear seach and grab pieces of what happened, that's reasonable
21:06andyfAvisoNovate /pretty lib on github is not what I am remembering, but has code relevant to enn's question
21:08ennoh, that looks really nice
21:09vermaemacs users: what's your general flow for adding a new dep to your project?
21:10andyfEdit project.clj in emacs. Save. :-)
21:10kenrestivoum, add it to project.clj and rstart the vm?
21:10justin_smithverma: I have pallet/alembic in my profiles.clj user deps, so I add it to the running repl at the same time I add it to project.clj
21:10justin_smithpallet can add a dep based on a changed project.clj at runtime
21:10vermaoh what!
21:10vermanice
21:10kenrestivowhat is this sorcery?
21:10justin_smithpallet/alembic. It is awesome.
21:11justin_smithalembic/load-project
21:11vermaalso the part of actually looking up the exact package you need, like I need core.async, but there's this whole lein string that you need, do you just copy paste it after googling it?
21:11justin_smithit doesn't drop deps, only adds them though
21:11andyfIt is sorcery, kenrestivo! Save yourself while there is still time!
21:11justin_smithverma: clojars / crossclj.info
21:11andyfSeriously, some sorcery is good
21:12justin_smithalso lein search
21:12kenrestivoi'm already locked in a battle to the death with clojure.tools.namespace/refresh, not sure i want ot add another magickal thing
21:12justin_smithhaha
21:12kenrestivothat does Things to my classpath and jvm
21:12kenrestivobut it sounds very cool
21:13justin_smithcompared to the state-wrangling that refresh does, downloading a jar and adding to classpath is pretty trivial
21:13justin_smithunlike refresh it can't drop things, only add to what you have
21:14vermalein search excepted :(
21:14vermacrossclj.info is pretty nice!
21:14justin_smithyeah, it is pretty amazing, I wish it would get a UX overhaul though
21:15kenrestivoi wish crossclj was integrated into emacs and/or lein
21:15vermahehe agree, I still cannot find that lein package string
21:15kenrestivoactually, something like alembic + crossclj + emacs.... mmmm
21:15vermaI mean click this button to copy it
21:15vermaor something, like lein plz is trying to do this
21:24kenrestivostarting to get to the bottom of this. it seems that if the component dependency order is not exactly the same as the namespace dependency order, Trouble can arise
21:33kenrestivohuh, well that fixed it. super scary that i have no idea *why*, but it did :-/
21:34kenrestivoi removed one dependency in one of the ns's. wasn't even a circular dependency or anything, just a slightly different order than i really needed.
22:28cflemingI hate the ns form in all its, er, forms.
22:28cflemingEspecially use. I have a special hatred in my heart for use.
22:30gfredericks~ns
22:30clojurebotns is unfortunately more complicated than it needs to be, but http://blog.8thlight.com/articles/2010/12/6/clojure-libs-and-namespaces-require-use-import-and-ns may be helpful.
22:31gfredericks~ns
22:31clojurebotns is unfortunately more complicated than it needs to be, but http://blog.8thlight.com/articles/2010/12/6/clojure-libs-and-namespaces-require-use-import-and-ns may be helpful.
22:31gfrederickshmm
22:33cflemingUnfortunately that blog post is silent on such matters as what (:use [my.ns :refer [a b c] :only [d e f] :exclude [a d] :as blarg]) actually means.
22:34cflemingOr actually does, rather.
22:34cflemingAnd such matters as whether (:use (clojure.java io javadoc)) is valid or if I have to split the prefix.
22:34gfrederickswell clearly it
22:37thearthurcfleming: It would be nice if use was more clearly discouraged in the official documentations for ns
22:38cflemingthearthur: No doubt. I'm an unusual case, admittedly, since I have to write code that parses ns and rewrites it, so I have to care about the edge cases that most people don't.
22:38cflemingTurns out there's a lot of them.
22:39gfredericks"arble-garble is a clojure library for parsing and rewriting ns forms."
22:40cflemingThat would be an excellent name for such a library.
22:40cflemingOr gobbledygook, perhaps. Or gibberish.
22:40cflemingI like gibberish, actually.
22:41cflemingAnyway, rant over. Thank you all for listening.
22:45gfredericksname it gobble-gobble in honor of tomorrow
22:50justin_smithgfredericks: global-gobble?
22:56thearthurglobal-globble
22:57kenrestivoi despise :use, and i don't much care for :refer :all either. i like it when people call out specifically what functions come from where
22:58llasramexplicit > implicit
22:58llasramPython got a few things right, at least philosophically
22:58kenrestivoyeah. java's "import foo.bar.*;" makes me see red too. especially in readmes and sample code.
23:02cflemingMy main beef are things like the prefixed use/require form, which make it massively more complex to avoid typing a few chars. The CLJS ns form is much more sane.