#clojure logs

2015-04-15

00:00justin_smith,(= (fn []) (fn []))
00:00clojurebotfalse
00:00brainproxy_right, the latter case makes sense to me
00:00justin_smithbrainproxy_: metadata is not part of equality
00:02brainproxy,(let [x (fn [])] (= x x))
00:02clojurebottrue
00:02justin_smiththat'
00:02brainproxy:)
00:02justin_smiths object idenity
00:02justin_smithwhich as I mentioned is the only kind of identity fn has
00:02justin_smith*equality
00:02brainproxy,(+ 1 1) (+ 1 1)
00:02clojurebot2
00:03brainproxywas testing something, have an idea
00:10brainproxy,(do (defrecord Myfun [f] clojure.lang.IFn (invoke [_] (f))) (let [x (->Myfun (fn []))] (= x (vary-meta x assoc :a 'bc))))
00:10clojurebottrue
00:11brainproxywell, obviously not a general purpose solution, but could do in a pinch
00:11justin_smithbrainproxy: you could also put the function in a var or atom or ref or agent
00:11justin_smithand put the metadata on that container
00:11TEttingermeta doesn't affect equality does it?
00:12justin_smithTEttinger: no, but varying meta on a function makes a new function
00:12TEttingeroh you covered that already
00:12TEttingerahhh
00:12justin_smithso it changes function equality as a side effect of that
00:16brainproxyjustin_smith: ah good point re: var/atom
00:18justin_smithbrainproxy: or even with your defrecord trick, that record could have been a vector, where you function is the only element
00:28noidijustin_smith, great explanation, thanks
00:29justin_smithnp
04:29zotmorning! is there a func like assoc that errors if the key already exists? i can clearly create this with merge-with, but wondered if something already exists.
04:34zotto be super clear, this is what I meant to simplify:
04:35zot (merge-with (fn [& _] (throw (Exception. (str "Duplicate :db/ident found: " :a)))) {:a :foo} {:a [0]})
04:59m1dnight_Guys, I'm looking for the term that describes how data structures (like maps) are represented in Clojure. IF you were to pass am ap and assoc to it, you would get a "new" map which shares old data with the previous data structure, but the old reference still has the old view of that data structure.
05:00m1dnight_CAn anyone help me?
05:00sm0kezot: i dont think so, but you can combine assoc with `contains?`
05:01Bronsam1dnight_: persistent data structures with structural sharing
05:01m1dnight_aha! thank you bronsa
05:01zotsm0ke: definitely, although since I want an error, i feel like the merge-with failing fn is more elegant. i didn't write the other version to actually see it though :)
05:01sm0kelike ##(if (contains? {:a 1} :b) (throw (Exception. "foo")) (prn "ok")))
05:01lazybot⇒ "ok" nil
05:01m1dnight_(inc Bronsa)
05:01lazybot⇒ 104
05:04sm0ke,(bean org.apache.commons.lang.SerializationUtils)
05:04clojurebot#error{:cause "org.apache.commons.lang.SerializationUtils", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.ClassNotFoundException: org.apache.commons.lang.SerializationUtils, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyze "Compiler.java" 6535]} {:type java.lang.ClassNotFoundException, :message "org.apache.commons.lang.SerializationUtils", :at [java.n...
05:05zotsm0ke: looks nice and tight there. will try the same now just for comparison. thanks :)
05:05sm0kehow awsome it would be if clojurebot allow adding a dependency here
05:33darthdeushey guys, anyone here using core.typed? I'm having trouble finding a good way to import its namespace ... since if I just :refer :all, it will collide with the core clojure functions
05:35oddcullydarthdeus: :as t seems quite popular
05:58asprahey there! Does anyone know if https://github.com/razum2um/clj-debugger is the main debugger for Clojure atm?
06:00razum2um aspra: seems like it is :) I also linked to other options here: https://github.com/razum2um/awesome-clojure#debugging
06:03asprarazum2um: cool thx! Is there anything more than the README I can look at?
06:03razum2umaspra: what are you looking for?
06:04aspraI want to start using it - just a guide to get me started
06:05asprarazum2um: I want to start using it - just a guide to get me started
06:06razum2umaspra: basically it has only 2 functions just on top of readme. currently won't work in multithreading and no stack up/down walking :\
06:06razum2umaspra: I've got less time for it recently, but we could improve it all together :)
06:08razum2umaspra: the main puprose I initially did this is importing a huge dataset, where some datarows were invalid and I needed break-catch, logging was not enough
06:08asprarazum2um: I see :) Ok great - I will try it and come back to you!
06:09asprarazum2um: thx for the work
07:24aspra I am trying the clj-debugger. I keep getting the https://github.com/razum2um/clj-debugger/issues/11 error even though my defn is not defined in the repl. Then I cannot exit using (q). Any idea what I might be doing wrong?
08:02clojerIs this syntactically wrong: (let [gen (new SecureRandom) key (byte-array length)] ... ?
08:03clojerFrom https://github.com/Arcanum-XIII/buddy-liberator/blob/master/src/buddy_liberator/core/handler.clj
08:07mavbozoclojer, at a glance, it's alright. why? is there any compilation error?
08:08clojermavbozo: Doesn't look like a proper binding.
08:09clojermavbozo: Shouldn't it be: (let [gen ((new SecureRandom) key (byte-array length))]
08:13mavbozoclojer, i tried it with repl and your version returns an error. What do you want to achieve with your version?
08:14sm0keone weird question so i have a var which contains a function how do find the namesapce of the fcuntion?
08:14mavbozo(new SecureRandom) returns an object, and you put the object in function position inside a list
08:14sm0ke,(do (def a inc) (namespace a))
08:14clojurebot#error{:cause "clojure.core$inc cannot be cast to clojure.lang.Named", :via [{:type java.lang.ClassCastException, :message "clojure.core$inc cannot be cast to clojure.lang.Named", :at [clojure.core$namespace invoke "core.clj" 1530]}], :trace [[clojure.core$namespace invoke "core.clj" 1530] [sandbox$eval25 invoke "NO_SOURCE_FILE" -1] [clojure.lang.Compiler eval "Compiler.java" 6784] [clojure.lang.C...
08:16sm0ke,(do (def a inc) (namespace `a))
08:16clojurebot"sandbox"
08:17sm0kewhich is obvious, but can i get ##(namespace `inc)
08:17lazybot⇒ "clojure.core"
08:35asprarazum2um: I am trying the clj-debugger. I keep getting the https://github.com/razum2um/clj-debugger/issues/11 error even though my defn is not defined in the repl. Then I cannot exit using (q). Any idea what I might be doing wrong?
08:53geirbyoh my
08:54geirbyhave just noticed that cider updated (ns (:require with [clojure.string :as str] when I typed (str/
08:54geirbymagic
08:56bensuthanks Bronsa, puredanger, lukev for reader conditionals
08:56mavbozogeirby, cider 0.9.0-SNAPSHOT?
08:56geirbyyes
08:57mavbozowow
08:57bensuand all the contributors for 1.7
08:57mavbozo(inc Bronsa)
08:57lazybot⇒ 105
08:57mavbozo(inc puredanger)
08:57lazybot⇒ 43
08:57mavbozo(inc lukev)
08:57lazybot⇒ 1
08:57bensuI just finished the migration and it worked great
08:57bensumavbozo: exactly :)
08:57geirbymavbozo: not sure if it was done by cider. I'm using spacemacs, may be it was some plugin
08:58puredangerNoooo now I lost my 42 :)
08:58mavbozo(dec puredanger)
08:58lazybot⇒ 42
08:58puredangerWhew
08:59bensupuredanger: the only thing that broke was instaparse, and the error was already solved and documented
09:09sobelis there anything like afl fuzzer for clojure code?
09:19oddcullysobel: considered test.check?
09:31timvisherwhat is `#'var`?
09:31timvisherand can i use it with a macro?
09:31justin_smithtimvisher: it's a reader macro
09:31justin_smith,#'+
09:31clojurebot#'clojure.core/+
09:31justin_smith,(var +)
09:31clojurebot#'clojure.core/+
09:31timvisherah
09:31clojurebotGabh mo leithscéal?
09:31timvisherso (= #' (var ...))
09:32justin_smithwell, (= #'foo (var foo)) yeah
09:32timvisherwhat's the word for that? qualified var?
09:33justin_smithtimvisher: var quote
09:33timvisherso generally i refer to `foo` as a var
09:33justin_smithit's a symbol, which resolves to the value of the var
09:33timvisherbut when i pass it to something using #'foo, what i'm passing to the thing is a ...?
09:33justin_smithwhile #'foo refers to the var itself
09:33timvisherok
09:33justin_smitha var is a mutable container
09:34justin_smithit's the difference between passing a pointer vs. the thing itself
09:34timvisherah yes, which is why when i wrap jetty around the var instead of the value, i can change the value of the var and jetty picks it up
09:34timvisheri thought it had something to do with pass by referenc rather than by value :)
09:34timvisherreference*
09:34justin_smithright - a var in function call position is implicitly dereferenced
09:34justin_smithtimvisher: and yes, it is sort of a value vs. reference sort of thing
09:34justin_smith,((var +) 1 2)
09:34clojurebot3
09:34justin_smithimplicit deref
09:35timvisherso, i'm trying to write a macro that will pass the war down eventually to a run-jetty call
09:35timvishervar*
09:35justin_smithbut note that that implicit deref is only in the calling position
09:35justin_smithtimvisher: the cool thing is with a macro, you could add the (var ...) part inside the macro
09:35timvisherand -main is now complaining that i can't refer to an undefined var
09:35timvisheri suppose i could give that a try :)
09:36justin_smithtimvisher: note that this won't work with a first class function
09:36justin_smithit needs to be a def at the top level of the ns
09:36timvisherjustin_smith: in this case it is
09:39timvisherwell, i can't get the code highlighting to work but this is what i've got so far https://gist.github.com/timvisher/1000a363e5dca3e2a01e
09:39timvisherjustin_smith: congrats!
09:40timvisherthere that's better
09:40timvisherhttps://gist.github.com/timvisher/1000a363e5dca3e2a01e
09:42justin_smithso yeah, that looks about right, wouldn't be surprised if it worked
09:42timvisherit doesn't seem to :( i attached the stack i'm getting to the gist
09:42justin_smithmaybe "handler-var" would be better named "handler-symbol"
09:42timvisherjustin_smith: that's a good note :)
09:43justin_smithtimvisher: ~'service-name
09:43justin_smithassuming service-name is a symbol
09:43timvisherservice-name is a string
09:43justin_smithoh it's a string
09:43justin_smithnever mind
09:43timvisherprobably doesn't need to be but it is right now
09:43justin_smithport-arg# nrepl-port-arg# etc.
09:44justin_smith` wants to namespace qualify your binding symbols
09:44justin_smithyou need to change them by adding #
09:44justin_smith(at definition and at usage) this tells ` to generate a gensym rather than namespace qualifying the symbols
09:44timvisherah
09:45justin_smithcompare:
09:45justin_smith,`(let [a 0] a)
09:45clojurebot(clojure.core/let [sandbox/a 0] sandbox/a)
09:45justin_smith,`(let [a# 0] a#)
09:45clojurebot(clojure.core/let [a__49__auto__ 0] a__49__auto__)
09:45justin_smithfor obvious reasons, that first version won't actually run
09:45timvisherindeed
09:45justin_smithyou can't let bind a ns qualfied symbol (as that stack trace is saying)
09:45mavbozojustin_smith, congratulations on your new job
09:45justin_smithmavbozo: thanks!
09:46justin_smithit'll be more clojure, but in a field I haven't done before
09:46justin_smithso I have a lot of learning to do...
09:46justin_smithwell, it's also a web server process, but there's some other fun stuff going on too that will be new to me...
09:46timvisherso now we're here https://gist.github.com/timvisher/1000a363e5dca3e2a01e#file-service-main-clj
09:46timvisherstill the same error
09:47Shayanjmjustin_smith: what industry will you be working in?
09:47timvisheris this because i'm attempting to use destructuring?
09:47justin_smithShayanjm: big data
09:47Shayanjmany specific vertical? 'big data' is a big place
09:47justin_smithtimvisher: I wonder...
09:47justin_smithShayanjm: graph analysis of social data, with a web UI for clients
09:48timvisher,`(defn [& {ohai ":ohai" charnock ":charnock" :as args}] (ohai charnock args))
09:48Shayanjmoh nice
09:48clojurebot(clojure.core/defn [& {sandbox/charnock ":charnock", :as sandbox/args, sandbox/ohai ":ohai"}] (sandbox/ohai sandbox/charnock sandbox/args))
09:48Shayanjma bit like my last project then
09:48Shayanjmbut, graph-y
09:48timvisher,`(defn [& {ohai# ":ohai" charnock# ":charnock" :as args#}] (ohai# charnock# args#))
09:48clojurebot(clojure.core/defn [& {:as args__100__auto__, ohai__98__auto__ ":ohai", charnock__99__auto__ ":charnock"}] (ohai__98__auto__ charnock__99__auto__ args__100__auto__))
09:48timvisherno that looks reasonable...
09:49timvisherassuming that :as can go first in the destructuring bind?
09:49justin_smithtimvisher: OH
09:49Shayanjmjustin_smith: do you have a few minutes to review some wordvomit? I'm trying to skeleton-out my blog post for that data project I was working on
09:49justin_smithtimvisher: pass app-routes rather than app
09:50justin_smithtimvisher: it's already a var, var quoting is nonsensical there
09:50Shayanjmwould appreciate some criticism/comments on direction. It's fairly light reading because I tried to make everything as simple/accessible as possible
09:50justin_smith,(var `#'+)
09:50clojurebot#error{:cause "clojure.lang.Cons cannot be cast to clojure.lang.Symbol", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.Symbol, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyzeSeq "Compiler.java" 6732]} {:type java.lang.ClassCastException, :message "clojure.lang.Cons cannot be cast to...
09:50justin_smithoops
09:50justin_smith,`(var #'+)
09:50clojurebot(var (var clojure.core/+))
09:50justin_smiththat's what you were doing, and it won't work ^
09:51timvisher,(let [{:as charnock ohai ":ohai" whitefield ":whitefield"} {":ohai" :a ":whitefield" :b}] [charnock ohai whitefield])
09:51clojurebot[{":ohai" :a, ":whitefield" :b} :a :b]
09:51timvisherit does seem to work
09:51justin_smithtimvisher: no, it's because app is already a var
09:51justin_smithyou can't call var on a var
09:51timvisherok
09:51justin_smith,(var #'+)
09:51clojurebot#error{:cause "clojure.lang.Cons cannot be cast to clojure.lang.Symbol", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.Symbol, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyzeSeq "Compiler.java" 6732]} {:type java.lang.ClassCastException, :message "clojure.lang.Cons cannot be cast to...
09:51timvisherso this was working though prior to trying to macroize it
09:52timvisherin the application the app-routes var is being further wrapped by some middleware
09:52justin_smithtimvisher: right, before you needed to pre-var-quote
09:52justin_smithnow the macro var-quotes
09:52justin_smithhmm...
09:52timvisherwhich i'm assuming doesn't return the var itself?
09:52timvishermiddleware returns a function right?
09:52justin_smithright
09:53justin_smithI was wrong, app should work there
09:53timvisheri updated the gist to be more accurate https://gist.github.com/timvisher/1000a363e5dca3e2a01e
09:53justin_smith,(def f +)
09:53clojurebot#'sandbox/f
09:53timvisher(sorry, trying to obfuscate sensitive stuff :) )
09:53justin_smith,(defmacro g [h] (var h))
09:53clojurebot#error{:cause "Unable to resolve var: h in this context", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.RuntimeException: Unable to resolve var: h in this context, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyzeSeq "Compiler.java" 6732]} {:type java.lang.RuntimeException, :message "Unable to resolve var: h in this context", :at [clojure.lang.Util run...
09:54justin_smith,(defmacro g [h] `(var ~h))
09:54clojurebot#'sandbox/g
09:54justin_smith,(g f)
09:54clojurebot#'sandbox/f
09:54timvisherthat looks like about what i was seeing
09:54justin_smithso that works
09:54timvisherah nice
09:54timvisherso a further syntax quote
09:55justin_smithtimvisher: you may need ~(var handler-var)
09:55justin_smithto make the defn form work
09:56timvisheri'm reminded of something fogus or chouser said about writing macros, which is that most people writing macros just treat the various quote and unquote functions like a salt shaker, sprinkling them at random throughout the macro until it works :)
09:56justin_smith,(defmacro g [h] `(defn ~'generated [] (var ~h)))
09:56clojurebot#'sandbox/g
09:56timvisherjustin_smith: net referring to you of course, but to me :)
09:56justin_smith,(defmacro g [h] `(defn generated [] (var ~h)))
09:56clojurebot#'sandbox/g
09:56justin_smithtimvisher: haha, indeed
09:57justin_smithI get suspicious of any nesting of quotes and unquotes
09:57justin_smith,(g f)
09:57clojurebot#error{:cause "Unable to resolve var: f in this context", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.RuntimeException: Unable to resolve var: f in this context, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyzeSeq "Compiler.java" 6732]} {:type java.lang.RuntimeException, :message "Unable to resolve var: f in this context", :at [clojure.lang.Util run...
09:57justin_smith,(def f +)
09:57clojurebot#'sandbox/f
09:57justin_smith,(g f)
09:57clojurebot#'sandbox/generated
09:57justin_smith,(generated)
09:57clojurebot#'sandbox/f
09:57justin_smithok, so this worked
10:00timvisherjustin_smith: i'm not sure it did. isn't there something about macros resolving vars in their namespace rather than in the var's namespace?
10:00justin_smithtimvisher: when I take the call to control/start-service! out, it works
10:00justin_smithtimvisher: just returning the hash-map
10:00timvisheroh well nevermind then :)
10:00justin_smithtimvisher: I think the problem is control/start-service!
10:00timvisheras in that's the qualified var it can't find?
10:00justin_smithbecause that's the only change I made from your code as of the last paste
10:00justin_smithtimvisher: has to be
10:01timvisherthat's possible
10:01timvisherin this instance, the macro is in the same ns as the function i'm calling
10:01justin_smithbecause it works in my repl if I take that reference out and return the hash-map
10:01justin_smiththan don't qualify it!
10:01justin_smith` ns-qualifies things for you
10:01timvisheri just realized that :)
10:02timvisherhow many fake internet points would you like? ;)
10:02justin_smithhaha
10:02mavbozomore than raynes?
10:03timvisher(identify raynes)
10:03timvisher(identity raynes)
10:03lazybotraynes has karma 55.
10:03timvisherwho was it last night that had triple digits?
10:03timvisheroh yeah
10:03timvisheramalloy
10:03justin_smithamalloy, technomancy, and myself all are in the 3 digits
10:04justin_smithoh, and gfredericks
10:04justin_smith$karma gfredericks
10:04lazybotgfredericks has karma 135.
10:04justin_smith$karma amalloy
10:04lazybotamalloy has karma 257.
10:04justin_smith$karma technomancy
10:04lazybottechnomancy has karma 163.
10:04justin_smith$karma justin_smith
10:04lazybotjustin_smith has karma 239.
10:04zerokarmaleftooh, catching up
10:05mavbozo$karma Raynes
10:05lazybotRaynes has karma 55.
10:05mavbozocase-insensitive i see
10:13timvisherjustin_smith: huh. i can't get this to work even removing the call to `start-service!`...
10:13timvishercan you pastebin the version you said worked?
10:13timvisherbecause you already do enough of my job for me :)
10:18justin_smithtimvisher: this version works https://www.refheap.com/99635
10:19justin_smithnext is for you to figure out how to refer to start-service!
10:20justin_smithalways so excited about side effects around here
10:22timvisherbizarre...
10:22timvisherthis is why i never write macros...
10:24timvisher"make it a little easier on your fellow devs... have some sweet syntax... have a few laughs..." http://imoviequotes.com/wp-content/uploads/2014/11/3-Die-Hard-quotes.gif
10:25timvisheroh jeez. -main is being ns qualified...
10:25timvisherso how i do i get that specific name to be in the resulting expansion?
10:26justin_smithtimvisher: haha ~'-main
10:26justin_smithfor some reason I did not have that problem, weird
10:27timvisherinteresting... the macroexpansion 'inlines' (?) the (var ...) call to #'app
10:27noncomdoes anybody know some solution to reduce startup time of aleph?
10:27justin_smithtimvisher: #'app is how (var app) prints
10:28timvisheroh interesting
10:28timvisheri know so litle about the reader/printer
10:29justin_smith,(var +)
10:29clojurebot#'clojure.core/+
10:29timvisherok! feeling good about this restart :)
10:34timvisherthe war is over ender... we won...
10:34timvisherat what cost?
10:34timvisher...
10:34zerokarmalefteh, he gets over it over the next three books :P
10:43timvisher(inc justin_smith)
10:43lazybot⇒ 240
10:43timvisher(inc justin_smith)
10:43lazybot⇒ 241
10:43timvisher(inc justin_smith)
10:43lazybot⇒ 242
10:43timvishergotta be worth at least three
10:43timvisherjustin_smith: want to come work in philly? :)
10:44justin_smithtimvisher: I appreciate the offer, but Portland is pretty awesome, and I just got this job
10:44timvisherjustin_smith: heh. understood :)
10:44timvishergotta love that concrete
10:46TEttingerwhat happened, haha
10:46virmundiare there any good tutorials for advanced compojure techniques? I just realized that I can have /resource/:id, and the :id be missing. as such a 404 should occur. Easy enough if I have just a few routes, but it would be a pattern.
10:50noncomif smb is interested on the q about aleph i asked a few minutes ago, here's what: http://dev.clojure.org/jira/browse/CLJ-1529
10:54timvishervirmundi: maybe the luminus docs?
10:54timvishercompojure is great while things are small by imo it breaks down _hard_ when you get more complex
10:58virmunditimvisher: I’ll take a look
10:58noncomdoes anyone use clojure 1.7.0-beta1 already?
11:11CookedGryphonhey, can anyone explain to me why Transit takes a ByteArrayInputStream argument to its reader?
11:11CookedGryphonhow am I supposed to get the benefits of keyword caching etc. over a stream of data if I need to recreate the reader every time?
11:13CookedGryphonon the writer side, I can at least call reset() on the bytearrayoutputstream and write new data to it if needs be, but I have no way of putting new data into the reader without creating a new reader, or going to all the faff of making a new type of input stream (which is hell in clojure, with it being an abstract class rather than an interface)
11:14dnolenCookedGryphon: that's just how caching is supposed to work, you can't safely share caches across reads anyway
11:15TEttingerhttps://docs.oracle.com/javase/8/docs/api/java/io/ByteArrayOutputStream.html it appears there is a .reset
11:17CookedGryphonTEttinger: yeah, I can do that on the write side, but it's not thread safe
11:17CookedGryphonbut on the read side, I can't do anything
11:17TEttingerah.
11:17TEttingeryeah you shouldn't be able to send something that causes the reader to forget everything it read...
11:18CookedGryphondnolen: is there a reason for that? I would have thought if you're creating a reader, you can manage a session to the extent that you know what the other end has seen from you already, in which case why not share cache values?
11:19TEttingerthere's also a reset for input https://docs.oracle.com/javase/8/docs/api/java/io/ByteArrayInputStream.html#reset--
11:19CookedGryphonTEttinger: yeah, but all that allows you to do is read the same data again
11:20TEttingernot if you mark when you reset the writer
11:20CookedGryphondnolen: my particular use case, I am opening a websocket and want a reader/writer for the lifetime of that socket, why wouldn't it be safe to use cached keywords during that session?
11:21TEttingerhttps://docs.oracle.com/javase/8/docs/api/java/io/ByteArrayInputStream.html#mark-int- this should let you reset to a later point in the stream
11:23TEttingerah, but you want different data to be read in, I guess? I think that it will keep reading and adding in input at the end
11:23TEttingersince it can't be closed
11:32CookedGryphonYeah, I really want streams to be core.async channels
11:32CookedGryphonand they just aren't
11:36timvisherugh... round-trip on uberjar testing is _slooooooow_
11:37timvisherCookedGryphon: i have some memory of aleph support attaching a core.async channel to a websocket?
11:37timvisherdoes that sound like anything to anybody? :)
11:37mpenettimvisher: via manifold probably
11:37mpenetjet has websocket support using core.async as well (both client/server)
11:38CookedGryphonso I'm using chord
11:38CookedGryphonand that has core.async websocket support, clj and cljs, and it's great
11:38CookedGryphonit even has a transit mode,
11:39CookedGryphonbut the formatter creates a new writer for every outbound message and a new reader for every inbound message
11:39CookedGryphonwhen I really want for the lifetime of the websocket to use keyword caching and a single reader/writer.
11:39muraikiI've used websockets in httpkit with core.async, but I don't know what it does in terms of writers/readers
11:40CookedGryphonso I tried to make the change to the formatter, and in cljs it's not a problem, but the clj version has these ByteArray<in/out>putStreams
11:42kolovcemerick, thanks for the help with friend & google oauth2 yesterday. https://github.com/ddellacosta/friend-oauth2 workflow works fine, I migrated my app to oauth2.
11:43cemerickkolov: great, glad it worked out :-)
11:44cemerickkolov: it would probably be useful to others if you could document the migration process/changes, would be happy to have a friend wiki page on this if you're willing
11:44timvisherso my understanding of transitive deps is clearly broken
11:45timvisherwhen i `lein run` a thing, all transitive deps seem to be present. but when i go to `lein uberjar` the thing, it seems like anything i didn't specify explicitly in my deps dissapears
11:45timvisherwhich can't be right, can it?
11:45kolovcemerick: I'll leave a comment at https://github.com/cemerick/friend/issues/117
11:46mpenettimvisher: sounds odd... you're using checkouts?
11:46timvishermpenet: i do, but not in this instance
11:47mpenettimvisher: I never had this issue
11:47timvishermpenet: i haven't either...
11:47timvishernot to my knowledge at least
11:48timvisherso i've got a shared lib which depends _explicitly_ on cider-nrepl, and _transitively_ on tools.nrepl
11:48timvisheri've got my service which depends explicitly on the shared-lib
11:48timvisherlein deps :tree reports all the deps
11:49timvisherbut lein uberjar can't find `clojure/tools/nrepl/server...` on the classpath
11:51timvisheri mean, i'm fine with adding the dep, but i don't understand why it's necessary
11:52mpenetthe dep is in a dev/test profile?
11:52timvishermpenet: nope. top level `:dependencies`
11:53timvisherthere doesn't appear to be anything weird about the dep in cider-nrepl either https://github.com/clojure-emacs/cider-nrepl/blob/0f189d6881352f584dbbbdcb47272ccfaf1ed25a/project.clj#L15
11:55ghadishaybanis there any known trouble with calling (require 'somens) inside futures to get an application started up faster?
12:03Bronsaghadishayban: might interact badly with defmethod/extend
12:03timvisherhah. `lein classpath` even reports that the dep is there...
12:05timvisherpuredanger's tip about jar contents is also a swing and a miss, the jar contains the stuff i think it does
12:18timvisheri'm completely baffled by this behavior. is there a difference between the compiletime dependencies and the dependencies included in the uberjar?
12:19timvisheri'm wondering now if this is a lein version problem? it has to be simpler than that though
12:21lemonodormaybe `lein with-profile uberjar deps :tree` might show something different?
12:38sdegutisDo any've y'all who've a Clojure web app 'nd deploy it to EC2 use Docker or Vagrant or anything else to manage it?
12:39lemonodorI used elastic beanstalk, and just created WARs with lein-awsuberwar
12:42bensusdegutis: I use Docker
13:01noncomdowa anyone use clojure 1.7.0-beta 1 lready?
13:02TEttinger,*clojure-version*
13:02clojurebot{:major 1, :minor 7, :incremental 0, :qualifier "master", :interim true}
13:02TEttingerit's pretty likely that clojurebot uses it
13:02TEttingeror something newer
13:02TEttingerare you having issues with it, noncom?
13:03noncomi'd say just a question: https://www.refheap.com/99638
13:03noncomsee the differences on starting my project in the two versions?
13:03noncom1) namespace object is strange in 1.7.0
13:04noncom2) warnings are not suppressed?
13:04noncomcan you maybe comment on that? (just to know what's going on)
13:08TEttingerright, noncom: update is new in 1.7.0 as a clojure.core fn
13:09mavbozo,(doc update)
13:09clojurebot"([m k f] [m k f x] [m k f x y] [m k f x y ...] [m k f x y ...]); 'Updates' a value in an associative structure, where k is a key and f is a function that will take the old value and any supplied args and return the new value, and returns a new structure. If the key does not exist, nil is passed as the old value."
13:09TEttingerand there's a different printer for objects
13:09TEttinger,(print (java.util.HashMap.))
13:09clojurebot#object[java.util.HashMap {}]
13:09TEttinger&(print (java.util.HashMap.))
13:09lazybot⇒ #<HashMap {}>nil
13:10TEttinger,#object[java.util.HashMap {}]
13:10clojurebot#<RuntimeException java.lang.RuntimeException: No reader function for tag object>
13:10TEttingerhm
13:10TEttingerwhy do we have this object reader syntax again?
13:11bacon1989TEttinger: think it's for the EDN format, so you can write custom readers to produce the desired Record from external data
13:12noncomok, i got it about (update), really, ew only had (update-in) before...
13:12TEttingeryep, we really did
13:12TEttingerkinda nuts
13:12noncombut as for the object...
13:12noncommaybe it's what bacon1989 says...
13:12puredangerTEttinger: the new syntax can be read by the reader, the old could not
13:13TEttingerpuredanger, but... it didn't get read
13:13puredangerit *can* be read, but no default reader is defined for it
13:13TEttingertag object doesn't have a reader function, should it?
13:14puredangerwhat would you do with it if you had it?
13:17TEttingerpuredanger: probably try to deserialize the stuff that comes with the object (the {} there), and/or call the zero arg constructor if present
13:18TEttingeris there an edn serializer for POJOs yet?
13:18puredangerthe {} is the toString - this seems like an older version btw, as it now also includes the hash explicitly
13:20Shayanjmping arrdem
13:21puredanger,(prn (java.util.HashMap.))
13:21clojurebot{}\n
13:21Shayanjm,(doc prn)
13:21clojurebot"([& more]); Same as pr followed by (newline). Observes *flush-on-newline*"
13:21Shayanjmoic
13:21TEttinger,(doc pr)
13:21clojurebot"([] [x] [x & more]); Prints the object(s) to the output stream that is the current value of *out*. Prints the object(s), separated by spaces if there is more than one. By default, pr and prn print in a way that objects can be read by the reader"
13:22TEttingerhm
13:22puredangerpr/prn are for printing as readable data
13:22puredangerprint/println are for humans
13:22Shayanjmnoted
13:22TEttingerthen what's this new less readable sometimes #object syntax?
13:22mavbozo,(println (java.util.HashMap.))
13:22clojurebot#object[java.util.HashMap {}]\n
13:23noncomso now we now that's an object :)
13:23puredangerthat's for printing as data when it has no defined printer as data - interestingly it looks like print-dup and print-method differ here in how they handle Java collections, so this is kind of a weird corner
13:23TEttingerah
13:24Bronsaall the differences between pr/str/print + *print-dup* always confused me
13:24ShayanjmTIL
13:24mavbozo,(prn 'a-symbol)
13:24puredanger,(pr (java.awt.Color/BLACK))
13:24clojurebota-symbol\n
13:24clojurebot#error{:cause "Could not initialize class java.awt.Toolkit", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.NoClassDefFoundError: Could not initialize class java.awt.Toolkit, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyzeSeq "Compiler.java" 6732]} {:type java.lang.NoClassDefFoundError, :message "Could not initialize class java.awt.Toolkit", :at [java...
13:24puredangerha
13:25mavbozo,(println 'a-symbol)
13:25clojurebota-symbol\n
13:26mavbozo,(prn (get get get get))
13:26clojurebot#object[clojure.core$get "clojure.core$get@38c44e0e"]\n
13:26mavbozo,(println (get get get get))
13:26clojurebot#object[clojure.core$get clojure.core$get@38c44e0e]\n
13:26puredangeryeah, functions are a good example
13:27noncombut adventures continue! https://www.refheap.com/99639
13:27noncomlook at lines 10 and 11
13:27puredangerbut on beta1 you should see something like this for (pr get): #object[clojure.core$get 0x58915a1a "clojure.core$get@58915a1a"]
13:27puredangerclass hash toString
13:28puredanger,*clojure-version*
13:28clojurebot{:major 1, :minor 7, :incremental 0, :qualifier "master", :interim true}
13:28puredangermust be an old version of master - that's weird
13:29puredangerI guess maybe clojurebot was started with master before beta1 or something?
13:29puredanger,(class (range 5))
13:29clojurebotclojure.lang.LazySeq
13:29puredangeryeah, definitely pre-beta1
13:30noncommine shows
13:30noncom => *clojure-version*
13:30noncom{:major 1, :minor 7, :incremental 0, :qualifier "beta1"}
13:30noncom=> (class (range 5))
13:30noncomclojure.lang.LongRange
13:30puredangeryeah, what clojurebot is showing is a master-SNAPSHOT, but it not current
13:30noncomwell, ok..
13:31noncomwhat about lines 10 and 11 here? ttps://www.refheap.com/99639
13:31puredangerthe :interim true up there means it's a snapshot
13:31puredangernoncom: those are long-standing reflection warnings in those libs - I think some of them have newer versions where they've been fixed
13:33hiredman,(class (range 5))
13:33clojurebotclojure.lang.LongRange
13:34puredangerhey look :)
13:34noncomwow
13:34noncom,(class (range 5))
13:34clojurebotclojure.lang.LongRange
13:34puredanger,(pr get)
13:34clojurebot#object[clojure.core$get 0x35bcc9ae "clojure.core$get@35bcc9ae"]
13:34noncom*clojure-version*
13:34noncom,*clojure-version*
13:34clojurebot{:major 1, :minor 7, :incremental 0, :qualifier "master", :interim true}
13:34noncomwtf
13:35puredangerI assume hiredman did a bounce :)
13:35hiredmanI did, I restarted the eval service with a newer version
13:35puredangermaster currently matches beta1
13:35mavbozocool
13:36mavbozo,(prn (get get get get))
13:36clojurebot#object[clojure.core$get 0x35bcc9ae "clojure.core$get@35bcc9ae"]\n
13:36noncomcool!
13:36mavbozo,(print (get get get get))
13:36clojurebot#object[clojure.core$get 0x35bcc9ae clojure.core$get@35bcc9ae]
13:38TEttinger,(def get ([] get) ([& get] get get))
13:38clojurebot#error{:cause "Too many arguments to def", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.RuntimeException: Too many arguments to def, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyzeSeq "Compiler.java" 6740]} {:type java.lang.RuntimeException, :message "Too many arguments to def", :at [clojure.lang.Util runtimeException "Util.java" 221]}], :trace [[cl...
13:39TEttinger,(defn get ([] get) ([& get] get get))
13:39clojurebot#error{:cause "denied", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.SecurityException: denied, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyzeSeq "Compiler.java" 6740]} {:type java.lang.SecurityException, :message "denied", :at [clojurebot.sandbox$enable_security_manager$fn__835 invoke "sandbox.clj" 69]}], :trace [[clojurebot.sandbox$enable_securit...
13:39TEttingerha
13:53sdegutisSorry, I disconnected. D'anyone say anythin' 'n regards t' my question about deploying t' EC2?
13:54sdegutisI only saw the first two responses, respectively from lemonodor and bensu.
13:54sdegutislemonodor: so you don't use nginx or anything besides a single UBER-WAR?
13:55xemdetiasdegutis, I spent at least half a minute trying to parse 3 messages back
13:55sobelanyone here use clojure-nginx?
13:58ircxyconcurrency Q: I'd like to manage a max number of a db column for more than 1 db env. I'd like to call a func or lazy-seq to get the next value passing a map containing the db-env. {:db-env :test} initially the map is empty. When the env key is not found, Q db, init the atom. Any tips?
13:58ircxyLooking at dosync with if-let
14:00small-chimpburn all jews in oven
14:00small-chimpsieg heil
14:00sdegutisxemdetia: sorry 'bout that, I s'pose contractions 'n' abbreviations don't work quite so well here as the'do in real life.
14:00small-chimpdeath to infidels
14:00small-chimpallahu akhbar
14:00small-chimpburn all jews in oven
14:00sobelyes. use a sequence in your database.
14:01sdegutissobel: nope, why d'y' ask?
14:01Bronsaamalloy:
14:01sobelsdegutis: hoping to find a success story with the latest version. i can't get it to twitch under the microscope.
14:01Bronsasdegutis: please stop. it's pointless and makes your phrases hard to read
14:02sdegutisBronsa: you're the boss.
14:02small-chimpDEATH TO JEWS
14:02small-chimpCLOJURE IS AN INFIDEL PROGRAMMING LANGUAGE
14:02small-chimpALLAHU AKHBAR
14:02Bronsapuredanger: you here?
14:02puredangeryeah, hang on
14:02sobelircxy: don't try to keep track of things in the database that are already kept track of in the database.
14:03mavbozoircxy, you only query the max-number of column once during your app startup?
14:03sobelircxy: if you need a serial value, use it in your sql expressions. that is regular/appropriate use.
14:03oddcullysmall-chimp: your last nick was more funny
14:03ircxymavbozo: yes, actually the first time someone calls the next function.
14:04Bronsasdegutis: not trying to be bossy but it's seriously irritating and I'm sure you're aware of it. no idea why you sometimes try to be willfully annoying
14:04sobelircxy: why do you need that value?
14:04sobelBronsa: the burden of communication is on the speaker. let the problems he creates rest on his shoulders.
14:04small-chimpHELP I WOULD LIKE TO LEARN CLOJURE BUT I AM TOO STUPID
14:04small-chimpHELP PLEASE
14:04sobelBronsa: rather than asking us to carry them, as well ;)
14:04ircxysobel: like DB sequence number, but for a group of inserts
14:04pbxno ops here eh?
14:05small-chimpHELP HOW CAN I BECOME A DATABASE
14:05sobel/ig small-chimp
14:05sobeland be done
14:05mavbozodone
14:05sdegutisBronsa: to be honest I was just trying to have a little harmless fun; but I keep forgetting that every single time I try to add a little harmless fun into my communications on IRC in #clojure, you get very very very annoyed at it; my apologies for forgetting to be sensitive to your needs
14:05oddcullynone of the bots have some vote kill feature?
14:05sobelircxy: right, it's a concurrency problem right there if you are sending seq numbers from your app. it's safer to use a "next seq" expression in the sql code.
14:06sobelircxy: s/safer/safe.
14:06sdegutissmall-chimp: touché
14:06sobelircxy: in other words, when you copy a seq value from your database, you have created the concurrency problem.
14:06small-chimpHELP HOW CAN I LEARN FUNCTIONAL PROGRAMMING HELP PLEASE
14:06ircxysobel: can't. I'm inserting a group of X rows that are related. They all need the same number. think batch id.
14:07small-chimpEVERYTHING IS A FUNCTION THAT IS SOMETHING I THINK UH THAT I COULD THINK ON ACID
14:07oddcullyaaaand good bye
14:08ircxysobel: understood. Theoretically this is true, no Q. But this server as the only access for inserting.
14:08mavbozoircxy, have you considered using stored-procedure?
14:08sdegutissmall-chimp: you make a very compelling and reasonable point in that we shouldn't try to amuse ourselves without regard or consideration for others around us; thank you for your subtle but effective nudge
14:08sobelircxy: so inserting then updating all new rows to the (same) next_seq value wouldn't be allowed
14:09ircxysobel: so each thread would get the next value and insert it's batch with the next number.
14:09sobelthat sounds like a shite db arrangement. sorry to hear it. :)
14:09sdegutisBronsa: after reading small-chimp's message between the lines, I now understand that I was the one wrong this whole time; I'm sorry for annoying you with my so-called "harmless" fun.
14:10Bronsasdegutis: I don't remember all those times I complained about you that you seem to imply. Also please stop this passive-aggressive trolling.
14:10mgaaresdegutis: how's the view from up there on hte cross?
14:10small-chimpwhat!? but i never meant any offense or disrespect
14:10ircxysobel: simply the inserted batch rows are logically related, this single number ties them together.
14:11dmeadhi channel. can i still use slime with swank-clojure? or do i have to use nrepl
14:11dmeadi'm having a problem getting slime to talk to clojure
14:11Bronsapuredanger: surely #clojure!*@* +b!*@* small-chimp!*@*
14:11sdegutisBronsa: based on your response you must have completely misunderstood what I was saying
14:11sobelircxy: ok, so you need a value nailed down that is transactional. a sequence will not be, for obvious reasons.
14:11@puredangerBronsa: eh?
14:11Bronsapuredanger: surely #clojure!*@* +b!*@* small-chimp!*@* have done nothing wrong :)
14:11sdegutismgaare: I'm sure that's meant to be an insult of some kind, but I really don't get it
14:11Bronsapuredanger: you messed up the ban command :P
14:12TimMcThat bans everyone, right?
14:12sdegutisAnyway, anyone else use Docker, Vagrant, or other, and have reason to prefer it over the others?
14:12@puredangeryeah, I probably did
14:12@puredangerhelp?
14:12clojurebotNobody can help with "X doesn't work". Please provide context: what you did, what you hoped would happen, and what happened instead. A stack trace is especially helpful, if applicable.
14:12sobelircxy: could you use a temp table to stage your import? would a UUID be just as good or does someone else depend on having continuously increasing integers for import ids?
14:12Bronsapuredanger: /mode #clojure -bb #clojure!*@* +b!*@*
14:12TimMcnot that I understand IRC ban syntax, because I don't
14:12sdegutisI don't know anyone who does, it's completely confusing.
14:13TimMcI've never seen documentation for it, though I've looked.
14:13@puredangerBronsa: what does all that mean?
14:13Bronsapuredanger: hang on, you're not opped so that won't work
14:13ircxysobel: no requirement for inc numbers. Was thinking UUID as well.
14:13@puredangerI think I am opped?
14:13sdegutispuredanger: you are
14:13sobelircxy: i would go with that, and not try to sync a data structure with db sequences
14:13oddcullyhes channel op
14:14@puredangerthis is like giving your keys to a 5 year old :)
14:14sobelircxy: that way your import process starts with reading a fresh uuid then inserting with that value for the batch
14:14Bronsapuredanger: oh you are, erc is dumb then
14:14Bronsapuredanger: that removes the two wrong bans you added to the banlist
14:14sobelircxy: it's probably the simplest concurrent way to do this
14:14Bronsa+b
14:15Bronsa(inc puredanger)
14:15lazybot⇒ 43
14:15sobel(inc sobel)
14:15lazybotYou can't adjust your own karma.
14:15sobel!!!!!!
14:15mavbozo(dec puredanger)
14:15lazybot⇒ 42
14:15ircxysobel: surely a lot simpler, to create a uuid
14:15mavbozokeep it 42
14:15TimMclocal maximum
14:15sobel(inc Bronsa )
14:15lazybot⇒ 3
14:15sobeli only inc the with-spaces version.
14:16sobel(div 2 Bronsa)
14:16TimMc$karma Bronsa
14:16lazybotBronsa has karma 105.
14:16sobel$karma Bronsa
14:16lazybotBronsa has karma 105.
14:16sobel$karma Bronsa
14:16lazybotBronsa has karma 105.
14:16TimMcwith-spaces, is that like the evin-twin version?
14:16sobelapparently it trims whitespace. however will i query the with-space version.
14:16sobelTimMc: right down to the goatee
14:17sobel$karma "Bronsa "
14:17lazybot"Bronsa " has karma 0.
14:17sobel$karma 'Bronsa '
14:17lazybot'Bronsa ' has karma 0.
14:17sobel$karma Bronsa\
14:17lazybotBronsa\ has karma 0.
14:17Bronsasobel: please stop highlighting me
14:17sdegutisBronsa: sorry
14:17sobelBronsa: will try
14:18sobeldo the karma inquiries highlight you?
14:18noprompt_is there anything i need to enable to get #? working in the repl?
14:18timvisheri do understand lein uberjar right in that it should package transient dependencies up with the jar?
14:18noprompt_i get a rt exception saying the conditional read isn't allowed. :/
14:19timvisherah https://github.com/technomancy/leiningen/issues/1762#event-194323170
14:20sobeltransitive <> transient ;)
14:21timvishersobel: not sure i follow
14:21sdegutisI'm looking to upgrade from 1.5.1 to 1.7. Are transients pretty much the only new interesting feature in this version jump?
14:21puredangernoprompt_: in beta1, reader conditionals won't work in the repl. with next release (beta2?) CLJ-1700 will enable that
14:22timvisherhttps://github.com/technomancy/leiningen/issues/1771
14:22timvisherthat's pretty much my situation exactly
14:22puredangernoprompt_: you can invoke the reader directly with read or read-string though
14:22puredanger,(read-string {:read-cond :allow} "#?(:clj "hi" :default "there")")
14:22clojurebot#error{:cause "Unable to resolve symbol: hi in this context", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.RuntimeException: Unable to resolve symbol: hi in this context, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyze "Compiler.java" 6543]} {:type java.lang.RuntimeException, :message "Unable to resolve symbol: hi in this context", :at [clojure.lang...
14:23noprompt_puredanger: right. i was simply looking forward to interacting with it. :)
14:23puredangerah, quoting bad
14:23puredanger,(read-string {:read-cond :allow} "#?(:clj :hi :default :there)")
14:23clojurebot:hi
14:24puredangersdegutis: are you talking about Clojure versions?
14:24puredangerif so, see: https://github.com/clojure/clojure/blob/master/changes.md
14:25Bronsasdegutis: transducers not transients. also another big 1.7 feature is reader conditionals
14:26Bronsa,(read-string {:read-cond :allow} "#?@(:clj [1 2])")
14:26clojurebot1
14:26Bronsapuredanger: ^ I have a patch for t.reader that makes that an error -- is it be reasonable?
14:26Bronsapuredanger: would mimick ##`~@()
14:27Bronsa,`~@()
14:27clojurebot#<IllegalStateException java.lang.IllegalStateException: splice not in list>
14:27TEttingerwhat on earth...
14:27TEttinger#?@ does what exactly?
14:28TEttingertrigraphs are getting a bit... much IMO
14:28sdegutisBronsa: oh nice!
14:28TEttingerI was pretty happy when my macro macro got working with ~'~ in there
14:28sdegutispuredanger: yes sorry
14:29sdegutisAre reader conditionals the new alternative to Cljx?
14:34sdegutisOff topic, but the Reader Conditionals feature made me wonder if it would be worthwhile to write a Clojure compiler in Haskell using parsec that has different back-ends for emitting different bytecode (JVM, JS, CLR, YARV, etc).
14:35sdegutisThe main downside I suppose would be that the macro-expansion runtime would need to be entirely written in Haskell.
14:47puredangerBronsa: sorry, was otp
14:48puredangersdegutis: see http://dev.clojure.org/display/design/Reader+Conditionals
14:49sdegutisOops got disconnected again.
14:50puredangerBronsa: on your question, I'm not sure that's generally correct. shouldn't 2 be available to be read next? I'm not sure we've talked about this case.
14:50Bronsapuredanger: with how it's currently implemented, it's impossible
14:50sdegutisTEttinger: #?@ is splicing, kind of like in macros.
14:50TEttingerah
14:50puredangersdegutis: see http://dev.clojure.org/display/design/Reader+Conditionals
14:50sdegutis,#?(:clj :foo :cljs :bar)
14:50clojurebot#<RuntimeException java.lang.RuntimeException: Conditional read not allowed>
14:51puredangerit won't work in here "at the repl" until next release
14:51puredangeryou have to invoke the reader via read-string:
14:51puredanger,(read-string {:read-cond :allow} "#?(:clj :foo :cljs :bar)")
14:51clojurebot:foo
14:52puredangerin next release, what you did will work though
14:52puredangerreader conditionals are only allowed in .cljc files, not in .clj or .cljs
14:52Bronsapuredanger: to make that work we'd have to save pending-forms in the reader
14:52puredangeryeah
14:53puredangerwe actually talked about an alternate implementation that would wrap the pbr and buffer forms instead of passing them around as we do now
14:53puredangerthat's prob a cleaner impl and could probably be used to allow this
14:53Bronsapuredanger: which might not be possible -- read just requires a j.io.pbr
14:54puredangeranyhow, I can read your case above as a valid result as it currently stands
14:54puredangerit's probably best to file it as a CLJ ticket so we can discuss and decide there?
14:55sdegutis,(read-string {:read-cond :allow} "(+ #?@(:clj [1 2 3] :cljs [4 5 6]))")
14:55clojurebot(+ 1 2 3)
14:56sdegutis/cc TEttinger
14:56TEttingeraaaah
14:56TEttingernice
14:58sdegutisI'm not sure I see a point to that tbh.
14:58puredangerthe splicing one comes in handy in ns macros to splice in different libs for clj vs cljs
14:59sdegutisOoh.
15:01sdegutisI'm approaching Clojure web apps in a new way now, where the Clojure part is just a microservice that offers an EDN-based API, and ClojureScript handles most of the heavy lifting.
15:03sdegutisIn this approach, Nginx serves a static HTML file for all routes that don't start with "/api/", and this static HTML file references the ClojureScript file (served via CDN), which then handles all the routing via Reagent, and pings the backend via /api/* routes.
15:03sdegutisBut this relies heavily on features of Nginx for the sake of speed, e.g. minimal delay between client's request and server's response, and thus it's not really an isolated application.
15:03Bronsa,(def a (java.io.PushbackReader. (java.io.StringReader. "#?(:clj [1 2])")))
15:04clojurebot#'sandbox/a
15:04Bronsa,(read a)
15:04clojurebot#error{:cause "Conditional read not allowed", :via [{:type java.lang.RuntimeException, :message "Conditional read not allowed", :at [clojure.lang.Util runtimeException "Util.java" 221]}], :trace [[clojure.lang.Util runtimeException "Util.java" 221] [clojure.lang.LispReader$ConditionalReader checkConditionalAllowed "LispReader.java" 1412] [clojure.lang.LispReader$ConditionalReader invoke "LispReade...
15:04Bronsa,(read a)
15:04clojurebot(:clj [1 2])
15:04sdegutisThat's why I'm looking into Docker/Vagrant/etc... but I'm wondering, maybe this isn't the best way to handle this?
15:04Bronsa:P
15:04pmonkssdegutis: have you considered OSv?
15:04pmonksThere are some Clojure examples out there (e.g. Reimmann)
15:05pmonkshttp://osv.io/
15:05pmonkshttps://github.com/cloudius-systems/osv/wiki/Porting-Clojure-applications-to-OSv
15:05pmonksNote: assumes you have a hypervisor to run on (AWS or whatever).
15:06pmonksI also did a little Clojure webapp on Heroku a while back. That was a reasonably nice experience.
15:08sdegutispmonks: thanks I'll look at that
15:08sdegutisBronsa: why did that work the second time??
15:08lazybotsdegutis: Uh, no. Why would you even ask?
15:09pmonkssdegutis: np note that OSv is still a beta, so ymmv...
15:09pmonksI'll admit to being a bit of a gushy fanboi about it though. ;-)
15:10Bronsasdegutis: it didn't really
15:11Bronsasdegutis: it returned an exception the first time and a wrong result the second time b/c only part of the input had been consumed
15:12lemonodorsdegutis: correct, no nginx, just an uberwar running in tomcat
15:12sdegutispmonks: that is valuable information and gives me perspective on your comments, thanks
15:12Bronsapuredanger: maybe it should be better to consume the coll before throwing an exception in that case?
15:12sdegutisBronsa: ahhhh
15:12sdegutisBronsa: mutation!
15:12sdegutislemonodor: sounds kind of convenient but also slow to serve static assets
15:13lemonodoryes, this is for an API with no real static resources
15:13sdegutislemonodor: great, thanks
15:39sveriHi, using clojures multimethod can I do a dispatch on either or something? maybe something like: (defmethod foo (or :varchar :char) [arg]....?
15:40amalloysveri: no, but the body of a defmethod can just call some other function. or you can use namespaced keywords and derive them
15:40tbaldrid_sveri: look at heirarchies: http://clojure.org/multimethods
15:40tbaldrid_can possibly do what you want
15:41sdegutisIs a Jetty/ring app actually really slow to serve assets?
15:42sveritbaldrid_: thanks, I play around with that approach
16:03bacon1989sveri: what're suggesting seems like a problem I ran into
16:03bacon1989I ended up using core.match with a seq
16:05bacon1989Here's an example. It's a bit messy, but you can pattern match to specific sequences. In your case, you would treat the arguments as a sequence.
16:05bacon1989https://github.com/benzap/baconbot/blob/master/src/baconbot/games/rpg/core.clj#L26
16:05bacon1989come to think of it, I wouldn't consider it for what you're doing
16:27szatzis it possible to use an instance of a record as a key in a map? when i'm trying, it's using the keys of the record as the keys for the map.
16:30lawandandIs there any plan to implement clojure in some lisp dialect?
16:30puredangerszatz: yes
16:31puredangerlawandand: one of Rich's early precursors of Clojure was written in CL
16:31puredangerhttp://jfli.sourceforge.net/ I think
16:32puredangerbut there are no plans to implement Clojure as it currently stands in a Lisp platform
16:32szatzpuredanger: aha, just figured it out. thanks for the confirmation!
16:32lawandandPerhaps immutability is a barrier, but racket also use a little of it
16:34lawandandjust out of curiosity, do people use java libraries with clojure or that is not very typical
16:35bacon1989lawandand: all the time
16:35szatzlawandand: i know that i do quite a bit.
16:35bensulawandand: many useful libraries are wrappers around java
16:35bensuhttps://github.com/dakrone/clj-http
16:36lawandandpeople in common-lisp are developing their own libraries for example there are many for http, I wonder if using java is a confortable zone to stagnate
16:38lawandandif you have many libraries at your disposal then is seducing to create your own, except if you have the NIH syndromme
16:38mengulawandand: that is the main reason of building clojure on top of jvm
16:39menguseamless java integration, access to thousands of ready-made libraries
16:39lawandandI can understand that java integration is a good selling point, but many programmers love to do thing from scratch
16:40lawandandlisp heart was begin with a list and conquer the universe (poetical license taken)
16:40amalloyam i doing something stupid here with compojure? https://www.refheap.com/e9cf75c476b3044efa9210a8d - if i include the handler (GET "/hello" [text] nil), or indeed any GET, then all requests to my server print this error message. if i just put in (constantly (response "ok")) it works fine, so it kinda has to be something wrong with how GET is working
16:41amalloyand i could swear it worked yesterday. i'm thinking it looks some dependency version mismatch or something, but i haven't changed those
16:42lawandandI don't know about compojure, can't help, I find ruby sinatra easy for playing.
16:44lawandandI learned a little clojure with Mark Wolkman article, I think it was a very good way of learning the basic of clojure
16:44patchworkamalloy: https://github.com/caribou/polaris (routes as data, not macros)
16:45amalloyi am not asking what other crazy framework to switch to, i am seeing if anyone knows why this simple example is broken even though i've written a dozen compojure servers just like it
16:45lawandandthe code for 4clojure was somewhere around to play with
16:45amalloylawandand: i know, i wrote it :P
16:45mavbozoamalloy, route path should be "/hello/:text" ?
16:46lawandandSome years ago I spent a lot of time playing with 4clojure, noughty boys
16:46Jekferrociao
16:46amalloymavbozo: no, the way it is now it's a query-param instead of a route-param
16:47lawandandit is supposed that compjure is so easy to use that you don't need a lot of documentation, but I prefer to h ave a lot of docs around, just in case something doesn't work
16:47amalloybut it doesn't matter, i can make it (GET "/foo" [] nil) and get the same behavior
16:47ircxyamalloy: with a nil handler I get 404
16:48amalloyyeah, i'd love to get a 404, because then stuff would be working
16:48lawandandamalloy: test the port is not broken
16:49lawandandperhaps the server is using a different port and so yoiu don't get traffic
16:49amalloywhat would a broken port even mean? curl causes my app to print stacktraces, the server is obviously on that port
16:50amalloysorry, i guess i am being kinda grumpy. you are trying to help, and i should appreciate it
16:50lawandandok, so the problem is somewhere else, perhaps the stacktraces can tell something
16:51amalloyyes, i pasted the stacktrace awhile ago
16:51amalloyhttps://www.refheap.com/e9cf75c476b3044efa9210a8d
16:52scottjamalloy: sorry to pile on random suggestions, but maybe you can write a minimal request map and pass that the router or handler (sorry I haven't used compojure in a long time)
16:52TimMclein clean, rm -rf ~/.m2/repository, and say three Hail Marys. :-P
16:52amalloyi did try lein clean, and turning off aot
16:52amalloybecause i have run into stupid stuff like this from stale classfiles before
16:53scottjright now we don't see the request map that's causing that clout error
16:53amalloyscottj: the req map is https://www.refheap.com/877c5be44427cd2865916b384
16:53amalloywhich seemed pretty reasonable to me
16:55lawandandI can't help, don't know about compojure, the stacktraces mention someting about clojure.core/-cache-protocol-fn
17:08TimMcamalloy: When you figure this out you'd better tell us 'cause the suspense is killing me.
17:08patchworkI bet it is something dumb
17:09amalloyTimMc: i have bad news in that regard. it mysteriously started working and i can't figure out what i changed
17:09TimMcnoooooo
17:09TimMcSomething *really* dumb, like being in the wrong directory then. :-P
17:09amalloyno, this is all in the same swank session
17:09TimMcoy
17:12mavbozothere'a github issue with the same error https://github.com/weavejester/compojure/issues/135
17:12mavbozoNo implementation of method: :route-matches of protocol: #'clout.core/Route found for class: clojure.lang.PersistentArrayMap
17:14amalloyi wonder if it is related to aot after all
17:18amalloyaha. TimMc: figured it out. it is another dang issue with clojure.tools.macro/macrolet. i guess that thing is more trouble than it's worth to keep trying to use
17:18mavbozowhat does it do?
17:19amalloymy route was inside of a (macrolet ... (routes (GET ...))), and the macroexpander in macrolet breaks the expansion of GET (probably replacing a record with a plain map, even though really you shouldn't be embedding record literals in code IMO)
17:21TimMcoof
17:21mavbozobut sometimes it works, sometimes it breaks. why?
17:21TimMcNot dumb, but not satisfying.
17:21TimMcI demand better bugs!
17:22TimMcsuch as this one: http://calicat.tripod.com/gif/giant.jpg
17:22amalloymavbozo: because i had gotten rid of the macrolet at some point, once i commented out the actual handler that was using it, and replaced it with the dummy handler that just returns nil
17:22winkTIL tripod is alive
17:27xemdetiait's getting all that sweet geocities traffic
17:27mavbozo1 more bug squashed today
17:29pmonks(inc wink)
17:29lazybot⇒ 3
17:29pmonks(inc rhymes)
17:29lazybot⇒ 1
17:40sveriWhy does (into (sorted-map) (partition 2 [:1 2 :3 4])) not work, but (into (sorted-map) [[:1 2] [:3 4]]) works?
17:41amalloybecause [1 2] is a vector, and (1 2) is not a vector, and maps only want to conj vectors
17:41amalloybut like, don't use into/partition to put stuff into a map. if you already have an interleaved vector, just (apply assoc (sorted-map) ...)
17:43sveriamalloy: thanks, that works :-)
17:43amalloysveri: also, the keyword :1 is super duper suspicious
17:43amalloyyou probably just want 1 as your map key, not :1
17:43sveriamalloy: this was just an example to try things out in the repl
17:43sveriI never had a :1 in real code ;-)
17:52calvinfroedgeI want to call an API until I hit a rate limit. My approach to this is mapping a function to an infinite range and then doseq until a condition exists. My problem with this is that there doesn't seem to be a way to break out of a doseq. Is there a better alternative?
17:53calvinfroedgeI want to use a lazy sequence so that I only need to keep 1 item in memory at a time. My understanding of doing this recursively would be that the entire call stack would stay in memory (is that incorrect)?
17:56amalloy(doseq [x xs :while (keep-going x)] ...)
17:56calvinfroedgeamalloy: Thanks!
17:59thearthuranyone know if you can tell leiningen to use some directory other than ~/.lein/profiles to get it's profiles (or another location for all of ~/.lein)?
18:00amalloythearthur: ~/.lein is hardcoded in a number of places in lein source, it seems to me from a quick grep. so probably not
18:00lemonodorcalvinfroedge: you could also use reduce for that, i think. use (reduced …) to break out, or just pass along information about the last attempt to the next attempt. e.g. you could do exponential backoff for a few tries, and break out after some limit is hit
18:01amalloyoh, no, i take it back
18:01amalloythearthur: you can set the environment var LEIN_HOME
18:01amalloyand that's used instead of .lein
18:02calvinfroedgelemonodor: Definitely seems like doseq :while is much simpler, but thanks for another option = )
18:03thearthuramalloy: LEIN_HOME works :) yay
18:13kaiyinanyone care to have a look at this? http://stackoverflow.com/questions/29661828/classcastexception-when-filtering-a-set-by-another-set
18:16amalloykaiyin: you mistyped the definition of character
18:16amalloyshould read :items, not :itmes
18:16spiedenya
18:16sritchietypo
18:17mavbozokaiyin, first argument for filter must be predicate-function
18:17amalloymavbozo: sets are functions, and the code is intending to pass a set there
18:17amalloybut because of the typo i mentioned, it's a list instead
18:18sritchie,(conj nil 0)
18:18clojurebot(0)
18:18mavbozoamalloy, ah, my mistake
18:18mavbozokaiyin, sorry
18:19kaiyingot it, thanks!
18:19kaiyinmavbozo: no problems at all.
19:05zanesDid someone integrate Herbert schemas with core.match?
19:06zanesAm I imagining things?
19:10zanes(Not quite sure what such an integration would look like.)
19:23irctchello, I need help with regex + permutation
19:24irctccan anyone tell me how would you implement such function: (magic-func "+---++---+" "KEY") -> ["+KEY++---+" "+---++KEY+"]
19:24irctcclojure.string/replace-first only gets me the first item
19:29oddcully,(re-seq #"\+---\+" "+---++---+")
19:29clojurebot("+---+" "+---+")
19:57timvishe_,(clojure.string/replace "---" "KEY")
19:58clojurebot#error{:cause "Wrong number of args (2) passed to: string/replace", :via [{:type clojure.lang.ArityException, :message "Wrong number of args (2) passed to: string/replace", :at [clojure.lang.AFn throwArity "AFn.java" 429]}], :trace [[clojure.lang.AFn throwArity "AFn.java" 429] [clojure.lang.AFn invoke "AFn.java" 36] [sandbox$eval25 invoke "NO_SOURCE_FILE" 0] [clojure.lang.Compiler eval "Compiler.j...
19:58timvishe_,(clojure.string/replace "+---++---+" "---" "KEY")
19:58clojurebot"+KEY++KEY+"
19:58timvishe_irctc: ↑
19:58timvishe_oh. Bai Bai! ^_^ :)
19:58timvishe_hmm... redundant emoji...
21:34stephens_hi i was wondering if i could get some help
21:34stephens_i want to hit an API from within my clojure code
21:35stephens_im very new to clojure, and have come from python, and i was wondering if there was anything like the requests library in python for clojure?
21:45mgaare_stephens_: look at http-kit
21:49stephens_great, thanks mgaare
22:12justin_smithcfleming: did you see this SO question? it might be something you could help with http://stackoverflow.com/questions/29661440/intellij-double-click-to-not-treat-hyphen-as-word-separator
22:12TEttingeruh oh, does intelliJ use \w for word separation?
22:13justin_smithOne would think you could override the word rules
22:13cflemingjustin_smith: Thanks. I don't know the answer but I'll see if I can find it
22:13TEttinger,(re-find #"\w+" "ÁÁÁÁaaa")
22:13justin_smithwho know, you may need to implement the answer :)
22:14clojurebot"aaa"
22:14justin_smith*knows
22:16cflemingjustin_smith: Yep, looks like I will. There's actually already an issue open for this I think
22:17justin_smithalso, maybe see you at clojure/west?
22:17cflemingI'm counting on it!
22:17cflemingI'll be too jetlagged to be going to the concert you were suggesting though.
22:18justin_smithfair enough
22:21cflemingI should probably watch some set of SO tags I guess, I never check it much
22:21justin_smithyeah, it's an era when people are more likely to mention their software problems on twitter or stack overflow than they are to bring them up with the developers of the app
22:22cflemingKids these days
22:23cflemingI've got to say, I hate twitter for most forms of support. I mean, it's generally pretty immediate, but for anything other than really simple queries it's a PITA
22:23justin_smithyeah
22:25amalloy@cfleming tweet longer than 140 chars :((((
22:25cflemingamalloy: 1. I end up writing
22:25cflemingamalloy: 2. lots of answers like
22:26cflemingamalloy: 3. this. It drives me
22:26cflemingamalloy: 4. nuts.
23:05xphillyxIs earmuff notation accepted or generally frowned upon in Clojure?
23:05justin_smithxphillyx: it's expected for dynamic vars
23:06justin_smith,*clojure-version*
23:06clojurebot{:major 1, :minor 7, :incremental 0, :qualifier "master", :interim true}
23:06justin_smith,*out*
23:06clojurebot#object[java.io.StringWriter 0x3fcdb5a1 ""]
23:06justin_smithfunny enough, *clojure-version* isn't even dynamic (I mean why would it be...)
23:07xphillyxAwesome thanks.
23:07justin_smith,(apropos "^\*.*\*$")
23:07clojurebot#<RuntimeException java.lang.RuntimeException: Unsupported escape character: \*>
23:07justin_smithergh
23:07justin_smith,(apropos #"^\*.*\*$")
23:07clojurebot(clojure.core/*agent* clojure.core/*allow-unresolved-vars* clojure.core/*assert* clojure.core/*clojure-version* clojure.core/*command-line-args* ...)
23:07justin_smith^ fun clojure trick
23:07xphillyxoh thats nifty.
23:08xphillyxYay regex.
23:08justin_smithnow I'm trying to remember if there's something like apropos that also looks at doc strings
23:08Bruce_Waynehas anyone used [cemerick.url :refer [url-encode
23:08Bruce_Wayne url-decode]
23:08justin_smith,(apropos "doc")
23:08clojurebot(clojure.core/my-doc clojure.repl/doc clojure.repl/find-doc)
23:09justin_smithooooo
23:09justin_smith,(find-doc "number")
23:09clojurebot-------------------------\nclojure.core/*print-length*\n *print-length* controls how many items of each collection the\n printer will print. If it is bound to logical false, there is no\n limit. Otherwise, it must be bound to an integer indicating the maximum\n number of items of each collection to print. If a collection contains\n more items, the printer will print items up to the limit foll...
23:09justin_smiththat's hella useful
23:09Bruce_Wayneanyone able to help with url encoding?
23:09justin_smithBruce_Wayne: you can go ahead and ask your specific question
23:10Bruce_WayneI am trying to encode params in a url useable way
23:10Bruce_Wayneaka not including special symbols
23:10Bruce_Waynethought I could use the [cemerick.url :refer [url-encode url-decode] library
23:11Bruce_Waynebut when i pass it a string it seems to not work
23:11justin_smithBruce_Wayne: what does it do? I'm looking at the source and it should work
23:12Bruce_Waynenot sure, I’m working in a complex system and I can’t see it’s output
23:12xphillyxBruce_Wayne: Have you tried the built in Java encoder? http://docs.oracle.com/javase/7/docs/api/java/net/URLEncoder.html
23:12justin_smithxphillyx: that's what cemerick's lib is using
23:12justin_smithit's a very thin wrapper
23:12justin_smithhttps://github.com/cemerick/url/blob/master/src/cemerick/url.cljx#L9
23:12Bruce_Wayneinteresting
23:12xphillyxAh, I didn't peek into the source.
23:13Bruce_WayneI’m just not sure why it won’t pass the params
23:13justin_smiththe function is just a single interop call (well two, one for clj, one for cljs)
23:13Bruce_Waynelooks like it’s encoding right
23:13Bruce_Waynejust a problem with reading the url on the other side
23:13justin_smithBruce_Wayne: url-encode is for taking a single param, and making a form that is safe to use inside a query parameter
23:14Bruce_Waynewill work a bit an check in with futhure questions
23:14Bruce_Waynejust wanted to make sure I wasn’ crazy
23:14justin_smithurl-encode is not for building your entire query-string with - you can piece that together with & and = and your various keys
23:15justin_smithBruce_Wayne: you might want to use map->query if you want it to build the whole query string though
23:15Bruce_Waynethank you!
23:17Bruce_WayneI am also using the reagent framework
23:17Bruce_Waynebut when the url is formated like this:
23:17Bruce_Waynehttp://localhost:8020/#/users/create-vendor-rep/003i000001OKpSrAAL/Dave_0Bodet/Sysco_0TBD/enter_password
23:17Bruce_Wayneit works
23:17Bruce_Waynebut like this:
23:18Bruce_Waynehttp://localhost:8020/#/users/create-vendor-rep/003i000001N8JsaAAF/Dennis%20Dougherty/US%20Foods/enter_password
23:18Bruce_Wayneit doesn’t work
23:18Bruce_Wayneideas?
23:18Bruce_Waynethe latter url gives a not found error
23:19justin_smithBruce_Wayne: that's not a query string, that is a really weird anchor
23:19Bruce_Waynei am passing the params attached to the end of the url
23:20Bruce_Wayneand destructuring the url based on the “/"
23:20Bruce_WayneI’m not building a query string
23:20justin_smithwhy not use real query syntax?
23:21justin_smith,(java.net.URLEncoder/encode "/users/create-vendor-rep/003i000001N8JsaAAF/Dennis%20Dougherty/US%20Foods/enter_password")
23:21clojurebot"%2Fusers%2Fcreate-vendor-rep%2F003i000001N8JsaAAF%2FDennis%2520Dougherty%2FUS%2520Foods%2Fenter_password"
23:22Bruce_Wayne?
23:22Bruce_Waynewhat i sent is already the encoded url….
23:22justin_smiththat's what a proper encoding of that monstrosity looks like, but I still thing using real query parameters is a better idea
23:22justin_smithBruce_Wayne: that's not encoded
23:22Bruce_Waynethe params are encoded
23:22Bruce_Wayneeach individual param
23:22Bruce_Waynethe struggle isn’t with the url
23:22justin_smithby what encoding? it's not URLEncoding
23:22Bruce_Wayneit’s with the params
23:22Bruce_Wayneyes it is haha
23:22Bruce_Waynegiven each param to the url encoder
23:23Bruce_Wayne(java.net.URLEncoder/encode “Dennis Dougherty”)
23:23justin_smithOK, but the fact that you are putting them together with / is what breaks it
23:23Bruce_Waynewhy does that break it
23:23Bruce_Wayneand why does the first url work then?
23:23justin_smithbecause URLs have rules
23:23Bruce_Wayneso why does the first one work and the second one doesn’t?
23:23xphillyx"this isnt nam smokey, there are rules!"
23:24justin_smithwhy invent your own idiosyncratic way of specifying parameters when there is already a system defined for specifying parameters with a request?
23:24justin_smithBruce_Wayne: because they are both broken and one accidentally worked
23:24Bruce_Waynejustin_smith: then all of them accidently work that way
23:25xphillyxDo you have any working URLs with spaces in the names?
23:25Bruce_Wayneyes
23:25justin_smithBruce_Wayne: most of the time if you walk into a random street without looking both ways you won't die. Just because something didn't fail once doesn't mean you were doing it properly.
23:26Bruce_Waynebasically the problem was special characters in the params
23:26Bruce_Waynewhich are being passed as extensions to the url
23:26Bruce_Waynewhether right or wrong
23:26Bruce_Waynecars on the street or no cars on the street
23:26justin_smithBruce_Wayne: why not use real query parameters and not your weird invented version?
23:27Bruce_Waynebecause the way I did it fits in nicely with reagent framework
23:27Bruce_Waynewhen i use these methods:
23:27Bruce_Waynehttps://gist.github.com/jtackett/962cddfb89e0b4fe9327
23:28Bruce_Wayneto take the special characters out of the params that I am passing
23:28justin_smithOK, you know what my opinion is. Good luck.
23:29xphillyxIs Joy of Clojure considered a good resource for learning idiomatic Clojure?
23:29justin_smithxphillyx: definitely, if you can follow it. It isn't a slow moving text.
23:29Bruce_Wayneoh that’s interesting, i think we have reached the limit to justin smith’s knowledge
23:30Bruce_Wayneif someone would be so kind as to actually explain why one url works and the other doesn’t that would be awesome
23:30justin_smithBruce_Wayne: if preferring real query parameters, as defined in the http spec, to bizarre nonstandard hacks makes me ignorant, I'm proud to be stupid.
23:31Bruce_Waynemaybe they could actually cite some of the rules the second url breaks rather than making car references
23:31justin_smithBruce_Wayne: for one, it isn't a query parameter
23:31justin_smithlike I said, it's an http anchor
23:31Bruce_Waynecould you just answer my specific question which you asked me to ask
23:32justin_smithno, I'll just accept being stupid instead
23:32Bruce_Wayneso you don’t know the answer?
23:34Bruce_Waynealso just because I am doing something different than the http spec protocol doesn’t make it wrong
23:34Bruce_WayneJob’s built a personal computer that was completely against the protocol…didn’t make him wrong either
23:35xphillyx… what?
23:35justin_smithyou are using the string as part of a http request string - as an achor tag in the URI. This means that you need to follow the rules for URIs. If you use query parameters properly, this problem can easily be avoided.
23:35justin_smithand I'm being grumpy and unhelpful, which means I need a break. See you all later, sorry.
23:46justin_smithBruce_Wayne: OK, everything following # in a URL is called a "fragment identifier", they are meant to look up named anchors within a page. This SO answer describes the valid characters in a fragment identifier: http://stackoverflow.com/a/2849800/2258453
23:47Bruce_Wayneawesome
23:47Bruce_Waynethank you for the straight answer
23:48justin_smithin particular, a "?" is going to introduce the end of a fragment, and everything after it will be treated as query params
23:49justin_smithhttp://tools.ietf.org/html/rfc3986#section-3.5 "The characters slash ("/") and question mark ("?") are allowed to represent data within the fragment identifier. Beware that some older, erroneous implementations may not handle this data correctly when it is used as the base URI for relative references (Section 5.1)."
23:50Bruce_Wayneso maybe a % sign isn’t allowed either?
23:51justin_smithit's allowed as part of an escape string
23:51justin_smith%dd where d are digits
23:51justin_smith*hex
23:51Guest76337(+ 1 1)
23:51clojurebot2
23:52TEttingerhuh, clojurebot normally needs , before it can eval
23:52TEttinger(+ 1 2 3)
23:52clojurebot*suffusion of yellow*
23:52justin_smithTEttinger: it's a special case :)
23:53justin_smith(#'+ Double/NaN Double/NaN)
23:54TEttinger,(== Double/NaN Double/NaN)
23:54clojurebotfalse
23:55Guest76337batman, are you building a REST api?
23:55TEttinger,(let [nana Double/NaN] (== nana nana))
23:55clojurebotfalse
23:55TEttinger,(let [nana Double/NaN] (= nana nana))
23:55clojurebotfalse
23:55arrdemnans are never equal yo
23:55TEttinger,(let [nana (identity Double/NaN)] (= nana nana))
23:55clojurebottrue
23:55arrdem##(* -1 Double/NaN)
23:55lazybot⇒ NaN
23:56TEttingerarrdem, you sure about that?
23:56TEttinger,(let [nana (identity Double/NaN)] [ (= nana nana) (== nana nana)])
23:56clojurebot[true false]
23:57arrdemthat's awful but I feel like we've been over this before
23:57TEttingerobject identity will make two NaNs returned by the same call equal, even if they are numerically non-equal
23:57TEttingeryep
23:57TEttingerI hadn't checked for == before
23:58TEttingerNaN is like the worst corner case possible wherever it shows up