#clojure logs

2016-01-25

02:06amalloydomokato: you need a function like (include-range existing-range-list new-range), and then you just reduce that over the input sequence like justin_smith was saying
02:07amalloywow apparently that was several hours ago though. i bet you figured it out by now
02:56MONODAFound out what the issue was
02:57MONODAI had some weirdness in my emacs init
02:57MONODAThat was causing the cider-refresh function to be remapped
02:57MONODAI dont know why the issue didnt appear before though
03:43lxsameerIs it logical to store the current leader of cluster in an atom ?
04:15vkngpmhc1
04:27arcatan1
04:49loophole2?
05:01qsyswell, 3?
05:02algernon42, clearly
05:03ridcullyno the next number is 5
05:05algernonbut 42 is the ultimate answer
05:33lxsameerhow can i add a java package to my project ?
05:33MasseRAdd it to project.clj?
05:34lxsameerhow ?
05:34lxsameerMasseR, same as clojure packages?
05:34MasseRYes
05:34MasseRlein is just a wrapper over maven
05:35poweredlxsameer, does this answer your question: http://stackoverflow.com/q/2404426
05:35MasseRhttp://search.maven.org/#artifactdetails|org.apache.commons|commons-jci|1.1|jar lxsameer for example
05:35MasseRCheck the 'leiningen' tab
05:35lxsameerthanks folks
06:14noncomis there any core function to transform values of a {}? i know i can use reduce, but just wonder if there's anything inbuilt.. or if there's none, then how would you do that?
06:14noncomfor examply, i do a (group-by) and want to transorm the []s in the values into their counts
06:15luma(defn map-values [f m] (into (empty m) (for [[k v] m] [k (f v))))
06:15lumathis what you mean?
06:15noncomyeah, like that
06:16noncomas i see, your solution is a bit different, but much of the similar idea
06:17noncomofcourse, there's probably no other way to even organize that, but no inbuilt function there is
06:18lumano, nothing inbuilt
06:18lxsameerguys, my app would have a web interface using ring/compojure and and other daemon like process to do lots of background jobs, how can i handle both in one project ?
06:24schmirlxsameer: I'm using chime to run background jobs in a cron-like fashion
06:26schmirI just call chime/chime-at before starting the HTTP server
06:26lxsameerschmir, hmmm I kinda have a event loop, and the web section should be a side thread
06:26lxsameerschmir, can i see your code ? is it opensource ?
06:30schmirit's really just (do (chime/chime-at ...) (httpkit/run-server ...))
06:31schmirdo you need to know how to start that "side thread"?
06:38lxsameerschmir, hmm so you use httpkit directly , but what if i use something like nginx
06:39yunfanschmir: interesting, i just met the author at 2013
06:41schmirlxsameer: what does use nginx mean here? nginx like in nginx-clojure? nginx as proxy?
06:56lxsameerschmir, nginx it self
06:59loopholelxsameer: build rpm/deb packages with dependencies to nginx?
07:00lxsameerloophole, no, I'm using nginx in my server and what if i want to use clojure to server my web section
07:03schmirlxsameer: I guess you need to configure nginx as a HTTP proxy then. I'm not even sure what you're problem is. that now looks quite different from your original question.
07:06lxsameerschmir, thanks man
07:10yunfanlxsameer: or configure a haproxy which use your clojure service as the backend
07:21lxsameeryunfan, that seems fun
07:29yunfanlxsameer: why its fun?
07:32lxsameeryunfan, by fun i meant interesting
07:33yunfanlxsameer: okay, sorry for misunderstanding, english is not my native
07:33lxsameeryunfan, me to buddy
07:34yunfanlxsameer: where are you from?
07:34lxsameeryunfan, unfortunately Iran
07:34yunfanlxsameer: lol i come from china. we are all in the same hell
07:35lxsameeryunfan, exactly
07:35yunfanlxsameer: but iran recently just release the banning for youtube, this made us the last country
07:36lxsameeryunfan, no that was temporary buddy, our filternet is the worst
07:37yunfanlxsameer: really? i thought we are the worst, can you reach google/facebook/twitter or even linode?
07:38lxsameeryunfan, only google, but they do man in middle to sniff traffic with fake ssl cert
07:38qsyswell, have visited both Iran and China, and I though China was worse...
07:39yunfanlxsameer: then you are better than us
07:39yunfanlxsameer: and sorry that chinese goverment has export that filternet to your goverment
07:39lxsameeryunfan, :)) thanks man, i hope i can run away from my country
07:39qsysalthough that might've been that is was easier in Iran to get around it
07:39yunfanlxsameer: if you are looking for another proxy other than vpn, you could check shadowsocks, its opensource in github
07:39lxsameerqsys, really ?
07:40lxsameeryunfan, yeah i'm using it right now
07:40yunfanqsys: yep, but we chinese are different look than iran if we go to westen country
07:41yunfanlxsameer: also a chinese tool. we are the center of evil :D
07:41lxsameeryunfan, :))
07:41qsys:)
07:42yunfanmaybe one day i should go to au, where i can still do business with my chinese fellows and enjoy the freedom at the sametime (though its not much free than usa)
11:59lokienwhat is an idiomatic way of getting this value out? [:keyword {:key value}]
12:05gfredericks,(get-in [:keyword {:key "VALUE"}] [1 :key])
12:05clojurebot"VALUE"
12:05gfredericks,(-> [:keyword {:key "VALUE"}] second :key)
12:05clojurebot"VALUE"
12:05gfredericks,(-> [:keyword {:key "VALUE"}] (get 1) :key)
12:05clojurebot"VALUE"
12:06lokiencan I destructure it?
12:07lokienI don't get map destructuring at all
12:08tolstoy,(let [[_ {:keys [key]}] [:keyword {:key "value"}]] key]
12:08clojurebot#<RuntimeException java.lang.RuntimeException: Unmatched delimiter: ]>
12:08tolstoy,(let [[_ {:keys [key]}] [:keyword {:key "value"}]] key)
12:08clojurebot"value"
12:09lokienthanks tolstoy, I'll try it
12:10tolstoyI use the [:key {:a 1 :b 2}] pattern a lot.
12:11tolstoyUsually, I destructure it as (let [[topic data] msg] ... )
12:11tolstoyThen (case topic :this-msg (do-something data) ...).
12:11tolstoydo-something is a function that destructures:
12:12tolstoy(defn do-something [{:keys [a b] :as msg}] ...)
12:12lokienwelp, it works. key in {:keys [key]} is just a name I give to the value, right?
12:13lokienyeah, it is
12:13ridcullykey there will fetch you :key from that map
12:14tolstoyThe names in :keys has to match up with actual keys in the map.
12:14ridcullysame like (let [key {:key map}]) basically
12:14tolstoyIf you want new names, there's a different destructuring form.
12:16lokien,(let [[_ {:keys [something]}] [:keyword {:key "value"}]] something)
12:16clojurebotnil
12:16lokienuh
12:17ridcullythere is no :something in that map
12:17lokienyeah, I just wanted to check
12:17tolstoy,(let [[_ {foo :key}] [:keyword {:key "value"}]] foo)
12:17clojurebot"value"
12:18tolstoyIn the above, you can bind the value of :key to the name "foo". That's how you extract out new names rather than just the keys.
12:19lokienthat's what I wanted it to be like, thank you tolstoy
12:47KamuelaIs the do operator kind of like data with a side effect of running it?
12:57mavbozo,(do (inc 1) (inc 2)))
12:57clojurebot3
12:58mavbozoKamuela, above do contains no side-effect
12:58mavbozoit just returns the result of the last expression
13:02Kamuelamavbozo: I am trying to understand do within an if, function? Form?
13:03tolstoydo evaluates its parameters, returning the value of the last one.
13:04KamuelaSo it's almost almost the equivalent of just throwing in another pair of parentheses
13:04Kamuelaif that were valid
13:04tolstoyYeah, like { ... } in other languages.
13:04loopholeKamuela: yep
13:04loophole(if (= 1 2) (do (println "WHAT?!?") :its_true) (do (println "ok") :everything_normal))
13:05KamuelaThank you all
13:13mavbozoi just recently found out that the body of a let form is implicitly wrapped in do block
13:13mavbozoso i could do this (let [a 1] (println a) a) instead of (let [a 1] (do (println a) a))
13:13tolstoySo is `when`.
13:14pilneisn't when just a macro for "if - do"
13:15tolstoyYep: https://github.com/clojure/clojure/blob/010864f8ed828f8d261807b7345f1a539c5b20df/src/clj/clojure/core.clj#L493
13:17ridcully,(macroexpand '(when true :x))
13:17clojurebot(if true (do :x))
13:17mavbozo,(doc when)
13:17clojurebot"([test & body]); Evaluates test. If logical true, evaluates body in an implicit do."
13:17mavbozo,(doc let)
13:17clojurebot"([bindings & body]); binding => binding-form init-expr Evaluates the exprs in a lexical context in which the symbols in the binding-forms are bound to their respective init-exprs or parts therein."
13:19mavbozowhen's doc states the "implicit do" while let's doc does not. that what makes me used do in let's body
13:20pilnei can see that, i just figured that for what let does, it makes sense that it is implied (and the tutorials i've read never used do inside let).
13:21mavbozowow great!, now http://clojure.org/reference/special_forms#let states the "implicit do"
13:23WorldsEndlessI need a java.lang.String[] and my clojure.lang.PersistentVector isn't cutting it. How should I get the string array?
13:23mavbozofn docs also states the "implicit do" http://clojure.org/reference/special_forms#fn
13:24loopholeWorldsEndless: (byte-array (map byte "foo bar baz"))
13:24tolstoyWorldsEndless: Maybe into-array?
13:25WorldsEndlessSo what I'm starting with is the result of string split command, but I need it a string[] for interop purposes. Reading on into-array now
13:25tolstoy,(type ["a" "b"])
13:25clojurebotclojure.lang.PersistentVector
13:25loopholeWorldsEndless: uhh i shot to fast :) you need a string
13:25tolstoy,(type (into-array ["a" "b"]))
13:25clojurebot[Ljava.lang.String;
13:26KamuelaInteresting about all these macros. Is there a list of only baser forms? Ones that form the indivisible parts of other combos?
13:27WorldsEndlessAh! into-array seems to do it . Thanks!
13:29pilneKamuela:: at the bottom here there is a list (partial?) of the built-in macros, and i'm pretty sure a macro can contain any valid function, but i'm still learning about them.
13:30justin_smithKamuela: the closest thing we have to "baser forms" is special forms, which are defined in java and not clojure itself
13:30justin_smitheverything else is defined in clojure
13:30justin_smith,(special-form? if)
13:30clojurebot#error {\n :cause "Unable to resolve symbol: special-form? in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: special-form? 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 symbo...
13:31justin_smith,(special-symbol? 'if)
13:31clojurebottrue
13:31justin_smithit fibs a bit
13:31justin_smith,(special-symbol? 'let)
13:31clojurebotfalse
13:31justin_smith,(special-symbol? 'let*)
13:31clojurebottrue
13:31justin_smithoh! it's more accurate than I remembered
13:31justin_smith,(special-symbol? 'fn)
13:31clojurebotfalse
13:32justin_smith,(special-symbol? 'fn*)
13:32clojurebottrue
13:33Howling,(+ 2 3)
13:33clojurebot5
13:33loopholeKamuela: everytime I think I need a macro I think again ;)
13:33mavbozo,(special-symbol? '+)
13:33clojurebotfalse
13:33mavbozo,(special-symbol? 'ns)
13:33clojurebotfalse
13:35justin_smithmavbozo: ever look at the source of ns? it's kind of crazy
13:35loopholejustin_smith: looks like he's gone
13:36justin_smithloophole: huh, was here when the name tab-completed I guess
13:36rcassidydoesn't clojure's let function like let* anyway? coming from scheme
13:36rcassidyor does the splat take a different meaning?
13:37rcassidy,(let [a 5 b a] b)
13:37clojurebot5
13:37justin_smithrcassidy: in clojure the trailing splat usually means "this is an implementation detail of the one without the splat"
13:37rcassidyah.
13:37justin_smithrcassidy: eg fn* for fn, let* for let, in both cases the difference is that the one without the splat has destructuring of its bindings
13:38rcassidyso it's basically like, "you probably won't need to call this version"
13:38justin_smithand the one with the splat is a special form from the java side of the code
13:38justin_smithright
13:38rcassidycool, thanks.
13:38justin_smithrcassidy: but...
13:38justin_smith,'#()
13:38clojurebot(fn* [] ())
13:38rcassidy,(fn* [] ())
13:38clojurebot#object[sandbox$eval288$fn__289 0x4b418dd0 "sandbox$eval288$fn__289@4b418dd0"]
13:38justin_smiththey can make a decent macro expansion if you know you won't be using destructuring due to the macro
13:38rcassidymakes sense!
13:39rcassidythanks :)
13:41rcassidyin scheme, bindings in a single let statement aren't bound in sequence, so you can't do (let ([a 5] [b a]) ...)
13:41rcassidythat's what let* is for :p
13:41rcassidyand letrec for recursive bindings.
13:41justin_smithright
13:41justin_smithsimilar in common lisp as well
13:45m1dnight_How can I wait in my main method for all my threads to finish?
13:45m1dnight_My main method ends instantly but in the meanwhile it fires a few threads that are actually my main program.
13:45loopholejustin_smith: this did supris me however: (let [x 2 x 3] x)
13:45justin_smithloophole: that's just shadowing though
13:46justin_smith,(let [x 2 y x x 3] [x y])
13:46clojurebot[3 2]
13:46justin_smithsee, the original value is still there
13:46loopholejustin_smith: ahh that makes sense
13:46tolstoym1dnight_: You can use a promise. (let [p (promise)] (start-threads) @p)
13:46tolstoym1dnight_: One of those threads could "deliver" to the promise to end the app.
13:46m1dnight_The thing is, the threads are a few fucntion calls away
13:47justin_smithm1dnight_: if you use futures or agents, clojure will already wait to shut down (you need (shutdown-agents) or System/exit to force actual shutdown)
13:47m1dnight_Im using bear threads :<
13:47rcassidyroar
13:47m1dnight_bare? Just java threads.
13:47justin_smithm1dnight_: then don't set them daemon
13:47justin_smithif they are not set as daemon, your main will wait for them
13:48tolstoyIs this a long running process, or a run it and die when done process?
13:48m1dnight_Odd, they are not explicitly set as daemon threads.
13:48m1dnight_Yes, it is a process that will run for years if all goes well :p
13:48m1dnight_Its my irc bot. I have a loop that listens for messages from the irc/slack server.
13:48m1dnight_I dont know why it worked in my previous version. Im rebuilding it and I just noticed this.
13:48tolstoyIn that case, I use the "promise" in the main method, then use a shutdown hook to deliver the message to break the promise.
13:48justin_smithm1dnight_: you can use the .isDaemon method to see if they have daemon status
13:50Guest44358i was at the clojure conj 2013 - and remember a talk that was about bringing systems together by using schemas. Anyone happen to know who the speaker was?
13:50justin_smithm1dnight_: anyway, if you call the .join method on the thread, that won't return until that thread finishes
13:50Guest44358it wasn't the _prismatic_ schema talk though
13:50tolstoy(.addShtudownHook (Runtime/getRuntime) (Thread. #(deliver p :release)))
13:51tolstoywhen you kill the process, that hook gets invoked.
13:51m1dnight_Daemon thread? false
13:51m1dnight_Oddly enough they are not set as daemons.
13:52m1dnight_Okay I will hold off on fixing this issue then. thread/sleep $supermanyalot will do the trick for dev atm
13:52justin_smithand they are erroneously being stopped when main exits?
13:52justin_smithm1dnight_: (.join t)
13:52Guest44358ah Jen Smith! thanks Google :)
13:53tolstoym1dnight_: Using the promise is the cleanest, but you could also start a do-nothing thread and use that machinery justin_smith is talking about.
13:53justin_smithtolstoy: I am talking about calling .join as the last line of -main, so that -main does not exit until that thread does
13:54justin_smithno need for a do-nothing thread
13:54tolstoyjustin_smith: I still like my little promise method better. Just seems so much cleaner, or at least clearer.
13:55justin_smithtolstoy: .join is very clear - it means "wait for this thread to exit"
13:55tolstoyjustin_smith: I used to solve this prob using Object.wait() and .notify().
13:55justin_smithwhich is exactly the thing we want
13:56tolstoyHow do you clean things up when you send a die signal via the OS?
13:56tolstoyAnyway, nevermind. I don't care. ;)
13:57loopholercassidy: bear threads... Now I have this picture of a rasta bear in my head
13:58justin_smithtolstoy: to be honest, I never use an OS where anything I am doing in my clojure code matters after the shutdown signal
13:59justin_smithI mean I guess if I was doing something fancier than I do now with the db or ipc, I might have to clean that up, but right now it's zookeeper, which assumes "you are gone and irrelevant" if you miss a ping, so no cleanup needed
13:59justin_smithtolstoy: but I guess I'd have to go into that rabbit hole if I ever used a resource that wouldn't cleanly be disposed of on vm death
13:59tolstoyI like the idea of starting up components (or whatever), then registering a shutdown hook that calls "stop" on them when the JVM goes down under normal circumstances.
13:59justin_smithbut that seems an entirely separate question
14:00justin_smithtolstoy: but what component actually needs that if the whole vm is going down?
14:00tolstoyMost of the time, all stop does is print out a message.
14:01justin_smithfrankly, if I had something that needed cleaned up on vm shutdown, I wouldn't trust any aspect of the vm itself to do it (I guess this might be overly cynical)
14:01loopholejustin_smith: finally :)
14:02tolstoySo you just (.join (Thread/currentThread)) at the end of your main?
14:02justin_smithtolstoy: absolutely not - he was talking about waiting for another thread - his vm was exiting too early
14:03justin_smithso I am saying if what you want is to wait for thread t to finish before normal exit, then call (.join t)
14:03justin_smithwhich is precisely what the .join method is for
14:03tolstoyBut he also said he wanted a long-running process, so I figured that what he really wanted was a way to keep the JVM from terminating. The fact that there are threads in the background was incidental.
14:04loopholeis there an advantage in using java threads vs futures?
14:04tolstoy(while try (Thread/sleep 100000)) works too, I guess (which he said he's doing).
14:05justin_smithloophole: they are slightly simpler? not much of one that I know of.
14:05loopholeI try to get by with the clojure abstractions. and so far it suites me well
14:07loopholejustin_smith: I mean there's a reason I use clojure and not java... :)
14:24TimMcjustin_smith: cassandra in particular is a DB designed to be shutdown with kill -9 -- I like that philosophy
14:24justin_smithheh, nice
14:24justin_smithTimMc: this relies on things like not running cassandra on Windows I assume...
14:24TimMcMaybe.
14:24loopholeTimMc: isn't cassandra a pure in memory database?
14:25TimMcno
14:25TimMcjustin_smith: Does Windows not have a reliable flush command?
14:25TimMcbecause i think that's the one essential thing
14:27justin_smithTimMc: I have heard tell of resource leaks on unclean shutdowns, but this could be old info about outdated versions
14:28TimMcloophole: Maybe you're thinking of HSQLDB? But that one also can be disk-backed.
14:28tolstoyWell, and we were talking at cross purposes. 1) how do you keep the JVM up for long-running servers? 2) how do you make a thread block shutdown?
14:29TimMcjustin_smith: On Cassandra? Wouldn't surprise me too much. There are some pretty bad bugs in old versions.
14:29justin_smithfor 1) I use jsvc
14:30justin_smithTimMc: with various programs on windows - where a *nix would reclaim all process resources reliably, but like I said this could be out of date info
14:30loopholeTimMc: how do they manage to catch sigkill? just curious
14:30justin_smithand I guess there are things like shm that even on a *nix you can't reliably reclaim automatically
14:30justin_smithloophole: I think the point is they don't catch it - the app is written so that an unclean kill won't hurt anything
14:33TimMcYeah, you can just *remove* the Cassandra process, and when you start it next time, it recovers from journals.
14:33tolstoyloophole: java.lang.Runtime/addShutdownHook lets you invoke methods on JVM shutdown.
14:34TimMcI regard this sort of thing as baseline functionality. My laptop runs out of battery all the time -- *everything* should work this way.
14:34loopholejustin_smith: ahh thats interesting. that makes it quite challenging to perform a write on disk. the only possible way i can think of is to write it in a temporary file and then perform a copy operation
14:34TimMctolstoy: Won't help with kill -9 :-)
14:34tolstoyloophole: Works for sigs outside of kill -9, anyway.
14:34loopholetolstoy: not a sigkill. sigkill
14:34loopholetolstoy: :)
14:34tolstoyNo, that's right.
14:34TimMchttps://www.youtube.com/watch?v=Fow7iUaKrq4
14:35tolstoyI figure if you're using kill -9 to kill something, it's stuck anyway.
14:35TimMc(content warning: overly nerdy rap)
14:35loopholetolstoy: or a script hacked by an admin that just wants to be sure...
14:35justin_smithtolstoy: it could be using too much ram, it could be trying to use a disk that is full...
14:36TimMcIf you kill Cassandra it a normal way it does a little cleanup so that startup can be fast.
14:36justin_smithor that even
14:39tolstoyYeah. In other words, under normal circumstances (re-starting after an upgrade), you can run a hook to clean things up (if you want), but under circumstances where kill -9 is necessary, you already have bigger problems.
14:41tolstoyAnyway, I like to call "stop" on all my components, necessary or not. It just feels good. ;)
14:41loopholetolstoy: jep I was just curious how its done since TimMc wrote < TimMc> justin_smith: cassandra in particular is a DB designed to be shutdown with kill -9
14:41justin_smithloophole: multi-step writes
14:42justin_smithloophole: any reliable db needs to be doing multi-step writes anyway
14:43loopholejustin_smith: so my guess "write to a temporary file" was not to far off
14:43justin_smithloophole: idea being that you don't commit until the full transaction is done, and any state that isn't fully transacted is still a valid state
14:43justin_smithloophole: it's a very fancy version of that, yes :)
14:44loopholejustin_smith: :)
14:45loopholejustin_smith: who needs fancy anyway
14:45loophole:)
14:47loopholejustin_smith: but this means that it is not an extraordinary feature when it comes to databases. that's what every mature database should do anyways
14:47justin_smithloophole: https://en.wikipedia.org/wiki/Two-phase_commit_protocol
14:47loopholejustin_smith: thx
14:48justin_smithloophole: well, you'd be surprised about mongo (or not)
14:48loopholejustin_smith: i played around with it. so... no ;)
14:48justin_smithit's the old CAP thing
14:49justin_smithcassandra seems to go for C while mongo for A
14:49justin_smithwait, does mongo even do A? it might just be P and throw hands in the air about AC, I forget.
14:50matthavenerafaik, mongo does leader election for single writer (some C, no A), and cassandra can do A since its a dynamo style DB
14:51TimMc"some C", yes...
14:51justin_smithhaha
14:51matthavenerfor a given definition of 'consistent' :)
14:52matthaveneras usual, aphyr has some interesting writings on all those definitions. this pic is a rabbit hole in itself https://aphyr.com/data/posts/313/family-tree.jpg
14:52loopholejustin_smith: any ideas regarding orientdb? I want to use it as a basis for my next OS project.
14:52justin_smithloophole: I looked into it very briefly, didn't use it in anger
14:52justin_smithmatthavener: nice!
14:54loopholejustin_smith: ok. needs a (working) clojure binding. maybe I will do it
14:55loopholejustin_smith: just want to know if it's worth the hassle
14:55justin_smithloophole: cool, I still have some open questions about databases due to the demands of the project I am working on
14:55justin_smithloophole: sorry I don't have more info
14:58loopholejustin_smith: It was worth a try :)
15:41loopholejustin_smith: still around?
15:45loopholei need an opinion. i'm playing around with a graphdb that uses an sql dialect. my aproach to it looks like this:
15:45justin_smithyo
15:45loophole(select [:name :birthday] ($from :persons) ($where ($= :name "hans")))
15:46loopholewhich then is converted to a string "select name,birthday from persons where name = 'hans'"
15:46loopholequite straight forward
15:46loopholeevery operator ($x... ) is by itself a funktion
15:47justin_smithOK
15:48justin_smithso is this your own DSL over sql?
15:48loopholejustin yes. its not really sql its the orientdb dialect
15:48justin_smithaha
15:49justin_smithloophole: I'd do two layers - one that is a straightforward adaptor, then another layer that does the dsl
15:49justin_smithI think syntax magic should be a thing one can opt out of
15:51loopholethere is no magic at all; you just do (query (select ....)) or (query "select ...")
15:51loopholejustin_smith: there is no magic at all; you just do (query (select ....)) or (query "select ...")
15:51justin_smithOK - so it will just be a string generating function?
15:52loopholejustin_smith: yes. to easy term building and prevent type errors
15:52loopholejustin_smith: s/easy/ease/
15:53justin_smiths/easy/ease/ is my favorite sed based gansta rapper
15:53loopholejustin_smith: a very thin layer
15:54loophole(select [:name :birthday]
15:54loophole ($let [:$foo (select [:foo] ($from :baz))
15:55loophole ($from :persons)
15:55loophole ($where ($= :$foo "hans"))))
15:55loopholeturns to "select name,birthday let $foo =( select foo from baz ) from persons where $foo = 'hans'"
15:57loopholejustin_smith: this way it's super easy to unit-test. however the sql-like abstractions i've seen for clojre are much more complicated. so I don't know if my approach is 'right'
15:57loopholemaybe its to basic
15:59CStormGuys i have a problem. When i boot emacs, load cider-jack and open my project it always fails when i compile it the first time (the error is Unable to resolve symbol). Its a super simpel project with only 5ish functions. The solution is then to oucomment the functions, recompile, enable functions again and everything works. How come?
16:01justin_smithCStorm: do you define any functions out of order?
16:01justin_smithCStorm: if you run "lein check" do you get the same error?
16:01CStormlemme check.
16:02justin_smithCStorm: clojure doesn't support using functions before their definition (even in the same file) unless you use declare
16:02loopholejustin_smith: do you think my approach is to simplicistic?
16:03justin_smithloophole: I'm really not sure - if the syntax the db uses and what you can do in clojure match that nicely, maybe it will just work? but I don't know that db
16:04loopholejustin_smith: i just lispify all sql statements. so ($+ 1 2 3) -> (1 + 2 + 3)
16:04CStormhm, ok let me show you the code, justin_smith.
16:04CStormjustin_smith: http://pastebin.com/KjeZKByQ
16:04CStormjust simplified everything, and still does the same thing.
16:05CStormso its because i use it before its defined?
16:05loopholejustin_smith: and the dollar in front of each sql operator is to distinguish it from clojure
16:06justin_smithCStorm: yes, clojure does not support using things before their definition
16:06justin_smithCStorm: as I said before
16:07loopholeCStorm either declare trakt-pin-auth or put it above -main
16:07CStormthank you both, that was a headache my "newbie-clojure" book havnt touched yet
16:07CStormso had problems understanding it :)
16:08justin_smithCStorm: it's actually simple - what works in a file is what would work if you were running the definitions one by one in a repl
16:08justin_smithCStorm: if you ran (defn -main ...) first, of course the compiler would complain if you used anything that was not defined yet
16:08CStormmake sense
16:08CStormso when should i define and when should i move it up?
16:09justin_smithCStorm: like many things in clojure, it's simpler as a behavior than other languages are, but there is the "complexity" of doing it a different way than you are used to
16:09justin_smithCStorm: I don't ever use declare, but some people like using declare for style reasons - if they want to show definitions in a specific order
16:09justin_smithCStorm: it's a style question really
16:09CStormthanks guys
16:10loopholeCStorm: i only declare things when two function call each other. that happens very rarely
16:10CStormok.
16:11justin_smithloophole: in that sort of case I usually look for a way to make them one recursive question (though perhaps there would be more elegant two function versions I am missing)
16:11justin_smithwhat I really want is to get a good idea of when to use trampoline
16:14loopholejustin_smith: I think trampoline is for recursive functions that are not tail recursive and can not be written with loop. afaik tramplone prevents in this case a stack overflow
16:14loopholejustin_smith: or so I read, played around with it just once
16:14justin_smithloophole: indeed it does, I know what it does but I haven't mastered the coding style where using it comes naturally
16:15justin_smithperhaps it's just a toy, or perhaps I need an a-ha moment that shows me how it is useful
16:15justin_smithI'm betting on the latter, since it's in clojure.core
16:18loopholejustin_smith: i still need to find a reason to use it. but I'm happy it's there just in case
16:18amalloyi think trampoline is just useful pretty rarely
16:18justin_smithlike maybe for a state machine?
16:18amalloythat is a classic case, yeah
16:19amalloyalso to simulate continuations
16:19amalloyor rather, TCO, i guess
16:19justin_smithright, of non-self-calls
16:27rcassidyyeah, trampoline is one of those things you don't really use much unless you're pretty deep into recreating lisp, from my experience :p
16:37amalloydang, i just got a NPE from `lein deps tree`. that's a new one. i must have a really exciting set of dependencies
16:37justin_smithwow
16:38amalloy[clj-aws-s3 "0.3.9"] overrides [clj-aws-s3 "0.3.9" :exclusions [joda-time]] Consider using these exclusions: java.lang.NullPointerException
16:38amalloyif i could exclude NPE from my programs i would be all for it
16:38justin_smithhaha
16:40loopholeamalloy: )
16:44bja_any ideas what would cause leiningen to build an uberjar jar that java -jar considers to be an "invalid or corrupt jarfile", but `java -cp myjar my.ns.core` works (which is what `java -jar myjar` is supposed to do)
16:45bja_and by works, I mean, loads, passes all integration tests, I can nrepl into it, require/move into all namespaces, etc
16:45justin_smithbja_: perhaps you aot-compile your namespace but don't set it as :main-ns ?
16:45tolstoyImproper :main setting in lein?
16:45bja_:main-ns ?
16:45bja_I thought it was :main
16:46justin_smithbja_: you are right, I misremembered
16:46bja_oh, was just scrambling to the leiningen docs
16:47amalloybja_: lein help sample
16:47amalloyis a useful command to remember
16:47justin_smithif you set your :main properly, and java -cp myjar main works, then lein is making a mistake
16:47justin_smithamalloy: in this case it was me that needed to go look at the docs again
16:47amalloysure, but there's no need to scramble to find the docs anyway
16:49bja_amalloy, thanks
17:08Glenjaminlein help sample is going to change my life
17:08Glenjamini've been going to github every damn time
17:09amalloyi think most md files in lein's github are available via lein help
17:09bja_hmm
17:09amalloysee `lein help help` for details on that
17:10bja_so, `lein uberjar` under jdk7 creates jars that jdk7's java -jar cannot read. jdk8 creates uberjars that jdk8 can read.
17:10justin_smithamalloy: I'm not finding one for "faster", maybe using the wrong term
17:10justin_smithbja_: that does not reflect my experience at all
17:10amalloywell, i did say "most". i don't know that they're all there, i just know a lot are
17:11bja_justicefries, oh I mean. in this case. that's not my usual experience.
17:11justin_smithamalloy: yeah, I just thought it would have been cool to be able to direct people to a lein command instead of find that wiki page when they talk about clojure starting slow
17:11amalloyi like justin_smith's new nick, bja_
17:12amalloymaybe i should just kickban everyone whose nick interferes with the tab-completion on people i often talk to. there's an idea
17:12bja_`lein uberjar` under my jdk8 creates a jar file that none of my jdk7 jvms can use via java -jar, but my jdk8 can use that uberjar via java -jar
17:13bja_oops, sorry justin_smith and justicefries
17:14bja_which, would be fine if I was just using some random jdk8 api. but jdk7 creating the uberjar, cannot execute said uberjar using java -jar.
17:14bja_in all instances `java -cp jarfile main` works like I expect it to
17:15bja_I think my solution for now involves just using java -cp to run things, but I'd like to know why this happens
17:15bja_since I feel like I broke something somehow
17:15justin_smithbja_: are you compiling java as part of the build?
17:16bja_no. unless one of my dependencies is.
17:16bja_my codebase here is all clojure
17:16justin_smithno, a dep should be compiling for you, just trying to think of something that would cause that incompatibility
17:17tolstoyHave your main print out the java version, then "lein run" to see what's going on?
17:18bja_I know the java version from `java -version`
17:19tolstoyYeah, it's a sketchy suggestion. Is lein using the same version? Etc, etc.
17:25bja_afaict, lein is using the same version. I'm using arch linux's tool to globally set the java version
17:25hyPiRionLein uses the same version unless you explicitly set some environment variables, which very few people do
17:26tolstoyTrust but verify! ;)
17:35csd_What's the correct pattern for catching the potential parsing error in (let [json (json/read-str json-str)] ...), given I don't want to wrap the let in a try as other actions in the function might fail as well, for different reasons
17:36amalloysomething wrong with (let [json (try ..)] ...)?
17:37amalloyif you need to make decisions based on whether that happened, you can instead write (if-let [json (try ...)] (worked) (broken))
17:37csd_but won't it also bind the return value from the Catch if there's an exception?
17:38bja_not it you return nil
17:38csd_I was hoping to have the Catch return an error that I could pass to a Ring response
17:39bja_I normally handle that with a namespaced exception using slingshot
17:39bja_and then let a middleware deal with custom ring responses
17:40bja_do you need to complete the rest of the function?
17:40csd_yeah
17:40csd_well not if it fails
17:40bja_i.e. are you hoping to return a message, and then process some more stuff before returning the error message + other stuff
17:40tolstoyPut the json/parse stuff in a "decode" function and trap the error there? decode returns [:sucess doc] or [:error msg]?
17:41csd_bja_: the function deserializes the json and attempts to make a rest call. if the parse fails it will return immediately
17:42bja_in that case, I would do something like (throw+ {:type ::json-parse-fail :message "something" :other-keys :that-are-useful})
17:42csd_i'll have to look at the slingshot docs, i'm not familiar with it
17:43bja_tolstoy's solution is more generic
17:43bja_returning a vector of [status result]
17:43clojurebotCool story bro.
17:43csd_tolstoy: oh i missed that. i like that idea
17:44bja_why did clojurebot CSB me?
17:44tolstoyI generally throw to a middleware handler using (ex-info ..) and (ex-data ..), but destructure return values works okay.
17:44tolstoyI also do all kinds of things until it all works, then refactor (when I don't have to worry about code review nags, that is).
17:48amalloybja_: he's got a few behaviors that are just for fun. in particular, he interprets some random subset of messages (like 1%?) as if they were directed to him specifically
17:48amalloyhe didn't understand why you were telling him "returning a vector of [status result]"
17:49amalloyclojurebot: returning a vector of [status result]
17:49clojurebotI don't understand.
17:59csd_what is this error i get if i do (ex-info "" {}) outside of a throw statement
17:59amalloy,(ex-info "" {})
17:59clojurebot#error {\n :cause ""\n :data {}\n :via\n [{:type clojure.lang.ExceptionInfo\n :message ""\n :data {}\n :at [clojure.core$ex_info invokeStatic "core.clj" 4617]}]\n :trace\n [[clojure.core$ex_info invokeStatic "core.clj" 4617]\n [clojure.core$ex_info invoke "core.clj" 4617]\n [sandbox$eval25 invokeStatic "NO_SOURCE_FILE" 0]\n [sandbox$eval25 invoke "NO_SOURCE_FILE" -1]\n [clojure.lang.Comp...
17:59csd_i've never seen an error message like this from cider
17:59amalloydoesn't look like an error to me. you created an exception, and there it is
18:00amalloythat's just how clojure prints exceptions
18:00csd_ah
18:13pilnei like this: β€œIn Lisp, you have the power to shoot off your foot, not just shoot your foot! But don't worry β€” with Lisp, you can easily make a new foot! Or a tentacle.”
18:16loopholepilne: https://xkcd.com/224/
18:16loophole;)
18:18pilneLMAO
18:18pilneahh perl...
18:18pilneperhaps the only syntax that is maligned to the extent as lisp
18:18montanstercat"bless this mess" OO is still my favorite part of perl
18:19montanstercatthis data structure may or may not work out as an object, let's incant a ritual on it
18:19loopholemontanstercat: bless you!
18:21loopholepilne: perl is a lisp with a funny syntax
18:21pilnei can see that
18:23pilnei find comfort in the regularity of s-expressions
18:24loopholepilne: i used perl a lot. I tend to think that one often solves problems in perl that you don't have in other languages
18:24pilnei was more of a python guy when it cames to perl/python/ruby
18:24pilneand now i futz around with "hy" when i use python lol
18:27loopholepilne: python has its use. its fairly easy to read and fast enough
18:28loopholepilne: i still use perl but not for big projects
18:28pilneyep, not knocking it whatsoever, i really don't "hate" any programming language, there are ones i dislike more, and ones i like more, but hate is just too strong for things like that
18:29loopholepilne shakespear is a funny language :)
18:29pilnetrue!
18:30pilneesolangs are fun, and lisp is probably the easiest way to "write" a simple goofy one too (:
18:33loopholepilne: maybe I will write a metal language one time. it will only contain words that are in manowar lyrics :D exceptions are thrown with HAIL AND KILL! and so forth
18:34pilneand i'll have to write the scripting language that works with it using GWAR vocabulary (:
18:35loopholepilne: :)
18:35loopholepilne: i'm off to bed now
18:35loopholecu
18:35highclassholePlaying devil's advocate here, but why do people like emacs so much for clojure? I use vim and fireplace never ever have issues -- guy today try to work on the project with emacs and literally could not get CIDER to work with nREPL -- I added the handler he added the cider-nrepl to his lein user profile and still just would not work
18:35loopholehighclasshole: because... vim :)
18:36justin_smithhighclasshole: I use emacs but I don't use CIDER, fwiw
18:36loopholehighclasshole: I had to... ;)
18:36highclassholeHow do you connect to the nrepl?
18:36pilnei've never had trouble getting either to work, and i've actually taken quite a fancy to spacemacs lately being that it combines the emacs base, with a very well-thought out modal system and a better package management (IMHO) system.
18:36justin_smithhighclasshole: emacs has historically been a friendly environment for lispy programming
18:36montanstercathighclasshole: the years of elisp radiation makes us predisposed to clojure
18:36justin_smithhighclasshole: I don't
18:36highclassholeoh
18:37justin_smithhighclasshole: I used to use inferior-lisp now I just use a repl in a terminal
18:37pilnei also use ligttable because it's just kinda neat for quick one-off futzing, and atom with a repl in a terminal for things too, just depends on my mood really.
18:37justin_smith(require 'some.ns :reload) is simple enough, I don't need editor integration for that
18:38highclassholeYeah that seems like the better approach, cider made us want to put a fist through the monitor
18:39pilnemy quick and dirty setup is the zip from "clojure for the brave and true" tutorial
18:39pilnefor emacs
18:39highclassholeYeah thats what he used
18:39tolstoyYeah, I've not had problems with Cider in years,
18:39pilnedid he replace his .emacs.d folder or try and merge them?
18:39highclassholereplaced it
18:40pilnealso, emacs can have issues launching from the gui (gnome 3 etc) if the path to lein is in your .bashrc
18:40highclassholeit works ok if you launch the repl from within emacs but connecting to a remote nrepl (even on localhost) would not work
18:40highclassholeand I did add the handler for the nrepl
18:40highclassholenah its not that
18:40pilnek
18:40pilnejust iterating over my "facepalm" moments
18:41pilnewell... my emacs-cider related ones... all of them would be several encyclopedias...
18:41justin_smithhighclasshole: nrepl is local only for security reasons by default
18:41highclassholeright
18:42highclassholeso ssh tunnel on a remote box and running locally on localhost
18:42justin_smithsure, yeah
18:42highclassholethe stupidest thing is it said "CANNOT CONNECT" yet would establish a TCP connection to the port
18:42highclassholebut sending anything to it would not work
18:43highclassholeit was probably one of the most annoying things i've dealt with -- it defied all logic and reason
18:43justin_smithhighclasshole: so you were running cider-connect, and had the right port, and it was failing with CANNOT CONNECT but it was hitting the port?
18:43highclassholeyep
18:44justin_smithwow
18:44highclassholewe tried 0.8.1 and 0.10.1 same behaviour
18:44highclassholeof cider-nrepl
18:44justin_smithhighclasshole: if you get a chance try "lein repl :connect <port>" to verify that works
18:44justin_smith(with a running repl on that port, of course)
18:45highclassholethat works fine
18:45highclassholeit also worked fine in fireplace, atom, telnet, intellij
18:45justin_smithhaha
18:45highclassholeso it was like
18:45highclassholewhats the point of emacs?
18:46highclassholehave to add an additional dep to support the nrepl (which didn't even work) no other editors require any special handlers or additional dependencies to connect to the nrepl
18:46highclassholeit was like, this is seriously the "ppreferred" editor?
18:46justin_smithhighclasshole: don't judge emacs by cider - emacs is a bit weird and crufty but I mean what do you expect from the oldest living editor?, cider on the other hand is often a mess
18:46cap10morganhighclasshole: please file an issue on cider's GitHub page. If we find a fix, I can most likely get it into an 0.10.x point release.
18:47highclassholenot on my work machine at the moment but I'll try to file an issue tomorrow
18:47cap10morganhighclasshole: thanks!
18:47pilneemacs (in this day and age) has a lot of lisp nostalgia, a lot of the syntax tools that other editors use for a lisp were originally made with emacs, and a lot of the common lisp/scheme tools are kept most up to date with it, clojure is a different beast of a lisp though due to its jvm parentage
18:48tolstoyCider's sometimes a mess if you live on unstable.
18:48highclassholeWell I was a sysadmin for the better part of a decade, so I've been a vim user as long as I can remember
18:48justin_smithtolstoy: my coworkers who use cider are living with missing features and bugs for fear of everything breaking if they ever try to upgrade.
18:49highclassholesysadmin / C developer
18:49cap10morganI definitely recommend melpa-stable for cider, but even then some of the other clojure-emacs tools are incompatible w/ 0.10.x, which is :(
18:50justin_smithcap10morgan: my fear is that will always be the story with cider - you chose between the known brokenness of the past, or the unknown brokenness of the future, along with the breakages caused by upgrading. There's seemingly never a good stable point.
18:50pilneto be fair, clojure/lein/jvm are a much faster moving target than common lisp and scheme :p
18:50cap10morganjustin_smith: I agree, it hasn't been great. That's why I've been volunteering some release engineering time to try to improve it.
18:51justin_smithcap10morgan: and thank you for that, I just got frustrated it wasn't there already and walked away, which is definitely much less helpful :P
18:51cap10morganjustin_smith: my goal is to get 0.10.x to a stable, integrated, consistent point and then backport bugfixes and no-brainer improvements from master to it for awhile.
18:51highclassholecap10morgan: thanks for that, didn't mean to be negative I really appreciate the work you are doijng
18:52cap10morganjustin_smith: Yeah, I know how that goes. My typical response too. Only so many things you can contribute to in a day!
18:52cap10morganhighclasshole: no worries; good motivation to keep working at making it better!
18:52pilneso with typed clojure, i can annotate where i want, and leave dynamic where i want... like... freedom?
18:52pilneclojure really just keeps blowing my mind...
19:16tos9Hi. Only about <10 hours into clojure, so still very much learning the ropes. Why does (str :a) not raise a type error of some sort
19:16tos9I come from Python, and I'm fairly sure if we had keywords, our str() would have the same behavior, but I'm trying to decide if my intuition for whose "fault" it is that this library that I handed a symbol to in the wrong place didn't raise an error carries over
19:17tos9er s/symbol/keyword in that second message
19:18justin_smithtos9: str works on literally *anything*
19:18justin_smithtos9: it gives you the string of its value
19:19tos9OK, so same as Python then.
19:19justin_smithtos9: or most OO languages really - if it's a value you can print it
19:19tos9justin_smith: So, it's basically up to the library to use "better" mechanisms for ensuring it gets the right type there and not splatting random things into strings?
19:19justin_smithand to print it you need a string
19:19TEttingerstr is a string-ify-ing function
19:20TEttinger,(str {:a 1 :b "hey guys"})
19:20clojurebot"{:a 1, :b \"hey guys\"}"
19:20justin_smithtos9: well, if you expect to turn something into a string, anything will do - if you need something more specific that's up to you, sure
19:20TEttingerpr-str is sometimes what you may want in place of str
19:21TEttinger,(pr-str {:a 1 :b "hey guys"})
19:21clojurebot"{:a 1, :b \"hey guys\"}"
19:21TEttingersame there
19:21TEttingeruhhh
19:21tos9TEttinger: well basically you need a separate protocol
19:21tos9(Does clojure have one?)
19:21TEttinger,(str '(1 2 3))
19:21clojurebot"(1 2 3)"
19:21TEttinger,(pr-str '(1 2 3))
19:21clojurebot"(1 2 3)"
19:21tos9For objects that claim "my str representation is a thing that is actually sane, and not just debugging noise"
19:21TEttingerdammit come up with an example Ettinger!
19:21justin_smithtos9: pr-str / print-method
19:22tos9justin_smith: well pr-str looks like it just worked on a list
19:22justin_smithtos9: for any given object you should be able to use str to get the default toString, and pr-str to get the readable version, if possible
19:22TEttinger,(str #"[abc]$")
19:22clojurebot"[abc]$"
19:22TEttingera ha
19:22TEttinger,(pr-str #"[abc]$")
19:22clojurebot"#\"[abc]$\""
19:22TEttingerthe string representation of a regex is not directly readable as a regex
19:23TEttingerbut its pr-str is
19:23justin_smith,(type (read-string (pr-str #"[abc]$"))) ; TEttinger
19:23clojurebotjava.util.regex.Pattern
19:23justin_smithTEttinger: d'oh, that's what you said
19:23TEttinger,(re-find (read-string (pr-str #"[abc]$")) "balaclava")
19:23clojurebot"a"
19:24TEttinger,(re-find (read-string (str #"[abc]$")) "balaclava") ; shouldn't work
19:24clojurebot#error {\n :cause "clojure.lang.PersistentVector cannot be cast to java.util.regex.Pattern"\n :via\n [{:type java.lang.ClassCastException\n :message "clojure.lang.PersistentVector cannot be cast to java.util.regex.Pattern"\n :at [clojure.core$re_matcher invokeStatic "core.clj" 4667]}]\n :trace\n [[clojure.core$re_matcher invokeStatic "core.clj" 4667]\n [clojure.core$re_find invokeStatic "core...
19:32justin_smithany idea what's going on with clj-time coercion here? https://gist.github.com/noisesmith/ede8248dadd6bc81d77d
19:33justin_smithI feel like I must be missing something, I'm getting the same instant for year 0, and a year from year 0
19:33justin_smithbut only in the converted version, the clj-time value looks fine
19:34TEttingera year from year 0, justin_smith?
19:35justin_smithright
19:35TEttingerdo you mean a day from year 0?
19:35justin_smithI added a year
19:35TEttingeror a year after year 0?
19:35TEttingeroh ok
19:36justin_smithbbl
19:41pilneoh holy batballs
19:41pilnethe arcadia project, unifying clojureCLR and unity
19:41pilnethank the makers
19:51pilnegf is now getting big into unity, so i feel i'll be helping with the js/c# side of things, and having clojure as an alternative in both cases makes me a happy lisper
19:51pilnealthough i'm kinda hoping to get her over to jme3 at some point
19:54Kamuelapilne: interesting but what's jme3 and how big is Arcadia
20:03LucidTortoiseHi, is there anyone here who has read through Clojure for the Brave and True?
20:04LucidTortoiseI have come across what I think is errata, and I don't know how to solve it.
20:04domgetterLucidTortoise: the printed version or the online version?
20:04LucidTortoiseOnline. I have also read the printed version on Safari Books. Nothing is changed
20:05domgetterLucidTortoise: link to error?
20:05LucidTortoisehttp://pastebin.com/fyDqvtm7
20:05LucidTortoisehttp://www.braveclojure.com/core-functions-in-depth/
20:05LucidTortoiseThe Vampire Database section
20:05TEttingerKamuela: JMonkey Engine version 3, which IIRC is not terrifically well-maintained
20:06TEttingerarcadia looks good
20:06domgetterLucidTortoise: pg 85 in the printed?
20:06LucidTortoiseMaybe? Nothing I have read has page numbers.
20:06domgetterLucidTortoise: ah okay. What's the error?
20:07LucidTortoise(time (vampire-related-detials 0))
20:07LucidTortoiseCompilerException java.lang.RuntimeException: Unable to resolve symbol: vampire-related-detials in this context, compiling:(C:\Users\spint\AppData\Local\Temp\form-init64976743713428325.clj:1:7
20:08LucidTortoise2. Unhandled clojure.lang.Compiler$CompilerException
20:08LucidTortoise Error compiling:
20:08LucidTortoise C:\Users\spint\AppData\Local\Temp\form-init64976743713428325.clj:1:7
20:08LucidTortoise Compiler.java: 6543 clojure.lang.Compiler/analyze
20:08LucidTortoise Compiler.java: 6485 clojure.lang.Compiler/analyze
20:08LucidTortoise Compiler.java: 3737 clojure.lang.Compiler$InvokeExpr/parse
20:08LucidTortoise Compiler.java: 6725 clojure.lang.Compiler/analyzeSeq
20:08LucidTortoise Compiler.java: 6524 clojure.lang.Compiler/analyze
20:08LucidTortoise Compiler.java: 38 clojure.lang.Compiler/access$300
20:08LucidTortoise Compiler.java: 6129 clojure.lang.Compiler$LetExpr$Parser/parse
20:08LucidTortoise Compiler.java: 6723 clojure.lang.Compiler/analyzeSeq
20:08LucidTortoise Compiler.java: 6524 clojure.lang.Compiler/analyze
20:08LucidTortoise Compiler.java: 6485 clojure.lang.Compiler/analyze
20:08LucidTortoise Compiler.java: 5861 clojure.lang.Compiler$BodyExpr$Parser/parse
20:08LucidTortoise Compiler.java: 5296 clojure.lang.Compiler$FnMethod/parse
20:08LucidTortoise Compiler.java: 3925 clojure.lang.Compiler$FnExpr/parse
20:08LucidTortoise Compiler.java: 6721 clojure.lang.Compiler/analyzeSeq
20:08LucidTortoise Compiler.java: 6524 clojure.lang.Compiler/analyze
20:08LucidTortoise Compiler.java: 6779 clojure.lang.Compiler/eval
20:08LucidTortoise Compiler.java: 6745 clojure.lang.Compiler/eval
20:08LucidTortoise core.clj: 3081 clojure.core/eval
20:08LucidTortoise main.clj: 240 clojure.main/repl/read-eval-print/fn
20:08LucidTortoise main.clj: 240 clojure.main/repl/read-eval-print
20:08LucidTortoise main.clj: 258 clojure.main/repl/fn
20:08LucidTortoise main.clj: 258 clojure.main/repl
20:09LucidTortoise RestFn.java: 1523 clojure.lang.RestFn/invoke
20:09LucidTortoise interruptible_eval.clj: 58 clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn
20:09LucidTortoise AFn.java: 152 clojure.lang.AFn/applyToHelper
20:09LucidTortoise AFn.java: 144 clojure.lang.AFn/applyTo
20:09LucidTortoise core.clj: 630 clojure.core/apply
20:09LucidTortoise core.clj: 1868 clojure.core/with-bindings*
20:09LucidTortoise RestFn.java: 425 clojure.lang.RestFn/invoke
20:09LucidTortoise interruptible_eval.clj: 56 clojure.tools.nrepl.middleware.interruptible-eval/evaluate
20:09LucidTortoise interruptible_eval.clj: 191 clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
20:09domgetterLucidTortoise: for future reference, don't paste > 2 or 3 lines into this chatroom
20:09LucidTortoise interruptible_eval.clj: 159 clojure.tools.nrepl.middleware.interruptible-eval/run-next/fn
20:09LucidTortoise AFn.java: 22 clojure.lang.AFn/run
20:09LucidTortoise ThreadPoolExecutor.java: 1142 java.util.concurrent.ThreadPoolExecutor/runWorker
20:09LucidTortoise ThreadPoolExecutor.java: 617 java.util.concurrent.ThreadPoolExecutor$Worker/run
20:09LucidTortoise Thread.java: 745 java.lang.Thread/run
20:09LucidTortoise1. Caused by java.lang.RuntimeException
20:09LucidTortoise Unable to resolve symbol: vampire-related-detials in this context
20:09LucidTortoiseOops
20:09LucidTortoiseSorry Channel
20:09LucidTortoiseThis is why we use Pastebin
20:09LucidTortoisedomgetter: I will definetly avoid that.
20:10domgetterYou spelled details wrong
20:10domgetter"Unable to resolve symbol: vampire-related-detials in this context"
20:10LucidTortoiseNo way. I mean, okay. Wow.
20:10LucidTortoiseThanks.
20:11domgetterThe printed version and the online version spell it "details" correctly both times
20:11domgetterno problem :)
20:14LucidTortoiseI am going to kill and reload the repl buffer. I realized that typing things yourself gets overrated, so I copy and pasted the boook text and I still got the error
20:16LucidTortoiseYups. Be wary of blaming errata, even when the book doesn't have a section for them online!
20:23pilneKamuela:: jme is jmonkeyengine (version 3 now) http://jmonkeyengine.org/ a java-based game engine/library. and arcadia is a clojurescript to unity bridging project. http://arcadia-unity.tumblr.com/post/100257212548/arcadia-01a-launched
20:31adictogfredericks: will write a seperate keys function.
21:30neoncontrailspilne: fascinating. Have you used it? (Arcadia?) I've futzed around with some javascript interfaces to WebGL, and they all rely deeply on mutation and inheritance
21:31pilnei have not yet, i just started looking at it today since the gf crash-coursed unity for like 8 hours and is really smitten with it, but... i can't stand c# and f# still is a second class citizen in that world.
21:33neoncontrailsIt's really remarkable. I'm just trying to wrap my head around how a functional semantics could even really work in that environment, esp. with immutability
21:33pilnefor what she wants to use it for (for now) the javascript level scripting is fine, and i can always help with the marvel that is clojurescript (: (i can also tolerate some plain javascript, just smitten with lisps)
21:34pilnei found a slide of tutorials for handling state in a couple different ways, one is the tutorial "caves of clojure" which seems to be left somewhat unfinished, and the other was from the perspective of a voxel-game in scala.
21:35pilneand from what i've gathered, immutable is default, but not forced at all times.
21:36neoncontrailsI could see there being some definite advantages though for the expression of movement. I found movement very difficult to express in JS
21:37neoncontrailsWhich makes sense. Movement is a function, so it will be a little more natural to express in a functional style
21:38neoncontrailsBut if I change the color of a cube's face to red, I don't really want to get a brand new cube
21:41justin_smithneoncontrails: if you change the color of the cube's face to red, you don't really want it to be a series of sequential storage locations in a turing machine
21:41justin_smithneoncontrails: these are all abstractions
21:45neoncontrailsjustin_smith: heh. Touche. That's true
21:45clojurebotPardon?
21:58princesois it normal that criterium.core/bench lasts hours working? (4 hours and counting)
21:59justin_smithhow big a function did you give to it? is it a function call that would normally return?
21:59justin_smithprinceso: no, I've never had bench take that long
21:59stapler,(rand-nth [1 2 3 4 5])
21:59clojurebot3
21:59princesoits just an eval some data
22:00justin_smithyou mean literally calling eval?
22:01princesoyes, one eval
22:02justin_smitheval is very slow, but still that shouldn't take hours to benchmark
22:02princesojustin_smith: classes loaded before 1205701 iterations
22:03TEttingersounds like the data is large
22:03TEttingerwhich isn't eval's fault
22:04princesoitst just a (defn f [x] (+ 1 x))
22:04princesoim going to stop it.
22:11justin_smithprinceso: what clojure version did you do that with?
22:14justin_smithprinceso: I'm running (crit/bench (eval '(defn f [x] (+ 1 x)))), maybe it will return eventually
22:14justin_smithclojure 1.8.0
22:14princesojustin_smith . 1.7.0 . well the thin being benchmarked is some assoc an prewalk-replace to get that func (defn f [x] (+ 1 x)). Nothing exorbitant
22:14justin_smithprinceso: liar!
22:15princesohaha
22:16princesojustin_smith: i suppose it does a real benchmark
22:16princesojustin_smith: sorry mate
22:16justin_smithheh, I guess I'll find out how long an eval defn takes in the raw, but it probably won't have much to do with your case...
22:17princesoplease show results
22:18justin_smiththis is now officially the longest crit/bench I have ever run, and it's still chugging along
22:37backnforthNewbie question: When I run "lein run" I get a clojure could not transfer artifact error. Here's my project.clj: http://pastebin.com/rCRUweb1
22:41backnforthWhy do I get this error? There's are also error messages saying im getting a "java.lang.runtimeexception: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
22:57princesojustin_smith: how did that end?
23:01highclassholebacknforth: lein run issue sounds like lein is having trouble downloading remote artifacts
23:02highclassholeyou behind a proxy or something
23:02justin_smithprinceso: still going
23:02justin_smithbacknforth: are you using ubuntu?
23:03backnforthI am running ubuntu, and no I'm not using a proxy.
23:03justin_smithbacknforth: known ubuntu issue http://askubuntu.com/questions/627426/minecraft-with-openjdk-7-i-get-the-trustanchors-parameter-must-be-non-empty
23:05backnforthSweet
23:24justin_smithprinceso: no more computer for tonight, but I'll leave that benchmark running, and I typed in a (java.util.Date.) after, so I should see what time it finally finished
23:51princesojustin_smith: good. good night