#clojure logs

2012-08-14

00:00TimMcIt's not wholly surprising given Erlang's origin as a telecom switch scripting language...
00:00cemerickTrue enough.
00:00FrozenlockWhat is "deps.js"? My console is complaining about this file.
00:01amalloydjanatyn: the general idea is to take the input list and, for each item in it: remove that item from the list, and cons it to the front of (permutations the-list-without-x)
00:02nkoza2there is something like clojure.inspector/inspect but that refreshes the display when the Var changes?
00:03amalloyrather, to each list returned by (permutations the-list-without-x)
00:03xeqiFrozenlock: https://github.com/emezeske/lein-cljsbuild/blob/master/example-projects/simple/src-clj/example/views.clj#L8
00:03muhooapparently nrepl-piggieback for cljs requires git master of leiningen. i tried to run it and it i got this: https://www.refheap.com/paste/4329
00:03muhoowhat's the secret to running the git master version of lein, but from a project dir (not from the lein dir itself)?
00:04RaynesPeople just really like cljs, given the hell people go through to use it.
00:04Raynes:p
00:04djanatynamalloy: my bad, I forgot to change some names >_>
00:04amalloyi figured
00:04Frozenlockxeqi: so it won't affect me?
00:05cemerickmuhoo: have you `lein install`ed from within leiningen-core?
00:06cemericki.e. https://github.com/technomancy/leiningen#building
00:06xeqiFrozenlock: its not fatal, I usually just put the (javascript-tag ...)
00:06cemerickRaynes: The promise of it is…promising. :-P
00:07Frozenlockxeqi: thanks
00:11amalloydjanatyn: if you don't mind a spoiler, a solution is at https://gist.github.com/3346186
00:12djanatynthanks. I'll keep working on it for a bit more :)
00:13amalloyand of course if you don't worry about duplicates, the whole remove-once nonsense can be replaced with (remove #{x} coll)
00:14djanatynwhat is #{}?
00:15TimMc&(class #{1 2 3})
00:15lazybot⇒ clojure.lang.PersistentHashSet
00:16TimMcdjanatyn: It's reader syntax for a set.
00:59ideally_worldif there a good mode for core.logic?
00:59ideally_worlds/if/is
00:59clojurebotHuh?
01:01ideally_worldworking my way through https://github.com/clojure/core.logic/wiki/A-Core.logic-Primer and the clojure mode doesn't indent so well with the macros in logic???
01:01lazybotideally_world: How could that be wrong?
01:04JulioBarrosAnyone know how to get compojure / enlive templates to reload when I change the html file?
01:12brainproxyJulioBarros: there's the ring-refresh plugin
01:12brainproxyerr.. let me check the name
01:13brainproxyJulioBarros: yep, ring-refresh
01:13JulioBarrosThanks. I'll take a look. Does that do the templates too? Or just the classes? Found a post that says a workaround is (use 'my.lib :reload)
01:14brainproxywhen I change the .clj files in src, the browser refreshes
01:14JulioBarrosSweet. Thanks.
01:14clojurebotthanks for your suggestion, but as usual it is gender
01:14brainproxyI also have `:auto-refresh? true` in the `:ring {...}` map in my project.clj
01:15lynaghkping: dnolen
01:15brainproxycan't remember if that's strictly required... been awhile since I put together the settings I've been using across a few projects
01:16brainproxyJulioBarros: one thing to note.. depending on what kind of exceptions get thrown as you're dev'ing and breaking stuff, you may need to bounce the process every once in awhile
01:17brainproxythat's been my experience anyway
01:17JulioBarrosbrainproxy: thanks, i've found that. Especially when i create and then rename methods.
01:17JulioBarrosBut now I'm just trying to create some basic pages.
01:19brainproxyone cool thing.. in addition to watching files in src/ it also watches files in resources/
01:19brainproxyso if you're using lein-cljsbuild and have it auto-rebuilding into some subdir of resources/
01:19brainproxythen you'll get refreshes when you update the client-side stuff also
01:20JulioBarrosbrainproxy: hmm ... weird. Installed it and see it refresh the browser but don't see the changes.
03:06wingyif i pass an object to a function and the function only alters this object but do not return anything .. is this function still side effect free?
03:06wingyit used the data passed in only but it didn't return anything
03:07wingyis it a pure function?
03:07mkno, because it has altered the object
03:08wingyoh yeah
03:08wingynow i recall what it means .. no outside world alterations
03:09Rayneswingy: What you described is the definition of a non-pure function.
03:09mkRaynes: would you call that a function? Perhaps method?
03:10Raynesmk: It's still a function.
03:10RaynesIn Clojure anyways.
03:13mkwingy: you might think of a function as only giving answers, and "non-pure functions" or methods as things that hammer away at whatever you gave them, or at the program state in general
03:13wingyright
03:13wingygood metaphor
03:13wingye
03:13wingy-e
03:14Fossinope
03:14Fossinot enough cars :>
03:19mkwingy: usually you want to avoid working with objects that even have a chance of being modified. If you find yourself wanting to modify an object, you might ask in here if there's a better way to do something (there's almost always a more elegant way)
03:21wingyyeah
03:23mkFossi: a clojure function is like a car cus... it runs? :P
03:23Fossi:D
03:34clojure-newcomerhey guys, I'm using remotes in Noir, and want to use the result from a call outside of the fm/letrem form, any ideas how I can do this ?
03:34clojure-newcomerwhen I log the response as I expected its a callback function
03:34ro_stpubsub
03:34azkeszHi, how would one go about loading clojure code from a file atomically:such that if any "compiler" errors then the loading would have no effect on the existing clojure code(in the running repl) ?
03:35ro_stclojure-newcomer: https://github.com/robert-stuttaford/demo-enfocus-pubsub-remote/
03:36azkeszfor example if I type 2 lines in repl and the second one errs, the first line still had effect
03:37ro_stclojure-newcomer: https://github.com/robert-stuttaford/demo-enfocus-pubsub-remote/blob/master/src-cljs/depr/remotes.cljs, more specifically
03:37clojure-newcomerro_st: just looking through code now
03:37clojure-newcomerro_st: ahhh, thats what I was gonna ask you next :-)
03:37clojure-newcomerjust looking now
03:38azkeszlooks like encapsulating them inside a dosync block would do the trick
03:38ro_sti put that out yesterday. it isn't working quite yet. will spend more time on it today. but that's what you'd do, pretty much
03:39azkeszactually, encapsulating the lines into one block (by just parens) would do the trick :D
03:39clojure-newcomerro_st: are you just leveraging noir fetch for remotes ?
03:40ro_stno, shoreleave-remotes, which is the same, but with csrf protection built in
03:41ro_styou don't need to use that, though, if you don't want to. the pubsub works independently
03:42clojure-newcomerro_st: I think it will break me if I switch frameworks right now :-) though this looks interesting, and from the sounds of it more secure
03:42ro_stwhat are you using?
03:42ro_stfetch, and what else?
03:42clojure-newcomerro_st: how do you solve the problem of accessing your callbacks outside of any local forms etc ?
03:42clojure-newcomerro_st: fetch and cljs-binding
03:43ro_styou mean accessing the data that the remote brings back?
03:43clojure-newcomerro_st: I want to bind the result of a callback to an element in an html page
03:43clojure-newcomerro_st: yes
03:45azkesz,*clojure-version*
03:45clojurebot{:interim true, :major 1, :minor 4, :incremental 0, :qualifier "master"}
03:45azkesz&*clojure-version*
03:45lazybot⇒ {:major 1, :minor 4, :incremental 0, :qualifier nil}
03:50clgvclojure-newcomer: I didnt understand your proplem with remotes in noir completely due to the lack of (minimal) example code - but I don't think you have to throw away noir ;)
03:52clojure-newcomerclgv: I'll post a little paste bin example if it helps
04:00clojure-newcomerno need to paste bin it, thanks ro_st
04:17clj_newb_298is there anyway to embed a browser in a clojure/java app?
04:17clj_newb_298by a browser, I'm refering to something like webkit
04:18ro_sti think the answer is yes. the question is, how :-)
04:21clj_newb_298ro_st: :-)
04:21clj_newb_298is $disease curable? yes. how? we're still working on it
04:22clj_newb_298i'm half tempted to use clojure + qt jambi + qt webkit
04:23AustinYunyou know, i kind of like the idea of prefixing vars with a char, but php just poisons everything
04:24ro_stno. noooooo. NO.
04:25ro_st*sedatives*
04:25clj_newb_298AustinYun: I acutally find that helpful too
04:25clj_newb_298to know whether it's something that is an argumen tinto the function
04:26clj_newb_298or a global function
04:26clj_newb_298I thikn the theory is that for the cost of 1 character
04:26magopianclj_newb_298: i find prefixing to be just evil and useless
04:26clj_newb_298I can locally know whether a var is a local or a global
04:26clj_newb_298w/o having to scan the entire function
04:26magopianif you need a prefix, maybe you need a better name for your var ;)
04:26Chousukeif scanning the entire function is too much work, it's too big :P
04:26AustinYunruby does it for instance/class vars
04:26magopianChousuke: +1 ;)
04:27ro_stmark-occurence highlighting
04:27ro_stboom
04:27clj_newb_298hmm; I'm going to pretend I won this argument, and go back to working on webkit inside of java
04:27AustinYunlol
04:27hoeckclj_newb_298: javafx has a WebView (webkit) component
04:27AustinYunthere was no argument!
04:27ChousukeAustinYun: those are more difficult to distinguish since they might come from who knows where
04:27ro_stit's not one character. it's one character per usage. it's that one character * the number of times you use local vars * the number of local vars in your program
04:28Chousukebut local variables don't appear from outside the file you're working in
04:28hoeckclj_newb_298: http://docs.oracle.com/javafx/2/api/javafx/scene/web/WebView.html
04:28ro_stanyway. solving problems is more important :-)
04:28AustinYuni have nothing important to contribute so i quibble over syntax
04:28ro_sthaha
04:29clj_newb_298hoeck: is webEngine a webkit instance or a javafx's own web viewer?
04:30Chousukesyntax is sort of important though. If clojure didn't have its lispy syntax goodness, it would be rather awkward to have syntactic abstraction :P
04:30Chousukesome languages do it, but it's just not very pretty
04:30clj_newb_298you don't need clojure's syntax
04:30clj_newb_298check out forth/factor
04:30hoeckclj_newb_298: its using webkit under the hood
04:30Chousukeforth is another language that does it okay.
04:30clj_newb_298it's like clojure, except instead of '(' ')' you have ' ' and ' '
04:30AustinYuncat!
04:31Chousukemostly because the syntax is simple enough.
04:31AustinYunhttp://www.cat-language.com/
04:31clj_newb_298dumbass question: is there a way I can lein install swt?
04:31clj_newb_298or do I have to install eclipse?
04:31hoeckhoeck: the api is roughly the same as the other webkit GUI components: loadDocument, executeScript, plus a way to invoke js and get js objects
04:32clj_newb_298hoeck: noted
04:32hoeckclj_newb_298: there is also a small clojure jfx lib to get started with jfx: https://bitbucket.org/splendid/jfx
04:33clj_newb_298hoeck: interesting; I didn't know javafx was this easy to use
04:33clj_newb_298i thought it was a mess since javafx always wnated to b emain thread
04:34hoeckclj_newb_298: there are some limitations when developing on the repl, like you have to restart if if you close the main jfx window
04:51CmdrDatsdoes anybody know of something that can give me a function level dependency graph for a namespace (or set of namespaces)? if that makes sense?
05:02clgvis there now a core function to access the last element of a vector efficiently or do I have to use count+nth, still?
05:03clgvnow = clojure 1.4.0 ;)
05:04the-kenny,(doc peek)
05:04clojurebot"([coll]); For a list or queue, same as first, for a vector, same as, but much more efficient than, last. If the collection is empty, returns nil."
05:09clgvoh right.
05:10clgvjust the word "peek" doesnt fit semantics here. gotta rename it
05:16AustinYunwhy is peek more efficient than last?
05:17clgvAustinYun: because last traverses the whole sequential that menas O(n)
05:17clgv*means
05:24nbeloglazov&(let [v (vec (range 100000))] (time (last v)))
05:24lazybot⇒ "Elapsed time: 266.224982 msecs" 99999
05:24nbeloglazov&(let [v (vec (range 100000))] (time (peek v)))
05:25lazybot⇒ "Elapsed time: 210.643355 msecs" 99999
05:25nbeloglazov&(let [v (vec (range 1000000))] (time (last v)))
05:25lazybot⇒ "Elapsed time: 275.935026 msecs" 999999
05:25nbeloglazov&(let [v (vec (range 1000000))] (time (peek v)))
05:25lazybot⇒ "Elapsed time: 232.886027 msecs" 999999
05:35Bahman_MourningIs it possible to start Jetty to serve only through SSL?
06:13clgvBahman_Mourning: if you are using ring: http://practice.kokonino.net/posts/ring-with-ssl-only
06:15Bahman_Mourningclgv: Excellent. Thanks.
06:16clgvBahman_Mourning: thats a hack but someone should certainly create something like an :ssl-only option.
06:17nbeloglazovDoes counterclockwise allow to import lein projects? Or I need to create pom file and import maven project?
06:17clgvnbeloglazov: yes it does since 0.9.0
06:17ejacksonnbeloglazov, it does
06:17nbeloglazovcool, thanks
06:18Bahman_Mourningclgv: Yes. Actually I was searching all the on Internet to find a natural solution like :ssl-only.
06:18clgvit's pretty awesome handling leiningen now. before you always had to adjust classpaths manually on dependency changes ...
06:18clgvnbeloglazov: just import and "Configure -> Convert to Leiningen project"
06:19nbeloglazovclgv: thank, I'll try
06:21clgvnbeloglazov: if you start from scratch just create a leiningen project directly
06:40nbeloglazovclgv: can't import lein project. First I need to import project to workspace somehow and then convert it to leiningen. But I can't import project because eclipse doesn't know what it is.
06:40ejacksonnbeloglazov there is a way to do this, 1 moment
06:41clgvnbeloglazov: I don't know if creating a Leiningen project overwrites the project.clj if present. Hence, try the safe way. Create a normal Clojure project in the folder of the project. then convert it to leiningen project
06:41ejacksonin the docs: http://code.google.com/p/counterclockwise/wiki/Documentation#Install_Counterclockwise_plugin
06:42ejacksoncheck out the section "f you want to use a non-Eclipse project you grabbed from Git/BitBucket, etc."
06:42ejacksonI did that just last week to get it going
06:42clgvejackson: that lists what I just said ;)
06:45nbeloglazovthanks guys, it worked
06:45clgvwell, if it is a version controlled project with no current changes you could just test if creating a leiningen project directly works. if not just reset to HEAD
06:46nbeloglazovWould be nice if counterclockwise guys added lein to eclipse import section
06:48clgvnbeloglazov: what section? I think creating a leiningen project in eclipse just should care not to overwrite an existing project.clj - that would be sufficient. maybe it does that already
06:49nbeloglazovcclgv: I mean "File -> Import..."
06:50clgvnbeloglazov: ah right. create an issue therefore, if there is none, please.
06:51clgvnbeloglazov: http://code.google.com/p/counterclockwise/issues/list
06:51nbeloglazovclgv: sure
06:53ejacksonclgv: aaaah, but it was written by French Guys, therefor is better :P
06:55clgvejackson: I thought there is a "French German friendship" one often hears about on related  anniversaries ;)
06:57ejacksonthis is the first I've heard of the French having any friends !
06:57hyPiRion:o
07:17clgvlol
07:21michaelr525hello
07:21augustlwhat's a good way to turn three vectors into one? [1], [2, 3], [4] => [1, 2, 3, 4]
07:22joegallo,(concat [1] [2 3] [4])
07:22clojurebot(1 2 3 4)
07:22joegalloif the result must be a vector, you can
07:23joegallo,(into [] '(1 2 3))
07:23clojurebot[1 2 3]
07:23noidior ,(vec (concat [1] [2 3] [4]))
07:23noidi,(vec (concat [1] [2 3] [4]))
07:23clojurebot[1 2 3 4]
07:23joegalloyes, that too
07:23augustlah, it doesn't actually have to be a vector
07:24hyPiRionYou can do concat by a reduce into
07:24hyPiRion,(reduce into [1] [[2 3] [4]])
07:24clojurebot[1 2 3 4]
07:25hyPiRion,(reduce into [] [[1] [2 3] [4]])
07:25clojurebot[1 2 3 4]
07:29michaelr525hyPiRion: cool
07:30clgvwell thats O(n) runtime - I wonder if they will implement the more advanced vectors that can be concatenated more efficient
07:31hyPiRionclgv: It really depends on your use case though
07:32michaelr525clgv: what are more advanced vectors?
07:33hyPiRionIf you want to append some elements and need a vector/constant lookup, then "reduce into" would probably be faster than "vec (concat"
07:33hyPiRionIf you just need a seq of elements you process, then concat is better
07:35hyPiRionIf you could combine some sort of difference list and vectors, then concatenation would be blazingly fast
07:35hyPiRionThough unbounded variables is still a hassle in Clojure :(
07:36clgvphil baghwell (from scala) presented this http://infoscience.epfl.ch/record/169879/files/RMTrees.pdf - vector with concatenation in O(log N)
07:37hyPiRionclgv: I don't have the time to look it up now, but are there any performance downsides to those vectors?
07:38hyPiRionIt certainly looks interesting though.
07:39clgvhyPiRion: I guess that the constant for the other operations increase
07:39clgvhyPiRion: so asymptotically none ;)
07:41hyPiRionLooked at the summary, seems like there are no reason to not use this.
07:42hyPiRionThis would be awesome for a data structure for strings though.
07:42clgvhyPiRion: I think if you do not need concatenation, plain clojure vectors will be faster in total due to the increased constants
07:43clgvso this would be the decision criterion which one to use
07:43hyPiRionclgv: It really depends on the performance loss
07:44hyPiRionIf there's no noticeable difference, you could switch over.
07:46hyPiRionMan, I've fallen in love with all these immutable data structures.
07:51ludstonOkeydokeyblokey's. IDE's. What doesn't emacs have by default?
07:52ludstonI have paredit, and I tried auto-complete but the suggestions it gave kept being annoyingly useless so I dropped it
07:53ludstonIs there something else essential that I'm missing out on?
07:57hyPiRionludston: nrepl?
07:58ludstonhyPiRion: Never heard of it. Back in 10
08:01hyPiRionMeh, my response was a bit slow - What you probably want is nrepl and ac-nrepl: https://github.com/purcell/ac-nrepl
08:02hyPiRionYou should get context-aware results by using that.
08:04ludstonhyPiRion: Thanks a load, I'll give it a go.
08:48hinjuzqiGhi
09:13jsabeaudryPotentially silly question here: does having a watch on an atom prevent it from getting garbage collected?
09:14gfredericksI doubt it
09:15gfredericks&(let [watched-atom #(let [a (atom %)] (add-watch a :foo identity) a)] (dorun (repeatedly 10000000 #(watched-atom 4))))
09:15lazybot⇒ nil
09:21gfredericksnothing important should have a reference to the atom
09:22hyPiRionThe atom has a ref to the watcher, and not vice versa
09:22hyPiRionreference*
09:31TimMchyPiRion: For strings, have you looked at ropes?
09:31TimMcThere's a Java impl out there.
09:33hyPiRionTimMc: I've heard about them, but not used them. Aren't they basically immutable binary trees?
09:39TimMchyPiRion: Yes, but the leaves are themselves strings.
09:40TimMcBasically every operation is O(log N)
09:44gfrederickswhat ought I to use for basic date-math? (just parsing and subtracting)
09:44hyPiRionclj-time
09:45hyPiRionhttps://github.com/KirinDave/clj-time
09:45wmealing_1-ah, that is the official one
09:45wmealing_1so many forks..
09:47gfrederickscorfield's isn't the official?
09:48xeqihttps://clojars.org/clj-time
09:48gfredericksdoes lein2 allow specifying alternate namespaces for use by `lein run` and `lein repl`? (for that matter does lein1?)
09:48hyPiRiongfredericks: I believe that's the one on clojars, as the "official" is kind of abandoned.
09:48xeqilooks like seancorfield's is
09:49gfrederickshyPiRion: in what sense does cljars claim it is official?
09:51xeqigfredericks: `lein run -m namespace`
09:52hyPiRiongfredericks: I meant that corfield's is the one on clojars
09:52xeqiI don't think the repl command does
09:54nbeloglazovgfredericks: also you can specify function to be called: lein run -m namespace/your-fn
09:55gfredericksxeqi: okay thanks
09:57cshellWhat's the rule for using the literal [] sequence for a vector versus using the vector function?
09:58Wild_Catcshell: if you can use the [] form, do it. Otherwise, use the vector function.
09:58cshellthat's what I thought but then I read something about only using the [] form if it contained literals, not functioncalls or vars
09:59gtrakwhere does it say that?
10:01gfredericksthat's an interesting distinction because when talking about the difference between (list ...) and '(...) that's quite important
10:02cshellyeah, i can't find it right now - I think it was a google groups discussion that cemerick was a part of a while ago
10:03cemerickcshell: You can put anything in [].
10:03gfrederickscemerick: you're flip-flopping from your previous alleged opinion!
10:03cemerickYou can put anything in any literal, but you might get an error if you have duplicate values in a set literal or duplicate keys in a map literal.
10:04cemerickgfredericks: Do you know what my opinion is? ;-)
10:04cshellNo, I think cemerick was answering someone's question which was similar to mine
10:04TimMccshell: You're thinking of Common Lisp, I think.
10:04cshellyes, that was it
10:04cemerickI never said anything about vectors, though.
10:04cshellit was on set literals
10:04TimMc&#{3 (+ 1 2)}
10:04lazybotjava.lang.IllegalArgumentException: Duplicate key: 3
10:05TimMc&(hash-set 3 (+ 1 2))
10:05lazybotjava.lang.IllegalArgumentException: Duplicate key: 3
10:05TimMcSeems awfully silly to me, but that's how it is currently.
10:05cshellhere's the post http://bit.ly/R00OBa
10:05gtrakeh, what's the big deal?
10:06cemerickWe talk about this on the podcast, actually.
10:06hyPiRionTimMc: You can wrap it with either distinct or into
10:06cshellI was just confused because there was some discussion in the thread which I took to imply that literals () [], etc were not to contain literals
10:06cshellso, that's why I was asking in here :)
10:07hyPiRion,[(into #{} [1 1 1]} (apply hash-set (distinct [1 1 1]))]
10:07clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: }>
10:07hyPiRion,[(into #{} [1 1 1]) (apply hash-set (distinct [1 1 1]))]
10:07clojurebot[#{1} #{1}]
10:07TimMcgtrak: Well, if your set literal is combining values that are known at compile time and at runtime, you could get a surprise -- sometimes.
10:08cemerickcshell: That's a bit like saying, "don't try to read from a path, because the file you think is there might not be"
10:08gtrakah, yea, I'm reading through that thread
10:08gtrakthe potential of a set collision causing an exception seems troublesome
10:08cshelllol
10:09gtrakbecause it doesn't happen ALL the time
10:09cshellI'm glad to hear that I can use the [] forms, as that's all I've been using
10:09jsabeaudrygfredericks, hyPiRion : thanks!
10:09xeqi&{1 2 1 3}
10:09lazybotjava.lang.IllegalArgumentException: Duplicate key: 1
10:10cshellthanks guys
10:12gtrakturns out hashset has the same problem
10:12gtrak,(hash-set 1 2 2)
10:12clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Duplicate key: 2>
10:12gtrakyou have to use into
10:13hyPiRionor, eventually, conj
10:13gtrakreduce
10:13hyPiRion,(conj #{} 1 2 2)
10:13clojurebot#{1 2}
10:14gtrak,(set [1 2 2])
10:14clojurebot#{1 2}
10:19hyPiRionHm, so set and conj seems to be the most succinct versions out there.
10:20TimMcconj would seem to be the best way to combine compile-time and runtime values into a set.
10:20TimMc&(conj #{1 2 3} (+ 1 2))
10:20lazybot⇒ #{1 2 3}
10:21magopianis there a way to get the version of a REPL, from within the REPL ?
10:22magopiantrying to find out what's the version of the light table playground i'm using, and the version on tryclojure, and on 4clojure ;)
10:22xeqi&*clojure-version*
10:22lazybot⇒ {:major 1, :minor 4, :incremental 0, :qualifier nil}
10:24TimMc4clojure gives you one bit of information per test, so you'll have to run tests using things like (:major *clojure-version*).
10:27xeqior just check the source https://github.com/4clojure/4clojure/blob/develop/project.clj
10:29gtrakgosh, that literal issue seems really needlessly heinous
10:43magopianthanks xeqi ;) (a bit late ;)
10:43magopianand thanks TimMc ;)
10:46cemerick<spam>Mostly Lazy episode 6 with chouser is here: http://mostlylazy.com&lt;/spam&gt;
10:46foxdonuthehe
10:49magopiani can't really understand the "import" mecanism in clojure
10:49magopiani'm using the light table playground (which is awesome ;)
10:49magopianand trying to use
10:49magopianclojure.contrib.core.dissoc-in
10:49magopianbut it just won't
10:49magopiansame in tryclojure
10:52magopiani'm trying either (use 'clojure.contrib.core)
10:52magopianeither (clojure.contrib.core/dissoc-in
10:52Bronsamagopian: clojure.contrib is not part of clojure
10:52TimMcmagopian: clojure.contrib.$FOO isn't on the classpath, so you can't import it.
10:52Bronsaand it also got deprecated since clojure 1.3
10:52magopianoh
10:53magopiandouble "oh" :)
10:53magopianthat explains it :)
10:53magopianso if i need dissoc-in, i either add the jar to the classpath, or copy the code
10:54Bronsahttp://clojure.github.com/clojure/ here you can see the namespaces included in clojure
10:54magopianthanks Bronsa ;)
10:54Bronsamagopian: actually, dissoc-in got included in clojure.core.incubator
10:54Bronsahttps://github.com/clojure/core.incubator
10:55magopiannice ;)
10:55TimMcmagopian: You'd probably be happy with just a combination of update-in and dissoc.
10:55magopianTimMc: you're right !
10:55magopiangenius !
10:56foxdonut(inc TimMc)
10:56lazybot⇒ 12
10:56TimMcHeh, that praise belongs to whoever I heard it from in this channel.
10:56magopianeh ;)
10:56foxdonutcollectively, this channel is genius, for sure.
10:57magopianfor sure.
10:57alexyakushevWow, didn't know one could do that
10:57alexyakushev(inc TimMc)
10:57lazybot⇒ 13
10:57gfredericks(inc TimMc) ;; TimMc is default for practicing with inc
10:57lazybot⇒ 14
10:58mattmoss(map inc [1 2 TimMc 4])
10:58mattmoss,(map inc [1 2 TimMc 4])
10:58clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: TimMc in this context, compiling:(NO_SOURCE_PATH:0)>
10:59mattmossI phale.
11:00TimMc"(inc" is undoubtedly hardcoded as a command prefix.
11:00TimMc (inc foxdonut) ;; with leading space
11:00magopianTimMc: mmm actually, it would be a combination of get, update-in and dissoc, right?
11:00gfredericksI remember adding a patch that allowed putting comments afterwards
11:03TimMc&(update-in [0 [1 [2 {:a 1 :b 3}]]] [1 1 1] dissoc :a) ;; magopian
11:03lazybot⇒ [0 [1 [2 {:b 3}]]]
11:03magopianTimMc: but it only works for a map (the dissoc)
11:03magopianwhile dissoc-in works for a collection, right?
11:04magopian(the key being the index)
11:05magopiannvm, i got it wrong, dissoc-in also works for maps only
11:05magopianmmm i'll have to find another solution to solve problem 112 on 4clojure ;)
11:08casioncan you see other user's solutions on 4clojure?
11:08nbeloglazov&(doc dissoc-in)
11:08lazybotjava.lang.RuntimeException: Unable to resolve var: dissoc-in in this context
11:08nbeloglazov,(doc dissoc-in)
11:08clojurebotIt's greek to me.
11:09nbeloglazov,(doc assoc-in)
11:09clojurebot"([m [k & ks] v]); Associates a value in a nested associative structure, where ks is a sequence of keys and v is the new value and returns a new nested structure. If any levels do not exist, hash-maps will be created."
11:09nbeloglazovDoes dissoc-in exist?
11:09nbeloglazov&cd dissoc-in
11:09lazybotjava.lang.RuntimeException: Unable to resolve symbol: cd in this context
11:10Bronsahttp://clojure.github.com/core.incubator/clojure.core.incubator-api.html#clojure.core.incubator/dissoc-in nbeloglazov
11:10`fogusIs there a dedicated CCW IRC channel?
11:18alexyakushevIs there a short way to check if value implements IFn? I tried `fn?` but it returns false on keywords, for example
11:19alexyakushevI am aware of `(instance? clojure.lang.IFn x)` but maybe there is some cleaner solution
11:21nbeloglazov&(ifn? :hello)
11:21lazybot⇒ true
11:21magopiancasion: yes, once you solve the problem, you can see other's solutions if you follow them
11:22casionmagopian: what about before you solve them?
11:22magopiancasion: i personnally follow each of the few that solved all the problems, this way i'm sure to have a global overview ;)
11:22magopiancasion: in that case, no
11:22nbeloglazovalexyakushev: you can use ifn?
11:22casion:|
11:22magopianthat would ruin all the fun, wouldn't it? :)
11:23casionmagopian: not really
11:23TimMc&(map (juxt ifn? fn?) [:hello identity])
11:23lazybot⇒ ([true false] [true true])
11:28magopiancasion: well, no point in trying to solve the problem, if you can see the solutions from the start
11:29casionmagopian: the point, for me, would be in many cases I don't even understand the problem
11:29casionand seeing the solution would make it much more clear… and thusly I learn a new concept
11:32juhu_chapaHi all! Is there a way to reduce "completely" a list of booleans i.e. (reduce and [true false true])
11:32S11001001,(doc every?) ; juhu_chapa
11:32clojurebot"([pred coll]); Returns true if (pred x) is logical true for every x in coll, else false."
11:33S11001001,(doc some) ; juhu_chapa
11:33clojurebot"([pred coll]); Returns the first logical true value of (pred x) for any x in coll, else nil. One common idiom is to use a set as pred, for example this will return :fred if :fred is in the sequence, otherwise nil: (some #{:fred} coll)"
11:33juhu_chapaS11001001: beautiful! ...thank you.
11:33Bronsacemerick: ping
11:34magopiancasion: try something else then, like rosettacode
11:37cemerickBronsa: hallo
11:37Bronsacemerick: hi, the second link on "Discrete topics" for the 6 mostly lazy podcast is broken
11:38cemerickso it is, thanks
11:38Bronsayou're welcome :)
12:34djpowellweavejester: Have
12:34djpowellgrr
12:36djpowellweavejester: have you pushed the 1.1.2 release of the ring wrapper project to clojars? I can only see the bits
12:36clojurebotIt's Turing complete |is| <reply>Turing completeness is the Godwin's Law of language arguments
12:45technomancyfrom the podcast: "some two-word functions don't have dashes in them" <- aren't those all inherited from CL?
12:45djpowellooh what podcast?
12:46technomancyhttp://mostlylazy.com/2012/08/14/episode-6-chris-houser-clojure-surveys-getting-the-little-things-right-in-languages-yegge-rama-clojurescript-repls/
12:46djpowellI guess dosync isn't
12:49technomancytrue
12:56TimMcc-d-r
12:56brainproxyhow to do let destructuring inside syntax quoted parts of defmacro?
12:56technomancyTimMc: hah
12:57technomancyelisp actually has detailed rules about whether you should use a -p suffix to indicate a predicate vs just p
12:58arrdemdoesn't Clojure scrap the -p convention?
12:58technomancyyes, thank goodness
12:58technomancybecause it's not 1980
12:58cemericktechnomancy: I think the bigger thing is that, there largely hasn't been a discussion about all those "little things".
12:58TimMc(def zero?p [x] (identical? zero? x))
12:58TimMc*defn, whatever
12:59technomancycemerick: yeah, but it's more cathartic to just blame CL
12:59drewranyone know what gaz jones tweeter is?
12:59cemerickg-d CL
12:59cemericktechnomancy: you're right :-D
12:59technomancyfor instance, the fact that the word "some" implies plurality but clojure.core/some doesn't return a collection
13:00seqrnoob question: How to create a set of sets, or a nested set, without using a set literal? e.g. I want to end up with #{#{:a :b}} but (set #{:a :b}) just gives me #{a b} back.
13:00TimMcseqr: set creates a set from a collection
13:01TimMc&(conj #{} #{:a :b}) is certainly one way
13:01lazybot⇒ #{#{:a :b}}
13:01TimMcYou can also ask for a specific kind of set: ##(hash-set #{:a :b})
13:01lazybot⇒ #{#{:a :b}}
13:01raek_seqr: (set [#{:a :b}]) or (hash-set #{:a :b})
13:02brainproxynvm, figured out the desctructuring thing..
13:03seqrraek_: Thanks!
13:04seqrTimMc: Ah, ok, that explains it, thanks.
13:05mkis the use of map entries discouraged?
13:06gtrakmk in what sense?
13:06gtrak,(first {:a 1 :b 2})
13:06clojurebot[:a 1]
13:07TimMc&(find {:a 1 :b 2 :c 3} :b)
13:07lazybot⇒ [:b 2]
13:07mkgtrak: in any sense. Seemed that it was preferable to use seqs on keys and values when doing map
13:07TimMcmk: It's common to see Clojure code that walks a map and destructures the entries.
13:07gtrakmapmap?
13:08gtrakhttp://tech.puredanger.com/2010/09/24/meet-my-little-friend-mapmap/
13:08mkI guess I'm mostly thinking of map, and generating new values based on old
13:08TimMc&(for [[k v] {:a 1 :b 2 :c 3}] (format "%s -> %s" k v))
13:08lazybot⇒ (":a -> 1" ":c -> 3" ":b -> 2")
13:09gtrakmk: I think it's fine as long as you know it's a seq view on the map, and you're not relying on order
13:10mkgtrak: the idea is to... for example, {:a "one", :b "five"} becomes (:a 3, :b 4) via length
13:11gtrakmk: yea, read the mapmap post
13:11TimMcThe mapmap in the blog post isn't quite perfect for what you want.
13:12abevi want to try eg clojure.json lib in repl how to go about it?
13:12gtraksure it is, there's a [vf s] arity
13:12gtrak(mapmap count m)
13:14mkright, it zipmaps. Seems like it should be using map enties, though
13:14gtrakit is... when you do map on it, it turns it into a seq
13:14TimMcgtrak: Not quite. (mapmap key (comp count val) m)
13:15gtrakerr huh?
13:15arrdem,(cons #{} 1)
13:15clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>
13:15arrdem,(cons 1 #{})
13:15clojurebot(1)
13:16gtrakTimMc: ah, you're right
13:16mkTimMc is right, when using the value-arity, it passes the whole map entry. I don't think that's a big deal, just redefine "mapmap"
13:18mkI guess the map does use map entries, though, so that's good
13:19gtrakyou shouldn't have to rely on the fact that it's a map-entry in implementation
13:19mkI guess I was looking at the zipmap variant?
13:20mkgtrak: yeah, list, vector, map entry, same thing. I'm just wondering about performance for mapping over huge maps
13:21gtrakdunno, you'd have to profile it
13:22gtrakTimMc's 'for comprehension' does a single iteration, though
13:23gtraki think 'into {}' can be faster than zipmap
13:24gtrakfor some reason zipmap doesn't use transients
13:24gtraklooks like there's a bug reported for it
13:28gtrakmk, take a look at https://github.com/flatland/useful/blob/develop/src/useful/map.clj#L46
13:33mkgtrak: thanks
13:33mkand a much clearer name than mapmap
13:34gtrakyea, np, I finally remembered where I saw it
13:35gtrakit uses a map-entry constructor presumably to avoid the extra allocations
14:02casionwould someone kindly give me some assistance with http://www.4clojure.com/problem/112, I've been working on it for about 6 hours and I'm not even close
14:03S11001001@google google
14:03jweissi remember seeing some lib or functionality where you can "remember" a group of requires in a ns declaration and re-use them. anyone know what that was?
14:04mkcasion: what do you have so far?
14:07casionmk: best I've managed is maintaining the nested structure and replacing everything with 1s
14:07casionI'm trying to find that code now, it was incredibly bad anyway
14:08arrdemcasion: were you using recursion? what is your basic case?
14:10casionhttps://www.refheap.com/paste/4346
14:10casionthat was the monstrosity
14:10scriptorshould it be (fn replze [data] …) ?
14:10scriptor*replaze
14:10casionuh
14:10casionyes
14:11casionI have no idea how I ended up pasting (fn instead of (defn replaze
14:13casionhttps://www.refheap.com/paste/4347
14:13casionthe correct incorrect code ^
14:21arrdemcasion: one idea I'm having is that if you flatten the nested list structure, you can figure out how many atoms you need to add up. look at the last case where the "correct" answer drops two levels of lists once it hits the sum cap.
14:30casionarrdem: ah
14:30casionwell, I can find how deep to go now, albeit inefficentll
14:32arrdemcasion: just notice that for these test cases you are always walking the same list or decending, there is no test case where you have to go down and come back up.
14:42casionarrdem: well, you've given me an excellent idea at least, now I need to figure out how to do it
14:42casionthank you
14:42arrdemno problem, best of luck
14:50dgrnbrgWhere does eclipse's CCW put the logs when the repl fails to start? Or where can I see the log of the repl start?
14:51eggsbyhmm, does the 'time' macro not work when you package into a jarfile?
14:54dgrnbrgeggsby: it should work fine
14:54amalloyeggsby: that sounds like nonsense
14:54dgrnbrgNow, i've found the log file, but I see that CCW is using lein 1. I have my lein2 binary called lein2--is there a way to tell CCW to use that instead?
14:56fentonWhat is a good data structure if i want to have a sorted list of name value pairs?
14:56dgrnbrgfenton: treemap?
14:56dgrnbrgerm, sorted-map?
14:57fentondgrnbrg: ok I have a look at those...thx.
14:57dgrnbrg,(doc sorted-map)
14:57clojurebot"([& keyvals]); keyval => key val Returns a new sorted map with supplied mappings."
14:57dgrnbrg,(doc sorted-map-by)
14:57clojurebot"([comparator & keyvals]); keyval => key val Returns a new sorted map with supplied mappings, using the supplied comparator."
14:57dgrnbrgthey force uniqueness in the keys, of course
14:58fentondgrnbrg: yeah, i'd want that, thats excellent.
14:58dgrnbrgif you just need uniqueness by element, use sorted-set and write your own comparator
14:58fentondgrnbrg: sorry, super newbie, let me chew on the first part :)
14:59hiredman /win 15
15:12arrdem,(dec arrdem)
15:12clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: arrdem in this context, compiling:(NO_SOURCE_PATH:0)>
15:22mk(inc arrdem)
15:22lazybot⇒ 1
15:24arrdemhum....
15:24arrdemyeah I though we had a karma system
15:29mknot a very good one. Increment rep systems are usually used by regulars, and for rewarding humor or agreement
15:34mkit would be more useful if the bot counted up "thanks"
15:35scriptorcould get a sense of that by parsing the logs
15:36TimMcAlso it sometimes forgets people's karma. :-)
15:37mkI just had a look at e.g. http://clojure-log.n01se.net/date/2012-06-21.html, 37 occurences of thanks, and the vast majority of the directed ones make sense. 4 instances of (inc, and they all seem... not so useful
15:38mkI don't want to parse the docs myself, the bot effectively does that realtime
15:38TimMcmk: Oh, you should just whip up a discourse analysis engine and build a better karmabot!
15:38amalloyor write a lazybot plugin
15:39amalloymk: thanks in advance! here's a thanks to get your bot started on
15:39arrdemamalloy: I see what you did there...
15:40TimMc(oh, huh... I know the person that wrote this dissertation!)
15:40mkTimMc: the so-called "discourse analysis engine" it would consist of inc (filter inchannel stuffbeforecolon-orcomma) ... if rest contains "thanks" or "thank you" etc.
15:40arrdemlink? my to-read list is still of finite length..
15:40TimMcmk: No, you'll have to pick out who is being thanked.
15:41mkamalloy: I'm sure the false-positives/negatives would be no worse than what already occurs, see my use of inc above :)
15:41TimMcmk: That will require determining who has been engaged in conversation with whom, based on semantic similarity, sentiment analysis, timing analysis, classification into broadcast vs. directed messages...
15:42mkTimMc: thanks. Because this message is directed at you, and contains the term "thank you" etc., you are incremented
15:42amalloyTimMc: ugh, no thanks. that sounds like too much trouble
15:42scriptormk: so what about
15:42scriptorthanks, mk
15:43TimMcthanks
15:43TimMc^ scriptor
15:43TimMcor just a bare "thanks", when it is clear that none of the other active chatters is engaged in the same conversation.
15:43mkscriptor: the filter will miss a few. Simply go through the logs and grep thanks. See which ones are caught and which ones aren't
15:44arrdemyou should be able to piece together simple conversations from timestamps and mentions, which would allow you to determine the target of a simple "thanks" message
15:44scriptormk: I still think finding anything with a thanks and getting all nicks from that line would get most of them
15:44mkscriptor: that's exactly what I'm saying
15:44scriptorthe issue would be recognizing nicks...hmm
15:44arrdemso if amalloy and I were going back and forth for a while then I say thanks with no qualifier the history disambiguates
15:44scriptorthe issue would be recognizing nicks…hmm
15:44scriptorargh
15:45arrdembut scriptor is probably right
15:45scriptormk: I thought you were only counting <nick>: <message including "thanks">
15:45scriptormy bad
15:45mkscriptor: you just check the stuff before the : or comma, and do (isinchannel ...)
15:45arrdemlogins/logouts should also be in the logs... so you could have a set of people in chan as of that message
15:46scriptormk: I meant when the nick isn't before the colon
15:46scriptoras in "thanks mk!"
15:46TimMcSome people use @this to address people, no doubt thinking that Twitter is the One True Conversational Medium.
15:46scriptor@TimMc #thanks
15:47TimMc(dec scriptor) ;; :-P
15:47lazybot⇒ -1
15:47metellus@someone makes sense even in a twitterless world
15:47mkscriptor: it just makes it easier to parse. I've scanned some logs and there just aren't that many cases of "thanks [...] targetnick", unless the nick comes at the very end
15:47aperiodichey man, i was using @someone on IRC before twitter even existed
15:47TimMcIt makes sense in blog comments.
15:47metellus[the following is directed] @ someone: blah blah blah
15:47scriptormk: ah, sounds good
15:48scriptorI was wondering how many irc newbies ask questions on here who aren't familiar with autocompleting nicks
15:49mkthe other thing is it encourages people to be polite
15:49metellusplus, everyone gets points at the end of November!
15:50nDuffmk: I'm not sure that encouraging the kind of politeness that involves a lower s/n ratio is beneficial (as opposed to the kind of politeness wherein folks describe their questions, and their answers, as clearly and succinctly as possible)
15:50mkanother thing to count is directed "ooooh"s
15:50scriptorwhat would be the dec equivalent?
15:51mknDuff: it increases s/n since gratitude is signal, not noise
15:51arrdemscriptor: absolutely increasing rep?
15:52metellusI've never seen someone use dec in here except the two tests today
15:52mkscriptor: there wouldn't be one. People don't usually dec each other when speaking in this context
15:53scriptorheh, true, thinking of fun cases for it I guess
15:53arrdemI mean... even if I said something really boneheadedly wrong I can't imagine getting dec'd in this setting. perrhapse rudeness?
15:54mkscriptor: some other ones (for different reps that might not be worth counting) are "heh", "yeah,", "haha", ":)" etc.
15:56mkarrdem: I'm pretty sure that my single rep modification is a dec for saying something disagreeable (but entirely right, in my view) about values or subtyping
15:57mkscriptor: if you want, you can do (/ thanksgiven charstyped)
15:59scriptoris there an established rationale for why comp applies its function right-to-left?
15:59scriptorI was thinking it had something to do with what the un-comped version would look like
15:59mkscriptor: recursion?
15:59scriptor(comp a b) => (a (b …)) so visually it has the same order
16:00jolyI believe it has to do with the mathmatical definition of composition; math did it that way first
16:00scriptorah
16:01mkscriptor: direct that and it should count as an inc
16:02scriptoranother thing I can't believe I didn't remember, (f . g) ~ f(g())
16:02scriptormk: ah :)
16:04mkI suppose that maybe the best place for that sort of thing is in the irc client itself, rather than a bot
16:09TimMc(inc scriptor) ;; because I feel bad just leaving that dec there
16:09lazybot⇒ 0
16:09scriptorTimMc: thanks
16:12TimMchaha
16:22mononofuCompiling jukebox.core Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.Symbol
16:22mononofuwhen trying to use leiningen to compile a hello world clojure file
16:22mononofuis there a proper compiler around too?
16:22arrdema) code? b) that is the compiler
16:23mononofuwell, problem was that :main wasn't set correctly in the project file
16:23mononofubut I was wondering if there is a compiler with actual error handling around
16:24mononofufor the record, randomly throwing exceptions without referencing what went wrong is not error handling
16:25TimMcmononofu: This sounds like an issue arising with leiningen's reading of the config file. Nothing to do with the Clojure compiler.
16:25S11001001mononofu: repl has option to ask for last trace; C-c C-l in slime also provides trace on failure
16:26mononofuI already fixed this error, that's not the problem
16:26RaynesAnd furthermore, if you actually read those traces, they can sometimes have some useful info such as the file and line number where the error occurred.
16:26TimMcmononofu: Lein isn't a compiler, it's a build/dev tool.
16:27mononofuRaynes: that's my problem, I never have line numbers in there
16:27RaynesYou have a strange problem.
16:27mononofuhttp://pastebin.com/KjTe7h1A
16:28mononofuerror message for incorrect :use statement
16:28mononofuthat's not a very good error message
16:28mmitchellanyone using s3-wagon? I just upgrade from lein 1.x to 2.x, and can't get authentication to work :/
16:29mmitchell... currently trying the :creds :env approach
16:29emezeskemononofu: It looks like a perfectly good error message, the only bad part is no line number.
16:29emezeskemononofu: Out of curiousity, what kind of :use led to that?
16:29RaynesI'm top tired for these shenanigans.
16:30Raynestoo, even
16:30llasrammononofu: For the record, I completely agree. I love Clojure, but think the error-reporting paradigm is less than optimally helpful
16:30mononofuomitting the () around :use
16:31S11001001When the error messages are good, we won't need human programmers anymore.
16:31llasrammononofu: It helps a bit to think about the fact that it's all just code all the way down, and you have a uniform interface whether the error results from something encountered by the compiler, a standard library macro, your own macro, your own run-time initializer code, or even your own run-time code
16:31emezeskemononofu: Right, so the error told you that you were passing a symbol (:use) where you should have passed a seq (the ()). So that's very direct and clear. The lack of a line number is definitely miserable.
16:31mononofuemezeske: yeah, my main issue is the lack of a line number
16:32Raynesemezeske: It looks like it might be because of how the code was evaluated. There is a NO_SOURCE_FILE thing in there.
16:32emezeskemononofu: I fully agree that's miserable.
16:32technomancyit also doesn't mention ns or use anywhere in the stack trace, which is bad
16:32technomancyload_libs is the closest it comes
16:32emezesketechnomancy: Yeah, that would have been almost as good as a line number
16:32technomancyso it relies on knowledge of the compilers internals
16:33llasramtechnomancy: It actually does mention 'ns', but it's def non-obvious
16:33emezeskeRaynes: Yeah, I don't know what that's all about.
16:33hiredmantechnomancy: compiler internals?
16:33technomancyllasram: where?
16:33llasramclojure.core$ns$fn__4796.invoke(core.clj:5130) -- doesn't exactly jump out at one
16:33emezeskellasram: Oh, you're right!
16:33llasramOh, even clojure.core$ns.doInvoke(core.clj:5130)
16:33technomancyhiredman: err-not the compiler, but clojure.core in general
16:33llasramStill, same complaint
16:34technomancyllasram: ah, totally missed it. that's something that could actually be made clearer in clj-stacktrace rather than an inherent problem in the data itself
16:38AWizzArdhttp://www.virtual-strategy.com/2012/08/14/oracle-releases-new-java-updates-java-se-7-update-6-javafx-22-and-javafx-scene-builder-10
16:43mmitchelltechnomancy: hey there. I'm trying to upgrade our lein plugins from leiningen 1 to 2.x. We use the s3wagon plugin, but for the life of me I can't get auth to work, any tips/ideas?
16:43mmitchellI thought :env would be the simplest test, but no go
16:46technomancymmitchell: what did you try?
16:47kennethhey if i do (pprint conf) i get a class not found exception (clojure 1.4) -- what gives?
16:48kenneth,(pprint [:hello :world])
16:48clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: pprint in this context, compiling:(NO_SOURCE_PATH:0)>
16:48S11001001kenneth: it's not in core
16:48arrdemclojure.pprint
16:48kennethtried clojure.pprint too, same error
16:48S11001001,(require 'clojure.pprint)
16:48clojurebotnil
16:48kennethah right
16:49S11001001,(clojure.pprint/pprint [:hi :there])
16:49clojurebot[:hi :there]
16:50kennethwait, that didn't work either… i added (:require clojure.pprint) to my (ns) and i get the same error when trying to do (clojure.pprint …)
16:51mmitchelltechnomancy: I added the s3wagon plugin to my project, then added two private s3 repositories. I setup my .lein/credentials.clj, then tried "lein deps" and lots of 403s
16:51metelluskenneth: you need to do (clojure.pprint/pprint …)
16:51mmitchelli also attempted to run my crednetials.clj file through gpg, but it (gpg) keeps telling me i didn't specify a username, not sure what to do there?
16:52technomancymmitchell: is it gpg 2?
16:52clojurebotI don't understand.
16:52mmitchelltechnomancy: let me check
16:52kennethoh right i get it! :)
16:53mmitchelltechnomancy: no, it's 1.4.12
16:53metelluskenneth: you're calling the pprint function in the clojure.pprint namespace
16:53mmitchellinstalling 2 now though
16:53technomancymmitchell: cool; could you paste the error so I can update the docs?
16:53technomancymmitchell: also, what did you try for :env?
16:54mmitchelltechnomancy: sure will paste error in a min... for :env, I just exported my aws keyId/secret to LEIN_USERNAME and LEIN_PASSPHRASE
16:56technomancymmitchell: aye, that sounds like a bug. can you try exporting DEBUG=y before doing deploy to see if it's reading the credentials correctly?
16:56mmitchelltechnomancy: sure thing
17:01mmitchelltechnomancy: here is the gpg 1.x output: https://gist.github.com/3352990
17:03mmitchelltechnomancy: maybe i'm doing something wrong, hmm. gpg2 does the same thing, to be clear... i've never used gpg so this could definitely be me
17:03arrdembesides binding it to a local name, is there a good way to initialize an object and then invoke a bunch of dot methods which return garbage?
17:04amalloy&(doc doto)
17:04lazybot⇒ "Macro ([x & forms]); Evaluates x then calls all of the methods and functions with the value of x supplied at the front of the given arguments. The forms are evaluated in order. Returns x. (doto (new java.util.HashMap) (.put \"a\" 1) (.put \"b\" 2))"
17:04arrdemthanks amalloy
17:06technomancymmitchell: oh, do you have your own key generated yet
17:06technomancy?
17:06technomancyI literally just added this to the tutorial a day or two ago
17:06mmitchelltechnomancy: ha, no. I actually just figured that out! Generating one now :)
17:06technomancyhttps://github.com/technomancy/leiningen/commit/50e14e06e6371e816777e52f7f8f98b9937f5111
17:07technomancyeither way, a better message is needed
17:08mmitchelltechnomancy: cool, i'll read through that
17:09mmitchelltechnomancy: so, in my credendtials.clj file, can I use System/getenv for my aws keys?
17:10mmitchellI have them setup in my env as AWSSecretKey and AWSAccessKeyId
17:10technomancyif it's encrypted it's probably fine to just put them in the file
17:12mmitchelltechnomancy: ok, i'll try that
17:13mmitchelltechnomancy: oh another thing... lein help deploying shows an example using backticks, like ```clj is this needed?
17:13hiredmanmarkdown syntax
17:14technomancymmitchell: it's for HTML rendering via github
17:14mmitchellahh ok! :)
17:14technomancywe ship the same source text as online help
17:14technomancynot worth the trouble to strip it out even though it looks a bit odd
17:14technomancymaybe we should; I dunno
17:15mmitchellno biggie, that makes sense
17:15mmitchellrats, when I start up "lein deps" I immediately see https://gist.github.com/3353090
17:17technomancythe invocation it's doing is gpg --batch --decrypt ~/.lein/credentials.clj.gpg
17:17technomancyjust by shelling out
17:17technomancyso you can use that to debug
17:17mmitchellok cool
17:17technomancythough I'm more concerned that :env isn't working
17:18technomancywith :gpg there are more moving parts, with :env it should just work
17:20mmitchelltechnomancy: oh i think it's because i have gpg (v 1) installed, but used the gpg3 executable to create the key. I'll uninstall gpg and alias gpg to gpg2
17:20mmitchellerr, i mean gpg2
17:21technomancyis there existing ring middleware to try/catch, check accepts headers, and return either json or HTML error messages as appropriate?
17:25mmitchelltechnomancy: ok, the "gpg --batch --decrypt ~/.lein/credentials.clj.gpg" command works now. But "lein deps" just hangs
17:25technomancyso it was a 1.x problem?
17:25technomancygpg1?
17:26technomancydoes lein deploy work?
17:26mmitchelltechnomancy: yeah i finally got gpg2 to generate my key and encrypt/decrypt my crednetials.clj file
17:26mmitchelltechnomancy: deps hangs, but i'll see what happens with deploy
17:27mmitchellhmm, hanging too
17:29Cr8technomancy: I've seen HTML exception traces before, but nothing that checks accepts headers or returns JSON
17:29technomancyCr8: well shucks
17:29technomancydon't tell me I have to write it myself =)
17:29technomancyI wonder if that should ship with ring or compojure?
17:29technomancydrat, the weaving jester is absent
17:30technomancydoesn't seem right for compojure
17:32technomancyseems like there isn't a coherent story around accepts headers in general
17:33mmitchelltechnomancy: I can't get :gpg or :env to work. For :env, should my $LEIN_USERNAME be my aws access key id, and $LEIN_PASSPHRASE be the aws secret key? (sorry for pestering)
17:34technomancymmitchell: that's right
17:34mmitchelldang, ok. Anything i can do for debugging :env?
17:35technomancymmitchell: sorry, I need to relocate briefly. I think you'd have to open a repl on leiningen itself to debug that
17:35steffi_show do i hook up functions to single keypresses in clojure when writing a commandline program? I tried my own loop, but it seems to be buffered somehow and reacts only line by line..
17:35mmitchelltechnomancy: no problem, i'll keep trying
17:35mmitchelltechnomancy: thanks!
17:36TimMcsteffi_s: What are you currently using to read?
17:37steffi_ssomething like (let [c (.read *in*)] [..]
17:39steffi_sthen i read about jline.Terminal, but cannot find a working clojure example
17:44TimMcI'm pretty sure that's all going to be line-at-a-time, unfortunately.
17:46scriptorhow does clojure know when to expect more code in the repl if all parens aren't matched
17:46scriptorsay, if you just enter: (defn foo []
17:46scriptordoes the reader return something that lets the repl know to expect more?
17:46m0smithsteffi_s: Take a look at http://sjl.bitbucket.org/clojure-lanterna/
17:47m0smithIt is used by "Caves of Clojure"
17:52mmitchelltechnomancy: OK, when I run "gpg --batch --decrypt ~/.lein/credentials.clj.gpg" I get a passphrase prompt. When I run "lein deps" it hangs... is it waiting for stdin for the passphrase?
17:59TimMcscriptor: I think the reader blocks until it has a complete form + a newline.
18:06alpheusTesting my install instructions I got the latest copy of lein and it errs after lein self-install;lein repl
18:08alpheusUsing https://raw.github.com/technomancy/leiningen/preview/bin/lein
20:55y3diis lisp like the only real way of representing functions in a way that can be interpreted anywhere?
20:56y3dilike json can represent any kind of dict like value/object and that can be read by any program with a json parser
20:56y3dibut to function logic isn't really composable in the same way
20:56y3diexcept for in lisp
20:57dnolenlynaghk: ping
21:00hyPiRiony3di: Lisp is basically just lists, so you could convert a lisp-program into a JSON-list if you wanted to.
21:02TimMcy3di: Having your surface syntax be very similar to the AST is nice, but it doesn't allow code to magically become portable. :-/
21:47lynaghk`dnolen: pong
21:53dnolenwowzers http://github.com/cderoove/damp.ekeko/wiki/Example-Ekeko-Queries :)
21:53dnolenlynaghk`: so is that patch ready to apply?
21:54lynaghk`dnolen: yes, that branch works on clj and cljs for the specific case I was having
21:54lynaghk`all clj tests pass (including the ones added in the original patch)
21:55lynaghk`inlining the bit in val-at-expr feels gross to me, though so if you have any suggestions I'd be happy to reimplement.
21:57dnolenlynaghk`: sorry I'm slow, where is the inlining?
21:58dnolenlynaghk`: where you backtrack?
21:58lynaghk`dnolen: https://github.com/lynaghk/core.match/blob/issue-52/src/main/clojure/clojure/core/match.clj#L137
21:59dnolenlynaghk`: oh that's not part of the patch.
21:59lynaghk`I put a commit on top of Jackson's patch for cljs support, which is my use case
21:59lynaghk`his original patch works fine for clj clojure.
22:00lynaghk`it just wouldn't apply to the latest master---I just manually applied it and made a commit.
22:00dnolenlynaghk`: oh you haven't added yr patch to that ticket?
22:00lynaghk`I couldn't figure out how to
22:00dnolenlynaghk`: you can't construct a new patch?
22:01lynaghk`dnolen: I tried adding it to my comment. I'll add it to the toplevel issue
22:01dnolenlynaghk`: k.
22:01lynaghk`you want a patch for each commit or a single patch containing both Jackson's stuff plus my own cljs tweaks?
22:01dnolenlynaghk`: combined patch please, with commit message about what was done.
22:04lynaghk`dnolen: coming right up.
22:05dnolenlynaghk`:thx
22:08lynaghk`dnolen: added. Available on Github here too: https://github.com/lynaghk/core.match/commit/5738c25f3351444adb7af1074f53f0e519851f12
22:14dnolenlynaghk: alpha11 going out.
22:14lynaghk`dnolen: awesome, thanks David!
22:15lynaghk`dnolen: also, is there some trick to building/testing core.match? I always end up having to add clojure to the dependencies so that lein will run the tests.
22:18aqhi
22:18aqAnyone doing web dev?
22:19brehaut~anyone
22: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 ..."
22:19brehautbut yes
22:19brehautlots of people are doing web dev
22:20aqwell in genrael
22:20aqI got a offer
22:20aq;P
22:20dnolenlynaghk: for core.logic & core.match I test w/ mvn test
22:22lynaghk`dnolen: okay, thanks. I'll give that a shot next time
22:31cshellaq: what's your offer?
22:33aqwell my cousin is transferring out of her google office in New delhi
22:33aqshe knows Web advertising and all
22:33aqshes been to the uS before
22:33aqso yeah
22:34aqSHe knows Pay Per click and that stuff
22:34cshellso what's the offer?
22:34aqwell I can show you her
22:34aqand maybe she can help with something
22:34Kowboyyou are trying to get her a job?
22:35aqwell somewhat
22:35aqshe may quit google
22:35aqor she could stay
22:35aqcan we talk about it in PM Kowboy ?
22:35cshellwhy isn't she out marketing heself?
22:35cshellherself?
22:35aqeh well not sure why
22:35Kowboynot really, just trying to help you get to the point
22:35aqwell care if I show you her?
22:35cshellthat makes you sound like a sex spam bot
22:36aqwel im not ..
22:36KowboyI'm not in a position to hire anyone
22:36aqnothing is lewd..
22:37aqcan i show you guys..
22:37cshellWhy would we need to see her?
22:37aqwell her skills..
22:37cshellyou mean show us her resume?
22:37Kowboythis isn't going to be a link to goat.se is it?
22:37aqwell her Linkedin
22:37aqand no
22:37cshelldid goat.se come back? I haven't found it since it was goatse.cx
22:37Kowboysorry, it's been a long time, I think it's goatse.cx
22:38aqso may i show..
22:38aqIf you guys aren't comfortable then its fine
22:38cshellgoat.se seems to have apicture of some dude
22:39Kowboyaq: I don't want to waste your time. I'm really not interested
22:39aqok
22:39brehautcshell: i cant tell if you are brave or foolish
22:39cshelllol
22:40Kowboyin the meantime, do you have any questions about Clojure?
22:40aqyes
22:40aqwell
22:40aqwhats a good oS run it on
22:40cshell?
22:41Kowboyany that runs Java
22:41Kowboyso, all of them
22:41aqoh
22:41aqok
22:41Kowboyall the ones that matter, anyway
22:41aqthx
22:41emezeskeaq: Linux is a good OS to run it on.
22:42emezeskeaq: Or Mac.
22:42aqok
22:42aqWhat is Mac?
22:42aqI never heard of .
22:42casion...
22:42brehautits a type of burger
22:42aqok
22:42brehautthree pieces of bread, two meat patties
22:42uvtcbrehaut: or truck.
22:42aqI know Linux
22:42aqNo Mac
22:42cshellyou can get it with cheese
22:42aqI know Windows
22:42emezeskeaq: Far fewer people run clojure on Windows, so you are more likely to experience rough edges (in the tooling)
22:42aqok
22:42casionaq: where do you live?
22:42Kowboyisn't Linux a game where you kick penguins and try to score a field goal?
22:42aqBuhutan
22:43aqBhutan
22:43casionah ok
22:43Kowboywe should have taken bets on that before he answered
22:43Kowboywe would all have been wrong, though
22:43casionbe nice now, he's been polite and he's learning
22:43aqWhat is Mac
22:43cshellhis ip is from washington dc
22:44KowboyI'm not being rude, am I?
22:44cshellno, aq is trolling
22:44emezeskeI assume that aq is a troll now
22:44aqno
22:44aqJjust kidding :D
22:44aqI'll try Linux
22:44aq:)
22:44aqUbuntu is hella ugly now with Unity
22:44emezeskeaq: Welcome to my ignore list! *plonk*
22:44aqno
22:44aqSo how do I get started with clojure ?
22:45aqAny good books?
22:45Kowboysomeone from Bhutan using "hella"? I don't think so. ;-)
22:45casionsay I have a nested sequence, is there a simple way to drop the rightmost value?
22:45Kowboycasion: of the outer sequence?
22:45seancorfieldaq: i think http://www.clojurebook.com is the best books to get started with
22:45wkellyaq is clearly from the internets
22:45casionKowboy: regardless of the depth
22:45aqok
22:46gfrederickscasion: so you have to be able to identify non-sequences
22:46uvtccasion: if you want everything but the last item, it's `butlast`.
22:46Kowboyso if the last item is a sequence, traverse it and recur for that sequence
22:46Kowboy?
22:47Kowboyby value, you mean non-sequence, ie leaf
22:47casionyes
22:47cpineraHi all. Is there a way to specify what lein profile to use with clojure-jack-in?
22:47brehautsounds like a job for butlast and a recursive mapcat
22:47Kowboyseems like it would be a simple recursive function
22:47casionmy clojure terminology is still garbage
22:47Kowboythat's ok
22:48Kowboyso is mine ;-{
22:49casionI thought there maybe some way to do it without explicit recursion
22:49xeqicpinera: no, I've had to run swank seperately and M-x slime-connect to it
22:49Kowboycasion: why? the recursive way is the simplest and cleanest way in any functional language
22:50cpineraxeqi: That's what I was afraid of. Well, as long as it works. Thanks!
22:50casionKowboy: mostly curiosity...
22:50Kowboyyou want a function that does the recursion for you?
22:50gfredericksmuch more efficient if they're all vectors than seqs
22:50brehauti think its roughly (fn bl [x] (if (sequential? x) (mapcat bl (butlast x)) x)) ?
22:50brehaut(untested)
22:51casioneverytime I've figured out something with explicit recursion, I inevitably find there's a way to do it without
22:52casionso when I end up on something I _think_ requires explicit recursion, I've been in the habit of looking for another solution as a learning exercise
22:52Kowboyyeah, but there's the "clever" way and the straight forward way. I almost always prefer the latter.
22:52Kowboyare you talking about recur?
22:53casionany explicit recursion, either a recursive call or recur
22:54gfrederickscasion: what should it do with [[2 3] []]?
22:54Kowboyooh, nice edge case!
22:54Kowboyor [[2 3] [5]]
22:56gfrederickshttps://www.refheap.com/paste/4358
22:56gfredericksassuming we don't care about that edge case I think ^ that works
22:56casiongfredericks: It could return [[23]] or [2], either would work
22:56gfredericksat least according to how I misunderstood the problem
22:56gfrederickscasion: well in that case I have no idea what we're talking about anymore
22:56casioner [[2 3]]
22:56casionmissed a space
22:57gfredericksI maintain my previous statement
22:57uvtcAnyone know of a fancier pretty-printer than clojure.pprint/pprint? If I hand `pprint` a big nested data structure, it just prints it out to me in one line...
22:57gfredericksuvtc: because it's small?
22:57gfredericks(i.e., its on one line)
22:57uvtcMy data structure is being printed on one line. Ex.
22:58uvtc{:a 1 :b 2 :c [1 2 {:aa 11 :bb [44 55 66]}] :d "hello"}
22:58uvtcI'd expect that to be printed out on multiple lines, to make its structure more clear to the eye...
23:02uvtcHow long does it usually take until your membership to the clojure dev ML is no longer "pending"?
23:02gfredericksthat took a few days for me I think :/
23:02gfredericksI can't even remember how it became unpended
23:02gfredericksmaybe by yelping in IRC
23:03uvtcSome unpenderbot I suppose...
23:03gfredericks~unpend uvtc
23:03clojurebotCool story bro.
23:03amalloyuvtc: it adds newlines when it needs them to fit within its desired width
23:05uvtcgfredericks: we must refuse to be tempted to use Clojurebot for our own gain. With great power, ...
23:05metellus~responsibility
23:05clojurebotI don't understand.
23:06gfrederickshow do you specify a full reply to clojurebot?
23:06uvtcamalloy: thanks! I see that when push comes to shove, pprint breaks lines like pretzel sticks. :)
23:07uvtcClojurebot: how does one program clojurebot?
23:08uvtcor she.
23:10amalloygfredericks: i think you need <reply> to be enclosed by whitespace
23:11gfredericksclojurebot: responsibility is <reply> what's that?
23:11clojurebotI don't understand.
23:12gfredericks~botsmack
23:12clojurebotOwww!
23:12uvtc~botfight
23:12clojurebotbotfight is http://raek.se/botfight.html
23:13gfredericks~responsibility is <reply> what's that?
23:13clojurebotTitim gan ?ir? ort.
23:13gfredericks~responsibility
23:13clojurebotHuh?
23:13uvtcHuh?
23:14gfredericksclojurebot: pipes |are| for use like this
23:14clojurebotAck. Ack.
23:14uvtcI've seen |is| used with "forget".
23:14gfredericks~pipes
23:14clojurebotpipes are for use like this
23:15xeqiclojurebot: responsibility is <reply> what's that?
23:15clojurebotExcuse me?
23:15xeqiblah
23:15uvtc~responsibility is <reply> With great power comes something something.
23:15clojurebotIk begrijp
23:15uvtc~responsibility
23:15clojurebotWith great power comes something something.
23:15gfrederickswat
23:16cshellresponsibility
23:16cshellhow do you make it so it responds to normal questions?
23:16uvtcThat,
23:16uvtc...I don't know.
23:16gfredericksI don't think it will pick up on arbitrary conversation
23:16cshellShould I use recursion?
23:16amalloygfredericks: he can't parse if you put a ? in the answer
23:17gfredericksamalloy: ah HA
23:17uvtcclojurebot: forget responsibility |is| With great power comes something something.
23:17clojurebotI forgot that responsibility is With great power comes something something.
23:17gfredericksclojurebot: responsibility is <reply> what's that
23:17clojurebotIn Ordnung
23:17cshellOnce someone came in here and said, "I have a problem with recursion" and clojurebot said, "using recursion leaves you with two problems"
23:17uvtc~recursion
23:17clojurebotCool story bro.
23:17xeqi~regex
23:17clojurebotSometimes people have a problem, and decide to solve it with regular expressions. Now they have two problems.
23:17gfrederickscshell: I think it occasionally replies to thinks but only at random
23:18cshellah
23:18cshellregex
23:18cshell:)
23:18muhoohey, credit jwz for that
23:19cshellHow do I use regex?
23:19cshellI have a problem with regex
23:19cshellyeah, must be random
23:20amalloyregex?
23:20clojurebotSometimes people have a problem, and decide to solve it with regular expressions. Now they have two problems.
23:20gfredericksoh also that one-word-question thing
23:20gfredericksgfredericks?
23:20cshellresponsibility?
23:20clojurebotwhat's that
23:21metellus~responsibility
23:21uvtcwat?
23:21clojurebotWith great power comes something something.
23:21clojurebotFor Jswat: start clojure with -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8888
23:21amalloyamalloy?
23:21clojurebotamalloy is <amalloy> just use juxt, it'll be great
23:21uvtcOh, I thought I told it to forget that.
23:21cshellcshell?
23:22gfredericksclojurebot: cshell is <reply> I don't know anything about cshell.
23:22clojurebotIn Ordnung
23:22cshelllol, thanks gfredericks :)
23:22clojurebotRickInGA: Thanks; the queue is empty now, though I'm sure it'll fill up at ClojureWest again.
23:22cshellcshell?
23:22clojurebotI don't know anything about cshell.
23:24cshellWhat triggered the RickInGA response?
23:25uvtcclojurebot is a riddle, wrapped in an enigma, then dipped in secret sauce.