#clojure logs

2014-05-18

00:01johnjelinekjoshhead: I'm all for minimal dependencies
00:26quizdranyone using websockets in clojure?
00:26johnjelinekdoes anyone use bower in a clojurescript app?
00:29ToBeReplacedquizdr: sorry if unhelpful since i'm about to leave, but see jetty9-websockets-async and chord on github
00:30quizdrok thanks ToBeReplaced
00:31quizdrToBeReplaced how do I know if I should be using Jetty 7 or 9, is there a particular version of Jetty already installed in the JVM?
00:52joshheadjohnjelinek: https://github.com/joshhead/om-brepl
00:52johnjelinekjoshhead: thanks
00:52joshheadjohnjelinek: The readme's empty, I'm not sure if the code or the explanation is more useful
00:53johnjelinekjoshhead: I'll let you know
00:53joshheadjohnjelinek: well there's no explanation so at least you can tell me if the code helps :)
00:55johnjelinekso if I were to deploy this to prod, I'd need to make sure it removed this line: https://github.com/joshhead/om-brepl/blob/master/resources/public/index.html#L14 right?
00:56numbertenis there a function that prettyprints s-expressions?
00:56joshheadjohnjelinek: yes, you can take out line 13 too
00:56johnjelinekahh, right
00:56joshheadjohnjelinek: it's not really optimized for production, I'd probably make a few changes beyond that
00:56johnjelinekok
00:57joshheadI had started writing, the main thing that's missing is to run "lein trampoline cljsbuild repl-listen" before loading the code in the browser. oh and it also needs to be running in a web server, I just 'cd resources/public/; python -m SimpleHTTPServer'
00:57numbertenalso unrelated, but what would you refer to default functions belonging to? the prelude? standard library? something else?
00:58quizdrnumberten you mean functions that are a part of clojure core?
00:58andyfnumberten: pprint in clojure.pprint namespace
00:58quizdryou can say "core functions" to mean those that are a "standard" part of the language
00:59numbertenthanks to both of those
00:59numbertenandyf: i just found this: http://richhickey.github.io/clojure-contrib/pprint-api.html
00:59joshheadjohnjelinek, and finally If you run "lein trampoline cljsbuild repl-listen" as inferior lisp in emacs, you can eval code interactively, tadaa
01:00andyfrichhickey.github.io is no longer maintained or updated, I believe
01:00johnjelinekcool, thx
01:00numbertenandyf: alright thanks
01:00johnjelinekjoshhead: I built a little boilerplate project from one of the om tutorials that includes ring/compojure in it
01:01johnjelinekthis way it'd host on localhost:8080 instead of needing to do pythong -m SimpleHTTPServer
01:01andyfGoogle clojure API to find more up to date one
01:01joshheadjohnjelinek: mm, yes I knew I'd seen one before, I also found this example https://github.com/magomimmo/modern-cljs/tree/master/cljs-tutorial
01:02joshheadit's more complete than mine and has documentation
01:02joshheadbut I wasn't sure I liked including ring just to test some clojurescript
01:02johnjelinekthat one seems a bit more involved
01:03johnjelinekthere's one example out there that exposes a lein alias that spins up ring + cljsbuild
01:40ivanis there a way to use cljsbuild with a snapshot version of clojurescript? cljsbuild's parse-version crashes on a "0.0-SNAPSHOT" cljs dep
01:46ivanwell getting rid of a block of version-checking code in cljsbuild seems to have fixed the problem
03:00johnjelinekdoes anyone know how to get cider to serve a clojurescript repl?
03:00johnjelinekI want to be able to compile the buffer to the clojurescript repl
04:39numbertenis there a way to see the returntype of a function?
04:40numbertenlike a (return-type str) => java.lang.String
04:52dissipate,(#(apply hash-map (conj (into [] (interpose %1 %2)) %1)) 0 [:a :b :c])
04:52clojurebot{:c 0, :b 0, :a 0}
04:53dissipate,(#(into {} (conj (into [] (interpose %1 %2)) %1)) 0 [:a :b :c])
04:53clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword>
04:53dissipatewhy? why does the 'apply hash-map' work, but not 'into {}'?
04:54dissipate,(#(apply hash-map (conj (into [] (interpose %1 %2)) %1)) 0 '(:a :b :c))
04:54clojurebot{:c 0, :b 0, :a 0}
04:55dissipate,(#(apply hash-map (conj (into [] (interpose %1 %2)) %1)) 0 #{:a :b :c})
04:55clojurebot{:c 0, :b 0, :a 0}
05:18numbertenshouldn't this be the function that always returns 0?
05:18numberten,#(0)
05:18clojurebot#<sandbox$eval25$fn__26 sandbox$eval25$fn__26@113abe4>
05:19numberten,((fn [] 0))
05:19clojurebot0
05:19numberten,(#(0))
05:19clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
05:40dissipatenumberten, what are you trying to do?
05:41dissipate,#(identity 0)
05:41clojurebot#<sandbox$eval25$fn__26 sandbox$eval25$fn__26@b93a6>
05:41dissipate,(#(identity 0) "blah")
05:41clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox/eval51/fn--52>
05:41numberten,(#(identity 0))
05:41clojurebot0
05:41dissipate,(#(identity 0))
05:41clojurebot0
05:41numbertenweird that you need identity in there
05:42numberteni was just trying to make a boilerplate function
05:42numberteni soon realized that clojures dynamic types meant I could use 'nil' >.>
05:43dissipatenumberten, a boilerplate function to do what?
05:43numbertenbut it just left me wondering why (#(0)) wasn't equal to ((fn [] 0))
05:43numbertena temporary value in a configuration structure
05:44numbertenmeaningless beyond just being there to show it needs to be replaced
05:44dissipatenumberten, you got me. i'm discovering quirks in clojure every day!
05:44numbertenhah yea
05:46dissipatenumberten, i still don't know how '& args' works in functions exactly. doesn't work how i expected, in any event.
05:46numbertenI think & args binds args to a sequence containing the rest of the arguments
05:47dissipatenumberten, yeah, but it doesn't work for me in certain forms
05:47numberten,((fn [a & args] (seq? args)) 1 2 3)
05:47clojurebottrue
05:48numberten,((fn [a & args] (println args))
05:48clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
05:48numberten,((fn [a & args] (println args)))
05:48clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: sandbox/eval177/fn--178>
05:48numberten,((fn [a & args] (println args)) 1 2 3)
05:48clojurebot(2 3)\n
05:49numbertendissipate: weird
05:49numberteni've yet to actually use it
05:49numbertenso i've yet to see it not work!
05:49dissipatenumberten, i have an example, if you want to see
05:50numbertensure
05:50numbertenalso this is pretty strange
05:50dissipatei'll put it on refheap
05:50numberten,(range -1.0 1.0 0.1)
05:50clojurebot(-1.0 -0.9 -0.8 -0.7000000000000001 -0.6000000000000001 ...)
05:51dissipatenumberten, because of the approximate values?
05:51numbertenyeah
05:51numbertenit's just funny because it ends up giving you more than you'd expect
05:51dissipatenot too strange. just some quirk of how the numbers work.
05:51numberten,(count (range -1.0 1.0 0.1))
05:51clojurebot21
05:51numberten,(count (range -10 10 1))
05:51clojurebot20
05:52dissipatehmm, that is a bit strange
05:52numbertenyeah beause the tail end of the range
05:52numbertenapproaches 1.0
05:52numbertenso it acts as if the range is inclusive
05:53numbertenwhen usually (range x y) is exclusive in regards to y
05:53numberten,(range 0 3)
05:53clojurebot(0 1 2)
05:54numbertenthankfully having an extra data point isn't a problem for my usecase
06:04dissipatenumberten, https://www.refheap.com/85603
06:04dissipatei want to rewrite 'cyclen' so that it is a function that takes in an arbitrary number of cycles
06:04dissipatehaven't been able to do this successfully yet
06:09numbertenhrm
06:15numbertentook me a second to understand what it's doing
06:15numbertensince i'm not used to n-arity map
06:26numbertengot it
06:26numbertendissipate:
06:27dissipatenumberten, cool, what's the solution?
06:28numberten(defn cyclen [& rest] (apply (partial map #(every? identity %&)) rest))
06:28numbertenthe problem I was having is that rest returns your vectors in a seq, and mapping over the seq isn't want you want
06:28numbertenyou want to use the n-arity map over the vectors
06:29numbertenso you have to apply the partially applied map function
06:29numbertento the seq
06:29numbertenwhich puts it back into the form (map fn v1 v2 v3)
06:29dissipatedamnit
06:29numbertennot working?
06:29dissipatei was so close. i tried the same thing, but i used 'comp' instead of 'partial'
06:30numbertenah
06:30dissipatehmm, so why does partial work but not comp?
06:31numbertenpartial turns (map fn) into an actual function that can be passed as the first arg to 'apply'
06:31dissipateand comp does not? :(
06:31numbertencomp takes 2 functions and passes a value through both.. hard to explain without types
06:32numbertenif you have a function from a -> b and a function from b -> c, you could (comp f1 f2) to have a new function from a -> c
06:33numbertenthe order above might be wrong, but the general gist is the same
06:34numbertenso (comp map fn) would make a new function that is the equivalent of taking some value, applying it to fn, then taking the result and applying it to map
06:34numbertenbut since map requires at least arguments, it still wouldn't be fully applied
06:34dissipateyep, i see. partial takes a single function and a partial of its args and returns a function that accepts the rest of the args
06:34numbertenat least 28
06:34numbertenat least 2*
06:34numbertenyea
06:36dissipatewell, thanks for that solution. i was going crazy. :O
06:37numbertenno problem, glad to be able to help
06:37numberteni owe #clojure, for all the questions i've been asking >.>
06:40dissipategoing from imperative languages to functional languages is no joke. :O
06:41dissipatebut i am proud to announce that i got problem #22 on 4clojure correct on the first try. w00t!
06:45numbertenoh cool, never heard of that site
07:38adsiscohi, i'm using httpkit/get to query json from google API, but i dont seem to be getting results, it might be because of SSL, how do i enable it?
07:53adsiscohttps://www.irccloud.com/pastebin/6ZfhzDUB
07:53adsiscowhy does this not work?
07:57whodidthishttp/get, method post sounds quite weird at least
07:59adsiscolol ya, i added that in by mistake
07:59adsiscoignore em
08:04whodidthismaybe check out if theres anything in :error of response
08:11adsiscoclj-http works flawlessly
08:23gfredericksanybody have thoughts about using component for batch jobs?
08:24gfredericksI know it's ~7am on a sunday and so the answer is no
08:24gfredericksbut I asked it anyways.
08:31gfredericksmaybe I will have the convention of a component having a :ctl key with a channel that can have exceptions put into it if something goes wrong, or closed when the job is done
08:49gfrederickss/channel/promise/
11:02patrickodI'm using korma at the moment with a model (def message (belongs-to user))
11:02patrickodwhen I select message with users korma is merging the two maps instead of having a subkey :user with the map. is this expected behavior?
11:03patrickodactually it is. weird
13:19dissipatewhat is the difference between 'hash-map' and 'into {}' ?
13:20arrdem,(doc hash-map_
13:20clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
13:21arrdem,(doc hash-map)
13:21clojurebot"([] [& keyvals]); keyval => key val Returns a new hash map with supplied mappings. If any keys are equal, they are handled as if by repeated uses of assoc."
13:21arrdem,(doc into)
13:21clojurebot"([to from]); Returns a new coll consisting of to-coll with all of the items of from-coll conjoined."
13:22arrdemdissipate: structure of the keyvals it looks like..
13:22arrdem,(into {} [[:a :b] [:c :d]])
13:22clojurebot{:a :b, :c :d}
13:22arrdem,(hash-map [:a :b] [:c :d])
13:22clojurebot{[:a :b] [:c :d]}
13:24dissipatearrdem, hmm, that's strange
13:25pyrtsa,(hash-map :a :b :c :d)
13:25clojurebot{:c :d, :a :b}
13:26dissipate,(into {} [:a :b :c :d])
13:26clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword>
13:26dissipatewhat the heck
13:26pyrtsadissipate: The values have to be key-value pairs.
13:26arrdeminto conj's the elements of the seq. conjing a keyword onto a map isn't meaningful.
13:27pyrtsa,(into {} [[:a 1] [:b 2] [:c 3]])
13:27arrdemyou have to conj a k/v pair
13:27clojurebot{:a 1, :b 2, :c 3}
13:27dissipate,(into {} ['(:a :b) '(:c :d)])
13:27clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.util.Map$Entry>
13:28dissipate,(into {} [[:a :b] [:c :d]])
13:28clojurebot{:a :b, :c :d}
13:29dissipatewhy does it not like lists?
13:29arrdem,(vector? (first {:foo :bar}))
13:29clojurebottrue
13:29arrdemdissipate: ^
13:29llasramWhich isn't really really true. It's special-cased
13:30dissipate,(first {:foo :bar})
13:30clojurebot[:foo :bar]
13:30llasram(class (first {1 2}))
13:30llasramack
13:30llasram,(class (first {1 2}))
13:30clojurebotclojure.lang.MapEntry
13:30dissipateand why is it a vector? special case?
13:30llasramIt's a sub-class of APersistentVector
13:30dissipatethis isn't intuitive. :(
13:31llasramIt's pretty weird
13:31arrdemagreed
13:31wei__what’s the short way to write (-> system add-cowbell add-cowbell add-cowbell)
13:31wei__I’m thinking something like repeat or iterate
13:32dissipate(take 3 (constantly add-cowbell))
13:32llasramThen `.cons` (despite name, backing method for `conj`) on persistent maps specially handles 2-entry vectors
13:32pyrtsawei__: (take 3 (iterate add-cowbell system))
13:32arrdemdissipate: that doesn't really make sense because it's really iterate.
13:32llasramSo map entries are vectors, and `conj` can treat vectors as map entries
13:32arrdem(nth 3 (iterate add-cowbell system))
13:32pyrtsaarrdem: Ah, you're right.
13:33wei__cool thanks
13:34hyPiRionIs there some guarantee that iterate won't be chunked?
13:34dissipatellasram, these quirks are not good for beginners learning clojure. it's actually pretty confusing.
13:34arrdemhyPiRion: I don't think so, but if add-cowbell is pure it doesn't matter.
13:34pyrtsahyPiRion: Looks like there isn't.
13:34pyrtsa(doc iterate)
13:34clojurebot"([f x]); Returns a lazy sequence of x, (f x), (f (f x)) etc. f must be free of side-effects"
13:34arrdemwei__: add-cowbell had better be pure
13:35wei__yes, it is
13:35wei__otherwise, I would use repeatedly
13:35hyPiRionright, then it's good
13:35arrdemgood!
13:36hyPiRionwell, repeatedly is not chunked, although I would be a bit careful using it that way
13:36hyPiRionrather do (dorun (map #(%) (repeat 3 add-cowbell))) instead
13:37hyPiRion(or even better, (dotimes [_ 3] (add-cowbell))
13:39wei__you need to add-cowbell to system though
13:39wei__I’m looking for f(f(f(x))), or whatever
13:40arrdemwei__: right. that's iterate, since f is pure
13:40wei__oh btw nth takes the collection first— but otherwise your solution works for me
13:42dissipatewei__, looks like its an infinite sequence, not a collection
13:45amalloyuh, sequences are collections
13:47pyrtsaamalloy: With the gotcha that nil is a sequence but not a collection.
13:47pyrtsa,(coll? (take-last 0 [1 2 3]))
13:47clojurebotfalse
13:47amalloypyrtsa: pretty sure it's neither
13:47arrdem,(seq? nil)
13:47clojurebotfalse
13:47pyrtsaOuch, I stand corrected. But nil is seqable.
13:47arrdem,(doc coll?)
13:47clojurebot"([x]); Returns true if x implements IPersistentCollection"
13:48arrdem,(coll? nil)
13:48clojurebotfalse
13:48amalloypyrtsa: as is every collection
13:48arrdem(inc amalloy) ;; karma for the insanities of clojure
13:48lazybot⇒ 107
13:48pyrtsa(inc amalloy)
13:48lazybot⇒ 108
13:52hyPiRionnil is void
13:52hyPiRion,(conj {} nil)
13:52clojurebot{}
14:08dissipate,(conj {} (and))
14:08clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Boolean>
14:09dissipate,(conj {} [(and) (or)])
14:09clojurebot{true nil}
14:18fortrucecan anyone help me understand why this is failing, its completely stumping me: https://www.refheap.com/85609
14:27ambrosebsBronsa: is :end-column different for different collections?
14:27ambrosebsthere seems to be an off-by-one error for maps vs other things
14:28ambrosebsBronsa: I'll find a specific example.
14:30Bronsaambrosebs: might be a bug, there shouldn't be any difference between maps & other colls
14:30Bronsaambrosebs: yeah an example would be helpful, I can't reproduce with a simple map http://sprunge.us/YJQR
14:31ambrosebs(-> "[]" ((comp tr/read readers/indexing-push-back-reader)) meta :end-column) => 3
14:31ambrosebs(-> "{}" ((comp tr/read readers/indexing-push-back-reader)) meta :end-column) => 2
14:32Bronsaambrosebs: oh, you're probably using 0.8.3
14:32BronsaI fixed that in 0.8.4 I believe
14:32ambrosebsnice :)
14:34ambrosebsBronsa: line info for non IObj values are unrecoverable?
14:35Bronsaambrosebs: yeah, there's really no place to store the info
14:36ambrosebsBronsa: is wrapping them in a quote an option?
14:37ambrosebs(I don't really know what quote does at that level tbh)
14:37Bronsaambrosebs: you just get (quote thing) back
14:38Bronsaand no, that wouldn't work
14:38Bronsaambrosebs: t.r currently only attaches source info to symbols/colls literals, not to expanded reader macros
14:39Bronsaalso wrapping in a quote might break some macros probably
14:40arrdemquote wrapping would be very risky.
14:44ambrosebsBronsa: possible to attach metadata in the enclosing sexpression, if present?
14:45arrdemyou'd have to write some strange support for looking up metadata from something along the lines of (nth (:children (meta <parent>)) n)...
14:47Bronsaambrosebs: yeah, I guess that might be possible
14:48Bronsa(meta [1 2 3]) could return something like {::children [{:line 1 :column 2 ..} {:line 1 :column 4 ..} ..] ..}
14:49ambrosebsthat would be great
14:50Bronsait's probably not too hard to do, let me see
15:04Bronsaambrosebs: uhm, so it's reasonable for lists/vectors but maps/sets are unordered. a :children vector doesn't really make much sense
15:08ambrosebsBronsa: damn
15:09ambrosebsBronsa: wrap everything in a `do`? :P
15:10Bronsaambrosebs: still gonna cause problems with macros
15:10ambrosebsahk
15:10ambrosebsbugger
15:10ambrosebsthat's unfortunate
15:11Bronsaambrosebs: maybe ::children might be a map of key->info, so that for vectors/lists you get the item info with (nth coll key) and for maps/set (get coll key) ?
15:12arrdem,(meta (first (into {} [ ^foo [:bar :baz]])))
15:12clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: foo in this context, compiling:(NO_SOURCE_PATH:0:0)>
15:13arrdem,(meta (first (into {} [ ^{:foo true} [:bar :baz]])))
15:13clojurebotnil
15:14ambrosebsBronsa: good idea
15:19ambrosebsBronsa: is () supposed to be missing metadata?
15:20ambrosebsforgot to update
15:20ambrosebsfixed in 0.8.4?
15:22ambrosebsyep I see it is
15:22mskoudHow fo i call java.util.UUID.randomUUID(); from Clojure?
15:23arrdemmskoud: you have to import java.util.UUID and then say (. java.util.UUID randomUUID)
15:23mskoudThx!
15:23hyPiRionarrdem: not sure if you have to import it
15:24hyPiRion,(java.util.UUID/randomUUID) ; suffices, I think
15:24clojurebot#uuid "f48ce140-4615-4935-a220-fa72b7b78af5"
15:24arrdemhum. ok you get it for free then.
15:24mskoudnice :-)
15:31gfrederickshyPiRion: that does assume it's already loaded though
15:32gfrederickswhich it probably is in this case but maybe a bad habit in general
15:32hyPiRiongfredericks: yeah, I was kind of wondering when you're forced to do it and when you're not
15:33Bronsaambrosebs: yeah 0.8.4 fixed a bunch of source info meta
15:33ambrosebsBronsa: I probably rediscovered most of them while offline today
15:33ambrosebs:)
15:36gfrederickshyPiRion: I think it's the same as using some.fully.qualified/var -- it just depends on whether the details of the rest of the code have caused that thing to be loaded already
15:36gfredericks,clojure.walk/postwalk
15:36clojurebot#<CompilerException java.lang.ClassNotFoundException: clojure.walk, compiling:(NO_SOURCE_PATH:0:0)>
15:36gfredericks,clojure.java.io/resource
15:36clojurebot#<io$resource clojure.java.io$resource@81560>
15:36gfredericks,java.util.UUID
15:36clojurebotjava.util.UUID
15:37gfredericks,java.util.zip.CheckedOutputStream
15:37clojurebotjava.util.zip.CheckedOutputStream
15:37hyPiRion,java.util.LinkedHashMap
15:38clojurebotjava.util.LinkedHashMap
15:38hyPiRion,javax.print.attribute.standard.PrinterStateReasons
15:38clojurebotjavax.print.attribute.standard.PrinterStateReasons
15:38gfrederickshow do I google for least popular built in java classes
15:38hyPiRionalright, I give up
15:38gfredericks,clojure.lang.IteratorSeq
15:38clojurebotclojure.lang.IteratorSeq
15:38gfredericks,clojure.lang.EnumerationSeq
15:38clojurebotclojure.lang.EnumerationSeq
15:39klokbaskeHey! Anyone into dsp around here? :)
15:39gfredericks,javax.swing.ComboBoxEditor
15:39clojurebotjavax.swing.ComboBoxEditor
15:39gfredericksomg clojurebot why do you have swing loaded
15:39arrdemolololol
15:39gfredericksklokbaske: Doing Some Programs?
15:39arrdemy is dimensional analysis this hard...
15:40arrdemgfredericks: digital signal processing...
15:40hyPiRiongfredericks: Xvfb perhaps?
15:40gfredericksarrdem: dimensional analysis is all made up amirite?
15:40arrdemgfredericks: ur wrong
15:40gfrederickssomebody had a blag complaining about this
15:41arrdembut but units and math...
15:41klokbaskegfredericks: i'd like to! I'm a bit in doubt how to do it in a functional style
15:41arrdemtypes...
15:41gfredericksarrdem: the thing was you can have two units that dimensionally are identical but are in fact unrelated concepts
15:41gfredericksI think force times distance was one example
15:42arrdemgfredericks: interesting...
15:42gfrederickswhat do you think force times distance makes? :)
15:42arrdemit's usually defined to be work or jules..
15:42klokbaskeaudio, that is. Normally, I'd have a global variable for the phase that I could increment when ever my callback is called
15:42gfredericksarrdem: OR torque
15:42klokbaskeBut that's not very idiomatic
15:43arrdemgfredericks: sure, which is a form of work...
15:43gfredericksarrdem: that sounds suspect
15:44arrdemgfredericks: torque is τ*r, force times lever arm
15:44arrdemah. gotcha.
15:45gfrederickswikipedia says: "Energy and torque are entirely different concepts, so the practice of using different unit names (i.e., reserving newton metres for torque and using only joules for energy) helps avoid mistakes and misunderstandings."
15:46arrdemyeah. gotcha....
15:46arrdemthat's rather irritating actually.
15:46gfredericksthis was brought to my attention by A via B via C where A is some paper, B is http://www.infoq.com/presentations/dynamic-static-typing, and C is I think mister baldridge
15:46gfredericks(on the tooter)
15:47arrdemtb++
15:47gfredericks(inc tbaldridge)
15:47lazybot⇒ 5
15:47arrdemI guess that tb's only at 5 cause he doesn't lurk IRC hard...
15:47arrdem(inc tbaldridge)
15:47lazybot⇒ 6
15:48BronsahyPiRion: you don't need to import classes to refer to them fully qualified
15:49gfrederickswaaat
15:50Bronsagfredericks: yep.
15:50gfredericksfully qualified class usages turns into Class/forName in the compiler I guess?
15:50gfredericksanybody know if this is the case for java too?
15:52gfredericksI mean I know java compile time is a bit different; I guess I just meant if imports are require for fully qualified usage
15:53gfredericksyes they are not required
16:38amalloygfredericks: i wouldn't expect it to turn into Class/forName
16:39amalloyit's just a reference to the class, and the class is only loaded when some other class needs it
16:39gfredericksClassFactoryFactory.getFromStringFactory().makeClass(s)
16:40gfredericksamalloy: so the initializer isn't run at that point?
16:41amalloyi have no idea what point you're talking about
16:41amalloyi'm not entirely sure what initializer either
16:41gfredericksclasses have initializers
16:41clojurebotI don't understand.
16:41gfredericksand the point I'm talking about is when calling Class/forName
16:42amalloygfredericks: well, if the class isn't loaded yet, and someone calls Class/forName on it, then i would expect its static initializers to run at that point
16:42gfredericksso the initializer I'm talking about is the initializer of the class referred to by the argument to Class/forName
16:42gfredericksokay so static initializers are different and prior to the class being "loaded"?
16:43amalloythey happen as part of loading
16:43gfredericksoh I think I must have misinterpreted your second statement
16:43gfredericksI read "The return value of Class/forName is just a reference to the class, and the class is only loaded when some other class needs it"
16:44amalloyoh, no. the forName causes loading if the class is not yet loaded
16:44gfredericksso you're saying the clojure compiler just creates a reference to the class
16:44gfrederickshow does it know if the class exists or not?
16:45gfredericks,(fn [] (this.class.does.not.Exist.))
16:45clojurebot#<CompilerException java.lang.ClassNotFoundException: this.class.does.not.Exist, compiling:(NO_SOURCE_PATH:0:0)>
16:45kzarHow can I increase heap space for the emacs cider-jack-in repl?
16:45amalloygfredericks: i think it just emits code that refers to the class, whether it exists or not. the java classloading mechanism will blow up if that doesn't "link"
16:45gfrederickskzar: you can set :jvm-opts in your project.clj
16:45amalloyand if it does "link", then the class is loaded if necessary
16:46kzarCan I do it without creating a project? (What's the default heap space?)
16:46gfrederickskzar: I think it would work in the :user profile
16:47kzarHow would I do that?
16:48gfrederickscat '{:user {:jvm-opts ["-Xmx16g"]}}' > ~/.lein/profiles.clj
16:49gfrederickss/cat/echo/ prollably
16:49kzarThanks, no don't worry I got the idea
16:50kzarDoes cider use the lein profiles.clj?
16:50gfredericksI think it calls `lein repl` or similar, so it should
16:50gfredericksindirectly
16:55kzargfredericks: hey I think it worked, thanks
16:55kzar:)
16:56gfredericksnp
17:19gfredericksokay so my impression was, regarding metadata
17:19gfrederickssome things are values and therefore cloneable, and they use with-meta and create new objects
17:19gfrederickswhich corresponds to the IObj interface
17:20gfredericksfunctions are a weird edge case here, since they aren't values but it's not too janky to clone them
17:20gfredericksreferences on the other hand can't be meaningfully cloned, so they have mutable metadata
17:20gfrederickscorresponding to the IRef interface and alter-meta!
17:20gfrederickswhat surprised me is that promises are IObj
17:21gfredericksand so you can clone them and get copies that all get delivered at once
17:21gfredericksand I realize there's probably not a way for that to mess anything up; but it still surprised me
17:22gfredericksI think I don't know of anything else that is IObj and IDeref
17:25dbaschgfredericks: what do you mean “values and therefore cloneable” ?
17:26gfredericksdbasch: an immutable value can be cloned, at the object-level, without bothering anybody
17:26dbaschgfredericks: but only if it implements Cloneable
17:26dbaschgfredericks: which in java is never the case for immutable objects, as far as I know
17:26gfrederickscloned conceptually, not necessarily via that interface
17:26arrdemgfredericks: since you don't believe in units check my math. https://www.refheap.com/85613
17:27gfredericksarrdem: lol I made a project called meajure like 5 years ago
17:27arrdemhttp://github.com/arrdem/meajure <= but mine's maintained!
17:29dbascharrdem: this may be interesting to you: https://github.com/dbasch/clj-brainwallet/blob/master/src/brainwallet/core.clj
17:30gfredericksdbasch: when you use with-meta, the object is copied and the new copy has the supplied metadata; that's what I mean by cloning
17:32toanHi guys, would like to sort this, ["Fools" "fall" "for" "foolish" "follies"] where caps don't matter.
17:32toanresult should be ["fall" "follies" "foolish" "Fools" "for"]
17:32gfredericksyou can use sort-by together with some case-thing in the String class
17:32toanI'll look it up
17:33dbaschgfredericks: but doesn’t that depend on the particular implementation of with-meta for the type?
17:33toanthx
17:33gfredericks,(sort-by String/CASE_INSENSITIVE_ORDER ["Fools" "fall" "for" "foolish" "follies"])
17:33clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String$CaseInsensitiveComparator cannot be cast to clojure.lang.IFn>
17:33gerardchey all, I would like to do (start (Thread. #(some background work))) inside a Compojure route but this blocks
17:34gfredericksdbasch: well that's certainly what it does in all the cases I know of, and I'm sure is the intention of the withMeta method
17:34gerardcIs there a way around this?
17:34gfredericksgerardc: that shouldn't block
17:34gerardcI've tried the same using plain old Ring but I'd prefer to use Compojure routing if possible
17:35gfredericksgerardc: are you returning a response as well?
17:37gerardcgfredericks: not explicity. I'll simplify my example to just have (start (Thread. ...) in the route handler fn
17:39gfredericksdo you mean .start?
17:40dbaschgerardc: just curious why you’re using Thread and not future
17:40gfredericksthat's a good point tooo
17:40blrallo, anyone know if a yaml -> edn library exists? google-fu failing
17:41gerardcdbasch: so I tried future and that also blocked :P
17:41numbertenwhy doesn't this work?
17:41numberten,(comp Math/abs (partial - 5))
17:41clojurebot#<CompilerException java.lang.RuntimeException: Unable to find static field: abs in class java.lang.Math, compiling:(NO_SOURCE_PATH:0:0)>
17:42dbaschnumberten: because Math/abs is not a function
17:42numbertenah
17:42dbaschnumberten: wrap it in a #( %)
17:43gerardcdbasch, gfredericks: ok I can't reproduce now :/
17:43dbasch,((comp #(Math/abs %) (partial - 5)) 7)
17:43clojurebot2
17:43gfredericksI wonder if there's any good reason for the compiler not to coerce it to a function
17:43numberten,(comp #(Math/abs %) (partial - 5))
17:43clojurebot#<core$comp$fn__4192 clojure.core$comp$fn__4192@8d9f9f>
17:43numberten,(type Math/abs)
17:43clojurebot#<CompilerException java.lang.RuntimeException: Unable to find static field: abs in class java.lang.Math, compiling:(NO_SOURCE_PATH:0:0)>
17:43gerardcthanks for your time guys, I'll do some more digging
17:43numbertenwhat is it?
17:44dbaschnumberten: it’s a static method from a java class
17:44gfrederickswhich is not anything unless you use it in the call position
17:44numbertenalright thanks
17:53gfredericksoh promise is not IObj explicitly, just by virtue of being defined with reify
17:55gfredericksI hadn't thought of that as a potentially dangerous aspect of reify before
17:58bbloomgrumble grumble metadata
17:58bbloomso useful, so arbitrary
18:00kzarMy profiles.clj doesn't seem to be being used now, it worked a moment ago
18:00AimHere"We kill people based on metadata"
18:01arrdemAimHere: move along, move along
18:01kzarTried restarting emacs on the off chance but nope :(
18:06gfrederickskzar: you're saying this based on the heap size of the process created by cider-jack-in?
18:06kzarYea, based on the output of (.maxMemory (java.lang.Runtime/getRuntime))
18:07kzarit's coming back as 124 meg instead of 10 gig, it's frustration because it worked before
18:07gfrederickswhat about if you do `lein repl` from a shell?
18:07kzaryea I tried that as well
18:07gfredericks...and?
18:07kzaralso I noticed when looking at the running java proceses that I can't see the -Xmx10G option there
18:08kzarno luck
18:08gfredericksthat still doesn't tell me which way it went
18:08gfredericksyou mean it was 124 meg there too?
18:08kzarSorry, yea that's what I mean
18:08gfredericksand this is regardless of where you run `lein repl`?
18:09kzarboth for running the repl manually with `lein repl` and using M-x cider-jack in
18:09gfredericks`lein repl` is sensitive to whether you start it in a project or not
18:09gfredericksso that's what I meant by "where"
18:10kzaroooh, just in my home directory (no projects.clj present)
18:15kzarOK I'm giving up for tonight, sure it's something obvious but too tired
18:15kzarty for help, cya
18:17gfrederickslein-pprint can help with sanity-checking
18:23ticking_wow I think I finally groked kovasbs session project, it could basically replace git,lein, maven, editors and every code search tool out there
18:38gmac_Banging my head against Emacs-Live/cider/nRepl/Leiningen/Clojure
18:38gmac_Moving parts just don't seem to want to co-operate.
18:39gmac_I open a project.clj file from my Luminus project in Emacs Live then M-x cider-jack-in. Copy some code from a file in the project into the cider repl and next thing it's "nrepl server not connected".
18:41gmac_Tried to eval an s-exp in one of the files and it didn't seem to be aware of the specified namespace
18:41blrgmac_: no error message of any sort when you jack-in?
18:41blrgmac_: ah, you have to switch to the namespace in your current buffer first with C-c M-n
18:41gmac_No. Shows a connection and opens a split window
18:41blryou could see the repl display foo.core> if that works
18:42gmac_No. lum.repl>
18:42blrthen you can start evaluating forms, or the whole buffer
18:43gmac_Switch to which namespace? The file has the namespace clearly specified.
18:43blrthe repl didn't return anything like #<Namespace foo.bar>?
18:43blrwell the repl just starts in the user ns, you need to tell it to change to the namespace in your file/buffer
18:43gmac_Yes. "lum" is the name of the project
18:44blrwhat's the name of the file you're working on?
18:44gmac_Why is the error "nrepl server not connected" if there's only a namespace issue?
18:45maik_hey what clojure book would you recommend? I have no experience with lisp but I know Haskell. Is the new book "The Joy of Clojure" any good?
18:46gmac_blr: db.clj
18:46blrnot sure gmac, is lein on your path?
18:47gmac_blr: I just entered it's namespace into the repl
18:47gmac_blr: Now I get lum.models.db> prompt
18:47gmac_blr: ... but when I eval an s-exp I still get the nrepl connection error
18:48blrok, now if you evaluate a form from your buffer with C-x C-e you still get that error?
18:48blrbugger, not sure :/
18:49gmac_The whole Emacs/cider/lein nrepl mixture seems so fragile. When I add cljs into the mix, as I intended, god knows what mess I'll end up in.
18:50gmac_I think this type of thing is a serious barrier to widespread adoption of Clojure given that Emacs/nRepl are the path to enlightenement.
18:52gmac_I've been programming for over 10 years but this lot has me beat. I also need something that's teachable, which this is not - at least in its current state.
18:52gmac_Anway, enough of my moaning.
18:52gmac_Thaks for the help.
19:38numbertennot sure what happened but I'm unable to require this code that was working moments ago
19:38numbertengetting lots of unable to resolve symbol in this context errors. it seems like the file lost forward references or something
19:39numbertenvery confused
19:49gfredericksforward references?
19:50numbertenI've been working with this source that had forward references so for example: (def a b)
19:50numbertenand it was working fine, up until now. Now i'm getting errors because b has yet to be declared
19:52numbertenI think I know what happened
19:52numbertenI think I was working step by step in the repl using :reload
19:52numbertenso it had the references already, even though they came later in the source
19:53gfredericksyeah that was going to be my guess
19:53numbertenbut once I restarted the repl and tried to load everything again, the source was uncompilable
19:53gfrederickssee declare if you want to maintain your ordering
19:53numbertenalright thanks
20:38kenrestivogmac_: try lighttable?
20:57msmolhi. I see that in jdbc, create-table has been deprecated. what is the replacement?
20:57brainproxyanyone using a clojure workflow involving docker?
20:58brainproxyand/or vagrant
20:58brainproxyfa
21:01FrozenlockAny tips on how to server static files with compojure? Like with a big button "download!"
21:07gfredericksfrom resources?
21:07fortruceFrozenlock: you could use (route/resources "/") to serve static resources from "resources/public" by default
21:21Frozenlockgfredericks: Of course...
21:21blris there a better way to get a file extension than (tail (str file) 4) where file is a java.io.file?
21:22fortrucesplit on '.'?
21:22Frozenlockfortruce: with a `last' somewhere, in case of "my-filename.fr.txt"
21:22Frozenlockregexp?
21:23blrwell, or a regex
21:24fortruce,(last (clojure.string/split "test.txt" #"\."))
21:24clojurebot"txt"
21:24gfredericks,(let [a (atom 0)] (swap! a (fn [_] (swap! a inc))))
21:24clojurebotExecution Timed Out
21:24fortrucehaha
21:25gfredericksmine is about to hit a billion
21:26blrah of course, thanks
21:53justin_smithFrozenlock: blr: do look out for the likes of file.txt.gz
21:53justin_smithall of txt.gz is important, and .txt is arguably the more important part
21:53bbloomDear Clojure folks, thank you for not evangelizing dickishly
21:54Frozenlockjustin_smith: oh right, gz appends its own extension. That could be problematic :-p
21:54fortrucejustin_smith: nice catch
21:54Frozenlockbbloom: Context?
21:54bbloomFrozenlock: https://twitter.com/dibblego
21:55fortrucebbloom: reminds me of a recent Giant Robots podcast, claimed the Clojure community was not quite so polarized as others (particularly rails)
21:55FrozenlockGoddamnit twitter
21:55FrozenlockAnyway to see that as a log or something?
21:55lockscan we swear in here?
21:56bbloomFrozenlock: you can click them & it sorta makes sense to read in order kinda
21:56FrozenlockI see... kinda
21:56FrozenlockThe marvels of social media
21:56locksfortruce: rails is toxic because… dhh
21:57locksthat's why I avoided it as long as I could
21:57fortrucelocks: he does have some strong opinions he doesn't mind stating
21:57locksthe ruby community is great though
21:57bbloomsome guy i don't know told me that I need to "Learn properly" and explained to me that I'm the enemy b/c i'd prefer java idioms such as looping over inner classes...
21:57locksfortruce: it's more how he states them, than the opinions but yeah
21:57fortrucei missed fridays DHH Martin Fowler, etc tdd talk :/
21:57bbloomi practically didn't say anything, & this guy went on a rant
21:57ddellacostabbloom: someone from the Rails/Ruby community?
21:57bbloomreminds me of bitemyapp
21:57kelseygihi frands
21:57bbloomnah haskeller, it seems
21:57dissipatebbloom, i've told people about clojure, but now i don't think i will. it's too 'foreign' for most, and the learning curve is a lot higher than some imperative language like python or ruby.
21:57locksfortruce: it's up on youtubes
21:57fortrucelocks: yea, just trying to find the right way to say it
21:58fortrucelocks: sweet, gonna go check it out
21:58ddellacostabbloom: ah. I am actually a friend of bitemyapp but it is in spite of his Haskell...advocacy
21:58kelseygidoes anyone hve a favorite resource on agents for newbies?
21:58blrbbloom: yeah, attitudes like that aren't doing the haskell community any favours
21:58arrdemololol bitemyapp
21:58arrdemthe reason I both will and won't learn haskell
21:58Frozenlockdissipate: clojure (and lisps) are a lot easier for newcomers. Just follow the parens, like in math.
21:58fortrucehaskell seems to have a "one true functional" air about the community
21:58dnolen_bbloom: tony morris, another person it's just best to ignore
21:59bbloomdnolen_: already blocked
21:59locks^ same
21:59blrI would like to think that bitemyapp and tony morris are not representative of the haskell community
21:59locksI started following some haskellers and ugh
21:59ddellacostaI don't get that attitude, frankly. People are going to do things you don't like in languages you don't like. Let them be and do your own thing.
21:59arrdemdnolen_: if you can just enjoy his twitter stream for the conviction it's bearable and kinda humorous but I understand if you can't be bothered.
21:59locksblr: I've had great interactions on the irc channel
21:59dnolen_arrdem: it's just boring
21:59ddellacostadnolen_: agreed
22:00arrdemdnolen_: that's definitely true.
22:00ddellacostaI do want to dig deeper into Haskell though, seems like a really great langauge
22:00ddellacosta*language
22:00dissipateFrozenlock, i've been working on the problems on 4clojure and it's frustrating figuring out why something doesn't work. i think awhile back when I was learning OCaml things were easier because the REPL would tell you in precise terms what the type of something was. with clojure i find myself reading the docs and still not understanding why something isn't working..
22:02justin_smithdissipate: though a given function may not always return the same datatype, each datatype has a type that you can easily check
22:02ddellacostaand actually if you listen to the folks "at the top of the Haskell food-chain," they are super easygoing about language comparisons; I saw a video recently where Simon Peyton Jones was speaking, without snark, of the utility of C# and Java
22:02bbloomit's pretty amazing how quickly twitter can reveal who isn't worth interacting with IRL
22:02justin_smithdissipate: and compared to other languages the repl is much more consistent to how a source file works
22:02ddellacostabbloom: we are who we are online and offline I think, in the end
22:03bbloomddellacosta: i'm mostly impressed by how much tone can be expressed in 140 chars
22:03ddellacostabbloom: ah, yeah, fair point
22:03arrdemddellacosta: mod some perceived liberties taken due to lack of direct interpersonal pressure
22:03fortrucesome of haskells community is really humble, my favorite quote from a haskellist was how without io all you do is make a computer hotter
22:03locksddellacosta: the one he calls haskell useless? ;P
22:03ddellacostaarrdem: it's true, but choosing to take advantage of that expresses your character too
22:03ddellacostalocks: yeah!
22:04ddellacostalocks: that cracked me up but I guess he's always said that, huh?
22:04kenrestivothere have always been fanbois. there always will be fanbois.
22:04arrdemddellacosta: agreed as best exemplified in the case of Xah in the last few days
22:04dissipatelocks, i saw the video of SPJ calling Haskell 'useless'. i think the real reason he says that is because he knows the average developer will never be a Haskeller
22:05dissipatea company like Microsoft absolutely must pander to the average developer
22:05arrdemand bitemyapp in my own IRL experience.
22:05ddellacostaarrdem: didn't see that, but maybe I'll avoid it since it sounds bad, whoever that is...
22:05locksdissipate: that isn't quite the context :P
22:05dissipatelocks, how is it not the context? why would a hard core Haskeller give a damn about C#?
22:05arrdemddellacosta: http://www.reddit.com/r/emacs/comments/25pjtb/im_about_as_good_as_dead_the_end_of_xah_lee/
22:05bbloomdissipate: SPJ has a knack for story telling. using the word "useless" is to draw you in... he doens't literally mean having no use. the word is a stand in for effect-less
22:06ddellacostadissipate: whether or not that may be the case, I think the fact is that he really has no arrogance about it on some level, compared to some folks
22:06kenrestivothe lisp world used to be like that. http://c2.com/cgi/wiki?SmugLispWeenie now i guess it's haskell
22:06ddellacostadissipate: I find (generally) the more skilled people are the less time they have for peacock displays
22:06lockswhat bbloom said
22:06arrdemkenrestivo: I think there's still plenty of that left over in common lisp and scheme...
22:07dissipateddellacosta, he works for a corporation that pays his salary that must cater to average developers. if it weren't for that, i seriously seriously doubt SPJ would give a dump about C# or Java.
22:07ddellacostaarrdem: oh, that guy. Yeah, I hope he figures his sh*t out
22:07bbloomdissipate: SPJ left msft recently, after 15 years or so
22:07locksbbloom: btw, I watched the clojure/west version of your talk, it still goes mostly over my head
22:07ddellacostadissipate: that may be the case, but I think the context was slightly different in that video locks and I were discussing
22:07bbloomdissipate: research in to GHC has had a major impact on .net & msft's C/C++ compilers/analyzers
22:07dissipatebbloom, i see. well i would be interested to know how much of his time he is devoting to C#. my guess is not much
22:08bbloomdissipate: probably mostly just typical cross polination of ideas among researchers & designers
22:08blrLinq fell out of his work at MSR didn't it? or was that from the ocaml/f# guys?
22:10bbloomblr: Linq was inspired by Haskell's comprehensions
22:10dissipatebbloom, have you seen the video of Brian Beckman where he says he wants to make Visual Basic 'the best programming language in the world'?
22:11bbloomdon't think so
22:12dissipatebbloom, i think this is the video: http://channel9.msdn.com/Blogs/Charles/Brian-Beckman-Monads-Monoids-and-Mort
22:12dissipatebbloom, he basically admits Microsoft is targeting average or even below average developers
22:13bbloomdissipate: that's not a surprise or an admission
22:14bbloomi don't think i've ever really understood what beckman has done at msft... what's his area of research exactly?
22:14danielcomptonbbloom why do you think Tony Morris's attitude is common to Haskellers?
22:15dissipatebbloom, languages i believe
22:15danielcomptonbbloom I've noticed similar comments from puffnfresh too
22:15bbloomdanielcompton: i don't think it's common to haskellers, i think it's common to zealots
22:15bbloomdean|away: and i think that the clojure community has an uncharacteristically low never of zealots
22:15bblooms/never/number
22:15blrthat video's from 2006 - did any of those efforts to improve VB manifest dissipate?
22:16dissipateblr, i don't know but there is no way VB is ever going to the 'the best programming language in the world'. quite the opposite actually. but i guess that's what these guys are researching.
22:16locksclojure has dnolen
22:17blrall the .net developers I know (.net has a bit of a stranglehold on NZ) use C#
22:17locksthat neutralizes about 20 zealots
22:17bbloomlocks: dnolen_ is far from a zealot
22:17ddellacostadanielcompton: I think that part of the problem is that those people are the loudest and get the most visibility. They don't necessarily represent the Haskell community though
22:17ddellacostadnolen is kind of the opposite of a zealot
22:17locksbbloom: exactly what I'm saying ;) he has the best laugh too
22:18bbloomheh, ok then... dnolen_ and others are what makes this community great: negative zealotry
22:18ddellacosta:-)
22:19FrozenlockI wonder if I should become a zealot to negate the negative zealotry. The universe needs equilibrium.
22:19bbloomFrozenlock: closed system fallacy
22:19locksyou are the chosen one Frozenlock
22:19ddellacostaFrozenlock: let the other communities balance it out
22:20Frozenlockbbloom: about the universe, or the clojure community? :-p
22:20dissipatestrange, i have yet to run into a logic programming zealot
22:20kelseygiooh i know one!
22:20kelseygishe’s awesome
22:20ddellacostadissipate: I wonder if it's because not enough folks are good at it
22:20bbloomFrozenlock: what ddellacosta said
22:21dissipatekelseygi, really?
22:21arrdemdissipate: they're hung up on the speed limitations of logical mathematics :C
22:21ddellacostad'oh
22:21kelseygiyeah! she doesn’t have twitter though so dunno if she even counts :)
22:21ddellacostakelseygi: she doesn't sound like a "bad zealot," but more an enthusiast from your description
22:22dissipateddellacosta, gotta be super hard core to be a logic programming zealot
22:22kelseygihaha true, the bar’s gotta be lower for logic programming though i’d htink
22:22ddellacostadissipate: I would assume so
22:22ddellacostakelseygi: touché
22:22kelseygiknowing what it is = enthusiast
22:22locksI had a Prolog class at uni
22:22locksso. cool.
22:22dissipateddellacosta, i'm going to become one. muhaha!
22:23kelseygiit makes me feel like my brain is being turned inside out
22:23bbloomdanielcompton: stuff like this: https://twitter.com/puffnfresh/status/467321065429950464 is depressing too
22:23ddellacostadissipate: although if you just want to get good at it, hell ya go for it
22:23lockskelseygi: isn't that the best feeling?
22:24locksbbloom: puff is just young enough to know everything :P
22:24ddellacostabbloom: I saw that one. The problem is that it is flamebait
22:24Frozenlockbbloom: Twitter per se is more depressing IMO.
22:24blrI worked at a company that bought a prolog based decision support engine, didn't understand it, and ended up wrapping the engine a ball of convoluted classic asp. It was.. a learning experience.
22:24dissipateddellacosta, na, that's too extreme for me. although i am interested in logic programming for specific use cases.
22:24ddellacostabbloom: I don't even necessarily disagree entirely, but it's a nuanced conversation that can't be had in 140 character chunks
22:24kelseygiit’s pretty cool, one of my vague goals with poking around in clojure is hoping to work up to core.logic actually
22:25danielcomptonblr: where in NZ are you?
22:25chchjesusNZ?
22:25locksnew zealand
22:25chchjesusYeye
22:25chchjesusI'm curious to know now too
22:25blrDunedin danielcompton, are you in NZ?
22:25kelseygiwhich
22:26kelseygispeaking of beginning in clojure
22:26danielcomptonblr Auckland
22:26chchjesusI'm from Christchurch
22:26danielcomptonchchjesus I could guess that
22:26kelseygidoes anyone have anything they recommend for learning about agents?
22:26blrcool, nice to see more kiwis interested in clojure :)
22:26blrthought it was just me and brehaut for ages
22:26ddellacostawow, are there Clojure gigs in NZ? Seems like it would be a nice place to live and work...
22:26chchjesusWe studied it at UC
22:26chchjesusIn our AI course
22:27danielcomptonddellacosta not a lot. There are a few companies using it but not many
22:27dissipateddellacosta, how about this experiment: as manager of a shop force everyone to use a logic based language
22:27blrare you guys using clj at work?
22:27ddellacostadanielcompton: gotcha
22:27danielcomptonddellacosta Of course remote work is always an option
22:27dnolen_kelseygi: do you have Clojure Programming? probably the most comprehensive coverage of all the concurrency constructs
22:27ddellacostadissipate: could backfire
22:27dissipateblr, nope. won't be ever
22:27kelseygii don’t, but sounds like i might have a reason to get it :)
22:27ddellacostadanielcompton: time zones are tough though
22:28danielcomptonddellacosta, especially when daylight savings kicks in both ways, a 6am start becomes a 4am start :(
22:28ddellacostadanielcompton: ugh!
22:28blrddellacosta: well, I made my workplace a clojure gig, by just using it :)
22:29kelseygidnolen_: to be clear, that’s this one http://www.clojurebook.com/ not the one by stuart halloway?
22:29dnolen_kelseygi: that plus Clojure Cookbook is a pretty comprehensive resource
22:29dissipateddellacosta, is there a logic based web framework? just get some hipsters to believe it's the next hot web thing, just like they did with node.js
22:29dnolen_kelseygi: yeah the O'Reilly not the Halloway one
22:29danielcomptonblr do you use ClojureCLR?
22:29kelseygisuspicious shadowing by a publication name...
22:29blrdanielcompton: no, not doing .net here (did many years ago), mostly python, but starting new projects in clojure
22:30danielcomptonblr what's your work?
22:30blruniversity of otago, faculty of medicine
22:30blrbuilding medical ontologies with web frontends using tawny-owl, liberator and other bits and pieces
22:31blrkeen to potentially rewrite an angular.js app using Om too, time allowing
22:31blrthat last one is a little hard to justify, as the angular app is actually pretty good :)
22:32lockswhy settle for good, when you can go for great
22:32locks#marketing
22:32dissipatehuh? it's all about Elm
22:32danielcomptonblr sounds great. Just tell them you're helping Om find it's place in the world.
22:32blryeah, I certainly would think twice about starting a new project in angular
22:32dissipateblr, why is that?
22:33dissipateangular is hot
22:33locksI can't sneak Om into work because I've already snuck ember.js (love it)
22:33locksbut I have a personal project for it
22:34dissipatelocks, what about Elm? have you tried that?
22:34locksdissipate: I looked at it, but it didn't appeal to me
22:36locksdissipate: I try to branch out, but there's only so many hours in the day ;\
22:37dissipatelocks, i see what you did there. :P
22:38kenrestivoit is funny how people doing back end work try to create a js-variant that is more like the back-end language they prefer. coffescript makes js like ruby. elm makes it like haskell. clojurescript makes it.... actually be clojure, thanks to clojure being a hosted language.
22:39lockskenrestivo: http://opalrb.org/
22:39locks;)
22:39dissipatekenrestivo, and asm.js goes full circle. nobody writing actual JS anymore.
22:40kenrestivogood point. i saw a presentation a while back where the guy was screaming "JUST GIVE ME BYTECODE!". his language was a bit saltier than that
22:40dbaschkenrestivo: it’s a long list https://github.com/jashkenas/coffeescript/wiki/List-of-languages-that-compile-to-JS
22:40blrdissipate: for a few reasons, I like react's model for components more than angular's directives, angular becomes unweildy in an app with a lot of behaviour/state. I think it's ideal for a CRUD app
22:41locksangular's team have some particular thought on things
22:42locksit's getting somewhat of a revamp for 2.0
22:42gfredericksclojure quiz: for what clojure object is (zero? (count ob)) true but (empty? ob) crashes?
22:42dissipatei think heavy client side JS apps are going to die a horrible death some day. it's going to be a wasteland. not pretty.
22:42blrdissipate: well yeah, they'll be replaced with native mobile apps, sadly.
22:42lockshaha
22:43dissipateblr, but i keep hearing that HTML 5 is going to eliminate native mobile apps
22:43blrgiven the current trajectory
22:43kenrestivodissipate: almost everything is going to be a horrible wasteland someday
22:44fortrucekent beck telling DHH he doesn't have enough self-confidence, priceless
22:44dissipatekenrestivo, so what is going to win eventually?
22:44locksfortruce: haha
22:44kenrestivodissipate: "eventually"? meaning when time ends?
22:44technomancygfredericks: something you reified?
22:44kenrestivothere is no eventually. the cycle continues endlessly
22:44blrkenrestivo: everything except emacs right.
22:44locksdissipate: that's not a question :P
22:45dissipatekenrestivo, when the human race ends
22:45zeroemWhat is the Protocol/interface required to control the behavior of `select-keys` ?
22:45gfrederickstechnomancy: nope I can get this object by calling a function in clojure.core with one innocuous arg :)
22:45dissipatekenrestivo, i want to cut to the chase and start using the technology that will be the last
22:45locksgfredericks: nil?
22:45gfredericks,(empty? nil)
22:45clojurebottrue
22:46kenrestivoblr: emacs, CD's, and keith richards will still be around after our bodies have returned to the loam and the cities are but dust.
22:46kenrestivo (h/t patton oswalt... i love that line)
22:46lockskeith richards is getting younger
22:46dnolen_zeroem: ILookup
22:46blramen
22:46kenrestivoi heard dick clark actually died but i never believed that was going to happen
22:47zeroemdnolen_: thanks
22:47dissipatekenrestivo, and Java? noooooo
22:48kenrestivocobol is still around. whatever. betting on what's goign to "win" seems a fool's errand to me
22:48locksI'm with kenrestivo
22:48dnolen_zeroem: actually, it looks like its Associative, select-keys uses `find` not `get`
22:48zeroemoi, roger
22:49gfrederickstechnomancy: okay you can stop sitting on the edge of your seat I will just tell you what it is
22:49gfrederickstechnomancy: it is (transient [])
22:49dissipatekenrestivo, will you even speculate on the post-Microsoft era? after MS dies off
22:49technomancygfredericks: dun dun dun
22:50technomancyinteresting
22:50kenrestivooh, transient!
22:50kenrestivowhat's the use case for transient anyway?
22:50fortrucespeed!!
22:50gfredericksquickly modifying a persistent data structure a bumch of times
22:50zeroemaaand it turns out it was a bad test. Thanks for the help though :)
22:51gfrederickskenrestivo: (source frequencies) is a good example
22:51dissipatekenrestivo, it's to allow you to do a lot of rapid mutations on something, similar to what you get with OOP.
22:52kenrestivogfredericks: cool, thanks.
22:53dbaschTransientVector implements Indexed which extends Counted
22:54dbaschbut not Sequential
22:58dbaschor Seqable
23:05dissipatedbasch, not even seqable? that's crappy
23:05dbaschapparently none of the transient collections do
23:06dbasch,(last (transient [1 2 3]))
23:06clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.PersistentVector$TransientVector>
23:07dissipateyikes, that's limited. :(
23:08numbertenis there a way to lose all the previous declared vars in the repl when re-requiring a namespace?
23:08numbertenI've got a problem in vim-fireplace, where a previous test that has since been deleted keeps reappearing when I run-tests
23:10mangedissipate: I don't think they should implement seqable, because that would require the whole collection to be copied into a seq in one operation (otherwise mutating the collection would potentially mutate parts of the seq which hadn't been realised yet).
23:20technomancynumberten: ns-unmap it first
23:22numbertenah
23:22numbertenthank you
23:22numbertenstrange that vim-fireplace's :Require doesn't do that automatically
23:26dissipatemange, so what *can* you do with a transient?
23:32danielcomptondissipate fast mutations
23:32danielcomptondissipate assoc, dissoc
23:36amalloygfredericks: dangit, i read the scrollback backwards, trying to figure out what you were telling technomancy about transients. then i got to the beginning and found out it was the answer to a quiz
23:37mangedissipate: Mutate it. Only use transients if you're building a structure, not if you're consuming one. General "shape" (conceptually) should be (-> coll transient mutate mutate ... mutate persistent!).
23:39dissipatemange, i see. but some may consider that heresy
23:39mangeConsider what heresy?
23:40dissipatemange, using mutations instead of things like map, filter, reduce etc.
23:42mangeSorry, my use of the word "mutate" is confusing. Transients should be treated like other collections (ie. use "assoc" and you get given a new map with the key/val put in), but they internally mutate their structure (making the original argument now invalid). When I say "mutate" I mean that you should still use "assoc"/"dissoc"/"conj"/etc as usual, but you can't use any earlier versions of the collection.
23:43mangeThe point of transients is that they *are* mutable, for speed's sake. You use them the same way as you would a persistent collection, except that things like "seq" won't work on them (because the seq could look at the collection in two inconsistent states).
23:51amalloyby the way, mange, i created http://dev.clojure.org/jira/browse/CLJ-1423 (bbloom was involved in that discussion too iirc)
23:55yeoj___does anyone know if there is any good way to use sql korma with an existing database model ? I need to reverse engineer what is already there/etc.
23:55mangeamalloy: Nice! Good find with that.
23:56jeremyheileryeoj___: maybe use honeysql instead? it's sql as data, so it's easier to customize.
23:56yeoj___jeremyheiler: ok sounds good