#clojure log - May 18 2014

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

0:01 johnjelinek: joshhead: I'm all for minimal dependencies

0:26 quizdr: anyone using websockets in clojure?

0:26 johnjelinek: does anyone use bower in a clojurescript app?

0:29 ToBeReplaced: quizdr: sorry if unhelpful since i'm about to leave, but see jetty9-websockets-async and chord on github

0:30 quizdr: ok thanks ToBeReplaced

0:31 ToBeReplaced 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?

0:52 joshhead: johnjelinek: https://github.com/joshhead/om-brepl

0:52 johnjelinek: joshhead: thanks

0:52 joshhead: johnjelinek: The readme's empty, I'm not sure if the code or the explanation is more useful

0:53 johnjelinek: joshhead: I'll let you know

0:53 joshhead: johnjelinek: well there's no explanation so at least you can tell me if the code helps :)

0:55 johnjelinek: so 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?

0:56 numberten: is there a function that prettyprints s-expressions?

0:56 joshhead: johnjelinek: yes, you can take out line 13 too

0:56 johnjelinek: ahh, right

0:56 joshhead: johnjelinek: it's not really optimized for production, I'd probably make a few changes beyond that

0:56 johnjelinek: ok

0:57 joshhead: I 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'

0:57 numberten: also unrelated, but what would you refer to default functions belonging to? the prelude? standard library? something else?

0:58 quizdr: numberten you mean functions that are a part of clojure core?

0:58 andyf: numberten: pprint in clojure.pprint namespace

0:58 quizdr: you can say "core functions" to mean those that are a "standard" part of the language

0:59 numberten: thanks to both of those

0:59 andyf: i just found this: http://richhickey.github.io/clojure-contrib/pprint-api.html

0:59 joshhead: johnjelinek, and finally If you run "lein trampoline cljsbuild repl-listen" as inferior lisp in emacs, you can eval code interactively, tadaa

1:00 andyf: richhickey.github.io is no longer maintained or updated, I believe

1:00 johnjelinek: cool, thx

1:00 numberten: andyf: alright thanks

1:00 johnjelinek: joshhead: I built a little boilerplate project from one of the om tutorials that includes ring/compojure in it

1:01 this way it'd host on localhost:8080 instead of needing to do pythong -m SimpleHTTPServer

1:01 andyf: Google clojure API to find more up to date one

1:01 joshhead: johnjelinek: mm, yes I knew I'd seen one before, I also found this example https://github.com/magomimmo/modern-cljs/tree/master/cljs-tutorial

1:02 it's more complete than mine and has documentation

1:02 but I wasn't sure I liked including ring just to test some clojurescript

1:02 johnjelinek: that one seems a bit more involved

1:03 there's one example out there that exposes a lein alias that spins up ring + cljsbuild

1:40 ivan: is there a way to use cljsbuild with a snapshot version of clojurescript? cljsbuild's parse-version crashes on a "0.0-SNAPSHOT" cljs dep

1:46 well getting rid of a block of version-checking code in cljsbuild seems to have fixed the problem

3:00 johnjelinek: does anyone know how to get cider to serve a clojurescript repl?

3:00 I want to be able to compile the buffer to the clojurescript repl

4:39 numberten: is there a way to see the returntype of a function?

4:40 like a (return-type str) => java.lang.String

4:52 dissipate: ,(#(apply hash-map (conj (into [] (interpose %1 %2)) %1)) 0 [:a :b :c])

4:52 clojurebot: {:c 0, :b 0, :a 0}

4:53 dissipate: ,(#(into {} (conj (into [] (interpose %1 %2)) %1)) 0 [:a :b :c])

4:53 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword>

4:53 dissipate: why? why does the 'apply hash-map' work, but not 'into {}'?

4:54 ,(#(apply hash-map (conj (into [] (interpose %1 %2)) %1)) 0 '(:a :b :c))

4:54 clojurebot: {:c 0, :b 0, :a 0}

4:55 dissipate: ,(#(apply hash-map (conj (into [] (interpose %1 %2)) %1)) 0 #{:a :b :c})

4:55 clojurebot: {:c 0, :b 0, :a 0}

5:18 numberten: shouldn't this be the function that always returns 0?

5:18 ,#(0)

5:18 clojurebot: #<sandbox$eval25$fn__26 sandbox$eval25$fn__26@113abe4>

5:19 numberten: ,((fn [] 0))

5:19 clojurebot: 0

5:19 numberten: ,(#(0))

5:19 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>

5:40 dissipate: numberten, what are you trying to do?

5:41 ,#(identity 0)

5:41 clojurebot: #<sandbox$eval25$fn__26 sandbox$eval25$fn__26@b93a6>

5:41 dissipate: ,(#(identity 0) "blah")

5:41 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox/eval51/fn--52>

5:41 numberten: ,(#(identity 0))

5:41 clojurebot: 0

5:41 dissipate: ,(#(identity 0))

5:41 clojurebot: 0

5:41 numberten: weird that you need identity in there

5:42 i was just trying to make a boilerplate function

5:42 i soon realized that clojures dynamic types meant I could use 'nil' >.>

5:43 dissipate: numberten, a boilerplate function to do what?

5:43 numberten: but it just left me wondering why (#(0)) wasn't equal to ((fn [] 0))

5:43 a temporary value in a configuration structure

5:44 meaningless beyond just being there to show it needs to be replaced

5:44 dissipate: numberten, you got me. i'm discovering quirks in clojure every day!

5:44 numberten: hah yea

5:46 dissipate: numberten, i still don't know how '& args' works in functions exactly. doesn't work how i expected, in any event.

5:46 numberten: I think & args binds args to a sequence containing the rest of the arguments

5:47 dissipate: numberten, yeah, but it doesn't work for me in certain forms

5:47 numberten: ,((fn [a & args] (seq? args)) 1 2 3)

5:47 clojurebot: true

5:48 numberten: ,((fn [a & args] (println args))

5:48 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading>

5:48 numberten: ,((fn [a & args] (println args)))

5:48 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: sandbox/eval177/fn--178>

5:48 numberten: ,((fn [a & args] (println args)) 1 2 3)

5:48 clojurebot: (2 3)\n

5:49 numberten: dissipate: weird

5:49 i've yet to actually use it

5:49 so i've yet to see it not work!

5:49 dissipate: numberten, i have an example, if you want to see

5:50 numberten: sure

5:50 also this is pretty strange

5:50 dissipate: i'll put it on refheap

5:50 numberten: ,(range -1.0 1.0 0.1)

5:50 clojurebot: (-1.0 -0.9 -0.8 -0.7000000000000001 -0.6000000000000001 ...)

5:51 dissipate: numberten, because of the approximate values?

5:51 numberten: yeah

5:51 it's just funny because it ends up giving you more than you'd expect

5:51 dissipate: not too strange. just some quirk of how the numbers work.

5:51 numberten: ,(count (range -1.0 1.0 0.1))

5:51 clojurebot: 21

5:51 numberten: ,(count (range -10 10 1))

5:51 clojurebot: 20

5:52 dissipate: hmm, that is a bit strange

5:52 numberten: yeah beause the tail end of the range

5:52 approaches 1.0

5:52 so it acts as if the range is inclusive

5:53 when usually (range x y) is exclusive in regards to y

5:53 ,(range 0 3)

5:53 clojurebot: (0 1 2)

5:54 numberten: thankfully having an extra data point isn't a problem for my usecase

6:04 dissipate: numberten, https://www.refheap.com/85603

6:04 i want to rewrite 'cyclen' so that it is a function that takes in an arbitrary number of cycles

6:04 haven't been able to do this successfully yet

6:09 numberten: hrm

6:15 took me a second to understand what it's doing

6:15 since i'm not used to n-arity map

6:26 got it

6:26 dissipate:

6:27 dissipate: numberten, cool, what's the solution?

6:28 numberten: (defn cyclen [& rest] (apply (partial map #(every? identity %&)) rest))

6:28 the problem I was having is that rest returns your vectors in a seq, and mapping over the seq isn't want you want

6:28 you want to use the n-arity map over the vectors

6:29 so you have to apply the partially applied map function

6:29 to the seq

6:29 which puts it back into the form (map fn v1 v2 v3)

6:29 dissipate: damnit

6:29 numberten: not working?

6:29 dissipate: i was so close. i tried the same thing, but i used 'comp' instead of 'partial'

6:30 numberten: ah

6:30 dissipate: hmm, so why does partial work but not comp?

6:31 numberten: partial turns (map fn) into an actual function that can be passed as the first arg to 'apply'

6:31 dissipate: and comp does not? :(

6:31 numberten: comp takes 2 functions and passes a value through both.. hard to explain without types

6:32 if 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

6:33 the order above might be wrong, but the general gist is the same

6:34 so (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

6:34 but since map requires at least arguments, it still wouldn't be fully applied

6:34 dissipate: yep, i see. partial takes a single function and a partial of its args and returns a function that accepts the rest of the args

6:34 numberten: at least 28

6:34 at least 2*

6:34 yea

6:36 dissipate: well, thanks for that solution. i was going crazy. :O

6:37 numberten: no problem, glad to be able to help

6:37 i owe #clojure, for all the questions i've been asking >.>

6:40 dissipate: going from imperative languages to functional languages is no joke. :O

6:41 but i am proud to announce that i got problem #22 on 4clojure correct on the first try. w00t!

6:45 numberten: oh cool, never heard of that site

7:38 adsisco: hi, 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?

7:53 https://www.irccloud.com/pastebin/6ZfhzDUB

7:53 why does this not work?

7:57 whodidthis: http/get, method post sounds quite weird at least

7:59 adsisco: lol ya, i added that in by mistake

7:59 ignore em

8:04 whodidthis: maybe check out if theres anything in :error of response

8:11 adsisco: clj-http works flawlessly

8:23 gfredericks: anybody have thoughts about using component for batch jobs?

8:24 I know it's ~7am on a sunday and so the answer is no

8:24 but I asked it anyways.

8:31 maybe 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

8:49 s/channel/promise/

11:02 patrickod: I'm using korma at the moment with a model (def message (belongs-to user))

11:02 when 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:03 actually it is. weird

13:19 dissipate: what is the difference between 'hash-map' and 'into {}' ?

13:20 arrdem: ,(doc hash-map_

13:20 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading>

13:21 arrdem: ,(doc hash-map)

13:21 clojurebot: "([] [& 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:21 arrdem: ,(doc into)

13:21 clojurebot: "([to from]); Returns a new coll consisting of to-coll with all of the items of from-coll conjoined."

13:22 arrdem: dissipate: structure of the keyvals it looks like..

13:22 ,(into {} [[:a :b] [:c :d]])

13:22 clojurebot: {:a :b, :c :d}

13:22 arrdem: ,(hash-map [:a :b] [:c :d])

13:22 clojurebot: {[:a :b] [:c :d]}

13:24 dissipate: arrdem, hmm, that's strange

13:25 pyrtsa: ,(hash-map :a :b :c :d)

13:25 clojurebot: {:c :d, :a :b}

13:26 dissipate: ,(into {} [:a :b :c :d])

13:26 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword>

13:26 dissipate: what the heck

13:26 pyrtsa: dissipate: The values have to be key-value pairs.

13:26 arrdem: into conj's the elements of the seq. conjing a keyword onto a map isn't meaningful.

13:27 pyrtsa: ,(into {} [[:a 1] [:b 2] [:c 3]])

13:27 arrdem: you have to conj a k/v pair

13:27 clojurebot: {:a 1, :b 2, :c 3}

13:27 dissipate: ,(into {} ['(:a :b) '(:c :d)])

13:27 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.util.Map$Entry>

13:28 dissipate: ,(into {} [[:a :b] [:c :d]])

13:28 clojurebot: {:a :b, :c :d}

13:29 dissipate: why does it not like lists?

13:29 arrdem: ,(vector? (first {:foo :bar}))

13:29 clojurebot: true

13:29 arrdem: dissipate: ^

13:29 llasram: Which isn't really really true. It's special-cased

13:30 dissipate: ,(first {:foo :bar})

13:30 clojurebot: [:foo :bar]

13:30 llasram: (class (first {1 2}))

13:30 ack

13:30 ,(class (first {1 2}))

13:30 clojurebot: clojure.lang.MapEntry

13:30 dissipate: and why is it a vector? special case?

13:30 llasram: It's a sub-class of APersistentVector

13:30 dissipate: this isn't intuitive. :(

13:31 llasram: It's pretty weird

13:31 arrdem: agreed

13:31 wei__: what’s the short way to write (-> system add-cowbell add-cowbell add-cowbell)

13:31 I’m thinking something like repeat or iterate

13:32 dissipate: (take 3 (constantly add-cowbell))

13:32 llasram: Then `.cons` (despite name, backing method for `conj`) on persistent maps specially handles 2-entry vectors

13:32 pyrtsa: wei__: (take 3 (iterate add-cowbell system))

13:32 arrdem: dissipate: that doesn't really make sense because it's really iterate.

13:32 llasram: So map entries are vectors, and `conj` can treat vectors as map entries

13:32 arrdem: (nth 3 (iterate add-cowbell system))

13:32 pyrtsa: arrdem: Ah, you're right.

13:33 wei__: cool thanks

13:34 hyPiRion: Is there some guarantee that iterate won't be chunked?

13:34 dissipate: llasram, these quirks are not good for beginners learning clojure. it's actually pretty confusing.

13:34 arrdem: hyPiRion: I don't think so, but if add-cowbell is pure it doesn't matter.

13:34 pyrtsa: hyPiRion: Looks like there isn't.

13:34 (doc iterate)

13:34 clojurebot: "([f x]); Returns a lazy sequence of x, (f x), (f (f x)) etc. f must be free of side-effects"

13:34 arrdem: wei__: add-cowbell had better be pure

13:35 wei__: yes, it is

13:35 otherwise, I would use repeatedly

13:35 hyPiRion: right, then it's good

13:35 * arrdem claps his hands

13:35 arrdem: good!

13:36 hyPiRion: well, repeatedly is not chunked, although I would be a bit careful using it that way

13:36 rather do (dorun (map #(%) (repeat 3 add-cowbell))) instead

13:37 (or even better, (dotimes [_ 3] (add-cowbell))

13:39 wei__: you need to add-cowbell to system though

13:39 I’m looking for f(f(f(x))), or whatever

13:40 arrdem: wei__: right. that's iterate, since f is pure

13:40 wei__: oh btw nth takes the collection first— but otherwise your solution works for me

13:42 dissipate: wei__, looks like its an infinite sequence, not a collection

13:45 amalloy: uh, sequences are collections

13:47 pyrtsa: amalloy: With the gotcha that nil is a sequence but not a collection.

13:47 ,(coll? (take-last 0 [1 2 3]))

13:47 clojurebot: false

13:47 amalloy: pyrtsa: pretty sure it's neither

13:47 arrdem: ,(seq? nil)

13:47 clojurebot: false

13:47 pyrtsa: Ouch, I stand corrected. But nil is seqable.

13:47 arrdem: ,(doc coll?)

13:47 clojurebot: "([x]); Returns true if x implements IPersistentCollection"

13:48 arrdem: ,(coll? nil)

13:48 clojurebot: false

13:48 amalloy: pyrtsa: as is every collection

13:48 arrdem: (inc amalloy) ;; karma for the insanities of clojure

13:48 lazybot: ⇒ 107

13:48 pyrtsa: (inc amalloy)

13:48 lazybot: ⇒ 108

13:52 hyPiRion: nil is void

13:52 ,(conj {} nil)

13:52 clojurebot: {}

14:08 dissipate: ,(conj {} (and))

14:08 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Boolean>

14:09 dissipate: ,(conj {} [(and) (or)])

14:09 clojurebot: {true nil}

14:18 fortruce: can anyone help me understand why this is failing, its completely stumping me: https://www.refheap.com/85609

14:27 ambrosebs: Bronsa: is :end-column different for different collections?

14:27 there seems to be an off-by-one error for maps vs other things

14:28 Bronsa: I'll find a specific example.

14:30 Bronsa: ambrosebs: might be a bug, there shouldn't be any difference between maps & other colls

14:30 ambrosebs: yeah an example would be helpful, I can't reproduce with a simple map http://sprunge.us/YJQR

14:31 ambrosebs: (-> "[]" ((comp tr/read readers/indexing-push-back-reader)) meta :end-column) => 3

14:31 (-> "{}" ((comp tr/read readers/indexing-push-back-reader)) meta :end-column) => 2

14:32 Bronsa: ambrosebs: oh, you're probably using 0.8.3

14:32 I fixed that in 0.8.4 I believe

14:32 ambrosebs: nice :)

14:34 Bronsa: line info for non IObj values are unrecoverable?

14:35 Bronsa: ambrosebs: yeah, there's really no place to store the info

14:36 ambrosebs: Bronsa: is wrapping them in a quote an option?

14:37 (I don't really know what quote does at that level tbh)

14:37 Bronsa: ambrosebs: you just get (quote thing) back

14:38 and no, that wouldn't work

14:38 ambrosebs: t.r currently only attaches source info to symbols/colls literals, not to expanded reader macros

14:39 also wrapping in a quote might break some macros probably

14:40 arrdem: quote wrapping would be very risky.

14:44 ambrosebs: Bronsa: possible to attach metadata in the enclosing sexpression, if present?

14:45 arrdem: you'd have to write some strange support for looking up metadata from something along the lines of (nth (:children (meta <parent>)) n)...

14:47 Bronsa: ambrosebs: yeah, I guess that might be possible

14:48 (meta [1 2 3]) could return something like {::children [{:line 1 :column 2 ..} {:line 1 :column 4 ..} ..] ..}

14:49 ambrosebs: that would be great

14:50 Bronsa: it's probably not too hard to do, let me see

15:04 ambrosebs: uhm, so it's reasonable for lists/vectors but maps/sets are unordered. a :children vector doesn't really make much sense

15:08 ambrosebs: Bronsa: damn

15:09 Bronsa: wrap everything in a `do`? :P

15:10 Bronsa: ambrosebs: still gonna cause problems with macros

15:10 ambrosebs: ahk

15:10 bugger

15:10 that's unfortunate

15:11 Bronsa: ambrosebs: 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:12 arrdem: ,(meta (first (into {} [ ^foo [:bar :baz]])))

15:12 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: foo in this context, compiling:(NO_SOURCE_PATH:0:0)>

15:13 arrdem: ,(meta (first (into {} [ ^{:foo true} [:bar :baz]])))

15:13 clojurebot: nil

15:14 ambrosebs: Bronsa: good idea

15:19 Bronsa: is () supposed to be missing metadata?

15:20 forgot to update

15:20 fixed in 0.8.4?

15:22 yep I see it is

15:22 mskoud: How fo i call java.util.UUID.randomUUID(); from Clojure?

15:23 arrdem: mskoud: you have to import java.util.UUID and then say (. java.util.UUID randomUUID)

15:23 mskoud: Thx!

15:23 hyPiRion: arrdem: not sure if you have to import it

15:24 ,(java.util.UUID/randomUUID) ; suffices, I think

15:24 clojurebot: #uuid "f48ce140-4615-4935-a220-fa72b7b78af5"

15:24 arrdem: hum. ok you get it for free then.

15:24 mskoud: nice :-)

15:31 gfredericks: hyPiRion: that does assume it's already loaded though

15:32 which it probably is in this case but maybe a bad habit in general

15:32 hyPiRion: gfredericks: yeah, I was kind of wondering when you're forced to do it and when you're not

15:33 Bronsa: ambrosebs: yeah 0.8.4 fixed a bunch of source info meta

15:33 ambrosebs: Bronsa: I probably rediscovered most of them while offline today

15:33 :)

15:36 gfredericks: hyPiRion: 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:36 ,clojure.walk/postwalk

15:36 clojurebot: #<CompilerException java.lang.ClassNotFoundException: clojure.walk, compiling:(NO_SOURCE_PATH:0:0)>

15:36 gfredericks: ,clojure.java.io/resource

15:36 clojurebot: #<io$resource clojure.java.io$resource@81560>

15:36 gfredericks: ,java.util.UUID

15:36 clojurebot: java.util.UUID

15:37 gfredericks: ,java.util.zip.CheckedOutputStream

15:37 clojurebot: java.util.zip.CheckedOutputStream

15:37 * gfredericks was trying to guess a class that hadn't been imported

15:37 hyPiRion: ,java.util.LinkedHashMap

15:38 clojurebot: java.util.LinkedHashMap

15:38 hyPiRion: ,javax.print.attribute.standard.PrinterStateReasons

15:38 clojurebot: javax.print.attribute.standard.PrinterStateReasons

15:38 gfredericks: how do I google for least popular built in java classes

15:38 hyPiRion: alright, I give up

15:38 gfredericks: ,clojure.lang.IteratorSeq

15:38 clojurebot: clojure.lang.IteratorSeq

15:38 gfredericks: ,clojure.lang.EnumerationSeq

15:38 clojurebot: clojure.lang.EnumerationSeq

15:39 klokbaske: Hey! Anyone into dsp around here? :)

15:39 gfredericks: ,javax.swing.ComboBoxEditor

15:39 clojurebot: javax.swing.ComboBoxEditor

15:39 gfredericks: omg clojurebot why do you have swing loaded

15:39 arrdem: olololol

15:39 gfredericks: klokbaske: Doing Some Programs?

15:39 arrdem: y is dimensional analysis this hard...

15:40 gfredericks: digital signal processing...

15:40 hyPiRion: gfredericks: Xvfb perhaps?

15:40 gfredericks: arrdem: dimensional analysis is all made up amirite?

15:40 arrdem: gfredericks: ur wrong

15:40 gfredericks: somebody had a blag complaining about this

15:41 arrdem: but but units and math...

15:41 klokbaske: gfredericks: i'd like to! I'm a bit in doubt how to do it in a functional style

15:41 arrdem: types...

15:41 gfredericks: arrdem: the thing was you can have two units that dimensionally are identical but are in fact unrelated concepts

15:41 I think force times distance was one example

15:42 arrdem: gfredericks: interesting...

15:42 gfredericks: what do you think force times distance makes? :)

15:42 arrdem: it's usually defined to be work or jules..

15:42 klokbaske: audio, that is. Normally, I'd have a global variable for the phase that I could increment when ever my callback is called

15:42 gfredericks: arrdem: OR torque

15:42 klokbaske: But that's not very idiomatic

15:43 arrdem: gfredericks: sure, which is a form of work...

15:43 gfredericks: arrdem: that sounds suspect

15:44 arrdem: gfredericks: torque is τ*r, force times lever arm

15:44 ah. gotcha.

15:45 gfredericks: wikipedia 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:46 arrdem: yeah. gotcha....

15:46 that's rather irritating actually.

15:46 gfredericks: this 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:46 (on the tooter)

15:47 arrdem: tb++

15:47 gfredericks: (inc tbaldridge)

15:47 lazybot: ⇒ 5

15:47 arrdem: I guess that tb's only at 5 cause he doesn't lurk IRC hard...

15:47 (inc tbaldridge)

15:47 lazybot: ⇒ 6

15:48 Bronsa: hyPiRion: you don't need to import classes to refer to them fully qualified

15:49 gfredericks: waaat

15:50 Bronsa: gfredericks: yep.

15:50 gfredericks: fully qualified class usages turns into Class/forName in the compiler I guess?

15:50 anybody know if this is the case for java too?

15:52 I mean I know java compile time is a bit different; I guess I just meant if imports are require for fully qualified usage

15:53 yes they are not required

16:38 amalloy: gfredericks: i wouldn't expect it to turn into Class/forName

16:39 it's just a reference to the class, and the class is only loaded when some other class needs it

16:39 gfredericks: ClassFactoryFactory.getFromStringFactory().makeClass(s)

16:40 amalloy: so the initializer isn't run at that point?

16:41 amalloy: i have no idea what point you're talking about

16:41 i'm not entirely sure what initializer either

16:41 gfredericks: classes have initializers

16:41 clojurebot: I don't understand.

16:41 gfredericks: and the point I'm talking about is when calling Class/forName

16:42 amalloy: gfredericks: 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:42 gfredericks: so the initializer I'm talking about is the initializer of the class referred to by the argument to Class/forName

16:42 okay so static initializers are different and prior to the class being "loaded"?

16:43 amalloy: they happen as part of loading

16:43 gfredericks: oh I think I must have misinterpreted your second statement

16:43 I 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:44 amalloy: oh, no. the forName causes loading if the class is not yet loaded

16:44 gfredericks: so you're saying the clojure compiler just creates a reference to the class

16:44 how does it know if the class exists or not?

16:45 ,(fn [] (this.class.does.not.Exist.))

16:45 clojurebot: #<CompilerException java.lang.ClassNotFoundException: this.class.does.not.Exist, compiling:(NO_SOURCE_PATH:0:0)>

16:45 kzar: How can I increase heap space for the emacs cider-jack-in repl?

16:45 amalloy: gfredericks: 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:45 gfredericks: kzar: you can set :jvm-opts in your project.clj

16:45 amalloy: and if it does "link", then the class is loaded if necessary

16:46 kzar: Can I do it without creating a project? (What's the default heap space?)

16:46 gfredericks: kzar: I think it would work in the :user profile

16:47 kzar: How would I do that?

16:48 gfredericks: cat '{:user {:jvm-opts ["-Xmx16g"]}}' > ~/.lein/profiles.clj

16:49 s/cat/echo/ prollably

16:49 * gfredericks cannot linux

16:49 kzar: Thanks, no don't worry I got the idea

16:50 Does cider use the lein profiles.clj?

16:50 gfredericks: I think it calls `lein repl` or similar, so it should

16:50 indirectly

16:55 kzar: gfredericks: hey I think it worked, thanks

16:55 :)

16:56 gfredericks: np

17:19 okay so my impression was, regarding metadata

17:19 some things are values and therefore cloneable, and they use with-meta and create new objects

17:19 which corresponds to the IObj interface

17:20 functions are a weird edge case here, since they aren't values but it's not too janky to clone them

17:20 references on the other hand can't be meaningfully cloned, so they have mutable metadata

17:20 corresponding to the IRef interface and alter-meta!

17:20 what surprised me is that promises are IObj

17:21 and so you can clone them and get copies that all get delivered at once

17:21 and I realize there's probably not a way for that to mess anything up; but it still surprised me

17:22 I think I don't know of anything else that is IObj and IDeref

17:25 dbasch: gfredericks: what do you mean “values and therefore cloneable” ?

17:26 gfredericks: dbasch: an immutable value can be cloned, at the object-level, without bothering anybody

17:26 dbasch: gfredericks: but only if it implements Cloneable

17:26 gfredericks: which in java is never the case for immutable objects, as far as I know

17:26 gfredericks: cloned conceptually, not necessarily via that interface

17:26 arrdem: gfredericks: since you don't believe in units check my math. https://www.refheap.com/85613

17:27 gfredericks: arrdem: lol I made a project called meajure like 5 years ago

17:27 arrdem: http://github.com/arrdem/meajure <= but mine's maintained!

17:29 dbasch: arrdem: this may be interesting to you: https://github.com/dbasch/clj-brainwallet/blob/master/src/brainwallet/core.clj

17:30 gfredericks: dbasch: 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:32 toan: Hi guys, would like to sort this, ["Fools" "fall" "for" "foolish" "follies"] where caps don't matter.

17:32 result should be ["fall" "follies" "foolish" "Fools" "for"]

17:32 gfredericks: you can use sort-by together with some case-thing in the String class

17:32 toan: I'll look it up

17:33 dbasch: gfredericks: but doesn’t that depend on the particular implementation of with-meta for the type?

17:33 toan: thx

17:33 gfredericks: ,(sort-by String/CASE_INSENSITIVE_ORDER ["Fools" "fall" "for" "foolish" "follies"])

17:33 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.String$CaseInsensitiveComparator cannot be cast to clojure.lang.IFn>

17:33 gerardc: hey all, I would like to do (start (Thread. #(some background work))) inside a Compojure route but this blocks

17:34 gfredericks: dbasch: 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:34 gerardc: Is there a way around this?

17:34 gfredericks: gerardc: that shouldn't block

17:34 gerardc: I've tried the same using plain old Ring but I'd prefer to use Compojure routing if possible

17:35 gfredericks: gerardc: are you returning a response as well?

17:37 gerardc: gfredericks: not explicity. I'll simplify my example to just have (start (Thread. ...) in the route handler fn

17:39 gfredericks: do you mean .start?

17:40 dbasch: gerardc: just curious why you’re using Thread and not future

17:40 gfredericks: that's a good point tooo

17:40 blr: allo, anyone know if a yaml -> edn library exists? google-fu failing

17:41 gerardc: dbasch: so I tried future and that also blocked :P

17:41 numberten: why doesn't this work?

17:41 ,(comp Math/abs (partial - 5))

17:41 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to find static field: abs in class java.lang.Math, compiling:(NO_SOURCE_PATH:0:0)>

17:42 dbasch: numberten: because Math/abs is not a function

17:42 numberten: ah

17:42 dbasch: numberten: wrap it in a #( %)

17:43 gerardc: dbasch, gfredericks: ok I can't reproduce now :/

17:43 dbasch: ,((comp #(Math/abs %) (partial - 5)) 7)

17:43 clojurebot: 2

17:43 gfredericks: I wonder if there's any good reason for the compiler not to coerce it to a function

17:43 numberten: ,(comp #(Math/abs %) (partial - 5))

17:43 clojurebot: #<core$comp$fn__4192 clojure.core$comp$fn__4192@8d9f9f>

17:43 numberten: ,(type Math/abs)

17:43 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to find static field: abs in class java.lang.Math, compiling:(NO_SOURCE_PATH:0:0)>

17:43 gerardc: thanks for your time guys, I'll do some more digging

17:43 numberten: what is it?

17:44 dbasch: numberten: it’s a static method from a java class

17:44 gfredericks: which is not anything unless you use it in the call position

17:44 numberten: alright thanks

17:53 gfredericks: oh promise is not IObj explicitly, just by virtue of being defined with reify

17:55 I hadn't thought of that as a potentially dangerous aspect of reify before

17:58 bbloom: grumble grumble metadata

17:58 so useful, so arbitrary

18:00 kzar: My profiles.clj doesn't seem to be being used now, it worked a moment ago

18:00 AimHere: "We kill people based on metadata"

18:01 arrdem: AimHere: move along, move along

18:01 kzar: Tried restarting emacs on the off chance but nope :(

18:06 gfredericks: kzar: you're saying this based on the heap size of the process created by cider-jack-in?

18:06 kzar: Yea, based on the output of (.maxMemory (java.lang.Runtime/getRuntime))

18:07 it's coming back as 124 meg instead of 10 gig, it's frustration because it worked before

18:07 gfredericks: what about if you do `lein repl` from a shell?

18:07 kzar: yea I tried that as well

18:07 gfredericks: ...and?

18:07 kzar: also I noticed when looking at the running java proceses that I can't see the -Xmx10G option there

18:08 no luck

18:08 gfredericks: that still doesn't tell me which way it went

18:08 you mean it was 124 meg there too?

18:08 kzar: Sorry, yea that's what I mean

18:08 gfredericks: and this is regardless of where you run `lein repl`?

18:09 kzar: both for running the repl manually with `lein repl` and using M-x cider-jack in

18:09 gfredericks: `lein repl` is sensitive to whether you start it in a project or not

18:09 so that's what I meant by "where"

18:10 kzar: oooh, just in my home directory (no projects.clj present)

18:15 OK I'm giving up for tonight, sure it's something obvious but too tired

18:15 ty for help, cya

18:17 gfredericks: lein-pprint can help with sanity-checking

18:23 ticking_: 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:38 gmac_: Banging my head against Emacs-Live/cider/nRepl/Leiningen/Clojure

18:38 Moving parts just don't seem to want to co-operate.

18:39 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:41 Tried to eval an s-exp in one of the files and it didn't seem to be aware of the specified namespace

18:41 blr: gmac_: no error message of any sort when you jack-in?

18:41 gmac_: ah, you have to switch to the namespace in your current buffer first with C-c M-n

18:41 gmac_: No. Shows a connection and opens a split window

18:41 blr: you could see the repl display foo.core> if that works

18:42 gmac_: No. lum.repl>

18:42 blr: then you can start evaluating forms, or the whole buffer

18:43 gmac_: Switch to which namespace? The file has the namespace clearly specified.

18:43 blr: the repl didn't return anything like #<Namespace foo.bar>?

18:43 well the repl just starts in the user ns, you need to tell it to change to the namespace in your file/buffer

18:43 gmac_: Yes. "lum" is the name of the project

18:44 blr: what's the name of the file you're working on?

18:44 gmac_: Why is the error "nrepl server not connected" if there's only a namespace issue?

18:45 maik_: 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:46 gmac_: blr: db.clj

18:46 blr: not sure gmac, is lein on your path?

18:47 gmac_: blr: I just entered it's namespace into the repl

18:47 blr: Now I get lum.models.db> prompt

18:47 blr: ... but when I eval an s-exp I still get the nrepl connection error

18:48 blr: ok, now if you evaluate a form from your buffer with C-x C-e you still get that error?

18:48 bugger, not sure :/

18:49 gmac_: 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:50 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:52 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:52 Anway, enough of my moaning.

18:52 Thaks for the help.

19:38 numberten: not sure what happened but I'm unable to require this code that was working moments ago

19:38 getting lots of unable to resolve symbol in this context errors. it seems like the file lost forward references or something

19:39 very confused

19:49 gfredericks: forward references?

19:50 numberten: I've been working with this source that had forward references so for example: (def a b)

19:50 and it was working fine, up until now. Now i'm getting errors because b has yet to be declared

19:52 I think I know what happened

19:52 I think I was working step by step in the repl using :reload

19:52 so it had the references already, even though they came later in the source

19:53 gfredericks: yeah that was going to be my guess

19:53 numberten: but once I restarted the repl and tried to load everything again, the source was uncompilable

19:53 gfredericks: see declare if you want to maintain your ordering

19:53 numberten: alright thanks

20:38 kenrestivo: gmac_: try lighttable?

20:57 msmol: hi. I see that in jdbc, create-table has been deprecated. what is the replacement?

20:57 brainproxy: anyone using a clojure workflow involving docker?

20:58 and/or vagrant

20:58 fa

21:01 Frozenlock: Any tips on how to server static files with compojure? Like with a big button "download!"

21:07 gfredericks: from resources?

21:07 fortruce: Frozenlock: you could use (route/resources "/") to serve static resources from "resources/public" by default

21:21 Frozenlock: gfredericks: Of course...

21:21 * Frozenlock makes another coffee

21:21 blr: is there a better way to get a file extension than (tail (str file) 4) where file is a java.io.file?

21:22 fortruce: split on '.'?

21:22 Frozenlock: fortruce: with a `last' somewhere, in case of "my-filename.fr.txt"

21:22 regexp?

21:23 blr: well, or a regex

21:24 fortruce: ,(last (clojure.string/split "test.txt" #"\."))

21:24 clojurebot: "txt"

21:24 gfredericks: ,(let [a (atom 0)] (swap! a (fn [_] (swap! a inc))))

21:24 clojurebot: Execution Timed Out

21:24 fortruce: haha

21:25 gfredericks: mine is about to hit a billion

21:26 blr: ah of course, thanks

21:53 justin_smith: Frozenlock: blr: do look out for the likes of file.txt.gz

21:53 all of txt.gz is important, and .txt is arguably the more important part

21:53 bbloom: Dear Clojure folks, thank you for not evangelizing dickishly

21:54 Frozenlock: justin_smith: oh right, gz appends its own extension. That could be problematic :-p

21:54 fortruce: justin_smith: nice catch

21:54 Frozenlock: bbloom: Context?

21:54 bbloom: Frozenlock: https://twitter.com/dibblego

21:55 fortruce: bbloom: reminds me of a recent Giant Robots podcast, claimed the Clojure community was not quite so polarized as others (particularly rails)

21:55 Frozenlock: Goddamnit twitter

21:55 Anyway to see that as a log or something?

21:55 locks: can we swear in here?

21:56 bbloom: Frozenlock: you can click them & it sorta makes sense to read in order kinda

21:56 Frozenlock: I see... kinda

21:56 The marvels of social media

21:56 locks: fortruce: rails is toxic because… dhh

21:57 that's why I avoided it as long as I could

21:57 fortruce: locks: he does have some strong opinions he doesn't mind stating

21:57 locks: the ruby community is great though

21:57 bbloom: some 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:57 locks: fortruce: it's more how he states them, than the opinions but yeah

21:57 fortruce: i missed fridays DHH Martin Fowler, etc tdd talk :/

21:57 bbloom: i practically didn't say anything, & this guy went on a rant

21:57 ddellacosta: bbloom: someone from the Rails/Ruby community?

21:57 bbloom: reminds me of bitemyapp

21:57 kelseygi: hi frands

21:57 bbloom: nah haskeller, it seems

21:57 dissipate: bbloom, 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:57 locks: fortruce: it's up on youtubes

21:57 fortruce: locks: yea, just trying to find the right way to say it

21:58 locks: sweet, gonna go check it out

21:58 ddellacosta: bbloom: ah. I am actually a friend of bitemyapp but it is in spite of his Haskell...advocacy

21:58 kelseygi: does anyone hve a favorite resource on agents for newbies?

21:58 blr: bbloom: yeah, attitudes like that aren't doing the haskell community any favours

21:58 arrdem: ololol bitemyapp

21:58 the reason I both will and won't learn haskell

21:58 Frozenlock: dissipate: clojure (and lisps) are a lot easier for newcomers. Just follow the parens, like in math.

21:58 fortruce: haskell seems to have a "one true functional" air about the community

21:58 dnolen_: bbloom: tony morris, another person it's just best to ignore

21:59 bbloom: dnolen_: already blocked

21:59 locks: ^ same

21:59 blr: I would like to think that bitemyapp and tony morris are not representative of the haskell community

21:59 locks: I started following some haskellers and ugh

21:59 ddellacosta: I 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:59 arrdem: dnolen_: 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:59 locks: blr: I've had great interactions on the irc channel

21:59 dnolen_: arrdem: it's just boring

21:59 ddellacosta: dnolen_: agreed

22:00 arrdem: dnolen_: that's definitely true.

22:00 ddellacosta: I do want to dig deeper into Haskell though, seems like a really great langauge

22:00 *language

22:00 dissipate: Frozenlock, 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:02 justin_smith: dissipate: though a given function may not always return the same datatype, each datatype has a type that you can easily check

22:02 ddellacosta: and 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:02 bbloom: it's pretty amazing how quickly twitter can reveal who isn't worth interacting with IRL

22:02 justin_smith: dissipate: and compared to other languages the repl is much more consistent to how a source file works

22:02 ddellacosta: bbloom: we are who we are online and offline I think, in the end

22:03 bbloom: ddellacosta: i'm mostly impressed by how much tone can be expressed in 140 chars

22:03 ddellacosta: bbloom: ah, yeah, fair point

22:03 arrdem: ddellacosta: mod some perceived liberties taken due to lack of direct interpersonal pressure

22:03 fortruce: some 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:03 locks: ddellacosta: the one he calls haskell useless? ;P

22:03 ddellacosta: arrdem: it's true, but choosing to take advantage of that expresses your character too

22:03 locks: yeah!

22:04 locks: that cracked me up but I guess he's always said that, huh?

22:04 kenrestivo: there have always been fanbois. there always will be fanbois.

22:04 arrdem: ddellacosta: agreed as best exemplified in the case of Xah in the last few days

22:04 dissipate: locks, 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:05 a company like Microsoft absolutely must pander to the average developer

22:05 arrdem: and bitemyapp in my own IRL experience.

22:05 ddellacosta: arrdem: didn't see that, but maybe I'll avoid it since it sounds bad, whoever that is...

22:05 locks: dissipate: that isn't quite the context :P

22:05 dissipate: locks, how is it not the context? why would a hard core Haskeller give a damn about C#?

22:05 arrdem: ddellacosta: http://www.reddit.com/r/emacs/comments/25pjtb/im_about_as_good_as_dead_the_end_of_xah_lee/

22:05 bbloom: dissipate: 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:06 ddellacosta: dissipate: 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:06 kenrestivo: the lisp world used to be like that. http://c2.com/cgi/wiki?SmugLispWeenie now i guess it's haskell

22:06 ddellacosta: dissipate: I find (generally) the more skilled people are the less time they have for peacock displays

22:06 locks: what bbloom said

22:06 arrdem: kenrestivo: I think there's still plenty of that left over in common lisp and scheme...

22:07 dissipate: ddellacosta, 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:07 ddellacosta: arrdem: oh, that guy. Yeah, I hope he figures his sh*t out

22:07 bbloom: dissipate: SPJ left msft recently, after 15 years or so

22:07 locks: bbloom: btw, I watched the clojure/west version of your talk, it still goes mostly over my head

22:07 ddellacosta: dissipate: that may be the case, but I think the context was slightly different in that video locks and I were discussing

22:07 bbloom: dissipate: research in to GHC has had a major impact on .net & msft's C/C++ compilers/analyzers

22:07 dissipate: bbloom, 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:08 bbloom: dissipate: probably mostly just typical cross polination of ideas among researchers & designers

22:08 blr: Linq fell out of his work at MSR didn't it? or was that from the ocaml/f# guys?

22:10 bbloom: blr: Linq was inspired by Haskell's comprehensions

22:10 dissipate: bbloom, 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:11 bbloom: don't think so

22:12 dissipate: bbloom, i think this is the video: http://channel9.msdn.com/Blogs/Charles/Brian-Beckman-Monads-Monoids-and-Mort

22:12 bbloom, he basically admits Microsoft is targeting average or even below average developers

22:13 bbloom: dissipate: that's not a surprise or an admission

22:14 i don't think i've ever really understood what beckman has done at msft... what's his area of research exactly?

22:14 danielcompton: bbloom why do you think Tony Morris's attitude is common to Haskellers?

22:15 dissipate: bbloom, languages i believe

22:15 danielcompton: bbloom I've noticed similar comments from puffnfresh too

22:15 bbloom: danielcompton: i don't think it's common to haskellers, i think it's common to zealots

22:15 dean|away: and i think that the clojure community has an uncharacteristically low never of zealots

22:15 s/never/number

22:15 blr: that video's from 2006 - did any of those efforts to improve VB manifest dissipate?

22:16 dissipate: blr, 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:16 locks: clojure has dnolen

22:17 blr: all the .net developers I know (.net has a bit of a stranglehold on NZ) use C#

22:17 locks: that neutralizes about 20 zealots

22:17 bbloom: locks: dnolen_ is far from a zealot

22:17 ddellacosta: danielcompton: 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:17 dnolen is kind of the opposite of a zealot

22:17 locks: bbloom: exactly what I'm saying ;) he has the best laugh too

22:18 bbloom: heh, ok then... dnolen_ and others are what makes this community great: negative zealotry

22:18 ddellacosta: :-)

22:19 Frozenlock: I wonder if I should become a zealot to negate the negative zealotry. The universe needs equilibrium.

22:19 bbloom: Frozenlock: closed system fallacy

22:19 locks: you are the chosen one Frozenlock

22:19 ddellacosta: Frozenlock: let the other communities balance it out

22:20 Frozenlock: bbloom: about the universe, or the clojure community? :-p

22:20 dissipate: strange, i have yet to run into a logic programming zealot

22:20 kelseygi: ooh i know one!

22:20 she’s awesome

22:20 ddellacosta: dissipate: I wonder if it's because not enough folks are good at it

22:20 bbloom: Frozenlock: what ddellacosta said

22:21 dissipate: kelseygi, really?

22:21 arrdem: dissipate: they're hung up on the speed limitations of logical mathematics :C

22:21 ddellacosta: d'oh

22:21 kelseygi: yeah! she doesn’t have twitter though so dunno if she even counts :)

22:21 ddellacosta: kelseygi: she doesn't sound like a "bad zealot," but more an enthusiast from your description

22:22 dissipate: ddellacosta, gotta be super hard core to be a logic programming zealot

22:22 kelseygi: haha true, the bar’s gotta be lower for logic programming though i’d htink

22:22 ddellacosta: dissipate: I would assume so

22:22 kelseygi: touché

22:22 kelseygi: knowing what it is = enthusiast

22:22 locks: I had a Prolog class at uni

22:22 so. cool.

22:22 dissipate: ddellacosta, i'm going to become one. muhaha!

22:23 kelseygi: it makes me feel like my brain is being turned inside out

22:23 * ddellacosta salutes dissipate in their absurd quest

22:23 bbloom: danielcompton: stuff like this: https://twitter.com/puffnfresh/status/467321065429950464 is depressing too

22:23 ddellacosta: dissipate: although if you just want to get good at it, hell ya go for it

22:23 locks: kelseygi: isn't that the best feeling?

22:24 bbloom: puff is just young enough to know everything :P

22:24 ddellacosta: bbloom: I saw that one. The problem is that it is flamebait

22:24 Frozenlock: bbloom: Twitter per se is more depressing IMO.

22:24 blr: I 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:24 dissipate: ddellacosta, na, that's too extreme for me. although i am interested in logic programming for specific use cases.

22:24 ddellacosta: bbloom: I don't even necessarily disagree entirely, but it's a nuanced conversation that can't be had in 140 character chunks

22:24 kelseygi: it’s pretty cool, one of my vague goals with poking around in clojure is hoping to work up to core.logic actually

22:25 danielcompton: blr: where in NZ are you?

22:25 chchjesus: NZ?

22:25 locks: new zealand

22:25 chchjesus: Yeye

22:25 I'm curious to know now too

22:25 blr: Dunedin danielcompton, are you in NZ?

22:25 kelseygi: which

22:26 speaking of beginning in clojure

22:26 danielcompton: blr Auckland

22:26 chchjesus: I'm from Christchurch

22:26 danielcompton: chchjesus I could guess that

22:26 kelseygi: does anyone have anything they recommend for learning about agents?

22:26 blr: cool, nice to see more kiwis interested in clojure :)

22:26 thought it was just me and brehaut for ages

22:26 ddellacosta: wow, are there Clojure gigs in NZ? Seems like it would be a nice place to live and work...

22:26 chchjesus: We studied it at UC

22:26 In our AI course

22:27 danielcompton: ddellacosta not a lot. There are a few companies using it but not many

22:27 dissipate: ddellacosta, how about this experiment: as manager of a shop force everyone to use a logic based language

22:27 blr: are you guys using clj at work?

22:27 ddellacosta: danielcompton: gotcha

22:27 danielcompton: ddellacosta Of course remote work is always an option

22:27 dnolen_: kelseygi: do you have Clojure Programming? probably the most comprehensive coverage of all the concurrency constructs

22:27 ddellacosta: dissipate: could backfire

22:27 dissipate: blr, nope. won't be ever

22:27 kelseygi: i don’t, but sounds like i might have a reason to get it :)

22:27 ddellacosta: danielcompton: time zones are tough though

22:28 danielcompton: ddellacosta, especially when daylight savings kicks in both ways, a 6am start becomes a 4am start :(

22:28 ddellacosta: danielcompton: ugh!

22:28 blr: ddellacosta: well, I made my workplace a clojure gig, by just using it :)

22:29 kelseygi: dnolen_: to be clear, that’s this one http://www.clojurebook.com/ not the one by stuart halloway?

22:29 dnolen_: kelseygi: that plus Clojure Cookbook is a pretty comprehensive resource

22:29 dissipate: ddellacosta, 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:29 dnolen_: kelseygi: yeah the O'Reilly not the Halloway one

22:29 danielcompton: blr do you use ClojureCLR?

22:29 kelseygi: suspicious shadowing by a publication name...

22:29 blr: danielcompton: no, not doing .net here (did many years ago), mostly python, but starting new projects in clojure

22:30 danielcompton: blr what's your work?

22:30 blr: university of otago, faculty of medicine

22:30 building medical ontologies with web frontends using tawny-owl, liberator and other bits and pieces

22:31 keen to potentially rewrite an angular.js app using Om too, time allowing

22:31 * locks hifives blr

22:31 blr: that last one is a little hard to justify, as the angular app is actually pretty good :)

22:32 locks: why settle for good, when you can go for great

22:32 #marketing

22:32 dissipate: huh? it's all about Elm

22:32 danielcompton: blr sounds great. Just tell them you're helping Om find it's place in the world.

22:32 blr: yeah, I certainly would think twice about starting a new project in angular

22:32 dissipate: blr, why is that?

22:33 angular is hot

22:33 locks: I can't sneak Om into work because I've already snuck ember.js (love it)

22:33 but I have a personal project for it

22:34 dissipate: locks, what about Elm? have you tried that?

22:34 locks: dissipate: I looked at it, but it didn't appeal to me

22:36 dissipate: I try to branch out, but there's only so many hours in the day ;\

22:37 dissipate: locks, i see what you did there. :P

22:37 * locks bows

22:38 kenrestivo: it 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:39 locks: kenrestivo: http://opalrb.org/

22:39 ;)

22:39 dissipate: kenrestivo, and asm.js goes full circle. nobody writing actual JS anymore.

22:40 kenrestivo: good 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:40 dbasch: kenrestivo: it’s a long list https://github.com/jashkenas/coffeescript/wiki/List-of-languages-that-compile-to-JS

22:40 blr: dissipate: 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:41 locks: angular's team have some particular thought on things

22:42 it's getting somewhat of a revamp for 2.0

22:42 gfredericks: clojure quiz: for what clojure object is (zero? (count ob)) true but (empty? ob) crashes?

22:42 dissipate: i 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:42 blr: dissipate: well yeah, they'll be replaced with native mobile apps, sadly.

22:42 locks: haha

22:43 dissipate: blr, but i keep hearing that HTML 5 is going to eliminate native mobile apps

22:43 blr: given the current trajectory

22:43 kenrestivo: dissipate: almost everything is going to be a horrible wasteland someday

22:44 fortruce: kent beck telling DHH he doesn't have enough self-confidence, priceless

22:44 dissipate: kenrestivo, so what is going to win eventually?

22:44 locks: fortruce: haha

22:44 kenrestivo: dissipate: "eventually"? meaning when time ends?

22:44 technomancy: gfredericks: something you reified?

22:44 kenrestivo: there is no eventually. the cycle continues endlessly

22:44 blr: kenrestivo: everything except emacs right.

22:44 locks: dissipate: that's not a question :P

22:45 dissipate: kenrestivo, when the human race ends

22:45 zeroem: What is the Protocol/interface required to control the behavior of `select-keys` ?

22:45 gfredericks: technomancy: nope I can get this object by calling a function in clojure.core with one innocuous arg :)

22:45 dissipate: kenrestivo, i want to cut to the chase and start using the technology that will be the last

22:45 locks: gfredericks: nil?

22:45 gfredericks: ,(empty? nil)

22:45 clojurebot: true

22:46 kenrestivo: blr: 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:46 (h/t patton oswalt... i love that line)

22:46 locks: keith richards is getting younger

22:46 dnolen_: zeroem: ILookup

22:46 blr: amen

22:46 kenrestivo: i heard dick clark actually died but i never believed that was going to happen

22:47 zeroem: dnolen_: thanks

22:47 dissipate: kenrestivo, and Java? noooooo

22:48 kenrestivo: cobol is still around. whatever. betting on what's goign to "win" seems a fool's errand to me

22:48 locks: I'm with kenrestivo

22:48 dnolen_: zeroem: actually, it looks like its Associative, select-keys uses `find` not `get`

22:48 zeroem: oi, roger

22:49 gfredericks: technomancy: okay you can stop sitting on the edge of your seat I will just tell you what it is

22:49 technomancy: it is (transient [])

22:49 dissipate: kenrestivo, will you even speculate on the post-Microsoft era? after MS dies off

22:49 technomancy: gfredericks: dun dun dun

22:50 interesting

22:50 kenrestivo: oh, transient!

22:50 what's the use case for transient anyway?

22:50 fortruce: speed!!

22:50 gfredericks: quickly modifying a persistent data structure a bumch of times

22:50 zeroem: aaand it turns out it was a bad test. Thanks for the help though :)

22:51 gfredericks: kenrestivo: (source frequencies) is a good example

22:51 dissipate: kenrestivo, it's to allow you to do a lot of rapid mutations on something, similar to what you get with OOP.

22:52 kenrestivo: gfredericks: cool, thanks.

22:53 dbasch: TransientVector implements Indexed which extends Counted

22:54 but not Sequential

22:58 or Seqable

23:05 dissipate: dbasch, not even seqable? that's crappy

23:05 dbasch: apparently none of the transient collections do

23:06 ,(last (transient [1 2 3]))

23:06 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.PersistentVector$TransientVector>

23:07 dissipate: yikes, that's limited. :(

23:08 numberten: is there a way to lose all the previous declared vars in the repl when re-requiring a namespace?

23:08 I've got a problem in vim-fireplace, where a previous test that has since been deleted keeps reappearing when I run-tests

23:10 mange: dissipate: 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:20 technomancy: numberten: ns-unmap it first

23:22 numberten: ah

23:22 thank you

23:22 strange that vim-fireplace's :Require doesn't do that automatically

23:26 dissipate: mange, so what *can* you do with a transient?

23:32 danielcompton: dissipate fast mutations

23:32 dissipate assoc, dissoc

23:36 amalloy: gfredericks: 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:37 mange: dissipate: 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:39 dissipate: mange, i see. but some may consider that heresy

23:39 mange: Consider what heresy?

23:40 dissipate: mange, using mutations instead of things like map, filter, reduce etc.

23:42 mange: Sorry, 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:43 The 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:51 amalloy: by the way, mange, i created http://dev.clojure.org/jira/browse/CLJ-1423 (bbloom was involved in that discussion too iirc)

23:55 yeoj___: 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:55 mange: amalloy: Nice! Good find with that.

23:56 jeremyheiler: yeoj___: maybe use honeysql instead? it's sql as data, so it's easier to customize.

23:56 yeoj___: jeremyheiler: ok sounds good

Logging service provided by n01se.net