#clojure logs

2012-11-02

00:00frenchypok, thanks for clearing that out
00:10brainproxybest practices for exception messages?
00:11brainproxyi.e. should they (never) contain line breaks? maximum length?
00:26jkkramerbrainproxy: no advice from me re messages, but you might consider using ex-info to include relevant data in the exception for the caller to check out
00:29TimMcSee notes on slingshot.
00:36brainproxyjkkramer: thanks
00:36brainproxyTimMc: slingshot looks awesome, need to remember to make a study of it
01:20myguidingstarxeqi: thank you so much. I've written a very first repl
01:20xeqimyguidingstar: hurray!
02:30ForSparePartsDoes Clojure code get cached somehow by clojure.lang.Compiler?
02:30ForSparePartsIt looks like my Java program is running an old version of my Clojure code, but I don't know why.
02:38amalloyAOTed code lives on disk, and its compilation is generally pretty mysterious. lein clean will get rid of it
02:45ForSparePartsamalloy, How can I load a file on demand?
02:46ForSparePartsLike outside of the classpath?
02:47ForSparePartsI tried Compiler.loadFile(), but as you pointed out, that's getting me AOT'd code.
04:22wingyis there a way to make an xml string without the <xml> tag https://www.refheap.com/paste/6336
04:34_uliseswingy: any reason why you'd want that? is it to compose xml snippets?
04:34wingy_ulises: im going to send xml in a http request for a service and its documentation shows xml without the xml tag
04:35_uliseswingy: strange; have you tried sending the xlm with the <xml...> and seeing if the service complains? perhaps the <xml...> bit was omitted from the documentation for brevity
04:36wingy_ulises: perhaps they accept without xml?
04:36_uliseswingy: in any case, you could try generating the xml using hiccup
04:37wingyyeah that would be as good
04:37wingyeasier to write since you don't have to use xml/element to create it
04:38amalloyyou don't have to use xml/element for data.xml either
04:38_ulisesamalloy to the rescue! \o/
04:38amalloyi added sexp-as-element to data.xml, which takes hiccup-style vectors
04:39wingyamalloy: in what version? i get an error while trying that
04:40amalloy*shrug*
04:40amalloy(and if you're using clojure.xml for anything...god help you. use clojure.data.xml, or any other viable tool)
04:40wingyim using clojure.data.xml
05:37maleghastMorning All...
05:40ejacksonmorning
05:41maleghastAnything exciting happening today?
05:41_ulisesmorning
05:41maleghastI mean it __is__ Friday ;-)
06:19hyPiRionIt's the last day before tomorrow, if that counts for anything.
06:30wingyhuh?
06:31Raynes*whoosh*
06:35ejacksonwhooooooosh
06:35ejacksoni'm enjoying your enthusiasm there Raynes
06:35Iceland_jackAre you?
06:36ejacksoni'm a big fan of enthusiasm
06:40_ulisesI'm just an enthusiast of enthusiasm
06:40_ulises*badum tish*
06:41ejacksonwell done.
07:03CheironHi, I want to add Maven Central repo to project.clj to get http://search.maven.org/#artifactdetails%7Corg.apache.zookeeper%7Czookeeper%7C3.3.2%7Cjar
07:03Cheironwhat is the address of it?
07:17jakubHCheiron: I believe that maven central is checked by lein by default
07:26clgvjakubH: Cheiron: yes, maven central is a default repository that is checked by leiningen
07:27Cheironclgv: jakubh: then I don't know why it is complaining when getting zookeeper's Sun's jmx jars
07:27clgvCheiron: well, what exactly does it complain?
07:27CheironThanks by the way!
07:27Cheironit can't get jmxri and jmxtools
07:27clgvCheiron: most likely you have an error in [group-id/artifact-id version]
07:27jakubHthere are always problems with things like the jmx jars; dtailed log of the error would help
07:28Cheironwill install them manually
07:28jakubHif you have maven, you can also run lein pom and mvn -X dependency:resolve to get detailed error messages
07:28clgvCheiron: I dont see any direct dependency named "jmx..." in that POM
07:29jakubHCheiron: you might also try to add the java.net repo as shown in https://github.com/technomancy/leiningen/blob/master/sample.project.clj
07:30CheironI will, thanks fellas
07:33jakubHjava.net doesn't help
07:33Cheironmeh, [org.apache.zookeeper/zookeeper "3.3.2"] needs jmx libs somehow
07:33jakubHthe problem with Sun is that these stupid libs are under a license that doesn't allow them being in maven central
07:34jakubHhere is it described: http://onemanwenttomow.wordpress.com/2007/12/31/maven2-log4j-and-jmx-dependencies/
07:35jakubHthe same here http://stackoverflow.com/questions/7323248/coludnt-find-the-following-dependencies-com-sun-jmxjmxrijar1-2-1-and-com-su
07:35jakubHreally extreme pain imposed by Sun+Oracle on the poor world :(
07:41CheironjakubH: Thanks fella!
07:45jakubHyw
08:13mklappstuhlhttps://www.refheap.com/paste/6339
08:19xeqimklappstuhl: mean-daily-returns calls (daily-returns (:etf trade))
08:19xeqiwhich eventually gets to parse-file, which does :etf again
08:20mklappstuhlxeqi, man you were fast I was still writing (got distracted then)
08:20mklappstuhlxeqi, thank you
08:23mklappstuhlxeqi, how would you approach/debug this kind of issue beside looking at the code? It's hard to tell where stuff fails with clojure sometimes
08:26xeqimklappstuhl: I've heard about debuggers like https://github.com/pallet/ritz or the one in eclipse, but I usually manually walk it or stick printlns in
08:28xeqifor example here, println in parse-file to make sure trade is nil, then println in daily-returns and see that trade is nil, then see (:etf trade) in mean-daily-returns
08:28xeqifor more complex things the call stack is invaluable
09:14shriphanihello everyone. I have a question about how somethings in scheme map to clojure. I remember that I could place several defines inside a function definition and use them in the function body. Apart from (let [foo (fn [x]…))) is there a better way to do something about internal functions that don't fit in a line ?
09:23swarmershriphani: letfn ?
09:23shriphaniswarmer: thanks.
09:57Cheironany good libraries to work with HTTP in clj?
09:58_ulisesCheiron: try clj-http
09:58Cheironany another funky cool lib?
10:02notsonerdysunnyis there a way to have lein2 not check for the project dependencies from the web.. because I know they are already there in the local "~/.m2" cache .. and some of them are installed by me using "lein localrepo" .. this additional checking unnecesarrily delays starting of swank
10:04cemericknotsonerdysunny: use `lein -o …` for offline mode
10:05MasseRWhat's the library name for pattern matching?
10:05xeqicore.match
10:06MasseRThanks
10:07notsonerdysunnythanks cemerick
10:07notsonerdysunnyI am not able to get how to run lein2 swank-wrap .. I have already set the :main namespace in the project.clj so I tried "lein2 swank-wrap [4005]" with no success .. can you please help?
10:09notsonerdysunnyspecifying the namespace again on the lein2 commad helped me run lein2 swank-wrap 4005 <main-ns>
10:09notsonerdysunnythanks
10:11alexnixonDoes a function already exist in clojure which can replace the anonymous fn here (essentially a non-variable-args version of 'apply')?: (condp #(%1 %2) 42 nil? "nil!" number? "number!")
10:13alexnixon(I can see other ways of writing this to achieve the same effect but I'm just interested whether this fn exists)
10:17mklappstuhlxeqi, how would I access the call stack?
10:18_ulisesalexnixon: why not use (comp apply vector)?
10:18_ulisesalexnixon: I know that wasn't your question though :)
10:20alexnixon,(condp (comp apply vector) 42 nil? "nil!" number? "number!")
10:20clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core$apply>
10:20_ulisesoh, it'd have to be the other way around
10:20_ulisesI mean, reverse ... never mind, ignore me
10:21alexnixon_ulises: you can get close using apply with (condp apply [42] nil? "nil!" number? "number!")
10:22_uliseshrmph
10:25Gmindwhy (defn factorial2 [acc n]
10:25Gmind (if (< n 2)
10:25Gmind acc
10:25Gmind (recur (* acc n ) (dec n)))) will run for (factorial2 1 20) without overflow but larger will be trouble ?
10:25Bronsami sta venendo il cancro
10:25Bronsaops. wrong chan.
10:25solussdGmind: use *' instead of *
10:26solussdit'll auto-promote to BigNums
10:26Gmindwhile (defn factorial [n acc] (if (< n 2) acc (recur (dec n) (* acc n)))) will be able to get to > 5000
10:26solussdGmind: also, it should never be overflowing, you should be getting an overflow exception
10:27GmindYep, it's an exception
10:28GmindArithmeticException integer overflow
10:28clgvGmind: the long type is finite. so if you exceed it you get an exception. with *' clojure will convert the long to a BigInt which can have arbitrary size
10:29solussdyeah, BigInt, not BigNum.
10:31Gmindclgv mean "cai l*n gi vay" ?
10:32Gmindsolussd: what's the difference ?
10:32clgvGmind: hwat?
10:32Gmindwhat's your nick mean ?
10:32GmindI just guess its meaning
10:32mklappstuhlI'm generating a list of hashmaps here but I'd like to have these sorted by one field ...
10:32clgvnothing special
10:32solussdone is for ints, the other for floats, etc
10:32mklappstuhlhow would I use something like sorted-map in this case?
10:32mklappstuhlhttps://github.com/mklappstuhl/computational-investing.clj/blob/master/src/mklappstuhl/stock_utils/data.clj#L31
10:32clgvmklappstuhl: sort-by
10:34clgv&(sort-by :b [{:a 10 :b 1} {:a 2 :b 2} {:a 8 :b 3} {:a 1 :b 4}])
10:34lazybot⇒ ({:a 10, :b 1} {:a 2, :b 2} {:a 8, :b 3} {:a 1, :b 4})
10:34clgv&(sort-by :a [{:a 10 :b 1} {:a 2 :b 2} {:a 8 :b 3} {:a 1 :b 4}])
10:34lazybot⇒ ({:a 1, :b 4} {:a 2, :b 2} {:a 8, :b 3} {:a 10, :b 1})
10:40Gmindclgv: thank for *', that really work
10:41clgvGmind: the main problem with faculty is that it grows so fast ;)
10:42GmindI'm new to Clojure, as on the way exploring its feature, and I stopped at this Recur keyword for a while. Must be me way too familiar with the old recur way
10:43clgv"old recur way"?
10:53Gmind1clgv: like non-tail recursion
10:56solussdpart of me likes the fact that I must be explicit in performing tail call recursion, rather than knowing that certain seemingly inefficient code will be optimized into tail call recursion by the compiler (like in scheme)
11:05Gmind1solussd: as paul said somewhere if I can remember right, he said that writing code is what developer responsible for, optimization is what compiler made for.
11:06Gmind1.. anyway, just laughing so much when reading this http://c2.com/cgi/wiki?WhyWeHateLisp =]
11:06solussdGmind1: and I wholeheartedly agree-- that said, i dont want to have to avoid recursive calls altogether b/c i dont know weather or not they;ll blow up. if I explicitly make a tail call in a way I know is "safe", I'll use more tail calls. :D
11:07Gmind1some reasons are very ridiculous
11:07solussd*whether
11:07MasseRThe match library has a warning that it's alpha quality and shouldn't be used with aot. Does 'lein uberjar' aot compiling?
11:08Gmind1that's right . I just feel it's not straight forward sometimes =.="
11:09jweisscan someone recommend a way to log to a different file for each thread in the system? seems inefficient to have one function look up the current thread name and rebind *out* to a FileOutputStream to the thread's file every time a log statement is written.
11:10jweissand using a binding form doesn't work either, because of futures and binding conveyance
11:13clgvMasseR: if you specify a :main class with a "-main" function then there will be AOT compiling
11:14clgvjweiss: you could use java's ThreadLocal class
11:15clgvjweiss: that one will call an initialize method for every thread it was not used yet
11:19MasseRclgv: Ok thanks
11:31clgvHow do I get something more detailed than "Error loading project.clj" from lein2?
11:40ambrosebsPretty cool example of what occurrence typing/heterogeneous maps helps Typed Clojure infer https://gist.github.com/4001974
11:42Anderkentclgv: run with DEBUG set
11:42Anderkentclgv: DEBUG= lein <command>
11:43clgvAnderkent: thx
11:45pjb3Hey, I have a clojure app where I'd like it to connect to one database if it's running tests and a different database otherwise
11:46pjb3is there a way to set an env var or something when you run lein test?
11:46pjb3I mean, I could do APP_ENV=test lein test
11:46eggheadI usually use bindings for that pjb3, something like (with-dev-db (db stuff))
11:46pjb3but it seems like there must be a conventional solution to this already
11:47eggheadI'm not sure if it's the best solution, but having stuff like *dbhost* and *dbport* be dynamically bound has worked for me
11:47pjb3egghead: but how do you make the binding behave differently depending on if you run lein test vs. if you are just running the code in lein repl
11:48stackhello, I was wondering why about this strange code https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RestFn.java
11:49eggheadlein test is hard coded to use the test bindings, lein repl I use whatever bindings I want
11:49alexnixonpjb3: I've used midje's 'around' form for that in the past
11:51pjb3egghead: how is lein test hard coded to use the test bindings?
11:52pjb3like, in every test you surround it in (with-dev-db)?
11:53eggheadya
11:53eggheadagain, probably not the coolest/cleanest way to do it, just what i've done in the past :)
11:58alexnixonegghead: AIUI that's an idiomatic solution
11:59eggheadgood to know
12:01pjb3not a fan of wrapping every call in the tests in a macro
12:03pjb3I know it's heresy in the Clojure community, but a global var is a better solution then bindings that are dynamically scoped at a high-level, IMO
12:03alexnixonpjb3: you could consider using midje: look at the sql example example under "The longer version" https://github.com/marick/Midje/wiki/Setup%2C-Teardown%2C-and-State
12:04dnolenpjb3: it just depends.
12:12pjb3starting to think APP_ENV=test lein test isn't such a bad solution :)
12:12technomancypjb3: typically you would load test-specific config from the test-resources directory, which is only on the classpath during test
12:13pjb3test-resources?
12:13technomancyyou don't need any special support from your testing lib just to change the DB connection parameters
12:14pjb3technomancy: is there an example of this somewhere?
12:15technomancypjb3: all the projects I've worked on have used the same config for dev/test and just pulled in special config during production from the deployment mechanism
12:15technomancyso I don't know off the top of my head
12:16pjb3technomancy: what did you mean by test-resources directory, like test/resources/dbconfig.clj or something?
12:17technomancyno, just test-resources/config.clj
12:18pjb3what is test-resources? Is that a leiningen thing?
12:18technomancyyeah
12:18pjb3is that mentioned in the docs somewhere?
12:18joegallotechnomancy: i work on a project like that, we do the same thing.
12:19technomancypjb3: dev-resources certainly is... not sure about test-resources
12:19technomancyjoegallo: you don't say?
12:19bobbrahmsI have this large java maven spring project that I'd like to use clojure with. I'm using clojure-maven-plugin. The existing java build builds classes into target/classes. When I mvn clojure:compile I get ClassNotFound exceptions where I refer to my java classes. How do I tell the clojure-maven-plugin where to look for my java classes?
12:19joegallosmall world
12:21technomancyhttps://github.com/Seajure/metaverse/blob/master/test/metaverse/nser.clj
12:22technomancy^ nix for namespaces
12:26eggheadi've been doing that scala course by odersky, its making me appreciate clojure more and more
12:28dnolen_low hanging CLJS fruit for somebody w/ CA who wants to help out - fix Herwig's patch for CLJS-401, then we can cut a new CLJS release - http://dev.clojure.org/jira/browse/CLJS-401
12:29bobbrahmsCan anyone tell me how to tell clojure-maven-plugin where to look for my java class files?
12:29bobbrahmsor point me in the right direction?
12:30bobbrahmsI'm trying to add clojure to my spring project, but the plugin doesn't seem to know where my java class files are.
12:31technomancybobbrahms: the guy who knows clojure-maven-plugin lives in new zealand, so you're not likely to get a response for another few hours just fyi
12:32bobbrahmsThanks for the info!
12:44Anderkentbobbrahms: can you do clojure:repl and print out the classpath? See if target/classes is on it (it should).
12:48qubit[01]!paste
12:48qubit[01](paste)
12:49qubit[01]Hi all, Im new to clojure, I have a file that im parsing whose 4th and 3rd columns are high and low temperature, how would I store the smallest spread ? http://pastebin.com/0BANKrmF
12:49qubit[01]Im struggling with how to set the variable, I know (min ), just how do I assign it to something to return ?
12:51S11001001qubit[01]: you can't set variables
12:51S11001001&(doc min)
12:51lazybot⇒ ------------------------- clojure.core/min ([x] [x y] [x y & more]) Returns the least of the nums. nil
12:51S11001001qubit[01]: be prepared for a completely different way of problem solving than what you're used to
12:51S11001001&(doc line-seq)
12:51lazybot⇒ ------------------------- clojure.core/line-seq ([rdr]) Returns the lines of text from rdr as a lazy sequence of strings. rdr must implement java.io.BufferedReader. nil
12:51S11001001&(doc map)
12:51lazybot⇒ ------------------------- clojure.core/map ([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls]) Returns a lazy sequence consisting of the result of applying f to the set of first items of each coll, followed by applying f to the set of second items in ea... https://www.refheap.com/paste/6342
12:51S11001001&(doc apply)
12:51lazybot⇒ ------------------------- clojure.core/apply ([f args] [f x args] [f x y args] [f x y z args] [f a b c d & args]) Applies fn f to the argument list formed by prepending intervening arguments to args. nil
12:52S11001001qubit[01]: everything I just asked lazybot about are your essential tools to solve your probelm
12:52S11001001problem
12:52qubit[01]hmm
12:53Anderkentqubit[01]: you might want to make a function that given a filename returns a list of differences between 3rd and 4th column values
12:54qubit[01]ahh ok, thanks :)
12:54Anderkentqubit[01]: then having that list you can reduce it the smallest one using min
12:54qubit[01]coolio, I'm working through codekata to try to learn clojure
12:54S11001001&(min 2 3 1 4 5 7 32)
12:54lazybot⇒ 1
12:54Anderkenthave fun :)
13:00jro(defn lz[i] (cons i (lz (lazy-seq (inc i))))) (take 3 (lz 3))
13:00jroStackOverflowError ontrail.core/lz/fn--408 (NO_SOURCE_FILE:31)
13:02rjoI do not see problem in my lazy sequence ^
13:07raekrjo: (assuming you are "jro") you should write it as (defn lz [i] (lazy-seq (cons i (lz (inc i)))))
13:08raekthat is, lazy-seq wraps a seq (here a cons) and delays it
13:10rjothanks! I was looking the documentation in (defn lz [i] (lazy-seq (cons i (lz (inc i)))))
13:10rjohttp://clojuredocs.org/clojure_core/clojure.core/lazy-seq
13:10rjosorry
13:11rjois this somehow releted to (clojure-version)
13:11rjo"1.4.0"
13:11rjosince the documentation is for 1.3
13:11AnderkentAnyone using REPL-y had an issue where ctrl-c while entering multiline statements messes up your terminal?
13:12raekrjo: you can also write it like this: (defn lz [i] (cons i (lazy-seq (lz (inc i)))))
13:12raekbut then the first step is not lazy
13:12Anderkentrjo: in general your recursion must be within lazy-seq
13:12raekrjo: in your example you had the lazy-seq around the argument to lz, not around the (lz ...) expression)
13:19rjooh, thanks. I was blind.
13:24bobbrahmsAnderkent: The directory is in the classpath. I see where my error is, I have the class in a different place than it should be. Thanks!
13:25AnderkentGlad you figured it out.
13:25qubit[01]how do I get this http://pastebin.com/mQsjcJHT to work, its just returning the entire list instead of the max entry in the list
13:25qubit[01]is there a spread operator in clojure ?
13:26alexnixon,(doc apply)
13:26clojurebot"([f args] [f x args] [f x y args] [f x y z args] [f a b c d ...]); Applies fn f to the argument list formed by prepending intervening arguments to args."
13:27rjois it generally a good pattern in clojure to define lazy seqs?
13:28technomancyrjo: depends what "define lazy seqs" means?
13:28rjowell, in this case I wanted to create time intervals consisting of weeks
13:29rjoso I wrote:
13:29rjo(defn from [date-time] (cons (week-period date-time) (lazy-seq (from (time/plus date-time (time/days 7))))))
13:29rjo(defn n-weeeks-from [date-time n] (take n (from date-time)))
13:29qubit[01]any critiques on this http://pastebin.com/Kv2LdgYg ? Gets the lowest temperature spread from a column based file
13:29technomancycalling lazy-seq directly is usually unnecessary unless you're writing very low-level code
13:30TimMcReally?
13:30mpanIs there an approximate equivalent to the programming style of http://hackedbellini.org/development/writing-asynchronous-python-code-with-twisted-using-inlinecallbacks/ for doing evented code in Clojure?
13:31TimMcIf by "low-level" you mean "helper fns", sure.
13:31rjotechnomancy, do you mean that (n-weeks-from [date-time n] ... (map (partial * 7) (range 0 n)) is better?
13:32technomancyrjo: probably, yeah
13:32mpenetmpan: Lamina is probably what you are looking for
13:33technomancyTimMc: I've only written a lazy-seq directly once, and even that I realized three hours later could be expressed in terms of for
13:33mpanAnd sort-of related to the previous question: Is there a way to make a "generator"? i.e. some value that can be called and maintains internal execution state between calls
13:33mpanmpenet: I'll look into that. Thanks!
13:33TimMcmpan: lazy-seq :-)
13:33raekmpan: lazy sequences and functions closing over atoms can both be used for that
13:34S11001001&(doc reductions) ;mpan, or what TimMc said
13:34lazybot⇒ ------------------------- clojure.core/reductions ([f coll] [f init coll]) Returns a lazy seq of the intermediate values of the reduction (as per reduce) of coll by f, starting with init. nil
13:34raek'iterate' can be worth checking out too
13:34mpanThose take explicit state passed in and out?
13:34rjois there any other differences in those two, other than just the style?
13:35S11001001mpan: yep
13:35raekmpan: yes, state is "updated" via recursion
13:35mpanBut is there a way to write code such that an expression "yields" multiple values as it gets called multiple times?
13:35mpanOr is that stylistically non-idiomatic?
13:35S11001001mpan: that is stylistically verboten.
13:35raek(lazy-seq ...) is kind of like yield
13:35S11001001mpan: referential transparency is greatly favored
13:35technomancympan: if you have multiple values, you should use a seq
13:35mpanAll right. Thanks so much, you all!
13:37Anderkentqubit[01]: looks okay, you can use % instead of %1 in your lambda if you only have one arg in it. You might also want to use split-lines instead of split, unless you really only want \n and not \r\n.
13:37qubit[01]Anderkent, ok both good suggestions :)
14:02qubit[01]who would I return a range in a list, like arr[5 .. 12] ?
14:02qubit[01]which would return elements 5 - 12 as a new list
14:02dgrnbrgqubit[01]: are you using vectors or sequences?
14:02technomancyqubit[01]: take/drop
14:02dgrnbrgor subvec
14:03qubit[01]vectors
14:03qubit[01]ok cool
14:06xeqimklappstuhl: you could (throw (Exception. "forced exception")) or such when the :eft in the case your paste had. There are other ways, but thats the easiest
14:07TimMcqubit[01]: NB: subvec just does index arithmetic on the original vector (and thus keeps a pointer to the whole thing).
14:32qubit[01]any critiques on this binary search in clojure ? Doesnt quite feel right http://pastebin.com/9mi9f1ti
14:35S11001001qubit[01]: change bsearch calls to "recur" instead
14:35qubit[01],(recur)
14:35TimMcqubit[01]: You're using a random-access algorithm on a sequential-access data structure.
14:36clojurebotExecution Timed Out
14:36S11001001qubit[01]: also remember that `if' is like ternary op, not a "statement"
14:36qubit[01],(doc recur)
14:36clojurebotNo entiendo
14:36nDuffqubit[01]: ...by the way, please consider using a pastebin without the flashy animated ads in the future. gist.github.com and refheap are both good.
14:36technomancynDuff: how many times is this going to happen before you break down and submit a lazybot pull request? =)
14:36S11001001qubit[01]: and refheap is clojurian so it's all dogfoody
14:37TimMcmmm, dogfood
14:37qubit[01]kk thanks all
14:37qubit[01]https://www.refheap.com/paste <-- much prettier
14:37nDufftechnomancy: Heh. Last time I looked at lazybot's source, I didn't see a bunch of known existing triggers there -> assumed they were out-of-band somewhere, and didn't want to dig.
14:38technomancynDuff: annoyance is a powerful motivator though
14:38qubit[01]TimMc, what is a random access data structure in clojure ?
14:38TimMcvector
14:40qubit[01]coolio
14:45TimMcnDuff: Oh those args... that must be for hinting, yeah?
14:47nDuffTimMc: Hard to have hinting work right if you don't know the object you're going to be invoked against until runtime... and why not take class/type names, then, rather than meaningless names?
14:49TimMc&(let [& 5] ((fn [&] &)))
14:49lazybot⇒ 5
14:54dnolen_bbloom: CLJS-401 resolved
14:54eggheadis there something like 'some' that will return the found item rather than just returning true or false?
14:55eggheadi.e. return the first thing in the collection to satisfy th epredicate
14:55technomancyegghead: (comp first filter)
14:55eggheadhmm, and so because first is lazy it won't filter the entire collection?
14:56eggheadpretty nice... thanks technomancy
14:56technomancysure
14:56technomancymight be more complicated with chunked sequences
14:57eggheadhmm, swapping out (comp first filter) with some worked... now to try to wrap my head around how that composition works...
14:57bbloomdnolen_: good
15:01TimMc&(let [& 0 ampers (memfn assoc & _)] (ampers [1 2 3] 'first 'place))
15:01lazybot⇒ [(first place) 2 3]
15:05amalloyyou are a sneaky devil, TimMc
15:14callenoh herro UnicodeDecodeError, long time no see.
15:16TimMcamalloy: I'm actually rather dissatisfied with it. I feel like it could be more compact and misleading.
15:16TimMcIt's not immediately counterobvious enough to be cute.
15:18Bronsaplaying with the clojure compiler http://i.imgur.com/vagyp.png
15:25lynaghkdnolen_: ping
15:27dnolen_lynaghk: pong
15:28lynaghkdnolen_: What's the story with the fancy-unification you mentioned to me at Strata?
15:28lynaghkdnolen_: is that something that's going to land soon, on the drawing board, or what?
15:28dnolen_lynaghk: I have a pretty nice idea.
15:29dnolen_lynaghk: during unification you can queue a constraint for a var. after unification these will be run to make sure they weren't violated. I think this should handle your use case cleanly.
15:30lynaghkdnolen_: are you in the market for implementation help in the next week? I'm pushing pretty hard on rolling out an alpha for the chart stuff and would like to start filling out the rewrites.
15:30dnolen_lynaghk: definitely on the table for 0.8.0, after I get out of all this election insanity, I'm planning on working on it.
15:30dnolen_lynaghk: not planning on doing anything on this until after Nov. 6th
15:31dnolen_lynaghk: it's a minor change that I can apply to master so maybe mid next week
15:31lynaghkdnolen_: okay. You're thinking that there'd be an extra parameter, "constraints", given to IUnifyTerms?
15:31dnolen_lynaghk: no need
15:32dnolen_lynaghk: you can cue constraints on the substitution which comes in an extra parameter already
15:32dnolen_er queue
15:32lynaghkdnolen_: ah, yeah. that was my second guess = )
15:34dnolen_lynaghk: yeah it should be pretty simple and very useful. one place I could get help is how to support this via simple unification where the unification form is usually quoted ... multimethods?
15:34lynaghkdnolen_: Not sure how I'd implement a special symbol meaning "no value for this key" with that system, though.
15:34dnolen_lynaghk: ^
15:35lynaghkdnolen_: not following. A multimethod so that people can extend the unification sematics a la cart for their own datatypes?
15:36dnolen_lynaghk: when I implement I plan on writing up an example in the repo to demonstrate how this works.
15:36dnolen_lynaghk: no how interpret custom symbols
15:36TimMcBronsa: Creepy.
15:36Bronsathanks.
15:36dnolen_lynaghk: '(1 2 ?x) where ?x must be a map, or any arbitrary predicate really
15:36lynaghkdnolen_: ah. args to the multimethod would be what?
15:38dnolen_lynaghk: or might be better to pass constraints as map of constraint fns ...
15:38dnolen_lynaghk: this is what I mean by i could use help, I don't know what the interface should look like. implementing the internal is easy
15:39lynaghkdnolen_: I'll gist up my wildest dreams this afternoon and we can see if they make any sense
15:40dnolen_lynaghk: that will be very helpful.
15:49dnolen_lynaghk: I'm assuming for your use case simple constraints are sufficient? I've been thinking about "deep constraints" as well after seeing Will & Dan's talk at StrangeLoop
15:49lynaghkdnolen_: yes, I believe my constraints are simple. Not sure what the technical meaning of deep is though.
15:49dnolen_i.e. no subterm of this term should violate this constraint
15:50dnolen_'(1 2 ?x) where is x is an arbitrary nesting of lists where even numbers don't appear.
15:51lynaghkdnolen_: yes, everything I have in mind satisfies that---assuming there is a way to handle the "doesn't have key". E.g., {:this 1 :no-haz !_ :that {:also-no-has !_ :c 3}}
15:51lynaghkdnolen_: yeah, nothing like that as far as I'm aware.
15:51dnolen_cool
15:52dnolen_the simpler case is easier to handle anyhow, I can the other thing later.
15:52dnolen_I can add I mean
16:20holohi
16:20holo##(= '' "spam")
16:20lazybot⇒ true
16:21TimMc...
16:21holoi know single quotes for strings is not valid in clojure, but returning true is an expected behaviour even?
16:21S11001001holo: are you looking for [+' +]
16:21bbloom,(count '(= '' "spam"))
16:21clojurebot2
16:22TimMcbbloom: not quite
16:22bbloom,'(= '' "spam")
16:22clojurebot(= (quote (quote "spam")))
16:22holoTimMc, haha, i think it was yesterday you asked me if i knew about this. today by accident, i did it again
16:22bbloommy point was that what looks like 2 arguments to = is actually one argument
16:22bbloom,(= 1)
16:22clojurebottrue
16:22TimMcbbloom: Oh wait, you're right.
16:23holobblom, great
16:23holoi mean *bbloom
16:23TimMc,(count ''(= '' "spam")) ;; this is basically what I was thinking of
16:23clojurebot2
16:24dnolen_jimduey: I'm curious if you ever tried benchmarking the monad versions of core.logic (beyond the fork/join one) and how they fared?
16:24TimMc,(count (flatten ''''''''' spam))
16:24clojurebot9
16:24bbloommany clojure (and most lisps) functions have seemingly odd arity base cases, but they are actually useful for code generation targets
16:24TimMcUnary literals!
16:24bbloomconsider:
16:24bbloom,(*)
16:24clojurebot1
16:24bbloom,(+)
16:24clojurebot0
16:24TimMc,(=)
16:24clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: core$-EQ->
16:24S11001001because it makes them monoidal
16:25bbloomS11001001: shh beat me to it :-P
16:25bbloomhttp://en.wikipedia.org/wiki/Monoid
16:25bbloomnot sure why = isn't defined for 0 arguments
16:25bbloomit is defined for 1, however
16:25S11001001among the clojure data structure types, there are more monoids than non-monoids
16:26ToBeReplacedfeel like i'm missing a core func... how would you express "integral type"... best i have is #(and (not (ratio? %)) (rational? %))
16:26bbloom,(doc integer?)
16:26clojurebot"([n]); Returns true if n is an integer"
16:26bbloom,((juxt integer? class) 1)
16:26clojurebot[true java.lang.Long]
16:26ToBeReplaced,(integer? 1M)
16:26clojurebotfalse
16:27ToBeReplaced,(#(and (not (ratio? %)) (rational? %)) 1M)
16:27clojurebottrue
16:27bbloomhm
16:27S11001001,(class 1M)
16:27clojurebotjava.math.BigDecimal
16:27bbloom*shrug* numbers are hard :-P
16:27bbloomoh yeah, you're looking for N
16:27bbloom,(integer 1N)
16:27clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: integer in this context, compiling:(NO_SOURCE_PATH:0)>
16:27bbloom,(integer? 1N)
16:27clojurebottrue
16:27ToBeReplacedah ya
16:28S11001001,(#(and (not (ratio? %)) (rational? %)) 1.5M)
16:28clojurebottrue
16:28bbloominteger? seems to work :-)
16:28ToBeReplacedyea integer? sounds good :) thanks
16:30lynaghkdnolen_: https://gist.github.com/4004131
16:32dnolen_lynaghk: thx, will check it out.
16:33lynaghkdnolen_: thank you! If some of those things are terrible ideas definitely let me know---I haven't done enough logicy stuff to get a feel for what is and is not a wise systems decision.
16:35bbloomlynaghk: cool stuff :-) i've been thinking about lots of the same kinds of things with respect to declarative UI
16:36lynaghkbbloom: it's easy to imagine cool things. Just need to get it workin' now = )
16:36bbloomlynaghk: the rewrite rules are kinda cousins with cascading stylesheets....
16:36lynaghkbbloom: ehhhhhh...that is not obvious to me.
16:38bbloomlynaghk: consider your :fill color property. someone describing a graph could omit some key style information, like fill color, but specify rewrite rules to insert colors later
16:38lynaghkbbloom: especially since I don't think the rules are necessarily composable. Having an automagic priority model that worked based on specificity of the match would be cool though
16:39lynaghkbbloom: the current implementation renders out to SVG and so user-provided CSS stylesheets are definitely on the table
16:39bbloomlynaghk: specificity is only one option for composition
16:41bbloomlynaghk: WPF doesn't have a specificity model. it just has a staged model: 1) core-styles, 2) theme, 3) control-styles, 4) app-styles, 5) animated values
16:41bbloomsomething like that
16:41bbloomlynaghk: http://msdn.microsoft.com/en-us/library/ms745683.aspx
16:42bbloomlynaghk: ah, here it is: http://msdn.microsoft.com/en-us/library/ms743230.aspx#listing
16:43bbloomthey call it "precedence"
16:44TimMc$findarg map % [1 1N 1M 1.5 1/2] [true true false false false]
16:45lazybot[]
16:45TimMc:-(
16:46bbloomlynaghk: does that make the connection clearer?
16:47TimMc$findarg % 2 3 5
16:48lazybot[clojure.core/+ clojure.core/unchecked-add clojure.core/+' clojure.core/unchecked-add-int]
16:54TimMc$findarg every? % [1 1.2 1/2] true
16:54lazybot[]
16:54TimMc$findfn 1 true
16:54lazybot[clojure.core/== clojure.core/odd? clojure.core/number? clojure.core/integer? clojure.core/distinct? clojure.core/boolean clojure.core/< clojure.core/= clojure.core/> clojure.core/>= clojure.core/<= clojure.core/pos? clojure.core/rational? clojure.core/await-for]
16:55TimMcIs findarg just timing out, or what?
16:56holohow do i remove these extra parentheses around the map? '('('({})))
16:56holoi mean, in an obvious way
16:57bbloomholo: huh? those parens are a list
16:57technomancymeta-s
16:57bbloom,'()
16:57S11001001holo: there's no good answer without more details
16:57clojurebot()
16:57bbloom,''()
16:57clojurebot(quote ())
16:57holobbloom, do you know any paretheses that aren't lists in clojure?
16:58Chousukeunless you count comments, there aren't any :P
16:58S11001001&((juxt identity type) (map identity [1,2,3]))
16:58lazybot⇒ [(1 2 3) clojure.lang.LazySeq]
16:58TimMcholo: Are you asking about a value or text in your editor?
16:58S11001001&(type '(1,2,3))
16:58lazybot⇒ clojure.lang.PersistentList
16:59holoTimMc, it's a value. i'm assuming the number of enclosing lists is unknown
17:00holoS11001001, i'm sorry for the ill explained question. i hope it's clear now
17:01Raynes(first (filter map? (iterate first l)))
17:01TimMcholo: Do you know the difference between '('('({}))) and '((({}))) ?
17:03S11001001holo: Raynes's solution is probably what you want, but you really shouldn't end up with any data in that shape ("unknown" recursion without an explicit termination data case is a recipe for destructuring disaster)
17:03holoTimMc, no. my verbose example would be (list (list (list {})))
17:04TimMcholo: Ah, that is different from what you asked for!
17:05holoTimMc, i see. i think your example with just one quote does match the last one i wrote
17:05holoRaynes, you're great! thanks
17:06ivanhttp://emareaf.deviantart.com/art/Rich-Hickey-321501046 via GIS
17:07ivan(trying to find the "it's just data!")
17:07TimMcholo: 'foo is (quote foo)
17:07TimMcivan: Haha, nice.
17:08holoS11001001, a query to a database will return me a ({something}) e.g. i think it would be a good idea to not worry the amount of enclosing around the data, and just always apply that function
17:09TimMcThat sounds like a very bad idea.
17:09holoTimMc, that's possible
17:09S11001001holo: TimMc merely typed faster than I could.
17:12TimMcAside from weird future bugs, you're going to miss out on patterns in your code that you would later be able to factor out.
17:12holoTimMc, this is just for foreign code. that i'm not able or willing to factor
17:14mpanGuys, how relevant/useful/necessary do you suppose some of the formal theory is to practically using a functional language?
17:14TimMcholo: I'm not sure what you're talking about, but OK.
17:14RaynesTimMc: He is saying that this is code that he doesn't control that is giving him the crappy listified result.
17:15TimMcRaynes: holo is still writing code, and presumably more than one piece...
17:15S11001001holo: ok then, as long as you have some guarantees somewhere
17:15S11001001mpan: quite
17:16holoyes, it's like Raynes say. sorry my slow reply
17:17TimMcmpan: It's useful, but not essential.
17:40mpanI tried to ask this earlier, and I'm not sure if my net connection died right before or right after the message went through. Apologies if I'm being repetitive.
17:40mpanI'm just wondering, how necessary is it to understand the underlying theory to use a functional language effectively?
17:40mpanFor example, I was reading about fixed point combinators, but I can't imagine how the idea came about or how concrete examples were discovered.
17:49S11001001mpan: S11001001: mpan: quite\r\nTimMc: mpan: It's useful, but not essential.
17:50mpanAwesome! Thanks!
17:50technomancybe sure to read at least Out of the Tarpit and Equal Rights for Functional Objects
17:51amalloympan: http://lazybot.org/logs/#clojure/
17:51mpanThank you.
17:52mpanI was looking at a different logger before, but that one seems to be delayed and batched, and it hadn't gotten up to anywhere near the present time
17:52S11001001amalloy: in this case, lazybot split from me for a chunk
17:53amalloyreally? what's different?
17:53S11001001(5:19:35 PM) S11001001: lazybot: mail mpan S11001001: mpan: quite\r\nTimMc: mpan: It's useful, but not essential.
17:54amalloy~search for mail
17:54clojurebotif you can access the email account that is signed up then you winn
17:54amalloydangit, i don't remember clojurebot's log-search feature. hiredman?
17:54amalloybecause i didn't see that message either, S11001001
17:54mpanStrange, though, because every one of my TCP connections believed they were still alive
17:54hiredmanit is disabled
17:54mpanI thought they timed out much quicker than that
17:54mpan(They just didn't work.)
17:55hiredmanwhen I moved clojurebot to a t1.micro the oomkiller kept killing elasticsearch (provides the indexing and search)
17:55jimdueydnolen_: re: benchmarking core.logic. I haven't yet, but I'm working towards doing that.
17:58dnolen_jimduey: cool, curious to hear about that.
18:03lpvbwhat happened to the clojure android effort?
18:04piskettiWas there any?
18:04lpvb._.
18:04mpanI remember seeing proof-of-concept demos
18:04jimdueydnolen_: I'm thinking (hoping :)) to see quite an improvement when using the continuation monad.
18:04piskettilpvb: awesome idea
18:05Raynes$google lein-droid
18:05lazybot[alexander-yakushev/lein-droid · GitHub] https://github.com/alexander-yakushev/lein-droid
18:06dnolen_jimduey: cool! I'm skeptical about the performance of multiple monads in core.logic (I think you alluded to this in your post) but I'm interested in the numbers.
18:44tickingUm, are performance improving patcheswelcome to the core? (Factor 3x on partition-by)
18:45dnolen_ticking: they are
18:45dnolen_lynaghk: ping
18:46tickingdnolen_: cool, I assume the requirement to sign the contributors agreement is transitive?
18:48dnolen_ticking: you mean had signed for a specific project?
18:50tickingdnolen_, no I mean that only the final contributor has to sign it, so that the "author" doesn't
18:51tickingI think it could take quite a while for the paper to arrive in the usa from germany ^^ a hierarchy would be usefull ^^
18:52tickingsay I'd put the code in public domain or gpl or whatever and somebody else put it into a pull request
18:59dnolen_ticking: don't really understand the finer points of EPL style licenses - perhaps someone else can say something about that.
18:59jonasacis it possible for clojure or java programs in general i guess to write persistent data to a file inside a jar ?
18:59tickingdnolen_ hrhr thanks anyway :D
19:31lynaghkdnolen_: pong
19:33dnolen_lynaghk: hey, so yeah most of that looks possible - the `or` bit requires some thinking, but doesn't seem hard. honestly the most challenging thing is determining the interface.
19:33lynaghkdnolen_: yeah, I thought that was the case. Nothing I'm trying to do is too crazy. I mean, I feel it's not even really logic programming since there is no backwards/generative magic.
19:34dnolen_lynaghk: I'm inclined to change prep to take a form + constraints on the vars and perhaps provide some other form for sugar which will allow for some flexiblity for experimentation.
19:35dnolen_in anycase I'll try to add the internals for this + some simple demos later next week.
19:35lynaghkdnolen_: that makes a lot of sense, but I wonder if that would mean my syntax is impossible.
19:36lynaghkdnolen_: I mean, if I wanted to I could have written each rule + constraints within the body of a run and then iterate over them manually.
19:37dnolen_lynaghk: no, but I'm not sure if the specific syntax is something core.logic needs to provide. but definitely interested in anything that make it simple to do what you want.
19:38dnolen_,(meta (first '(^foo ?x)))
19:38clojurebot{:tag foo}
19:38lynaghkdnolen_: yeah, agreed. Basically it comes down to how people can hook into the walk that happens during unification or if they're going to need to walk their stuff themselves first
19:38dnolen_lynaghk: prep could look at symbol metadata ...
19:38dnolen_,(meta (first '(^::foo ?x)))
19:38clojurebot{:sandbox/foo true}
19:38lynaghkdnolen_: which will probably come down to how crazy their syntax is.
19:38dnolen_that's actually kind of nice
19:38dnolen_,(meta (first '(^::not-present ?x)))
19:38clojurebot{:sandbox/not-present true}
19:39dnolen_,(meta (first '(^::numeric ?x)))
19:39clojurebot{:sandbox/numeric true}
19:39lynaghkNot all of the constraints are on a single var, though. The not-present constraint, for instance, you can't use because the standard unification will fail
19:40dnolen_lynaghk: I got some ideas about this ;) we can do this during prep
19:40dnolen_^::numeric ?x could return a logic+var w/ constraint instead of just a logic var.
19:40dnolen_anyways gotta do some other things but I got some ideas
19:41lynaghkdnolen_: ahhh. yeah, definitely. Thanks for your thoughts on this
19:41lynaghkdnolen_: we can get it all figured out in Raleigh = )
19:41dnolen_yes!
19:49ivanhope you weren't interested in any of the comments on bugs.sun.com
19:49ivanhttps://blogs.oracle.com/darcy/entry/jdk_bug_migration_bugs_sun
19:57ivanhttp://www.xmlvm.org/overview/ huh
20:00bbloomit's extensible!
20:00bbloomor should i say:
20:00bbloomeXtensible!
20:01lynaghkbbloom: sorry for missing your comment earlier. I'd just left the keyboard
20:01bbloomlynaghk: no worries
20:01AtKaaZhi, is there some editor/ide which can do refactoring like renaming vars or function names in all relevant places?
20:01lynaghkbbloom: leaving again now, but I'll take a look at that stuff later. I'm trying to push out some of this grammar of graphics stuff before I leave for Sweden on Monday, so I'll ping you with info about the alpha if you're interested in kicking the tires.
20:02bbloomlynaghk: sure, would be happy to try it out and report back my experiences
20:02lynaghkbbloom: rad. Any pref on language? Right now Python, R, JavaScript, and Clojure are the targets.
20:03bbloomlynaghk: i assume Clojure would be the easiest initial target, no?
20:03lynaghkbbloom: yeah, pretty much because I don't need to dick around with EDN generation = )
20:04lynaghkbbloom: though the alpha is very minimal (send spec, get SVG back) so there's not a lot the client libs actually do
20:05bbloomlynaghk: do you have a tiny swing app with an SVG renderer? i'd imagine that would be the fastest way to iterate, rather than having to refresh the browser each time
20:06lynaghkAlso, since everything is a map I'm thinking about just accepting JSON and running data-readers on any maps with a :_tag key. E.g., the EDN #my/record.thing {:a 1} is the same as {"_tag": "my/record.thing", "a" 1}
20:06lynaghkbbloom: nah, I have no swing experience. The plots use CSS, so a browser is pretty necessary. I could throw a livereload server in the client though.
20:06lynaghkso refreshes would be automatic.
20:06bbloommmm automatic refreshes :-)
20:07bbloomthe _tag json thing is a reasonable approach
20:07bbloomkeywords and symbols are going to be a real issue for some EDN targets
20:07lynaghkokay, I'll consider that feature request #1 for the clj client and see if I can throw it in there later tonight = )
20:08bbloomthe MRI implementation of ruby, for example, treats every single symbol as a memory leak :-/
20:08bbloomEDN is cool, but i'm not sure how well it will be received, so JSON support is probably wise
20:08lynaghkbbloom: yeah, that's what I'm thinking.
20:09bbloombut i'm much more interested in the graph-description -> svg step, so clojure-only and no json is enough for me to play with it
20:09lynaghkbbloom: anyway, I'm going for a run before the Pacific NW sun completely disappears. I'll email you Sunday with deets.
20:09bbloomlynaghk: cool, cya
20:09lynaghkbbloom: okay. I am giving a talk on this stuff at Oredev in Sweden next Friday if you're feeling up for a quick Euro trip =P
20:10bbloomhaha thanks but no thanks
20:10lynaghkbbloom: but I will also post slides and writeup next week too.
20:35AtKaaZhow to make an empty sorted map ?
20:36AtKaaZoh i see
20:41AtKaaZis there something like *file* for lines or current function?
20:44S11001001AtKaaZ: no, but it might work to write a macro that asks the metadata on &form
20:44S11001001(defmacro here [] `'~(-> &form meta :line))
20:45S11001001AtKaaZ: depends on the details of operation ordering in Compiler.java though
20:47S11001001AtKaaZ: if you're writing a debugging macro, though, line and current function are pretty useless, as you can pick it up from exceptions anyway. The really useful thing is to write a macro that scribbles out details of &env (which has the current lexical env, e.g. let bindings & fun args
20:48AtKaaZS11001001, that pretty much works like I wanted to, thanks, but I'm not sure what you mean with operation ordering...
20:50S11001001AtKaaZ: the times when the Clojure compiler sticks metadata on forms is pretty ad hoc. It should *really* mark forms iteratively, before and between each macroexpansion phase. It's not that simple, though
21:10AtKaaZEPL or AGPL? why?
21:24xeqiAtKaaZ: for what?
21:24AtKaaZown clojure projects
21:24AtKaaZI mean, projects written in clojure
21:26technomancyyou can't use clojure in GPL'd projects
21:26xeqiI choose EPL cause it reduces the license complexity of the ecosystem and for my users
21:26xeqitechnomancy: ?
21:26AtKaaZreally?
21:26ivantechnomancy: wait what seriously?
21:26technomancythe EPL's patent clause is ironically considered "additional restrictions" by the GPL
21:27xeqiah
21:29xeqiluckily most java gpl projects I've seen use the "classpath exemption"
21:30technomancythe GPL with the classpath exception is effectively no different from the EPL afaict
21:31technomancyor the LGPL
21:31AtKaaZ"A number of developers have told us that they are prohibited from adding a dependency covered by the AGPL due to the viral nature of the license."
21:32AtKaaZwhere I read, it seems EPL is better
21:32xeqifor some definition of "better"
21:32technomancythe EPL is not very good at doing what the AGPL does
21:32AtKaaZyep xeqi
21:33AtKaaZ"With the EPL, Developers don’t have to worry that a single library will taint an entire server-side application and compel the release of source code." lol
21:36AtKaaZhttp://vschart.com/compare/eclipse-public-license/vs/gnu-affero-general-public-license
21:37seancorfieldas someone who's been thru a software license audit at a large corporation, i can say that licensing is important to such companies ;)
21:37hughfdjacksonis there a canonical online book for clojure?
21:37hughfdjacksonby which i mean.. de-facto, for begineers
21:37hughfdjackson*beginners -.-
21:38hughfdjacksonnot canonical at all.
21:38technomancyhughfdjackson: you mean free?
21:38hughfdjacksonI don't mind paying, but instant gratification would be nice
21:38hughfdjackson:D
21:38technomancyhughfdjackson: hard to beat clojurebook.com
21:38seancorfieldClojure Programming would be my recommendation - yes, clojurebook.com
21:38xeqi+1 for clojurebook.com
21:39hughfdjacksonthanks all :)
21:40seancorfieldand welcome to the clojure universe hughfdjackson
21:42AtKaaZtechnomancy, so if I want to release my project under AGPL, I can't have it written in clojure ? or I can't dist the uberjar ?
21:43hughfdjacksonseancorfield: :D thanks. Here's hoping it'll be a refreshing change from battling js' addition to mutable objects
21:45dnolen_hughfdjackson: I think there's a lot to like for a JSer. Simple assocative model minus mutability.
21:48hughfdjacksondnolen_: basically what piqued my curiousity; it looks similar enough to be (perhaps) the js i wish js was
21:49hughfdjacksonout of interest; are you working on that predicate dispatch library anywhere in public? I don't think i saw it on your github
21:50dnolen_hughfdjackson: ha, people always ask about that. I do work on it, but in a very slow way via core.logic/match
21:51xeqiAtKaaZ: ianal, but I believe you can't distribute the uberjar
21:51AtKaaZxeqi, it makes some sense
21:52xeqior with the agpl even use the combined work across a network
21:52hughfdjackson:D fair enough
21:53AtKaaZxeqi, I suppose even if you were to release the project under dual license AGPL and EPL it would still not work?
21:54Apage43Then it would basically just be licensed under the EPL
21:54AtKaaZlike this project https://github.com/malcolmsparks/clj-logging-config
21:55xeqidual licensing would be fine, everyone would just choose the epl
21:56Apage43unless they want to sue you or something, and avoid the patent retaliation language
21:56AtKaaZi hate licenses :/
21:57xeqiand hope not to be in conflict with it and get copyright infringment :p
21:57xeqiAtKaaZ: yeah, thats why I just choose the EPL for clojure stuff
21:59AtKaaZxeqi, yeah EPL should do, especially for whatever I program, since nobody will touch with a 10feet pole
21:59Apage43both AGPL and EPL have patent grant language (if you contribute patent encumbered code, you are granting a license to that patent), but the EPL has the added restriction that if you sue someone over patent related to an an EPL project you are not able to license that project under the EPL, which is why it is not GPL compatible.
22:01AtKaaZthis is a good read: http://briancarper.net/blog/579/keyword-arguments-ruby-clojure-common-lisp%5D
22:28hughfdjacksoni'd have thought that read-string and pr-str would have been defined at about the same time
22:29hughfdjacksonany rhyme or reason to this decision, or just one of those things that happens with code?
22:32tomojwell, pr-str's definition makes use of destructuring, which is defined after read-string
22:33tomojbut maybe read-string could have been stuck under there..
22:36hughfdjackson:D interesting
22:36hughfdjacksonalthough i suppose that makes a lot of sense..
22:39joegalloif you want to make a pie from scratch, you must first create the universe, and all that.
22:39hughfdjacksonmmm sagan pie
22:43tomojevery time I didn't put pomegranate on my path and I actually care, I just curse and don't put pomegranate on my path
22:43tomoj
22:45tomoj(= (__ [{:foo #{1 2} :bar #{3}} {:foo #{4}} {:bar #{5 6} :baz #{7}}])
22:45tomoj [[:foo #{[1 4 nil] [2 4 nil]}] [:bar #{[3 nil 5] [3 nil 6]}]])
22:45tomojd'oh
22:47tomojalso
22:47AtKaaZcan we def private atom? similar to defn-
22:47tomoj(= (__ {:a {:foo #{1 2} :bar #{3}} :b {:foo #{4}} :c {:bar #{5 6} :baz #{7}}})
22:47tomoj [[:foo #{{:a 1 :b 4} {:a 2 :b 4}}] [:bar #{{:a 3 :c 5} {:a 3 :c 6}}]])
22:47tomoj
22:48tomoj(def ^:private foo (atom :foo))
22:48AtKaaZoh it's before the symbol
22:48AtKaaZthanks
22:48AtKaaZworks!
22:49tomojthere used to be a def- in contrib but it seems to have disappeared
22:50tomojpersonally I don't use defn- anymore, ^:private is nice an clear
22:50AtKaaZI agree
22:50RaynesOnly time I use defn- is when working with code that uses it already.
22:50RaynesLike Clojure itself.
23:10lpvbhas anyone done development for windows metro apps or windows phone?
23:10lpvbwith clojure
23:32brainproxySgeo: glad you're doing alright
23:45AtKaaZcan we loop recur with first and rest inside a macro [firs & res] , trying to parse all by applying a check on first
23:47AtKaaZthe problem is in the loop let `(loop [xfirst# ~x allrest# ~all] the ~all is evaluate
23:50AtKaaZif I were to not use the ` should I use eval to evaluate the form inside the macro?
23:54Sgeobradfordw_, thank you
23:54Sgeooops
23:54Sgeobrainproxy, thank you
23:59brainproxybtw, I've been hacking on the protocol-monads library; implemented a basic mechanism that options lets you check whether the return type of a monadic function matches the type of the monadic value
23:59brainproxySgeo: ^
23:59brainproxy*optionally