#clojure logs

2016-01-31

00:13anniepoo__I'm trying to set up counterclockwise. I'm returning to Clojure after being absent since clojure 1.0
00:14anniepoo__somehow it's not finding java when it compiles
00:14anniepoo__java.io.IOException: Cannot run program "java" (in directory "/home/anniepoo/clojtut"): error=2, No such file or directory
00:14anniepoo__ at java.lang.ProcessBuilder.start (ProcessBuilder.java:1048)
00:14anniepoo__ java.lang.Runtime.exec (Runtime.java:620)
00:16anniepoo__also wanted to say howdy if any old friends are on
00:17TEttingerhello
00:17TEttingerRaynes is still here! amalloy has been around a long time
00:17anniepoo__howdy
00:18anniepoo__8cD
00:18TEttingeranniepoo__: seems like it can't find it on the linux or mac equivalent to PATH
00:18TEttingerbut java is installed, at least for CCW
00:18anniepoo__yes - it's linux
00:18anniepoo__not sure where it's picking the path up from
00:19TEttingereclipse might bundle their own java
00:19anniepoo__it;'s strange - it was working earlier this evening
00:19anniepoo__I made a java project
00:19anniepoo__now it's stopped -
00:20anniepoo__ah, got it
00:20anniepoo__difference in how I started eclipse
00:21anniepoo__8cP
00:22rotcevis there a way to make a .clj file compile itself?
00:24justin_smithall clojure code is compiled when loaded by clojure
00:25justin_smithis it that you want the resulting bytecode?
00:25rotcevim 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
00:26rotcevi basically based my code off the way clojure.main works
00:27justin_smithclojure.main is the only way to run clojure code
00:27justin_smithif require fails, then fix your broken classpath
00:27rotcevsay 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
00:27rotcevbut the execution of code works fine
00:27rotcevscripts just cant see eachother atm
00:27justin_smithrotcev: require uses the classpath
00:27justin_smithfix your classpath
00:31yunfanrotcev: you might need aot?
00:32rotcevyunfan: something like that would work but i'm not sure how to implement it properly
00:32justin_smithyunfan: 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
00:33justin_smithrotcev: if you are afraid of the classpath, you can replace all usage of require with load-file for files external to clojure itself
00:33adam___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
00:33yunfanjustin_smith: then i must misunderstanding his demands
00:33adam___ "But it won't affect behavior like equality"
00:33adam___ (= __ (vary-meta giants dissoc :league))
00:33adam___(def giants
00:33adam___ (with-meta 'Giants
00:33adam___ {:league "National League"}))
00:34adam___why is the answer just 'Giants
00:34adam___intuitively I'm thinking it should be {}
00:35rotcevjustin_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
00:44princeso_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?
00:44justin_smithrotcev: if your code is (ns foo.bar) and it's in src/foo/bar.clj then src should be an entry in your classpath
00:44justin_smithprinceso_: make your own walker?
00:45justin_smithprinceso_: perhaps with the help of the clojure.walk/walk function
00:46justin_smith(doc vary-meta)
00:46princeso_justin_smith: ah yes. let me try. :D. ok that function is the one i was looking at.
00:46rotcevjustin_smith: (load-file "./src/main/clojure/services.clj") is the working code atm
00:46clojurebot"([obj f & args]); Returns an object of the same type and value as obj, with (apply f (meta obj) args) as its metadata."
00:46justin_smithrotcev: what is the ns in services.clj?
00:46justin_smithclojure.main.services?
00:46rotcev(ns services) probably wrong
00:47justin_smithrotcev: 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
00:47justin_smithif it was main.services, then having clojure on classpath would work
00:47justin_smithmaybe you get the idea...
00:49rotcevye fixed my code now, ty justin_smith
00:50justin_smithrotcev: np, glad it wored out
00:51justin_smithadam___: if you saw the doc above, vary-meta returns a new object which is the same as the original, but with different metadata
00:51justin_smithadam___: normal code won't access the metadata at all, so the object is equal to what it was before
00:51clojurebotRoger.
00:52justin_smithclojurebot: weirdo
00:52clojurebotExcuse me?
01:00princeso_clojurebot: weirdo
01:00clojurebotCool story bro.
01:01justin_smithprinceso_: 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
01:01justin_smithprinceso_: the culprit is in the second case of the cond in clojure.walk
01:02justin_smithprinceso_: 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)
01:04princeso_justin_smith: mmm ok. thanks a lot man. I was completely loose. Now let me try.
01:31favetelinguisjf
01:34faveteli`,(+ 2 2)
01:34clojurebot4
02:27justin_smith,(reductions + (iterate inc 2))
02:27clojurebot(2 5 9 14 20 ...)
02:28justin_smith,(reductions + (iterate inc 0))
02:28clojurebot(0 1 3 6 10 ...)
02:55princeso_justin_smith: just made a map-entry function and replaced it for vec. I hope it doesnt avoid desirable behavior. I guess not.
02:58princeso_justin_smith: thanks a lot :D
03:56adam___hey I am trying to filter all the upper case letters out of a string and I feel like I am missing something obvious
03:56adam___i tried (fn [x] (filter #(Character/isUpperCase %) x)
03:57TEttinger,(remove #(Character/isUpperCase %) "Hey Guys!")
03:57clojurebot(\e \y \space \u \y ...)
03:57adam___but passing "HeLlO, WoRlD!" to this gives me (\H \L \O \W \R \D)
03:57TEttinger,(apply str (remove #(Character/isUpperCase %) "Hey Guys!"))
03:57clojurebot"ey uys!"
03:58adam___ohhh apply string
03:58adam___thanks :)
03:58TEttingerfilter gets only things for which the function returns trye
03:58TEttingertrue
03:58TEttingerremove is the opposite
03:58adam___wait how does clojurebot work
03:58adam___(+ 1 1)
03:58clojurebot2
03:58TEttingerit shows the return value and what it printed
03:58TEttingerit usually needs a comma prefix
03:59TEttinger,(str "Hello, " (name :world))
03:59clojurebot"Hello, world"
03:59adam___((fn [x] (apply str (filter #(Character/isUpperCase %) x))) "HeLlO, WoRlD!")
03:59adam___oh comma first
03:59TEttingercomma
03:59adam___,((fn [x] (apply str (filter #(Character/isUpperCase %) x))) "HeLlO, WoRlD!")
03:59clojurebot"HLOWRD"
03:59adam___awesome
03:59TEttingerand remove
03:59adam___thanks
03:59adam___actually thats all I needed
03:59TEttingeroh cool
03:59adam___I am working through 4clojure so the excersises are kindof contrived
04:00adam___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
04:00TEttinger,((fn [x] (apply str (re-seq #"\P{LU}" x))) "HeLlO, WoRlD!")
04:00clojurebot#<SecurityException java.lang.SecurityException: denied>
04:01TEttinger,((fn [x] (apply str (re-seq #"\P{Lu}" x))) "HeLlO, WoRlD!")
04:01clojurebot"el, ol!"
04:01adam___how would you say clojure is as a language for writing commercial grade software?
04:01adam___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
04:02adam___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
04:02adam___so im hoping to try out some new functional languages haah
04:02TEttingerdepends 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
04:04rotcevadam___: haskell has huge benefits from learning it, as does clojure
04:04TEttingerI'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
04:04rotcevworth learning it even if you dont get a job in it
04:04adam___rotcev: I absolutely agree
04:04adam___I bought a book on it, and tried to absorb as much information as I could
04:05TEttingerthere's definitely java being used in finance
04:05TEttingerclojure is a natural fit for analysis
04:05rotcevyeah cos everything is just data
04:05adam___I definitely wouldnt say im an expert at haskell, but the experiance taught me more about writing software then any other language
04:05adam___learning about monoids/functors/applicative/monads/traversable/foldable/reader/state/etc
04:06TEttingerthis was fascinating for me, that Java really is competitive in this environment https://github.com/OpenHFT
04:06adam___but lisp seems like it is really useful in its own right
04:06rotcevi literally think learning haskell rewired my brain
04:06adam___haha I wouldnt be surprised
04:06adam___so since it seems like you know both
04:07adam___how would you compare/contrast the two
04:07adam___because so far outside of both being "functional" they seem dramatically different
04:07rotcevim not an expert in either language but i like how clojure is on the jvm, but both languages share the same principles
04:07TEttingeryeah, type system is a huge difference
04:07rotcevthere is also a language called frege which is a haskell on the jvm but im not sure how it is
04:07adam___yeah type system is hugely different
04:07TEttingerfrege is interesting
04:07adam___im not sure how I feel about dynamic typing yet
04:08TEttingerit seems to output fairly decent java source from haskell-like code
04:08adam___I feel like already Im writing a few bugs in Clojure which a type system would have picked up instantly
04:08TEttingerthere is typed clojure
04:08adam___yeah thats what I was going to mention next
04:08TEttingerand there's definitely discussion of a more typed than typed clojure
04:08adam___it seems like clojures biggest strength is its extensibility
04:09adam___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
04:09adam___instead with macros you should be able to craft the language to your personal preference
04:09rotcevi 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
04:10TEttingerI'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
04:10adam___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
04:10adam___like all sequences are pretty much functors here right
04:10TEttingerhaskell has a similar strength
04:10TEttingerlazyseqs yes
04:10rotcevadam___: also u can achieve curried functions and function composition in clojure which i was happy when i found that out
04:11adam___but I cant tell if you can have things like Maybe types
04:11adam___or if you can perhaps make other things "functors" so that map works on them as well
04:11rotcevin terms of maybe i would think of something as just the value or the empty list ()
04:11adam___so if I have a Maybe 2 and I map #(+ 2 %)
04:12adam___I would get Just 4
04:12adam___but mapping #(+ 2 %) on Nothing would get me Nothing
04:12TEttingeryou 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
04:12adam___ok
04:12adam___how about something like applicative?
04:13adam___can I have a list of functions and apply it to a list of values
04:13TEttingeryes
04:13rotcev(map (partial + 2) '(2))
04:13rotcevwould be 4
04:13adam___,(map (partial + 2) '(2))
04:13clojurebot(4)
04:13adam___cool
04:14adam___but
04:14adam___what about (map [(partial + 2) (partial * 2)] [2 3 4])
04:14rotcevyou mean like <*>
04:14rotcevin haskell
04:14adam___yeah
04:14adam___so that way I could make a cartesian product of two lists with (,) <$> [1, 2] <*> ['a', 'b']
04:14rotcevhonestly idk if u can do it in clojure i dont see why not but ive never had to do it in clojure to say
04:15rotcevi feel as if there is a way to do it tho rofl
04:15adam___yeah see thats why I kindof wanna drop my prior knowledge and just learn how clojure people do everything
04:15hiredman(doc juxt)
04:15clojurebot"([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)]"
04:15adam___then afterwards I can try to bring back other ideas if I feel there is no good way of doing things idiomatically
04:16adam___otherwise I feel like I be fighting the langauge
04:16TEttinger,(map #(apply % %&) [+ - *] [1 2 3] [10 20 30])
04:16clojurebot(11 -18 90)
04:16adam___ooh nice Tettinger
04:16rotcevadam___:
04:16rotcev,(map (comp (partial + 2) (partial * 3)) '(1 2 3)))
04:16clojurebot(5 8 11)
04:16TEttingerI'm trying to see if there's a better way
04:16hiredman(doc juxt)
04:17clojurebot"([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)]"
04:17rotcevnvm thats not what u wanted but that other guy did it rofl
04:17TEttinger,(map (juxt [+ - *]) [1 2 3] [10 20 30])
04:17adam___hiredman can you give me an example of juxt
04:17clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: PersistentVector>
04:18TEttinger,(map (juxt + - *) [1 2 3] [10 20 30])
04:18clojurebot([11 -9 10] [22 -18 40] [33 -27 90])
04:18hiredmanthere is an example in the doc string
04:18TEttingerhm
04:18adam___,((juxt (partial + 1) (partial + 2)) [1 2 3])
04:18clojurebot#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...
04:19rotcev,(map (partial juxt [+ - *] [1 2 3]) [4 5 6])))
04:19clojurebot(#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"])
04:19TEttinger,(map (juxt (partial + 1) (partial + 2)) [1 2 3])
04:19clojurebot([2 3] [3 4] [4 5])
04:19hiredman((juxt a b c) x) => [(a x) (b x) (c x)]
04:19hiredmanjust do the substitution evaluation
04:19adam___can x be a list
04:20TEttingerif a b and c take a list
04:20TEttingerotherwise use apply to make it spread into separate args
04:20adam___so that way you have ((juxt a b c) '(x y)) => [(a x) (b x) (c x) (a y) (b y) (c y)]
04:20TEttingeroh yes
04:21TEttingercartesian stuff is a good use for for
04:21adam___so if a b c were partial functions
04:21TEttinger,(for [f [inc dec] num [1 2 3]] (f num))
04:21clojurebot(2 3 4 0 1 ...)
04:21hiredman((juxt (partial + 1) (partial + 2)) [1 2 3]) => [((partial + 1) [1 2 3]) ((partial + 2) [1 2 3])]
04:22hiredmanhttps://mitpress.mit.edu/sicp/full-text/sicp/book/node10.html
04:22adam___hmm. hiredman so do I need an map in there somehow?
04:22hiredmanadam___: TEttinger has an example above
04:22adam___because I need to distribute that partial across each element of the list
04:23adam___ok, well I need to brush up on my foundation it seems like haha
04:23adam___can you guys recommend any good books for learning clojure?
04:23adam___I was thinking about buying "joy of clojure"
04:24TEttinger~brave
04:24clojurebotbrave is http://www.braveclojure.com/
04:25rotcev,(map (juxt (partial + 1) (partial + 2) (partial + 3)) [1 2 3])
04:25clojurebot([2 3 4] [3 4 5] [4 5 6])
04:25rotcevdid i do it rofl
04:25adam___yeah you totally did
04:25adam___awesome!
04:26rotcevrip TEttinger got it a long ass time ago
04:27adam___TEttinger: you think brave is in depth enough to really grasp clojure in its entirety?
04:27rotcevadam___: i read that book last night and it filled in a lot of blanks i didnt know coming from haskell
04:28adam___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?
04:28adam___that really teach you the clojure way of thinking
04:29rotcevjust watch some talks by Rich Hickey on youtube
04:29adam___sounds good
04:30adam___I saw one about transducers, but some of the stuff he was talking about was a little over my head haha
04:30tier2villain_rotcev: that's something that impresses me about clojure
04:30tier2villain_I seem to see more from Rich Hickey than other creators
04:31adam___tier2villain_: like other creators of Clojure or creators of other languages?
04:31TEttingerbrave is certainly deep enough to cover a lot of basic to complex stuff
04:32TEttingerI go to it when there's some topic I don't know well enough, like macros
04:32rotcevtier2villain_: 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
04:32tier2villain_adam___: creators of other languages
04:32tier2villain_rotcev: oh gotcha
04:33adam___tier2villain_: I could see that, but there is one other language whose creator really impressed me
04:33adam___have you heard of Elm?
04:34tier2villain_adam___: I have, it's like web haskell right?
04:35adam___tier2villain_: yeah its like a simpler subset that targets the front end
04:35adam___his talks about language design and frp are really interesting and apply regardless of what you are working on
04:35tier2villain_adam___: that's pretty cool
04:35tier2villain_I'll have to check it/him out
04:36adam___https://www.youtube.com/watch?v=Agu6jipKfYw
04:36rotcevya FRP is a cool paradigm
04:37tier2villain_adam___: cool, thank you. added to my watch later playlist
04:37adam___it is, but clojure has some killer projects up its sleeve too
04:38adam___Datomic, figwheel, Om Next
04:38adam___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
04:41adam___alright well im gonna grab some sleep, good night guys
04:42tier2villain_i really should as well
06:03lokienhello guys! :D
06:30jeayeWhich is more idiomatic, when looking to avoid repeating the random call in the recur? http://dpaste.com/0FE4V82
06:31jeayeThe first is shorter, but probably less clear.
06:40ridcullywhat about putting that rand id generator fn in its own function to always generate one. then (first (remove fs/exists? (repeatedly gen-rand-id))?
06:41ridcullyif you need kill switch, put the number into the repeatedly call
06:42jeayeI like it.
06:42jeayeridcully: What're the implications of it though? How many will be generated in the sequence before I take the first?
06:43jeayeI'm not looking to do extra work, at run-time, just to safe line count.
06:43ridcullyoh 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 ;))
06:44jeayeNo, 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).
06:44jeayes/ies/ied/
06:45jeayeIn both of my implementations, every single call to random is justified, so there are no subtle implications of extra work being done.
06:45ridcully,(chunked-seq? (repeatedly +))
06:45clojurebotfalse
06:46jeayeIn your implementation, which is more expressive, no doubt, I don't know that.
06:46jeayeSimply as a result of my own naivety.
06:50jeaye,(print (first (remove #(> % 0.5) (repeatedly (fn [] (let [r (rand)] (print r " ") r))))))
06:50clojurebot0.9287760619384853 0.5452062791450517 0.9749107014168042 0.110180886751294 0.110180886751294
06:51loophole_jeaye: ,(do (time (doall (take 10 (repeatedly #(str "somework"))))) (time (doall (take 10000 (repeatedly #(str "somework"))))) [])
06:51loophole_,(do (time (doall (take 10 (repeatedly #(str "somework"))))) (time (doall (take 10000 (repeatedly #(str "somework"))))) [])
06:51clojurebot"Elapsed time: 0.264517 msecs"\n"Elapsed time: 106.258255 msecs"\n[]
06:51loophole_jeaye: you only pay for the elements you take
06:53jeayeThat's not entirely true, loophole_.
06:53jeayeIf I'm not mistaken, these are chunked.
06:54jeayeSo, while I may not pay for 10K calls, I may pay for 5 when I only need 1.
06:55jeayeIn which case, this is not preferable, in terms of efficiency, to either implementation I showed originally.
06:56jeayeYet, is it more idiomatic, the lazy sequence approach, sacrificing efficiency for expressiveness?
06:56loophole_jeaye: look at the source, luke!
06:56loophole_jeaye: https://github.com/clojure/clojure/blob/clojure-1.7.0/src/clj/clojure/core.clj#L4915
06:57loophole_jeaye: is see no caching whatsoever
06:58jeayeloophole_: You're right.
06:58jeayeAlso, taking a look at these results again:
06:58jeaye,(first (remove #(> % 0.5) (repeatedly (fn [] (let [r (rand)] (print r " ") r)))))
06:58clojurebot0.8801418029159563 0.07494692920633217 0.07494692920633217
06:58jeayeIt's quite clear that it runs twice here.
06:58jeaye,(first (remove #(> % 0.5) (repeatedly (fn [] (let [r (rand)] (print r " ") r)))))
06:58clojurebot0.23048041961099075 0.23048041961099075
06:59jeayeYet, by chance, once here ^
07:00jeayeIn which case, this will be a very nice replacement, and I learned more about lazy sequencing. Thanks, loophole_ ridcully.
07:04loophole_(first (remove #(> % 0.5) (repeatedly (fn [] (let [r (rand)] (print (str :print " " r " ")) r)))))
07:05loophole_jeaye: do you take the print output for the result?
07:05jeayeloophole_: I'm not actually printing anything.
07:05jeayeDid you miss the original question?
07:06loophole_jeaye: in your example (print r " ")
07:06jeayeThat's just an example.
07:07jeayeoriginal question: Which is more idiomatic, when looking to avoid repeating the random call in the recur? http://dpaste.com/0FE4V82
07:07loophole_,,(first (remove #(> % 0.5) (repeatedly (fn [] (let [r (rand)] (print r " ") r)))))
07:07clojurebot0.2547377973642859 0.2547377973642859
07:08loophole_,,(first (remove #(> % 0.5) (repeatedly (fn [] (let [r (rand)] (print (str :print " " r " ")) r)))))
07:08clojurebot:print 0.8991033050691054 :print 0.3883866794351942 0.3883866794351942
07:08jeayemmhmm
07:08jeayeThe last is just from the expression.
07:08loophole_jeaye: see where i am coming from?
07:09jeayeloophole_: See what I said before: "It's quite clear that it runs twice here" and "Yet, by chance, once here ^"
07:09jeayeI realize why the last value is there.
07:10loophole_jeaye: it's created two times because remove sees the first element and throws it away
07:10spuzI 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?
07:10loophole_jeaye: the pred is not met the first time
07:11jeayeloophole_: Yes, I've never been confused about that.
07:11jeayePerhaps you misunderstood what I was saying for confusion: I see exactly what's happening and I get it.
07:11loophole_jeaye: then I'm stupid
07:11loophole_jeaye: :)
07:11jeayeNo, not at all. Thanks for following up.
07:14loophole_jeaye: ok. glad I was able to clear thinfgs up with caching/repeatedly at least
07:14jeayeAbsolutely; this approach is much nicer than writing the recursion out.
08:12kwladykado 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.
08:16loophole_kwladyka: why not install a smtp server in vm?
08:17loophole_kwladyka: you seem to need the full functionality anyway i.e reading and receiving mails
08:17loophole_s/reading/sending/
08:23kwladykaloophole_ because i want to "lein test" to check it without any additional instalation and vm
08:23dysfunthen use a java smtp server
08:23kwladykajust send something by fake SMTP server and read what was sended
08:24dysfunso you want a simple smtp server, preferably with a memory database
08:24kwladykadysfun but will it be fast and could i do (send-email ...) (read-what-was-sended ...)?
08:25dysfuni don't know. if i need dependencies for an application, i provide them
08:25kwladykacan you recommend some module for that purpoue?
08:25dysfunbut the thing is you're asking for something that makes a communication and speaks a protocol, so that's the definition of a server
08:26dysfuni'm sure there are some simple ones
08:26dysfunbut unless you're writing an smtp library, i think you're testing the wrong thing
08:27kwladykayes, 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.
08:27dysfunwhat are you trying to achieve by testing this? what property of your system are you proving?
08:28kwladykamaybe... 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.
08:30dysfunright, 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
08:31kwladykajust something what can listen on some port and receive e-mail by SMTP protocol
08:32dysfunagain, i think this might not be the best way to test it
08:33kwladykammm maybe this one https://github.com/whilo/bote
08:33kwladykaand yet, it is not unit testing, it is functional testing
08:33kwladyka*yes
08:34dysfunthen maybe you want a functional testing tool?
08:35kwladykadysfun like for example?
08:35amgarchIn9hi, why do I need ((map #(Math/abs %) (range -3 3)) instead of (map Math/sin (range -3 3))?
08:36dysfunwell here's the thing, a functional test wouldn't ordinarily check they received an email
08:36dysfunif they did, they would do it from a real mail account set up for testing purposes, with a real smtp server, probably
08:37spuzif 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?
08:38kwladykaamgarchIn9 you can use map in that way (map inc (range 10)). You don't have to write (map #(inc %) (range 10)
08:38amgarchIn9docs are full of these: (map (fn [x] (.toUpperCase x)) (.split "Dasher Dancer Prancer" " "))
08:38kwladykaamgarchIn9 not sure what is about your question
08:39dysfunamgarchIn9: it's because they're java methods not clojure functions
08:39amgarchIn9why not just (map .toUpperCase (.split "Dasher Dancer Prancer" " "))? There is something I seem to miss
08:39dysfunit's one of the sharp edges of interop
08:39kwladykaamgarchIn9 like dysfuns said
08:39kwladykaamgarchIn9 but you have fucntions like clojure.string/split instead of .split
08:40kwladykathe same with upper case
08:40dysfuni prefer to use #(.method %) when i have to
08:40dysfunbut you might also note that sometimes you want doto, not map :)
08:41dysfun(if they are mutable)
08:41kwladyka(partial .method) work too?
08:41dysfun,(partial .foo)
08:41clojurebot#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...
08:42dysfun(no)
08:42amgarchIn9Ok, thanks. Thats the difference between functions and methods that I need to learn then
08:43dysfunfunctions are objects, methods are attached to objects
08:43dysfuna method is not valid without an object to attach it to
08:55kwladykainstead of partial you can use http://clojuredocs.org/clojure.core/memfn
08:57kwladykaamgarchIn9 ^
09:04amgarchIn9weird, (memfn isDirectory) vs #(.isDirectory %), neither symbol can be resolved standalone, both forms are supposed to work. Thanks kwladyka.
09:06dysfunthere'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
09:06kwladykaamgarchIn9 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.
09:07dysfunnot necessarily. best to actually check whether reflection is happening
09:08kwladykawithout hint reflections should appear in 100% in that case
09:09kwladykacorrect me if i am in mistake
09:12amgarchIn9(fn [x] (xyz x)) -> "Unable to resolve symbol: xyz", but (fn [x] (.xyz x)) compiles ok. Probably for the same reason.
09:15loophole_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.
09:17loophole_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
09:28Rick77Hi! How do I access an interface I have declared with gen-interface in a file, from another clojure namespace/file?
09:28Rick77(does the interface have to sit on a file on it's own?)
11:45kqbdoes 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:48Malnormalulokqb, What do you need to know?
11:49kqbI read up the definition for "`"-read-macro. It interns any symbols it comes accross in the current package.
11:49kqb(let ((y 'x))
11:49kqb `(let ((x 1))
11:49kqb (print (+ ,y 1)))) "works" in common-lisp
11:50kqb but (let [y 'x]
11:50kqb `(let [x 1]
11:50kqb (print (+ ~y 1))))
11:50kqbyields:
11:50kqb(clojure.core/let [boot.user/x 1] (clojure.core/print (clojure.core/+ x 1)))
11:50kqb
11:50kqb"[boot.user/x 1]" is garbage
11:50MalnormaluloThe backquote does two things in Clojure
11:51Malnormalulofirst of all, it quote the form
11:51Malnormalulo*quotes
11:51Malnormaluloin the same manner as '
11:51MalnormaluloSecond of all, it qualifies any symbols it sees with their full package
11:52MalnormaluloThat's what you're seeing with boot.user/x
11:58kqbI know. I read the spec. Why was the "qualifying" implemented?
11:59MalnormaluloNot 100% sure, but what does it hurt?
12:00kwladykakqb https://www.refheap.com
12:00kqbkwladyka: ?
12:01kwladykakqb don't paste code on IRC channel, use my link, past code there and past link on IRC channel to see you code
12:01MalnormaluloI can imagine situations where using ` to write a macro in one package, then calling it in another package, can cause unforeseen symbol collisions.
12:02kqbMalnormalulo: it wrecks my let-special-forms. is there a non-qualifying syntax-template-library around?
12:02MalnormaluloSince the backquote is primarily meant for writing macros, that's probably why it qualifies things
12:02MalnormaluloWell you can use something like x#
12:02MalnormaluloI don't think it'll qualify nonce symbols like that
12:03Malnormalulo,`(let [x# 100] nil)
12:03kqbThose are not symbols, they are a read macro
12:03clojurebot(clojure.core/let [x__25__auto__ 100] nil)
12:03MalnormaluloThey yield symbols
12:03kqbThey yield gensyms which is a gigantic difference
12:04kqbIn CL backquote is part of the template syntax which is useful for macros coincidentally.
12:05kqbI 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:05Malnormalulookay, I think I see what you're trying to do
12:06MalnormaluloI think the idiomatic way to do something like that is to splice in the existing variable with ~, and assign that to a gensym
12:08kqbit sounds easier to produce my code in CL, print it as clojure and require it
12:12alex```Malnormalulo: you mean ~@ to splice?
12:12MalnormaluloI didn't mean that, no
12:12alex```okay
12:13Malnormalulo,(let [x 100] `(let [x# ~x] (+ x# 50)))
12:13clojurebot(clojure.core/let [x__50__auto__ 100] (clojure.core/+ x__50__auto__ 50))
12:13MalnormaluloI meant that
12:13alex```oh sure
12:16kqbit is possible but breaks the structure of the code. It is a huge finite-stat-machine to escape characters.
12:17MalnormaluloPossibly there are better ways to do this, but that's what I'm aware of
12:18kqbI played around with it a lot and that seems to be the only way
12:35pilnehypothetical 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:36pilneor would clojurescript be easier to work in for a test run?
12:37kqbFrom what I gather a Clojure/ClojureScript//boot stack is stable and requires only one codebase.
12:40loophole_kqb: what about (symbol "x")
12:40loophole_,(let [x (symbol "x") y 'x] `(let [~x 1] (print (+ ~y 1))))
12:41clojurebot(clojure.core/let [x 1] (clojure.core/print (clojure.core/+ x 1)))
12:41loophole_kqb: I hope I understand your problem
12:42kqb`(let [x 1] (print ~(symbol "x")))
12:42kqb(clojure.core/let [boot.user/x 1] (clojure.core/print x))
12:42kqbsame problem
12:42kqboccured to me to
12:42kqb*too
12:44kqbi have been working on this for 2 months
12:46kqb`(let [~(symbol "x") 1] (print ~(symbol "x")))
12:46kqb(clojure.core/let [x 1] (clojure.core/print x))
12:46kqbthis seems to work but if you have multiple backquotes that gets messy too.
12:46kqbclojure needs a non-qualifying backquote
12:48loophole_(let [x (symbol "x")] `(let [~x 1] (print (+ ~x 1))))
12:48loophole_,(let [x (symbol "x")] `(let [~x 1] (print (+ ~x 1))))
12:48clojurebot(clojure.core/let [x 1] (clojure.core/print (clojure.core/+ x 1)))
12:49loophole_kqb: I did not read your last reply
12:51luxbockkqb: might this help: https://github.com/brandonbloom/backtick ?
12:54kqbthose two solutions sound interesting and doable, I'll try implementing them next week and report back. Thanks a lot!
13:44kwladykain 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:44justin_smiththat's what with-redefs is for
13:46kwladykaif it works like i see it works.... it would be too good :)
13:51TMA,`(let [y 'x] (let [~'x 1] (print (+ ~y 1))))
13:51clojurebot#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:51TMA,(let [y 'x] `(let [~'x 1] (print (+ ~y 1))))
13:51clojurebot(clojure.core/let [x 1] (clojure.core/print (clojure.core/+ x 1)))
14:03justin_smith,(conj)
14:03clojurebot[]
14:05kwladykawhen should i use with-redef-fn instead of with-redef ? The purpose of with-redef-fn is not clean for me.
14:06kwladyka*clear
14:08justin_smithkwladyka: it takes a hash-map, so it is more useful if the things to be redefined are calculated at runtime
14:08kwladykaoh thx
14:27kwladykaHow can i turn off print to terminal for block of code? I am doing rest-db an flyway print too much on screen...
14:28kwladykaand i don't see in flyway doc option to turn off it
14:28justin_smithwith-out-str
14:28kwladykajustin_smith thank you again!
14:29amalloythat rebinds *out*, but not System/out, which you can't really rebind
14:29amalloyit also collects all the results into a string, which could be a problem if it's large
14:29justin_smithtrue
14:29amalloyapache commons has a writer that's equivalent to dev/null, somewhere
14:30kwladykajustin_smith hmm but it doesn't work
14:31justin_smithkwladyka: then they are not using *out*, see amalloy 's remarks above
14:35justin_smithkwladyka: if it's logging output, you could set the log level
14:36kwladykajustin_smith i don't see option like that http://flywaydb.org/documentation/commandline/migrate.html
14:37justin_smithkwladyka: 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:37kwladykaso what exactly should i write to turn it off only for this function?
14:38justin_smithlogging is not controlled by a per-function basis, but it can be controlled per class
14:40justin_smiththis 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:42kwladykathx
14:53noncomdoes anyone have experience with clojurewerkz mailer ?
15:27benjyz1hi. does someone know a template for a web-app with clojure & clojurescript?
15:27benjyz1I tried https://github.com/plexus/chestnut
15:28visofhi guys
15:37iwoHey, 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:37justin_smithiwo: which part isn't working?
15:38iwoFor 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:38justin_smithiwo: first thing, make sure the scsynth is running. It's a standalone program, c++, that overtone needs to find and send messages to.
15:38justin_smithiwo: is it making sound at all?
15:39iwojustin_smith: oh yes, sorry, I should have been more clear :) it's all working correctly (super collider is obviously installed and happy)
15:40iwoIt'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:40justin_smithOK. 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:40iwoso I was wondering if anyone knows of any good introductory material
15:42justin_smithiwo: 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:43iwojustin_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:43justin_smithiwo: range is a translator, it doesn't create ranges of values
15:44justin_smitheg 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:44justin_smithyou would want a line or envelope to attach to the frequency parameter
15:45justin_smith(and for convenience you might want to send the line or envelope through a range translation)
15:46iwookay cool, and if I attach the same line of envelope to amplitude, I guess I'll be controlling volume
15:47justin_smithexactly - 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:47justin_smithexcept unlike amplitude, you wouldn't want it to start and end at 0 :)
15:48justin_smiththe 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:48justin_smithso you're trading a nicer language for a smaller community with less expertise available
15:49justin_smithso yeah, I hope the good docs are out there for overtone
15:56iwoyay, so I have something: (definst foo [freq 220] (->> (saw (line freq (* 2 freq) 3))))
15:56justin_smithnice!@
15:56iwooops, sorry ignore the ->>
15:56iwomessing around with the code ;)
15:57justin_smithiwo: another trick - do the line from one log to another, then convert back from log
15:57justin_smiththat way you get a perceptually linear slide (yours will move slower as the pitch gets higher)
15:57iwoah yes, I see
15:58iwojustin_smith: Thanks! that definitely helped me get started
15:58justin_smithso something like (expt 2 (line (log 2 pitch) (inc (log 2 pitch)))) pseudo-code of course
15:58justin_smithbut the concept should be clear enough
15:59justin_smithiwo: np! sometimes just knowing one good term to google can make a difference
15:59Mokuso,(expt 2 3)
15:59clojurebot#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:00Mokuso:/ hello all
16:00justin_smiththat isn't clojure, but synthdefs in overtone are not clojure either :)
16:00justin_smith,(Math/pow 2 3) ; this would not work in a synthdef
16:00clojurebot8.0
16:00Mokusoah cool :)
16:00justin_smithI was maybe-remembering an operator in supercollider that overtone could invoke (just as likely remembering it wrong)
16:51kwladykahow to change log level here http://clojure.github.io/tools.logging/ ? I am not sure how exactly it works.
16:51kwladykai want change log level to silent third part module during tests
16:52justin_smithkwladyka: you can use LoggerFactory/get-logger to get the logger, then you mutate it to change the log level
16:52kwladykai was trying with (set! *tx-agent-levels* ... ) but it throw Can't change/establish root binding of: *tx-agent-levels* with set
16:53justin_smithkwladyka: I already showed you a four line function that changes the logging level without needing all that stuff
16:53kwladykajustin_smith yes but i don't understand how it is working
16:53justin_smithkwladyka: it finds a logger, and mutates it so that it makes less output
16:54justin_smitha logger is a mutable java object that decides what should be output and where it goes etc.
16:54kwladykabut how exactly it find the right logger? App can have a few loggers? How it will find the right one?
16:54justin_smithkwladyka: the code I shared already does this
16:59kwladykaanyway 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:59justin_smithkwladyka: 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:59kwladykaWhat i miss?
17:00justin_smithkwladyka: using binding instead
17:00justin_smith(binding [*tx-agent-level* ...] ...)
17:00justin_smith*earmuffs* usually mean you want binding
17:02kwladykajustin_smith hmm i always see things like *foo* with set!
17:02kwladykalike here http://clojuredocs.org/clojure.core/set!
17:04justin_smithkwladyka: watch this...
17:04MalnormaluloChanging root bindings is generall Not The Clojure Way, though. It discards the thread-safety that scoped rebinding gives you.
17:04justin_smith,(def ^:dynamic *foo*)
17:04clojurebot#'sandbox/*foo*
17:05justin_smithso first the error:
17:05justin_smith,(set! *foo* :a)
17:05clojurebot#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:05justin_smithnow the right way:
17:05justin_smith,(binding [*foo* :a] *foo*)
17:05clojurebot:a
17:05justin_smithMalnormalulo: indeed
17:06kwladykaanyway set this var doesn't work... do you see here http://clojure.github.io/tools.logging/ how to mute logs?
17:07justin_smithkwladyka: as I already said, you need to mutate the logger and set the level
17:08justin_smithor 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:08kwladykaok so the last question... "logging directly or via an agent" - what is the difference? What is it about?
17:10justin_smithkwladyka: 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:35kwladykalogger-ns - is it mean each ns has own settings?
17:36kwladykaname of this parameter
17:37kwladykaas 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:37kwladykabut what value should be in logger-ns?
17:42kwladykadamn... it makes me too confuse how to use it.... i am going sleep....
18:13adam___is core.match the best pattern matching library?
18:41staplerwhat are some good clojure oss projects to get into?
18:43MalnormaluloWell, Clojure itself is an oss
18:44MalnormaluloIf you're looking for some particular kind of project to get into, someone here might know of one
18:45MalnormaluloOtherwise, browsing Clojure repos on Github might be a way to find some
19:20justin_smithstapler: leiningen has issues / features marked as newcomer friendly
19:20justin_smithand they are probably more open to contributions than any other major clojure project
22:08arrdemThose 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:10justin_smitharrdem: 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:11justin_smithfor the record, I miss the old timers that left here for slack
22:11justin_smith~slack
22:11clojurebotPardon?
22:11justin_smith~slack is where all the cool kids went.
22:11clojurebotOk.
22:16arrdemmailed the list, we'll see
22:17arrdemI bet karma points that the earmuff options just came first.
22:17justin_smithand then we have our (awesome) reluctance to ever break backward compat
22:28rhg135slack is a sad sad thing
22:29rhg135but this channel is still sizable
22:29justin_smithrhg135: it's true, but some shining stars are gone (and many others much less active)
22:30Bronsaarrdem: *compiler-options* was a 1.4/5 addition IIRC
22:31rhg135indeed, I'm rather intrigued and disgusted by it myself
22:32arrdemwell 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:32rhg135I enjoy centralized knowledge, but I also like knowledge. thus I must do both.
22:33Bronsathings I hate about slack: no /ignore, cannot use from emacs
22:33arrdemBronsa: CLJ-1274 and earlier... yeah 2013
22:33rhg135I can see the first being very bad
22:34justin_smiththings 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:34arrdemYeah 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:34arrdemwhich is my personal bugbear with the service since I run a very very rowdy slack
22:34justin_smitharrdem: firing someone is your /ignore :)
22:34arrdemjustin_smith: that's their stance at least
22:35justin_smithyeah, and it sucks
22:35rhg135also RIP open knowledge
22:35Bronsabut hey, we get gif emoji
22:35rhg135it's owned by the company now
22:35justin_smitharrdem: if someone leaks creds to slack, slack itself owns all the logs, regardless of later edits they still have the leaked data
22:36justin_smithgifs, emoji, inline reactions, storing snippets / references to content
22:37rhg135irccloud has all of that...
22:37justin_smithbut 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:37justin_smithrhg135: storing snippets?
22:37rhg135yeah, justin_smith
22:37Bronsarhg135: problem is that not everybody is using irccloud (most aren't infact)
22:38rhg135they have a pastebin service
22:38Bronsaand that multimedia content would be just noise to everybody else
22:38rhg135Bronsa: true, but I'm saying that there is no need to convert to slack for it
22:38justin_smithwe 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:38justin_smithit was really sad, and there was no way to recover it that I know of
22:39arrdem4036c7720949cb21ccf53c5c7c54ed1daaff2fda
22:39Bronsaarrdem: can I hack you with that now?
22:39rhg135I just keep a huge .org file
22:39arrdemsorry that's the commit where Rich added compiler options
22:39Bronsadang
22:39justin_smithyeah, org file in your own git repo is the way to go
22:39arrdemnot one of my passwords :P
22:39rhg135org-babel ftw
22:40justin_smithrhg135: bonus, if the file starts to get too big, you can hyperlink between org files!
22:40rhg135I recently saw the superiority of org
22:40BronsaI should start using org.
22:40arrdemorg is awesome. I've used it very successfully for classes that tolerated electronic notes/laptops.
22:41arrdemnever used the babel stuff for anything much yet
22:41rhg135now markdown feels like I'm bashing rocks together
22:42justin_smithBronsa: 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:42Bronsaliterally the only thing I've ever used org for is nested bulletin lists :P
22:42justin_smiththat's how one starts
22:43arrdemyeah so 1.4 was when that got added.
22:43justin_smiththen you start putting - [ ] before entries
22:43Bronsaand the rest is a typo away?
22:43justin_smithhehe
22:43arrdemnested lists is still a killer feature IMO
22:43Bronsa"what did I do now?"
22:43Bronsa"oh coool"
22:43arrdemonly 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:44justin_smitharrdem: you can link to arbitrary search strings
22:44justin_smithin files that are not even org files
22:44rhg135emacs would be better with a good editor, so I run vim in term
22:44arrdemyeah but then I gotta do something like UUIDs or other weirdness
22:44justin_smithrhg135: evil mode here
22:44arrdemI made the leap to Emacs and found that I liked chording more than modal.
22:44rhg135or that, justin_smith. I use spacemacs
22:45Bronsaweirdos
22:45justin_smitharrdem: I like chording just fine, my fingers demand modal (after years it started to be painful)
22:45arrdemBronsa: this is emacs, we're allowed to call them heretics
22:45Bronsaheh
22:45arrdemjustin_smith: yeah one day my lack of good typing habbits will surely catch up ti me
22:46Bronsaabout half of my coworkers use spacemacs, seems to be growing in popularity
22:46justin_smithreally it's the wrists more than fingers that got the really bad pain
22:46arrdemI think the draw of spacemacs is that it just works for the most part.
22:46justin_smithbut modal editing cleared it up (and a split keyboard helped too)
22:46arrdemunlike most of the emacs starter kit things
22:46rhg135it's rather cool to have layers, or premade bundles
22:47BronsaI've wasted way too much time forging my emacs into something I can use to learn another emacs
22:47rhg135and the nice part is they're not magic. you can edit
22:49rhg135but the biggest thing was evil mode
22:49rhg135vanilla emacs is greek to me
22:59hiredmanlack of /ignore must be terrible
22:59justin_smithsays the guy whose had me and arrdem on ignore for years
23:04Bronsawhen I think of /ignore I think of hiredman
23:06rhg135I remember a guy who ignored people for no reason on another channel
23:07rhg135D:
23:08lockdownso this slack thing, why does active discussions have move there? they already use it are their co?
23:08lockdowns/are/at/
23:09justin_smithI think a lot of people find it more friendly to use compared to irc
23:09justin_smithfor 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:10justin_smithbut I could be prejudiced
23:10lockdownthat's a fair reason, but we are programmers! I can understand some can't be bothered setting up irc
23:10justin_smithlockdown: perhaps because we go off topic a lot and don't have seperate subtopics like slack does
23:10arrdemI'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:12Bronsahaving a conversation over slack or irc feels surprisingly different
23:12rhg135anonymous channels would be nice
23:13rhg135for going into a random/non-relevant topic
23:13lockdownjustin_smith: yeah, subtopics seems nice
23:13Bronsawe tried that already with #clojure-offtopic in 2013/2014
23:14arrdemit's still there, just dead quiet
23:14arrdemhasn't seen act since Bronsa and I ended GSoC :P
23:14lockdownon the other hand, I wonder how many users are in each subtopic and how active they are
23:15rhg135hmm, that's true. pressing A-8 takes so much effort.
23:16lockdownslack still has an irc gateway thought but I heard is clunky
23:16Bronsarhg135: it's not a matter of how much effort it takes but whether people feel that that effort is necessary
23:16base698bronsa: do you use evil? I changed my leader to space and changed a few motions because of what I saw in spaceemacs
23:16Bronsalockdown: it's awful
23:16Bronsabase698: nope
23:16BronsaI just swapped fn with ctrl and meta with cmd
23:17Bronsaeverybody looks at me like I'm crazy when I tell them I actually use caps lock as caps lock :(
23:17lockdownBronsa: no right ctrl?
23:17base698that is crazy
23:17BronsaI've rebound right ctrl to forward delete
23:17Bronsabecause apparently macs don't have a forward delete ¯(°_°)/¯
23:18lockdownyeah, can't imagine doing emacs with out both ctrls
23:18rhg135Bronsa: I don't know. If I had a split open I think I'd look o'er there...
23:18BronsaI can't imagine doing emacs with both :P
23:18base698I used slack in erc the other day and it didn't seem too bad
23:19BronsaOTOH I don't use left shift either
23:19base698just wish I could move off hangouts for private work chats
23:19Bronsabase698: I gave it a try a few months ago and it was unbearable. might have improved
23:20lockdownBronsa: 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:21Bronsaoh. right cmd
23:21Bronsaas I said, I've swapped my cmd for ctrl
23:21Bronsaso whenever I say ctrl I mean the cmd button
23:21TEttingerI haven't even configured the AltGr key on this keyboard
23:22Bronsa(mac keyboard layouts are the worst)
23:23justin_smith,(compare :mac-keyboard-layouts :slack)
23:23clojurebot-6
23:23lockdownI settled on using karabiner and set enter as ctrl when pressed with another key, alone acts as enter
23:23arrdemlol
23:23Bronsalol
23:23Bronsalockdown: ewww
23:23rhg135H'm thinking of bofing a mac
23:23lockdownBronsa: its like having caps as ctrl but on the right ;)
23:24rhg135pretend I can spell ;)
23:24Bronsalockdown: can't you just C-j rather than doing the magic enter trick?
23:25BronsaI've started using C-j instead of enter a few months ago and I like it way better
23:25lockdownbut ctrl is used for so much than that, also is touch typing 101 ;)
23:25Bronsaheh
23:25lockdown+more
23:26lockdownBronsa: so you do ctrl + s with one hand for example?
23:26Bronsayes
23:26justin_smithone of these days I am going to do a video tutorial for clojure development using sh, clojure.jar, make and ed
23:26lockdownBronsa: you may go the route of justin_smith
23:26Bronsalockdown: I suspect that's going to be the case
23:26lockdownwrist pain
23:27base698re: 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:27lockdownjustin_smith: the problem is libs, lein makes it so convinient
23:27base698walled gardens everywhere.
23:27justin_smithyes, slack is definitely aol 4.0
23:27base698and FB et all
23:27justin_smithlockdown: it's true
23:27rhg135justin_smith: substitute ed for cat and I'm in
23:28arrdemEh 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:29justin_smithrhg135: if I used cat I think I would have to use sed too, then I'm basically using ed :P
23:29Bronsajustin_smith: you still don't use cider/slime/inf-mode?
23:30justin_smithBronsa: none of the above, I got tired of juggling multiple inferior lisps, now I don't even have a repl in my browser
23:30lockdownjustin_smith: not even lein repl?
23:30base698cider is just awesome. it's almost reason alone to develop clojure even if you aren't a functional purist
23:31Bronsahah, I love the implications of having to say "now I don't even have a repl in my browser"
23:31justin_smithlockdown: oh, I use lein repl, I mean no repl in my editor
23:31justin_smithbase698: it's nice until you attempt to upgrade any part of it in place
23:31lockdownare the any studies of repl driven dev increasing productivity?
23:32Bronsaeasy solution: use git submodules to manage emacs libs
23:32justin_smithlockdown: 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:32Bronsaif upgrading breaks, just revert to the previously working commit
23:33justin_smithBronsa: then I need to put .elc files in version control and that's weird, but sure that's viable
23:33Bronsamanaging 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:33base698bronsa: I do that just with a regular repo and ln everything.
23:33Bronsajustin_smith: why? just gitignore them
23:34base698but everything has been really solid lately
23:34justin_smithBronsa: because bad emacs logic about elc files is what breaks the in place upgrades of cider
23:34justin_smithor at least it's a crucial part of what breaks
23:34Bronsaah :P
23:35base698seems like with more interest in clojure there is more dev in emacs world
23:35justin_smithBronsa: 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:35BronsaI see
23:35BronsaI guess you care way more than me about actually restarting emacs
23:36BronsaI do that about once a month and never feel too bad about it
23:36justin_smithBronsa: it's not just restarts, the elc files remain broken
23:36justin_smiththe 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:37Bronsagotcha
23:37BronsaI guess I've just been lucky then
23:37justin_smithall of those I find less than pleasing, and I find what the repl can do perfectly usable on its own
23:37rhg135justin_smith: does have a TUI?
23:37justin_smithrhg135: does what have a what?
23:38rhg135ed have an interface with ncurses/etc...
23:38justin_smithrhg135: rlwrap ed :P
23:38rhg135ah, I see lmao
23:39justin_smithrhg135: 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:39rhg135"the masochism of clojure editing<
23:39rhg135yeah, clojure is awesome that way
23:41lockdownjustin_smith: true, imo things like cursive just make you dumber but I guess is appealing to mixed projects java with clojure
23:42lockdownI wonder how tedious would be to add better paren matching and automatic indent to the lein repl ;)
23:43justin_smithlockdown: 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:43lockdownit already supports some emacs keys
23:43arrdemor y'know... you could use CIDER which is embedded in Emacs and gets you all that stuff for free...
23:44lockdownarrdem: some don't use emacs
23:44arrdemlockdown: some make silly decisions
23:44Bronsajustin_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:45lockdownI'll give cider another try, using inf-clojure currently
23:45Bronsasometimes some tools *are* a necessity
23:45TEttingerheh
23:45arrdemI use smartparens but almost no structural editing and get by fine.
23:45Bronsayou're the crazy 20% :)
23:45justin_smithBronsa: 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:46TEttingerI 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:47justin_smithSo 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:47TEttingerI think I'm the crazy 0.1%
23:47Bronsajustin_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:47justin_smithhaha, sure
23:48lockdownBronsa: alt + ctrl + k :P
23:48lockdownTEttinger: I guess Hickey developt Clojure that way ;)
23:49Bronsalockdown: afaik rich still doesn't use cider/paredit
23:49justin_smithhe still uses maven, right?
23:49Bronsa¯_(ツ)_/¯
23:49justin_smithhaha
23:50arrdemRumor has it he's a Cursive user these days
23:50arrdemor thinking about it
23:51Bronsaarrdem: the .iml files he's been randomly committing into clojure over the past 2 years would make me agree with you
23:51lockdownwe are doomed!
23:51arrdemBronsa: lul
23:51lockdownI guess he does a lot of java too
23:51Bronsa[I find cursive to be a great alternative to cider btw]
23:52BronsaIDEs aren't for everybody, but so isn't emacs.. :)
23:53arrdemCursive 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:54lockdownrich's simple made easy is anti-cursive
23:54scottjThere's a video from several years back of Rich talking about how beautiful IntelliJ is.
23:55lockdownscottj: I don't think anyone would argue that for java it isn't
23:56scottjlockdown: well he wasn't even talking about java in this case iirc, I think he was talking about displaying diffs or version control
23:58lockdownit makes java somewhat tolerable :P