#clojure logs

2016-01-19

00:00mheldhey y'all
00:01mheldI have a ring handler that spits out other ring handlers (liberator resources), thus requiring to be called twice on a request to get a response — is there a better way of doing this?
00:02mheldso I end up having to do something nasty like this -> (fn [x] ((user-handler x) x)) and it barfs if I try to go up the stack
01:45amalloywell, if it returns a ring handler it's not a ring handler itself, since those return responses
01:47amalloyan easy solution would be to define a trampolining middleware, (defn tramp [handler] (fn [req] (let [x (handler req)] (if (fn? x) (x req) x)))), and then insert that at the appropriate place in your middleware stack
01:49amalloymheld: ^
02:08kenrestivoliberator is weird that way, IIRC
02:08kenrestivosome keys in their map want handlers, some want results, and i think some want functions that return handlers (wrappers), it's been a few years
04:16jonathanji think returning a static result is just convenience for (fn [ctx] (merge ctx {:my 'values}))
04:17jonathanjpretty sure everything can just be a function
04:17jonathanjhowever what the function does depends on which key it is, there are decisions, actions and handlers; it's all pretty well documented
04:18jonathanjit doesn't really make any sense for a decision function to return a ring response because the nature of the function asking a question like "is this resource available?"
04:19jonathanjmy biggest wish for liberator (and ring) is handling async correctly
04:21jonathanj(or at all)
04:32RedNifreHey there. I had a brief look at Clojure and wrote a tiny program in it. It seems nice but I'm not sure if I should dive in. Do you have a link to some examples of complex/brilliant/interesting/impressive/unusual things that you can do with Clojure? I might be looking for a unique selling point so to speak.
04:35TEttingerRedNifre: ohoho!
04:35TEttingergot any unusual problems you want tackled?
04:39TEttingerRedNifre: you around? I'm curious what the audience for this is
04:40TEttingerthe seq abstraction is really good at making code cleaner
04:41TEttinger,(map count [{:a 1, :b 2} [1 2 3] #{:red :green :blue :beige}])
04:41clojurebot(2 3 4)
04:41jonathanji'm trying to remember the last time i found something brilliant or impressive in a language
04:42jonathanji think it must have been Erlang
04:42TEttingergave it three different kinds of collection and it could count all of them just fine
04:42TEttingerclojure tends to be very very short code
04:46TEttingerso as part of a "how short can you go" contest,
04:46TEttinger(let[a #(apply str(flatten %))p partition R rand-nth n #(a(R(mapcat p[1 2 3]%&)))v #(n"aioeu""iaaiaa")](a[(n"STKNYPKLGVZ""GlThShNyFtCh""ZvrCthShrMycTch")(for[_" "][(v)(n"lpstnkgxzv"(concat[(R '[h gl gr nd])(v)]"rnthggghtsltrkkhshng")"ghnlok")])]))
04:46TEttinger,(let[a #(apply str(flatten %))p partition R rand-nth n #(a(R(mapcat p[1 2 3]%&)))v #(n"aioeu""iaaiaa")](a[(n"STKNYPKLGVZ""GlThShNyFtCh""ZvrCthShrMycTch")(for[_" "][(v)(n"lpstnkgxzv"(concat[(R '[h gl gr nd])1(v)]"rnthggghtsltrkkhshng")"ghnlok")])]))
04:46clojurebot"Kakol"
04:46TEttinger250 character or less demonic name generator
04:50schmirTEttinger: that actually makes me want to run away from clojure
04:50TEttingerhaha
04:50TEttingerit's heavily heavily obfuscated
04:51RedNifreYes, I'm here, somewhat. Sorry.
04:51TEttingercleaned up and long version: http://ideone.com/L0eHc6
04:51TEttingerthe impressive thing is some of the shorter versions have about the same features
04:53alex``yeah that's pretty impressive, and the management of different sorts of types within the same function is nice too
04:53TEttingerit was a team effort
04:53schmirRedNifre: REPL based development is a unique selling point for me
04:53TEttingeryep
04:53RedNifreNo, I don't have a particular problem in mind. But jonathanj mentioned Erlang, I find it impressive that it is geared towards reliability and it's interesting how actors are somewhat like OOP on top of FP. Or in Haskell I was impressed by how those hyper abstract concepts make your brain explode. Or in Kotlin I found the syntax rule "if the last parameter is a lambda you may close the paren before it" very neat because foo(x) {bla() } loo
04:53RedNifreks nicer than foo(x, { bla() }) etc.
04:54RedNifreDon't all languages except Java have a REPL?
04:54TEttingerprobably. clojure has a good one
04:54TEttingerothers probably have good ones too
04:54MasseRRedNifre: no, not really no :)
04:55alex``lispies have good REPLs
04:55MasseRC, C++, Java, HaXe, etc
04:55schmirRedNifre: I've been doing python before, which has a REPL. but clojure's REPL is *much* better
04:55TEttingerclojure can call java about as easily as java can call java. with macros involved, it can be easier to call java from clojure than calling java from java
04:55schauehoschmir, to be fair, ipython isn't exactly bad
04:55schauehoIMHO, of course
04:55mpenetit's more the advanced integration of the repl in every editor/IDE more than the repl itself
04:55alex``interop is a really nice feature for commercial purpose
04:56TEttingersane names.
04:56TEttingerone of my favorites.
04:56schauehoand btw, there are REPLs for Java
04:56TEttinger"I want something like reduce but it doesn't throw away the intermediate values"
04:56TEttinger"reductions"
04:57TEttinger"it maps and then concats" "mapcat"
04:57schmirschaueho: ipython is fine. but I've used that mostly to explore 3rd party libraries. when you're trying to reload your own code, I've hit a wall pretty early in python.
04:57MJB47on the flip side: contains
04:57TEttinger"it finds the frequencies things appear in a collection" "frequences"
04:57TEttingerfrequencies
04:57RedNifreWell, in Haskell you can create an infinite list of fibonacci numbers by zipping it with itself, which I find pretty wild: fibs = 1 : 1 : zipWith (+) fibs (tail fibs). Is there something like that in Clojure i.e. something that made you think "Huh, I didn't expect that could be done like that"?
04:58TEttinger,(doc contains)
04:58clojurebotexcusez-moi
04:58TEttinger,(doc contains?)
04:58clojurebot"([coll key]); Returns true if key is present in the given collection, otherwise returns false. Note that for numerically indexed collections like vectors and Java arrays, this tests if the numeric key is within the range of indexes. 'contains?' operates constant or logarithmic time; it will not perform a linear search for a value. See also 'some'."
04:58schauehoschmir, agreed, although reloading can be a pain in Clojure, too
04:58TEttingerRedNifre: you can do the same in clojure
04:59alex``RedNifre: i found a lot of stuff that surprising in clojure, even coming form lisps
04:59RedNifreIs it called mapcat everywhere or just for lists? E.g. I find it annoying that in Java, mapcat is called flatMap for Optionals and Streams, but it's called thenCompose on CompletableFuture.
04:59alex``lazy evaluation is really good, maybe haskell partialitation is easier, tho
05:02RedNifrealex`` do you have an example for something surprising?
05:03Kneiva,(def cats (cons 'cat (lazy-seq cats)))
05:03clojurebot#'sandbox/cats
05:03Kneiva,(take 20 cats)
05:03clojurebot(cat cat cat cat cat ...)
05:04jonathanjRedNifre: i don't think i could tell you anything about Clojure that doesn't apply to other lisps, but i really enjoy the (almost entirely) consistent syntax
05:04jonathanjbeing able to write (if) inside a function call is something i find quite convenient and totally foreign compared to languages where if is a statement
05:07TEttinger,(defn fibs ([] (fibs [1 1]) ([so-far] (conj so-far (apply + (take-last 2 so-far))))
05:07clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
05:07ridcullywell that fn(x) {...} bit on kotlin makes me even more believe, that it's just groovy in disguise
05:07TEttinger,(defn fibs ([] (fibs [1 1])) ([so-far] (conj so-far (apply + (take-last 2 so-far)))))
05:07clojurebot#'sandbox/fibs
05:07TEttinger,(iterate fibs)
05:07clojurebot#error {\n :cause "Wrong number of args (1) passed to: core/iterate"\n :via\n [{:type clojure.lang.ArityException\n :message "Wrong number of args (1) passed to: core/iterate"\n :at [clojure.lang.AFn throwArity "AFn.java" 429]}]\n :trace\n [[clojure.lang.AFn throwArity "AFn.java" 429]\n [clojure.lang.AFn invoke "AFn.java" 32]\n [sandbox$eval164 invokeStatic "NO_SOURCE_FILE" 0]\n [sandbox$ev...
05:07TEttinger,(iterate fibs [1 1])
05:07clojurebot([1 1] [1 1 2] [1 1 2 3] [1 1 2 3 5] [1 1 2 3 5 ...] ...)
05:08TEttinger,(nth (iterate fibs [1 1]) 20)
05:08jonathanjexcept isn't recursion without (recur) usually a mistake?
05:08clojurebot#error {\n :cause "Unable to resolve symbol: fibs in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: fibs in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6688]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: fibs in this co...
05:08TEttingeryes
05:08TEttingerit isn't iterating here
05:08scottj,(do (def fibs' (lazy-cat [0 1] (map + fibs' (rest fibs')))) (take 10 fibs'))
05:08clojurebot(0 1 1 2 3 ...)
05:08TEttingerah, lazy-cat
05:08TEttingerthat's what I was looking for
05:08mpeneterror messages could be nicer. It doesnt matter much once you get used to it, but a 300 line stacktrace isn't very welcoming to somebody trying it out
05:08jonathanjRedNifre: i think Clojure's pragmatism is kind of a hard sell to make but it's incredibly valuable
05:09TEttingerindeed
05:09ridcullympenet: +1
05:09TEttingerthere's lots of "make your life easier" tools
05:10mpenetpersonnally I dont mind the stacktraces, but for somebody with 1h clojure experience I doubt installing libs for better output is something reasonable
05:11mpenetbut I think I've hear it's something we might get sometime soon (whatever "soon" means heh)
05:11jonathanjmpenet: really? where did you hear that?
05:12jonathanji've managed to become conversationally fluent in reading clojure stack traces but boy i would love for them to be better
05:12mpenetI think on twitter or slack
05:13mpenetwell, sometimes scrolling through 1km of noise from the compiler to get to 1 line is a tiny bit annoying
05:13mpenetI guess having different output levels could make sense
05:14mpenetif you work on core you might want the over chatty stacktraces
05:14jonathanji don't really know if this is doable but reading stacktraces caused by async code is basically meaningless garbage
05:14jonathanjin other words, you get a stacktrace that occurs in exactly zero of your own code
05:15jonathanjit would be really nice to be able to tell where the call originated from, but that's possibly more of a JVM requirement than a Clojure compiler one
05:21alex``i prefer common lisp error reports more than java ones
05:22alex``unfortunately, clojure took the java ones
05:24jonathanjwas that even a choice?
05:24alex``i guess not, the JVM has counterparts
05:29jonathanj,(if-let [[x y] [0 nil]] :a :b)
05:29clojurebot:a
05:29jonathanj,(if-let [[x y] nil] :a :b)
05:30clojurebot:b
05:30lnostdalwith some overhead ("debug mode") i'm sure closures and stuff could have metadata needed for filename, line + col number etc. added to them
05:30lnostdaljvm or not doesn't matter i think
05:31jonathanjto be honest i'd be a bit hesitant about slapping "debug mode" on that kind of information
05:31lnostdalwhy?
05:31clojurebotwhy is the ram gone
05:31jonathanjhaving that information in a production environment would be just (if not more) useful
05:32lnostdalsure in some cases i guess, but that wasn't the point
08:07visofhi guys
08:07visofis there anybody using archimedis?
09:56visofis there a method which partition [1 2 3 4] to [[1 2] [2 3] [3 4]] ?
09:56aurelianpartition
09:56visof,(partition [1 2 3 4])
09:56clojurebot#error {\n :cause "Wrong number of args (1) passed to: core/partition"\n :via\n [{:type clojure.lang.ArityException\n :message "Wrong number of args (1) passed to: core/partition"\n :at [clojure.lang.AFn throwArity "AFn.java" 429]}]\n :trace\n [[clojure.lang.AFn throwArity "AFn.java" 429]\n [clojure.lang.AFn invoke "AFn.java" 32]\n [sandbox$eval25 invokeStatic "NO_SOURCE_FILE" 0]\n [sandbox...
09:57visof,(partition 2 [1 2 3 4])
09:57clojurebot((1 2) (3 4))
09:57aurelianpartition with a twist :)
09:57ridcully,(partition 2 1 [1 2 3 4])
09:57clojurebot((1 2) (2 3) (3 4))
09:58visofah thanks
09:59aurelian,(doc partition)
09:59clojurebot"([n coll] [n step coll] [n step pad coll]); Returns a lazy sequence of lists of n items each, at offsets step apart. If step is not supplied, defaults to n, i.e. the partitions do not overlap. If a pad collection is supplied, use its elements as necessary to complete last partition upto n items. In case there are not enough padding elements, return a partition with less than n items."
10:30dadinnhi all
10:30dadinnI am trying to use clojure.data.zip.xml
10:31dadinnxml-> specifically
10:31dadinnand it doesn't seem to work at all
10:31dadinnI parsed html with crouton
10:32dadinnturned it into zipper with clojure.zip/xml-zip
10:32dadinnbut xml-> returns nothing but empty lists
10:33dadinnis this a known issue I missed?
11:02csd_I have a defrecord that is implementing an interface that only throws FooException. If I instantiate that record with a function that instead calls BarException, what happens?
11:10juanjo_hi
11:10juanjo_how can I add to leingen dependencies a path lo a local repo of a lib i'm trying to debug=
11:10juanjo_?
11:14mpenetjuanjo_: https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md#checkout-dependencies
11:20juanjo_thanks mpenet
11:58dadinnhi all
11:58dadinncould anyone help with a bit of html parsing with zippers?
12:00dadinnI specifically have issues with clojure.data.zip.xml/xml->
12:01dadinnI have the following code:
12:01dadinn(ns stuff
12:01dadinn (:require [org.httpkit.client :as http]
12:01dadinn [clojure.data.xml :as xml]
12:01dadinn [crouton.html :as html]
12:01dadinn [clojure.zip :as z]
12:01dadinn [clojure.data.zip.xml :as zx]))
12:02dadinn(def res2 (http/get "http://help.websiteos.com/websiteos/example_of_a_simple_html_page.htm&quot;))
12:02dadinn(def body2 (:body @res2))
12:02dadinn(det xdat2 (html/parse-string body2))
12:02dadinn(def zdat2 (z/xml-zip xdat2))
12:02ridcullywhoa
12:02ridcullycould you please use some paste site?
12:02dadinnsorry
12:03dadinnone last line:
12:03dadinn(zx/xml1-> zdat2 :html :title zx/text)
12:03dadinnthis one is not returning what I would expect instead an () empty list
12:04dadinnwhat I am doing wrong (besides pasting multiple line to the channel :))?
12:12dadinnhi
12:13dadinntrying again, would need some help with clojure.data.zip.xml: http://pastebin.com/D3UzTA2Y
12:13dadinncan anyone help why its not returning the title of the html?
12:14dadinnthanks
12:15dadinnplz
12:17luxbockdadinn: maybe you are thinking that xml1-> works like ->, when based on the doc string it seems more analogous to cond-> ?
12:18luxbockI haven't used clojure.data.zip.xml before so it's hard to say for me
12:18dadinncan I ask for some help with xml zippers?
12:19luxbockdadinn: do you know how zippers work in general?
12:20dadinnluxbock: yes I used zip-filter a year ago and it was working then only now it seems I am trying to do the same what then but it doesn't work
12:21dadinnluxbock: this is the example code: http://pastebin.com/D3UzTA2Y
12:23dadinnI would like to get the text of the title, I remember using xml-> or xml1-> before but it returns an empty list not what I would expect
12:25dadinnI've been trying to figure what I am doing wrong for days but couldn't get it to work :(
12:26luxbockyeah I'm not sure, I've used zippers before but not with xml
12:26dadinnany ideas?
12:30luxbockdadinn: I'd just try to break down what you're doing into smaller and smaller parts while testing at the REPL where things go awry
12:31dadinnI'we used xml-> when it was part of contrib zip-filter and I've been using it to extract gigabytes of xml elements and in ETL kind of processing with xml-> parallelly and I am completely surprised why this is not working, what I am doing wrong
12:32luxbockdadinn: if you're using Emacs, the debugger that comes with Cider is pretty awesome
12:33dadinnluxbock: it doesn't really go awry only that xml-> returns empty list, and xml1-> nil
12:34luxbockby awry I meant find the point where your expectation deviates from what actually happens
12:34dadinnluxbock: the httpkit, crouton parser part works fine until xml->
12:37dadinnluxbock: possibly I am using the xml-> wrong, but I don't know how else it should be used, it's according to the docs keywords should be transformed into tag= matchers, so it should be working...
12:37luxbockdadinn: so you need to zoom in, use the source
12:46dadinnlukbock: I understand, but if the source of clojure.data.zip needs to be modified for it to work then I would call it a bug... and it was working before... I came here hoping that the answer would be that I am doing something wrong instead :(
12:48KamuelaWhat is the rails of Clojure? Not necessarily the same design pattern, but certainly the relative popularity?
12:48ecelisKamuela: for web development I have used luminus
12:49mavbozoluminus
12:50MJB47clojure typically likes to go with picking a choosing various libraries
12:50MJB47compared to using a framework
12:50MJB47luminous is the closest you have, but it is actually a collection of libraries and some documentation around them
12:50MJB47it isnt a framework
12:50ridcullydadinn: leave out the :html
12:51ridcullydadinn: or rather use :head instead of :html
12:52mavbozoMJB47, it's not a framework but a tasty omakase that yogthos creates
12:52mavbozo(inc yogthos) ;; i hope it works
12:52mavbozo,(inc yogthos) ;; i hope it works this time
12:53clojurebot#error {\n :cause "Unable to resolve symbol: yogthos in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: yogthos in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6688]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: yogthos i...
12:53dadinn:ridcully thanks that was the problem indeed
12:53justin_smithmavbozo: inc is done by lazybot, who is on long term vacation
13:02KamuelaThank you
13:08sdegutisHi.
13:08sdegutisGood day.
13:08sdegutisI mean good day to all of you here.
13:16mavbozosdegutis, good day to you too
13:17sdegutisThanks :)
15:49engblomThread/sleep seem to not be able to wake the thread up fast enough if one got really small values like (Thread/sleep 0.1). Is there any busy waiting alternative that would be faster?
15:50amalloy0.1 is a pretty strange integer
15:50justin_smithengblom: with a value that low, aren't you dealing with the time slice of the OS itself?
15:50justin_smiththat too
15:51amalloyanyway you can't ever expect timing stuff like that to be precise. at any moment your thread might be descheduled for whatever reason, maybe the user is rendering six video files at once and the OS decides your program is boring
15:52amalloyso instead, ask *why* you want a sleep precision of a tenth of a millisecond, and then maybe find a solution that is possible to the real problem
15:52justin_smiththere is (Thread/sleep 0 500000) which I think would do what that intends?
15:53engblomjustin_smith: Where do you find documentation about Thread/sleep?
15:53amalloyit might, anyway. microsleep support depends on platform
15:53amalloy$google javadoc thread
15:53amalloyer
15:53justin_smithengblom: javadoc https://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html
15:53amalloysomeone restart that bot pls
15:54justin_smithengblom: one arg is long millis, two args is long millis followed by int nanos
15:54engblomThanks!
15:54justin_smithbut you still have to wrestle the OS for time slices that small if they need to be accurate
15:56justin_smithengblom: for linux kernel the smallest unit reliable would be 100ms if I read this right
15:56justin_smithhttp://stackoverflow.com/questions/16401294/how-to-know-linux-scheduler-time-slice
15:58justin_smith"Timeslice will be always between sysctl_sched_min_granularity and sysctl_sched_latency, which are defaults to 0.75 ms and 6 ms respectively and defined in kernel/sched/fair.c."
15:59hiredmana technique used sometimes to stall a thread for a small amount of time on the jvm is to busy loop for a small amount of time
16:00hiredmanthat also isn't predictable because of the jit, and also because to cpus, that kind of code can end up looking like an idle run loop for the os so the cpu may go in to a lower power state
16:01hiredman(amazing hear say)
16:07nuttynutnutwhat's a good way of removing all parts of a string that don't match a regex? i was trying something like this but keep getting "error: null" (filter #(re-matches #"\w" %) "Have a nice day.")
16:07nuttynutnut,(filter #(re-matches #"\w" %) "Have a nice day.")
16:07clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Character cannot be cast to java.lang.CharSequence>
16:08nuttynutnutoo lambabot gives a better error message than light table
16:08nuttynutnutstill not sure what the problem is though
16:08amalloywhat is a "part of a string"? "Have a" doesn't match the regex \w either
16:08nuttynutnutor if this is even the best way of doing this
16:09hiredman,(seq "Have a nice day.")
16:09clojurebot(\H \a \v \e \space ...)
16:09nuttynutnutisn't \w [a-zA-Z0-9_]?
16:09nuttynutnuti just want all the letters, numbers, and spaces
16:09amalloyyes, and "Have a" is six characters
16:09nuttynutnuti dont get it
16:10amalloyso you want (re-seq #"\w" "Have a nice day")
16:10nuttynutnutoh
16:10nuttynutnut,(re-seq #"\w" "Have a nice day")
16:10clojurebot("H" "a" "v" "e" "a" ...)
16:10nuttynutnuto
16:10nuttynutnuti still need the spaces
16:10nuttynutnutwhere did the space go
16:12matthavener\w doesn't match spaces
16:12matthavener,(re-seq #"." "Have a nice day")
16:12clojurebot("H" "a" "v" "e" " " ...)
16:12pbx,(re-seq #"[\w ]" "have a nice")
16:12clojurebot("h" "a" "v" "e" " " ...)
16:13hiredman,*clojure-version*
16:14clojurebot{:major 1, :minor 8, :incremental 0, :qualifier nil}
16:14amalloydid 1.8 just come out?
16:15nuttynutnut\w doesnt match spaces?
16:15hiredmanamalloy: yep
16:15nuttynutnut"\w stands for "word character". It always matches the ASCII characters [A-Za-z0-9_]"
16:15lokien_amalloy: clojure 1.8?
16:15nuttynutnutam i missing something or is java's regex different
16:15amalloynuttynutnut: are you aware of what character _ is?
16:15nuttynutnutoooooo
16:15nuttynutnutlol
16:15nuttynutnutgot it
16:15lokien_and new site! my god, so excited
16:16amalloythe site certainly looks a lot nicer
16:16lokien_and looks good on mobile too
16:17lokien_but.. where is j-pb?
16:29hiredmanhttps://vimeo.com/65102395 is a really neat doug lea talk that touches on how long it takes to just wake up a thread, and some different idling approaches
16:32momerathi have what amounts to a style question: I have some types and compound types, which need to be 'serialized' to basic edn, throwing away some information in the process, which I don't need for my current purposes (shipping out to a visualization in clojurescript). The types already implement toString to output compact human readable forms, which in some cases elide the bulk of the data. Is there
16:32momerathsome other existing interface that would be idiomatic? Some library? Just a term other than 'serialize' that's less misleading?
16:37amalloyit's a bit like marshaling, or encoding
16:43engblomHow soon is leiningen usually catching up with the newest release of Clojure?
16:43hiredmanin what context?
16:44hiredmanprojects that build using lein specify which clojure version they want to use
16:44amalloy0.1 milliseconds after a clojure version is released, you can use it with lein
16:45hiredmanwell, as soon as it is up in a maven repo
16:45amalloyi'm choosing to call that the release
16:45amalloyreally i just wanted a cheap 0.1ms joke for engblom
16:46engblom:)
17:09KamuelaWhat construct is identified like #’thing-here
17:09rhg135var
17:09hiredmanit is #'
17:09amalloy,#'x
17:09amalloyer
17:09clojurebot#error {\n :cause "Unable to resolve var: x in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve var: x in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyzeSeq "Compiler.java" 6875]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve var: x in this context"\n :at ...
17:09amalloy,'#'x
17:09clojurebot(var x)
17:09rhg135#,+
17:10rhg135,#+
17:10clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
17:10rhg135uh, I can't type
17:10hiredman#’ (hash followed by, what I think is the unicode prime mark) isn't anything
17:11hiredman#' is var quote, and #' followed by the name of a var, is the var
17:11hiredman,#'+
17:11clojurebot#'clojure.core/+
17:11hiredman,(deref #'+)
17:11clojurebot#object[clojure.core$_PLUS_ 0x74070ee9 "clojure.core$_PLUS_@74070ee9"]
17:11hiredman,+
17:11clojurebot#object[clojure.core$_PLUS_ 0x74070ee9 "clojure.core$_PLUS_@74070ee9"]
17:14hiredmanand the difference between (var +) and #'+ is one is a list that needs to be evaluated to get a var, and the other is a var
17:16Kamuelaso is it a reference to this var?
17:16amalloyhiredman: i'm not so sure about this last one. they're both a list that needs to be evaluated
17:16amalloy#'+, unevaluated, is just turned by the reader into (var +)
17:17amalloy,(= '(var +) '#'+)
17:17clojurebottrue
17:18hiredmanamalloy: huh, and there is commented out code for it that does return the var
17:18hiredmanwhich was commented out in 2009, so I am just wrong and I don't know why
17:39KamuelaOk thank you
17:39KamuelaFinally separated out routes to different files in luminus
17:42KamuelaI’m wondering if my development setup is correct, does changing code require a rebuild?
17:51justin_smithKamuela: depends, do you have anything that auto-loads changed code?
17:52Kamuelajustin_smith: what do you mean? basically I’m running luminus with lein within nightcode
17:54justin_smithKamuela: I mean there is nothing inherent about a standard setup that would auto reload anything
17:55Kamuelathat’s what I figured, so basically a rebuild is what’s required
17:56justin_smithKamuela: well, depends what you mean by "rebuild" - at the very least it requires reloading your changed namespaces, it could require restarting the server or ensuring that you use a var rather than just a function as your handler
17:59Kamuelawell, right now I am clicking “stop” and “run” which I admit, i’m not totally sure what it’s doing. i do know that a stop/run procedure is needed when I change code and it seems to take a very long time to start up again
18:00Kamuelaso I figured I may just be doing something inefficiently
18:01justin_smithyeah, stop and run is going to be the slowest thing, if you make sure your handler is a var and not function (eg (start-web-server #'handler) rather than (start-web-server handler)) then reloading the apropriate namespaces will suffice, and is much faster
18:11sdegutisSomeone wanna change the topic?
18:11sdegutisClojure 1.8 is out.
18:12sdegutisI forgot alex's IRC nick.
18:12justin_smithsdegutis: it's not on maven yet?
18:12sdegutishttp://search.maven.org/#artifactdetails%7Corg.clojure%7Cclojure%7C1.8.0%7Cjar
18:12sdegutisping puredanger
18:13sdegutisI hope this translates into CIDER!
18:13sdegutisI mean, I hope CIDER gets slimmer, or something.
18:14justin_smithcidr
18:15sdegutishaha
18:15sdegutiscidr.io
18:16justin_smithsdegutis: odd, 1.8.0 still not showing up here http://mvnrepository.com/artifact/org.clojure/clojure
18:16sdegutisHmm.
18:17puredangerThat stuff gets added by some batch system - usually takes a day or two
18:17amalloythat's an indexer
18:18rhg135cool
18:20amalloyquote now throws if passed more or less than one arg - dang, that's an old bug to finally fix
18:21justin_smith :message java.lang.NoClassDefFoundError: IllegalName: compile__stub.clj_http.headers.clj-http.headers/HeaderMap, compiling:(clj_http/headers.clj:105:1)
18:21justin_smithinteresting
18:23amalloylooks like some pretty good stuff in 1.8
18:23amalloyhttp://dev.clojure.org/jira/browse/CLJ-1208 was a common cause of confusion
18:24justin_smithhmm, the namespace getting that error uses potemkin
18:25ashnurcan someone please tell me in a few words what is the relationship between edn, transit, datascript ?
18:26sdegutisashnur: edn and transit are json alternatives, datascript is an in-browser datomic-like thing
18:26sdegutisalso datomic uses both edn and transit iirc
18:26ashnurdatascript is a database?
18:26ashnurholy shit
18:26ashnurit writes on the github page
18:26justin_smithregarding the above error with clj-http when using 1.8.0, updating to a newer clj-http fixed it
18:26ashnurbut somehow i missed it
18:27sdegutis"Immutable database and Datalog query engine for Clojure, ClojureScript and JS"
18:27sdegutisfirst few words
18:27sdegutis:D
18:27ashnuryeah :( sorry
18:28sdegutisI'm excited to figure out how Clojure 1.8 can help us!
18:42puredangerashnur: I wrote some stuff about transit and edn (and fressian) at https://groups.google.com/d/msg/clojure/9ESqyT6G5nU/2Ne9X6JBUh8J if you're interested
18:43ashnurreading it, thanks
19:12ashnurpuredanger, thanks, that was exactly what i needed to orient myself :)
19:19leavesofgrassif I have a ref foo and add a watch to it that updates another ref bar, will it do it in a transaction if I change foo in a dosync block?
19:26justin_smithleavesofgrass: I was curious so I tried it. the watcher is not run inside the transaction. https://gist.github.com/noisesmith/653e2280be728ab3909f
19:31leavesofgrassjustin_smith cool, thanks
19:31leavesofgrass(i could/should have tried it though, lol)
19:32leavesofgrasswas afraid of it maybe not giving me an exception but not running in a transaction at the same time, which I now realize doesn't make sense
19:34justin_smithleavesofgrass: of course I would only have shared the example if it proved one way or another that it was/wasn't in a transaction
19:36leavesofgrassI know, thanks a lot
20:18jarjar_p_(wave)
20:18jarjar_p_I'm trying to enable compiler options in my project file
20:18jarjar_p_"Can't change/establish root binding of: *compiler-options* with set" and getting this error