#clojure logs

2013-02-07

00:17DeeceSorry if this is OT for #clojure, but I read on the google group a while ago the mention of a new-ish (>2009?) lisp unrelated to Clojure. it had pattern matching. it was called something er, vaguely "buddhist"-sounding?
00:18DeeceWondering if it rings a bell for anyone.
00:19technomancythere's Qi, which is a lisp with interesting ideas about static types and a horrible license
00:19technomancyor Shen rather
00:19alisdairjoxa or lfe? the erlang lisps? they have pattern matching
00:21Deecetechnomancy: it was Shen, thank you. The shen license looks.. weird, but not too bad.
00:23technomancydepends what you're going to use it for I guess
00:24technomancynot the kind of thing I'd invest a lot of time in if someone else is going to tell me what I can use it for
00:30shaunxcodewhat uses does the license prohibit?
00:35technomancydistributing anything based on Shen which doesn't pass the spec
00:35technomancyamong other things
00:35technomancykinda similar to the way oracle restricts openjdk forks with the compatibility kit
00:36Guest76208isnt that a good thing? J++?
00:37amalloyask apache about harmony
00:37tmcivertechnomancy: it doesn't sound too restrictive if you're only creating apps with it: "the code you write which rides on the top of our code is not bound by our license, this is yours."
00:38technomancyGuest76208: in the case of Oracle it's very bad, since they don't let you even have the compatibility kit unless you're their pal
00:39shaunxcodeI think the most interesting thing about shen is KL, I have been waiting to see if anyone else uses it as a target for other lisps (or languages in general)
00:39technomancyGuest76208: in the case of Shen, it's bad because they won't even let you base your work on it if you change the name. it's not like they're just out to avoid confusion or anything.
00:40technomancyif you read the reasoning behind the license, you can tell he's just bitter about his inability to make a living from the software he's written
00:40technomancyOracle's is worse because if you get on their bad side they've got a big pile of patents they'll use against you, of course. Shen is just silly.
00:41technomancy(silly about compatibility)
00:42shaunxcodeyeah the notion of anything beside MIT licensing just seems odd to me but I'm a simple kind of guy
00:42shaunxcode(for open source/languages that is)
00:42technomancyugh; MIT's a bit of a mess when it comes to patents though
00:42technomancysomeone can submit a patch to your MIT-licensed codebase, get bought by oracle, and then sue your pants off
00:43technomancymost licenses longer than a page avoid that
00:44shaunxcodehah really? I guess I should pay more attention - is their a case where something like that has happened?
00:45technomancynot sure if it's happened with MIT specifically, but it has no patent provisions at all, which is foolish for anything high-profile.
00:47amalloydoes anyone know if every contrib requires patches come exclusively through jira? ISTR rich saying at some point that as long as you only take patches from people with CAs you're okay
00:48amalloyi ask because i have some small fixes to tools.reader and don't fancy sticking my hand into the jira bag of scorpions
00:57shaunxcodeanyone have thoughts on how to pretty print a map with a literal tag in it e.g. for creating datomic schemas programatically? I have a quaint work around, but now I am intrigued as to how you can do it
01:04callenbotyogthos: next time you're around, I have some potential additions/improvements to Luminus to discuss.
01:04callenbotyogthos: I'd just do a PR, but I'd rather discuss them with you first
01:18fsvehlaI have a deconstructuring question, is it possible to get a map with {key, (the-vector 1), other-key (the-vector 2), ... from a vector?
01:18Ember-the-vector meaning element at index x?
01:18fsvehlaI currently use { :host (fields 0) :timestamp (fields 1) :url (fields 2) ...
01:19fsvehlaEmber-: Yes
01:19fsvehlaOf course starting with 0
01:20fsvehlaI was looking over the destructuring examples of jay fields, but I don’t actually think that’s possible...
01:20amalloy(zipmap [:host :timestamp] v)
01:21fsvehlaActually I think locals following the let form would be even nicer
01:21fsvehlazipmap, thanks
01:22Ember-I'm not sure if that's possible via destructing
01:22Ember-it's a one liner otherwise though
01:24Ember-,(map-indexed hash-map ["a" "b" "c" "d"])
01:24clojurebot({0 "a"} {1 "b"} {2 "c"} {3 "d"})
01:24Ember-wasn't that what you wanted?
01:24Ember-no it was not
01:24Ember-almost!
01:26fsvehlaThe zipmap solution works to return a map with the specified keys :)
01:27fsvehlaI just wasn’t sure if that isn’t possible via destructing, because it is a kind-a obvious feature
01:33amalloyfsvehla: nonsense. destructuring isn't for building objects, it's for tearing them apart. and you asked to build a map
02:09durka42what on earth does that mean
02:09durka42"PLASMA warning: plasma_init(): PLASMA re-initialized"
02:09durka42(using incanter)
04:03AtKaaZhas anyone found a solution for this or is it impossible? &(#(var %) prn)
04:03AtKaaZ&(#(var %) prn)
04:03lazybotjava.lang.RuntimeException: Unable to resolve var: p1__12841# in this context
04:04AtKaaZ&(#(var-get %) prn)
04:04lazybotjava.lang.ClassCastException: clojure.core$prn cannot be cast to clojure.lang.Var
04:04durka42wait what are you trying to do
04:05Sgeovar-get should be a function like any other
04:05AtKaaZto be able to give a symbol to a function and get the var, if that even makes sense
04:05Sgeoresolve?
04:05clojurebotUnable to resolve symbol: pst-elem-str is you have an old version of clj-stacktrace somewhere. see the Troubleshooting section of the swank-clojure readme.
04:05Sgeo(doc resolve)
04:05clojurebot"([sym] [env sym]); same as (ns-resolve *ns* symbol) or (ns-resolve *ns* &env symbol)"
04:05Sgeo(resolve 'resolve)
04:05Sgeo,(resolve 'resolve)
04:05clojurebot#'clojure.core/resolve
04:05AtKaaZsomething like: (fn [func] (add-hook func #'incTimes_hook))
04:06durka42,(class #'prn)
04:06clojurebotclojure.lang.Var
04:07AtKaaZwhere func needs to be a var
04:07AtKaaZbut I don't want to pass a var, I want to pass a symbol
04:07SgeoAtKaaZ, what's wrong with resolve?
04:07AtKaaZSgeo, don't know how to use it in this context
04:07SgeoIf what you're doing is even sensible, which I don't know
04:08SgeoPass it a symbol, it finds the var that would be named by the symbol in the current namespace
04:08AtKaaZoh it has to be quoted, wait
04:11AtKaaZ&(#(resolve (quote %)) prn)
04:11lazybotjava.lang.SecurityException: You tripped the alarm! resolve is bad!
04:11AtKaaZi don't know how:)
04:13AtKaaZmaybe from a macro, trying...
04:14durka42you'll need a macro, by the time #(resolve (quote %)) gets prn it has already been resolved into #'clojure.core/prn
04:14durka42,'(prn)
04:14clojurebot(prn)
04:14durka42hmm, maybe not?
04:15AtKaaZmy problem is, I think, that it's passing p1__9968# to the macro, by I want its value instead
04:16AtKaaZso instead of p1__9968# it would pass prn
04:16AtKaaZi wish
04:19AtKaaZin other words, I want the symbol which was passed to the anon function, but I can't unless the function is a macro, i see
04:20AtKaaZie. (xx prn) when xx is a macro will get me prn inside the macro, but (#(xx %) prn) will never get me "prn" but only things like p1__13332# or #<core$prn clojure.core$prn@741854be>
04:23AtKaaZunless there's a way to get "#<core$prn clojure.core$prn@741854be>" to "prn" ?
04:23AtKaaZ,prn
04:23clojurebot#<core$prn clojure.core$prn@37f8ff58>
04:24AtKaaZthat's one way, but I want the opposite way
04:29AtKaaZok, I got what I wanted for, thanks , if anyone cares it's this: https://github.com/DeMLinkS/demlinks/blob/92379ca7f955033d18a3b8eec677ce1cc1e7db25/src/runtime/q.clj#L673
04:31AtKaaZ(ignore that :pre btw xD)
04:37AtKaaZright that makes sense why you can't resolve backwards from #<core$prn clojure.core$prn@37f8ff58> to prn because more than one symbol maybe be associated with that #<core$prn clojure.core$prn@37f8ff58>
04:40OscarZ_if i want to define a function with multiple arities, do I have to use defn or is it possible with just fn ?
04:53AtKaaZOscarZ_: you can use fn
04:53nonubyi dissoc a key from a map and save that into mongo via monger, mongodb has the document with the key set to null, is there an alternative to dissoc
04:56nonubyignore i was doing something stupid
04:58nonubycan i use update-in to update multiple keys
05:40lpetitHello there
05:40cemerickhi :-)
05:40lpetitWhat is the best available library for file manipulation / folder creation, etc., etc. over there ? (beyond plain use of java API)
05:40lpetitcemerick: you're everywhere :-)
05:41cemerickmaybe Raynes' fs lib?
05:41cemerickI've never used it
05:41lpetitor maybe just plain old apache commons io ?
05:49ejacksonlpetit: I've been using Raynes' fs
05:49ejacksonits good
05:50lpetitejackson: thanks for the feedback. And I also see that it has apache commons compress as a dependency, so hopefully it will provide me with not so low level APIs for e.g. unzipping files
06:13pepijndevosIf the default lein template includes a .gitignore, why doesn;t it come with the git repo right away?
06:13durka42you might be like me and create the lein project inside a larger extant git repo
06:17pepijndevoshm
06:20pepijndevosI like the idea of drip, but it doesn't seem to help me much. lein repl still takes several seconds to start.
06:21pepijndevosIn fact, there is not decernible difference on either my mac or linux laptop. drip ps does show a ton of vms running. I don't get it.
06:30the-kennypepijndevos: I remember problems with drip & lein2
06:30pepijndevosew
06:30the-kennylein2 used some caches which changed the command line of the JVM so drip couldn't cache
06:30the-kennydunno if that was fixed
06:31pepijndevosoh, it says you need to build it yourself
06:31pepijndevosall the way down: https://github.com/flatland/drip/wiki/Clojure
06:31pepijndevosoh, the other way around
06:31pepijndevosyou need to build leiningen
06:32clgvpepijndevos: well latest snapshot after preview 10 should be included in 2.0.0
06:33aroemerspepijndevos: Also make sure you have the latest version of drip. With some earlier version, drip had a bug that it did not reuse any spawned VM.
06:34pepijndevosbottom line: version hell
06:39pepijndevosoh, I have lein 2.0.0--SNAPSHOT, and a pretty old one at that, I guess
06:39pepijndevos$ lein upgrade
06:39pepijndevosThe upgrade task is only meant for stable releases.
06:51clgvpepijndevos: install leiningen manually
07:01pepijndevoshm, the brew seems to be cray broken
07:01pepijndevosstable is 1.7, devel is 2.0.0 and HEAD is 2.1.0-SNAPSHOT, which is not on S3.
07:09AtKaaZis there some testbed that causes my function f that I pass to swap! to be call more than once? i need to test that somehow and see what happens
07:09pepijndevosgrrr, I'm now on a checkout version of drip and the latest leiningen that I can get. Nothing
07:10AtKaaZpepijndevos: is that lein from github master branch?
07:11pepijndevosAtKaaZ: no, just 2.0.0 :(
07:12pepijndevosthere is no such thing as 2.1.0-SNAPSHOT on amazon
07:12AtKaaZno idea how that works, I take it you can't compile it there?
07:13AtKaaZ~logs
07:13clojurebotlogs is http://clojure-log.n01se.net/
07:13pepijndevosI suppose I can. I don;t know. It refers to a nonexsistant hacking section of the readme
07:14clgvpepijndevos: lein 2.0.0 is stable
07:14AtKaaZmaybe you wanted this: https://github.com/technomancy/leiningen/blob/master/CONTRIBUTING.md#bootstrapping
07:17pepijndevosclgv: so do I need master for drip?
07:18clgvpepijndevos: take that on: https://raw.github.com/technomancy/leiningen/stable/bin/lein
07:18pepijndevosclgv: that is what I have
07:19clgvpepijndevos: if that does not work you then maybe something for drip was broken again in 2.0.0
07:20pepijndevosI'm going to try lein trampoline, that always fixes stuf… oh, no, maybe not
07:21AtKaaZif anyone cares, on win7 this is what I use to build leiningen from master https://gist.github.com/AtKaaZ/4730559
07:27wunkihow would I get the metadata of a namespace. `(meta *ns*) keeps returning `nil`
07:27AtKaaZ,(meta (var *ns*))
07:27clojurebot{:ns #<Namespace clojure.core>, :name *ns*, :added "1.0", :doc "A clojure.lang.Namespace object representing the current namespace.", :tag clojure.lang.Namespace}
07:28AtKaaZthat's not it xD
07:29wunkiAtKaaZ: nope :(
07:33clgvtry ##(meta (the-ns 'clojure.set))
07:33lazybotjava.lang.SecurityException: You tripped the alarm! the-ns is bad!
07:36pepijndevos<inappropriate terms> I'm now running checkout versioins of both drip and leiningen. Still takes like ten seconds to do lein repl, while having a dozen jvms running, each consuming over 50MB of RAM
07:39AtKaaZwunki: that actually works if the ns has meta, (meta *ns*)
07:40AtKaaZwunki: like https://www.refheap.com/paste/10994
07:40wunkiAtKaaZ: I think I found my problem, maybe the `ns` doesn't get recompiled in Emacs. A fresh `lein run` seems to find the meta now
07:41AtKaaZwunki: yes I had to restart my ccw repl also
07:44wunkiAtKaaZ: thanks for checking it out
07:45AtKaaZwunki: np, I enjoyed it
07:46pepijndevoswut, where did my Java prefs go in OS X 10.8?
07:47pepijndevosuh, found it.. It's in system prefs, but it's not
07:51pepijndevoswut, no more java 6 I guess
07:53pepijndevosor, just chaos. I can no longer select the version, like I could in the utilities java thing. the prefs say 7, the terminal says 1.6
07:57pepijndevoshttp://reviews.cnet.com/8301-13727_7-57533880-263/java-preferences-missing-after-latest-os-x-java-update/
08:35TimMcI wonder if core.logic could be used to solve this puzzle: http://www.coinheist.com/rubik/a_regular_crossword/grid.pdf (PDF warning)
08:39clgvTimMc: hmm you would have to normalize it I think
08:40clgvTimMc: you can use the regexps as predicates but you have to determine the domains for the fields
08:45clgvTimMc: but a real unification would be difficult I guess
08:49progodid some of the clojure books have a venn diagram of clojure's essential sections I could use in a presentation?
08:50hyPiRionprogo: Essential sections?
08:51hyPiRionhttp://clojure.com/ has a diagram with focus, empowerment and simplicity.
08:51abpOh, great: https://codeq.io/
08:52progohyPiRion: like that but less enterprisey, and in a book that has better authority in citations :P
08:54noidiprogo, the joy of clojure has one
08:54noidion page 4
08:55progonoidi, great. I was just at page 16 walking backwards :D
08:56noidi:D
09:22octagonhello, does anyone know of a document that describes how the case* special form works? i see it in the macroexpansion for case, but it's very confusing and the java code is sort of without comments
09:24octagonhttps://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L8362 <-- that is the java implementation
09:26octagonhttps://gist.github.com/micha/4731233 <-- macro expansion of a case expr
09:34luxbockis there a way to auto-load some code when nrepl starts itself in Emacs?
09:35luxbockfor example I would like to have Pomegranate loaded everytime by default in case I need to install any new libraries
09:44@rhickeyWhen we support #bin"base64" - which base64 and why? http://en.wikipedia.org/wiki/Base64
09:45`fogusoh my... I had no idea that there were so many choices.
09:48@rhickeyhttp://tools.ietf.org/html/rfc4648 ?
09:48@rhickeyIs there a Java lib that does rfc4648?
09:49hyPiRion$google java rfc4648
09:49lazybot[RFC4648 - jinahya - RFC-4648 Implementation. - Jinahya's Java ...] http://code.google.com/p/jinahya/wiki/RFC4648
09:55stuartsierraApache Commons Codec is probably the most commonly-used Java lib, it claims to comply with RFC 2045.
09:55jkkramerother std libs: ruby - rfc 2045, python - rfc 3548, php - rfc 2045
09:55@rhickeystuartsierra: yeah, but http://www.ietf.org/rfc/rfc2045.txt looks gross
09:55jeremyheilerwhat does data.codec implement?
09:56aroemersrhickey: whatever the choice, I am happy to see #bin will become part of edn. :)
10:00@rhickeyI like filename/url compatible and no fixed line lengths
10:00clgvssh seems to use RFC2045 for keyfiles
10:00@rhickeyno fix/max
10:00TimMcrhickey: Strong preference for +/
10:01@rhickeyTimMc: because?
10:01TimMcIt's the original, so basically every base64 tool I've seen uses it.
10:02TimMcThe URL/Filename stuff is just... I don't know, a special transport-dependent encoding.
10:02@rhickeyand yet, most newer ones don't, for good reasons
10:02@rhickeytransport-dependent? transport compatible
10:02TimMcSure.
10:03TimMcCould you support both? It doesn't look ambiguous.
10:03TimMcOne danger is that you would misread (say) _- variants instead of rejecting them.
10:04TimMc(because it uses the same alphabet as -_)
10:04hyPiRionWouldn't it be smarter to use the standard used by most other languages? As long sound implementations of the standard exists, it will be both easier and simpler to extend/implement EDN on those platforms then. Unless there's significant issues with the most popular, I don't see a reason why this should be a discussion.
10:04@rhickeyhyPiRion: "I don't see a reason why this should be a discussion." - then don't participate
10:04TimMcThat's rude.
10:05@rhickeyI don't see a reason why this should be a discussion. is rude
10:05TimMcI think he's asking you to justify the bikeshedding.
10:05@rhickeyI think the existence of the variants demonstrates the bikeshedding is not due to me
10:06TimMcYou expressed a preference for filename/URL compatible variants -- why?
10:06pepijndevostechnomancy: ping
10:07hyPiRionrhickey: You lost the head of that sentence. What I meant was that if there's minor differences between the characters used, then use the most popular one.
10:07hyPiRionDisclaimer: I have no knowledge on base64.
10:15aroemersOne could always add a #my/rfc2045 data reader oneself of course, if the default is not to one's liking.
10:16TimMc#base64-_
10:16TimMc(not entirely serious)
10:17TimMc,(javax.xml.bind.DatatypeConverter/printBase64Binary (.getBytes "k\ueff3"))
10:17clojurebot"a+6/sw=="
10:23pepijndevosIs (:require :refer) the same as (:use :only) ?
10:28saolsenpepijndevos: yep, and :refer :all would be the same as just :use
10:29pepijndevosI was hoping I could use slamhound to develop with :use and publish with :only/refer
10:29pepijndevosThat way, a reader knows where everything comes from, and I don't have to spell it out
10:30hyPiRion(:require [foo :refer [bar]]) would make it possible to use foo/baz as well
10:35gfrederickswhat's a use case for evaling IFns? i.e., why does (eval (list + 1 2 3)) work?
10:36nDuffgfredericks: Sorry? (list + 1 2 3) is just a PersistentList, not an IFn.
10:36danielglauserhyPiRion: How so? Just tried at the repl, if I :refer [bar] I can't access anything else from foo besides bar
10:37hyPiRiondanielglauser: what?
10:37hyPiRion,(require '[clojure.pprint :refer [cl-format]))
10:37clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: )>
10:37hyPiRion,(require '[clojure.pprint :refer [cl-format]])
10:37clojurebotnil
10:38hyPiRion,(cl-format true "~R" 150)
10:38clojurebotone hundred fifty
10:38hyPiRion,(clojure.pprint/pprint {:a 1 :b nil})
10:38clojurebot{:a 1, :b nil}\n
10:38danielglauserhyPiRion: Got it, didn't realize you were talking about using the fully qualified namespace
10:39hyPiRionoh
10:39Sgeohttp://ideone.com/O0LqJy
10:39SgeoHuh. That's simpler than I expected
10:41gfredericksnDuff: yes but + is an IFn, and it's not quoted
10:41clgvSgeo: what?
10:41Sgeoclgv, using deftype to store data
10:41Sgeo(I need it to be a type to distinguish from other kinds of data)
10:42clgvSgeo: you can also use maps with :type metadata for that ^^
10:42SgeoI'm just writing a version of trampoline which requires the loop to be ended with (done blah) rather than just blah, meaning functions can be returned
10:42SgeoIt's for my blog post
10:42clgv&(type (with-meta {:a 1} {:type :blubb-type}))
10:42lazybot⇒ :blubb-type
10:43SgeoThat argues that that sort of thinking is a good thing
10:43nDuffgfredericks: eval would be confusing to use if it didn't behave that way. Would you _really_ want to force folks to pass '+ instead of +?
10:45SgeoIFns functioness is only meaningful at the beginning of a list (or when something calls it, say, if you're passing it in to a higher order function)
10:45hyPiRionWell..
10:45Sgeo(+ 1 2 3) this, as a list, sees + at the beginning is an IFn, so evaluates it
10:45clojurebot#<RuntimeException java.lang.RuntimeException: java.lang.NumberFormatException: For input string: "+">
10:45Sgeo..?
10:45Sgeo(+ 1 2 3)
10:45clojurebot*suffusion of yellow*
10:45hyPiRionSgeo: no, that resolves the symbol
10:45hyPiRion,('+ 1 2)
10:45clojurebot2
10:45clgv(+ 1 2 3),
10:45clojurebot*suffusion of yellow*
10:45clgvoops
10:46clgv,(+ 1 2 3)
10:46clojurebot6
10:46hyPiRion(eval (list 'foo 1 2)) returns "unable to resolve symbol: foo in this context"
10:46SgeoWell, yeah, symbols get resolved first
10:46hyPiRionWhereas double-quoting it resolves that issue
10:47SgeoWhat's the problem exactly?
10:47hyPiRionSgeo: I have no issue with it, really. Behaves as I expect.
10:47SgeoSomeone seemed like they were having an issue?
10:47SgeoDon't mind me, I'm tired
10:48SgeoAnd forcing myself to stay awake so I can stop sleeping in the middle of the day
10:48hyPiRionSgeo: yeah, gfredericks mentioned something I didn't quite grasp
10:49Sgeo<gfredericks> what's a use case for evaling IFns? i.e., why does (eval (list + 1 2 3)) work?
10:49Sgeogfredericks, all Clojure code is data
10:50SgeoFirst it's read in, which turns "(+ 1 2 3)" for example into a list containing a symbol +, a number 1, a number 2, a number 3
10:50SgeoThen that list is evaluated
10:50Sgeo(Or whatever the result of reading it is)
10:50Sgeo,(read "(+ 1 2 3)")
10:50clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.io.PushbackReader>
10:50Sgeo:(
10:50Sgeo(doc read)
10:50clojurebot"([] [stream] [stream eof-error? eof-value] [stream eof-error? eof-value recursive?]); Reads the next object from stream, which must be an instance of java.io.PushbackReader or some derivee. stream defaults to the current value of *in* ."
10:50hyPiRionread-string
10:50Sgeo,(read-string "(+ 1 2 3)")
10:50clojurebot(+ 1 2 3)
10:51SgeoThat + is a symbol, which then gets resolved, in this case, to a function
10:51hyPiRionOoh. But (list + 1 2 3) doesn't do that. It resolves + into the function plus.
10:51the-kenny,(list + 1 2 3)
10:51clojurebot(#<core$_PLUS_ clojure.core$_PLUS_@463bb30a> 1 2 3)
10:51SgeoAh, so, in that case, eval is seeing the function object directly, rather than the symbol
10:52the-kenny,(#<core$_PLUS_ clojure.core$_PLUS_@463bb30a> 2 3 4)
10:52clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unreadable form>
10:52SgeoWell, that's part of what evaluation means
10:52SgeoEvaluation on a symbol resolves the symbol and evaluates the result
10:52SgeoErm, wait, it... hmm
10:53SgeoSo resolving is not theoretically a separate step from evaluation, it's what it means to evaluate a symbol
10:53Sgeoalthough, hmm. (list 'quote 'foo) gets evaluated to foo but the foo symbol doesn't get evaluated
10:54SgeoI guess quote says "don't evaluate this" and symbols say "go ahead and evaluate the result"
10:54hyPiRionSgeo: I think it's because functions are values.
10:55SgeoIt bothers me though that Clojure doesn't accept arbitrary objects in forms
10:55hyPiRion(= (eval 1) (eval '(quote 1))), same applies for functions
10:56hyPiRionA value resolves to itself, whereas a symbol doesn't.
10:56Sgeo(def foo 'foo)?
10:57ivaraasenhyPiRion: ever tried test.generative BTW?
10:57SgeoI think there's some sort of phases mechanism that I'm forgetting about
10:58SgeoOr... not quite phases
10:58hyPiRionSgeo: You meanie. A symbol resolves to the value it refers to in the context it is evaluated in.
10:58hyPiRionivaraasen: Not generative, I'm afraid
10:58hyPiRionjust tesrt
10:58hyPiRion*test
10:59ivaraasenhyPiRion: pretty sweet stuff. using it to test array-utils.
10:59hyPiRionivaraasen: What is its use case?
10:59hyPiRionDoes it generate data to work with?
10:59hyPiRion/s/work/test/
11:00clgvhyPiRion: there are two steps: resolve and var-get (or calling the symbol)
11:00clgvI meant: *the var
11:00ivaraasenhyPiRion: yeah, in my case it just generates tons of different long-arrays and double-arrays to test the rigidity of the exposed API
11:01Sgeo...I forgot about vars
11:01ivaraasenso things that shouldn't be mutated aren't mutated, et cetera.
11:01Sgeoderpderpderpderpderpderp
11:01hyPiRionivaraasen: Oh, that sounds valuable.
11:01hyPiRionAt least for some stuff.
11:02ivaraasenhyPiRion: discovered a bug in afill! (and afill-bounded!) thanks to this, actually.
11:14gtrakanyone have a working phonegap/android clojurescript repl or know of a technical reason why it wouldn't work? (eg, does phonegap or android disallow eval or something weird like that?)
11:16matthavenergtrak: its my understanding that android doesn't preclude clojure, but the gc pressure is a little high for the dalvik jvm
11:16gtrakah, yes, that's why I'm considering clojurescript as an alternative. Real clojure would be nice, but impractical.
11:17cemerickgtrak: clojurescript does not have eval, unless you're talking about kanaka's fork
11:17gtrakI see a bunch of getting-started things, but no browser-repls on google
11:18gtrakcemerick: 'eval' in the sense of browser-repl, doesn't it rely on JS eval?
11:18cemerickno
11:18gtrakah
11:18cemerickThe ClojureScript compiler is implemented in Clojure.
11:18gtrakI get that, I'm talking about the browser repl
11:18gtrakit somehow sends forms over the wire and runs them
11:19cemerickThe browser-repl is just a different runtime environment for cljs; it still needs a cljs compiler.
11:19pimeysbtw. let's build a browser with llvm support :)
11:19gtrakyes, I have the cljs compiler part working :-)
11:19pimeysjust came to my mind while I'm writing javascript here again :(
11:19gtraknot the browser-repl part (works locally, not on phonegap)
11:20alexnixonhow is Clojure (the language itself) built and deployed? Does it come from a CI machine or is it built and pushed manually on someone (rhickey's?) personal machine?
11:20cemerickgtrak: You might want to check out kanaka's fork, he's been working on it for quite a while now (and perhaps using it in real stuff?)
11:20gtrakie, I've compiled a cljs file into javascript that *should* connect to lein trampoline cljsbuild repl-listen, but silently breaks
11:21cemerickalexnixon: see http://build.clojure.org
11:21cemerickgtrak: Whatever the issue there, you'll still need a Clojure runtime to compile cljs to drive a browser-repl.
11:22gtrakthat's what lein-cljs repl-listen does
11:25alexnixoncemerick: thanks for that - just trying to figure out the best way of managing build/releases internally
11:26cemerickgtrak: oooh, you just want to run browser-REPL with cljs running on android, not have a self-hosted cljs
11:26gtrakyes! :-)
11:26cemerickThe joys of short-form textual communication.
11:27cemerickgtrak: silent failure might sound like you're violating the same-origin policy
11:27gtrakah, I was just thinking it could be a security policy
11:28gtrakthe android emulator has a hook for 10.0.2.2 to refer to the host IP, that's what address I'm trying to connect to
11:28gtrakwhen every other cljs example I've seen is localhost, (won't work in this case)
11:29cemerickgtrak: If you can get the same file to work when loaded from localhost (*not* file:/), then yeah, you're running into a phonegap/network/browser security restriction.
11:29cemerickYou can't just throw a random URL into your browser repl connection call
11:29gtrakthat makes sense
11:29cemerickit has to be the same host as where the cljs was loaded from
11:30gtrakI will hack it :-)
11:37gtrakcemerick: looks like the browser-repl indeed uses js eval? just curious now: (js* "eval(~{block})"))
11:39gtrakalong with some crazy string interpolation macro trick
11:40gfredericksSgeo: hyPiRion: I just noticed the long conversation I spawned; was there any resolution?
11:40cemerickgtrak: oh, cljs does use js eval, but not in service of compiling cljs->js
11:41cemerickwhich is what I thought you meant
11:42gtrakah, yea, no. cljs-eval js-eval browser-repl-eval clojure closure google-closure, I think we need some more ambiguity :-)
11:42SgeoMy own personal conclusion is that I need more sleep.
11:46pepijndevosAny carmine users around? I'm confused about how it does pipelining. Am i correct that any command ran inside a car/with-conn actually returns nil and only returns the result at the end?
11:47alexnixoncemerick: with the Clojure release process, what is to prevent a sneaky commit being pushed by someone in the second before rhickey clicks the "release" button in Jenkins? Is it safe because rhickey is the only guy with push-to-master privileges?
11:48cemerickalexnixon: AFAIK, only he and Stuart Halloway have commit. That might be outdated info, but it's a very limited set in any case.
11:50alexnixoncemerick: thanks for the info - that sounds plausible
11:51Chousukestuff like that is probably the main reason I like git
11:51Chousukeeveryone has commit access, so you only need to decide whose collection of commits you like best
11:52alexnixongit definitely makes a bunch of different workflows possible
11:52alexnixonit's just tricky finding the "right" one for the situation
11:52ChousukeI find working with svn so awkward because I can't save my code before I'm ready to publish it :/
11:53Chousukefortunately git-svn exists
11:54Chousukethough I've found that often I end up with a bunch of crappy commits and then svn dcommit them all. :P
11:56Chousukethat's still marginally better than having a huge bunch of code uncommitted in the working copy, however
11:59ChousukeAnd I tend to use branches so often that I find it hard to imagine working without them :P
11:59gfredericksI can't imagine not viewing a git repo as a graph
12:00Chousukethat's what it is
12:00gfredericksyes I mean for looking at it visually
12:00gfredericksthe default format of `git log` seems so worthless
12:00ChousukeI mostly use git log -p
12:01Chousuketo review changes
12:01gfredericksI use git log --graph --all --format=\"%h[%t] %d %an--%s\"
12:02gfredericksthose backslashes are probably unhelpful
12:02Chousukebranches make everything so carefree in git
12:02gfredericksmy favorite is debugging by creating a `wtf` branch and deleting half of the code at a time until the error is isolated
12:02nDuffthey're certainly unhelpful.
12:02Chousukehave a cool new idea? branch. need to fix something? branch. hard merge/rebase? branch
12:03nDuffUse the slashes like that and the shell will string-split the contents
12:03gfredericksnDuff: I needed them in the .gitconfig as an alias
12:03nDuffso your command becomes: git log --graph --all '--format="%h[%t]' '%d' '%an--%s"'
12:03nDuffAhh.
12:04Chousukethe way I usually do rebases is branch -> rebase -i -> ff merge to original. sometimes with several branching steps
12:05Chousukeso I end up for foo-rebase-1 through 10
12:05Chousukethe amusing part is that you don't even have to do that manually since git keeps all the information in the reflog anyway
12:06Chousukebut somehow it still helps
12:08technomancypepijndevos: hi
12:10pepijndevostechnomancy: I was playing with slamhound, hoping it would allow me to turn (:use) clauses to (:require :refer) ones. So far, it just crashes
12:10technomancyoh, that's a drag
12:10pepijndevoswhat do you mean?
12:11technomancyoh, just that it's unfortunate
12:11pepijndevosoh
12:11nDuffHeh; the joys of using slang on an international forum
12:11pepijndevosMy use case is that when reading code, I like to see where stuff comes from, but when I write code, I don't want to specify every little function.
12:12pepijndevostechnomancy: is that something slamhound could do, if I got it to work?
12:12technomancypepijndevos: oh yeah, definitely
12:12pepijndevoscool
12:13hammer__if i'm looking at a seq and want to compare an element to its previous element
12:13hammer__how do i do that sort of comprehension?
12:13pepijndevosFailed to reconstruct: #<File src/asky/core.clj>
12:13pepijndevosjava.lang.RuntimeException: Unable to resolve symbol: == in this context, compiling:(NO_SOURCE_PATH:1:139)
12:13technomancypepijndevos: ok, yeah the regex for exceptions needs tweaking
12:13rasmustohammer__: partition might be of use
12:14pepijndevostechnomancy: what does that mean?
12:14technomancyshouldn't be too tricky; I think it assumes missing vars are going to be compliant with the symbol name restrictions on clojure.org
12:14hammer__oh that's exactly what i was look for, thanks rasmusto
12:14hammer__(inc rasmusto)
12:14lazybot⇒ 1
12:14technomancypepijndevos: this explains how slamhound works: http://technomancy.us/148
12:15pepijndevosok, will read
12:15technomancybasically it looks at the message for each exception to see what var is missing
12:15rasmustohammer__: (partition 2 1 someseq) is something I use a lot
12:15technomancyso it can search for it and add it into the candidate ns
12:15technomancyso it's just a matter of tweaking the regex
12:15pepijndevosah, nice. So all the 2 namespaces I tried must have defeaten the regex in some way
12:16pepijndevosfor the other one it says: nth not supported on this type: Symbol
12:16technomancythat's the thing about regexes... they never cover all the possibilities
12:16craigbrohmm
12:17craigbrocore.logic issue
12:17craigbroif I do (run N ...
12:17craigbrowill it repeat results into I get N?
12:17pepijndevoscraigbro: no
12:17hiredmanI don't think so
12:18maioOT: native english speakers - is it possible to say word raweri? :)
12:18craigbrohmm
12:18hiredmanbut depending on your program you can have duplicate results
12:18pepijndevos&(#(println %&) 1 2 3)
12:18lazybot⇒ (1 2 3) nil
12:18nDuffmaio: I don't know -- it's hard to know how it should be pronounced from only seeing it spelled. :)
12:18pepijndevosMy new favourite syntax
12:21desertmonadChousuke: I'm still a bit of a git novice. At work SVN is mandated, but I am able to use git-svn. Do you know of a work flow that would let me git clone a repository that was created by git-svn?
12:22desertmonadI can do the clone, of course, but git svn dcommit rebases to change the log messages (afaik)
12:22Chousukehmm, yeah
12:22desertmonadand so the git clone diverges
12:22gfredericksmaio: depends on what you mean by "possible" I guess; looks like pronounced "rah WHERE ee"
12:23gfredericksbut definitely looks foreign
12:23Chousukedesertmonad: probably easiest to have two separate git-svn clones and just work with them treating them as two SVN committers (with occasional sending of patches back and forth)
12:23nDuff(though it does so only because bzr changed their backend to accomodate better SVN interop)
12:23nDuffs/only//
12:25desertmonadYeah, I've thought about doing that. My goal is to not publish to SVN if I'm in the middle of tweaking something… best I've come up with is using rsync, which is less than ideal.
12:26gfrederickshas using println with a lazy seq always given reasonable results?
12:26gfredericks(as opposed to str)
12:26hiredmanyes
12:28ln2Hi all. =)
12:28ln2Do you guys have any recommended reading other than "The Joy of Clojure"?
12:29gfredericks"because I hate the joy of clojure" or "because I've already read the joy of clojure"?
12:29hiredmanread clojure.org
12:29hiredmanhttp://clojure.org/documentation http://clojure.org/rationale http://clojure.org/features
12:30hiredmanetc
12:30ln2"Because I just started reading The Joy of Clojure and I am excited to line something up in front of it. =)
12:30ln2hiredman: Thank You!
12:32brainproxyln2: Clojure Programming pub'd by O'Reilly was a great read, imo
12:32ln2I do have one dilemma though. I've never programmed in *any* language before. So I guess my question should be more along the lines of. "Is there a Clojure for Dummies?".
12:32hyPiRionln2: Depends. If you want to learn Clojure, then Clojure Programming is great.
12:32brainproxyone of the best O'Reilly books I've ever read, in terms of quality of the writings and examples, and the depth of learning
12:33ln2brainproxy: The one with the big bird on the front? Haha
12:33gfrederickshas anybody heard any anecdotes of new programmers learning clojure?
12:33ln2Is that the same thing as horror stories?
12:34gfredericks:)
12:34brainproxyln2: this one http://www.clojurebook.com/
12:34SgeoIs Clojure really a good idea for a starting language?
12:34hyPiRionln2: I am not sure if any Clojure book is "not programmed anything yet" friendly. I do know that there are some python books out there for people completely new to programming, but I can't tell you which ones to choose.
12:35cemerickgfredericks: borkdude is a prof IIRC; Lee Spector also teaches total noobs Clojure. *shrug*
12:35ln2I'm starting to learn the difference between Clojure and the more popular languages as I go. But again... I've never programmed in any language. (advantage?).
12:35dnolenSgeo: IMO it's about as good as any other.
12:35Natchln2: programming clojure 2nd edition by halloway and bedra is great. clojure programming from oreilly seems good but it has 3-4 annotations per page and is extremey annoying to read, imho..
12:35Sgeodnolen, well, there's the whole Java interop that is around that could cause issues
12:35ln2To help I'm trying to learn Lambda Calculus also. I'm sure it will help. Probably... haha
12:35SgeoWhich is not the case with most languages
12:35dnolenSgeo: doing anything useful in any language is pain.
12:36rasmustoln2: could be partially an advantage, might make you take less notice of unique clojure features though
12:36Natch*extremely
12:36ln2Natch: Thank you! I will get that one also. =)
12:36cemerickNatch: sorry about that; it's O'Reilly house style, something we fought tooth and nail about, but lost
12:36gfredericks"If you haven't programmed before I recommend starting with clojure and the lambda calculus."
12:37pbostrom_ln2: you also might try some exercises on http://www.4clojure.com/ to reinforce your book learning
12:37ln2gfredericks: Is this sarcasm? Haha
12:37ln2pbostrom_: I've never seen this site! Thank you!!!
12:37rasmustoln2: clojure koans are good too (on github), it's slightly more structured than 4clojure
12:37Natchcemerick: that's a shame
12:38Natchcemerick: because it seemed really nice otherwise
12:38ln2rasmusto: I am working through the Clojure Koans right now as we speak. =)
12:38rasmustoln2: cool :)
12:39FrozenlockI just realized why the docstring is before the arguments in clojure, as opposed to say elisp... For when you have multiple arity.
12:39rasmustoFrozenlock: oo, I was wondering that too. Good point
12:40creeseHas anyone read the new o'reilly book on cljs?
12:40ln2I was a little turned off aesthetically to the massive amounts of parens in Clojure until I saw lamda calculus. Maybe I should be thankful? O_o
12:40gfredericksln2: a little bit. nothing wrong with being ambitious though :)
12:41technomancySKI or go home
12:41hyPiRionln2: If you're that far (doing Clojure Koans) and never programmed before, I'd go with Clojure Programming as a book for learning Clojure. You sound like a smart and motivated guy, so it shouldn't be a problem.
12:42ln2gfredericks: Maybe the next generation of programmers it will be ambitious to try and comprehend object oriented languages! We can all hope...
12:42Frozenlockln2: http://www.thejach.com/imgs/lisp_parens.png
12:42SgeoFun fact: There's more to OO than you would think just by looking at the most popular languages
12:43SgeoThe style of you see in Java and C# and C++ is not the only one out there
12:43gfredericksSgeo: just because something is rich and subtle doesn't make it good :P
12:43pimeyssicp teaches objects in chapter three
12:43Sgeo*style of oo
12:43pimeysand of course you can do the same with clojure
12:43ln2hyPiRion: It may seem that way... O.o. In reality I'm only average at logic and seriously inept at higher math (pretty good at mental). I'm not having the easiest time with visually following a fn embedded into a fn taking two fn ect. ect.
12:43pimeyshaving a function with inner functions, message passing and returning a closure
12:43ln2I'm really really trying to go slow. xD
12:44Sgeomessage sending implies single-dispatch I think (but not certain)
12:44SgeoI'm not especially a fan of single dispatch, but I'm not sure what I would like
12:44pimeysme neither
12:44pimeysbut it's possible
12:44pimeysand one way of building your app
12:44pimeysI think that the hardest part with lisps is that it doesn't force you to anything
12:44hyPiRionln2: Being smart is not the same as being knowledgable. Being smart is about learning rapidly and being open to new ideas :)
12:45pimeysyou can use whatever style you prefer
12:45technomancyfor most people the hardest part of learning clojure is unlearning bad imperative habits
12:45Sgeopimeys, which gets annoying when you try to mix different OO systems together
12:45SgeoSay in Scheme if one person is using TinyCLOS and another is using, I don't know, coops
12:45pimeystechnomancy: but you can also use your imperative habits
12:45pimeyskeep state etc.
12:45SgeoTcl has this problem too
12:45pimeysSgeo: yep
12:46technomancypimeys: arguably then you haven't really learned it =)
12:46SgeoAlthough Snit tries to solve it by saying that anything that looks like an object is an object
12:46ln2For example. This Koans got me. I cheated and got the answer from a YouTube series.
12:46SgeoI think
12:46pimeystechnomancy: well, who says so :D
12:46pimeyslisps are not so much of functional languages, I'd say
12:46ln2http://tny.cz/7feb3618
12:46dnolenln2: go slow
12:46Sgeopimeys, depends on the Lisp
12:46pimeysbut they have a nice way of giving you that possibility
12:46SgeoTrying to categorize them all into one mold seems like a fool's errend
12:46technomancyactually that's not true, I judge all the time
12:47ln2Even worse. The explanation on YouTube was basically. "That was convoluted... lets move on now!"
12:47SgeoLisp is a style of syntax and metaprogramming, imo
12:47gfrederickstechnomancy: and I'm going to judge you either way so you can't really avoid it
12:47ln2O.o
12:48ln2I'm assuming all of you can solve that one pretty easily?
12:48pbostrom_creese: I read it, it's pretty light on content, but that's reflected in the price, probably worth if if you're brand new to cljs, but if you're already up and running, you won't learn anything new
12:48SgeoTook me a bit more thinking than it should have, to be honest. But yeah
12:49SgeoThink about what the fn is supposed to be doing. What is its role, what is its job there?
12:49ln2To remove words that don't meet certain conditions?
12:50Sgeoreduce isn't a mover, it's a thing that takes a list and gives a result. And the fn you pass into it is supposed to take a result so far and an item, and return a new item-so-far
12:50Sgeo*reduce isn't a remover
12:51Sgeo(also, saying "list" was a bad choice of words on my part)
12:51ln2Oh right. Because nothing can / should be "removed". Just returned.
12:51ln2Because "removing" is a mutation.
12:51SgeoWell, there is a function that returns a copy with some stuff different in the copy. Removed if it doesn't meet a condition. But that's not what reduce is for.
12:52dnolenSgeo: message sending isn't necessarily single dispatch, look at Cecil, also the whole idea behind CLOS was being able to support different OO systems under the same roof.
12:53ln2I suppose it's starting to make more sense now. I wish there was an easier way to format these but there really isn't because it's a single expression.
12:53ln2Maybe this IS what draws people to OO?
12:53SgeoI think what draws people to OO is the fact that it's one of the first things they learn
12:54ln2Then maybe.. really.. we only have public schools to blame...
12:54SgeoAs far as formatting goes, that's not really much of an OO vs. functional thing. There are ways to split things up in functional languages
12:54SgeoBut imperative languages do admittedly tend to partition into separate statements more than having an expression
12:54ln2Sgeo: Really? I'm interested in that!
12:55Sgeo,(doc let)
12:55clojurebot"([bindings & body]); binding => binding-form init-expr Evaluates the exprs in a lexical context in which the symbols in the binding-forms are bound to their respective init-exprs or parts therein."
12:55ln2I wonder if I could reason how to split up that koans... might be a fun exercise.
12:55Sgeo,(let [a 5 b 6] (+ a b))
12:55clojurebot11
12:56SgeoOther functional languages have other approaches. And you can usually drag an fn out and give it a name
12:56Sgeo(although not always)
12:56enquoraanyone from prismatic here? is the Graph library Clojurescript-friendly?
12:56SgeoBut at least with this koan, it's just a matter of fill in the blank
12:56SgeoI promise that for this one, the blanks are very simple, they won't complicate the expression at all
12:56ln2Binding... I was watching a talk about binding and how it do it without Macros.
12:57Sgeo,((fn [a b] (+ a b)) 5 6)
12:57clojurebot11
12:57ln2I don't actually know what let / binding do yet.
12:57Sgeo^^roughly equivalent to the above let
12:57ln2Wait a minute. Theres a REPL in this channel?
12:57SgeoTwo, although imperfect
12:58ln2Ha! That is amazing!
12:58brianwongthat is amazing
12:59brianwongi didnt know that
12:59brianwong(doc let)
12:59clojurebot"([bindings & body]); binding => binding-form init-expr Evaluates the exprs in a lexical context in which the symbols in the binding-forms are bound to their respective init-exprs or parts therein."
12:59brianwongerr
12:59ln2,(* 2 2)
12:59clojurebot4
12:59brianwong,(doc let)
12:59clojurebot"([bindings & body]); binding => binding-form init-expr Evaluates the exprs in a lexical context in which the symbols in the binding-forms are bound to their respective init-exprs or parts therein."
12:59ln2It's fast too. *giggles like a schoolgirl*
12:59ln2And it has the doc namespace!
13:00ln2Does an XMPP REPL exist?
13:00technomancyclojurebot used to have an XMPP interface
13:00technomancyI think it was removed though
13:00ln2=(
13:02callenbotenquora: I sincerely doubt it, and why would you want it to be?
13:03enquoraneed to build a PDF report generator to run in both browser and on server
13:04enquorait's a non-trivial task, just thinking now how to structure it
13:04hyPiRionenquora: What do you mean by "in browser"?
13:05enquoraHTML browser
13:05hyPiRionShould the PDF be build by ClojureScript, or could it be sent from the server to the browser?
13:05hyPiRionbuilt*
13:05enquoramust run offline
13:06enquorait's a distributed system
13:07ln2Do most of you guys use LightTable?
13:07enquorathe web browser app is a cached HTML app, or browser extension
13:07craigbronot I
13:07craigbrobut I'm an emacs curmudgeon, so may not be representative, and is no judge of LT
13:08TimMcln2: Most folks here use emacs or vim.
13:08TimMcLT is very young.
13:08nDuff*nod*. It's a very neat toy, and has promise.
13:09shaunxcodeI seem to recall there was a pure js pdf gen tool floating around recently
13:09ln2Having zero programming background I'm not sure I could bring myself to use tools like emacs and vim. I'm really impressed by some of the features I've seen from both of them though, features I did not expect in cli apps.
13:09TimMcln2: Learn one thing at a time.
13:09TimMcBoth emacs and vim have long learning curves.
13:09ln2TimMc: That's the method I'm trying to use. LightTable is helping me get going fast. =)
13:10TimMcGood.
13:10nDuffln2: If you want to be blown away, watch the Emacs Live intro video. http://vimeo.com/22798433
13:10shaunxcodeln2: the nice thing about using a generic text editor when starting is you learn the difference between what is language magic v.s. what is ide magic v.s. build tool wizardry
13:10TimMcI had to try learning emacs 3 times before it stuck; the first two times I was trying to learn a new programming language at the same time, so it sucked. :-P
13:11ln2One thing I would really like to have is some way of auto-correcting my parens. Light table color codes them. But I think it was emacs that actually does parens for you?
13:11dnolenln2: yes paredit
13:11rasmustoln2: paredit.el or paredit.vim
13:12TimMc~paredit
13:12clojurebotparedit is not for everyone, but what you need to understand ís how to become the kind of person that paredit ís for.
13:12TimMc:-P
13:12shaunxcodecodemirror has paredit mode http://htmlpreview.github.com/?https://github.com/achengs/subpar/blob/master/demo/normal.html
13:12technomancyclojurebot: botsnack
13:12clojurebotThanks! Can I have chocolate next time
13:12ln2Did the bot just talk? O_O
13:12TimMcI triggered a factoid.
13:12technomancyas long as it obeys the Three Laws clojurebot can do anything
13:12ln2Aahhhhahha!
13:12ln2Is the bot as opinionated as Hickey? xD
13:13TimMcThe bot is opinionated as the people who care to feed it things.
13:13TimMcAlso it randomly picks up quotes from the channel, which can be... odd.
13:14ln2It's also a Furby? O _ O
13:14SgeoParedit is awesome
13:14SgeoI wish I had paredit in here
13:14technomancySgeo: (add-hook 'erc-mode-hook 'paredit-mode) ; =D
13:14jballancclojurebot: litany against cons
13:14clojurebotlitany against cons is "I must not cons. Cons is the perf-killer. Cons is the little death that brings total obliteration. I will face my cons and permit it to pass over me and through me, and when it has gone past I will turn my GC to see its path. And where it has gone there will be nothing; only I will remain."
13:14Sgeotechnomancy, heh
13:14craigbroconj
13:14hyPiRionIt replies to certain things. right clojurebot???
13:14lazybothyPiRion: Yes, 100% for sure.
13:14hyPiRionoh, that's the wrong one.
13:15llasramtechnomancy: I just tried it, and paredit is unhappy lingering emoticons :-(
13:15SgeoClose all emoticons! (:)
13:15Sgeo(:-)
13:15technomancyllasram: yeah, show-paren-mode is good enough for me
13:16Bronsashow-paren-mode is awesome
13:20hyPiRionI prefer highlight-parentheses.
13:23aaelonydoes anyone know of a tutorial or link that describes how to profile a clojure program running at the repl via yourkit ?
13:24aaelonyor running a jar produced by lein uberjar ?
13:24hyPiRionaaelony: running a jar? java -jar name-of-uberjar
13:25aaelonyhyPiRion: how to profile that running jar though?
13:25ln2http://tny.cz/f15ac6b4
13:25ln2I'm trying to understand how this "inline function" can be expressed in a way that is easier to read. What am I missing?
13:26hyPiRionaaelony: I'm afraid I don't know that. I saw the questions as two decoupled ones.
13:27aaelonyhyPiRion: thanks anyways. yeah I have a jar I am running that I'd like to profile. I have an evaluation license for yourkit and trying to get it to analyze my jar.. Youkit's docs say I should do this: java -jar yjp-controller-api-redist.jar localhost 10001 capture-memory-snapshot but unsure what host and port and how it knows to analyze the uberjar running...
13:28aaelonyhttp://www.yourkit.com/docs/12/help/command_line_tool.jsp
13:31owengalenjonesa few minutes late, what's wrong with cons?
13:31technomancythis is pretty sweet: http://schneems.com/post/42508340989/open-source-in-your-inbox-code-triage
13:32technomancyowengalenjones: nothing apart from the fact that allocating memory is often at odds with performance
13:33technomancynobody should be following the litany against cons unless they're neck-deep in profiling =D
13:35owengalenjonesok, heh hadnt seen that before and was curious
13:35technomancyit's mostly an excuse to quote Dune I guess?
13:36desertmonadthe litany against fear got me through some final exams in years past :)
13:38SgeoHuh. So that's where "politics is the mind-killer" came from, I guess
13:38SgeoDune reference
13:41desertmonadDune is one of my all time favorites. That and Neuromancer.
13:41technomancythe bot's gotta have some neuromancer quotations in there somewhere, but I can't think of any off the top of my head
13:42gtrakisn't cons pretty obvious? cache-thrashing... java programmers know arraylist is generally always faster than linkedlist
13:44nishantHi! Is there a way to comp a function with itself n times? Something with this behavior - (f(inc, 5), 0) => 5 ?
13:44gtrakiterate?
13:44technomancy,((apply comp (repeat 5 inc)) 0)
13:44nishantIterate almost works, except it returns a seq of all the intermediate results too
13:44clojurebot5
13:44gtrak,(doc iterate)
13:44clojurebot"([f x]); Returns a lazy sequence of x, (f x), (f (f x)) etc. f must be free of side-effects"
13:45owengalenjonesIANA java progrrammer
13:45AimHere(nth #(iterate inc 0) 5)
13:45AimHere,(nth #(iterate inc 0) 5)
13:45clojurebot#<UnsupportedOperationException java.lang.UnsupportedOperationException: nth not supported on this type: sandbox$eval77$fn__78>
13:45gtraknishant: it's lazy, don't keep the head
13:45nishantAh, thanks!
13:45AimHereOops
13:45gtrak,(nth (iterate inc 0) 5)
13:45clojurebot5
13:46gtraknot sure why returning a seq would be anything other than convenient
13:46technomancyclojurebot: oinc
13:46clojurebotoinc is octo-inc: (apply comp (take 8 (repeat inc)))
13:46technomancyhm; that must predate repeat's second arity
13:48dnolen`fogus: ping
13:49brainproxyI must not fear. Fear is the mind-killer. Fear is the little-death that brings total obliteration. I will face my fear. I will permit it to pass over me and through me.
13:57ln2I am trying to re-write one of the Clojure Koans from section 8. What is going on here? Haha
13:57ln2http://tny.cz/6ad1b8bc
13:58gtrakln2: you need to return an accumulator
13:58gtrak(reduce (fn [acc next-element] do-something-to-acc) source-seq)
13:59ln2"source-seq" is the accumulator?
13:59gtrakacc
13:59ln2Sorry for all of the questions! You guys have been a massive help. =D
13:59gtrakthat's just kinda what reduce does :-)
14:00ln2The Koans are amazing but I wish there was a detailed explanation of each problem somewhere. Not a cheat sheet but just some information. xD
14:01gtrakwell, the doc for reduce is helpful ##(doc reduce)
14:01lazybot⇒ "([f coll] [f val coll]); f should be a function of 2 arguments. If val is not supplied, returns the result of applying f to the first 2 items in coll, then applying f to that result and the 3rd item, etc. If coll contains no items, f must accept no arguments a... https://www.refheap.com/paste/11004
14:05ln2If I wanted to make this two functions then I could create one that takes an input and does a reduce with an acc. Then call that function from another function that checks if one word is larger than another?
14:10ln2*crickets*
14:11gtrakit is two functions, whether they're both bound to a vars or not
14:12gtrakbut I think what you described seems inverted
14:12TimMc&(reduce (fn [accum next-thing] (str accum ", " next-thing)) "0" [1 2 3 4])
14:12gtrakreduce is the control-flow, it's calling the aggregator or whatever you wanna call it
14:12lazybot⇒ "0, 1, 2, 3, 4"
14:17ln2Thanks a lot guys! I think I'm managing to figure it out through trial and error. I'm not sure this would be possible without a REPL. Haha
14:17jimdueybrainproxy: LOL
14:17ln2I have it reduced to a "key must be an integer" error. Hmm.
14:17ln2To google!
14:18amalloyln2: you're attempting to call a vector as a function, and passing it a non-integer
14:19ln2amalloy: I think I'm trying to pass a vector TO a function. I wonder how I managed to pass it AS a function. O.o
14:21TimMc,([:a :b :c] 0)
14:21clojurebot:a
14:27ln2Alright I think my problem is that I have two functions "lengthycheck" which uses the if statement to determine which is longer (a or b). "lengthyness" uses the reduce function. The values a and b are being passed to "lengthyness" but not to "lengthycheck". I need to read more about embedding functions. =(
14:37dnolenlynaghk: ping
14:49ln2TimMc: I had my first extremely minor programming victory. I turned your expression into a function!
14:49ln2(defn first-in-list [a]
14:49ln2('[a] 0))
14:49amalloyerrrrr, that always returns the symbol 'a, ln2, ignoring its input
14:50ln2CRAP!
14:50TimMcWhat you probably want is `first`.
14:51amalloyTimMc: really? it looks to me like he was writing identity
14:51ln2TimMc: I can't just express the function in the same simple way? ([:a :b :c] 0) ?
14:51TimMcamalloy: Not with the name "first-in-list".
14:51amalloyoh
14:52TimMcln2: (fn [a] (a 0)), which works if a is a vector
14:52amalloyi never read function names. easier to just run them on all possible inputs in my head, observe the outputs, and derive the function's meaning thereby
14:53ln2TimMc: Holy sh* that did it! My function was calling [a] the vector and not a the value. Thanks!
14:53sveduboisHow I can write these 2 lines:
14:53svedubois(show image1)
14:53svedubois(show image2)
14:53sveduboisin only 1 line?
14:53svedubois(show image1 image2)
14:54ln2This has the behavior I was looking for.
14:54ln2(defn first-in-list [a]
14:54ln2(a 0))
14:54ln2Thanks guys! I'm not as proud now though because Tim solved it for me. =(
14:54rasmustoln2: ,(first [1 2 3])
14:55ln2rasmusto: I figured that there was an easier way to do this. I am just trying to understand the language so I'm rebuilding various expressions as functions. Thank you though!
14:55rasmusto,(first [1 2 3])
14:55clojurebot1
14:55Guest14889i saw recently there is a server specially for clojure, forgot the name
14:56Guest14889can anyone help?
14:56ln2In a lot of ways it is like lamda calc. Even the most basic operations has to be reduced to logic. Instead of calling + or * you need an expression.
14:56joegalloGuest14889: immutatnt
14:56rasmustoln2: first/rest are interesting because they work on more than just one type of sequence. They'll work on vectors, maps, seqs, etc.
14:56Guest14889what wevserver do people commonly deploy to?
14:56joegallotypo
14:56joegalloimmutant
14:56Guest14889joegallo: thats the one, thanks
14:56technomancyjetty is the most common
14:57technomancybut immutant can be good if you need to integrate into certain environments
14:57ln2rasmusto: I know about rest from the Koans problems. I'm going to write a basic rest function manually right now. =)
14:57Guest14889im open to anything, i want to deploy it on a new vps
14:58amalloyln2: you can't really write first or rest without in fact using first and rest. they're the primitives of sequence manipulation
14:58Guest14889i'd probably go with jetty unless immutant offered significant benefits
14:58technomancyjetty is the simplest
14:59amalloyyou can write versions that only work on vectors, as you did for first, but it's not very useful even as an exercise
14:59akhudekimmutant is a lot more than just a web server. You may or may not need the extra features it has. Jetty is good for a straight forward web server.
15:00ln2amalloy: This function does not always return the first character?
15:00ln2(defn first-in-list [a]
15:00ln2(a 0))
15:00amalloytry it with (list 1 2 3)
15:00Guest14889also, is pallet the favourite for automated deployments? or do people generally use a non-clojure tool?
15:00ln2(first-in-list [:a :b :c]) returns :a for me
15:01Guest14889if anyone has any simple pallet scripts that deploy a basic app on jetty/immutant i'd be interested i seeing one
15:01technomancyGuest14889: pallet is a bit less polished than other tools, but the underlying models it uses are much, much better-designed.
15:01rasmusto,(get '(1 2 3) 0)
15:01clojurebotnil
15:02Guest14889technomancy: interesting, i'll probably give it a try at least
15:02Guest14889maybe i can help polish it
15:02amalloyln2: so, you're saying you did not do what i suggested and try (first-in-list (list 1 2 3))
15:03the-kenny(list 1 2 3) is doesn't implement the same interfaces as [1 2 3]
15:04ln2amalloy: That fails. But "(first-in-list [1 2 3])" succeeds.
15:04amalloyas i said, you invented a solution that works only for vectors
15:04technomancyGuest14889: I'm sure they'd appreciate feedback and help. they were very responsive when I had questions.
15:05ln2amalloy: Interesting.
15:05llasram&((fn [[x]] x) (list 1 2 3))
15:05lazybot⇒ 1
15:05llasramHehe
15:05ln2amalloy: However. Rest is possible with only vectors also correct? I need to use increment?
15:05nDuffHugo _is_ responsive. On the other hand, the amount of ground Pallet needed to make up to cover a lot of my use cases when last evaluated was pretty overwhelming.
15:06nDuffThen again, if I were amenable to a nuke-and-pave cloud deployment model, that wouldn't so much be the case.
15:06nDuff(and it's been a long time since I took a close look)
15:07hyPiRionln2: rest is possible with anything you can do `seq` on and return a sequence
15:07hugodnDuff: if you want incremental edits of config files, that's a hard problem
15:08hyPiRion,(seq (list 1 2 3 4))
15:08clojurebot(1 2 3 4)
15:08hyPiRion,(seq (vector 1 2 3 4))
15:08clojurebot(1 2 3 4)
15:08hyPiRion,(seq (hash-map 1 2 3 4)) ;; Don't worry about this for now, just be aware of it
15:08clojurebot([1 2] [3 4])
15:08hugodnDuff: or was it something else you needed?
15:09ln2Rest is more difficult because apparently this is impossible.
15:09ln2(defn rest-of-list [a]
15:09ln2(a (> 0))
15:10nDuffhugod: Not so much editing _files_ incrementally as configurations which could span multiple files / be determined only by invocation of queries or commands (example: Determining an edit list of invocations of vendor-provided tools to move from current state to desired configuration)
15:10ln2hyPiRion: Just noticed your response. Yes I think I do need a sequence. =)
15:10technomancyln2: interesting idea. for that to work, a would have to take a predicate on the index of the element, you could do it like so: (a (partial > 0))
15:11the-kennyReminds me bit of logic programming
15:11nDuffhugod: ...it's not an easy problem, granted, which is why I spent so much of my time a few jobs ago working on toolage to tackle it.
15:11hugodnDuff: so updating based on querying the current system status?
15:12nDuff*nod*.
15:12hugodok, 0.8 should be much better at that
15:13hugodyou can use the return values of actions in flow control, etc
15:13nDuffNice. I'll definitely need to reevaluate, then.
15:13hugodshould be released before clojure/west, I hope
15:14ln2technomancy: I'm still getting a "key must be an integer" exception. =(
15:14technomancyln2: oh, I didn't mean that would work; I meant if vectors took predicates it would work.
15:15ln2Hahaha!
15:15technomancyI was noting that your assumption it did was interesting from an API design point of view.
15:15ln2technomancy: Well thank you very much. I try to be interesting. ;)
15:16ln2technomancy: I'm determined to get this to work. I'm pretty sure I need to create a sequence to index the input data and ignore the first entry?
15:17technomancythere are a bunch of ways you could do it; that's a decent place to start.
15:18technomancyassuming you have a vector, anyway
15:18ln2technomancy: A bunch of ways huh? Well you really know how to make someone feel smart. ; )
15:19technomancyln2: well, think of it as an artistic expression more than a puzzle.
15:20ln2technomancy: Now I feel a ton better! If I fail I'm simply not artistic. xD
15:21nDuffln2: One easy way to do that (without the obvious thing of using first, of course) would be destructuring.
15:21technomancyheh; I was restraining myself from saying that =)
15:22technomancylet him get it working this way first so he'll appreciate that more =)
15:22lynaghkdnolen: pong
15:22lynaghkdnolen: I just saw your core.logic push on github. Looking forward to checking it out---might be able to this afternoon
15:22hyPiRionln2: You're looking at it wrong. You're unfamiliar with the paintbrush you use. In fact, you're unfamiliar with anything which involves paint. It's not about being artistic or not, it's about knowing the details of the paintbrush.
15:22lynaghkfinally back in Portland
15:22dnolenlynaghk: some significant changes to simple unifier in master
15:23TimMctechnomancy: And then I can show ln2 the swearjure approach to rest, and we can *all* appreciate the standard way more. :-P
15:23dnolenlynaghk: only thing left to do is to distinguish vector & sets of symbols -> constraints
15:24lynaghkdnolen: awesome. I'll take things around for a spin and if I'm feeling lucky I'll take a crack at the vector+sets constraints
15:24ln2hyPiRion: I think that is pretty much right. Compared to actual painting I'm accomplishing what amounts to a poorly drawn stick figure. Only been programming for 4 days!
15:24ln2nDuff: Thank you for the suggestion! I will do it that way after I figure out another way of doing it first. =)
15:24jsabeaudryWhat are the popular choices for doing parameter validation on your rest api?
15:25hyPiRionTimMc: yeah, I used a similar version of your rest to get quicksort working. It's not really quicksort though, since it's O(n^3) when the seq is already sorted.
15:25hyPiRionBut if we assume rest is constant time, it's quicksort :)
15:28TimMc:-P
15:28DerGuteMoritzhello, I think I found a bug in clojurescript's core.cljs which requires a one-line fix. I haven't got a CA, yet, nor do I intend to get one right now. does anyone here care about it and wants to submit it as their own patch perhaps?
15:28lynaghkDerGuteMoritz: what is it?
15:29DerGuteMoritzlynaghk: I think the if-not in https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/core.cljs#L4428 is missing an else branch
15:29DerGuteMoritzwith a (recur (inc i) init) call
15:30DerGuteMoritzI may be mistaken though!
15:31DerGuteMoritzhm, maybe I should take this opportunity and do the CA dance once and for all
15:31lynaghkDerGuteMoritz: How did you come across this? If you're just reading core.cljs for fun, then yeah, you should totally get a CA = )
15:32hyPiRion^ +1
15:32DerGuteMoritzlynaghk: I am actually porting PersistentHashMap to Scheme right now hehehe
15:32DerGuteMoritzok I shall, then
15:32lynaghkDerGuteMoritz: ah. Yeah, I don't know enough about the internals to say if that's a bug or if someone used if-not when they meant when-not
15:32amalloyDerGuteMoritz: i wouldn't be surprised if this code is correct, though i'm not familiar with the internals
15:33amalloyie, it seems unlikely to me that there would be a nil node followed by a non-nil node
15:33DerGuteMoritzlet's see
15:33DerGuteMoritzwell
15:33DerGuteMoritzbut the correct thing to return then would be init, then, wouldn't it?
15:33hyPiRionA repro case is usually sweet to have.
15:33DerGuteMoritzyeah, I agree, that would be best
15:34DerGuteMoritzI will follow the code path completely again, maybe I overlooked something
15:34amalloygood point
15:34TimMcIt could be a masked bug, i.e., not actually demonstrable until some other code changes and reveals it.
15:36DerGuteMoritzTimMc: yeah might be!
15:41DerGuteMoritzamalloy: for the record: empircally it seems to be possible that an ArrayNode has gaps
15:41TimMcThat expression really points to the need for a let-loop-if-let-if-let-if macro.
15:42DerGuteMoritzabsolutely
15:42DerGuteMoritzso this CA means I assign the copyright of contributions to Rich?
15:44amalloyDerGuteMoritz: you give him joint copyright, which is basically permission to do whatever he wants with it
15:44DerGuteMoritzah yes, I just read the text
15:45hyPiRionDerGuteMoritz: It's there so that you cannot submit a patch, get it accepted and sue afterwards if you have a patent on the thing you submitted. IIRC.
15:45ln2(defn rest-of-vector [a]
15:45ln2(subvec a 1))
15:45hyPiRionThough don't quote me on that.
15:45ln28)
15:46amalloyhyPiRion: that is the main reason it exists, yes
15:46TimMchyPiRion: Also for relicensing.
15:46jsabeaudryout of curiosity, why don't I need a CA for contributing to the linux kernel?
15:46DerGuteMoritzhmmm so does that mean we could lose clojure completely if Rich decides to go proprietary? :-)
15:46TimMcNah.
15:47amalloyDerGuteMoritz: no, because he's already licensed existing versions of it
15:47amalloyyou could lose access to his latest and greatest new ideas if he decides not to share them with you, but that's hardly unusual
15:47TimMcIn short, it would create a fork.
15:47hyPiRionamalloy: You won't lose access, you wouldn't get them to begin with.
15:48DerGuteMoritzah, so it can't be used to change the past, good :-)
15:48ln2Is there any alternative to his database that is open source?
15:48ln2^Datomic
15:48ravsterhello all
15:48amalloyln2: postgres
15:48DerGuteMoritzok guys, I gotta leave for a bit, I'll get back to you later when I know more about the possible bug
15:48DerGuteMoritzthanks for your feedback so far!
15:48amalloymongodb. millions of open-source alternative databases. i realize this doesn't answer the question you meant to ask, but it's kinda a silly question :P
15:48ln2amalloy: Is it possible to mimic the same ideas with postgres? An accumulating data structure with timestamps ect?
15:49ln2amalloy: I was under the assumption that Datomic was unique.
15:49ln2ravster: Hello. =)
15:49amalloy*shrug* everything is unique
15:49dnolenDerGuteMoritz: that's one for Michal Marcyk to look at, if you open an issue and assign it to him he will probably respond pretty quickly.
15:49ln2amalloy: I was under the assumption that Datomic had capabilities that other databases didn't have?
15:49amalloyif you've been programming for four days i'd save worrying about datomic's licensing for later
15:50gtrakln2: you can run datomic on postgres if you like.. what do you mean by possible to mimic the same ideas?
15:50hyPiRionln2: Well, he has explained how Datomic works, so it's possible to create an open version of it.
15:52ln2amalloy: Understandable. The reason I'm drawn to Clojure is because I agree with the basic concepts. Even with programming for two weeks I think it's reasonable to start working with databases. No point in working with databases that don't agree with the basic concepts of the langauge. =)
15:52DerGuteMoritzdnolen: I can't open an issue without having signed the CA though, right?
15:52hyPiRionDerGuteMoritz: You can.
15:52dnolenDerGuteMoritz: anyone can open an issue
15:52DerGuteMoritzah, cool, then I misunderstood that part
15:53ln2hyPiRion: That is what I was getting at. I understand that Datomic ultimately uses other databases as raw data stores. But the way that it places and organizes that data is unique (time based, imutable, ect.).
15:53DerGuteMoritzthen I shall do that, thansk!
15:53DerGuteMoritzafk now for real :-)
15:53hyPiRionln2: It unique in this moment, yes :)
15:54ln2gtrak: Yes. More along the lines of "Have those ideas been copied yet". It looks like the answer is no unfortunately.
15:55gtrak'a particular set of design tradeoffs', anything can do anything if you try hard enough
15:56ln2I wish I was a more competent programmer. I would help implement FreeTomic. ; )
15:57ln2It's unfortunate that Rich didn't kickstart Datomic, open source it and profit from support and solutions.
15:58ln2hyPiRion: Is there something missing from this or will this actually rest any vector?
15:58ln2(defn rest-of-vector [a]
15:58ln2(subvec a 1))
16:01hyPiRionln2: It will indeed rest any vector.
16:01ln2hyPiRion: Sweet! I ran a bunch of tests but I wasn't sure if I had missed something stupid / obvious.
16:01hyPiRionWell, it won't return a seq, but it will return a collection without the first element
16:02hyPiRionoh right, we may have an odditiy.
16:02hyPiRion,(subvec [] 1)
16:02clojurebot#<IndexOutOfBoundsException java.lang.IndexOutOfBoundsException>
16:02hyPiRionYeah, you need to handle that case.
16:02ln2An empty vector.....
16:02TimMc&(pop [])
16:02lazybotjava.lang.IllegalStateException: Can't pop empty vector
16:02hyPiRion,(rest [])
16:02clojurebot()
16:03ln2& is an anonymous function?
16:03lazybotjava.lang.RuntimeException: Unable to resolve symbol: is in this context
16:03TimMcln2: No, & is lazybot's eval trigger.
16:03ln2Rest also fails against an empty vector? Interesting.
16:03amalloyhyPiRion: he only needs to handle that case if it's part of the function's contract, and he's making it up himself
16:03TimMcln2: What do you mean by "fails"?
16:04ln2,(rest [])
16:04clojurebot()
16:04hyPiRionln2: Doesn't fail, it returns ().
16:04RaynesThat isn't failure.
16:04RaynesThere is no rest of nothing.
16:04ln2I see it. Read the responses in the wrong order. =)
16:04amalloythere *ain't no rest of nothing
16:04TimMcheh
16:04holohi
16:05ln2amalloy: Interesting. I'm trying to understand contracts. It really just means the "purpose" of the function as defined by me?
16:05amalloyyes
16:06ln2amalloy: If that purpose never involved empty vectors then theres no problem. I am still curious enough to try and fix that case.
16:07gtrakmaybe being broken on empty it is part of the contract, conveniently, since that's what it does
16:07ravstercemerick: in 'friend', does the users data have to be a map of stuff that has username as a key and in the map itself?
16:08ln2gtrak: Maybe I just need to find a more productive problem to solve now that I *mostly* solved that one. Haha
16:09holoin korma, when a defentity users has-one email, this singular name "email" refers to a defentity email? or does it follow a plural names convention and it refers to defentity emails?
16:11cemerickravster: maps are just convenient credential fns; see https://github.com/cemerick/friend/#credential-functions-and-authentication-maps
16:13ln2I tried a google on this one but can't seem to figure it out. What is the difference between the values 1 and :1?
16:13ln2Int vs Str?
16:13jsabeaudryIs validateur the defacto standard for parameter validation in a rest webapp ?
16:13amalloyjsabeaudry: no such standard has arisen yet
16:14jsabeaudryamalloy, what are the other top dogs?
16:15amalloyhell if i know. i just validate stuff by hand
16:15Raynesamalloy, jsabeaudry: lib-noir has a tiny validation thingy that I've never used and have nothing to do with.
16:17ravstercemerick: thanks
16:19ppppaulweavejester, you here?
16:20SurlyFrogHas anyone ever gotten a `ClassNotFoundException org.apache.http.impl.conn.PoolingClientConnectionManager` when trying to require clj-http.client ?
16:20craigbronope
16:20craigbrohowever, if it was working previously...
16:20amalloyi'm guessing at least one person has
16:20craigbrosometimes rming target helps clean up confusion about deps
16:21SurlyFrogI'll try that
16:21craigbrogets me alot when switching between branches of a project that has different deps on different branches
16:21holojsabeaudry, i think i lost several days trying and making market study with many of the validation solutions, only to end up rolling my own validation module. I still use the lib-noir email validation e.g., but i don't use it's stateful errors
16:22weavejesterppppaul: Yep
16:22callenbotRaynes: we need to talk.
16:22ppppaulwhat would be the easiest way to deal with having singular and pluralized routes map to the same fn?
16:22callenbotRaynes: but first: http://www.youtube.com/watch?v=7tOo2OMUhB8
16:23weavejesterppppaul: What do you mean?
16:23callenbotppppaul: what like "/page/:id" and "/pages/:id" ?
16:23ppppaulyup
16:23callenbotweavejester: exercise a little imagination mate :)
16:23weavejestercallenbot: Yes, but why would that be a problem?
16:24Raynescallenbot: Talk
16:24callenbotRaynes: what's the deal with signed cookies in lib noir?
16:24Raynescallenbot: EH?
16:24SurlyFrogremoving target didn't help
16:24jsabeaudryholo, Interesting, what made you reject the libraries you found?
16:24callenbotRaynes: you can see the values.
16:24callenbotRaynes: it's key and key__s or whatever
16:24gtrakvalidateur seems to me no better than apply
16:24callenbotRaynes: and it just nukes the k/v pair if the __s doesn't match the value
16:25Raynescallenbot: I didn't write that, so *shrug*.
16:25RaynesI guess ibdknox likes broken shit?
16:25callenbotRaynes: balls. Enjoy the Misty Mountain Cold anyway. who do I harass?
16:25callenbotoh this is his fault?
16:25callenbotI'd better write a patch.
16:25RaynesWell, ibdknox wrote it but he won't be able to fix it.
16:25callenbotI know, that's why I realized I have to write it
16:26RaynesI'd take a patch to fix it, but I don't have time to do so myself anytime soon, especially since I don't know squat about cookies.
16:26gtrak"(numericality-of :age :even true)" I mean seriously? how about (even? x)
16:26callenbotRaynes: they're a sticking point / bugbear of mine. I'll fix it.
16:26weavejesterppppaul: Could you explain why plural vs. singular would be a problem?
16:26weavejesterAnd for that matter, why you'd want it.
16:26callenbotweavejester: legacy URL compatibility?
16:26ppppaulit's not a problem. i'm just wondering how i would deal with this in as little code as possible
16:27callenbotweavejester: unless there's a legitimate x-y problem going on, it's usually a waste of time to pushback on peoples' stated needs. Sometimes they don't have a choice.
16:27weavejesterppppaul: Well, there's https://github.com/r0man/inflections-clj
16:27ppppaullegacy URL compatability is actually what i would like to deal with
16:27weavejestercallenbot: Getting more information about the cause of the issue is almost never a bad idea.
16:28callenbotweavejester: maybe so but I've had a lot of bad experiences with time wasted questioning needs and having to re-explain an irrelevant use-case over and over.
16:28ppppaulin many cases in my app singular and plural don't have meaning for the api
16:28holojsabeaudry, some were hard to understand, others did too much, and all of them (obviously) assumed i had to specify what kind of validation to run against each field. because i had to change constraints in the db, and repeat the process in the code, i built my own constraint map extracted from the db
16:29rasmustohyPiRion: thanks for the leiningen patch (`lein clean`)
16:30technomancyln2: for the record, clojars uses a data store that has the same assumptions of immutability and append-only as datomic, but since the data set is small (and not distributed) it's much easier to implement.
16:30technomancyoops
16:31weavejestercallenbot: I've mostly had the opposite problem. Asking one or two questions before leaping to answer a problem is often a sound idea, and usually doesn't take up much time.
16:31holojsabeaudry, i also use conventions of my own extracted from the database (but not constraints) to validate for errors that are not available from constraints. e.g. validate for email when a field's name has *email* in the name
16:31ppppaulthanks for the link weavejester, however i'm talking about matching routes. do i have to duplicate my routes then? clout can't handle something like what i'm asking for?
16:32callenbotweavejester: fair. also if I'm first person to notice the sucky cookies implementation then how have you been doing auth/saved-signin all this time?
16:32gfrederickswhat kind of storage does datomic free use? some opaque internal thing?
16:33hiredmangfredericks: looks like hsql
16:33hiredmangfredericks: but that is just a guess since I'g gotten hsql exceptions from broken datoic free setups
16:33desertmonadso is it "day-tom-ic" or "duh-tom-ic"?
16:33weavejesterppppaul: Hum. You could look for directory paths in the path and setup some regular expression to match both parts.
16:33weavejestercallenbot: Sucky cookies implementation?
16:34weavejestercallenbot: What do you mean?
16:34weavejesterppppaul: Or… maybe a "normalize route" middleware.
16:35weavejesterppppaul: Split a route up by /, then pluralize any singular words.
16:35gfrederickshiredman: cool thanks
16:35callenbotweavejester: signed cookies in lib-noir upsets me :)
16:35gfredericksdesertmonad: this is english, so yes
16:36jsabeaudryholo, I see, do you remember the names of the better ones you considered? (besides validateur and lib-noir)
16:36weavejestercallenbot: I hadn't seen that before. I don't have a lot of interation with lib-noir.
16:37weavejesterWhat's the purpose of put-signed?
16:37callenbotweavejester: okay fine but that wasn't my question
16:37callenbotweavejester: I was asking you how you kept users logged in
16:37weavejestercallenbot: With cookies? I'm not sure I understand the question.
16:37callenbotweavejester: you do use cookies?
16:38weavejestercallenbot: Yes, but not lib-noir.
16:38callenbotweavejester: what do you save, an id or something? How do you keep them from tampering with the cookie?
16:38callenbotare you signing them yourself?
16:39weavejestercallenbot: It depends. Ring has several different cookie stores. The most common mechanism is to generate a UUID and link that to a database value that contains session data.
16:39amalloycallenbot: everyone just sends the user an id, and keeps the real data server-side somewhere
16:39callenbotamalloy: a db-backed session id?
16:39weavejestercallenbot: But Ring also has a cookie-store implementation that encrypts the session data with AES and HMACs it with a secret key.
16:39ppppaulweavejester, i think i'll use multiple contexts with inflections-clj that point to the same route
16:39callenbotweavejester: wait wait, where's this cookie-store implementation?
16:39holojsabeaudry, i can't precise it now after so much time, but it's safer to go to clojuresphere.com and check how many projects are using foo and bar validation libs. if no one is using it, suspect something is wrong with the lib :)
16:40callenbotweavejester: that's what I need. is something that hides the kv pairs.
16:40weavejestercallenbot: https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/middleware/session/cookie.clj
16:40callenbotI don't like db-backed session stores.
16:40weavejestercallenbot: Also read: https://github.com/ring-clojure/ring/wiki/Sessions
16:40weavejesterI believe lib-noir has a stateful session implementation based on top of Ring's sessions.
16:41hyPiRionrasmusto: Oh, you're welcome :)
16:42jsabeaudryholo, oh wow thanks, I didn't know about clojuresphere
16:42technomancyhyPiRion has been on fire recently =)
16:42weavejestercallenbot: (wrap-session handler {:store (cookie-store secret-key)})
16:42callenbotweavejester: yeah I see it. I'm pondering how to make the wrapping work with my template rendering
16:42holojsabeaudry, you're welcome
16:42callenbotweavejester: thanks for the pointer, it's much appreciated.
16:43technomancyhttp://www.generationgamerz.com/images/post/361/nbaj_02.jpg
16:43rasmustotechnomancy: that symlink? code seems like it should exist somewhere else, are symlinks just not used frequently in clojure projects? (my case may have been special)
16:43weavejestercallenbot: No problem. You can take the session data out and put it into a binding, of course. And lib-noir provides stateful session functions.
16:43callenbottechnomancy: damn dude, now I want to play that.
16:44gtraktechnomancy: sb3j3c2 nyhkhbs is a cheat-code for some reason I can never forget. haven't played in 13 years.
16:44holojsabeaudry, i would gladly provide you my module, but unfortunately it has too much code smell, and is coupled with database details
16:44weavejesterSo you could write: (wrap-noir-session handler {:store (cookie-store …)})
16:44callenbotweavejester: I don't like the stateful session stuff in lib-noir. I have my own cookie and request context stuff floating around
16:44weavejesterAnd then (noir.session/get "foo")
16:44weavejester(noir.session/put! "foo" "bar")
16:45technomancyrasmusto: it'd be nice if it were in clojure.java.io, but it's small enough that it's probably not worth the effort that would take
16:45weavejesterBehind the scenes it uses an atom that exists for the duration of the request.
16:45weavejesterI usually prefer a more functional approach, however.
16:46TimMchyPiRion: Nice solution.
16:46callenbotweavejester: I have my own atom thing I'm using that does that.
16:46hyPiRionTimMc: Chinese wall of Apache Commons solution, praise them.
16:46holoweavejester, are you able to sanely not use session state?
16:47rasmustotechnomancy: understood
16:48TimMchyPiRion: I was trying to work something like that out yesterday. I didn't think of taking the canonical parent and sticking the last path element back on.
16:48weavejesterholo: I just use session state for holding the user ID.
16:48weavejesterholo: I've never needed anything more.
16:49callenbotweavejester: I do the same thing.
16:49callenbotweavejester: I do need a RequestContext thingamajig to keep from getting pissed off though.
16:49hyPiRionTimMc: Well, now you know that trick!
16:49gtrakhow do you expire a cookiestore session without another store?
16:49weavejestercallenbot: Did you implement that?
16:50weavejestergtrak: Cookies have their own expiration mechanism.
16:50holoweavejester, amazing! after some unsuccessful refactorings, i came with the same conclusion (yesterday) - just store the user ID
16:50hyPiRionTo be fair, I was hoping for a cleaner solution, but the "Java on all platforms" kind of breaks down when you're dealing with system specific things.
16:50gtrakah, tell the browser to expire it and hope it complies
16:51weavejestergtrak: Well, if you want to be certain about it, you can set an internal timestamp and check it.
16:51TimMchyPiRion: "Runs on all platforms" is like "it's Turing complete!".
16:52callenbotweavejester: yes but it's not an original idea. I based it on Django/Flask RequestContext and data lifecycles
16:52gtrakah
16:52holoweavejester, ok, that's a lie. i actually store the username too, but the ID is the most important since it's reliable cause it never changes
16:52weavejesterholo: I can't really think of anything else you'd want to store. People give examples like shopping baskets and such, but they're usually better implemented as resources on the server.
16:52callenbotweavejester: I implemented it myself because none of the people who hadn't used Python before had any idea what the hell I was talking about.
16:53weavejestercallenbot: I'd encourage you to release it as middleware, if you have time.
16:53callenbotweavejester: you people will hiss at me because it's not functional.
16:54rbarraudYou people?! <ninja_pose> (Me, myself and Irene) :-/
16:54holoweavester, i store the username, cause every page salutes the user >.> .. i thought it would be slugish to make a query on every page change hehe.. and it's not a big deal if the username is not up to date with the db for this purpose
16:54rbarraudRofl
16:54technomancywe wouldn't do that
16:54technomancywe have bots to do the hissing for us now
16:54TimMc$hiss
16:54TimMc:-(
16:54rasmustoclojurebot: hiss
16:54clojurebotGabh mo leithscéal?
16:54callenbottechnomancy: :D (btw, I was talking to me best friend who also moved to Cali about Seattle. He might follow me there if I move)
16:54TimMcclojurebot: boo is <reply>hiss
16:54clojurebotIn Ordnung
16:55weavejestercallenbot: Sometimes one has to depart from pure functional code, but pure functions are very nice to work with.
16:55rbarraudClojurebot: rant
16:55weavejesterholo: Caching the username seems reasonable.
16:55callenbotweavejester: alright I'll do it. Do you use lib-noir?
16:55rbarraudFail...
16:55weavejestercallenbot: Nope.
16:56callenbotweavejester: you said you didn't right? okay.
16:56callenbotI'll try to keep it ring-only then.
16:56TimMcclojurebot: rant is http://www.ccs.neu.edu/home/shivers/rants/
16:56clojurebotYou don't have to tell me twice.
16:56rasmustoclojurebot: rant
16:56clojurebotrant is http://www.ccs.neu.edu/home/shivers/rants/
16:56weavejestercallenbot: I'm not advocating avoiding lib-noir. If it's useful, by all means, use it :)
16:57weavejesterBut lib-noir tends to advocate a slightly less functional approach than Ring.
16:57callenbotweavejester: I'm just saying that I'll strive for reusability and composability.
16:57weavejestercallenbot: I'm all for that :)
16:57abpcallenbot: That's need a (def (atom ..)) per namespace!
16:57weavejesterWhich reminds me...
16:57rbarraudclojurebot: rant
16:57clojurebotrant is http://www.ccs.neu.edu/home/shivers/rants/
16:58weavejesterI need to release crypto-password
16:58callenbotabp: what?
16:59abpyea the sentence was f**d up
16:59callenbotabp: wat
17:00abpcallenbot: For reusability and composability you need at least one (def x (atom ...)) per namespace. :P
17:00gtrakI thought the point of dynamic binding was that it wasn't composable?
17:00callenbotabp: no I don't
17:00callenbotabp: my thingy works fine.
17:01abpI were joking.
17:01callenbotI use it to shoot stuff from pre-processing middleware to the templates.
17:01callenbotabp: I don't have a sense of humor.
17:02abpAnd I shouldn't do jokes based on my opinions in a technical irc-channel, probably.
17:02holocallenbot, i find the defpages from noir really sweet
17:02callenbotholo: I don't do webapps that way.
17:02callenbotholo: most of my web work is collaborative/team based
17:03callenbotaka I'm working with a frontend guy...that doesn't know Clojure.
17:03gtrakVars shouldn't be in libraries. I hate it when people make assumptions about lifecycles for me.
17:03abpSo no hiccup for you?
17:03callenbotgtrak: so don't use it. boohoo.
17:04callenbotgtrak: I need it and so do a lot of web apps.
17:04hyPiRioncallenbot: The obvious solution is to learn them Clojure.
17:04callenbotgtrak: it's just ring middleware.
17:04callenbothyPiRion: we don't want to repeat this conversation.
17:04callenbothyPiRion: I've been working and running teams long enough to know what's in the cards and what ain't
17:04gtrakcallenbot: just saying, vars are more useful for an application... and not talking about you specifically, other libs have the same problem
17:04callenbothyPiRion: guess what? it ain't in the fucking cards.
17:05callenbotgtrak: well I need a way to shoot data around the handlers. so blah.
17:05abpcallenbot: That can't be put into the request-map?
17:05gtrakyes, I actually like vars more than most of my colleagues, just at the top
17:05weavejestergtrak: You mean like with-connection or something?
17:06gtrakweavejester: I think so?
17:06callenbotabp: hrm. I just got an idea.
17:07TimMc&(format "%02x" (int \#))
17:07lazybot⇒ "23"
17:07gtrakweavejester: yea. I prefer to write extra glue than do surgery on a namespace
17:07brianwong(for [x (range 4)] (println x))
17:07abpcallenbot: Around getting rid of state? :D
17:07brianwongis the reason the nils are at the end in REPL because of the lazy evaluation?
17:07abpmutable*
17:08weavejestergtrak: Agreed. I don't like side channels, especially when they're not written by me ;)
17:08holoany good advice for a unix shell script lisp? or i will just try fish. it looks nice
17:08brianwongas in the side-effects are not guaranteed to happen before the next item is returned?
17:08gtrakI really like vars that I write :-)
17:08gfredericksbrianwong: yeah
17:08gfredericksbrianwong: the side effects happen as the repl walks through the lazy seq to print the nils
17:09gfredericksbrianwong: wrap the thing in doall to see a different effect
17:12ubuntu1hi
17:12gfrederickshi.
17:12holohi
17:12brianwonggfredericks: why doesnt the (for [x (range 4)] (println x)) print anything?
17:13hiredman~for
17:13clojurebotfor is complected
17:13hiredman~for
17:13clojurebotfor is not used often enough.
17:13hiredman~for
17:13clojurebotfor is not a loop
17:13nDuffbrianwong: for creates a lazy sequence.
17:13brianwonga list comprehension
17:13gfrederickshiredman: oh oh is there inference on "is not"? :D
17:14nDuffbrianwong: ...if you want it to execute immediately, and you aren't looking for side effects, you should probably be using doseq instead.
17:14gfredericksnDuff: s/aren't/are/?
17:14nDufferr, right.
17:14brianwongi see
17:15gtraksequences are about values, side effects aren't
17:15gfrederickslaziness and side effects aren't comfortable together
17:15gfredericksthey fight a lot
17:15hiredmangfredericks: I think the verb there is |is| so you would have to say "not a loop is xyz"
17:15brianwong(doc doall)
17:15clojurebot"([coll] [n coll]); When lazy sequences are produced via functions that have side effects, any effects other than those needed to produce the first element in the seq do not occur until the seq is consumed. doall can be used to force any effects. Walks through the successive nexts of the seq, retains the head and returns it, thus causing the entire seq to reside in memory at one time."
17:16brianwongit says that the side effects of a lazy sequence would happen after the sequence is consumed
17:16gfredericksthe "other than those needed to produce the first element" sounds wrong?
17:16brianwongso shouldnt (for [x (range 4)] (println x)) produce the side-effects?
17:16nDuffbrianwong: What's consuming it?
17:16brianwongeven at the end?
17:16brianwongahhh
17:16brianwongnDuff: i see your point
17:16brianwongnothing is using the lazy sequence
17:17nDuffExactly.
17:17nDuffbrianwong: (btw, it's generally "during" rather than "after")
17:17nDuff...and actually, can even be before with chunked sequences
17:19hyPiRionThe only promise is that the side effects will be done before the element is realized.
17:19gtrakbrianwong: also, seqs are read in chunks ##(first (for [x (range 4)] (println x)))
17:19lazybot⇒ 0 1 2 3 nil
17:20gtraknotice first makes all four happen
17:20gfredericksgtrak: only chunked seqs
17:20gtrakgfredericks: sure :-), the point is to foster a healthy paranoia
17:20gfredericksphew
17:21brianwonginterested
17:21brianwonginteresting
17:22brianwongthanks for the help guys
17:22gtrak ##(first (for [x (range 50)] (println x)))
17:22lazybot⇒ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 nil
17:23gfrederickspor eso estamos
17:30thalassios_xelonheloo guys:)))
17:30thalassios_xelon,(+ 1 2)
17:30clojurebot3
17:30holomaybe some girls are present too
17:31thalassios_xelongirls are not clever :P
17:31thalassios_xelonhello holo :)
17:31holohi!
17:31thalassios_xelonholo u girl?
17:31nDuff...eh, easier to /ignore
17:31brianwonghahah
17:32holoi'm a male
17:32gfredericksdon't treed the folls
17:33thalassios_xelonholo are you blond and sexy clojure geek?
17:33holo>.>"
17:33tmciverthalassios_xelon: I'm a blond and sexy geek . . . but I'm a guy. ;)
17:33thalassios_xelonbye :*
17:34gtrak(votekick thalassios_xelon)
17:34thalassios_xelongtrak, dont be evil
17:34gfredericks(dec thalassios_xelon)
17:34lazybot⇒ -1
17:34TimMcC'mon, don't feed. Just /ignore.
17:34gfredericksTimMc: good point. done.
17:34nDuff(inc TimMc)
17:34lazybot⇒ 34
17:35holo(inc holo)
17:35TimMc(And if you're an op, kick.)
17:35lazybotYou can't adjust your own karma.
17:36TimMcgtrak: I think I've heard of IRC clients where /ignore is broadcast/made available to other clients.
17:36arohnergiven defrecord foo, is there an existing way to find its (map->Foo) fn?
17:36brianwong(brianwong)
17:36TimMcA quorum makes compliant clients auto-ignore.
17:36gfredericksarohner: find it?
17:36technomancyinc
17:36ivan)/whois thalassios_xelon
17:36brianwong##(inc 1)
17:36lazybot⇒ 2
17:36gtrakTimMc: ah, fun, it's like git vs svn
17:36brianwong##brianwong
17:36amalloyTimMc: i would want that so hard
17:36brianwongi guess i have no value
17:37brianwongthat makes me sad
17:37xeqi$karma brianwong
17:37lazybotbrianwong has karma 0.
17:37arohnergfredericks: I want a fn like (resolve-map-fn Foo) that returns the result of (resolve 'map->Foo)
17:37gtrakcan we build a git repo for /ignores and have a web of trust?
17:37arohnerbut I want to pass arbitrary records in
17:37arohnerit looks possible using (.getName record) and (.getSimpleName record), but that's a total hack
17:37gfredericksarohner: you want to pass in an instance? or the class?
17:37arohnerthe class
17:37sjlDo Leiningen and Drip work together yet? I followed the instructions but I'm not really seeing any speed boost
17:37holo$karma holo
17:37lazybotholo has karma 0.
17:38nDuffgtrak: Hmm. There'd have to be standards established in terms of tolerance. I've got a lot of entries on my /ignore list from time-wasters as opposed to outright trolls, for instance, but others might not want that.
17:38gfredericksarohner: yeah I'm not sure there's anything for that beyond what you're doing
17:38gfredericksnDuff: we could say /troll
17:38TimMcnDuff: Another problem is that ignores make you blind to a problem, they don't remove it.
17:38gtraknDuff: easily solved with an int rating
17:38aaelonyhyPiRion: fyi, figured out the command i needed earlier for profiling. java -agentpath:/path/to/YourKit_Java_Profiler_12.0.2.app/bin/mac/libyjpagent.jnilib -jar my-uberjar.jar
17:39technomancysjl: they're supposed to, but I've seen reports of non-workage. are you on lein 2.0.0 final?
17:39ivanjcowan/Chouser/rhickey can add people to the access list
17:39ravsterwhat would a credential-fn look like for the http-basic workflow in 'friend'?
17:39thalassios_xelongood night room :)
17:40sjltechnomancy: http://paste.stevelosh.com/51142d5509b5f60007000001
17:40sjlI think that means 2.0.0 final?
17:40sjljust says 2.0.0
17:40technomancysjl: yeah, that's the latest
17:40amalloyand 0.2.3 is latest drip, i'm fairly sure
17:40technomancysjl: sorry; haven't used drip myself, but I saw some patches go in right before lein 2.0.0 landed.
17:40sjlit does seem to start the extra JVM: http://paste.stevelosh.com/51142d2109b5f60007000000
17:41hyPiRionaaelony: oh, sweet.
17:41arohnergfredericks: I just wrote: https://gist.github.com/arohner/4734884
17:41sjldoesn't really speed up much though
17:41aaelony:)
17:41amalloysjl: looks like https://github.com/flatland/drip/issues/57
17:42amalloyninjudd is out of the country for the week, and i'm not really qualified to fix anything, so this will probably get fixed less quickly than usual
17:42sjlso the answer is no, they still don't work together
17:42sjlhah
17:44technomancythere is also https://github.com/technomancy/leiningen/issues/968
17:44technomancywhich doesn't exist yet
17:44technomancyactually I think I have a stash for that; I should at least put it on a branch
17:45amalloysjl: what if you time lein trampoline test?
17:45amalloyi'm thinking that lein test should be using two JVMs (right, technomancy?), and only one of them is being controlled by drip
17:45technomancyamalloy: yeah
17:46sjlamalloy: same thing -- user time drops but real time is (roughly) the same
17:46technomancysjl: `export LEIN_FAST_TRAMPOLINE=y` should allow trampoline calls to avoid launching Leiningen's own JVM entirely for trampolined invocations.
17:46gfredericksarohner: coo
17:46jweissis there a better way to split a list of ints at the max value, other than using map-indexed (or otherwise producing a structure that contains indices)?
17:46technomancythere's also my eshell launcher that avoids the bash script entirely and uses nrepl
17:46technomancywhich doesn't work either
17:47hyPiRionjweiss: Is there only one max value?
17:47technomancyanyway, the point is there are a bunch of ways to do it and none of them work all that well, in conclusion yay open source
17:47amalloyjweiss: i don't think that's possible lazily
17:47jweisshyPiRion: no, there could be more than 1, but it should be split at the first.
17:47sjltechnomancy: no difference
17:47technomancysjl: sorry, I meant repeated calls should be faster
17:48technomancywith LEIN_FAST_TRAMPOLINE
17:48sjloh
17:48sjlyes they are, a bit
17:48sjllike 1s instead of 3
17:48technomancyrepeated calls to the exact same command anyway
17:48sjlyeah
17:48sjltechnomancy: what's the downside to setting this var?
17:48technomancyit memoizes the resulting form to call from that task
17:48technomancysjl: it's not well tested
17:48sjlah
17:48technomancyat some point it should default to on though
17:48hyPiRion,(let [orig (repeatedly 6 #(rand-int 4000)), m (reduce max orig)] [orig (split-with (partial not= m) orig)])
17:48clojurebot[(3109 1760 1057 2537 1965 ...) [(3109 1760 1057 2537 1965) (3144)]]
17:49jweisshyPiRion: thanks!
17:49technomancysjl: there are probably some cache invalidation issues with it where the memoized command would end up being out of date
17:49hyPiRionjweiss: Not sure if it's better, per se.
17:49sjltechnomancy: makes sense
17:49hyPiRionBut it's at least without indices
17:49technomancyif that happens; `lein clean` will take care of it
17:49jweisshyPiRion: i think that traverses the list twice though.
17:49technomancybut changes to project.clj should get picked up
17:49sjlcool
17:49technomancybut (for instance) new versions of a snapshot won't
17:49amalloyjweiss: you can't help but traverse the list twice
17:50technomancybecause project.clj doesn't change, but the proper command does
17:50hyPiRionyeah, you have to find the max.
17:50technomancyFraught with Peril™
17:50jweissamalloy: can't you split a vector at an index without traversing it?
17:51jweissfind the max should be the only traversal
17:52hyPiRionjweiss: is it a vector we're talking about?
17:52amalloyunless your first traversal is to put it into something random-accessible
17:52amalloyeg, you could reduce over the sequence, putting it into a vector and finding the max element; then split up the resulting vector with two subvec calls
17:52amalloyactually, i tell a lie. of course you can do this in one pass
17:52amalloyjweiss: that's what i just said. if you put it into something random-accessible
17:53jweissok thanks
17:54gfrederickstwiceish
17:55gfredericksuse split-at and do it in 3 traversals!
17:56amalloyjweiss: https://www.refheap.com/paste/abcc0036c84dc85622b0f69ce is one way that's interesting, if not necessarily good
17:56gfredericksI guess split-with has that property too
17:56hyPiRion&(first (reduce-kv (fn [[i max :as init] j v] (if (< max v) [j v] init)) [-1 -1] [1 2 10 3 4]))
17:56lazybot⇒ 2
17:56hyPiRionthen do subvec from there.
17:58amalloybut really in a lazy language thinking about the number of times you traverse something is very confusing
17:58dnolenunifier in core.logic is getting fancy - http://gist.github.com/swannodette/4735012
17:58gfrederickswe need a contest where we try to maximize CPU-cycles / source-char
17:59gfredericksit'd be like clojure golf but with an anti-performance component
17:59amalloygfredericks: that'd be a short contest
17:59gfredericksamalloy: sleeping doesn't count
17:59amalloy(#(recur))
17:59gfrederickshrm
17:59gfredericksamalloy: also you have to solve the problem at hand
17:59gfrederickslike splitting a list at the max element
18:00ppppauli have a destructuring issue that i would like help with. https://gist.github.com/boxxxie/4735021 :D
18:00gtrak(dotimes [x 1000] (future (recur)))
18:00gtrak999, rather
18:01gfredericksppppaul: ah ha
18:01gfredericksppppaul: so line 7
18:01gfrederickswait are you trying to make something equilavent to line 2?
18:01ppppaulgfredericks, yes
18:02gfredericksppppaul: okay remove the curly braces around {:keys [body content-length]}
18:02amalloygfredericks: you might find http://en.wikipedia.org/wiki/Busy_beaver entertaining, then
18:02gfredericksamalloy: man I gave a lightning talk on that
18:02gfredericksI don't think I did it well though
18:03ppppaulgfredericks, can you post on my gist?
18:03gfredericksspecifically it was about the "busy beaver sequences grows faster than any computable sequence" part
18:03gfredericksppppaul: yeah
18:03dnolenlynaghk: pretty much done w/ vector & set syntax
18:04ppppaulthanks gfredericks
18:04gfredericksnp
18:06amalloyi apparently don't even know what noncomputable really means
18:06lynaghkdnolen: awesome!
18:07gfredericksamalloy: is it mentioned in the article?
18:07lynaghkdnolen: I've been in meetings and haven't had a chance to look yet =/
18:07amalloygfredericks: yes
18:07gfredericksamalloy: any sequence of numbers you can write a function to compute will provably grow slower than the busy beaver sequence
18:07dnolenlynaghk: the biggest change is that unifier only really takes 1 or 2 args now. in 1 arg case no options - just sequences of terms to unify. 2 args case first arg is the options.
18:08dnolenlynaghk: set & vector syntax both support giving a single constraint, or a seq of constraints
18:08gfredericksamalloy: the proof is a one-line reduction to the halting problem
18:08dnolenlynaghk: there are tests for these different cases - let me know if they don't make sense.
18:09lynaghkdnolen: okay, will do.
18:22gfredericksjson with cheshire should be a faster serialization than pr-str/read-edn, right?
18:23hiredmangfredericks: I don't think there is an inherent reason it should be so, but I believe it is
18:23dxeh_veer,
18:23dxehsuper_?
18:23clojurebotcontribute is http://clojure.org/contributing
18:23hiredmane.g. someone should write a high performance edn codec
18:24gfredericksI wonder if rhickey still wants tools.edn since he added read-edn?
18:24_veerdxeh: ?
18:24mrb_bkdnolen: oooh nice unifying
18:24dxehdo you have another alias "super_"
18:24technomancysjl: highly experimental: https://github.com/technomancy/leiningen/issues/968
18:25dnolenmrb_bk: yes, should make the unifier a lot more useful.
18:25_veerdxeh: why?
18:25dxehcause if you do then maybe you know me _veer :P
18:26_veerokay
18:29mrb_bkdnolen: we should grab a beer and talk about how i can help with some documentation stuff soon
18:30dnolenmrb_bk: hey, that sounds like a great idea!
18:31mrb_bkdnolen: awesome, I'll drop you an email
18:32mrb_bki made my first proper minikanren goal in core.logic and almost jumped out the window in excitement
18:32dnolenmrb_bk: haha, it's pretty great when it clicks.
18:35technomancywow, vimclojure ships with vim now
18:36technomancythat should help a lot considering installation has been somewhat involved from what I hear
18:36mrb_bktechnomancy: confirmed
18:37technomancyI guess that means vim doesn't have a CA policy; good for them =)
18:37technomancyclojure-mode will never ship with Emacs unfortunately due to that
18:40bawrCA?
18:40clojurebotCA is Contributor Agreement: http://clojure.org/contributing
18:41bawrOh, that's useful.
18:50rasmustoif I turn a map into a seq, what's the good way to turn that back into a map? I'm mapping a function to my map, returning a seq of k/v vectors, then wanting to turn that into a map
18:50amalloy(into {} kvs)
18:51rasmustoamalloy: ok, thanks
18:56DerGuteMoritzok I think I found a way to hit the potential bug
18:57DerGuteMoritznow I wonder how to test my patch
18:57DerGuteMoritzi.e. how do I run the cljs test suite?
18:58DerGuteMoritzdoes anyone know?
18:58DerGuteMoritzah, script/test I guess
19:03RaynesIn case anyone wonders why refheap suddenly has 11k pastes vs the 9k it used to have, it's because someone spammed the crap out of it recently, apparently. https://www.refheap.com/paste/11032 is the last 1000 or so pastes.
19:04RaynesAnd congratulations to whoever did this act of elite hackery, pat yourself on the back for spamming the most un-ratelimited pastebin in history.
19:05technomancymad skillz
19:06RaynesUnless of course, as amalloy just pointed out, it could be unintentional. If that's the case, please let me know and complain about there not being a sandbox for testing API stuff so I can point you to the sandbox for testing API stuff.
19:07technomancyit doesn't look spammy spam
19:08amalloyyeah, it looks like someone is running https://github.com/killswitch/dunn/blob/master/plugins/git.js and has it configured to automatically refheap exceptions
19:09shaunxcodesomeone asked earlier if graph supported clojurescript - mid way down the readme: "Also, stay tuned for a ClojureScript version of Graph, coming soon."
19:09RaynesHrm
19:09amalloyRaynes: https://github.com/killswitch/dunn/blob/master/libs/irc.js#L90
19:09RaynesI see.
19:09RaynesSo this is a totally valid usage.
19:10amalloywell, valid usage run amok by him having too many errors. i'd get in touch with him and ask him to chill out
19:10technomancydepends on your TOS =)
19:10RaynesI mean, maybe not sending 1k pastes.
19:10abptechnomancy: In Emacs, can I open the readme.md of a dependency of a Clojure-project I'm working on? M-. let's me jump to a symbols definition. But then from there, I can't further navigate in the jars context apparently.
19:10RaynesBut I don't have any rules.
19:10technomancyabp: M-. into a file in a jar will open both that file and the jar itself
19:11technomancyso look in your buffer list
19:11technomancyabp: that said, we don't include readmes inside the jars right now. there's an open issue for it though.
19:12abptechnomancy: Oh ok. Also the jar isn't in my buffer list. But this is on windows..
19:12technomancyshouldn't matter. are you sure you've opened a .clj file in a jar?
19:13technomancyif so C-x C-f would default to being deep inside .m2/repository
19:14abptechnomancy: yes, buffer-list points into .m2/.. C-x C-f is in there too
19:14abptechnomancy: But C-x C-f context being right is enough. I somehow got the impression thats not the case.
19:15dxehclojure seems quite the interesting language, coming from c/java programming its quite the switchup which is nice
19:15dxehsyntax wise, that is
19:15technomancyhuh... I guess that might vary by OS then; that is surprising to me.
19:16abptechnomancy: Should the jar be opened like a dired buffer..?
19:16technomancyabp: yeah, that's how it works here
19:16ravsterabp: jars in emacs open automatically for me.
19:16technomancyyou can see all the .class files and stuff
19:16ravsterI don't need to do anything special
19:19abptechnomancy: I'm fine with it, I can walk into the jar from the files context, dired-like.
19:19technomancyok, cool
19:20technomancyfeel free to chime in here on the topic of including readmes: https://github.com/technomancy/leiningen/issues/880
19:21ravsterI'm trying to make a credential-fn for 'friend' for the project I'm working on, but I'm getting 'wrong number of args passed [0]' errors. How do I make sure that the cred-fn gets the map of user and password thats coming in from the request? I'm using http-basic workflow.
19:21abptechnomancy: Using emacs for two days now, preceded by a few days of reading the tutorial, memoizing basic bindings, reading .emacs.d's, now using emacs-live. I'm extremely impressed and addicted. :)
19:22technomancycool; have fun =D
19:23brehautwaitaminute, you read the documentation‽ thats not doing it right!
19:24technomancybrehaut: you're supposed to write documentation, not read it.
19:24brehauttechnomancy: wait, you sure you are in the right community?
19:25dxehwhat is reading?
19:25technomancybrehaut: sorry, "you're supposed to chide people for not writing documentation, not for not reading it"
19:25RaynesYou guys sound like antares all of a sudden.
19:25technomancynow I'm just confused
19:25brehauttechnomancy: PHEW
19:26tanzoniteblackshaunxcode: the clojurescript comment was obviously way too unclear...I mean it's in its own paragraph in the readme, how could someone possibly notice it?
19:27abpReadme's being way to long with more then one sentence will be all the rage soon.
19:27dxehis it true there is a "clojurescript" which compiles clojure to js rather than java lmao
19:28technomancylol its true
19:28shaunxcodetanzoniteblack: hah I read the whole thing as it is absolutely solving a problem I face
19:29tanzoniteblackshaunxcode: I'm doing the same; less because it solves a problem I currently face, but more because it might be useful in the future and my brain hurts from debugging all day
19:29tanzoniteblackhttps://github.com/Prismatic/plumbing in case anyone is wondering what readme we're referring to
19:29dxehtechnomancy, you wrote leiningen?
19:30technomancydxeh: guilty as charged
19:30craigbroas transcribed to him by aiwas
19:30craigbrorather, whispered into his ear
19:30dxehimpressive technomancy
19:30craigbrojust like Aleister Crowley
19:30abpshaunxcode: Something related to your datomic workspace?
19:31dxehtechnomancy, i was just like lets look up some random people on github and i laughed so hard when i typed in your name and saw leiningen
19:34amalloyi think he's calling you random, technomancy
19:34dxehthe world is a random place
19:34tommowhat does a : denote before something in clojure, e.g. [:a :b]
19:35brehauttommo: keyword literal
19:35tanzoniteblacktommo: http://clojure.org/data_structures#Data%20Structures-Keywords
19:35brehaut(a keyword is a symbol that refers to itself rather than something else)
19:38ravstercemerick: how should I go about making a credential-fn for http-basic that hooks into a function that I already have that checks usernames & passwords against those in a DB?
19:38shaunxcodeabp: yes actually, I have actually started working on feature enhancements in the coffeescript branch whilst I wait til I am happy with "best practice" in cljs branch
19:39cemerickravster: you just need to create a fn that calls what you already have, and returns an authentication map on success
19:40cbphowdy
19:40headshothowdy
19:40cbpanyone here preparing or planning to prepare for google codejam?
19:41dxehcbp, google codejam?
19:41ravsterI'm trying that, the code I have is at https://www.refheap.com/paste/11034 , but I'm getting a 'wrong number of args passed [0]' error.
19:41headshotcoding competition
19:42hyPiRioncbp: Yeah
19:42cbpdxeh: http://code.google.com/codejam/
19:42abpshaunxcode: Sounds reasonable. Getting a satisfying cljs-environment in terms of libs etc. is a lot of work.
19:43dxehcbp, reverse engineering?
19:43DerGuteMoritzhttp://dev.clojure.org/jira/browse/CLJS-467 <- if anyone is interested in my findings with regards to the bug I mentioned earlier
19:43hyPiRiondxeh: algorithm and data structures
19:44cbpI just solved a problem that was taking me over 2 hours with (memoize fn) and got excited
19:44cbpI was considering using a more iterative language for the contest but now I think i'll stick to clojure
19:44ravstercemerick: this function should return a map with {:name, :identity, :roles, etc}. That counts as a valid authentication map, right?
19:45xeqiravster: are you useing `:credentials-fn friend-authenticate` ?
19:45dxehim just picking up clojure, heard about it a year or 2 ago and have seen code snippets but never really looked into it
19:45hyPiRioncbp: I'd recommend going polyglot. I go Java for things like Floyd-Warshall and Dijkstra, but Clojure if there's combinatorics or permutations
19:45dxehseems quite cool though
19:45shaunxcodeabp: yeah, I am definitely heavily devoted to building the cljs ecosystem but I also want to "ship" features as I do that.
19:46hyPiRionThough I've realized you can get very far with just Clojure.
19:46dnolenDerGuteMoritz: thanks looks right to me, I've assigned the Michal to confirm
19:46dnolenassigned to
19:46DerGuteMoritzdnolen: alright, thank you!
19:46ravsterxeqi: arrghh, no. I had that inside parens.
19:46dnolenDerGuteMoritz: please do send in your CA ;)
19:46dnolenDerGuteMoritz: that's a good catch, could use more of those.
19:46ravsterxeqi: thanks :$ thats embarrassing
19:47xeqiravster: np, happens to everyone at some point
19:47cbphyPiRion: yes I'll probably do that
19:52DerGuteMoritzdnolen: yeah I'll try to do that as soon as possible, might take a moment though coming from Germany. on a different note, do you happen to know what license restrictions apply when I port code from cljs core to another language?
20:14abpNow there's an opportunity to beat the shit out of everyone who took the read*-issue lightly (like me): (alter-var-root #'*read-eval* (constantly :unknown)) on the top-level of every public ns of your libraries. :D
20:15technomancyabp: `lein new app mythingy` already includes that =)
20:15amalloytechnomancy: i think you missed the joke there
20:16abptechnomancy: read closely, and have a look at richs latest commits. :P
20:16technomancyuh oh
20:16abpHm, I can't resist joking in here.
20:17amalloyabp: i'm not clear on how that's a more interesting "attack" than putting (/ 1 0) at the top level of all your namespaces, though
20:17xeqiI prefer ziping everything in src/ and sending it to a web server
20:17abpamalloy: Not attack, more in spirit of teaching a lesson. Secure your reads, a*
20:18abpamalloy: Via explicit *read-eval*-binding like loudly proposed
20:31abpAny pointers on how to start learning git, preferably with magit, if that makes any sense?
20:32hiredmanabp: http://mirror.linux.org.au/pub/linux.conf.au/2013/ogv/Git_For_Ages_4_And_Up.ogv
20:32technomancyabp: magit has a screencast that's good
20:34abphiredman: technomancy Thanks!
20:59charlietanksleyabp: I don't know about learning git, but the magit user manual is pretty thorough: http://philjackson.github.com/magit/magit.html
21:00charlietanksleyabp: I try to pick some random thing I find myself doing on via the cli every week or so, looking it up there, and trying to add just that to my magit workflow.
21:05lynaghkcharlietanksley, abp: whenever I get into a new mode in emacs I always "C-h m" to see what commands are available. (I do pretty much everything in magit now.)
21:07abpcharlietanksley: Sounds good, since I'm new to Emacs I try to learn it as broad of an replacement as possible. I haven't done much with git on the console anyway, so going magit from the beginning will work or not.
21:08charlietanksleylynaghk: good call.
21:09charlietanksleyabp: I'm not sure how that will work. Good luck with it!
21:09abplynaghk: sam is crazy, he's rebound C-h to delete in emacs live.
21:10technomancyeep
21:11abpOh and made it M-h
21:13abplynaghk: Thanks, thats really cool!
21:13lynaghkabp: yeah, no problem. it's the only emacs trick I really know, but you can use it to find out all of the other tricks =)
21:13abpStill can't believe I've procrastinated on learning Emacs until now...
21:14cemericklynaghk: welcome back :-)
21:14lynaghkabp: you have taken the first step on the journey of a lifetime...
21:14abpActually, people I've pushed into Clojure pushed me into Emacs in return.
21:14lynaghkcemerick: thanks! I'm so happy to be back in PDX. The Internet is now on a screen larger than 10 inches
21:14technomancyreturning the favour =)
21:15cemericklynaghk: were you gone long enough to start going a bit bonkers?
21:19lynaghkcemerick: yeah, especially in the more rural parts of New Zealand
21:20lynaghkcemerick: also traveling with the same person for six weeks, that was a bit intense. I did swing by SF on the way back for a week though and got to visit a lot of folks there
21:20brehautlynaghk: whats 'more rural'?
21:21lynaghkcemerick: in San Francisco the Internet is, like, a real thing. With billboards and everything
21:21lynaghkbrehaut: Riwaka on the South Island, which is a suburb of Moteuka
21:21brehautlynaghk: i am from the south island ;)
21:21lynaghkbrehaut: sorry I didn't get in touch, by the way. We were pretty busy for the days when we were in Auckland
21:21brehautlynaghk: thats no problem at all
21:21cemerickbrehaut: dude, don't trip over the village's internet wire
21:22lynaghkbrehaut: ah, cool. Are you coming out to Clojure/west by any chance? A lot of the stuff I saw in the South Island reminded me a lot of Oregon.
21:22brehautcemerick: theres only one. we are all very careful with it
21:22brehautlynaghk: sadly no. way too far to travel
21:22brehauti might make it to YOW!/Lambda Jam
21:22cemerickbrehaut: my mental image is too hilarious for words
21:23brehautcemerick: until kim dotcom builds a second cable, there is literally only one internet cable
21:23brehautpart of the reason everythign down here is slow as molasses
21:23cemerickreally? I thought there was a whole aws region in NZ?
21:24lynaghkbrehaut: I was talking with some nerds in Wellington and they said there was plenty of capacity, but that the provider basically just charged a ton for everything---whenever there is a credible threat that someone will build another cable the Internet cost mysteriously goes down
21:25brehautlynaghk: yeah providers charging insane amounts is basically par for the course here
21:25brehautnot enough demand to create real competition
21:25cemerickoh, the AP region is in Sydney, my bad
21:26tommowhat does # denote for example infront of a set?
21:26brehautlynaghk: im not surprised riwka / moteka reminded you of oregan
21:26brehautthats hops country
21:27brehaut(and riwaka is also a variety of hop)
21:28brehauttommo: in front of a set? ##{:a :b}?
21:28lazybot⇒ {:a :b}
21:28lynaghkbrehaut: re: beer, I'm tempted to buy a case of Moa's St. Joseph. That stuff was awesome
21:28tommobrehaut: yeah
21:28cemericktommo: #{} *is* a set
21:28cemerick{} is a map
21:28brehautlynaghk: its pretty good eh, i quite like their five hops in mid summer too
21:29tommocemerick: ohh ok, i thought i seen them used elsewhere, that makes sense, ty
21:31brehautlynaghk: did you get a chance to try any renaissance or 8wired beers there?
21:39gfredericksTimMc: hyPiRion: if neither of you are going to be at clojure/west I will submit a lightning talk on swearjure.
21:43craigbronew AUtechre album!
21:46gfrederickslein will not let me create a project in an existing directory? :/
21:55TimMcgfredericks: You have my blessing.
21:55abpO R G
21:57abpWhen I memoized those org-todo key-bindings ST2 travels into trash and everything's E
21:57technomancy=D
21:58abpbrb, sleepersisting those bindings.
23:44cemerickbizarre; I think a particular rev of firefox is what was causing my ff/browser-repl problems a few weeks ago