#clojure logs

2015-08-28

00:08tolstoyUsing component and reloaded.repl: I have a reference to system of type SystemMap. How do I inspect it to see instances of all the components and dependencies?
00:08tolstoyOh: To disable this behavior and print system maps like normal records, call (remove-method clojure.core/print-method com.stuartsierra.component.SystemMap).
00:08tolstoyAh. I see, it's just a print method. You can still (:comp system) and see things. Good! ;)
00:25tolstoyNormally, you can pass a handler into a web-runner using #'routes or #'handler or something similar.
00:25tolstoyBut what if you want to use a closure for dependencies?
00:26tolstoy(make-routes db ldap) when returns something like (defn make-routes [db ldap] (fn [request] (db this)))?
00:26tolstoyHow do you make that so that when you recompile that bit in a repl, the runner will recognize the change?
00:26tolstoyAlter-var-root, maybe?
00:48tolstoy(alter-var-root #'middleware-chain (constantly (partial #'actual-middleware db ldap etc)) Then use #'middleware-chain as needed.
00:48tolstoyC-c C-c any function in the middleware change actually changes on subsequent requests.
00:52tolstoyOh. Even simpler than that. Just #' each of the middlewares in the "comp" chain. Phew!
00:56tolstoyOh, yes. So nice.
02:14piranhaDoes anybody has an idea about how do I get rid of this message? WARNING: reader-conditional already refers to: #'clojure.core/reader-conditional in namespace: clojure.tools.reader.impl.utils, being replaced by: #'clojure.tools.reader.impl.utils/reader-conditional
02:14piranhaI use clojure 1.7.0 and tools.reader 0.9.2...
02:37piranhaok, so I just need to stop using aot tools.reader and problem goes away
03:53lodin_Is the correct terminology that "a type extends a protocol"? The implementations in defrecord are "extensions"?
03:53lodin_And "a protocol extends *to* a type"?
03:57jeayelodin_: As far as I know, "a type implements a protocol."
04:00lodin_jeaye: I'm pretty sure that it's not implements. :-)
04:01jeayeNot that it's official, but this also uses the "implements" nomenclature: http://matthewboston.com/blog/implementing-clojure-protocols/
04:01lodin_I think implements is used only for interfaces. defprotocol happens to also define an interface, but I consider that an "implementation detail" (since I rarely do Java interop :-)).
04:02lodin_jeaye: I think that implements is explicitly avoided when talking Clojure since it makes you think of Java interfaces.
04:03lodin_And indeed, Clojure data can implement Java interfaces, and a key feature of protocols is that you can extend them after the type has been defined.
04:04jeayeFair
04:04lodin_jeaye: I just looked at the docs for extends?, extenders, etc, and I think I was right above: a type extends a protocol.
04:04andyflodin_: “a single type can implement multiple protocols” appears here: http://clojure.org/protocols
04:05lodin_andyf: Yeah, I saw that too, which is why I first asked here. :-)
04:06lodin_clojure.org/protocols does not really help with the terminology. I think it is because it also talks a lot about how protocols also works well with the host.
04:08andyfThe word “implement” with various suffixes is used a lot on that page :)
04:09lodin_It would probably be good if this was clarified in the docs. The docstrings seem pretty consistent with the use of extends though.
04:10lodin_E.g. extend only mentions implementation w.r.t. the functions/methods.
04:10lodin_As in "Implementations of protocol methods ...".
04:10lodin_I know, it's splitting hairs. :-)
04:11lodin_My question was really about whether a protocol extends a type, or a type extends a protocol. And that is clear now.
04:31hellofunki need a bit of advice on the least resistance approach to setting up a webocket client connection on a Jetty server. one old SO thread recommended Aleph, but that would probably be a replacement for Jetty, right? Any other advice?
05:16expezhellofunk: sente
05:16Bill_Cosbys_LawyHi all
05:16expezhi
05:17hellofunkexpez: sente does not show Jetty as a supported server
05:20expezhellofunk: then I only know about this: https://github.com/lynaghk/jetty7-websockets-async
05:25hellofunkexpez: it says for jetty 7, how do i check which version of jetty i am using?
05:28expezhellofunk: M-x cider-classpath then find the jetty entry
05:29hellofunkexpez: it does not show Jetty anywhere in there
05:29expezIt's just a regular buffer so use C-s to search
05:31expezhellofunk: to be clear, you had a repl going into the right project when you did M-x cider-classpath?
05:32hellofunkexpez: whoops, had the wrong repl open. i'll check now. i just saw that the ring jetty adapter uses jetty 7, so that's probably what i'm using. will confirm in bit.
05:34hellofunkexpez: yup says jetty 7. thanks that's useful. i guess the jetty7-webockets library is worth a try, the quick start looks simply.
05:34hellofunk(inc expez)
05:34lazybot⇒ 2
05:36Igor__What is more faster to use inside function: with-local-vars or atom?
05:37Igor__For mutable vars
05:39expezIgor__: in 1.7 you can use volatile! with vswap! etc instead of atoms. I'm not sure how that compares to with-local-vars speed wise, but it was created to be faster than atoms
05:42Igor__expez: thanks, I will look it
05:49Igor__https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Volatile.java looks good :)
06:19lwmfolks, in a distant past I remember a website that I could pass a function and it would give me examples of how to use it in clojure
06:20lwmit was amazing. It was the best
06:20lwmI've lost it.
06:21lwmSurely someone else saw this website as well ... I think I got the link from hckrnews
06:23schmirconj.io probably
06:23lwmTHANK YOU!!!
08:26kungiI am having problems with clj-refactor in emacs when I have a macro in my namespace. When I try to call the cljr-clean-ns refactoring I get an error saying "Don't know how to create ISeq from Keyword".
08:26kungiAnyone else having this problem?
08:46cap10morganWhen extending a protocol to core.async channels, what is the best type to use? clojure.core.async.impl.channels.ManyToManyChannel? Or are they all kind of equally "might work now but it could break in a future core.async release"?
08:59stuartsierracap10morgan: ManyToManyChannel is currently the only Channel implementation, but there may be additional implementations in the future.
09:00cap10morganstuartsierra: OK, thanks. I wondered if there may be a more general interface to use in extend-protocol or similar. I'll use ManyToManyChannel for now.
09:07lambda-smithHow often do you guys need to drop down to write Java code, if at all?
09:18chouserlambda-smith: Depends on the kind of project. Personally, perhaps once every year or two.
09:18chouserI read Java (Clojure implementation, libraries I'm using) far more often than I write it.
09:18lodin_Is there any (good) way to find all protocols that a type extends? It would be useful for finding supported operations.
09:22chouserlodin_: hm, not easily. A type knows which protocols it extended inline when defined (via Java interfaces), but any extended later are stored in the protocol, not in the type.
09:23chouserI guess you could find all protocols in all namespaces and look for the type in question there.
09:23chouserDoes sound useful...
09:24lambda-smithchouser: I see, that's good to hear
09:26lodin_chouser: Unfortunately, you can't do with-meta on a class. :-/ Otherwise that would be the obvious place to add supported protocols.
09:30chouser(defn all-protocols [] (filter :on-interface (map deref (mapcat (comp vals ns-publics) (all-ns))))
09:31lodin_chouser: Yeah, but that's the solution I was /not/ looking for. ;-)
09:31chouseryeah
09:32lodin_chouser: It works for REPL stuff, though.
09:32RedNifreHas anyone tried to create atom editor plugins with clojurescript?
09:33lodin_chouser: Except :on-interface might break. I assume that there's a reason for protocol? to be private in deftype.clj.
09:35chouseryeah, I wouldn't trust :on-interface across Clojure versions.
09:35lodin_It would be great if protocol? would be made public.
09:43RedNifreSo I was thinking about learning a lisp and heard about clojure and racket. Racket looks interesting because you can change the syntax a lot and clojure sounds interesting because it sounds like a "practical lisp you can use for serious stuff.". I heard clojure still has macros, so how much can you warp the language? What is the most extreme DSL you can build with it?
09:46chouserRacket's macros are more advanced in a way that makes them easier to write, not (I think) more powerful.
09:48chouserIn Clojure, if you want an embedded DSL, you'll be constrained by the basic syntax of s-expressions (Clojure does not have reader macros).
09:49chouserOnce I became comfortable with s-exprs, I found this constraint to be liberating rather than an obstacle.
09:49RedNifreHm, I guess that's fine.
09:49chouserOf course you can have complete syntactic flexibility with an external DSL, writing your own parser. There are a couple of nice parser libs for Clojure if you want to go that way, though I haven't explored them much.
09:50RedNifreAnother thing, while having a quick glance at the documentation I found something about only using read-string for trusted data and look at clojure.core.edn for reading untrusted data. Why is that? My understanding was that it only gets dangerous when you actually try to eval what you read, not when you parse it?
09:50snowellWhen passing a function (e.g., for an event handler) is it more/less memory/space intensive or better/worse programming practice to use anonymous functions vs partial?
09:51snowell#(foo "bar") vs (fn [] (foo "bar)) vs (partial foo "bar")
09:51chouserThe Clojure default reader has a couple hooks that are useful when reading code, which make it unsafe.
09:51chouserRedNifre: The most obvious being the #=(foo) syntax, where foo is actually evaluated at read-time. There are some restrictions on that, but not enough to make it truly safe.
09:52chousersnowell: Not enough of any of those to matter, compared to the programmer's time/energy to understand and interact with the code. Do what makes sense for the humans.
09:54chouser#() actually expands to (fn []) at read time, so they're as close to identical as possible. They both generate a class at compile time, which (partial) does not, but again by runtime that basically never matters.
09:55snowellHmm, true. Thanks!
09:55RedNifreCan you recommend a small open source project that I could look at to get an impression on how normal good clojure looks like in practice?
09:55RedNifreSomething not too magical but not to primitive either.
09:56xemdetiaRedNifre, try https://github.com/stuartsierra/component ?
09:57xemdetiathere is a lot of supporting resources to the 'why'
09:57xemdetiabut its kind of on the small side
09:57chousermaybe https://github.com/ring-clojure/ring
09:58chouserUsed ubiquitously, does something every language needs to do (web app backend stuff), and is primarily good clean code.
10:00RedNifreThanks, looks good.
10:01RedNifreMany people say that having null/nil in a language is a bad idea. What's clojure's reason for having it?
10:03stuartsierraRedNifre: This post offers some reasons http://www.lispcast.com/nil-punning
10:04snowell1Ugh. My internet crapped out and now I can't /nick back to snowell
10:05chouserstuartsierra: that's a lovely answer. Thanks for pointing it out; I don't think I've seen it before.
10:05stuartsierrachouser: You're welcome.
10:08snowellGuess I just had to wait for the old login to die
10:09xemdetiasnowell, you might want to learn about nickserv ghost
10:09xemdetiasnowell, you can force-disconnect an old session that way with /msg nickserv GHOST <nick> [password]
10:09RedNifrestuartsierra thanks for the article. I have a question regarding type-checking and nil: If nil is a value of the nil type, why can functions return it? Isn't it weird if the same function can return values of different types?
10:11RedNifreThe article made weird examples, like saying that it makes sense that the first element of an empty list is nil. I'd prefer an exception in this case because it's an out of bounds exception. I mean, you can put nils in lists, so how would you differentiate a valid nil from an out of bounds exception?
10:12stuartsierraRedNifre: It depends on your point of view. :) Clojure is a dynamically-typed language, so it's not weird at all. Another way to think of it is in terms of Union types, which most mainstream statically-typed languages, e.g. Java, don't support. core.typed has explicit definitions for the return types of most Clojure functions.
10:13stuartsierraIn general, it is a mistake to use 'nil' as a value anywhere it could be confused with a 'nil' returned to indicate absence of a value.
10:14stuartsierraFor example, core.async channels use `nil` to signal that a channel is closed, and disallow putting as a value on a channel.
10:14stuartsierras/putting/putting nil/
10:24lwmguys, can someone explain me how this submitting a code example on clojuredocs.org works?
10:24lwmit seems like I can just bork anything into the editor and add it
10:24RedNifreHow does typed clojure work in practice? Can you start without it and gradually add type annotations whenever you get a type error? How does it compare to the type systems in Java, C# or Haskell?
10:27chouserRedNifre: That's the only way I've used it, though I'm sure some people use it right from the beginning of the project.
10:30RedNifreHas anyone tried clojure in a conservative enterprise environment (java shop)? What to expect?
10:37chouserIn my experience, deploying Clojure into "enterprise" Java shops hasn't been a problem. I've seen more resistance for development activities, and rightfully so. Maintaining code in a language that is not familiar to all devs on a team has costs and risks.
10:44stuartsierraRedNfire: I have acted as a consultant for enterprise Java shops adopting Clojure. In my experience, developers are happy with it. There's definitely a learning curve, but even people with no prior Clojure experience can get started fairly quickly. The strongest resistance tends to come from management. People who don't have the day-to-day experience of working with code are slower to recognize the productivity benefits of switching a
10:46snowellI've hit heavy resistance from project leaders who don't want to adopt it because Java/JS is more mainstream and therefore it's easier to find new people that already know it
10:47snowellEven when I show them that it is objectively faster/smaller/more awesome than the thing they want to use
10:47snowellOK, maybe the 'more awesome' part isn't very objective :D
10:47chouserstuartsierra: you cut off at "benefits of switching a..."
10:48stuartsierrahuh
10:48stuartsierra… The strongest resistance tends to come from management. People who don't have the day-to-day experience of working with code are slower to recognize the productivity benefits of switching away from Java.
10:49chouserIRC prefers sentence
10:49chouserfragments
10:49stuartsierra:)
10:54pepijndevosWith a list it's easy to take the first and the other element, but what is the most elegant way of taking the nth element and the others?
10:55snowellConvert it to a vector :)
10:55troydmhow do I specify newline character?
10:55chouserOr better yet, maintain it as a vector instead of a list. Then use 'nth'
10:55troydm\\n obv is not correct
10:56chousertroydm: \newline for a character, "\n" for a string of length one
10:56pepijndevoswell, I have a vector already, and nth works for the first part, but now I also want a new vector without the nth element.
10:57snowellpepijndevos: (vec (concat (subvec v 0 n) (subvec v (inc n))))
10:57chouserpepijndevos: vectors are bad at that. There are some other data structures that would be a better choice.
10:57pepijndevosa nice. I keep forgetting those vector functions.
10:57snowellBut listen to chouser :)
10:58chousersnowell: or (into (subvec v 0 n) (subvec v (inc n))) ;-)
10:58snowellchouser: More parens means it's more clojure-y
10:58pepijndevoschouser, if their length is 6, the overhead of a nice tree is probably not worth it.
10:58chouserpepijndevos: indeed, likely.
11:01chouserpepijndevos: For reference: https://github.com/clojure/core.rrb-vector
11:02pepijndevosThough I'm always interested to learn about new types of fancy trees
11:04troydmchouser: thx
11:04chouserrrb-vectors have subvec and catvec which together should give you O(log) deletion of an interior entry.
11:04pepijndevosI wasn't aware of the difference between clojure.lang.PersistentVector and clojure.core.Vec
11:04chousermost people don't even know about gvec
11:07pepijndevosSo it's a vector for primitive types? Not much I can find about it.
11:07BronsaI don't think gvec is much maintained these days
11:07chouserpepijndevos: right. Implemented in Clojure (instead of Java like clojure.lang.PersistentVector)
11:11sdegutisHow can you tell what JVM you're using from Clojure/Leiningen?
11:12chouserBronsa: is it broken?
11:12pepijndevosCopyright Michał Marczyk... who else.
11:14chouser,(System/getProperty "java.version")
11:15clojurebot#error {\n :cause "denied"\n :via\n [{:type java.lang.SecurityException\n :message "denied"\n :at [clojurebot.sandbox$enable_security_manager$fn__835 invoke "sandbox.clj" 69]}]\n :trace\n [[clojurebot.sandbox$enable_security_manager$fn__835 invoke "sandbox.clj" 69]\n [clojurebot.sandbox.proxy$java.lang.SecurityManager$Door$f500ea40 checkPropertyAccess nil -1]\n [java.lang.System getProperty ...
11:18troydmanyone using parsatron?
11:18Bronsachouser not broken but it hasn't been as performance tuned as PV has in recent times
11:28troydmalso how do I check if number is not equals to some value? in more shorter form rather than (not (= a 42))
11:30chouser(not= a 42)
11:31luxbockTIL: https://github.com/clojure/clojure/blob/master/src/clj/clojure/gvec.clj
11:31luxbockin case anyone else was looking for a link as well
11:33oddcully,(def ≠ not=)
11:33clojurebot#'sandbox/≠
11:33luxbockI had seen `vector-of` before but I didn't know that it was written in clojure
11:35luxbockif I wanted to read through the Clojure source bit by bit, where should I start?
11:36justin_smithluxbock: RT.java + clojure.core side by side I think
11:36luxbockjustin_smith: thanks, wonder how long getting through it is going to take me
11:37luxbocksomeone should create a curated version of it, though now that I think about Github is kind of like that
11:38sdegutis(inc oddcully)
11:38lazybot⇒ 19
11:38sdegutis,(≠ 1 2)
11:38clojurebottrue
11:38sdegutis<3
11:39luxbockreminds me of a post I saw on HN asking about why literate programming never took of, and someone pointed out that version control is kind of like the evolved version of literate programming
11:39sdegutisheh
11:40sdegutisLiterate programming is only necessary when your code is unreadable. We found a better solution: make your code readable.
11:41luxbockhttps://news.ycombinator.com/item?id=10070444
11:42Bronsamost git commit messages in clojure are not helpful at all
11:42luxbocknever having been a professional developer, that comment made me reconsider my git habits
11:42luxbockoh, that's too bad :/
11:43luxbockI discovered today that Emacs can display git commit messages at point in a tooltip which is very nice
11:43Bronsaluxbock: uh?
11:43luxbockhttps://github.com/syohex/emacs-git-messenger
11:44Bronsaah, that's nice
11:44justin_smithgit log -p some/file-in/repo is still a nice way to see what's been going on
11:44BronsaI use magit-blame
11:44justin_smitheven if the commit messages are shit
11:44luxbockmagit is incredible, I would be completely useless with git on the command line
11:45justin_smithis there a version of blame that shows more than the most recent change? or is it just most recent change on each line?
11:45sdegutisjustin_smith: I always just do `git log -p some_file`
11:45sdegutisjustin_smith: inside the terminal, where I can then use /foo n n n to find "foo" in the history
11:45justin_smithluxbock: trufax - many things in magit are accessed with normal git tools with an added command line parameter, usually that parameter is -p
11:46justin_smithin fact many might just be most there
11:46sdegutisjustin_smith: this lets me see what commit a thing happened in, or in general let me track the history of that file/dir until it was created (or moved to this location)
11:47luxbockI wonder if there's a mode for displaying the comments people make on Github in Emacs as well
11:47luxbockthose are not part of git right?
11:47justin_smithI think those are github only yeah
11:48luxbockit's a bit shame, I wish git acted as a decentralized discussion board for the code base it represents
11:48sdegutisoh wait justin_smith has me on ignore too
11:48sdegutisnever mind, will stop wasting my breath
11:48luxbockmaybe this is something someone is working on
11:48expezThere's also vc-annotate which is pretty sick too. http://devblog.avdi.org/2012/06/22/use-revision-control-annotation-in-your-editor/
11:48justin_smithluxbock: startup idea! git as a social network. This is kind of what github does though.
11:49justin_smithexpez: that gets the blame info, right?
11:49sdegutisSo, if most of #clojure has me on ignore, then I can't really help anyone here since they won't see it. So, bye I guess.
11:49luxbockjustin_smith: it would be great if they built this as an open source extension to git
11:49expezjustin_smith: it allows time travelling through the file
11:50justin_smithcool
11:50luxbockexpez: awesome!
11:50expezyeah pretty helpful when you want to answer questions like 'why does this look like this?'
11:50luxbockthe more I learn the worse I feel about my past git habits :P
12:00xemdetialuxbock, what do people not use the stuff under C-x v l to walk versions of a file?
12:00notid1is this a good channel to ask incanter questions?
12:00xemdetiaI mean I prefer C-x v l to magit because it works the same-ish for svn as well as git
12:01xemdetiamagit for actual commits, C-x v l to walk history
12:02luxbockxemdetia: that was a new command to me as well
12:02luxbockI have only ever used git
12:02notid1specifically, i'm wondering how I can do a $where or (i/$ :filter (fn ...)) based on the previous row.
12:03xemdetialuxbock, if you do use that move the cursor in the file and just hit 'd' to see the diff and 'f' to get a version of the file to look at
12:03xemdetiaif you use 'd' tap 'q' in the opened diff buffer to close it
12:04luxbockxemdetia: thanks
12:06hiredman /win 17
12:20dagda1_ I see how I can create a tree-seq like this (def t (tree-seq next rest xs)) but how can I navigate the tree after it is created
12:20justin_smithdagda1_: tree-seq does not create a tree
12:20justin_smithit creates a seq
12:20justin_smitheach node is a sub-tree or leaf of the input tree
12:21justin_smiths/node/element
12:22dagda1_justin_smith so if i have '(:a (:b nil nil) (:b nil nil))) I can I get to the b nodes, maybe I should use a zipper
12:23justin_smith,(tree-seq next rest '(:a (:b nil nil) (:b nil nil)))
12:23clojurebot((:a (:b nil nil) (:b nil nil)) (:b nil nil) nil nil (:b nil nil) ...)
12:23justin_smithdagda1_: if you wanted all subtrees starting with :b you could filter the output for first item = :b
12:24dagda1_justin_smith :b is just an example, it could be any keyword. finding it difficult to model trees
12:25justin_smithtree-seq isn't for modeling things, it's for disecting them...
12:25justin_smithdagda1_: I find the adjacency list representation is the most flexible (it can even do arbitrary graphs with circularities)
12:26dagda1_justin_smith yes, I just want to grab left, right of :a
12:26dagda1_justin_smith I'll check that out, thanks
12:26justin_smithdagda1_: then filter tree-seq output for first thing starting :a, then get its left, right?
12:27justin_smithwith an adj-list you would search your nodes for soemthing with val=a (they are in a flat series of already) then find paths coming from there as needed
12:28justin_smithone way to do your example as adj-list [{1 :a 2 :b 3 :b} {:a [2 3]}]
12:29justin_smithsorry, that second one would be {1 [2 3]}
12:34pepijndevosIsn't there a nice repl for figwheel that has line editing and tab completion?
12:34pepijndevosI'm already using rlwrap, but it sill kind of sucks.
12:47Bronsahiredman: the bug in hoistedmethods-pass-7.patch was just a missing s/OBJECT_TYPE/retType
12:50hiredmanBronsa: oh, good
12:52hiredmanI feel like I should try and get test.check or test.generative to generate valid fn forms
12:55Bronsahiredman: I wonder if there are performance/inlining implications for all the hops an invoke might go through
12:56Bronsaah nevermind invokeStatic is direct linking stuff not relevant to your patch
12:56hiredmanfor the hoisted stuff? well it is getting hoisted out as fn already, hoisting just switches that to hoist as a static method with type info
12:59hiredmanright now for my hoisted method patch the compiler writer has to opt in to the hoisted stuff, which is only done for loops and trys, I was thinking it would be nice to have invokeexpr hoist automatically when it is an immediately invoked function literal, but the most straightforward way to do that ends up double analyzing forms, which breaks everything
13:01Bronsahiredman: because of double macroexpansion or what?
13:01hiredmanyeah
13:01Bronsahiredman: loop body analysis might cause multiple form analysis
13:01pepijndevosWhy can't I do max on things other than strings?
13:02Bronsa,(max 1 3 2)
13:02clojurebot3
13:02pepijndevosI mean numbers
13:02Bronsahiredman: http://dev.clojure.org/jira/browse/CLJ-1407
13:02hiredmannow, or is it something my patch does :(
13:02pepijndevos,(max "foo" "bar")
13:02clojurebot#error {\n :cause "java.lang.String cannot be cast to java.lang.Number"\n :via\n [{:type java.lang.ClassCastException\n :message "java.lang.String cannot be cast to java.lang.Number"\n :at [clojure.lang.Numbers gt "Numbers.java" 229]}]\n :trace\n [[clojure.lang.Numbers gt "Numbers.java" 229]\n [clojure.lang.Numbers max "Numbers.java" 4027]\n [sandbox$eval49 invokeStatic "NO_SOURCE_FILE" 0]\n...
13:02hiredmangross
13:02pepijndevos,(compare "foo" "bar")
13:02clojurebot4
13:04Bronsahiredman: a solution would be having an AST->clj compiler and building the macroexpanded form & doing subsequent analysis on that rather than on the original one
13:04Bronsareal tricky wrt metadata
13:04Bronsaand line/col info
13:04hiredmanor mutate the expr tree :(
13:04Bronsaew
13:20sdegutisAnyone have experience with ultra?
13:20sdegutishttps://github.com/venantius/ultra
13:20sdegutisI'm wondering if anyone has used it and can recommend it or advise against it. It seems awesome.
13:21winksounded good, yes. haven't tried it
13:22sdegutisWow it seems to work nice so far.
13:24Bronsapuredanger: CLJ-1805 reports the issue with :rettag I was telling you a while ago
13:55ashwink005hey why does println "Something" and println "\"Something" give the same output?
13:55ashwink005noob quest
13:56Bronsathey don't
13:56Bronsa,(println "foo")
13:56Bronsa,(println "\"foo")
13:56clojurebotfoo\n
13:56clojurebot"foo\n
14:01ashwink005Bronsa: huh? then I must be doing something wrong
14:01ashwink005thanks
14:30ashwink005I'm having some problem in emacs while coding in clojure
14:36ashwink005anyone? my nrepl is not updated to my core.clj file
14:38sdegutisWhat was the motivation behind using symbols instead of strings with (deftest)?
14:39Bronsaashwink005: nobody can help you if you don't say what problems you're having
14:40ashwink005Bronsa: my cider's nrepl is not recognizing new functions etc that i add to my core.clj
14:40ashwink005it says can't resolve symbol
14:41ashwink005its stuck to some old version of the same file. I tried saving the file, then restarting everything, still no lucj
14:45justin_smithashwink005: so you go to the buffer with the file, and do the key-combo to make cider load the file, and it fails?
14:46ashwink005justin_smith: I edit the file ( defn a new function), save it, go to the nrepl buffer, and run the function, it says can't resolve symbol
14:46justin_smithashwink005: that's not how it works
14:46ashwink005even changing println statements is not showing effect
14:46justin_smiththere is no auto-reload by default
14:46ashwink005it was happening earlier ...
14:46justin_smithyou have to go to the file with the changes, and make cider load your new definition, or reload the file
14:47ashwink005justin_smith: how do I make cider load the new file defs?
14:48darth10ashwink005: M-x cider-load-buffer
14:48justin_smithusually bound to C-c C-k
14:48justin_smith(by default at least)
14:49justin_smiththere's a decent overview here https://github.com/clojure-emacs/cider#cider-mode
14:50justin_smithI may try it again some day
14:50ashwink005justin_smith: ok will look into it
14:50justin_smithI got fed up by the breaking changes, but it seems that might be happening less now
14:51Bronsayeah seems to be stable enough for me to try again
14:51darth10justin_smith: cider is pretty stable now. there's a pretty decent debugger in it now as well.
14:51Bronsaand the refactor capabilities seem really nice
14:51darth10cider and clj-refactor are both really nice
15:07ashwink005I'm pressing C-c C-k and Nothing is happening
15:09justin_smithashwink005: in which buffer
15:10ashwink005in cider buffer
15:10justin_smithashwink005: you have to do C-c C-k in the buffer you want cider to load
15:10ashwink005I'm also getting a warning that my cider version is not matching my nrepl version (not installed)
15:10ashwink005justin_smith: yeah I tried that as well
15:11justin_smithashwink005: sounds like your cider is not set up properly, maybe the folks in #clojure-emacs can help with that
15:11justin_smithcider is hard to set up in my experience
15:11ashwink005ooh
15:11ashwink005thanks I'll join that channel
16:06spieden-think i just landed my first clojure day job!
16:06sdegutis,(.contains ["foo" "bar"] "foo")
16:06clojurebottrue
16:06sdegutis,(.contains '("foo" "bar") "foo")
16:06clojurebottrue
16:06sdegutisneat
16:28justin_smithspieden-: congrats
16:34spieden-justin_smith: cheers =)
16:43troydmis there a clojars statistic somewhere? like which libraries are most downloaded etc
16:44tcrawleytroydm: you can figure it out from https://clojars.org/stats/all.edn
16:46amalloyhttps://crossclj.info/
16:46amalloyalthough i do find the ordering at https://crossclj.info/all.html?sort=r somewhat hard to believe
16:49troydmtcrawley: there is an .edn data but there is no simple page that would display it in more human readable form? am I correct?
16:49tcrawleycorrect, clojars doesn't currently publish the stats other than via .edn files
16:50tcrawleywell, you can get them via the API as well, but only on a per-artifact basis
16:50tcrawleyand that's not still easily readable
16:50troydmtcrawley: hmm, so I assume in library listing there is no sorting too to sort search results by download numbers
16:51dagda1_how can I change this for to return one hash-map https://gist.github.com/dagda1/2fb86f7a3a10073b205b
16:51justin_smithtroydm: I guess you could do a sort-by on the edn
16:51troydmjustin_smith: I mean on website search results
16:52tcrawleytroydm: ah, the search index is scored by # of downloads, and I believe that is used to sort the results
16:53troydmtcrawley: oic so naturaly I see the output already sorted by downloads yes
16:53amalloydagda1_: for always returns a sequence. you have to call some other function on the result
16:53amalloyalso, rather than two nested for-comprehensions you want a single comprehension with two clauses
16:53tcrawleytroydm: if there is some other way you'd like to see the data, please file an issue at https://github.com/ato/clojars-web/issues
16:54sdegutisJust converted our suite to clojure.test to see if a bug is still present using this framework. So far so good!
16:54troydmtcrawley: just checked it the search results aren't sorted by number of downloads
16:54amalloy,(into {} (for [[x y] '{a {p 1, q 2} b {m 3, n 4}} [a b] y] [[a x] b]))
16:54clojurebot{[p a] 1, [q a] 2, [m b] 3, [n b] 4}
16:54justin_smith(take 10 (sort-by #(apply - (vals (val %))) dls)) where dls is (read-string (slurp clojars-edn-url))
16:54justin_smithgives the 10 most downloaded projects across all versions
16:55justin_smithclojure-complete/clojure-complete ring/ring-core, clj-time/clj-time cheshire/cheshire ...
16:55troydmtcrawley: like for example try searching "json" and compare clj-json with tigris
16:56troydmtcrawley: tigris has less downloads but comes first a
16:56tcrawleyheh, I think there is some non-determinism there - it comes after clj-json for me
16:57troydmtcrawley: so I assume there is no sorting of search results in place
16:57tcrawleywould you mind filing an issue about the result order? I can take a look when I have more time
16:57troydmtcrawley: yeah, sure
16:57tcrawleybonus points if you d/l the clojars src and fix it :)
16:58dagda1_amalloy great, thanks
17:00amalloydagda1_: did you see my response on the 4clojure mailing list? i'm puzzled why you think it's not symmetrical
17:01dagda1_amalloy let me check
17:01sdegutisIs it possible to hide the "Testing some.name.space \n\n" lines that show up when doing `lein test` ?
17:02sdegutisI read the docstring for clojure.test and do not see anything, but I'm hoping there is something that someone knows about.
17:03amalloysdegutis: i don't think so. the best you can do is `lein test | grep -v lein test`
17:03sdegutisThanks amalloy. I'll look into the source code as a last resort.
17:03amalloyi already did
17:03sdegutis<3
17:03amalloy(feel free though, of course)
17:04dagda1_amalloy ok, it is the positioning of the left and right nodes of node with the value of 4
17:04dagda1_[2 nil [3 [4 [5 nil nil] [6 nil nil]]
17:04dagda1_ [2 [3 nil [4 [6 nil nil] [5 nil nil]]]
17:04sdegutisamalloy: actually wouldn't I just need to do (report :begin-test-ns [m] ... my own code goes here ...) ?
17:04amalloysdegutis: maybe. i don't actually know how the clojure.test mechanism works very well; i was looking in lein's source
17:05sdegutisAhh.
17:05sdegutisI'm looking at https://github.com/clojure/clojure/blob/master/src/clj/clojure/test.clj
17:05dagda1_amalloy rignt, I just clicked
17:06sdegutisSeems to work!
17:06sdegutisWonder why the \n is at the beginning of everything :/
17:14sdegutis,(name #'map)
17:15clojurebot#error {\n :cause "clojure.lang.Var cannot be cast to clojure.lang.Named"\n :via\n [{:type java.lang.ClassCastException\n :message "clojure.lang.Var cannot be cast to clojure.lang.Named"\n :at [clojure.core$name invokeStatic "core.clj" 1527]}]\n :trace\n [[clojure.core$name invokeStatic "core.clj" 1527]\n [clojure.core$name invoke "core.clj" -1]\n [sandbox$eval25 invokeStatic "NO_SOURCE_FILE...
17:15sdegutisawww, so it needs to be from meta?
17:15sdegutis,(-> #'map meta :name)
17:15clojurebotmap
17:46justin_smith,(map map (meta #'map))
17:46clojurebot(#object[clojure.core$map$fn__4537 0x740fad61 "clojure.core$map$fn__4537@740fad61"] #object[clojure.core$map$fn__4537 0x313ff6ce "clojure.core$map$fn__4537@313ff6ce"] #object[clojure.core$map$fn__4537 0x5e6467a4 "clojure.core$map$fn__4537@5e6467a4"] #object[clojure.core$map$fn__4537 0x11d07066 "clojure.core$map$fn__4537@11d07066"] #object[clojure.core$map$fn__4537 0xb8341ad "clojure.core$map$fn__4...
18:53sdegutis,(instance? clojure.lang.IFn {})
18:53clojurebottrue
18:58amalloy$mail sdegutis see also clojure.core/ifn?
18:58lazybotMessage saved.
19:51sdegutis,(meta #'print-method)
19:51clojurebot{:line 3540, :column 1, :file "clojure/core.clj", :name print-method, :ns #object[clojure.lang.Namespace 0x3f1cb25f "clojure.core"]}
19:52sdegutisWhere's the implementations actually stored??
19:52lazybotsdegutis: What are you, crazy? Of course not!
19:52sdegutis,(var-get #'print-method)
19:52clojurebot#object[clojure.lang.MultiFn 0x3d90e205 "clojure.lang.MultiFn@3d90e205"]
19:52amalloyinside an atom in the MultiFn
19:52sdegutisAh clever.
19:52sdegutisThanks amalloy, +1
19:53sdegutisFwiw clojure.test is *super* nice to customize.
19:53sdegutiswish stuartsierra still ung around so I could congratulate him on a job well done
21:53TEttinger,(+ 12 34)
21:54clojurebot10
22:00andyf__TEttinger: What fresh witchcraft is that?
22:01TEttingerapparently some clients render it "correctly" but others don't
22:01TEttinger,",(+ \u001e1\u001e2 \u001e3\u001e4)"
22:01clojurebot",(+ 12 34)"
22:01TEttinger,"\u001e"
22:01clojurebot""
22:01TEttingercounts as whitespace
22:03andyf__Ah, got it. More normally one would write that (+ 1 2 3 4)
22:06Bronsaandyf__: more normally one would write 10
22:06gfredericks,0xa
22:06clojurebot10
22:07gfredericks,8r12
22:07clojurebot10
22:07andyf__gfredericks: Which numeric constant was your recent library created for?
22:07gfredericks71
22:07gfredericksI might have generated that randomly using clojurebot, can't recall
22:08Bronsawow, it even has cljs support
22:08gfredericksoh yep, found it in the log
22:08Bronsaand generative testing
22:09BronsaI might suggest it to newcomers asking for well maintained libs to learn clojure from
22:09andyf__generative testing …. for 71. I almost feel like I need to look at that to see what it does.
22:11gfrederickshttp://logs.lazybot.org/irc.freenode.net/%23clojure/2015-05-28.txt
22:11gfrederickssearch ^ there for "my new library"
22:11gfredericksandyf__ was even right there
22:14andyf__Not afraid someone will 1-up you? 71++
22:14gfrederickssomebody oughta update test.check so the test namespace doesn't have so much duplication
22:15Bronsagfredericks: IIRC cljs aliases clojure.* to cljs.*
22:15Bronsathe duplication in the require shouldn't be necessary
22:15Bronsaexcept maybe when :include-macros/:refer-macros are used
22:16Bronsaif clojure's ns made :refer-macros an alias for :refer and ignored :include-macros, that would be lovely
22:16Bronsapuredanger: any chance that might get considered? ^
22:18Bronsaoh well, looks like :ignore-macros is already ignored
22:19gfredericksBronsa: woah what
22:19gfredericksBronsa: like it checks for clojure.* first and then checks cljs.*?
22:19gfredericksBronsa: I talked to david about this and I swear he recommended renaming the namespaces
22:20gfredericksI guess I can just try it
22:20Bronsagfredericks: oh no wait
22:20Bronsait's just for clojure.core->cljs.core
22:20gfredericksphew
22:20gfredericksBronsa: is that how `(+ 1 2) works correctly?
22:20Bronsayes
22:20Bronsahttps://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/analyzer.cljc#L661-L663
22:20gfrederickseverything makes a lot more sense now
22:21Bronsawell
22:21gfredericksBronsa: would you say the cljs.* naming is regrettable?
22:21Bronsatools.reader now has support for making ` work correctly regardless of that
22:21gfredericksand is there any benefit to the name difference?
22:21Bronsagfredericks: the less reader-conditionals required, the better IMHO
22:21Bronsaand I don't see any benefit, no
22:22gfredericksI've never heard anybody defend it
22:22Bronsaotoh I just realized I'm doing that for tools.reader too.
22:23gfrederickswhen david ported test.check that's what he did, and I ended up switching it
22:23gfredericksstuartsierra had a clojure-dev thread about this that I don't think anybody but me replied to
22:24BronsaI honestly think that aliasing clojure.* to cljs.* in cljs would be valuable
22:25gfredericks:'(