#clojure logs

2014-04-28

00:00TravisDbeamso: Do you know if there is already an effort to wrap this library?
00:01beamsoi haven't heard of one
00:01TravisDHehe, perhaps I will work on one and if it ever matures make it available :)
00:02beamsocool
00:05TravisDI didn't know about apache commons math. Looks like a pretty useful library
00:05TerranceWarriorno main manifest attribute.
00:07TerranceWarriornevermind i'll figure it out. :)
00:12TravisDIs there a guide somewhere for including dependencies from Maven Central in lein? I'm looking on the github page, but not seeing it
00:12FrozenlockAnyone has the indentation config in clojure-mode for this https://www.refheap.com/81966 ?
00:13technomancyTravisD: `lein help tutorial` should cover that
00:14arrdemFrozenlock: there should be an add-to-list you can do, but I don't know offhand
00:14arrdemFrozenlock: I don't think that clojure-mode uses a monolithic indentation policy regex but it ma
00:14arrdem*may
00:15TravisDtechnomancy: Is that different from the tutorial at https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md?
00:16Frozenlockarrdem: I mostly want to change the behavior. Currently it indents to the end of the function, but I'd prefer if it indented only 3-4 characters.
00:16FrozenlockLike elisp :-p
00:16technomancyTravisD: same thing
00:16TravisDAh, cool. I skimmed through that, but not carefully enough :)
00:18arrdem$google clojure-mode github
00:18lazybot[clojure-emacs/clojure-mode · GitHub] https://github.com/clojure-emacs/clojure-mode
00:19TravisDtechnomancy: I was looking specifically for more information on the Maven format for dependencies. I'm not familiar with maven
00:25arrdemFrozenlock: it looks like there's an indentation width list in here somewhere, but my computer is lagging too hard for me to read it :C
00:26Frozenlockarrdem: I found this. https://github.com/weavejester/compojure/wiki/Emacs-indentation
00:26FrozenlockStill not what I wanted, but better than nothing
00:27arrdemFrozenlock: ah ok I saw define-clojure-indent but I didn't read it. Something is indeed better than nothing...
00:29TerranceWarriorJust made a jar. As Ray Stantz would say 'Now that wasn't sure a chore now , was it?'
00:29TerranceWarrior3 megs for hello world.
00:29TerranceWarriorha!
00:29arrdemLean Clojure should fix that right up.. in a few months :P
00:29TerranceWarriorthats like the total ram in a 1993 pc.
00:30TravisDIt's sure a good thing it isn't still 1993!
00:30arrdem$google pascal p code
00:30lazybot[p-code machine - Wikipedia, the free encyclopedia] http://en.wikipedia.org/wiki/P-code_machine
00:30arrdemI guess the JVM is just terrible then..
00:33TerranceWarriorhello world, maybe less than 24 bytes on a c64?
00:35arrdem,(length (seq "Hello, world!\n"))
00:35clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: length in this context, compiling:(NO_SOURCE_PATH:0:0)>
00:36arrdem,(count (seq "Hello, world!\n"))
00:36clojurebot14
00:36TravisDI wondered the same thing :)
00:36arrdemwell... you can probably do it in 30 bytes on a 16 bit machine with a write to stdout MMIO op.
00:37arrdembecause you have one write per char at 15 chars including null... so 28 bytes if you optimize out the null char...
00:38arrdemif you "get" the C stdlib for free from the loader you could probably do "push $STR; call puts; ret;" in 20 bytes...
00:38arrdemon an x86 AFAIK
00:39dbasch`/join #clojure
00:40TerranceWarriorHa, either way it's still a 3 meg difference, lol!
00:40arrdemdbasch: this is #assembly wrong chan
00:40dbaschdrats
00:40arrdemTerranceWarrior: yea Clojure's "compiler" drags more than a change of pants along for the ride..
00:41TerranceWarriorarrdem: i am sure that'll be fine when I tap my laptop at 32 gigs of RAM.
00:41technomancyclojure is bad at a lot of things
00:42TerranceWarriorwhich for a 30 year veteran starting with a 3k ram vic-20 this month is pretty incredible.
00:42arrdemTerranceWarrior: I mean... I'm an optimizing compilers wonk, but given the rate that storage is becoming effectively free I appreciate the tradeoff that Clojure makes in terms of having the compiler and stdlib at runtime despite the size implications. sometimes.
00:43arrdemTerranceWarrior: damn. welcome to the future :P 21 never had a machine with less than 128Meg
00:43TerranceWarrioryeah, i am figuring too that the multicore situation combined with ram will hold clojure in high regards for many years to come.
00:43arrdemembedded systems not counting due to artificiality...
00:45arrdemTerranceWarrior: well bear in mind that a large part of the "multicore" performance of clojure is the JVM's multithreaded garbage collector ;_;
00:45TEttingertechnomancy, do you write clojure for work, as a hobby, both, neither, what now?
00:45TerranceWarriorhm, 21 years ago pcs typically had 4 (or was it 40) megs?
00:45technomancyTEttinger: I'm not sure
00:45technomancyI write clojure at work and will keep doing so till they tell me to stop
00:45technomancybut not very often
00:45arrdemTerranceWarrior: I had a 1998 Gateway with a Pentium II I think...
00:45TerranceWarriorarrdem: oh no, don't say that. I think i just lost my hard on! hahahah
00:46TerranceWarriorarrdem: in 1993? lol
00:46arrdemTerranceWarrior: I said I'm dated '92, the computer was '98 :P
00:46technomancyTEttinger: I hang out in here for all the good jokes mostly
00:46TerranceWarriorah, i see.
00:47TerranceWarriorarrdem: in 1995 i was working with Solaris and also a pc with a 500 meg hard drive.
00:47TEttingerI like clojure for scripty stuff myself, but I don't think it's been a good fit for the game dev I'd like to be doing.
00:48arrdemI like Clojure because I feel more able to hack stuff at the REPL in Clojure than I do in Python
00:49arrdemthat and I find the transition from REPL "hacks" to apps to be near zero which is awesome.
00:49TerranceWarriorarrdem++
00:50TravisDTerranceWarrior: That doesn't appear to be the clojure way
00:50arrdem(inc TravisD) ; both for the demo and because funny
00:50lazybot⇒ 3
00:50TravisD:D
00:51arrdemint foo = (void*)(god_only_knows++)*3+128
00:52TerranceWarriorTravisD: sorry. that thought did occur after the return press.
00:52rhg135arrdem: i've actually seen that somewhere :(
00:52TravisDTerranceWarrior: The bots in here keep track of fake internet points for everyone in the channel. Points are given by (inc username)
00:52arrdemrhg135: I had to write that :(
00:52arrdem$karma arrdem
00:52lazybotarrdem has karma 24.
00:53TravisDah, fake internet points, also known as karma.
00:53arrdemTravisD: I seem to have more fake internet points than you, "sir"...
00:53rhg135i mean i sadly have seen that in real codebases
00:53rhg135with different names ofc but still
00:53arrdemrhg135: so did I... embedded hardware and drivers are evil.
00:53TerranceWarriorINC ARRDEM
00:53TravisDarrdem: I hope your karma causes you to be showered with good fortune
00:54rhg135they are arrdem
00:54arrdemTravisD: well it got me GSoC which pays next to nothing so I can't complain too loudly :P
00:54TerranceWarrior$karma TerranceWarrior
00:54lazybotTerranceWarrior has karma 0.
00:54arrdemTerranceWarrior: karma is sandboxed by channel... you can't /msg (inc foo)
00:55TerranceWarrior6510, same as clojure, acept no parens.
00:55arrdemalso #clojure-social for more offtopic chat :P
00:55rhg135there's a social chan?!?
00:55TerranceWarrior(inc arrdem)
00:55lazybot⇒ 25
00:55technomancyTerranceWarrior: dang; one of my life goals (long term) is to learn 6502
00:55rhg135man nobody tells me
00:56TerranceWarriortechnomancy: i recommend the c64 PRG and vice emulator (real thing, but that can be a hassel)
00:56TravisDrhg135: You'd better join it right now.
00:56TerranceWarrior+or the real thing
00:57technomancyI almost tried to pick up AVR, but the docs I could find were junk
02:02trap_exitwhen the cljs compiler bitches at me: "map must have even number of forms"
02:03trap_exitis there anyway to tell it "which fucking file and which fucking line" ?
02:03trap_exits/tell it/ask it/
02:03dbaschtrap_exit: what’s the exact error message?
02:04trap_exitCaused by: clojure.lang.ExceptionInfo: Map literal must contain an even number of forms
02:06dbaschtrap_exit: you’re missing the rest of the stacktrace. How are you compiling?
02:06trap_exitcljsbuild autodev
02:06trap_exitCaused by: clojure.lang.ExceptionInfo: Map literal must contain an even number of forms at line 1 /home/x/code/client/cljs/app/all.cljs core.clj:4327 clojure.core/ex-info analyzer.clj:267 cljs.analyzer/error analyzer.clj:1415 cljs.analyzer/analyze-seq analyzer.clj:1506 cljs.analyzer/analyze[fn] analyzer.clj:1499 cljs.analyzer/analyze analyzer.clj:1494 cljs
02:06trap_exitexcept everything looks fine in app/all.cljs
02:10dbaschtrap_exit: what’s line 1? or can you paste the whole thing somewhere?
02:10johanndbasch: line 1 is probably the namespace form
02:11dbaschjohann: yes, it’s probably malformed in a subtle way
02:13TravisDDoes anyone know of a statistically sane way to seed multiple random number generators?
02:15dbaschTravisD: why do you need multiple rngs?
02:15TravisDdbasch: one for each of several threads
02:16dbaschTravisD: all the numbers will come from the same source anyway, you might as well use SecureRandom
02:16dbaschTravisD: in fact, you should use SecureRandom
02:17TravisDSecureRandom will be substantially slower than a Mersenne twister, for example, no?
02:17dbaschTravisD: possibly, it depends on what you need the randomness for
02:18dbaschTravisD: and how much you need
02:18TravisDI'm running some monte carlo simulations. It'd be great to parallelize it
02:18TravisDquite a lot of random bits, I expect
02:19TravisDAh, SecureRandom is often a PRNG that is just seeded randomly. That makes sense
02:25fifosineIs there an if-let form that will hit the else clause when the test evaluates to the empty sequence, ()?
02:26TravisDI think what I'll do is have one PRNG governed by STM that is used to seed a PRNGs for each thread.
02:26TravisDProbably that will not introduce any substantial statistical badness and will allow me to reproduce experimental results
02:28dbaschfifosine: no, the empty sequence is truthy
02:28fifosinemerr
02:40pyrtsafifosine: (if-let [xs (not-empty xs)] ... ...)
02:43dbaschpyrtsa: that’s a good one
02:44pyrtsaNote that unlike (seq xs), (not-empty xs) returns xs when not empty. ;-)
02:44pyrtsa,(not-empty [1])
02:44clojurebot[1]
02:44pyrtsa,(seq [1])
02:44clojurebot(1)
02:44pyrtsaUseful. :)
02:44fifosinepyrtsa thank you!
03:27olliveraIs there any library that helps to create a nested map from a sql query result? so much so that it could result on { username: "ollivera", contact: {phone: "1234-1234", email: "ollivera@example.com"}}
03:28kelseygianybody down for a code review for ~30 lines of very newbie code?
03:29scottjkelseygi: best to just share a link and see what happens
03:32kelseygihttps://gist.github.com/kelseyq/51dce2e997b393f469b5
03:32kelseygiit's pretty unpleasantly imperative
03:32Glenjaminoh wow
03:32Glenjamini'd recommend extracting functions
03:33kelseygiyeah there's one really glaringly obvious one
03:34kelseygican i do local functions? so i still have access to the atoms?
03:34Glenjaminyou just pass them along
03:34Glenjaminalso, it's not clear to me why you have atoms at all
03:35kelseygii'm using a twitter api library
03:36kelseygibut the chunked responses from twitter don't break cleanly on tweet boundaries
03:36Glenjaminthere's no shared state here, so you should be able to use locals
03:36kelseygiit's shared over multiple calls to the callback, no?
03:36Glenjaminoh, sorry
03:36Glenjamini see
03:37Glenjaminit's not a loop
03:37kelseygii mean ideally the callback would take a promise or something
03:37mpenetchunked responses from twitter do not guarantee so split at tweet boundaries
03:37mpenetto*
03:37kelseygibut i'm on like day 3 of clojure and not sure i'm ready to take a crack at taht
03:37kelseygiyes
03:37mpenetfrom what I can remember
03:37kelseygithat's why i'm doing this
03:37kelseygiwhich seems like something a streaming api library should handle
03:37Glenjamintry having only one atom
03:37mpenetYou're better off using twitter4j if you are short on time btw
03:38kelseygibut ¯\_(ツ)_/¯
03:38mpenetit handles all the errors/retries etc nicely
03:38kelseygiwell the point of this project was to play with clojure
03:38kelseygiso i'd really rather not
03:38Glenjaminah, ok
03:38Glenjaminyeah, so try a single atom which is a map of {:expected :count :tweet}
03:39Glenjaminextract the function passed to the callback into a named top-level defn
03:39Glenjaminyou don't need the (do) in there either
03:39kelseygiheh i was just doing that--reading how to pass another function around
03:39kelseygiatom as map makes sense, thanks
03:39kelseygilol i think i got kind of lost and just started throwing do's & parens in there
03:39Glenjaminin fact, every time you have a (do), name a function and pass it the state it needs
03:40Glenjaminonce you've got that it should be easier to read, and thus easier to reason about
03:40kelseygigreat, thank you
03:40clgvkelseygi: right, break that down into several functions
03:42clgvkelseygi: you should also review whether you really need those atoms. that gist looks a lot lilke imperative programming and not functional
03:44kelseygii explained why up above, and yes i'm not thrilled about it
03:45kelseygiif there's a way to share state over multiple calls to that callback without them that'd be rad
03:59FrozenlockHow does one redirect on auth with friend? I've seen this https://github.com/cemerick/friend/issues/100, but I'm a little confused as to how/where I need to add this metadata.
04:00Frozenlock(and why in the metadata?)
04:02szymanowskihello!, how can i turn "camelCaseStuff" into ("camel" "Case" "Stuff") ? i've tried (clojure.string/split #"[A-Z]" my-string) but it grabs the uppercase chars
04:04szymanowski(clojure.string/split
04:04szymanowskimy-string
04:04szymanowski#"[A-Z]")
04:04szymanowskisorry
04:08Frozenlockszymanowski: Found this with a quick google. It should answer your question :) https://www.refheap.com/82154
04:08TEttinger,(re-seq #"[A-Za-z][a-z]+" "camelCaseStuff")
04:08clojurebot("camel" "Case" "Stuff")
04:09szymanowskiThank you very much
04:09TEttingerit'
04:09TEttingerit's a fun problem to solve
04:09TEttingerclojure has nice regex support thanks to java
04:09TEttingeryou can extend it to other languages too
04:12TEttinger,(re-seq #"\p{L}\p{Ll}+" "ΒαλεντίνΒολόσινοφ")
04:12clojurebot("Βαλεντίν" "Βολόσινοφ")
04:13TEttinger\p{L} is any letter, \p{Ll} is any lower case letter
04:20clgvFrozenlock: I'd guess you provide that in the middleware options of friend/authenticate
04:21Frozenlockclgv: but where? I 'with-meta' the credential-fn?
04:22clgvFrozenlock: sounds complicated, I'd thought in the map as usual key value pair
04:22szymanowskiwhat is the way to go for working with rational numbers in clojurescript?
04:24clgvFrozenlock: but according to the readme you seem to be right. https://github.com/cemerick/friend/#todo
04:24Frozenlockclgv: Like you I would have expected to just assoc it in the credential map.
04:25Frozenlockusing with-meta seems... I don't know... dirty?
04:25clgvwell if it there was a consistent distinction between meta properties and regular settings that would be ok. but I cant read that from the docs
04:26FrozenlockI'll ask cemerik tomorrow if he shows up on IRC
05:02TravisDszymanowski: As an alternative to the camel case splitting, you could do it this way:
05:02TravisD,(defn split-camel-case [str] (butlast (re-seq #"[A-Z]?[^A-Z]*" str))) (split-camel-case "thisIsATest")
05:02clojurebot#'sandbox/split-camel-case
05:02TravisD=/
05:02TravisD,(letfn [(split-camel-case [str] (butlast (re-seq #"[A-Z]?[^A-Z]*" str)))] (split-camel-case "thisIsATest"))
05:02clojurebot("this" "Is" "A" "Test")
05:03szymanowski thank you Travis
05:03TravisDthere might be some corner cases though :)
05:04TEttinger,(letfn [(split-camel-case [str] (butlast (re-seq #"\p{Lu}?\P{Lu}*" str)))] (split-camel-case "thisIsATestΒαλεντίνΒολόσινοφ"))
05:04clojurebot("this" "Is" "A" "Test" "Βαλεντίν" ...)
05:07TravisDAh, TEttinger, I didn't see your message earlier
05:07TravisDI am happy that I came up with essentially the same thing
05:08TravisDit was /so/ frustrating that I couldn't think of a way to use "partition-by" or "split-with"
05:16TravisDthis was the best I could come up with without using regular expressions
05:16TravisDhttps://www.refheap.com/82182
05:30owl-v-can clojurec outperform clojre on math problems?
05:32TEttingerowl-v-, sounds possible but I wouldn't think likely
05:33TEttingerif you're doing just numerics stuff you might find more people doing that type of thing in Julia than in Clojure, and I was suprised at the similar library coverage
05:33clgvis clojurec a "usable thing" already?
05:33TEttingerJulia would almost certainly outperform clojure on math because it defaults to using the highly optimized BLAS libs for math
05:34clgvif it is that one https://github.com/schani/clojurec/graphs/commit-activity there seems not much recent activity
05:35TEttingeryeah. if you were targeting LLVM that would be what Julia does as well
05:35TEttingerso maybe they would both be pretty fast
05:38owl-v-somebody did little test on python julia clojure java -> http://matthewrocklin.com/blog/work/2014/01/13/Text-Benchmarks/
05:42TEttingerthat seems like a pretty poor benchmark since it only tests startup time
05:48owl-v-ya, i think startup time is also important, but providing bunch of loops, arithmetic operations, and io operation would have helped.
05:49TEttingerwell it's just too short of a test to gauge actual performance
05:50TEttingerI don't think Python uses a JIT compiler by default, so it has less startup cost, but will take longer for larger inputs
05:56olliveraHow can I map something like {:a 2, :b 4, :c 6, :d 7} to {:a 2, {:b 4, :c 5, :d 7}}?
05:57opqdonutollivera: {:a 2, {:b 4, :c 5, :d 7}} isn't valid syntax
05:57opqdonutyou're missing the key that corresponds to {:b 4, :c 5, :d 7}
05:58opqdonut,{:a 2, {:b 4, :c 5, :d 7}} -- see?
05:58clojurebot#<RuntimeException java.lang.RuntimeException: Map literal must contain an even number of forms>
05:59olliveraopqdonut, okay thank you ... anyway how can I do such map ... with the valid key
06:01opqdonutwhat do you want the key to be? what would you do with {:foo :a, :bar 3, :quux nil}?
06:02olliveraopqdonut, I want to create a nested map with the keys/values bar and quux
06:02opqdonutso you want to leave :foo out? why :foo? a clojure map is not really ordered
06:03owl-v-TEttinger: why not compile once? we can save startup cost at the same time we can have better optimization.
06:04TEttingerowl-v-, and indeed you can in clojure
06:04opqdonut,{:a 1 :x 2 :c 3}
06:04clojurebot{:c 3, :x 2, :a 1}
06:04TEttingerI think his benchmarks didn't do that, by the way
06:04opqdonutollivera: see above, (normal clojure) maps don't have a stable ordering
06:05owl-v-I hope android updates its jvm.
06:06owl-v-it's very interesting to see how ios uses 64bit registers when GC is used :)
06:07owl-v-what is it called.... tags?
06:07owl-v-incremental indexing ..hm..
06:08olliveraopqdonut, I could create a key ... but I would like to have a nested map .. see example
06:08olliverauser=> {:a 2, :b 4, :c 6, :d 7}
06:08ollivera{:c 6, :b 4, :d 7, :a 2}
06:08olliverauser=> {:a 2, :new {:b 4, :c 6, :d 7}}
06:08ollivera{:new {:c 6, :b 4, :d 7}, :a 2}
06:10ssiderisollivera: look into select-keys, assoc and dissoc, you'll probably have to use all of those functions
06:16owl-v-im going to make a tree. but i want to mark values to the elements. how do i do it when the tree is immutable structure?
06:17clgvowl-v-: essentially you rebuild the tree as you update values
06:18owl-v-my tree is going to be quite big, and multiple duplicates of that is... :-(
06:18clgvowl-v-: btw that shootout is not reliable. measuring one time duration leads to false results
06:21owl-v-what if I want to preserve memory by removing modules?
06:23ashish_ In java we read the properties file by Myclass.class.getProtectionDomain.getCodesource.getLocation.getPath() But how this read in clojure
06:25ssiderisowl-v-: clojure uses structural sharing, the copy will refer back to the old tree and consume very little extra memory
06:26ssiderisonly the changed values will be extra
06:29uejeWhy does Clojure use [vectors] so much, instead of lists as in most lisps? Like for definings args to a function for instance
06:30ashish_In java we read the properties file by Myclass.class.getProtectionDomain.getCodesource.getLocation.getPath() But how this read in clojure
06:31owl-v-let structure be like {depth {index {value path-value}}} then change from {0 {0 {3 0}}} to {0 {0 {3 4}}} then what is changed?
06:31ssiderisashish_: (.getPath (.getLocation (.getCodesource (.getProtectionDomain (Myclass/class)))))
06:31owl-v-only 0 to 4?
06:32ssiderisowl-v-: not sure, I'm not familiar with the intimate details of the persistent data structures implementation
06:33pyrtsassideris, owl-v-: That very case will probably end up sharing nothing.
06:33clgvssideris: well if you build a tree of maps and update almost all leaves you will completely rebuild the tree
06:34pyrtsaActually, wipe the "probably" in the above.
06:36pyrtsaashish_: See also the macros `..` and `->`, e.g. `(-> (MyClass/class) (.getProtectionDomain) (.getCodesource) (.getLocation) (.getPath))`.
06:39ssideriswith -> you dont even need all the parens
06:40pyrtsaCorrect.
06:40ssideris(-> (MyClass/class) .getProtectionDomain .getCodesource .getLocation .getPath)
06:44clgvstyle suggestion (.. (MyClass/class) getProtectionDomain getCodesource getLocation getPath)
06:44clgv,(.. String getProtectionDomain getCodesource getLocation getPath)
06:44clojurebot#<CompilerException java.lang.NoSuchFieldException: getProtectionDomain, compiling:(NO_SOURCE_PATH:0:0)>
06:45clgvsomething is missing
06:45ssiderisclgv: that's nice too, hadn't used it before
06:45owl-v-pyrtsa: clgv: ssideris: so it is better to implement this stuff in c/cpp?
06:46clgvowl-v-: not necessarily.
06:47clgvowl-v-: why would you want to use c/c++ voluntarily if the program fulfills all your performance and memory requirements in clojure?
06:48ssiderisowl-v-: it depends, I think in many cases you may be able to re-phrase your problem to better fit clojure. for example for trees/graphs you can represent them using "flatter" data structures which work better in clojure
06:49pyrtsaclgv: I tend to avoid .. altogether and just move the . prefix as close to Java interop as possible, i.e. every method call. But it's a matter of taste with no real winner, IMO.
06:52pyrtsaowl-v-: I'm unsure what you mean by "this stuff".
06:54owl-v-i'm afraid that creating multiple versions of tree might take too much time compared to simply changing a value in a structure.
06:55clgvowl-v-: well being afraid and knowing are two pair of shoes ;)
06:57trap_exitis milk price at $5.50 / gallon? I thought it was $3.509 / gallon
06:57owl-v-clgv: knowing that there will be multiple trees, knowing that copying tree takes time, knowing that copying is slower than changing value, knowing that this is my problem?
06:57clgvowl-v-: you could make a small prototype to check
06:58clgvowl-v-: maybe the representation of the tree is not optimal. there is more then one possibility to represent a tree
06:59clgvowl-v-: I assumed you will use nested persistent datastructures but that is not mandatory.
06:59clgvowl-v-: you could use an indirect representation similar to adjacency matrix/lists
07:08ssiderisclgv: yeah, that's what I meant about "flatter" data structures
07:13phiwareHello, I’m new here and new to clojure :)
07:13phiwareI think I’ve found a bug in clojure.core, in particular, it relates to `binding`...
07:14phiwaremy understanding of `binding` is a bit hairy, so I’m happy to be proved wrong :)
07:14phiwarecan someone help me out?
07:16trap_exitcreate a minimal test case
07:16trap_exitshowing the result and the expected result
07:16trap_exitthen post to the mailing list
07:17phiwareok… it’s going to be quite a task to shrink my test case!
07:18trap_exitthen mostly likely there's something wrong with your "test case"
07:18phiwareyeah, that’s usually the way it goes…
07:19phiwarebut…
07:20trap_exitwhat's a reasonable cost for grocery for 1 person / day
07:20clgvphiware: build a minimal viable gist post it to refheap.com (or similar sites)
07:20trap_exitI can't seem to get mine below $10.00 / day
07:20clgvlol what?
07:20trap_exitthis is half a gallon of milk + half a gallon of orange juice + 6 bagels + cream cheese
07:20trap_exitclgv: how much do you spend on food / day ?
07:21clgvtrap_exit: honestly, I dont know exactly
07:21trap_exitestimate
07:21trap_exit$10.00 / day ? $20.00 / day ?
07:21agarmanin college, it was $3/day
07:21trap_exitagarman: how did you pull that off?
07:21agarmannow-a-days much much more :-)
07:22clgvlunch is between 3-5 euro. and the rest? hmm maybe in average closer to 10 euro / day than 20
07:22ssiderisclgv: what country?
07:22trap_exitunited states
07:22trap_exitfucking silicon valley
07:22trap_exiteven food here is more expensive
07:22grimmulfrcan someone please explain to me how deps work in lein (on windows)? I'm trying some simple gfx so I though I'd use quil. Added (:use quil) in my source, and [quil "1.7.0"] in the project file. ran lein deps, all seemed to work, but when compiling (from within a working emacs windows environment) I get FileNotFoundException Could not locate quil__init.class or quil.clj on classpath: clojure.lang.RT.load (RT.java:4
07:22grimmulfr43)
07:23grimmulfrI see what the error means, but not sure what extra steps I need to take to make the library available
07:23clgvssideris: germany. lunch at university for student prices ;)
07:23agarmangrimmulfr: can you post your project.clj to refheap.com
07:24grimmulfrNothing fancy, just ran `lein new' and added that deps line, but will do
07:24grimmulfrhttps://www.refheap.com/82198
07:24grimmulfroh, added :main too
07:25nbeloglazovgrimmulfr, it should be quil.core I think
07:25clgvgrimmulfr: looks fine. it is quil.core
07:26grimmulfrso [quil.core "1.7.0"] ?
07:26grimmulfror the :use thing in my source is quil.core?
07:26nbeloglazovin :use
07:26agarmanno, the dep looks fine
07:26grimmulfrOh, thank you, will try now
07:26grimmulfrNo suck namespace qc :(
07:26grimmulfrsuch*
07:27grimmulfrneed to read an actual documentation page methinks
07:27nbeloglazovgrimmulfr: I would suggest to start with example from README: https://github.com/quil/quil#getting-started It should work fine out of box.
07:27grimmulfrcheers
07:27agarmanfor quil, it's (require 'quil.core)
08:09grimmulfr(:require [quil.core :refer :all]))
08:09grimmulfrThis worked
08:09grimmulfrYey, first gfx :)
08:34jcidahoHi - anyone using Stuart Sierras component lib?
08:35jcidahoit's great for starting up components, but if a component blows up during startup you ideally want it to gracefully shutdown components already started
08:36agarmanI looked at it
08:36agarmanand started playing with https://github.com/juxt/jig
08:37jcidahohow did jig treat you?
08:37agarmanhaven't gotten far with it
08:40clgvwhat I dont get with jig: why do you have to clone the project? is it not usable as lib? wouldn't a lein template be the better choice?
08:41gfredericksjcidaho: I think if your start/stop methods are idempotent you could just call stop on the system after failure
08:42jcidahogood point gfredericks
08:43pyrtsaWhat I don't get in Component is why start has to be separate from initialization.
08:44pyrtsaIt would be much simpler if you simply couldn't start a service without its dependencies passed in as arguments and, hence, started first.
08:45AWizzArdBtw guys, there’s also a german speaking Clojure channel: #Clojure.de
08:45pyrtsaThe whole interface (protocol) could be just function to stop the service.
08:47gfrederickspyrtsa: I've used the initialize/start separation in tests to modify the component before starting it
08:48pyrtsagfredericks: Why do you need to modify it? Why don't you just modify the arguments you use to construct it?
08:48pyrtsaI thought mutation was considered bad here. :o
08:48gfredericksbecause that constructing happens in the app code
08:48gfredericksand I'd have to duplicate it in the test code to do it your way
08:48gfredericksit's not mutation, it's record modification
08:49gfredericks(-> (app-code/make-system) (assoc :component (mock-component)) (component/start))
08:50pyrtsagfredericks: Does (assoc c :component (mock-component)) replace something in c?
08:51gfredericksyep
08:53pyrtsaI think that approach is conflating two interests: the "system" record is both its configuration and a handle to a stateful system.
08:54gfredericksyes the record + statefulness approach is super weird
08:54gfredericksbut I don't have a better idea
08:54pyrtsaMy approach wouldn't be much different, something like (-> (app-code/make-config) (assoc :component (mock-component)) (component/run))
08:55pyrtsa...The main difference being that the app does its own (assoc c :component ...).
08:55gfrederickswhat does (mock-component) return?
08:55pyrtsaAnd sorry, actually there is no component/run in my model.
08:56pyrtsa(mock-component) returns a mocked component (in this case, with no arguments).
08:56gfredericksalready started?
08:56pyrtsaYes.
08:56gfredericksso (app-code/make-config) contains other started components also?
08:56pyrtsaSeparating the start from the initialization is, I think, a mistake.
08:56pyrtsaYes.
08:57gfredericksyou were complaining about conflating two things and now you're arguing for conflating two things :P
08:57gfredericksso what if (mock-component) has dependencies inside (app-code/make-config)?
08:58pyrtsaSee, it's then up to you to choose how the plain-old-data config and resource-like arguments need to be created. In practice, I'd have those in separate steps
08:59pyrtsagfredericks: If mock-component had dependencies, you couldn't call it like (mock-component), you'd call it like (mock-component {:dep1 d1, :dep2 d2, :foo "bar", ...})
09:00gfrederickswould those args be started or not? it sounds somewhat difficult to reason about the ordering of things
09:00pyrtsaThat itself defines the DAG of dependencies, and all visible in code.
09:01pyrtsaBy default, these components are started when they are created. After that, they can be only stopped, then garbage collected.
09:02pyrtsaThen, anything you need to do before starting a component, you must by definition do before creating the component.
09:03pyrtsaOf course you could group all dynamic configuration into one single map that is used by all components that need (parts of) it.
09:35rodnaphhi - i'm using "lein bin" to create an executable, and trying to set -Xmx via JAVA_OPTS or JVM_OPTS but it doesn't seem to have any effect. can anyone help? thanks.
09:39hyPiRionRaynes: someone is using your plugin and want some help with it
09:40phiware,(def ^:dynamic *modulus* 10) (defn f [x] (-> x (inc) (mod *modulus*))) (binding [*modulus* 3] (take 3 (iterate f 1)))
09:40clojurebot#'sandbox/*modulus*
10:00mdrogalishttps://twitter.com/feross/status/459259593630433280
10:02rodnaphRaynes: trying to use JVM_OPTS with your "lein bin" plugin but they don't have any affect, can you help?
10:02ssiderismdrogalis: !!!
10:03mdrogalisssideris: I'm not sure if that's a joke.
10:04grimmulfrAnyone know of a simple step by step clojurescript tutorial that gets me from creating a basic lein project to actually publishing a working "hello world" html + js? (not looking for starting my own server locally, as I already run one). I just want something to get me going with doing the scripting
10:05mdrogalisI mean, why would we hear about this at 54 gigs? You'd think someone would have to make a public outcry at, say, 20 gigs.
10:05mdrogalisSomeone just *snapped*!
10:05rodnaphgrimmulfr: swannodettes example as as concise as it gets if you're after bare-bones - http://swannodette.github.io/2013/10/27/the-essence-of-clojurescript/
10:06grimmulfrNice, thank you :)
10:06phiware,(vector (def ^:dynamic *modulus* 10) (defn f [x] (-> x (inc) (mod *modulus*))) (binding [*modulus* 3] (take 3 (iterate f 1))))
10:06clojurebot[#'sandbox/*modulus* #'sandbox/f (1 2 3)]
10:07grimmulfrThat is pure clojurescript right? no extra libs and whatnot?
10:07arrdempurity is overrated..
10:08grimmulfrNot a purist, just trying not to mess my head up at this stage in the learning process :D
10:08mdrogalisThat's fair.
10:08rodnaphjust leiningen and clojurescript afaik
10:08grimmulfrAwesome, thank you
10:09owl-v-how do i memory trace?
10:09phiware,[(def ^:dynamic *modulus* 10), (binding [*modulus* 3] (take 3 (iterate #(-> % (inc) (mod *modulus*)) 1)))]
10:09clojurebot[#'sandbox/*modulus* (1 2 3)]
10:10phiwareSorry to pester clojurebot, but this represents the bug I have encountered in the repl…
10:12pyrtsaphiware: take is lazy.
10:12grimmulfrYey, it worked. Time to see how I can do everythign from within emacs, I just hate running lein from the console
10:12pyrtsa,[(def ^:dynamic *modulus* 10), (binding [*modulus* 3] (vec (take 3 (iterate #(-> % (inc) (mod *modulus*)) 1))))]
10:12clojurebot[#'sandbox/*modulus* [1 2 0]]
10:13phiwareyup, but what about binding conveyance?
10:13ToxicFrogThe lazy sequence doesn't close over its (binding)s?
10:13ToxicFrogEek.
10:13hyPiRionToxicFrog: not the dynamic ones
10:14owl-v-how do i trace memory?
10:14phiware,[(def ^:dynamic *modulus* 10), (binding [*modulus* 3] (last (take 3 (iterate #(-> % (inc) (mod *modulus*)) 1))))]
10:14clojurebot[#'sandbox/*modulus* 0]
10:14hyPiRionphiware: you can use bound-fn to bind dynamic values to functions
10:14ToxicFrogManually making sure I never let something lazy defined in terms of dynamic bindings escape is not something I should have to worry about!
10:15hyPiRion,(binding [*modulus* 3] (take 3 (iterate (bound-fn [x] (mod (inc x) *modulus*)) 1)))
10:15clojurebot(1 2 0)
10:15hyPiRionToxicFrog: solution: Don't use dynamic vars
10:16hyPiRionalthough I get your concern, it's a pain with IO as well.
10:16ToxicFroghyPiRion: when dynamic binding is useful it is really fucking useful.
10:17hyPiRionToxicFrog: huh? It usually allows you to pass in a parameter less to a function
10:17phiwaredynamic var fits my needs, I have a group of functions that all use the same var and it should remain constant for a given application
10:19ToxicFroghyPiRion: yes. And when you have an entire call stack that all need access to some configuration map or similar, not needing to manually thread that through every function that needs it makes things way cleaner.
10:20ToxicFrogOr, for example, when you're using something like Saturnine and you can bind *to-client* and *to-server* to upstream or downstream appropriately depending on which direction you're processing in.
10:21hyPiRionToxicFrog: Sure, it makes stuff seem cleaner, and in general it's easier to work with.
10:22hyPiRionbut it's hard to reason about it when it comes to higher order functions
10:25phiwarehyPiRion: even with HOF it’s easy when the bebound var doesn’t change in the context of the application/domain
10:25phiwarerebound*
10:29phiwareI still think that binding conveyance should take care of the laziness of take
10:29phiware(no pun intended)
10:30hyPiRionphiware: Sure, but if it doesn't change, then what's the point of a dynamic var?
10:31phiwareit can be rebound. When building a library I can make that decision for all applications
10:32phiwarecan’t* make that decision
10:33gtrakwhat's the closest thing to ruby's mechanize these days?
10:33gtrakI like the whole cookies.. stateful object thing.. but ruby.
10:33hyPiRionright, which is why functions per definition cannot lock their dynamic scope
10:33hyPiRion(at least not by default)
10:34CookedGryphonDoes anybody have an idea how to use profiles with cider-jack-in? I hate having an extra terminal floating around running my headless repl just because I want to use a profile other than :default
10:35gtrakI guess I could hack something together with clj-http and laser
10:36dakronegtrak: maybe check out https://github.com/sonian/cartridge also?
10:37gtrakah, cool.
10:37gtrakthat's like VCR
10:37gtrakbut I imagine less monkey-patchy :-)
10:39szymanowskihello, does anyone know how can I call a function given its "string-name" in clojurescript?
10:40szymanowskilike (call "+" 1 1)
10:41gtrakdakrone: trying to work around lack of basic auth for an oauth api :-)..
10:41gtrakfigured I could fill in the login form programmatically and extract the token out of the redirect.
10:42phiwarehyPiRion: the group of functions I’m developing share a common *word-length*, dynamic vars seems to fit the bill (there’d be nothing to stop an application from changing the *word-length* “mid-stream” but it would be breaking the rules of my group of functions)
10:43owl-v-szymanowsky: i don't know anything about clojurescript. maybe there is #clojurescript in irc?
10:44hyPiRionphiware: yeah, as long as they work within the same dynamic scope, you're fine
10:44phiwarehyPiRion: I could place the word-length as the first arg, and then the application could redefine each function using partial… would that be idiomatic?
10:45hyPiRionphiware: no need, just be aware of the scope of dynamic vars
10:45szymanowskithank you owl-v- it seems to be a #clojurescript IRC i will try
10:45phiwareit’s the whole thread-local nature of dynamic vars doesn’t fit with me…
10:46hyPiRionI'm just saying that whenever you pass a function down or up a scope, stuff may get very confusing
10:48CookedGryphonalternatively, does anyone know of a way to specify the leiningen profile to use when no other is specified? Sort of like :default, but doesn't get included if you with-profile something else
10:53phiware,[(def ^:dynamic *modulus* 10), (let [*modulus* 3] (take 3 (iterate #(-> % (inc) (mod *modulus*)) 1)))]
10:53clojurebot[#'sandbox/*modulus* (1 2 0)]
10:54technomancyCookedGryphon: I don't understand what you mean about with-profile
10:54technomancy
10:55phiwarehmmm, a dynamic var is a hairy thing indeed
10:57CookedGryphontechnomancy: so I have a project with multiple profiles, some for clojurescript, some for android, and some for running midje on my desktop
10:57CookedGryphontechnomancy: when I cider-jack-in, I want the profile with all the desktop stuff and midje
10:57CookedGryphonbut cider jack in provides no option for that
10:58CookedGryphonif I set default, that breaks my other profiles, because it pulls all teh midje stuff into my android and clojurescript builds
10:58phiware,[(def ^:dynamic *modulus* 10) (defn f [x] (-> x (inc) (mod *modulus*))) (let [*modulus* 3] (take 3 (iterate f 1)))]
10:58clojurebot[#'sandbox/*modulus* #'sandbox/f (1 2 3)]
10:58pyrtsaphiware: Nothing prevents you from hiding names in a let binding. But you shouldn't use *earmuffs* in a let binding, that isn't recommended.
10:59phiwarepyrtsa: I’m explore dynamic vars, you’ll notice I’ve def’ed that way…
11:00pyrtsaA let binding doesn't touch the dynamic var at all.
11:01phiwareyeah, I thought that it did, my mistake
11:01phiwareis `binding` the only way to redefine it?
11:03pyrtsaYou can use e.g. set! too.
11:04pyrtsaBut dynamic vars aren't pretty.
11:05hyPiRionphiware: It's recommended to just use binding, I think. Using set! can be... nasty
11:05stuartsierrahttp://stuartsierra.com/2013/03/29/perils-of-dynamic-scope
11:05phiwarebut they do have a purpose…
11:09technomancyCookedGryphon: you can change cider's jack-in command
11:10CookedGryphonyeah, I'm looking at that, but ideally this should be something that doesn't break jack-in for my other projects and which my other team members can just pick up and use
11:10CookedGryphonI'm writing a cider-jack-in-with-profile (profile-name)
11:11CookedGryphonwould be nice if there was something officially supported though, not sure this is going to be neat enough for a PR
11:11phiwareset! doesn’t work if the dynamic var is defined in another ns
11:18phiwarestuartsierra: I have read that blog post before …but it was worth a reread :)
11:18stuartsierraphiware: thanks
11:19phiwareI’n not trying to manage a resource as in DSSR
11:19phiwareI’m trying to parameterise a group of functions…
11:21phiwareconsider modular arithemetic: clock-add, clock-multiply, clock-diff, etc… all based on 24 hours in a day
11:21phiwarebut why not 12 hours, imagine a decimal clock!
11:22phiwareonce an application has chosen the number of hours per day, it is encourge to stick to it.
11:24technomancyCookedGryphon: you can use emacs dir-locals to scope it to one project
11:24CookedGryphontechnomancy: so I've written a cider-jack-in-with-profile which takes a profile string
11:24CookedGryphonit's a bit repeaty of cider-jack-in, but it works
11:25CookedGryphonmight tidy it up and see if anybody wants it
11:25phiwareI propose ^:dynamic *hours-on-clock*… but it lacks indefinite extent…
11:26mikerodI'm reading through the Clojure v1.6 changelog on github. I noticed this item: "(no ticket) Rich Hickey fix: use non-loading classForName"
11:26mikerodIs there a way I could get more information on this?
11:26rovarblarg
11:26mikerodPerhaps see what this change entails?
11:27mikerodJust digging around some. I have observed a slight change of behavior from 1.5.1 to 1.6 around RT#load
11:27rovarwhat is the simplest way to make a basic templated site with partials in clojure? I'm thinking its enlive but I was wondering if there were other options.
11:27rovarI have to maintain a pure static html5 site, and so I just want to partial the nav, headers etc..
11:27rovarI don't need a full fledged blog static generator
11:28phiwareyes, I have considered partials, and they are lookin more and more attactive
11:28mikerodPreviously it seemed that using RT#load multiple times on a namespace I had with a defrecord in it only compiled the ns once; and thus didn't recreate the defrecord class. In 1.6 I'm seeing this defrecord being compiled repeatedly upon multiple calls to RT#load
11:29gtrakCookedGryphon: cider would probably take something that customizes cider-jack-in via variables. Not sure what the closeest thing to a dynamic binding in elisp is.. except all of it.
11:29mikerodI'm just trying to track down what made this happen since none of the changes I can see are immediately obvious. I know the fix for it is to not use RT#load when I don't want the re-compile; just use something like `require`.
11:29llasrammikerod: If that's what I think it was, there had been some mailing list discussion, and I didn't realize had been slipped into 1.6
11:29llasrammikerod: Tracking down commit, but I believe is about JVM class loading, not namespace loading
11:29mikerodllasram: hmmm I'm trying to figure out how to search for it. I can search in the mailing list
11:31gtrakrovar: selmer's pretty neat.
11:31gtrakLuminus uses it, if you create a new luminus project, you can see how it's all wired up.
11:32llasrammikerod: Here's the commit: https://github.com/clojure/clojure/commit/38a129f2631a75ed999b52d8e0440f730b00da1f
11:32gtrakI think it'd be easy to generate files from it.
11:32technomancygtrak: .dir-locals.el is best for stuff like that
11:32phiwareI realise I’ve mostly been talking to myself here …but helps to talk out loud, thanks
11:32gtraktechnomancy: awesome
11:32gtrakCookedGryphon: ^
11:32rovargtrak, wow. that is pretty advanced.
11:33mikerodllasram: oh, awesome
11:33mikerodthanks!
11:33llasrammikerod: But... v confused, because doesn't seem to reflect current reality
11:34gtrakrovar: the template inheritance stuff is something not built-in to things like hiccup.
11:34gtrakI'd just use hiccup for small stuff.
11:34llasrammikerod: Wow, what a mess
11:35mikerodllasram: what doesn't reflect reality?
11:35mikerodoh, the LispReader
11:35llasrammikerod: The RT method was introduced in that commit, but that single use was in the EvalReader, and was re-written back to just classForName in 53201d8c38a984401ae9d70190cf1959902edf64
11:35rovargtrak, I don't think I want to get that crazy just yet. I think I'm just going to slurp partials and inject them with the enlive selectors.
11:36rovarthat way the html stays pure html..
11:36gtrakcool, I've been using laser myself. same idea.
11:36gtrakbut I didn't already know enlive
11:37llasrammikerod: The one remaining classForNameNonLoading call is in 5cf6aa3f90778498c116d143750ce31a0e2cee39, which was part of an attempt to make `read`ing safer prior to adding the explicit EDN reader in the last commit I mentioned
11:38llasramSo... Really that change doesn't belong in the log, because nothing really happened which matters to anyone, except that Record JVM classes aren't loaded upon reference in the LispReader
11:38mikerodllasram: yeah, I'm seeing what you mean now looking at these commits
11:39mikerodHmm. So it isn't looking likely that these changes is what has cause my `defrecord` to create multiple definitions of the same class when multiple RT#load calls are called on its enclosing namespace.
11:39TerranceWarriorHow to cleanly stop java clojure daemon processes under linux? ctrl-z leaves them continously running in the background.
11:39mikerodchanges are*
11:40iwilligdoes anyone know the emacs minor-mode that highlights the current paren or scope you cursor is in
11:40rovargtrak, laser looks pretty cool. Very similar to enlive, and the author is right, enlive is very full featured for what it does. A bit overkill for me, but whatevs.
11:42llasramiwillig: `show-paren-mode`
11:42TerranceWarriori am suprised this doesn't happen to anyone else.
11:43llasramTerranceWarrior: Well, in a terminal ctrl-z normally sends SIGSTOP to a process, leaving it suspendend in the background
11:43llasramSo it's utterly unsurprising it does this to Clojure processes too
11:44iwilligthanks llasram
11:44ToxicFrogTerranceWarrior: to get back a backgrounded process, use 'jobs' to list them and then 'fg %n' to foreground one. Then you can ^C or the like as you see fit.
11:44rovaris there a function to map a function f across a seq of K's and return a hashmap of { K f(K) }
11:45ToxicFrogrovar: (zipmap ks (map f ks)) ?
11:45rovari can do it in two loops.. can't think of a way to do it in one..
11:45rovarToxicFrog, lemmme look at zipmap and see if that's what I'm after..
11:46ToxicFrog,(let [ks [1 2 3 4]] (zipmap ks (map #(* %1 %1) ks)))
11:46clojurebot{4 16, 3 9, 2 4, 1 1}
11:46coventryFor one loop, there's (into {} (for [k ks] [k f (k)]))
11:46rovarToxicFrog, yea that'll do, although that is also technically two loops
11:46coventryEr, (f k)
11:47TerranceWarriorToxicFrog: 'jobs' produces no results.
11:47rovarah.. man for seems to come in handy
11:47coventryYeah, for is even better than juxt
11:47ToxicFrogTerranceWarrior: you're doing it from the same shell you ^Z'd them from?
11:47ToxicFrogjobs are shell process specific.
11:48TerranceWarriorToxicFrog: wow, now it works.
11:48TerranceWarriorToxicFrog: thank you.
11:49TerranceWarriorToxicFrog: do you happen to know how to default lein {command} to the latest clojure (without needing a project.clj file)?
11:50ToxicFrogTerranceWarrior: no idea, sorry
11:51ToxicFrogTerranceWarrior: oh yeah, and as for job control - note that something in the background is suspended. If you genuinely want it to keep running in the background, use 'bg %n' (or just 'bg' to background-resume the most recently suspended process)
11:51ToxicFrogThis is basically the same as running it in the first place with '&'
11:54cbpTerranceWarrior: You need to run leiningen from source to use the latest clojure by default
11:54TerranceWarriorcbp: ah ok. thanks.
12:02owl-v-clojure on ios?
12:04TerranceWarriorcbp: you mean this: https://github.com/technomancy/leiningen/tree/master/resources/leiningen/new/app
12:04TerranceWarrior?
12:04cbpTerranceWarrior: I'
12:04cbper
12:05cbpI'm not entirely sure what you're pointing out
12:05TerranceWarriorcbp: ok
12:05cbpBut sure that commit hasnt been released yet
13:22TravisDGiven some mutable java object, are there some standard techniques for exposing a functional interface?
13:23grimmulfrwhat exactly does "mies" in lein cljsbuild auto hello-world provide? I tried retracing the (working) example that I put together at work and it doesn't seem to work for me anymore. i made a new project with lein new cljs, copied over the inde.html that I had from work (since without the mies part it doesn't get created), I replicated the src code and added everything to the project file (changing all hello-world to
13:23grimmulfrcljs of course), and even though cljsbuild-start (in emacs) says that it compiled, it doesn't build all the files, I only get goog so cljs.core is not available. I tried to build it manually with `leim cljsbuild auto and it just hand at "Compiling ClojureScript". Any ideas? What Am I missing here?
13:23grimmulfrsorry for the spammy question :)
13:23grimmulfrreplace the first command with `lein mies auto hello-world' :)
13:24danneuWhat's the Clojure equivalent to `Terminal.Color.Red`?
13:27hyPiRionIn clojure-lanterna, it's `:red`
13:28danneuhyPiRion: thanks, i'll check out clojure-lanterna
13:32yeoj___is there any easy way to slurp a file, and if it's large just grab the first 100 rows?
13:32yeoj___or should i be looking at a lazyseq read file type thing.
13:32gtrakyeoj___: line-seq takes a reader
13:32gtrakslurp is not lazy
13:35danneuline-seq is great.
13:43amalloydanneu: Terminal.Color.Red wouldn't even really work in java - you have to at least spell it RED
13:43amalloybut, since Color is an inner class of Terminal, which has RED as a constant, it would look like Terminal$Color/RED
13:59danneuamalloy: thanks. Lanterna docs had both Red and RED
14:30yeoj___If i'm filtering based on re-matches with regex groups... how can i reference the individual groups after the filter is matched? It seems as though it comes across as a line only... the groups are gone.
14:30yeoj___basically i want to pass the results of re-matches from a filter, rathre than the line that is inbound
14:30yeoj___not sure if thats possible
14:33justin_smith,(re-matches #"this((that)other)" "thisthatother") yeoj___
14:33clojurebot["thisthatother" "thatother" "that"]
14:33amalloyi think yeoj___ is probably looking for keep rather than filter, or map followed by filter
14:34yeoj___ahh ok i don't know about keep yet, i'll look that up.
14:34yeoj___i'm puling in a lin-seq based on regex groups, and i want to use the groups inside the with-open .... and I'm sure i don't want to run regex-matches twice...
14:34yeoj___i'll check on keep
14:35justin_smithyeoj___: anyway, if I understand you correctly you would want to define groups in your RE and look at some of the other indexes in the vector returned by re-matches
14:37yeoj___justin_smith: yeah thats the idea
14:40justin_smithand yeah, keep or filter⋅map will help there too
14:48yotsovI've been trying (unsuccessfully) to understand what Brandon Bloom's Extensible Clojure is. It seems to have its roots in Haskell concepts I am not familiar with. Can anybody recommend any somewhat "simple" read explaining what this sort of extensibility is about?
14:50justin_smithyotsov: for one thing, it is very much a work in progress. Do you know the names of any of these haskell concepts in question?
14:50yotsovjustin_smith: monad transformers to begin with
14:50justin_smithyotsov: I trust you saw the link to this on his github http://okmij.org/ftp/Haskell/extensible/
14:51yotsovjustin_smith: yes indeed, it didn't help me, my knowledge of haskell is basic
14:51justin_smithyotsov: there are way too many monad tutorials, maybe #haskell could help you find a good one, or maybe they will just make jokes about mexican food
14:52mercwithamouthhaskell or #scala in fact if you can get ahold of dibblego (Tony Morris) in either one of those rooms he's one of the best teachers i've come across as far as programming concepts are concerned
14:53justin_smithyotsov: birds eye simplistic view, it looks to me like eclj differs from clojure in that clojure (the jvm version especially) tries to be as thin an interface as can be implemented while having a somewhat clean / sane semantics
14:53yotsovjustin_smith: hehe, I have a basic understanding of monads, but far from enough to grasp the meaning of this paper abstract. The thing is, I was wondering if I could somehow understand the concepts in extensible clojure without deepening my haskell knowledge first
14:53justin_smithyotsov: where instead it wants a general view of program transformation that would be portable across clojure implementations, and bootstrapped in clojure itself
14:55justin_smithiow what is wanted is to be able to programmatically simplify / optimize / manipulate programs. This is why you want to account for and manipulate side effects of code that is not run yet. Which is where monads and transformations on monads come in.
14:55justin_smithI think.
14:56justin_smithI would double check the those speculations, but they are based on what bbloom has said so far on this channel, and my understanding of what a "mondad transformer" would be
14:59yotsovjustin_smith: thanks! that gives me some ideas which way to dig further.
14:59TerranceWarriorfireplace.vim is pretty weak.
14:59nDuffIs there a way to reexecute cljsbuild when "cljx auto" rewrites generated cljs code?
15:00technomancynDuff: if you had a generalized auto-task thing you could chain them instead of having every plugin reinvent the wheel with auto-watching
15:00technomancyI don't know about cljx auto specifically, but it makes me grumpy
15:02justin_smithlazybot: fortune
15:02lazybotDifficulty at the beginning usually means ease at the end...except in bed
15:11fifosineI have this anonymous function (fn [item] `(foo ~item)) that includes quoting and unquoting. Is there a way to write this with the #(…) macro?
15:12Chousukenot really
15:12fifosineno? ok
15:13cbp#(do `(foo ~%))
15:13Chousukeyou can do something like #(do `(foo ~%)) I guess but the fn looks nicer
15:13Chousuke:P
15:13justin_smithyeah, agreed the fn is nicer than that
15:13fifosineok
15:13fifosinewhy do you guys prefer it?
15:13justin_smithunlike ' (quote) I don't think ` has a non-reader-magic version
15:14justin_smithfifosine: the fn is not much longer, and is much clearer to read
15:14justin_smithand comes out to be the same code
15:15justin_smithsyntax-quote is the name of `, and it is not bound in clojure.core
15:16fifosineSorry, I'm only just learning clojure, what does non-reader-magic refer to?
15:16justin_smiththe reader expands some things before macro-expansion
15:16justin_smith` is not a macro, it is a reader-macro
15:16fifosineoh ok
15:17fifosinewhy are there two levels of macro expansion?
15:17justin_smith,(macro-expand '`(this that something))
15:17clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: macro-expand in this context, compiling:(NO_SOURCE_PATH:0:0)>
15:17justin_smith,(macro-expand-1 '`(this that something))
15:17clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: macro-expand-1 in this context, compiling:(NO_SOURCE_PATH:0:0)>
15:17justin_smithhrmph
15:17justin_smithfifosine: because a prefix-character does not follow the standard clojure reading rules
15:18justin_smithso special reading rule changes are needed, thus reader-macros
15:18fifosineok, gotcha
15:18justin_smithsimilar for anything beginning with #
15:18cbp,(macroexpand-1 '`(this that something))
15:18clojurebot(clojure.core/seq (clojure.core/concat (clojure.core/list (quote sandbox/this)) (clojure.core/list (quote sandbox/that)) (clojure.core/list (quote sandbox/something))))
15:18justin_smithahh, silly me, thanks
15:18justin_smithnotice no mention of quasiquote above - the reader expands it before macroexpand-1 sees it
15:18fifosineok
15:19justin_smithsimilar issues for most things with . in them
15:20honzawhat's the idiomatic way of checking if an optional parameter was passed to a function (from inside the function)?
15:21dbaschhonza: it depends on what you want to do, do you want to have a default value or do you want to do something else?
15:22honzadbasch: in this case, i want to set a reasonable default; but interested in both
15:22dbaschhonza: for a default you could do (or variable default-value)
15:22justin_smith,(map (partial apply (fn [& [y]] (not (nil? y)))) [[] [1] [:a] []]) ;honza
15:22clojurebot(false true true false)
15:23honzadbasch: yes, but the optionality of the arg makes it a seq
15:24justin_smithhonza: note how in my example I made it not a seq
15:24cbp^ You can nest destructuring
15:24honza(defn f [a & b] ... b is a seq here
15:24justin_smith,(map (partial apply (fn [& [y]] [y (not (nil? y))])) [[] [1] [:a] []]) ;honza
15:24clojurebot([nil false] [1 true] [:a true] [nil false])
15:24honzajustin_smith: sorry, missed your reply
15:25justin_smithnp
15:25dbasch,((fn [x & [optional]] (println optional)) 1 2)
15:25clojurebot2\n
15:27dbasch,((fn [x & [optional]] (println (or optional 2))) “A”)
15:27clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: “A” in this context, compiling:(NO_SOURCE_PATH:0:0)>
15:27dbasch((fn [x & [optional]] (println (or optional 2))) 1)
15:27dbasch,((fn [x & [optional]] (println (or optional 2))) 1)
15:27clojurebot2\n
15:31honzajustin_smith: dbasch: welp, somehow it didn't occur to me that it would be nil --- thanks
15:32dbaschnp
15:46Glenjaminhi everyone - is there a shortcut for #(= (:key %) :val) when applied to a map?
15:46Glenjaminspecifically, I'm filtering a seq of maps where (= (:key %) :val)
15:47fifosineIs there a way within repl to view what java source is generated by a function?
15:51dbaschfifosine: you mean bytecode?
15:51fifosineNo, I mean the human-readable source
15:52dbaschfifosine: clojure compiles to bytecode, not java
15:52fifosineOh ok
15:52cbpYou can compile and then use a decompiler
15:52Bronsafifosine: https://github.com/gtrak/no.disassemble is the best you can get
15:52fifosineI was just wondering if there was something quick so that while I'm exprimenting in the repl, I can just see other interpretations of the code
15:53fifosineI don't want anything complicated
15:53gtrakfifosine: it's possible to hook up a java decompiler, I'd welcome a PR :-).
15:54Bronsagtrak: I don't think all the bytecode generated by clojure has a corrispondence with java though
15:54gtrakoh, huh, good point.
15:54ambrosebsGlenjamin: (comp #{:val} :key)
15:54gtrakcan't hurt to try.
15:54gtrakhttp://jd.benow.ca/ supports up to 1.7
15:54fifosinethere are instructions in java bytecode that can't be represented decompiled?
15:54gtrakthis is not meant to be used in production :-)
15:54Glenjaminambrosebs: thanks, i thought there was a trick with sets, but couldn't remember it
15:55technomancyfifosine: yeah
15:55fifosinehuh, that's weird
15:55technomancyfifosine: locals clearing being the main one that comes to mind
15:55gtrakinvokedynamic?
15:55technomancyiirc you can also do intra-method gotos in bytecode
15:55Bronsatechnomancy: I was thinking of that aswell
15:55dbaschhere’s an interesting series of posts about decompiling clojure to bytecode http://blog.guillermowinkler.com/blog/2014/04/27/decompiling-clojure-iii/
15:55technomancy(or maybe that was just a proposal)
15:55gtraktechnomancy: within one method, that's how loop-recur works.
15:56gtraksets a jump target.
15:56technomancyoh sure
15:56dbaschfifosine: it’s not java bytecode, it’s jvm bytecode
15:57fifosineIf I have a function that returns a sequence, but I know in specific situations it will return a sequence of one element, is there a prettier way of retrieving that singleton versus (first …)?
15:57technomancyfifosine: you can destructure it
15:58fifosinetechnomancy: What does that mean?
15:58gtrakfifosine: well, no-disassemble can return data structures now, it would be easy to walk over them and print it however you like.
15:58dbasch,(let [[a & rest] [1 2 3 4]] a)
15:58clojurebot1
15:59fifosineI guess I prefer first over a let
16:00justin_smithfifosine: yeah, it makes more sense when the value is already in a fn args list or in a let
16:01justin_smith,((fn [[a & rest]] [a a]) (range))
16:01clojurebot[0 0]
16:03klokbaskeany clojure shops in copenhagen? :-)
16:08grimmulfrAnyone that does web dev with clojure & friends: do you work with clojure alone? Or integrate with php backends of sorts? (maybe clojurescript + json/ajax requests?!)
16:08lvhhi
16:08mercwithamouthgrimmulfr: friend library?
16:09lvhI'm trying to write something that interacts with a foreign rest service through clj-http
16:09justin_smithgrimmulfr: clojure on the backend, js+sass on the frontend (we are a shop mainly known for design / frontend quality)
16:09lvhfor testing I obviously don't want to actually itneract with the rest service
16:09rhg135php...
16:09mercwithamouthfunny i was just aboutt o ask a similar question. does anyone use liberator ad friend together
16:09justin_smithgrimmulfr: so my job on the backend is to make things seamless for frontend, and let them do things as they would normally
16:09lvhin python, I would pass around an object with some interface, and just stub the methods
16:10lvhhow do I do it in clj? pass around a map with some functions?
16:10justin_smithlvh: a map can have functions in it
16:10lvhjustin_smith: Yes, I understand; that's what I'm suggesting :)
16:11justin_smithahh, I misparsed "with" there
16:11lvhe.g. {:validate #(...) :submit #(...)}
16:11lvhis that a reasonable way to do it?
16:11justin_smithlvh: in general my best results in clojure are making things pure stateless functions whereever there is any "logic" to speak of
16:11grimmulfrI meant friends as in clojurescript/jayq/hiccup etc :)
16:11justin_smithand making all imperative/stateful parts into minimal logic free stubs
16:12justin_smiththat makes it easy to do comprehensive testing of everything that is not a remote service
16:12justin_smithwhich you would not test directly anyway
16:12lvhjustin_smith: sure, absolutely; but the rubber has to hit the road somewhere right
16:12lvhI guess Id on't really have to test the I/O bits and just supply some JSON response strings
16:12justin_smithright, because IO is part of the stateful stuff
16:13justin_smithand I really do mean abstract out everything stateful
16:13justin_smithso the remaining functional code can get a map / json as input and you can verify it has the right output
16:14grimmulfrThing is, the projects I usually work on involve a server that I don't have access to (actual access, to run ring and whatnot) so I don't really know how to grasp the whole full clojure backend thing
16:14grimmulfrI guess I could handle all the routing and whatnot, and use a clojure library for mysql (if that's even possible /me = new )
16:16justin_smithgrimmulfr: yeah, clojure.java.jdbc works nicely with mysql
16:16grimmulfrThere's so many things that do similar stuff, my head is spinning. I just need to find a working list of items that have good sinergy
16:16mercwithamouthheh...extremely overwhelmed even trying to begin dealing with authentication with liberator and friend =(
16:16grimmulfrsynergy even :D
16:17grimmulfrI have my own PHP coder that cand handle the backend when the time comes so that's really not a problem.
16:17grimmulfrI mostly do frontend stuff anyway nowadays. and usually flash, but I plan on slowly switching to html5/6
16:17justin_smithmercwithamouth: I think I almost have friend figured out, but it was definitely not intuitive for me at least, so don't feel bad about that
16:17grimmulfrSo tired of flash, god damn it
16:20grimmulfrIs there a nice and widely accepted as "good/the best" templating (or general frontend ui stuff) library?
16:20grimmulfrif for example I want to build my content from the ground up
16:20grimmulfrAlso, compojure seems to be the most used routing lib, would that be accurate?
16:21justin_smithgrimmulfr: folks here will try to help I am sure, but for frontend (clojurescript) stuff, be sure to ask on #clojurescript
16:21justin_smithgrimmulfr: yes, but it is a backend routing lib
16:21grimmulfrOh, sorry, didn't know that existed :)
16:22justin_smithgrimmulfr: np, it is all clojure, but this channel has a strong jvm-clojure bias I think
16:23grimmulfrNot to say that I won't ever do backend too. I kind of like the speed clojure provides when working with lists, and I work with a ton of those (I work in advertising, and we have a ton of campaigns involving codes, ids, saved data etc)
16:26justin_smithgrimmulfr: I am also in an agency shop, but really I think clojure's immutable / data-centric approach is almost always a win (with a few possible exceptions for when you need the absolute best possible cache line and memory performance, where you wouldn't be using PHP or the like anyway)
16:32grimmulfrPlus, clojure source is freakin sweet
16:32grimmulfraesthetic-wise :)
16:33jamesnvcif I want to compile clojurescript at runtime via cljs.closure/build, is there something special I need to do to make :require work?
16:34jamesnvcJust generating js is working okay, but If I try to require om, I get a bunch of errors about undeclared vars and an exception when I try to load the page
16:35nullptrjamesnvc: just a guess, but are you providing an extern for react (or react itself)?
16:35jamesnvcyup
16:35jamesnvcdoing the :preamble [“react/react.min.js”] and the :externs
16:35TimMcAt work we have some Clojure libraries that we'd like to expose to Java consumers but also keep easily available to Clojure callers. Is this a reasonable solution?
16:36TimMcExport example: https://github.com/timmc/lib-3844/blob/cbe53bab9/src/lib_3844/api.clj#L58
16:36TimMcHow it would look as an API: https://github.com/timmc/lib-3844/blob/cbe53bab9/src/lib_3844/core.clj
16:37devnI have a go loop which is doing blocking takes from a port. I know i need alts!! or alt! or alts! here, but I'm having trouble setting it up right. I basically want to wait a few seconds, and if (<!! my-port) is still blocking and waiting, i want to System/exit 0
16:38lvhhi
16:38lvhhow do I read some bytes from the OS' CSPRNG?
16:38devn(go-loop [v (<!! port)] ...)
16:38lvh(Does Java's SecureRandom do that by default if it can?)
16:40TerranceWarriorHow does one do 3d Graphics in Clojure or ClojureScript?
16:41l1xis there any serious performance difference between a () and a []?
16:41devnl1x: depends on what you're doing, but yes, there can be
16:41l1xi am storing a bunch of small hashes in it for further processing, size is 1000 elements max
16:42l1xok i guess i need to benchmark it
16:42justin_smithl1x: use [] if you need lookup by index or addition at the end, () if you need addition at the front
16:42devnl1x: adding to the front vs adding to the end
16:42l1xi see
16:42devnwhat justin said
16:42devn,(conj '() 1)
16:42clojurebot(1)
16:42devn,(conj '(1 2) 1)
16:42clojurebot(1 1 2)
16:42devn,(conj [1 2] 1)
16:42clojurebot[1 2 1]
16:43l1xyep, thank you guys, much appreciated
16:43devnnp
16:43justin_smithalso () can be lazy, [] cannot
16:44dbaschlvh: yes, use SecureRandom
16:44amalloylvh: i don't think you care about reading from any particular cryptographically secure RNG, just about getting some secure bytes
16:44amalloyand that's what SecureRandom is for
16:44jamesnvcAre there any severe gotchas around calling cljs.closure/build at run time?
16:45jamesnvcBecause it is starting to seem to me that either I’m insane, missing something big, or computers hate me
16:47lvhamalloy: That's true, but I trust the OS's CSPRNG a lot more than I trust a userspace one.
16:48lvhdbasch: Is that "yes, SecureRandom is just something that secretly reads from /dev/urandom on *NIX and calls CryptGenRandom on Windows"?
16:48dbaschlvh: not sure about Windows, but that’s what it does on Unix
16:50lvhGotcha.
16:51dbaschlvh: yes, it uses CryptGenRandom on windows
16:51lvhI was thinking of the issues with Android's SystemRandom, but apparently that's only Android
16:52lvhAnd, IIUC, on Android today it still means "OpenSSL CSPRNG output"
16:57ucbam I right to think that if I want a namespace with hypens in its name, e.g. root.my-ns, then the file must be named with underscore, i.e. my_ns.clj?
16:57arrdemucb: correct.
16:57ucboh, urgh
16:57arrdemucb: if you use dashes in the filename, the clojure compiler can't find it.
16:57ucbI think I came across a Java thing then
16:57ucbyes
16:58ucbso I can require root.my-ns
16:58ucbbut if I want to reference a record in there, I have to do so like root.my_ns.Record :/
16:58arrdemaren't implementation details a gem!
16:58ucbgorgeous!
16:58arrdemI'd actually open a ticket over that... just because it isn't the "obvious" behavior.
16:59arrdemBronsa: ^^ thoughts?
16:59ucbarrdem: https://gist.github.com/11383711
16:59technomancythere's a ticket for it already
16:59arrdemtechnomancy: oh good.
16:59ucbah, cool
16:59ucbI was puzzling over this for a good ... 2h now.
16:59arrdemucb: that really means you log in and vote for the existing ticket then :P
16:59Bronsaarrdem: it's one of the most voted ticket too.
16:59technomancyit's tragic how much time it wastes
16:59ucbarrdem: log in? how? where?
16:59technomancyusability woooo
16:59ucbheh
17:00arrdemucb: dev.clojure.org jira lemme find it...
17:00technomancyhttp://dev.clojure.org/jira/browse/CLJ-1297
17:00arrdem(inc technomancy)
17:00lazybot⇒ 107
17:01arrdemoh good I already voted that one up.
17:01technomancybasically crickets from anyone who actually has the power to do anything though
17:01technomancyas usual
17:01justin_smithyogthos|away: I pushed the updated unit tests for the rss:atom pr, I guess I need to update the pr too
17:02ucbhrm
17:02ucbbut that issue isn't quite what I have on my hands now
17:02ucbI knew about the - _ duo
17:02ucbmy beef is with not being able to talk about root.my-ns.Record
17:02justin_smithyogthos|away: oh, never mind, I guess github tracks against the head of the branch I issue the pr on, so it is updated automatically, never mind the noise
17:02ucbbut rather having to talk about root.my_ns.Record
17:03ucbbecause Java (I assume)
17:20devnAnyone mind taking a peak at this? https://gist.github.com/devn/72d8d9ad414ef448ced3 -- core.async stuff.
17:21devnI could use some help. `lein run` will just sit there. I need a way to exit once I know all the work has been completed.
17:22justin_smithdevn: I think shutdown-agents is required along with the System/exit
17:22justin_smith(doc shutdown-agents)
17:22clojurebot"([]); Initiates a shutdown of the thread pools that back the agent system. Running actions will complete, but no new actions will be accepted"
17:22devnI'm not seeing it print "STOP!"
17:23justin_smithoh, that's odd
17:23technomancyhttps://github.com/fredericksgary/system-slash-exit
17:23justin_smithdevn: are you running from a terminal or via nrepl/cider/whathaveyou?
17:23devnterm
17:23justin_smithdevn: if the latter, you may need to check the process output buffer because threads
17:23devni think there's something wrong with my core.async stuff
17:23justin_smithoh
17:24justin_smithtechnomancy: surprised that doesn't also wrap shutdown-agents actually
17:24technomancygfredericks: ^^
17:25justin_smithalso, congrats, I think that is the smallest actual clojure lib I have ever seen
17:26justin_smithtempted to submit code-golf prs to that repo, given how small it is already :)
17:26devnjustin_smith: yeah, it's the async stuff. if i add a (println [v c]) i see that it will return :continue :default forever
17:26devnhmmm
17:28amalloygfredericks: https://github.com/fredericksgary/system-slash-exit/blob/master/src/com/gfredericks/system_slash_exit.clj#L4-L5 - i don't see many people restricting themselves to 70-column lines
17:32stompyjHow has core.typed been received?
17:33devnpretty well i'd say
17:33devnconsidering it was well-funded on kickstarter, has some serious users
17:34devnpulsar being one of the more substantial i've seen lately
17:34TerranceWarriordo you people generally distribute .jnlp s ?
17:34devn"you people
17:34devn"
17:35justin_smithTerranceWarrior: never touched it
17:36TerranceWarriorif you install icedtea-netx , it will autorun java from within a browser.
17:36TEttingerTerranceWarrior: uberjars are pretty common I think
17:36stompyjdevn: is pulsar a lib? or a company?
17:37stompyjI donated to it, then promptly forgot it existed
17:37stompyjand am wondering if it wouldn’t help me right now
17:38devnstompyj: they are a YCombinator company
17:38devnand yes it is a lib
17:38devnstompyj: https://github.com/puniverse/pulsar
17:38devnit wraps quasar
17:38devnstompyj: i didn't get too far with it last friday, but it is certainly cool
17:39TerranceWarriorTEttinger: right
17:39stompyjdevn: thanks!
17:47mmitchellanyone here use bidi, the routing lib?
17:47amalloysuppose i have a list like '(a b c), and i want to repeat its items five times to get a single list of 15 elements. is there a better way than (apply concat (repeat 5 xs))? that apply concat feels unpleasant
17:48amalloyi suppose i could also write `(~@xs ~@xs ~@xs ~@xs ~@xs). yikes
17:48justin_smithdunno, (mapcat identity (repeat 5 xs))
17:48justin_smiththat's not really any better
17:48amalloyi guess i was just hoping there's a repeat-cat in core that i don't know about
17:48TEttinger(doc cycle)
17:48clojurebot"([coll]); Returns a lazy (infinite!) sequence of repetitions of the items in coll."
17:49amalloyno, i don't much care for mapcat identity/seq
17:49justin_smith(take 15 (cycle xs))
17:49justin_smith(inc TEttinger)
17:49lazybot⇒ 17
17:49justin_smithbeat me to it
17:49TEttinger,(take 15 (cycle '(a b c)))
17:49clojurebot(a b c a b ...)
17:49TEttingerhooray
17:49amalloyyeah, i did consider cycle. but then i have to know how many items are in xs and do multiplication
17:49Bronsajustin_smith: TEttinger that's assuming your list has a known length
17:50justin_smithoh, yeah
17:50mikerodI heard in a talk/read somewhere an explanation of the -> vs the ->> macros in clj. The explanation described how they are typically for different "modes" of sequence operations. What is this that I'm trying to remember?
17:50Bronsalooks like it would be trivial to add a 2-arity version of cycle though
17:51amalloyi actually need some other stuff in between, so `(~@xs ~@xs ~@xs ~foo ~@xs) is not looking so bad
17:51TEttingerone supplies an arg to the first position in an arglist, one supplies an arg to the last position, mikerod
17:51justin_smithBronsa: yeah, that would be nice, following in the example of repeat and partition for example
17:52TEttingermikerod, I guess the talk is probably about argument order in clojure and how the API is arranged?
17:52mikerodTEttinger: yes, I'm more trying to recall this good way of explaining the difference. I understand where threaded items are placed. thanks though
17:52mikerodTEttinger: I can't remember :( I was just explaining the thread macros to someone and wished I could remember what I heard on that topic. I was just wondering if it was something obvious that someone would immediate recognize.l
17:52justin_smithmikerod: often the last arg will be a sequential argument, while the first arg will be an associative one
17:53amalloymikerod: functions that deal with sequences should be arranged to make ->> convenient, while those which work with other stuff should make -> convenient
17:53amalloyjustin_smith: not just associative, but also atoms, refs, and so on
17:53justin_smithahh, yeah, pretty much all the non-sequential stuff :)
17:54mikerodHmm, ok. That sounds like a pretty reasonable way to put it.
17:54justin_smithI was thinking of how often a map or ref would be the first arg
17:54justin_smiths/ref/record
18:12Bronsajustin_smith: amalloy http://dev.clojure.org/jira/browse/CLJ-1412
18:12justin_smithvery nice!
18:14technomancyBronsa: does that have the optional argument first?
18:15justin_smithhttp://dev.clojure.org/jira/secure/attachment/12965/0001-Add-2-arity-version-of-cycle-that-takes-the-number-o.patch yup, like the other optional count args
18:15Bronsatechnomancy: yes, like repeat/repeatedly & friends
18:15technomancyhuh; I thought that was an anti-pattern
18:16technomancybut I guess there's precedent
18:16amalloytechnomancy: seems pretty normal for functions which take sequences (which, as recently discussed, take those sequences last)
18:18amalloyactually, IIRC you're in favor of a multi-arity filter, right? (filter xs) => (filter identity xs)? same thing there
18:18technomancyamalloy: that is the main reason I haven't pushed harder on multi-arity filter, yeah =)
18:18technomancyI guess it's just a problem if you take var-args
18:18grimmulfrHmm, this might sound stupid but can ypu not use more than one :use in a source?
18:19Bronsaamalloy: that's also the same for reduce. (reduce f coll), (reduce f init coll)
18:19justin_smith:use can take multiple libs, so that is not an issue. Also seriously consider :require [foo.bar :as bar] ... instead of :use, it is better in the long run
18:19amalloyreduce is even weirder, because its optional arg comes in between the two required ones
18:20grimmulfrI want to have both jayq and hiccup in my file, but apparently I can't ":use" them both, and I'm just following their wikis :(
18:20justin_smithgrimmulfr: (:use [foo.bar] [baz.quuz]) it can all go in one :use block
18:20technomancyamalloy: weird behaviour there is easy to blame on CL
18:21Bronsaamalloy: right. my brain was thinking of "reduce f" as a singleton
18:21amalloytechnomancy: i'm not really interested in blaming anyone for it. it's the most natural order, i think
18:21hyPiRiontechnomancy: actually, CL is more sane there
18:21justin_smithgrimmulfr: but really even though the docs show :use, :require with :as is better
18:21grimmulfrI tried that and still no go. My line is: (:use [jayq.core :only [$ append delegate data]] [hiccup.core])
18:21grimmulfrI get clojure.lang.ExceptionInfo: Only [lib.ns :only (names)] specs supported in :use / :use-macros; offending spec: [hiccup.core] at line 1
18:21amalloywell, maybe that's not true, but nothing else is lots more natural, anyway
18:22hiredmanif anything, clojure's reduce arities come from haskell or ml, not cl
18:22technomancyhuh
18:22hyPiRion(reduce #'list '(1 2 3 4) :initial-value nil) and (reduce #'list '(1 2 3 4) :from-end t)
18:22amalloygrimmulfr: does hiccup exist in cljs?
18:23grimmulfrHmm...I'll just play the I'm new and have no idea card here
18:23technomancyhiredman: but the reducer function itself takes flipped args in ML iirc
18:23nullptrthere is sablono, but that's targeted towards om usage
18:23technomancyalways threw me off
18:23tieTYT2how does that quote go? 100 functions on 1 collection is better than 10 functions on 10 collections
18:23technomancyor maybe that was racket
18:23amalloyi guess it does. but the readme for hiccups (https://github.com/teropa/hiccups) doesn't include that ns form - it looks like you're trying to use the jvm version of hiccup on cljs, grimmulfr
18:24grimmulfrI used regular hiccup :(
18:24Frozenlockamalloy: https://github.com/ibdknox/crate
18:25hiredmanmy kingdom for a web browser that would show you anchors points even if the author of the thoughtless didn't include a link to them
18:25justin_smithsounds like an awesome userscript or chrome extension lib
18:26amalloyhiredman: amusingly, over the weekend i sent someone a pull request to add hrefs to the anchors they already generated
18:26Frozenlockhiredman: How would you do that, considering that IDs are used everywhere in js?
18:26tufthiredman: yeah, and how about one that gives you keyboard hints for everything that's clickable instead of just an annoying subset =)
18:26Frozenlock(not just for anchors)
18:26amalloyFrozenlock: <a name="...">, not everything with an id
18:26Frozenlockah right
18:27tufthiredman: need a webkit browser programmed in cljs
18:27justin_smithyeah, how many times have I found a heading I want to share in wikipedia, then had to navigate to the top of the article to find a link to it :(
18:27hiredmantechnomancy: http://caml.inria.fr/pub/docs/manual-ocaml/libref/List.html#6_Iterators
18:28technomancyhiredman: yeah, I was thinking of racket
18:28amalloyugh, the autogenerated signatures for foldr/foldl are confusing
18:28amalloythey swap the meaning of a and b, instead of swapping the argument order to your folder
18:28Bronsahiredman: there's https://addons.mozilla.org/en-us/firefox/addon/show-anchors-2/
18:29justin_smithamalloy: yeah, that's pretty dysfunctional
18:29hiredmanBronsa: jokes on you, I don't have a kingdom
18:29amalloy*chuckle*
18:29justin_smithhttps://chrome.google.com/webstore/detail/show-anchors/nhppnhnadikeniijclnghjfblnojgige?hl=en for chrome
18:30hiredmanamalloy: and fold_right takes the list and the init in a different order too
18:30BronsaI didn't want it anyway.
18:31amalloyhiredman: i'm choosing to ignore the gross signatures in ocaml, and instead focus on the mildly-confusing ones from haskell
18:32hiredman"here, have three half built castles" "wait, but is only half built!" "well, you know, I was sling morter one day and realized the morter was drying to faster which would compromise the wall, so I started play with mud, and well time makes fools of us all..."
18:33arrdem(inc hiredman)
18:33lazybot⇒ 45
18:40nDuffHmm. I'm having an issue w/ code generated by cljs.core.async's go macro complaining about a (recur) at the end of a try block but for a catch; the try block is the last item in the enclosing (loop). Is there a relevant behavioral difference here? I don't have comparable problems on the JVM.
18:46BronsanDuff: youy mean (loop [] (try (catch Exception _ (recur)))) ?
18:47nDuff@Bronsa, rather, (loop [] (try (recur) (catch Exception _ (do nil))))
18:47nDuffjs/Error rather than exception, but...
18:47BronsanDuff: are you sure that works on the jvm? there should be no way to recur across try blocks
18:47coventryThat gives me a compile error in jvm clojure (outside a go block.)
18:48nDuffthat was rough draft rather than actual code; one moment...
18:51gfredericksamalloy: my apologies
18:51gfredericksjustin_smith: technomancy: why would wrapping shutdown-agents be useful?
18:52gfredericksit's already a var
18:52justin_smithgfredericks: just for convenience, because exiting and calling shutdown-agents often go together
18:52nDuffOkay -- that was a misconstructed example. The actual macro I've been using with clojure/jvm, with (loop [] ...) constructs within the body, is https://www.refheap.com/e59721cb94ebe17f094e7b582
18:52justin_smithgfredericks: I can see few situations where you would want to exit and not shut the agents down
18:54gfredericksjustin_smith: I would be happy to see somebody create a system-slash-exit-and-shutdown-agents lib
18:54arrdemthat'd be messy... you'd have to either track all the agents at init time or introspect the clojure core threadpool...
18:55justin_smithI'd probably call it ejector-seat
18:56justin_smitharrdem: I am just talking about calling the shutdown-agents function so the jvm can exit sooner
18:58arrdemjustin_smith: alternative names: bang-seat, loud-handle, martin-baker
18:58justin_smith!seat
18:58justin_smithlol
18:58coventrynDuff: If the loop compiles outside that context, sounds like a bug.
18:59arrdemdid you hear me say _BANG_seat?
18:59arrdem:P
18:59justin_smithyou don't pronounce ! as bang?
18:59arrdemwhy would I read _BANG_ as "bang"....
19:00johann__hey guys--i am trying to set up datomic on a heroku postgres instance. when i try to connect my transactor to it i am getting the error "sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"
19:01mdeboardjohann__: Wow.
19:01mdeboardjohann__: We had an issue with this error last week unrelated to clojure/heroku/datomic
19:01arrdemjustin_smith: trap is another potential term..
19:02johann__mdeboard: atleast i am not alone!
19:02mdeboardIt just means (i think) that Java's SSL library doesn't recognize the certificate authority of the SSL cert
19:02mdeboardjohann__: Out of curiosity, what key length was used to generate the cert? Do you know? 2048? 4096?
19:03mdeboardjohann__: Do you know who the CA is for your SSL cert?
19:03johann__mdeboard: not a clue.
19:05mdeboardtry connecting over http instead of https?
19:07johann__mdeboard: i'll give it a shot! thanks :)
19:12winkjohann__: OS X/Windows? ;) https://github.com/technomancy/leiningen/issues/619 https://github.com/technomancy/leiningen/issues/613
19:16johann__wink: woe to the endless labyrinth of technologies. i'm on osx
19:18justin_smitharrdem: SHUT DOWN FOR WHAT‽‽‽‽ (sorry)
19:18arrdemjustin_smith: I'll send you pics when we use that for a party...
19:18arrdemjustin_smith: thanks for the idea :D
19:20justin_smithheh
19:29kurtharrigerhey yo
19:29danielglauserkurtharriger: technomancy: Intro
19:29technomancyohai
19:32dbaschif you ever need to generate bitcoin addresses in clojure, it’s not pretty. https://www.refheap.com/82567
19:33Frozenlockdbasch: ugh
19:33mdeboarddbasch: What's the .. sigil?
19:33mdeboardkey-params?
19:33amalloy,(doc ..)
19:33clojurebot"([x form] [x form & more]); form => fieldName-symbol or (instanceMethodName-symbol args*) Expands into a member access (.) of the first member on the first argument, followed by the next member on the result, etc. For instance: (.. System (getProperties) (get \"os.name\")) expands to: (. (. System (getProperties)) (get \"os.name\")) but is easier to write, read, and understand."
19:33justin_smithmdeboard: chains methods
19:33clojurebotHuh?
19:34justin_smithmdeboard: lets you do the equiv of x.y.z.bar() in clojure
19:34mdeboardWow.
19:34mdeboardNow... that is a difficult operation to google.
19:34amalloyreally (.. foo x y z) is more nicely written as (-> foo .x .y .z) these days
19:34dbaschmdeboard: sigil?
19:34amalloy.. is a relic of the days before ->
19:35mdeboardamalloy: ah
19:35mdeboarddbasch: Oh, I guess I used the wrong word
19:35mdeboardI should've just said symbol
19:35dbaschgotcha
19:35dbaschamalloy: choose you flavor of ugly :)
19:36technomancykurtharriger: hey, can you identify with nickserv so I can pm you?
19:36amalloymdeboard: well, sigil was reasonable, since not every funny squiggle in .clj code is actually a symbol
19:36amalloyeg, ~@
19:36mdeboarddbasch: Oh man I think the threading semantics are just gorgeous
19:37dbaschI guess creating bitcoin key/address pairs is ugly in every language
19:37mdeboardI don't think that's particularly ugly
19:37kenrestivoi've not seen a language in which crypto was not ugly
19:38mdeboardThough putting the mutations in the let block strike me as kinda weird
19:38mdeboardbut as good as any
19:38mdeboards/weird/unfamiliar
19:39eraserhd_Time to code some more on my weird, heavy threading macro.
19:53mdeboardAre there any battle-tested authentication & authorization bits for Compojure out there? I saw cemerick's Friend repo but it's still pretty early on that one.
19:55dbaschmdeboard: that’s as battle-tested as there is. I had to write my own password authentication based on scrypt for an app.
19:55mdeboardWow that's surprising
19:56mdeboardI mean I'm wondering what Prismatic uses
19:56dbaschmdeboard: indeed. I’ve been thinking about how to create a user/password store that’s modular / abstract enough to share
19:57dbaschmine uses scrypt and postgres
19:57dbaschand specific details about users that not everyone will care about
19:57mdeboardWell, I think table stakes there is user/pass + openid/oauth/etc. support
19:57justin_smithdbasch: if you want aes128 and persistance of an arbitrary clojure form (likely a map) on disk, there is my cryptlj lib
19:57justin_smithhttps://github.com/noisesmith/cryptlj
19:57mdeboardor rather, account management + sso support
19:58dbaschmdeboard: friend is good enough if you want openid
19:59dbaschjustin_smith: that looks useful for a different use case, but probably not what I need for passwords
19:59dbaschpasswords are not really encrypted, just one-way hashed
19:59justin_smithmy use case was: you want credentials at runtime, and not everyone who has access to the repo should have access to those credentials
20:00justin_smithdbasch: OK, friend has bcrypting of passwords built in
20:00justin_smithor you could directly use whatever bcrypt lib
20:00justin_smithI think that is pretty much the state of the art (last I checked)
20:00dbaschjustin_smith: yes, it does bcrypt but you have to provide the store
20:01dbaschit assumes you have a db somewhere to check against
20:01justin_smithwell it can be any lookup function you desire
20:01justin_smithbut a db is the most common case
20:01dbaschnot to mention that (to my knowledge) nobody has implemented things like change-password, reset-password, create-user, etc
20:02justin_smiththat is just some set of functions on the store (which friend is rightly agnostic to)
20:02dbaschjustin_smith: of course, but there should be a user management component somewhere
20:02dbaschjustin_smith: definitely outside of friend
20:03justin_smithdbasch: the downside to clojure's opinionated dislike of frameworks I think (it is a space where two featuresets (persistence and auth) intersect, so you must connect dots)
20:03justin_smiththat said, I think avoiding frameworks is the right thing (despite being a maintainer of a framework)
20:04dbaschjustin_smith: I tend to agree with that opinionated dislike
20:04technomancyjustin_smith: I dunno, I think friend being complicated goes beyond just disliking frameworks
20:04justin_smithtechnomancy: here I thought I had it all figured out :) what other problems do you see?
20:04dbaschjustin_smith: that’s why I don’t know how to implement a user management layer that’s modular / abstract enough to be useful
20:05technomancyjustin_smith: I remember staring at the readme blankly and deciding to do something else a couple times.
20:05technomancymaybe it's gotten better
20:05justin_smithdbasch: kind of like a last-mile problem
20:05dbaschjustin_smith: yes, and one that pretty much everyone has
20:06justin_smithtechnomancy: sounds like my experience too - but based on my attempts to use it, I think this has to do with the preference for libs that do one thing in clojure, and how that conflicts with the existential / sweeping demands of security
20:06dbascheveryone needs to create and maintain user stores at some point
20:07technomancyjustin_smith: maybe. I haven't written a full-fledged user-handling web app, so my needs have been simpler, but I think you could do better on the usability front without sacrificing orthogonality.
20:07dbaschand that includes reallly unpleasant tasks like email verification, forgotten passwords, enforcing password standards, etc
20:07justin_smithexcept the paridigmatic cowboy solitary genius programmer, he only writes single user programs that solve all his problems and he doesn't need our help
20:08justin_smithtechnomancy: yeah, but to be honest I don't know how - it's a tricky space
20:09dbaschjustin_smith: indeed, and it’s also kind of a full-stack problem
20:10justin_smithand full stack problems in a modular space are DWIM complete :)
20:10dbaschespecially when you bring 2FA into the mix
20:13danielszmulewiczHi, anybody knows how to do entity expansion in OM/sablono? Given a string "It&#39;s one of kind.", how do I render the apostrophe?
20:17justinholguinDoes anyone here use emacs/evil for Clojure development?
20:18justinholguinI mean emacs _and_ evil
20:19Jaood,anyone
20:19clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: anyone in this context, compiling:(NO_SOURCE_PATH:0:0)>
20:19TEttinger~anyone
20:19clojurebotanyone is anybody
20:19TEttinger~anyone
20:19clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
20:20justinholguinJust looking for some general pointers or advice on using CIDER with evil, I guess.
20:20mdeboard20:02 <justin_smith> technomancy: sounds like my experience too - but based on my attempts to use it, I think this has to do with the preference for libs that do one thing in clojure, and how that conflicts with the existential / sweeping demands of security
20:21mdeboardNailed it
20:21mdeboard,(inc justin_smith) ;; hope I did this right
20:21clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: justin_smith in this context, compiling:(NO_SOURCE_PATH:0:0)>
20:21mdeboarddammit
20:21metellus(inc justin_smith)
20:21lazybot⇒ 36
20:21clojurebotIt's greek to me.
20:21mdeboard(inc justin_smith)
20:21lazybot⇒ 37
20:21mdeboardcool
20:21pdk,pdk
20:21clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: pdk in this context, compiling:(NO_SOURCE_PATH:0:0)>
20:21pdkweak
20:23mdeboardjustinholguin: What is it about that combo that makes it worth the hassle?
20:23mdeboardevil + cider, I mean
20:25justin_smithmdeboard: if you'd rather be using vim but fireplace is not good enough
20:25justinholguinmdeboard: Fair question, but right now I'm sort of trying to figure out what makes emacs/cider so great in the first place. I don't really want to give up the speed of vim.
20:25mdeboardoh
20:25justinholguinWhat my co-Justin said
20:25mdeboardYeah I feel your pain, but in reverse
20:25justin_smithheh
20:26justinholguinIn reverse how?
20:26mdeboardelixir-mode for emacs is broken, but the vim plugin for elixir works great
20:26justinholguinAhh
20:26mdeboardso when I want to write elixir, I have to use vim
20:26mdeboardand it feels like a fish riding a bicycle
20:26justinholguinBut you want some sort of... emacs mode?
20:26justinholguinhaha
20:26mdeboardnaw
20:26justin_smithone of the outdated vi-emulation modes (name escapes me) was my gateway drug to emacs
20:26mdeboardJust saying I understand if you're muhc more proficient with vim why you'd be looking for an integration
20:26justinholguinA wise man once said, there's rarely a problem that can't be solved by rubbing a little elisp on it.
20:26justin_smithoh yeah, ViPer
20:28justinholguinJumping straight into the evil/cider combo was a mess. Too many shortcuts clashing, I guess. I was hoping to get some idea of how other people reconcile the two.
20:28mdeboardfwiw I tried evil because I do like a lot of things about vim (also because I use it a non-trivial amount), but it just didn't go well for me
20:28ambrosebsvim fireplace is just fine for me.
20:28mdeboardjustinholguin: Is there something wrong with fireplace? I've heard it's really good
20:29ambrosebsIt's not emacs.
20:29ambrosebsso it sucks apparently.
20:29mdeboardnow now
20:29mdeboardI'm sure no one still thinks that
20:30mdeboardWell, no one who'd use Clojure
20:30justinholguinFireplace isn't terrible by any means (praise tpope), but the grass still looks a lot greener on the cider side of things.
20:30justinholguinAlso elisp>vimL
20:30mdeboardby speed did you just mean your vim muscle memory?
20:30mdeboardor editor runtime
20:30justinholguinMore muscle memory, I can cope with the start time
20:30mdeboardYeah
20:31mdeboardIt's rough. But gotta use the best tool for the job
20:31mdeboardThat said I don't write much elixir because it's tiring thinking about struggling with vim for an hour before I can get in the groove
20:31justinholguinI find that a lot of the vim commands I use a lot don't have any equivalent in emacs (outside of evil)
20:31mdeboardlike what
20:32nullptrdanielszmulewicz: i don't see any clean way to do it, but you can use goog.string.unescapeEntities as a workaround
20:32justinholguinNumber 1 would be most things involving a motion, like dt; (delete upto the next ;) or something
20:33danlamannajustinholguin: zap-to-char?
20:33mdeboardI'm sure there's an equivalent for that
20:33technomancylearning the expression-based movement commands helps a lot
20:33justinholguinThere are equivalents for all of them... in evil
20:33mdeboardI mean when it comes to just straight-up text editing I can't imagine the two aren't extremely close in features/capabilities
20:34technomancyforward-sexp, etc
20:34technomancyparedit helps more
20:34mdeboardparedit drives me nuts
20:35justinholguinYeah, I'm sure that emacs will end up being able to do everything I want, but it seems like the most parsimonious way to do that probably starts with evil
20:35technomancymdeboard: paredit will be there for you when you change your mind
20:35justinholguinI love paredit
20:35mdeboardtechnomancy: It's just that it makes me change how I do certain things, and I have never taken the time to acclimate
20:36justin_smithI have found that any friction between my habits and paredit are flaws in my habits :)
20:36technomancytruth
20:39danielszmulewiczSo it's `unescapeEntities` in google's Closure library.
20:40amalloyfrom what i hear, vim's text-objects are pretty cool and useful, and we emacsers just don't get it. i mean, we can do most things anyway, via special-cased functions like forward-sexp, but it's a little condescending to say "dude paredit does everything" unless you really know what vim stuff mdeboard misses
20:45justin_smithlein question: is there a convenient way to run a one-off piece of code from the command line? the client has been using their own servers (including db), but I need to write code that fixes something on their end (as a one-off bit of clojure code that would fix up the db issues)
20:45technomancyamalloy: sure, iiuc the main difference is that emacs mashes together "forward" and "sexp" as a hard-coded defun while vim composes them gracefully.
20:45technomancyjustin_smith: lein run -m clojure.main -e "(stuff)"
20:45mdeboardtbh I don't use forward-sexp etc. in emacs, just C-<Space> set-mark-command (kinda like visual mode in vim)
20:45justinholguinjustin_smith try the lein-exec plugin
20:45justin_smithtechnomancy: great, thanks, I'll just shove that in a shell script and have them run it
20:45technomancyamalloy: I wouldn't say paredit is better than text objects, just that emacs without paredit kinda sucks
20:46amalloymdeboard: i take back everything good i ever said, you're a heathen
20:46mdeboardlol
20:46mdeboardOh wait, yeah I do, I just didn't know the keybind I was using was called that
20:47technomancymay the ~guards have mercy on your soul
20:47amalloyi was gonna say, set-mark-command is terrible for general navigation
20:47justin_smithlazybot: fortune
20:47lazybotaddfortune everywhere is within walking distance if you have the time
20:47justin_smithamalloy: it's great if you want to have a stack of locations in buffers kind of like pushd/popd in the shell
20:48mdeboardI use all the search varieties way more than navigatin
20:48technomancyamalloy: depends how you define "general". it's really useful in a lot of situations.
20:48amalloyi can't figure out how to maintain such a stack. i just use it as "what was i doing a minute ago? C-u C-SPC. no, not that...C-SPC, C-SPC...oh right, there i was"
20:48justin_smithhttps://www.gnu.org/software/emacs/manual/html_node/emacs/Mark-Ring.html
20:49justin_smithamalloy: ^^
20:49justin_smithyou are doing it already, looks like :P
20:49amalloyyes, yes, i know about the mark ring. just using it effectively is hard
20:49amalloyi rarely/never set mark myself on purpose
20:49amalloyjust as a side effect of selecting text or using navigation commands
20:50nullptrusually in cases where you want an explicit "mark" it's better to set a point register
20:50nullptr"C-x r SPC runs the command point-to-register"
20:50nullptr"C-x r j runs the command jump-to-register"
20:52turbofailoh hm. i didn't know #(.foo ^TypeWad %) actually worked until just now
20:52turbofaili seem to recall it not working in the past
20:53mdeboardamalloy: I'm not even sure why I said C-<Space>, the only time I ever use it is to copy paste or bulk delete
20:53mdeboardI guess I just wanted to fit in.
20:58justin_smithmdeboard: if you are selecting a form for pasting, try M-h
20:58justin_smith(for copying then pasting, of course)
20:58mdeboardThat too, but not usually selecting the whole deal
20:58mdeboardBut I also use M-x gist-region a *lot*
20:58justin_smithI use refheap-paste-region
20:59amalloyjustin_smith: M-h? blech. i don't select whole defns nearly as often as i select subforms
20:59mdeboardAlso I use emacs for a lot more than just clojure
21:01technomancyamalloy: spend some time doing forth, then you'll get better at stacks =)
21:04mdeboardIs that the programmer equivalent of "Go lift some weights then come talk to me"
21:04justin_smithbro do u evn lambda-lift?
21:05technomancyhaha, probably
21:09justin_smithof course that already existed http://cdn.memegenerator.net/instances/500x/33992180.jpg
21:10mdeboardha
22:09yedianyone have exp with chord or sente?
22:09yeditryna decide which to use for an upcoming project
22:59justin_smithhow best to discover image files that are corrupted or invalid from clojure? attempt to make a BufferedImage and return false from a try / catch?
23:54Jaoodclojure is hard ;)
23:54arrdemclojure is different, and largely pure
23:54arrdemtransients are not something you should try and learn until you need them.
23:55Jaoodgood!
23:55cbpjust maps and functions all the way baby
23:56Jaoodcan you take out macros, datatypes, protocols and multimethods too? ;)
23:56eggheadJaood: those are super userful, but also not necessary to write decent clj apps
23:57arrdemprotocols and multimethods are worth learning, defrecord/deftype are sorta worth it and macros are usually not the right tool for the job.
23:57eggheadnever use a macro where you could have used a function
23:58arrdemgood multimethod example, https://github.com/clojure/algo.generic + https://github.com/arrdem/meajure
23:58arrdemno I'm not biased at all :P
23:58arrdemhigherarchies are a weird language artifact that's largely disused. ignore it at your discression.
23:59cbpheh
23:59JaoodI would though macros would be the more useful of the four, to decrease redundacy
23:59cbpI wanna see an example of hierarchies use
23:59arrdemcbp: I would too :P