#clojure log - Jan 31 2016

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

0:13 anniepoo__: I'm trying to set up counterclockwise. I'm returning to Clojure after being absent since clojure 1.0

0:14 somehow it's not finding java when it compiles

0:14 java.io.IOException: Cannot run program "java" (in directory "/home/anniepoo/clojtut"): error=2, No such file or directory

0:14 at java.lang.ProcessBuilder.start (ProcessBuilder.java:1048)

0:14 java.lang.Runtime.exec (Runtime.java:620)

0:16 also wanted to say howdy if any old friends are on

0:17 TEttinger: hello

0:17 Raynes is still here! amalloy has been around a long time

0:17 anniepoo__: howdy

0:18 8cD

0:18 TEttinger: anniepoo__: seems like it can't find it on the linux or mac equivalent to PATH

0:18 but java is installed, at least for CCW

0:18 anniepoo__: yes - it's linux

0:18 not sure where it's picking the path up from

0:19 TEttinger: eclipse might bundle their own java

0:19 anniepoo__: it;'s strange - it was working earlier this evening

0:19 I made a java project

0:19 now it's stopped -

0:20 ah, got it

0:20 difference in how I started eclipse

0:21 8cP

0:22 rotcev: is there a way to make a .clj file compile itself?

0:24 justin_smith: all clojure code is compiled when loaded by clojure

0:25 is it that you want the resulting bytecode?

0:25 rotcev: im trying to make in java a way to interpret scripts (which works fine), but my problem is when my clojure code requires another script it can't work the way i've done it due to the fact that the code doesnt compile

0:26 i basically based my code off the way clojure.main works

0:27 justin_smith: clojure.main is the only way to run clojure code

0:27 if require fails, then fix your broken classpath

0:27 rotcev: say there is script a and script b, script b can't require code from script a because script a is never compiled or on the classpath

0:27 but the execution of code works fine

0:27 scripts just cant see eachother atm

0:27 justin_smith: rotcev: require uses the classpath

0:27 fix your classpath

0:31 yunfan: rotcev: you might need aot?

0:32 rotcev: yunfan: something like that would work but i'm not sure how to implement it properly

0:32 justin_smith: yunfan: it has nothing to do with aot, he is calling require but the source files for his clojure code are not on his classpath relative to the namespace, so require cannot do anything

0:33 rotcev: if you are afraid of the classpath, you can replace all usage of require with load-file for files external to clojure itself

0:33 adam___: Hey I am struggling with one of the clojure koans, and was wondering if you guys could tell me where I can learn more about meta tags

0:33 yunfan: justin_smith: then i must misunderstanding his demands

0:33 adam___: "But it won't affect behavior like equality"

0:33 (= __ (vary-meta giants dissoc :league))

0:33 (def giants

0:33 (with-meta 'Giants

0:33 {:league "National League"}))

0:34 why is the answer just 'Giants

0:34 intuitively I'm thinking it should be {}

0:35 rotcev: justin_smith: load-file worked properly ty dude. ofc the real fix would be fix my classpath but im not quite sure whats wrong with it at the moment

0:44 princeso_: justin_smith: thanks. i watched the code and cant find the entry-map's killer . The code is too much for me already. Any advice man?

0:44 justin_smith: rotcev: if your code is (ns foo.bar) and it's in src/foo/bar.clj then src should be an entry in your classpath

0:44 princeso_: make your own walker?

0:45 princeso_: perhaps with the help of the clojure.walk/walk function

0:46 (doc vary-meta)

0:46 princeso_: justin_smith: ah yes. let me try. :D. ok that function is the one i was looking at.

0:46 rotcev: justin_smith: (load-file "./src/main/clojure/services.clj") is the working code atm

0:46 clojurebot: "([obj f & args]); Returns an object of the same type and value as obj, with (apply f (meta obj) args) as its metadata."

0:46 justin_smith: rotcev: what is the ns in services.clj?

0:46 clojure.main.services?

0:46 rotcev: (ns services) probably wrong

0:47 justin_smith: rotcev: OK, if it was clojure.main.services (which is bad because it's using someone else's package) then having src on classpath would work

0:47 if it was main.services, then having clojure on classpath would work

0:47 maybe you get the idea...

0:49 rotcev: ye fixed my code now, ty justin_smith

0:50 justin_smith: rotcev: np, glad it wored out

0:51 adam___: if you saw the doc above, vary-meta returns a new object which is the same as the original, but with different metadata

0:51 adam___: normal code won't access the metadata at all, so the object is equal to what it was before

0:51 clojurebot: Roger.

0:52 justin_smith: clojurebot: weirdo

0:52 clojurebot: Excuse me?

1:00 princeso_: clojurebot: weirdo

1:00 clojurebot: Cool story bro.

1:01 justin_smith: princeso_: after taking another look, really your ticket is to require clojure.walk/walk, then use postwalk with that walker. Your walker would differ in how it handles hash-maps and records

1:01 princeso_: the culprit is in the second case of the cond in clojure.walk

1:02 princeso_: notice how if it finds a map-entry, it calls f on each item, and then puts them in a vec (not a map entry)

1:04 princeso_: justin_smith: mmm ok. thanks a lot man. I was completely loose. Now let me try.

1:31 favetelinguis: jf

1:34 faveteli`: ,(+ 2 2)

1:34 clojurebot: 4

2:27 justin_smith: ,(reductions + (iterate inc 2))

2:27 clojurebot: (2 5 9 14 20 ...)

2:28 justin_smith: ,(reductions + (iterate inc 0))

2:28 clojurebot: (0 1 3 6 10 ...)

2:55 princeso_: justin_smith: just made a map-entry function and replaced it for vec. I hope it doesnt avoid desirable behavior. I guess not.

2:58 justin_smith: thanks a lot :D

3:56 adam___: hey I am trying to filter all the upper case letters out of a string and I feel like I am missing something obvious

3:56 i tried (fn [x] (filter #(Character/isUpperCase %) x)

3:57 TEttinger: ,(remove #(Character/isUpperCase %) "Hey Guys!")

3:57 clojurebot: (\e \y \space \u \y ...)

3:57 adam___: but passing "HeLlO, WoRlD!" to this gives me (\H \L \O \W \R \D)

3:57 TEttinger: ,(apply str (remove #(Character/isUpperCase %) "Hey Guys!"))

3:57 clojurebot: "ey uys!"

3:58 adam___: ohhh apply string

3:58 thanks :)

3:58 TEttinger: filter gets only things for which the function returns trye

3:58 true

3:58 remove is the opposite

3:58 adam___: wait how does clojurebot work

3:58 (+ 1 1)

3:58 clojurebot: 2

3:58 TEttinger: it shows the return value and what it printed

3:58 it usually needs a comma prefix

3:59 ,(str "Hello, " (name :world))

3:59 clojurebot: "Hello, world"

3:59 adam___: ((fn [x] (apply str (filter #(Character/isUpperCase %) x))) "HeLlO, WoRlD!")

3:59 oh comma first

3:59 TEttinger: comma

3:59 adam___: ,((fn [x] (apply str (filter #(Character/isUpperCase %) x))) "HeLlO, WoRlD!")

3:59 clojurebot: "HLOWRD"

3:59 adam___: awesome

3:59 TEttinger: and remove

3:59 adam___: thanks

3:59 actually thats all I needed

3:59 TEttinger: oh cool

3:59 adam___: I am working through 4clojure so the excersises are kindof contrived

4:00 I just am coming from Haskell so I guess I am trying to bring that mindset to clojure and so I am not doing things idiomatically yet

4:00 TEttinger: ,((fn [x] (apply str (re-seq #"\P{LU}" x))) "HeLlO, WoRlD!")

4:00 clojurebot: #<SecurityException java.lang.SecurityException: denied>

4:01 TEttinger: ,((fn [x] (apply str (re-seq #"\P{Lu}" x))) "HeLlO, WoRlD!")

4:01 clojurebot: "el, ol!"

4:01 adam___: how would you say clojure is as a language for writing commercial grade software?

4:01 because as much as I loved haskell I was a little terrified when I checked monster.com and saw how sparse the job postings were

4:02 and they didnt have a huge abundance of libraries so I found myself rewriting a lot of code that I felt should have been already there

4:02 so im hoping to try out some new functional languages haah

4:02 TEttinger: depends on the software. from what I can tell, a lot of big companies use it in small sections or divisions of more forward-targeted parts of their business

4:04 rotcev: adam___: haskell has huge benefits from learning it, as does clojure

4:04 TEttinger: I've heard that, for example, Monsanto has clojure job openings, though that may be akin to a job opening for the devil's masseuse for some people depending on their beliefs

4:04 rotcev: worth learning it even if you dont get a job in it

4:04 adam___: rotcev: I absolutely agree

4:04 I bought a book on it, and tried to absorb as much information as I could

4:05 TEttinger: there's definitely java being used in finance

4:05 clojure is a natural fit for analysis

4:05 rotcev: yeah cos everything is just data

4:05 adam___: I definitely wouldnt say im an expert at haskell, but the experiance taught me more about writing software then any other language

4:05 learning about monoids/functors/applicative/monads/traversable/foldable/reader/state/etc

4:06 TEttinger: this was fascinating for me, that Java really is competitive in this environment https://github.com/OpenHFT

4:06 adam___: but lisp seems like it is really useful in its own right

4:06 rotcev: i literally think learning haskell rewired my brain

4:06 adam___: haha I wouldnt be surprised

4:06 so since it seems like you know both

4:07 how would you compare/contrast the two

4:07 because so far outside of both being "functional" they seem dramatically different

4:07 rotcev: im not an expert in either language but i like how clojure is on the jvm, but both languages share the same principles

4:07 TEttinger: yeah, type system is a huge difference

4:07 rotcev: there is also a language called frege which is a haskell on the jvm but im not sure how it is

4:07 adam___: yeah type system is hugely different

4:07 TEttinger: frege is interesting

4:07 adam___: im not sure how I feel about dynamic typing yet

4:08 TEttinger: it seems to output fairly decent java source from haskell-like code

4:08 adam___: I feel like already Im writing a few bugs in Clojure which a type system would have picked up instantly

4:08 TEttinger: there is typed clojure

4:08 adam___: yeah thats what I was going to mention next

4:08 TEttinger: and there's definitely discussion of a more typed than typed clojure

4:08 adam___: it seems like clojures biggest strength is its extensibility

4:09 I saw a talk where I think it was Rich Hickey who said that Clojure allows you not to have to wait around for somebody to implement a language feature you are missing

4:09 instead with macros you should be able to craft the language to your personal preference

4:09 rotcev: i like that since clojure is a lisp its really easy to understand the fundamentals of the language where as haskell its a bit more to get ur head around

4:10 TEttinger: I'd say the biggest one is clarity through conciseness. many operations that are multiple messy loops and calls in other languages are just a few straightforward calls in clojure, sometimes just one

4:10 adam___: I agree, but I feel like now coming with the mindset of Haskell I am looking at a lot of the things in clojure different

4:10 like all sequences are pretty much functors here right

4:10 TEttinger: haskell has a similar strength

4:10 lazyseqs yes

4:10 rotcev: adam___: also u can achieve curried functions and function composition in clojure which i was happy when i found that out

4:11 adam___: but I cant tell if you can have things like Maybe types

4:11 or if you can perhaps make other things "functors" so that map works on them as well

4:11 rotcev: in terms of maybe i would think of something as just the value or the empty list ()

4:11 adam___: so if I have a Maybe 2 and I map #(+ 2 %)

4:12 I would get Just 4

4:12 but mapping #(+ 2 %) on Nothing would get me Nothing

4:12 TEttinger: you can but because the return value of a fn is not predetermined it isn't as useful. you could return a valid value or return a value of a different type that contains some info on what went wrong, or a default value

4:12 adam___: ok

4:12 how about something like applicative?

4:13 can I have a list of functions and apply it to a list of values

4:13 TEttinger: yes

4:13 rotcev: (map (partial + 2) '(2))

4:13 would be 4

4:13 adam___: ,(map (partial + 2) '(2))

4:13 clojurebot: (4)

4:13 adam___: cool

4:14 but

4:14 what about (map [(partial + 2) (partial * 2)] [2 3 4])

4:14 rotcev: you mean like <*>

4:14 in haskell

4:14 adam___: yeah

4:14 so that way I could make a cartesian product of two lists with (,) <$> [1, 2] <*> ['a', 'b']

4:14 rotcev: honestly idk if u can do it in clojure i dont see why not but ive never had to do it in clojure to say

4:15 i feel as if there is a way to do it tho rofl

4:15 adam___: yeah see thats why I kindof wanna drop my prior knowledge and just learn how clojure people do everything

4:15 hiredman: (doc juxt)

4:15 clojurebot: "([f] [f g] [f g h] [f g h & fs]); Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable number of args, and returns a vector containing the result of applying each fn to the args (left-to-right). ((juxt a b c) x) => [(a x) (b x) (c x)]"

4:15 adam___: then afterwards I can try to bring back other ideas if I feel there is no good way of doing things idiomatically

4:16 otherwise I feel like I be fighting the langauge

4:16 TEttinger: ,(map #(apply % %&) [+ - *] [1 2 3] [10 20 30])

4:16 clojurebot: (11 -18 90)

4:16 adam___: ooh nice Tettinger

4:16 rotcev: adam___:

4:16 ,(map (comp (partial + 2) (partial * 3)) '(1 2 3)))

4:16 clojurebot: (5 8 11)

4:16 TEttinger: I'm trying to see if there's a better way

4:16 hiredman: (doc juxt)

4:17 clojurebot: "([f] [f g] [f g h] [f g h & fs]); Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable number of args, and returns a vector containing the result of applying each fn to the args (left-to-right). ((juxt a b c) x) => [(a x) (b x) (c x)]"

4:17 rotcev: nvm thats not what u wanted but that other guy did it rofl

4:17 TEttinger: ,(map (juxt [+ - *]) [1 2 3] [10 20 30])

4:17 adam___: hiredman can you give me an example of juxt

4:17 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: PersistentVector>

4:18 TEttinger: ,(map (juxt + - *) [1 2 3] [10 20 30])

4:18 clojurebot: ([11 -9 10] [22 -18 40] [33 -27 90])

4:18 hiredman: there is an example in the doc string

4:18 TEttinger: hm

4:18 adam___: ,((juxt (partial + 1) (partial + 2)) [1 2 3])

4:18 clojurebot: #error {\n :cause "clojure.lang.PersistentVector cannot be cast to java.lang.Number"\n :via\n [{:type java.lang.ClassCastException\n :message "clojure.lang.PersistentVector cannot be cast to java.lang.Number"\n :at [clojure.lang.Numbers add "Numbers.java" 128]}]\n :trace\n [[clojure.lang.Numbers add "Numbers.java" 128]\n [clojure.core$_PLUS_ invokeStatic "core.clj" 973]\n [clojure.core$_PLUS...

4:19 rotcev: ,(map (partial juxt [+ - *] [1 2 3]) [4 5 6])))

4:19 clojurebot: (#object[clojure.core$juxt$fn__4744 0x1fb7a9d5 "clojure.core$juxt$fn__4744@1fb7a9d5"] #object[clojure.core$juxt$fn__4744 0x52eeef37 "clojure.core$juxt$fn__4744@52eeef37"] #object[clojure.core$juxt$fn__4744 0x449b2e6a "clojure.core$juxt$fn__4744@449b2e6a"])

4:19 TEttinger: ,(map (juxt (partial + 1) (partial + 2)) [1 2 3])

4:19 clojurebot: ([2 3] [3 4] [4 5])

4:19 hiredman: ((juxt a b c) x) => [(a x) (b x) (c x)]

4:19 just do the substitution evaluation

4:19 adam___: can x be a list

4:20 TEttinger: if a b and c take a list

4:20 otherwise use apply to make it spread into separate args

4:20 adam___: so that way you have ((juxt a b c) '(x y)) => [(a x) (b x) (c x) (a y) (b y) (c y)]

4:20 TEttinger: oh yes

4:21 cartesian stuff is a good use for for

4:21 adam___: so if a b c were partial functions

4:21 TEttinger: ,(for [f [inc dec] num [1 2 3]] (f num))

4:21 clojurebot: (2 3 4 0 1 ...)

4:21 hiredman: ((juxt (partial + 1) (partial + 2)) [1 2 3]) => [((partial + 1) [1 2 3]) ((partial + 2) [1 2 3])]

4:22 https://mitpress.mit.edu/sicp/full-text/sicp/book/node10.html

4:22 adam___: hmm. hiredman so do I need an map in there somehow?

4:22 hiredman: adam___: TEttinger has an example above

4:22 adam___: because I need to distribute that partial across each element of the list

4:23 ok, well I need to brush up on my foundation it seems like haha

4:23 can you guys recommend any good books for learning clojure?

4:23 I was thinking about buying "joy of clojure"

4:24 TEttinger: ~brave

4:24 clojurebot: brave is http://www.braveclojure.com/

4:25 rotcev: ,(map (juxt (partial + 1) (partial + 2) (partial + 3)) [1 2 3])

4:25 clojurebot: ([2 3 4] [3 4 5] [4 5 6])

4:25 rotcev: did i do it rofl

4:25 adam___: yeah you totally did

4:25 awesome!

4:26 rotcev: rip TEttinger got it a long ass time ago

4:27 adam___: TEttinger: you think brave is in depth enough to really grasp clojure in its entirety?

4:27 rotcev: adam___: i read that book last night and it filled in a lot of blanks i didnt know coming from haskell

4:28 adam___: it seems like it is that short I could be a good introductory read but are there any more resources that go in more depth?

4:28 that really teach you the clojure way of thinking

4:29 rotcev: just watch some talks by Rich Hickey on youtube

4:29 adam___: sounds good

4:30 I saw one about transducers, but some of the stuff he was talking about was a little over my head haha

4:30 tier2villain_: rotcev: that's something that impresses me about clojure

4:30 I seem to see more from Rich Hickey than other creators

4:31 adam___: tier2villain_: like other creators of Clojure or creators of other languages?

4:31 TEttinger: brave is certainly deep enough to cover a lot of basic to complex stuff

4:32 I go to it when there's some topic I don't know well enough, like macros

4:32 rotcev: tier2villain_: to answer ur question about the 'self compiling file' i was wondering if it was possible to use the 'compile' core function to compile the file itself if it was executed via an interpreter

4:32 tier2villain_: adam___: creators of other languages

4:32 rotcev: oh gotcha

4:33 adam___: tier2villain_: I could see that, but there is one other language whose creator really impressed me

4:33 have you heard of Elm?

4:34 tier2villain_: adam___: I have, it's like web haskell right?

4:35 adam___: tier2villain_: yeah its like a simpler subset that targets the front end

4:35 his talks about language design and frp are really interesting and apply regardless of what you are working on

4:35 tier2villain_: adam___: that's pretty cool

4:35 I'll have to check it/him out

4:36 adam___: https://www.youtube.com/watch?v=Agu6jipKfYw

4:36 rotcev: ya FRP is a cool paradigm

4:37 tier2villain_: adam___: cool, thank you. added to my watch later playlist

4:37 adam___: it is, but clojure has some killer projects up its sleeve too

4:38 Datomic, figwheel, Om Next

4:38 its seems like the combination of those tools allows you to be hyper productive as a lot of the aspects of designing apps that work across many platforms are all well designed

4:41 alright well im gonna grab some sleep, good night guys

4:42 tier2villain_: i really should as well

6:03 lokien: hello guys! :D

6:30 jeaye: Which is more idiomatic, when looking to avoid repeating the random call in the recur? http://dpaste.com/0FE4V82

6:31 The first is shorter, but probably less clear.

6:40 ridcully: what about putting that rand id generator fn in its own function to always generate one. then (first (remove fs/exists? (repeatedly gen-rand-id))?

6:41 if you need kill switch, put the number into the repeatedly call

6:42 jeaye: I like it.

6:42 ridcully: What're the implications of it though? How many will be generated in the sequence before I take the first?

6:43 I'm not looking to do extra work, at run-time, just to safe line count.

6:43 ridcully: oh so you dont stress the random generator to much (e.g. entropy)? that is a good question! for the pro:s here (which i am not ;))

6:44 jeaye: No, I'm not worries about the entropy; I just know I only want the first item which doesn't exist and I don't want to calculate anything more than that (since it's not needed).

6:44 s/ies/ied/

6:45 In both of my implementations, every single call to random is justified, so there are no subtle implications of extra work being done.

6:45 ridcully: ,(chunked-seq? (repeatedly +))

6:45 clojurebot: false

6:46 jeaye: In your implementation, which is more expressive, no doubt, I don't know that.

6:46 Simply as a result of my own naivety.

6:50 ,(print (first (remove #(> % 0.5) (repeatedly (fn [] (let [r (rand)] (print r " ") r))))))

6:50 clojurebot: 0.9287760619384853 0.5452062791450517 0.9749107014168042 0.110180886751294 0.110180886751294

6:51 loophole_: jeaye: ,(do (time (doall (take 10 (repeatedly #(str "somework"))))) (time (doall (take 10000 (repeatedly #(str "somework"))))) [])

6:51 ,(do (time (doall (take 10 (repeatedly #(str "somework"))))) (time (doall (take 10000 (repeatedly #(str "somework"))))) [])

6:51 clojurebot: "Elapsed time: 0.264517 msecs"\n"Elapsed time: 106.258255 msecs"\n[]

6:51 loophole_: jeaye: you only pay for the elements you take

6:53 jeaye: That's not entirely true, loophole_.

6:53 If I'm not mistaken, these are chunked.

6:54 So, while I may not pay for 10K calls, I may pay for 5 when I only need 1.

6:55 In which case, this is not preferable, in terms of efficiency, to either implementation I showed originally.

6:56 Yet, is it more idiomatic, the lazy sequence approach, sacrificing efficiency for expressiveness?

6:56 loophole_: jeaye: look at the source, luke!

6:56 jeaye: https://github.com/clojure/clojure/blob/clojure-1.7.0/src/clj/clojure/core.clj#L4915

6:57 jeaye: is see no caching whatsoever

6:58 jeaye: loophole_: You're right.

6:58 Also, taking a look at these results again:

6:58 ,(first (remove #(> % 0.5) (repeatedly (fn [] (let [r (rand)] (print r " ") r)))))

6:58 clojurebot: 0.8801418029159563 0.07494692920633217 0.07494692920633217

6:58 jeaye: It's quite clear that it runs twice here.

6:58 ,(first (remove #(> % 0.5) (repeatedly (fn [] (let [r (rand)] (print r " ") r)))))

6:58 clojurebot: 0.23048041961099075 0.23048041961099075

6:59 jeaye: Yet, by chance, once here ^

7:00 In which case, this will be a very nice replacement, and I learned more about lazy sequencing. Thanks, loophole_ ridcully.

7:04 loophole_: (first (remove #(> % 0.5) (repeatedly (fn [] (let [r (rand)] (print (str :print " " r " ")) r)))))

7:05 jeaye: do you take the print output for the result?

7:05 jeaye: loophole_: I'm not actually printing anything.

7:05 Did you miss the original question?

7:06 loophole_: jeaye: in your example (print r " ")

7:06 jeaye: That's just an example.

7:07 original question: Which is more idiomatic, when looking to avoid repeating the random call in the recur? http://dpaste.com/0FE4V82

7:07 loophole_: ,,(first (remove #(> % 0.5) (repeatedly (fn [] (let [r (rand)] (print r " ") r)))))

7:07 clojurebot: 0.2547377973642859 0.2547377973642859

7:08 loophole_: ,,(first (remove #(> % 0.5) (repeatedly (fn [] (let [r (rand)] (print (str :print " " r " ")) r)))))

7:08 clojurebot: :print 0.8991033050691054 :print 0.3883866794351942 0.3883866794351942

7:08 jeaye: mmhmm

7:08 The last is just from the expression.

7:08 loophole_: jeaye: see where i am coming from?

7:09 jeaye: loophole_: See what I said before: "It's quite clear that it runs twice here" and "Yet, by chance, once here ^"

7:09 I realize why the last value is there.

7:10 loophole_: jeaye: it's created two times because remove sees the first element and throws it away

7:10 spuz: I can't seem to add my project.clj as a Leignigen project in Cursive. What does a leinigen project need to look like for cursive to recognise it?

7:10 loophole_: jeaye: the pred is not met the first time

7:11 jeaye: loophole_: Yes, I've never been confused about that.

7:11 Perhaps you misunderstood what I was saying for confusion: I see exactly what's happening and I get it.

7:11 loophole_: jeaye: then I'm stupid

7:11 jeaye: :)

7:11 jeaye: No, not at all. Thanks for following up.

7:14 loophole_: jeaye: ok. glad I was able to clear thinfgs up with caching/repeatedly at least

7:14 jeaye: Absolutely; this approach is much nicer than writing the recursion out.

8:12 kwladyka: do you know any clojure module to test e-mails? I need some fake SMTP server which i can connect and send an email and read that e-mail. I need use that in tests.

8:16 loophole_: kwladyka: why not install a smtp server in vm?

8:17 kwladyka: you seem to need the full functionality anyway i.e reading and receiving mails

8:17 s/reading/sending/

8:23 kwladyka: loophole_ because i want to "lein test" to check it without any additional instalation and vm

8:23 dysfun: then use a java smtp server

8:23 kwladyka: just send something by fake SMTP server and read what was sended

8:24 dysfun: so you want a simple smtp server, preferably with a memory database

8:24 kwladyka: dysfun but will it be fast and could i do (send-email ...) (read-what-was-sended ...)?

8:25 dysfun: i don't know. if i need dependencies for an application, i provide them

8:25 kwladyka: can you recommend some module for that purpoue?

8:25 dysfun: but the thing is you're asking for something that makes a communication and speaks a protocol, so that's the definition of a server

8:26 i'm sure there are some simple ones

8:26 but unless you're writing an smtp library, i think you're testing the wrong thing

8:27 kwladyka: yes, just i want use something ready, but i don't see ready solution. I am also wonder why. Maybe i have stupid idea or there is another reason.

8:27 dysfun: what are you trying to achieve by testing this? what property of your system are you proving?

8:28 kwladyka: maybe... i prefer to test business functional of the app. So i want see for example if user register if he can get e-mail and confirm his account by confirmation link.

8:30 dysfun: right, so perhaps what you want is a protocol and two implementations. or perhaps this is out of scope for unit testing and you want more high level tools for user testing

8:31 kwladyka: just something what can listen on some port and receive e-mail by SMTP protocol

8:32 dysfun: again, i think this might not be the best way to test it

8:33 kwladyka: mmm maybe this one https://github.com/whilo/bote

8:33 and yet, it is not unit testing, it is functional testing

8:33 *yes

8:34 dysfun: then maybe you want a functional testing tool?

8:35 kwladyka: dysfun like for example?

8:35 amgarchIn9: hi, why do I need ((map #(Math/abs %) (range -3 3)) instead of (map Math/sin (range -3 3))?

8:36 dysfun: well here's the thing, a functional test wouldn't ordinarily check they received an email

8:36 if they did, they would do it from a real mail account set up for testing purposes, with a real smtp server, probably

8:37 spuz: if i have a function that takes an int and returns a boolean, how can I return a sequence of numbers for which that function is true?

8:38 kwladyka: amgarchIn9 you can use map in that way (map inc (range 10)). You don't have to write (map #(inc %) (range 10)

8:38 amgarchIn9: docs are full of these: (map (fn [x] (.toUpperCase x)) (.split "Dasher Dancer Prancer" " "))

8:38 kwladyka: amgarchIn9 not sure what is about your question

8:39 dysfun: amgarchIn9: it's because they're java methods not clojure functions

8:39 amgarchIn9: why not just (map .toUpperCase (.split "Dasher Dancer Prancer" " "))? There is something I seem to miss

8:39 dysfun: it's one of the sharp edges of interop

8:39 kwladyka: amgarchIn9 like dysfuns said

8:39 amgarchIn9 but you have fucntions like clojure.string/split instead of .split

8:40 the same with upper case

8:40 dysfun: i prefer to use #(.method %) when i have to

8:40 but you might also note that sometimes you want doto, not map :)

8:41 (if they are mutable)

8:41 kwladyka: (partial .method) work too?

8:41 dysfun: ,(partial .foo)

8:41 clojurebot: #error {\n :cause "Unable to resolve symbol: .foo in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: .foo in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6688]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: .foo in this co...

8:42 dysfun: (no)

8:42 amgarchIn9: Ok, thanks. Thats the difference between functions and methods that I need to learn then

8:43 dysfun: functions are objects, methods are attached to objects

8:43 a method is not valid without an object to attach it to

8:55 kwladyka: instead of partial you can use http://clojuredocs.org/clojure.core/memfn

8:57 amgarchIn9 ^

9:04 amgarchIn9: weird, (memfn isDirectory) vs #(.isDirectory %), neither symbol can be resolved standalone, both forms are supposed to work. Thanks kwladyka.

9:06 dysfun: there's usually a clojure library that wraps the java so you don't have to use it as well. in this case, 'fs' might be what you want

9:06 kwladyka: amgarchIn9 and be sure you remember about "name may be type-hinted with the method receiver's type in order to avoid reflective calls." <- it is important if you care about performance.

9:07 dysfun: not necessarily. best to actually check whether reflection is happening

9:08 kwladyka: without hint reflections should appear in 100% in that case

9:09 correct me if i am in mistake

9:12 amgarchIn9: (fn [x] (xyz x)) -> "Unable to resolve symbol: xyz", but (fn [x] (.xyz x)) compiles ok. Probably for the same reason.

9:15 loophole_: kwladyka: if you use a smtp-lib for testing then you end up testing this library. maybe this labrary has a bug that handles some mime data weird, unicode weird etc. at this point you hav to check what is broken. the library or your code. if you test against a well known server, this possibilty is still there but much smaller.

9:17 kwladyka: I'd try to split your test code. one that chescks if sending mail is possible against a real server. and one that pretends success/failure and tests from there

9:28 Rick77: Hi! How do I access an interface I have declared with gen-interface in a file, from another clojure namespace/file?

9:28 (does the interface have to sit on a file on it's own?)

11:45 kqb: does somebody here know the clojure syntaxquote back to front, I have a specialized question that did not yield any usable result in a google-search for "`(let"

11:48 Malnormalulo: kqb, What do you need to know?

11:49 kqb: I read up the definition for "`"-read-macro. It interns any symbols it comes accross in the current package.

11:49 (let ((y 'x))

11:49 `(let ((x 1))

11:49 (print (+ ,y 1)))) "works" in common-lisp

11:50 but (let [y 'x]

11:50 `(let [x 1]

11:50 (print (+ ~y 1))))

11:50 yields:

11:50 (clojure.core/let [boot.user/x 1] (clojure.core/print (clojure.core/+ x 1)))


11:50 "[boot.user/x 1]" is garbage

11:50 Malnormalulo: The backquote does two things in Clojure

11:51 first of all, it quote the form

11:51 *quotes

11:51 in the same manner as '

11:51 Second of all, it qualifies any symbols it sees with their full package

11:52 That's what you're seeing with boot.user/x

11:58 kqb: I know. I read the spec. Why was the "qualifying" implemented?

11:59 Malnormalulo: Not 100% sure, but what does it hurt?

12:00 kwladyka: kqb https://www.refheap.com

12:00 kqb: kwladyka: ?

12:01 kwladyka: kqb don't paste code on IRC channel, use my link, past code there and past link on IRC channel to see you code

12:01 Malnormalulo: I can imagine situations where using ` to write a macro in one package, then calling it in another package, can cause unforeseen symbol collisions.

12:02 kqb: Malnormalulo: it wrecks my let-special-forms. is there a non-qualifying syntax-template-library around?

12:02 Malnormalulo: Since the backquote is primarily meant for writing macros, that's probably why it qualifies things

12:02 Well you can use something like x#

12:02 I don't think it'll qualify nonce symbols like that

12:03 ,`(let [x# 100] nil)

12:03 kqb: Those are not symbols, they are a read macro

12:03 clojurebot: (clojure.core/let [x__25__auto__ 100] nil)

12:03 Malnormalulo: They yield symbols

12:03 kqb: They yield gensyms which is a gigantic difference

12:04 In CL backquote is part of the template syntax which is useful for macros coincidentally.

12:05 I need it to splice code (automate away redundancy) and I need it to capture the variables already present. Otherwise I need my own implementation of cond and build the lists myself. yuck.

12:05 Malnormalulo: okay, I think I see what you're trying to do

12:06 I think the idiomatic way to do something like that is to splice in the existing variable with ~, and assign that to a gensym

12:08 kqb: it sounds easier to produce my code in CL, print it as clojure and require it

12:12 alex```: Malnormalulo: you mean ~@ to splice?

12:12 Malnormalulo: I didn't mean that, no

12:12 alex```: okay

12:13 Malnormalulo: ,(let [x 100] `(let [x# ~x] (+ x# 50)))

12:13 clojurebot: (clojure.core/let [x__50__auto__ 100] (clojure.core/+ x__50__auto__ 50))

12:13 Malnormalulo: I meant that

12:13 alex```: oh sure

12:16 kqb: it is possible but breaks the structure of the code. It is a huge finite-stat-machine to escape characters.

12:17 Malnormalulo: Possibly there are better ways to do this, but that's what I'm aware of

12:18 kqb: I played around with it a lot and that seems to be the only way

12:35 pilne: hypothetical situation, shop is java/ruby/go/javascript (primary) and then c++/c/php/perl, but they are very forward thinking (looking into elixir to replace ruby for rails stuff), i wonder if they would object to properly commented and overly-doccumented clojure worked in with the java >.>

12:36 or would clojurescript be easier to work in for a test run?

12:37 kqb: From what I gather a Clojure/ClojureScript//boot stack is stable and requires only one codebase.

12:40 loophole_: kqb: what about (symbol "x")

12:40 ,(let [x (symbol "x") y 'x] `(let [~x 1] (print (+ ~y 1))))

12:41 clojurebot: (clojure.core/let [x 1] (clojure.core/print (clojure.core/+ x 1)))

12:41 loophole_: kqb: I hope I understand your problem

12:42 kqb: `(let [x 1] (print ~(symbol "x")))

12:42 (clojure.core/let [boot.user/x 1] (clojure.core/print x))

12:42 same problem

12:42 occured to me to

12:42 *too

12:44 i have been working on this for 2 months

12:46 `(let [~(symbol "x") 1] (print ~(symbol "x")))

12:46 (clojure.core/let [x 1] (clojure.core/print x))

12:46 this seems to work but if you have multiple backquotes that gets messy too.

12:46 clojure needs a non-qualifying backquote

12:48 loophole_: (let [x (symbol "x")] `(let [~x 1] (print (+ ~x 1))))

12:48 ,(let [x (symbol "x")] `(let [~x 1] (print (+ ~x 1))))

12:48 clojurebot: (clojure.core/let [x 1] (clojure.core/print (clojure.core/+ x 1)))

12:49 loophole_: kqb: I did not read your last reply

12:51 luxbock: kqb: might this help: https://github.com/brandonbloom/backtick ?

12:54 kqb: those two solutions sound interesting and doable, I'll try implementing them next week and report back. Thanks a lot!

13:44 kwladyka: in clojure tests i am calling function and i want check if this functions somewhere deep inside call sending e-mail and what pass to this function. How can i catch this call to function in test with data passed to this function?

13:44 justin_smith: that's what with-redefs is for

13:46 kwladyka: if it works like i see it works.... it would be too good :)

13:51 TMA: ,`(let [y 'x] (let [~'x 1] (print (+ ~y 1))))

13:51 clojurebot: #error {\n :cause "Unable to resolve symbol: y in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: y in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6688]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: y in this context"\n ...

13:51 TMA: ,(let [y 'x] `(let [~'x 1] (print (+ ~y 1))))

13:51 clojurebot: (clojure.core/let [x 1] (clojure.core/print (clojure.core/+ x 1)))

14:03 justin_smith: ,(conj)

14:03 clojurebot: []

14:05 kwladyka: when should i use with-redef-fn instead of with-redef ? The purpose of with-redef-fn is not clean for me.

14:06 *clear

14:08 justin_smith: kwladyka: it takes a hash-map, so it is more useful if the things to be redefined are calculated at runtime

14:08 kwladyka: oh thx

14:27 How can i turn off print to terminal for block of code? I am doing rest-db an flyway print too much on screen...

14:28 and i don't see in flyway doc option to turn off it

14:28 justin_smith: with-out-str

14:28 kwladyka: justin_smith thank you again!

14:29 amalloy: that rebinds *out*, but not System/out, which you can't really rebind

14:29 it also collects all the results into a string, which could be a problem if it's large

14:29 justin_smith: true

14:29 amalloy: apache commons has a writer that's equivalent to dev/null, somewhere

14:30 kwladyka: justin_smith hmm but it doesn't work

14:31 justin_smith: kwladyka: then they are not using *out*, see amalloy 's remarks above

14:35 kwladyka: if it's logging output, you could set the log level

14:36 kwladyka: justin_smith i don't see option like that http://flywaydb.org/documentation/commandline/migrate.html

14:37 justin_smith: kwladyka: logging config isn't going to be an argument passed to a function, it controls things that log using log4j, sl4j, etc. and most db level stuff does that kind of logging

14:37 kwladyka: so what exactly should i write to turn it off only for this function?

14:38 justin_smith: logging is not controlled by a per-function basis, but it can be controlled per class

14:40 this function sets logger level https://github.com/littlebird/conduit/blob/master/src/conduit/kafka.clj#L10 based on a stack overflow answer here http://stackoverflow.com/questions/13760095/java-dynamically-change-logging-level

14:42 kwladyka: thx

14:53 noncom: does anyone have experience with clojurewerkz mailer ?

15:27 benjyz1: hi. does someone know a template for a web-app with clojure & clojurescript?

15:27 I tried https://github.com/plexus/chestnut

15:28 visof: hi guys

15:37 iwo: Hey, I'm trying to play with Overtone but failing to create the most basic thing. I've tried the examples, wiki, bit of googling. Does anyone know of a good introductory guide to Overtone? Any good learning resources?

15:37 justin_smith: iwo: which part isn't working?

15:38 iwo: For example, the first thing I want to create is a note that rises. It seems like a simple enough thing, but I just can't for the life of me work out how I would go about this.

15:38 justin_smith: iwo: first thing, make sure the scsynth is running. It's a standalone program, c++, that overtone needs to find and send messages to.

15:38 iwo: is it making sound at all?

15:39 iwo: justin_smith: oh yes, sorry, I should have been more clear :) it's all working correctly (super collider is obviously installed and happy)

15:40 It's more about what I do next - I have and idea of where I want to get to but I'm failing to get started with the most simple things

15:40 justin_smith: OK. General concept is that you need to create a rising signal inside the synth definition, and attach that to the pitch parameter. I'm fuzzy on how the overtone version of this works, but I've used supercollider itself extensively.

15:40 iwo: so I was wondering if anyone knows of any good introductory material

15:42 justin_smith: iwo: my cynical hunch is that you would have to start learning supercollider, then translate their docs for clojure usage. Hopefully the overtone docs are better than that though, best of luck.

15:43 iwo: justin_smith: okay, so I was thinking that maybe i need the 'range' ugen and attach this in some way - and pitch would be correlated to frequency I guess (overtone synths seem to use frequency)

15:43 justin_smith: iwo: range is a translator, it doesn't create ranges of values

15:44 eg range takes a signal that goes from -1 to 1 and scales it so it goves from 1000 to 1500 so you can then use it as a frequency input

15:44 you would want a line or envelope to attach to the frequency parameter

15:45 (and for convenience you might want to send the line or envelope through a range translation)

15:46 iwo: okay cool, and if I attach the same line of envelope to amplitude, I guess I'll be controlling volume

15:47 justin_smith: exactly - you'll likely find amplitude envelope examples readily - it's a quick change to attach a different envelope to pitch, but it would work the same way

15:47 except unlike amplitude, you wouldn't want it to start and end at 0 :)

15:48 the one problem with using a tool like overtone is that the supercollider community is very active and friendly and helpful, but they won't be able to help you much with overtone

15:48 so you're trading a nicer language for a smaller community with less expertise available

15:49 so yeah, I hope the good docs are out there for overtone

15:56 iwo: yay, so I have something: (definst foo [freq 220] (->> (saw (line freq (* 2 freq) 3))))

15:56 justin_smith: nice!@

15:56 iwo: oops, sorry ignore the ->>

15:56 messing around with the code ;)

15:57 justin_smith: iwo: another trick - do the line from one log to another, then convert back from log

15:57 that way you get a perceptually linear slide (yours will move slower as the pitch gets higher)

15:57 iwo: ah yes, I see

15:58 justin_smith: Thanks! that definitely helped me get started

15:58 justin_smith: so something like (expt 2 (line (log 2 pitch) (inc (log 2 pitch)))) pseudo-code of course

15:58 but the concept should be clear enough

15:59 iwo: np! sometimes just knowing one good term to google can make a difference

15:59 Mokuso: ,(expt 2 3)

15:59 clojurebot: #error {\n :cause "Unable to resolve symbol: expt in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: expt in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6688]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: expt in this co...

16:00 Mokuso: :/ hello all

16:00 justin_smith: that isn't clojure, but synthdefs in overtone are not clojure either :)

16:00 ,(Math/pow 2 3) ; this would not work in a synthdef

16:00 clojurebot: 8.0

16:00 Mokuso: ah cool :)

16:00 justin_smith: I was maybe-remembering an operator in supercollider that overtone could invoke (just as likely remembering it wrong)

16:51 kwladyka: how to change log level here http://clojure.github.io/tools.logging/ ? I am not sure how exactly it works.

16:51 i want change log level to silent third part module during tests

16:52 justin_smith: kwladyka: you can use LoggerFactory/get-logger to get the logger, then you mutate it to change the log level

16:52 kwladyka: i was trying with (set! *tx-agent-levels* ... ) but it throw Can't change/establish root binding of: *tx-agent-levels* with set

16:53 justin_smith: kwladyka: I already showed you a four line function that changes the logging level without needing all that stuff

16:53 kwladyka: justin_smith yes but i don't understand how it is working

16:53 justin_smith: kwladyka: it finds a logger, and mutates it so that it makes less output

16:54 a logger is a mutable java object that decides what should be output and where it goes etc.

16:54 kwladyka: but how exactly it find the right logger? App can have a few loggers? How it will find the right one?

16:54 justin_smith: kwladyka: the code I shared already does this

16:59 kwladyka: anyway i need some log tool so i can use https://github.com/clojure/tools.logging i guess... but why u have exception when call (set! *tx-agent-levels* ... ) ?

16:59 justin_smith: kwladyka: the usual way to set the verbosity level is with a .properties file, but to change it at runtime I think the thing I shared before is the simplest thing you will find. Of course it is possible to set levels other than WARN, that's just the one I selected in that case

16:59 kwladyka: What i miss?

17:00 justin_smith: kwladyka: using binding instead

17:00 (binding [*tx-agent-level* ...] ...)

17:00 *earmuffs* usually mean you want binding

17:02 kwladyka: justin_smith hmm i always see things like *foo* with set!

17:02 like here http://clojuredocs.org/clojure.core/set!

17:04 justin_smith: kwladyka: watch this...

17:04 Malnormalulo: Changing root bindings is generall Not The Clojure Way, though. It discards the thread-safety that scoped rebinding gives you.

17:04 justin_smith: ,(def ^:dynamic *foo*)

17:04 clojurebot: #'sandbox/*foo*

17:05 justin_smith: so first the error:

17:05 ,(set! *foo* :a)

17:05 clojurebot: #error {\n :cause "Can't change/establish root binding of: *foo* with set"\n :via\n [{:type java.lang.IllegalStateException\n :message "Can't change/establish root binding of: *foo* with set"\n :at [clojure.lang.Var set "Var.java" 221]}]\n :trace\n [[clojure.lang.Var set "Var.java" 221]\n [sandbox$eval47 invokeStatic "NO_SOURCE_FILE" -1]\n [sandbox$eval47 invoke "NO_SOURCE_FILE" -1]\n [cloj...

17:05 justin_smith: now the right way:

17:05 ,(binding [*foo* :a] *foo*)

17:05 clojurebot: :a

17:05 justin_smith: Malnormalulo: indeed

17:06 kwladyka: anyway set this var doesn't work... do you see here http://clojure.github.io/tools.logging/ how to mute logs?

17:07 justin_smith: kwladyka: as I already said, you need to mutate the logger and set the level

17:08 or I guess you could establish a logger that doesn't output, for the scope of that code, but I think just setting the level is easier

17:08 kwladyka: ok so the last question... "logging directly or via an agent" - what is the difference? What is it about?

17:10 justin_smith: kwladyka: it's specific to clojure.tools.logging and explained well in the docs for log* ; if you are not logging inside transactions you don't need it https://clojure.github.io/tools.logging/#clojure.tools.logging/log*

17:35 kwladyka: logger-ns - is it mean each ns has own settings?

17:36 name of this parameter

17:37 as i understand from here https://clojure.github.io/tools.logging/#clojure.tools.logging.impl/find-factory i should use get-logger function? like that (get-logger (find-factory) something) ?

17:37 but what value should be in logger-ns?

17:42 damn... it makes me too confuse how to use it.... i am going sleep....

18:13 adam___: is core.match the best pattern matching library?

18:41 stapler: what are some good clojure oss projects to get into?

18:43 Malnormalulo: Well, Clojure itself is an oss

18:44 If you're looking for some particular kind of project to get into, someone here might know of one

18:45 Otherwise, browsing Clojure repos on Github might be a way to find some

19:20 justin_smith: stapler: leiningen has issues / features marked as newcomer friendly

19:20 and they are probably more open to contributions than any other major clojure project

22:08 arrdem: Those of you who've been around longer... is there a reason for *warn-on-reflection* etc rather than just adding kvs to *compiler-options*? My guess is that the former is more CL/traditional and that the latter came to support -Dclojure.compiler.foo but I thought I'd ask.

22:10 justin_smith: arrdem: good question and I wish I had a clue, I get the mailing list is the best place to get an answer to it

22:11 for the record, I miss the old timers that left here for slack

22:11 ~slack

22:11 clojurebot: Pardon?

22:11 justin_smith: ~slack is where all the cool kids went.

22:11 clojurebot: Ok.

22:16 arrdem: mailed the list, we'll see

22:17 I bet karma points that the earmuff options just came first.

22:17 justin_smith: and then we have our (awesome) reluctance to ever break backward compat

22:28 rhg135: slack is a sad sad thing

22:29 but this channel is still sizable

22:29 justin_smith: rhg135: it's true, but some shining stars are gone (and many others much less active)

22:30 Bronsa: arrdem: *compiler-options* was a 1.4/5 addition IIRC

22:31 rhg135: indeed, I'm rather intrigued and disgusted by it myself

22:32 arrdem: well we'll see, there are noises about the Clojurians slack being too big and fragmenting or switching to another service which may be more open to IRC action

22:32 rhg135: I enjoy centralized knowledge, but I also like knowledge. thus I must do both.

22:33 Bronsa: things I hate about slack: no /ignore, cannot use from emacs

22:33 arrdem: Bronsa: CLJ-1274 and earlier... yeah 2013

22:33 rhg135: I can see the first being very bad

22:34 * rhg135 has yet to assimilate all to emacs

22:34 justin_smith: things I hate about slack: central company owns all your data, no plan or promise for what happens when they go under / get acquired / decide they need to monitize more effectively

22:34 arrdem: Yeah slack has really ignored all the moderation/voice control features of IRC on the grounds that they're targeting small teams where that shouldn't be a problem.

22:34 which is my personal bugbear with the service since I run a very very rowdy slack

22:34 justin_smith: arrdem: firing someone is your /ignore :)

22:34 arrdem: justin_smith: that's their stance at least

22:35 justin_smith: yeah, and it sucks

22:35 rhg135: also RIP open knowledge

22:35 Bronsa: but hey, we get gif emoji

22:35 rhg135: it's owned by the company now

22:35 justin_smith: arrdem: if someone leaks creds to slack, slack itself owns all the logs, regardless of later edits they still have the leaked data

22:36 gifs, emoji, inline reactions, storing snippets / references to content

22:37 rhg135: irccloud has all of that...

22:37 justin_smith: but for the latter, it's a great feature I refuse to use - as soon as you lose access to the channel there's no way to recover the archive work, might as well keep your own archive off slack

22:37 rhg135: storing snippets?

22:37 rhg135: yeah, justin_smith

22:37 Bronsa: rhg135: problem is that not everybody is using irccloud (most aren't infact)

22:38 rhg135: they have a pastebin service

22:38 Bronsa: and that multimedia content would be just noise to everybody else

22:38 rhg135: Bronsa: true, but I'm saying that there is no need to convert to slack for it

22:38 justin_smith: we had a junior programmer here, and she used slack to store all kinds of info as she was learning, and then when she was laid off she lost all of her archive / reference

22:38 it was really sad, and there was no way to recover it that I know of

22:39 arrdem: 4036c7720949cb21ccf53c5c7c54ed1daaff2fda

22:39 Bronsa: arrdem: can I hack you with that now?

22:39 rhg135: I just keep a huge .org file

22:39 arrdem: sorry that's the commit where Rich added compiler options

22:39 Bronsa: dang

22:39 justin_smith: yeah, org file in your own git repo is the way to go

22:39 arrdem: not one of my passwords :P

22:39 rhg135: org-babel ftw

22:40 justin_smith: rhg135: bonus, if the file starts to get too big, you can hyperlink between org files!

22:40 * Bronsa just relies on browser history and his own memory

22:40 rhg135: I recently saw the superiority of org

22:40 Bronsa: I should start using org.

22:40 arrdem: org is awesome. I've used it very successfully for classes that tolerated electronic notes/laptops.

22:41 never used the babel stuff for anything much yet

22:41 rhg135: now markdown feels like I'm bashing rocks together

22:42 justin_smith: Bronsa: one great thing about org is the basics are even simpler than markdown, and as you realize you need more features you can look them up and learn them

22:42 Bronsa: literally the only thing I've ever used org for is nested bulletin lists :P

22:42 justin_smith: that's how one starts

22:43 arrdem: yeah so 1.4 was when that got added.

22:43 justin_smith: then you start putting - [ ] before entries

22:43 Bronsa: and the rest is a typo away?

22:43 justin_smith: hehe

22:43 arrdem: nested lists is still a killer feature IMO

22:43 Bronsa: "what did I do now?"

22:43 "oh coool"

22:43 arrdem: only thing I don't like about org is that there isn't a way to make a link to anything other than a top level header.

22:44 justin_smith: arrdem: you can link to arbitrary search strings

22:44 in files that are not even org files

22:44 rhg135: emacs would be better with a good editor, so I run vim in term

22:44 arrdem: yeah but then I gotta do something like UUIDs or other weirdness

22:44 justin_smith: rhg135: evil mode here

22:44 arrdem: I made the leap to Emacs and found that I liked chording more than modal.

22:44 rhg135: or that, justin_smith. I use spacemacs

22:45 Bronsa: weirdos

22:45 justin_smith: arrdem: I like chording just fine, my fingers demand modal (after years it started to be painful)

22:45 arrdem: Bronsa: this is emacs, we're allowed to call them heretics

22:45 Bronsa: heh

22:45 arrdem: justin_smith: yeah one day my lack of good typing habbits will surely catch up ti me

22:46 Bronsa: about half of my coworkers use spacemacs, seems to be growing in popularity

22:46 justin_smith: really it's the wrists more than fingers that got the really bad pain

22:46 arrdem: I think the draw of spacemacs is that it just works for the most part.

22:46 justin_smith: but modal editing cleared it up (and a split keyboard helped too)

22:46 arrdem: unlike most of the emacs starter kit things

22:46 rhg135: it's rather cool to have layers, or premade bundles

22:47 Bronsa: I've wasted way too much time forging my emacs into something I can use to learn another emacs

22:47 rhg135: and the nice part is they're not magic. you can edit

22:49 but the biggest thing was evil mode

22:49 vanilla emacs is greek to me

22:59 hiredman: lack of /ignore must be terrible

22:59 justin_smith: says the guy whose had me and arrdem on ignore for years

23:04 Bronsa: when I think of /ignore I think of hiredman

23:06 rhg135: I remember a guy who ignored people for no reason on another channel

23:07 * lockdown ignores rhg135

23:07 rhg135: D:

23:08 lockdown: so this slack thing, why does active discussions have move there? they already use it are their co?

23:08 s/are/at/

23:09 justin_smith: I think a lot of people find it more friendly to use compared to irc

23:09 for other irc channels I'd say irc culture was an aspect, but frankly I think this is one of the friendliest open forums you'll find, on or off irc

23:10 but I could be prejudiced

23:10 lockdown: that's a fair reason, but we are programmers! I can understand some can't be bothered setting up irc

23:10 justin_smith: lockdown: perhaps because we go off topic a lot and don't have seperate subtopics like slack does

23:10 arrdem: I'd tend to agree, as I've said before but for random help from you lot I wouldn't have picked Clojure up in the first place. Very welcoming crew.

23:12 Bronsa: having a conversation over slack or irc feels surprisingly different

23:12 rhg135: anonymous channels would be nice

23:13 for going into a random/non-relevant topic

23:13 lockdown: justin_smith: yeah, subtopics seems nice

23:13 Bronsa: we tried that already with #clojure-offtopic in 2013/2014

23:14 arrdem: it's still there, just dead quiet

23:14 hasn't seen act since Bronsa and I ended GSoC :P

23:14 lockdown: on the other hand, I wonder how many users are in each subtopic and how active they are

23:15 rhg135: hmm, that's true. pressing A-8 takes so much effort.

23:16 lockdown: slack still has an irc gateway thought but I heard is clunky

23:16 Bronsa: rhg135: it's not a matter of how much effort it takes but whether people feel that that effort is necessary

23:16 base698: bronsa: do you use evil? I changed my leader to space and changed a few motions because of what I saw in spaceemacs

23:16 Bronsa: lockdown: it's awful

23:16 base698: nope

23:16 I just swapped fn with ctrl and meta with cmd

23:17 everybody looks at me like I'm crazy when I tell them I actually use caps lock as caps lock :(

23:17 lockdown: Bronsa: no right ctrl?

23:17 base698: that is crazy

23:17 Bronsa: I've rebound right ctrl to forward delete

23:17 because apparently macs don't have a forward delete ¯(°_°)/¯

23:18 lockdown: yeah, can't imagine doing emacs with out both ctrls

23:18 rhg135: Bronsa: I don't know. If I had a split open I think I'd look o'er there...

23:18 Bronsa: I can't imagine doing emacs with both :P

23:18 base698: I used slack in erc the other day and it didn't seem too bad

23:19 Bronsa: OTOH I don't use left shift either

23:19 base698: just wish I could move off hangouts for private work chats

23:19 Bronsa: base698: I gave it a try a few months ago and it was unbearable. might have improved

23:20 lockdown: Bronsa: oh, I misunderstood, though you were useing forward delete as right ctrl, what keyboard are you using? mac laptops don't have a right ctrl key :/

23:21 Bronsa: oh. right cmd

23:21 as I said, I've swapped my cmd for ctrl

23:21 so whenever I say ctrl I mean the cmd button

23:21 TEttinger: I haven't even configured the AltGr key on this keyboard

23:22 Bronsa: (mac keyboard layouts are the worst)

23:23 justin_smith: ,(compare :mac-keyboard-layouts :slack)

23:23 clojurebot: -6

23:23 lockdown: I settled on using karabiner and set enter as ctrl when pressed with another key, alone acts as enter

23:23 arrdem: lol

23:23 Bronsa: lol

23:23 lockdown: ewww

23:23 rhg135: H'm thinking of bofing a mac

23:23 lockdown: Bronsa: its like having caps as ctrl but on the right ;)

23:24 rhg135: pretend I can spell ;)

23:24 Bronsa: lockdown: can't you just C-j rather than doing the magic enter trick?

23:25 I've started using C-j instead of enter a few months ago and I like it way better

23:25 lockdown: but ctrl is used for so much than that, also is touch typing 101 ;)

23:25 Bronsa: heh

23:25 lockdown: +more

23:26 Bronsa: so you do ctrl + s with one hand for example?

23:26 Bronsa: yes

23:26 justin_smith: one of these days I am going to do a video tutorial for clojure development using sh, clojure.jar, make and ed

23:26 lockdown: Bronsa: you may go the route of justin_smith

23:26 Bronsa: lockdown: I suspect that's going to be the case

23:26 lockdown: wrist pain

23:27 base698: re: slack. it is crazy to me that we used to fight so hard to defend the AOLization of the internet but now everyone fights to turn the internet into AOL

23:27 lockdown: justin_smith: the problem is libs, lein makes it so convinient

23:27 base698: walled gardens everywhere.

23:27 justin_smith: yes, slack is definitely aol 4.0

23:27 base698: and FB et all

23:27 justin_smith: lockdown: it's true

23:27 rhg135: justin_smith: substitute ed for cat and I'm in

23:28 arrdem: Eh these things come and go. Open standards are great but they move slowly and fragment, walled gardens allow rapid iteration and as it were vertical integration/control over the whole product.

23:29 justin_smith: rhg135: if I used cat I think I would have to use sed too, then I'm basically using ed :P

23:29 Bronsa: justin_smith: you still don't use cider/slime/inf-mode?

23:30 justin_smith: Bronsa: none of the above, I got tired of juggling multiple inferior lisps, now I don't even have a repl in my browser

23:30 lockdown: justin_smith: not even lein repl?

23:30 base698: cider is just awesome. it's almost reason alone to develop clojure even if you aren't a functional purist

23:31 Bronsa: hah, I love the implications of having to say "now I don't even have a repl in my browser"

23:31 justin_smith: lockdown: oh, I use lein repl, I mean no repl in my editor

23:31 base698: it's nice until you attempt to upgrade any part of it in place

23:31 lockdown: are the any studies of repl driven dev increasing productivity?

23:32 Bronsa: easy solution: use git submodules to manage emacs libs

23:32 justin_smith: lockdown: and my "video tutirial using make, cat, ed, clojure.jar" is not because those are the tools I use, but more because clojure is powerful enough that you really don't need a whole lot from your tooling (though the dep management thing is a killer app of course)

23:32 Bronsa: if upgrading breaks, just revert to the previously working commit

23:33 justin_smith: Bronsa: then I need to put .elc files in version control and that's weird, but sure that's viable

23:33 Bronsa: managing transitive deps by hand is a pain but that only needs to be done when you first add a new lib (which doesn't happen that often for me nowadays)

23:33 base698: bronsa: I do that just with a regular repo and ln everything.

23:33 Bronsa: justin_smith: why? just gitignore them

23:34 base698: but everything has been really solid lately

23:34 justin_smith: Bronsa: because bad emacs logic about elc files is what breaks the in place upgrades of cider

23:34 or at least it's a crucial part of what breaks

23:34 Bronsa: ah :P

23:35 base698: seems like with more interest in clojure there is more dev in emacs world

23:35 justin_smith: Bronsa: tl;dr is that cider breaks api compatibility and that would need an elc file recompile for all files using that function but emacs isn't smart enough or cider fails to tell it to recompile and boom things break

23:35 Bronsa: I see

23:35 I guess you care way more than me about actually restarting emacs

23:36 I do that about once a month and never feel too bad about it

23:36 justin_smith: Bronsa: it's not just restarts, the elc files remain broken

23:36 the solution is to delete all the elc files that package install / updates create, or not use the package system, or track the elc files alongside the el files in version control for your .emacs

23:37 Bronsa: gotcha

23:37 I guess I've just been lucky then

23:37 justin_smith: all of those I find less than pleasing, and I find what the repl can do perfectly usable on its own

23:37 rhg135: justin_smith: does have a TUI?

23:37 justin_smith: rhg135: does what have a what?

23:38 rhg135: ed have an interface with ncurses/etc...

23:38 justin_smith: rhg135: rlwrap ed :P

23:38 rhg135: ah, I see lmao

23:39 justin_smith: rhg135: but my point about making a tutorial using ed, which might have been lost here, is that you don't need a lot of tooling to do awesome and powerful things with clojure

23:39 rhg135: "the masochism of clojure editing<

23:39 yeah, clojure is awesome that way

23:41 lockdown: justin_smith: true, imo things like cursive just make you dumber but I guess is appealing to mixed projects java with clojure

23:42 I wonder how tedious would be to add better paren matching and automatic indent to the lein repl ;)

23:43 justin_smith: lockdown: I don't look down on any tooling enough to say it makes you dumb, but I think its worth remembering that clojure is pretty damned powerful on its own and it's cool to know how much it can do on its own without the tooling you are used to.

23:43 lockdown: it already supports some emacs keys

23:43 arrdem: or y'know... you could use CIDER which is embedded in Emacs and gets you all that stuff for free...

23:44 lockdown: arrdem: some don't use emacs

23:44 arrdem: lockdown: some make silly decisions

23:44 Bronsa: justin_smith: most would say that paredit is pretty powerful and I (and probably 80% of us) would never be able to write clojure without it

23:45 lockdown: I'll give cider another try, using inf-clojure currently

23:45 Bronsa: sometimes some tools *are* a necessity

23:45 TEttinger: heh

23:45 arrdem: I use smartparens but almost no structural editing and get by fine.

23:45 Bronsa: you're the crazy 20% :)

23:45 justin_smith: Bronsa: somehow I've slowly learned to balance parens to the degree it's nearly a sixth sense, but I admit, I'll fall back and just use paredit too. It's nice to be able to do both.

23:46 TEttinger: I code a significant amount of the clojure I write in jEdit simply because I have it installed everywhere I would be editing. it has parenthesis highlighting. it doesn't do much else clojure-specific. it's still perfectly enough for what I do

23:47 justin_smith: So my job gave me this bottle of canadian maple rye wiskey and it almost makes me wish I had pieces of pancake to put in the glass, I'm also nearly running out after a couple weeks pancakes or no.

23:47 TEttinger: I think I'm the crazy 0.1%

23:47 Bronsa: justin_smith: I hear you, I can balance parens without counting them when I write simple snippets in the repl and I'm always amazed by this new ability. But try shuffling expressions around without it :)

23:47 justin_smith: haha, sure

23:48 lockdown: Bronsa: alt + ctrl + k :P

23:48 TEttinger: I guess Hickey developt Clojure that way ;)

23:49 Bronsa: lockdown: afaik rich still doesn't use cider/paredit

23:49 justin_smith: he still uses maven, right?

23:49 Bronsa: ¯_(ツ)_/¯

23:49 justin_smith: haha

23:50 arrdem: Rumor has it he's a Cursive user these days

23:50 or thinking about it

23:51 Bronsa: arrdem: the .iml files he's been randomly committing into clojure over the past 2 years would make me agree with you

23:51 lockdown: we are doomed!

23:51 arrdem: Bronsa: lul

23:51 lockdown: I guess he does a lot of java too

23:51 Bronsa: [I find cursive to be a great alternative to cider btw]

23:52 IDEs aren't for everybody, but so isn't emacs.. :)

23:53 arrdem: Cursive is awesome. I have a paid license and just haven't invested in making the leap since I have no prior experience with Intellij

23:54 lockdown: rich's simple made easy is anti-cursive

23:54 scottj: There's a video from several years back of Rich talking about how beautiful IntelliJ is.

23:55 lockdown: scottj: I don't think anyone would argue that for java it isn't

23:56 scottj: lockdown: well he wasn't even talking about java in this case iirc, I think he was talking about displaying diffs or version control

23:58 lockdown: it makes java somewhat tolerable :P

Logging service provided by n01se.net