#clojure logs

2012-11-24

00:04tomojnot that I think there's a better way
00:10antares_yedi: CDS does mention laziness but this particular fact can be left out of the Collections/Sequences guide
00:11antares_we will cover it in the Laziness guide which is supposed to be "advanced"
00:12lynaghk`Does anyone have any strong arguments for or against namespacing keywords? E.g., :com.keminglabs.c2po.stat/density vs :stat/density vs. :density?
00:13dnolenlynaghk`: I generally don't like it unless it's necessary to avoid clashes.
00:13lynaghk`This is for the system I described at the Conj. Fully namespaced would be a no brainer if it were a totally automated system, but I anticipate quite a lot of off-the-cuff REPL usage.
00:13ambrosebssheesh, I guess I should have expected the whole anti-contrib, but it's such a buzzkill.
00:14lynaghk`dnolen: yeah, that's my gut feeling as well, but I'm leaning towards the informal namespaces just so that you're reminded where the values are actually coming from
00:15lynaghk`since things like groupers and stats are effectively acting as "middleware" between the raw data and the finished plot geometry.
00:19dnolenambrosebs: FWIW, I really think Typed Clojure belongs in contrib.
00:21dnolenlynaghk`: I think :stat/density is kinda cool. fully namespacing is tedious unless there's a really strong value proposition.
00:21lynaghk`dnolen: sold. Thanks for the feedback.
00:27ambrosebsdnolen: it was made for contrib. I thought it was obvious why.
00:27ambrosebsoh well.
00:27brainproxyambrosebs: i look forward to learning more and putting the typed clojure stuff to good use, in time
00:27dnolenambrosebs: you don't need to convince me :) I think it'll be a goto tool for many folks in the near future.
00:28ambrosebs:)
00:28brainproxyhaving had my head in this monads stuff for the past several weeks has given me better appreciation of reasoning about code in terms of types
00:28ambrosebsbrainproxy: hello target audience.
00:28brainproxy:)
00:28brainproxyambrosebs: have you played with Frege at all?
00:29ambrosebsnever heard of it
00:29brainproxyambrosebs: https://github.com/Frege/frege
00:29brainproxyit's basically an implementation of the haskell spec on the jvm
00:29brainproxynot really a port in the sense that someone sat down and ported ghc over to java
00:30brainproxybut a haskell work-a-like
00:30ambrosebsinteresting
00:32brainproxyi'm reading a book on haskell, when I get up to speed, I hope to start spending some time in Frege; i think it would be interesting if one could get clj and frege working together, i.e. without AOT compilation
00:33dnolenit's cool to hear that you got Typed Clojure working w/ CLJS - it'd be fun to show a slide or something about that at TechMesh
00:33antares_what about including projects to contrib when they mature and get some adoption?
00:34antares_many newcomers see core.* as "the right way to do Clojure" and when they hit frequent changes or semi-complete libraries, they assume that's how all Clojure is
00:35antares_that's how ecosystems such as Apache or Eclipse work, things graduate from incubation
00:36ambrosebshave *any* contrib libraries reached 1.0?
00:36antares_Ruby, Python, Scala work the same way, things get into core only after they really have proven themselves
00:36dnolenantares_: sometimes it's worthwhile to symbolically invest in the future - in anycase you've already expressed your opinions quite poorly - might as well leave the topic alone.
00:36antares_ambrosebs: no and that's why we get into trouble from time to time, e.g. data.json 0.2 story
00:37antares_I think most of core.* should not be core.* at all
00:37antares_so that's not an argument for me
00:37hughfdjacksonif it helps; i, as a newbie, assumed that things under the core. namespace were golden
00:37ambrosebsdnolen: when's TechMesh?
00:37antares_hughfdjackson: yeah, being under github.com/clojure already makes people expect certain degree of maturity
00:37dnolenambrosebs: Dec 4 & 5
00:38dnolenhughfdjackson: core namesepace just means "golden" idea
00:38ambrosebsdnolen: I'll get something cool together for you.
00:38dnolenambrosebs: SWEET
00:39antares_dnolen: not to newcomers
00:39antares_to them it means "golden, done, ready to be used"
00:39antares_and it's just not going to change
00:39hughfdjackson:D well, while understandable, that's not the first thing that pops to mind
00:40antares_a number of core.* projects is at 0.0.1, with breaking API changes in sight (according to github log). That's just very counter-intuitive.
00:41ambrosebsdnolen: I was playing around with changing ana/specials to stop macroexpansion. Seems a bit hacky, and I think I'll fall back to typed "wrapper" macros
00:42ambrosebsWasn't ana/specials :dynamic at some point?
00:42dnolenambrosebs: why do you need to prevent macroexpansion in CLJS?
00:43ambrosebsmy motivating example was deftype, if I could catch deftype expansion at (deftype A ISeq (-first ...) ....) then I could probably type check it more easily than the (set! cljs$....) calls it expands to
00:44ambrosebsbut perhaps that's not really a sound idea.
00:45dnolenambrosebs: well I don't really see a problem with making specials dynamic if that helps you out.
00:46ambrosebsdnolen: I don't know if it's a dumb idea to mess with the specials.
00:46ambrosebsdnolen: It was always something that I loved to experiment with
00:49dnolenambrosebs: I do see what you mean - what the deftype macro exands to is a bit implementation specific.
00:49dnolenexpands
00:49ambrosebsdnolen: ...but you better handle the AST creation correctly..
00:50ambrosebsIt seems fraught with danger. eg. scoping, macros, var resolution
00:51dnolenambrosebs: you mean it seems tricky even if you get the unexpanded form?
00:53ambrosebsdnolen: maybe not. It seems like a backdoor with some unknown implications that I haven't thought of.
00:53dnolenambrosebs: well let me know if it seems useful to you - tho can't you just alter-var-root too?
00:54ambrosebsdnolen: yes, that's exactly what I'm doing.
00:55dnolenambrosebs: I definitely think there's real benefit to not providing typed versions of deftype etc
00:56ambrosebsagreed.
00:56ambrosebsthings like `for`, `doseq` and similar will need similar treatment.
00:57ambrosebsThat would be a pretty cool +1 on Typed Racket if we can get that right.
00:57dnolenambrosebs: huh - why would need early access to those?
00:57seangrovednolen: It looks like doseq is doing much better now, map was probably the culprit
00:57dnolenseangrove: cool - yeah that jumped out me immediately.
00:58seangroveThere're still some leaks, but they're much smaller and I'll look into them in the morning
00:58seangroveThanks, and sorry for such a pedestrian mistake
00:58ambrosebsUsually if there's a weird macroexpansion that includes anonymous functions, Typed Clojure isn't good enough.
00:58ambrosebs.. to infer the types.
00:58seangroveReporting tools in cljs are quite primitive though, makes tracking things down difficult
00:59ambrosebsI'll have to double check those definitions though... they seemed problematic from a glance.
00:59dnolenseangrove: hah, not a pedestrian mistake - everyone gets majorly burned by laziness now and then.
00:59dnolenambrosebs: but why not try to attack the root of the problem - inference?
01:00ambrosebsdnolen: sight, you're right. :-) *opens 100 page PhD*
01:00dnolenambrosebs: I'm very curious as to what missing in core.logic for you to use it for this step?
01:01ambrosebsdnolen: Me too. There are several existing extensions to local type inference that are candidates for inclusion.
01:01dnolenseangrove: yep everyone is feeling the pain. like I said source mapping is incredibly close now.
01:02dnolenambrosebs: especially now that we have constriants - this seems pretty doable
01:02ambrosebsdnolen: I might try and convert the type var inference to core.logic.
01:02ambrosebsIt should reveal the major issues. eg. subtyping
01:09seangrovednolen: We've moved all our frontend dev to cljs, and it's been great, so no worries
01:09dnolenseangrove: very cool!
01:09seangroveRough edges, but it's critical to our infrastructure, and wonderful to work with
01:09seangroveHoping to be able to give back in some way soon
01:22dnolenambrosebs: I'm a type noob. So is the problem w/ subtyping is that it cane make inference undecideable?
01:23ambrosebsdnolen: Unification based inference seems contrary to subtyping.
01:24ambrosebsHopefully the constraints help.
01:24ambrosebsThe last time I played with core.logic inference was before cKanren extensions, so I haven't had a chance to test it.
01:25dnolenambrosebs: and by that you mean, that w/ subtyping you have a set of types that might be applicable?
01:25dnolenand that seems weird to solve w/ unification?
01:25ambrosebsdnolen: yea exactly.
01:25ambrosebsI don't know if it's impossible, but it's definitely weird.
01:26dnolenambrosebs: gotcha, I'm willing to work out CLP(Set) if that will help you. much simpler than efficient CLP(FD) from what I can tell.
01:27jondavidjohnSo... I'm trying to get my clojure on... and I've got this function... http://pastie.org/5426354
01:27dnolen(inset q {:dog :cat :bird}) stuff like that
01:27dnolenambrosebs: ^
01:27ambrosebsinteresting. The other problem is that you can't get the known subtypes in general of a given Java class.
01:27jondavidjohnNeeding someone to drop some clojure knowledge on me, tell me if I'm writing horrid code
01:28jondavidjohnnot sure why I'm getting this exception when I try to (assoc! ...) on a transient.
01:28dnolenambrosebs: yeah but there's nothing you can do about that period right?
01:28ambrosebsyep.
01:29ambrosebsIt seems like you'd need a constraint that can only be run in "one direction" that runs a `subtype?` predicate
01:29ambrosebsSo you might know how a known set of types in advanced.
01:30dnolenwhat do you mean by "one direction" in this case?
01:30ambrosebs#(subtype? % My-Type) kind of thing
01:31dnolenambrosebs: by one direction you just mean "doesn't run backwards" ?
01:31ambrosebsbasically.
01:32dnolenyes constraints in general aren't about running forwards or backwards.
01:32ambrosebsok, got it.
01:33dnolena subtype predicate could be written with predc like I showed at the Conj.
01:33ambrosebswas that where you added a defmethod on the fly?
01:33dnolenwell that just for fun - but the point was that any predicate can be converted in to a constraint
01:33dnolenin your case that's not enough tho
01:34dnolenI assume you'll want to operate on sets
01:34dnolen#{Nil Seqable}
01:34ambrosebsright
01:34dnolen(inset t #{Nil Seqable}) or something like that
01:34dnolen(!=set t 'Nil) => t will now represent #{Seqable}
01:35ambrosebsoh cool
01:35dnolen(unionset newt somet othert), (diffset ...) etc
01:37ambrosebsyes that sounds very promising.
01:42dnolenambrosebs: if you come up with an example(s) that you want to infer and provide the hooks - I'd be willing to take a closer look and see if I can at least sketch out what would be required.
01:42tomojcould typed clojure be used to do something like auto-derived typeclass implementations?
01:43ambrosebsdnolen: ok I'll send you an email for the morning.
01:43dnolenambrosebs: cool
01:43ambrosebstomoj: do you mean like protocol inheritance?
01:48tomojI guess, yeah
01:49ambrosebsI don't know exactly what you mean, as in a default implementation? Why couldn't it be done with macros?
01:55tomojI don't really know what I mean, either. it just looks like haskell magic
01:57ambrosebstomoj: I don't know what's possible by building on top of Typed Clojure, but so far it has been about understand existing Clojure idioms.
01:57ambrosebsIt's basically a framework to build cooler stuff on.
02:00jondavidjohnAny help on this? http://pastie.org/5426354
02:01tomojI guess I'm thinking just of typeclasses in general
02:01jondavidjohnthe problem is this line `(assoc! _cards _current c)`, I'm pretty sure, I think I have a mis-understanding of transients
02:04tomojtypecheck the entire code and generate all the necessary multimethods? :(
02:05ambrosebsAh. Haskell uses global type inference, Typed Clojure uses local type inference. So whole program analysis is not as powerful.
02:06ambrosebsYou basically have to be very explicit about what derives what beforehand.
02:07tomojthat seems maybe OK
02:08ambrosebsThat's sorta how Clojure works anyway.
02:08tomojI guess you don't need multimethods, inside (with-typeclasses ...) you could just generate the necessary function if it isn't around already
02:10ambrosebsto be clear: I'm talking about protocols. An implementation of type-classes using Typed Clojure would probably look that that, yes.
02:10tomojah, yeah
02:11ambrosebsSomething very interesting is dispatching on the last argument of a type-class method.
02:11tomojright
02:11ambrosebsI haven't investigated that, but it's come up several times.
02:43yedihas prismatic released any libraries yet?
05:53abpRaynes: Can I (ab)use refheaps code by reimplementing it as a showcase of some libs, in approximately 500 years?
05:56strczprstskrzkrkChousuke, you think I'm insane right?
08:32tgoossenshow common it put :test metadata in a funciton?
08:32tgoossensi mean. is it done a lot?
08:32gfrederickstgoossens: I've nearly never seen it
08:32tgoossensi just bumped into metadata for the first time
08:33tgoossensis it correct to interpret
08:33tgoossensmetadata
08:33tgoossensas java @ tags. But now
08:33antares_tgoossens: :test metadata may be helpful in a REPL session, metadata in general is used quite often, e.g. to group clojure.test tests
08:33tgoossenscan be passed on, read, used by other code
08:33tgoossens(and more)
08:33antares_tgoossens: yes, Java annotations often serve the same purpose
08:33tgoossensok
08:33erwagasoreI am doing koans but I have been stack for a while on the following please help
08:34erwagasore"Iteration can be used for repetition"
08:34erwagasore (= (repeat 100 :foo)
08:34erwagasore (take 100 (iterate repeat :foo))))
08:34antares_erwagasore: can you please link to the koan you need help with on github?
08:34gfredericks(iterate repeat :foo) could probably be (repeat :foo)
08:34tgoossensgfredericks: how do you write code? Do you write a testbench for every function. Or do you use repl and then put that into (comment.. ) or something else
08:34gfredericksbut that doesn't illustrate the use of iterate
08:35tgoossensstill exploring different styles
08:35gfrederickstgoossens: I write tests with clojure.test
08:35gfredericksso they go in a different file
08:35tgoossensi played around with (expect ..) from jayc
08:35erwagasore(= (repeat 100 :foo) (take 100 (iterate __ :foo)))
08:35tgoossensi like it so far
08:35tgoossens,(= (repeat 100 :foo) (take 100 (iterate __ :foo)))
08:35clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: __ in this context, compiling:(NO_SOURCE_PATH:0)>
08:36tgoossensoops
08:36gfrederickserwagasore: identity should wwork there
08:36gfredericksyou want a function that takes an item in the sequence and returns the next item
08:36gfredericksyou could also use (constantly :foo)
08:36tgoossensgfredericks: yesterday someone here told me about https://github.com/clojure/clojure/blob/master/src/clj/clojure/zip.clj
08:36tgoossenswhere rich, put his repl stuff in a comment
08:36tgoossensstill finding it a bit strange
08:37tgoossens(at the bottom)
08:37gfredericksoh I've seen that a lot
08:37gfredericksI expect it's an emaxy thing
08:37gfredericksbecause in emacs you can eval arbitrary bits of code
08:37gfredericksso putting them in the comment means they're generally harmless, but easy to ask emacs to eval if you want to
08:38gfredericksalso the comment macro as opposed to ;; line comments means you keep the syntax highlighting and paredit features
08:38tgoossensyeah. but they do not test anything automatically. so
08:38gfrederickscorrect
08:38tgoossensif your lib is getting big this is probably just not a good idea
08:38gfredericksrich isn't a huge TDD fanatic
08:38erwagasoregfredericks what do u mean by identity?
08:38gfrederickserwagasore: ##(identity :foo)
08:38lazybot⇒ :foo
08:38erwagasoreI am kind of new to clojure.
08:38tgoossenserwagasore
08:38tgoossenscool
08:38gfredericksbe back in 15 min
08:38tgoossensme too
08:38tgoossensi'll give you a video where everything will be explained
08:39erwagasorethanks.
08:39tgoossensprobably a must if you are getting into clojure for the first time:
08:39erwagasoreCant wait.
08:39tgoossensIn this video rich hickey (creator of clojure) will explain his ideas and opinions on how we program today.
08:39tgoossensand will try to define
08:39tgoossensidentity
08:39tgoossensstate, value
08:39tgoossensin a meaningful manner
08:39tgoossensvery inspiring
08:39tgoossenshttp://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey
08:40tgoossenshow long have you been playing around?
08:40erwagasoreA month.
08:40tgoossensme two months now
08:40tgoossensi began by watching a lot of these talks
08:40tgoossensi'll give you some more
08:40tgoossenshttp://www.infoq.com/presentations/An-Introduction-to-Clojure-Time-Model
08:41tgoossenshttp://www.infoq.com/presentations/Simple-Made-Easy
08:41erwagasoreGreat.
08:41tgoossensif you watch these 3
08:41tgoossensyou'll already have a pretty strong idea of what ideology of clojure is all about
08:42tgoossenswhat experience do you have by now?
08:42tgoossens(in other languages)
08:42tgoossens(and paradigms)
08:42erwagasoreI have been using Python for 3 years
08:42erwagasoreSo I am kind of experienced there.
08:42tgoossensfor me, it was java
08:43erwagasoreHow long have you been in Java land?
08:43tgoossensprepare for something completely different and exciting!
08:43erwagasoreSweeet.
08:43tgoossenshow did you bump into clojure?
08:43erwagasoreWhere I use emacs, so.
08:44tgoossensi mean. where did you hear about clojure
08:45erwagasoreYou cannot avoid LISP, from there I have had an interest in their syntax, eventhough many hate the paranthesis
08:45erwagasoreIt didn't both then discovered Clojure.
08:45tgoossenscool
08:46tgoossensclojure has some extra syntax so that parantheses are now much simpler to understand
08:46tgoossensbut you'll find that out very soon
08:46mpenetDoes nyone know if autodoc can generate doc for cljs? Is there any alternative if it's not the case, as I suspect?
08:48tgoossenserwagasore: enjoy your exploration! feel free to hang around at the irc, you'll learn a lot from other people
08:48erwagasoreSure. Thanks for your support tgoossens
08:48tgoossensnow back to studying :D
08:49antares_erwagasore: and if you are looking for doc guides, see http://clojure-doc.org. If you find something missing there, let me know, we are always looking to make it better for beginners.
08:51gfredericksokay sorta back
08:52FoxboronBTW, Chrome users, yesterday i learned something awsome. If you use Chrome, type ClojureDocs then tab.
08:52gfrederickserwagasore: you still confused about the identity function?
08:52gfredericksFoxboron: HOLY CRAP
08:52FoxboronI KNOW
08:53Bergle_1hangon its not april 1st.
08:53FoxboronTruth
08:54Foxboronalso works on docs.python.org etc
08:54Bergle_1so where do you type this ?
08:54FoxboronChrome, in the adressbar.
08:54antares_Bergle_1: in the address bar
08:54FoxboronClojuredocs then tab.
08:54Bergle_1does nothing
08:55Foxboronneeds to point at clojuredocs.org
08:55antares_Foxboron: try visiting clojuredocs.org and search something there
08:55Bergle_1what needs to point at ?
08:55gfredericksjust for fun I searched for `inc`; I still don't understand why it's so hard to get that right.
08:55Foxboronhaha, type "clojuredocs.org" in the adressbar, then push tab instead of enter :P
08:56Foxboronantares_, yes. and?
08:56Bergle_1it still does nothing odd or different.
08:56antares_Foxboron: I believe it discovers search forms as you browse
08:56antares_maybe there is a threshold of how many times you need to use a search form it for Chrome to learn about it
08:56Foxboronpossibly, i was still amazed when i discovered it :)
08:56antares_or it may be markup-driven
08:57Bergle_1Key thing, have to have visited ClojureDocs before
08:57Foxboronprolly looks for the search urlvar
08:57antares_Foxboron: I discovered it via youtube and github, but yeah, it is a very nice feature for docs
08:57Foxboronalso Vimium, never really used it before yesterday :3
08:58Foxboronhttp://support.google.com/chrome/bin/answer.py?hl=en&amp;answer=95655
08:58antares_Bergle_1: what it does is it prefixes the address bar with Searching ClojureDocs: and then when you enter a query and hit Enter, it sends you directly to ClojureDocs search results
08:58Bergle_1yeah it works now.
08:58Bergle_1but i had to visit clojuredocs.org first.
08:58Bergle_1at least once.
08:59Bergle_1chrome exists for me for google stuffs and checkvist.
09:02FoxboronJust shared the tip as it seems not many people really knows about them ^^
09:13Guest96956hello wat is the equivalent of (cons 4 5) in clojure cons in lisp creates a list cons in clojure requires to have a collection. IS there anything equivalent for this
09:14borkdudeGuest96956 no
09:15borkdudeGuest96956 clojure doesn't have cons cells
09:15Guest96956borkdude: why is that , do you know why cons doesn't work as in lisp
09:15borkdudeGuest96956 it's avoided on purpose I think, just a matter of design
09:16Guest96956borkdude: okay
09:17antares_Guest96956: there is a function called cons, though, just no cons cells: http://clojuredocs.org/clojure_core/clojure.core/cons
09:18borkdudeah yes, that sometimes confuses people
09:18tufflaxGuest96956, but also check out http://clojuredocs.org/clojure_core/clojure.core/conj
09:19borkdudejust remember: cons always adds to the front of a collection, conj adds whatever is natural for a collection to add an item (lists on the head, vectors on their ends)
09:20Guest96956but none of them would take two object and returns a cell
09:20Bergle_1hangon cons does whats natural for a collection as well. afaik.
09:20Bergle_1conj is just cons with param diff order.
09:21tufflaxBergle_1, not really
09:21antares_Guest96956: if you need "a cell", use a pair: [1 2]
09:21tufflaxcons always returns a seq I think
09:21tufflax,(cons 2 [1])
09:21clojurebot(2 1)
09:22tufflax,(conj [1] 2)
09:22clojurebot[1 2]
09:25Bergle_1ok i got my wires crossed ;) tah.
09:26Guest96956is there a rcurry in clojure
09:26Guest96956or equivalent
09:27Guest96956when i use a partial fn i want the evaluation from right hand side
09:33antares_Guest30953: maybe https://github.com/clojurewerkz/support/blob/master/src/clojure/clojurewerkz/support/fn.clj#L3 is what you are looking for?
09:34bordatoueanything equivalent to rcurry in clojure
10:16Guest3464i'm having problems with reading in parameters with ring. I'm getting a key must be integer error. Here's my code, can somebody see what's wrong? I dont see it. http://cljbin.com/paste/50b0e3d9e4b0dbc711a99f51
10:19winkGuest3464: could you try to import compojure.handler as something other than "handler"?
10:20Guest3464wink: nothing changed
10:21winkGuest3464: hm, sorry, looked like a namespace/import problem to me, I'm probably wrong though
10:22Guest3464wink: oh wait, after I restarted the server it seems to run. Not sure if it was the namespace though
10:23andrewmcveighGuest3464: I find that error usually means that you're trying to call a vector ##([1 2 3] :k)
10:23lazybotjava.lang.IllegalArgumentException: Key must be integer
10:41tgoossenswhere can i find what is new in clojure 1.5 ?
10:44tgoossensnvm
10:49DrakesonIs there a clojure repl (or just a clojure function) that can print the documentation for a java class?
10:51antares_Drakeson: http://clojuredocs.org/clojure_core/clojure.java.javadoc/javadoc
10:51antares_Drakeson: oops, not that one, hold on
10:53antares_Drakeson; actually, (javadoc 1) and (javadoc obj) is exactly what you need
10:53antares_just give it an object and if it is a JDK class instance, it should open a link with the docs in the browser
11:59kevin2895I am getting an error when running "lein check" on my app: Exception in thread "main" clojure.lang.LispReader$ReaderException: java.lang.RuntimeException: Unsupported character: \\-
12:00kevin2895But I can't figure out where it comes from... the stack trace only shows lines from internal clojure code
12:02antares_kevin2895: do you have \* somewhere in your code?
12:02antares_like \t?
12:02antares_there is probably either an extra \ or you are using an escape sequence JVM does not support
12:03kevin2895antares_: Why would lein check show an error like this that never comes up when my app is compiled or run?
12:06antares_kevin2895: can you post the entire stack trace?
12:06antares_kevin2895: it may be something in lein check implementation
12:06antares_yes
12:06antares_(.replace \- \_)
12:07antares_there is double escaping going on, I assume
12:10kevin2895antares_: https://gist.github.com/4140537
12:10kevin2895That is the stack trace
12:10antares_ok, it does not reveal the offender
12:11antares_kevin2895: is this codebase something you can share on github, by any chance?
12:11kevin2895antares_: unfortunately no, it is a large codebase that is not open source
12:12antares_kevin2895: ok. What OS do you use?
12:12antares_I am trying to reproduce this on any one of my 30+ repos.
12:12kevin2895windows right now, but the same error happens on mac
12:20antares_kevin2895: I suggest that you file an issue with Leiningen and ask on the mailing list
12:21antares_something causes double-escaping, leiningen.check does use \-
12:21antares_but \- is a valid character, \\- is not
12:29ambrosebsI'm getting my honours dissertation back tomorrow for corrections. If anyone is sitting on some more corrections, please send them my way!
12:29ambrosebsI've already uploaded the latest version.
12:32jacobsenambrosebs: I'd be interested in taking a look - what is the URL?
12:33ambrosebscool http://cloud.github.com/downloads/frenchy64/papers/paper.pdf
12:35jacobsenthanks - some friends and I were discussing your conj talk yesterday here in chicago, and looked at the slides. My friend was curious about how close to Haskel type classes your clj type system got. I'm sure your thesis will out. Thanks again!
12:37abpWow. Installing the Eclipse Color Theme plugin takes forever..
12:37ambrosebsjacobsen: No type classes, I strictly do not introduce new structures or idioms. Very cool and often requested future work though.
12:37jacobsenambrosebs: cool, thanks
12:44brainproxyambrosebs: what's the best way to get started w/ Typed Clojure?
12:45brainproxyi guess I should just read your paper :D
12:45ambrosebsbrainproxy: See the end of the introduction chapter.
12:45ambrosebsUnfortunately it's probably the best way atm.
12:45ambrosebsOr my conj slides.
12:45brainproxycool, thanks
12:46ambrosebsNB: TC currently requires clojure 1.5.0-beta1
12:47brainproxyi implemented an optional "return type checker" in my fork of protocol-monads, but it's really primitive and I didn't reference your work, just gave it my best guess
12:47ambrosebsyes I saw that. Seemed pretty cool for what it offered.
12:48brainproxywhat's the story on clojure 1.5, is it due to come out of beta soon, or is it still going to be awhile?
12:49ambrosebsnot sure myself.
12:49dnolenbrainproxy: I'd expect soon-ish
12:49PudgePacket|LSDo/
12:49brainproxy\o
12:50PudgePacket|LSDoh shit
12:50PudgePacket|LSDwrong irc
12:54brainproxydnolen: nice, looking forward to it
12:57muhoois that a half-cheer? or hailing a cab?
12:58muhoo o/ <--- taaxiiii!
13:12squidzwhats the preferred way to do ajax with clojure? right now I have a basic site with Ring and Hiccup. ?
13:15abpsquidz: You could try rpc using https://github.com/shoreleave/shoreleave-remote-ring on ClojureScript.
13:16squidzabp: thanks ill look into it
13:17squidzis the noir version pretty standard?
13:24ambrosebsdnolen: working on a little Typed CLJS example, basically #(if % (%) false) with type [(U nil boolean) -> boolean].
13:24ambrosebsWill finish tomorrow or the day after :)
13:24ambrosebswhoops [(U nil [boolean -> boolean]) -> boolean]
13:26ambrosebswas hoping to get a protocol example but it took more work than I expected to port the basics.
13:41octagonis there a reason why in clojurescript Function has not been extended to satisfy the IWithMeta protocol?
13:42octagondoes that cause problems somehow?
13:44dnolenoctagon: that's fixed in master
13:45octagondnolen: awesome thanks!
13:47octagondnolen: how would you recommend i add clojurescript as a dependency to my leiningen project so as to get a current version?
13:48dnolenoctagon: lein-cljsbuild currently dictates a version, hopefully it can stop doing that and you can just specify the version need in the future.
13:49octagondnolen: i'm not using lein-cljsbuild actually, i'm calling the compiler from within my own plugin
13:49dnolenoctagon: then you can get the version in the usual way
13:49octagoni'm currently specifying [org.clojure/clojurescript "0.0-1450"], but i am not sure how to find which versions are available
13:50dnolenoctagon: if you want to use master - clone into your repo and add the src directories to your classpath
13:50octagondnolen: if i do that then my jar that i distribute on clojars will contain the cljs compiler, yes?
13:51octagonif so would that cause problems if someone depends on lein-cljsbuild, for example, in their project, too?
13:51dnolenoctagon: probably - so just wait for the next release.
13:51dnolenoctagon: lein-cljsbuild is a plugin - not a direct depedency so I'm not sure if that's problem.
13:52dnolenhttps://oss.sonatype.org/index.html#nexus-search;quick~clojurescript
13:52octagondnolen: cool thanks. i think i'll work with master in dev and wait for the next release to push the new stuff
13:53octagondnolen: awesome, i didn't know about that, that's exactly what i needed
14:19tgoossensis the use of monads in clojure not more difficult because it is dynamically typed?
14:25antares_tgoossens: static vs dynamic typing makes no difference for monads
14:29tgoossensantares_:just wondering. It has only been a few hours i first read and heard about monads :p
14:37gfrederickswell I can imagine having a harder time debugging monads without the compiler barking about specific type mismatches
14:37antares_gfredericks: that's not specific to monads, though
14:38gfredericksnot that the type mismatches in haskell are easy to understand; but it's at least something concrete compared to however a similar runtime error would manifest itself in clojure
14:38gfredericksantares_: sure but you said "makes no difference"
14:38gfredericksand he was asking about difficulty
14:38antares_well, ok, fair enough
14:38borkdudeof course it makes a difference
14:38borkdudebut in clojure you usually can avoid monads ;)
14:39abpHm, can I reduce with recur or something like that?
14:39gfredericksabp: instead of with reduce?
14:40abpgfredericks: Yes. I just don't know how to flatten my structures, probably.
14:44gfredericksabp: I think that question could do with some example data :)
14:45abpgfredericks: Uhm, yea, but that's what makes me hesitate to ask. It's a dependency graph and making up an example would need some work.
14:47gfredericksmy only thought without anything more concrete is that there's a 20% chance mapcat will do what you want?
14:47gfredericksbut I really can't say
14:48abpgfredericks: I think I'll try to get a working loop/recur-version, often reduce sits in complex loop/recurs and smiles at me.
14:49abpgfredericks: Thanks so far.
15:04firesofmayHey can anyone tell me, are ring middlewares similar to mediawiki extensions? extending the functionality of the site. In a way. Am I correct here?
15:05weavejesterfiresofmay: Yes… But they extend the functionality of the whole app. They're not like widgets you can add to a page.
15:05weavejesterfiresofmay: More formally, they're functions that change a handler into another handler.
15:06firesofmayweavejester, okay.
15:07borkdudefiresofmay if you're familiar with the filter or pipe pattern in OO, it's kind of like that I guess
15:07firesofmayweavejester, so mediawiki extensions are widgets? I thought they extend the functionality of the website in itself. No?
15:07firesofmayborkdude, okay.
15:08tmciverborkdude: I might say it's more similar to the Decorator pattern, yes?
15:09weavejesterfiresofmay: I have no idea what mediawikis extensions are, aside from the obvious :)
15:09firesofmayweavejester, :) cool
15:09borkdudetmciver that might be a better analogy
15:09yedimatch is super cool
15:11borkdudetmciver maybe those patterns are essentially the same thing, now that I'm thinking about it?
15:13tmciverborkdude: perhaps, I'm more familiar with decorator than pipe. I think Filter and Decorator are similar.
15:14tmciverThat explains it: no filter or pipe pattern in GoF.
15:15borkdudetmciver http://stackoverflow.com/a/747975/6264
15:17iosicahey guys a quick question about vars and symbols
15:17iosicasay s is a symbol for a var to a fn
15:17iosicahow do I get execute that function?
15:18borkdude(s)
15:18borkdudeor (s args) if it has args
15:18iosicas (`identity)
15:18iosicahow do I execute s now?
15:18borkdude,(let [s (fn [x] (inc x))] (s 1))
15:18clojurebot2
15:19Scriptorwhat are you trying to set s in that?
15:19Scriptorthe identity function?
15:19iosicaI'm sending s over the wire
15:19iosicaon the other side I have the symbol for the function
15:20borkdude(defn my-fun [s] (s)) ;; like this?
15:21iosicanot exactly, thinking for a good example
15:22iosica(s) appears to be the right way but on the other side s returns nil
15:22iosicathis is how I got it to work
15:22iosica((clojure.lang.RT/var (namespace s) (name s)))
15:22iosicabut this is too weird
15:24iosicaidentity function is just an example
15:25borkdudesorry, gtg
15:26iosicathis is how I got it to work in java
15:26iosicapublic final class GenericMapFn extends MapFn<Object, Object> {
15:26iosica private final Symbol fnSymbol;
15:26iosica private transient IFn fn;
15:26iosica public GenericMapFn(Symbol fnSymbol) {
15:26iosica this.fnSymbol = fnSymbol;
15:26iosica }
15:26iosica @Override
15:26iosica public void initialize() {
15:26iosica fn = RT.var(fnSymbol.getNamespace(), fnSymbol.getName());
15:26iosica }
15:26iosica @Override
15:26iosica public Object map(Object input) {
15:26iosica return fn.invoke(input);
15:27iosica }
15:27Scriptor,pastebin
15:27clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: pastebin in this context, compiling:(NO_SOURCE_PATH:0)>
15:28iosicahttps://gist.github.com/4141292
15:28Scriptorgah, anyway, it'd help to use something like https://www.refheap.com/paste for code snippets like that
15:28Scriptor:)
15:28iosicacreated a gist
15:28iosicasorry still new to irc
15:28yediin core.logic, why can't constrains be any predicate function that returns a boolean?
15:33MahNiggardChousuke suomalainen, miks sä et rakasta mua enää
15:34MahNiggardMä olen kissa jolla on pyörät, sun rakkaukseni on pakko olla minun, homo.
15:34Scriptorops?
15:40brainproxywhat are my options if I essentially want defrecord, but I need to override clojure.lang.IHashEq
16:36xeqiis there a library for interacting with http://jejacks0n.github.com/mercury/ ?
17:06Frozenlock&(class (make-array Byte/TYPE 0))
17:06lazybot⇒ [B
17:07FrozenlockIs there a class I could use that matches everything made with 'make-array' or 'into-array'?
17:08seangrovednolen: Are there any instructions on using a custom-compiled goog-closure.jar with lein-cljsbuild? I can't seem to find any, and there are a \
17:08seangrove... a few bugs with the version included in the current lein-cljsbuild
17:11lynaghkping: hugod
17:18replacabn m ji]'l;;i~y6~ugggt576v7mbnbn b c,c,c,c
17:18replaca=
17:23zerokarmalefti'm wrapping a macro that calls defn in a let/doseq and no vars appear to be getting bound: https://gist.github.com/4141616
17:23zerokarmaleftis there something i'm missing?
17:28bbloomi really wish cljs had eval :-/
17:59seangroveThe Closure library is pretty gnarled in a few places... good code, but not particularly well documented from a high-level point of view
18:31Ploiqseangrove, give me a library that isn't, and I give you a Finn that doesn't eat reindeer
18:45zii-primequestion: would there be any run-time disadvantage to changing the implementation so as to auto-require clojure.set when you say clojure.set/intersection and it doesn't resolve?
18:45bbloomzii-prime: yes, this has been discussed before… let me find you the details
18:46bbloomzii-prime: http://dev.clojure.org/jira/browse/CLJ-461 see Rich's comment at the bottom
18:47cgagAnyone know the state of clojure for android? I think last I heard it was useable but had a really large startup time, but that was quite a while ago
18:48zii-primebbloom: but... calling a function in a module can have arbitrary side-effects. How is loading so dangerous?
18:49bbloomzii-prime: most clojure code avoids side effects, documenting them when they exist. implicit loading would cause the transitive closure of dependencies to be implicitly loading… which can have a wide variety of global state side effects
18:50bbloomzii-prime: violates http://en.wikipedia.org/wiki/Principle_of_least_astonishment
18:50bbloomzii-prime: plus, if you already have a qualified symbol, ie clojure.set/intersection, it's trivially to (require clojure.set)
18:51zii-primebbloom: this is only true when using good code, and, using good code, loading namespaces won't do anything evil. / yes, true; it's also trivial to say BufferedImage bi = new BufferedImage(BufferedImage.SOMETHING_I_FORGOT); in java
18:52wingyi finally get why rick hickey is not that fond of testing
18:52bbloomzii-prime: this sort of thing is already a problem in java. there was a guy in here a week or two ago who was getting a strange error that made no sense. we tracked it down to a little static initializer that was attempting to log something, but he didn't have a logger configure
18:53bbloomzii-prime: clojure is trying to avoid exacerbating problems like that
18:53bbloomwingy: i don't think "not fond of testing" is the right way to describe it…. more like not fond of TDD
18:55UrthwhyteIs there someplace I can read about his thoughts on that?
18:56bbloomUrthwhyte: http://www.codequarterly.com/2011/rich-hickey/
18:56bbloomUrthwhyte: search "TDD"
18:56wingybbloom: if i may .. i think that FP reflects the nature's way of thinking .. that we are living in a big digital system that someone (God as a super programmer?) created .. and this world seems quite bug free .. we don't freeze all of the sudden .. the best way to create the bug free digital system is to simulate this universe .. i don't think God is running the code for this world through a test suite .. everything is just live
18:56Urthwhytebbloom: cheers!
18:56wingyjust some thoughts i have recently :)
18:57wingybottom line .. i deleted all my tests .. everything is live .. they work if they work .. if they don't i correct them in the test production
18:57zii-primebbloom: are people really bad enough to do nasty things in namespaces as they load but good enough to explicitly point out all side effects?
18:58bbloomzii-prime: it's not a matter of good or bad, it's the matter of the top level operations in a module being inherently side effectual. def, for example, mutates the global collection of vars
18:59zii-primebbloom: and... that needs to occur at predictable times? That's like the antithesis of "laziness is a good idea".
19:00bbloomzii-prime: laziness introduces significant complexity. for example, it doesn't play well with dynamic bindings. after many languages have included and studied laziness, clojure made the decision that it was worth the cost/benefit trade off
19:00bbloomzii-prime: the default is to not add features. the benefits to auto namespace loading are small. you can easily work around the lack of such a feature. adding it adds complexity
19:01bbloomzii-prime: the trade off is either A) not well understood or B) deemed not worthwhile. in either case, features don't get added to clojure to minimize complexity
19:02bbloomzii-prime: and with laziness in particular, side effects are a huuuge problem
19:02zii-primebbloom: i could see that, but i really don't see the complexity. like, are defs overwriting other defs normally?
19:02bbloomzii-prime: module loading is side-effectualy. lazy module loading seems like a bad idea to me on those grounds
19:03bbloomzii-prime: not usually, but lots of people (set! *warn-on-reflection* true) and other compile time configuration
19:04zii-primebbloom: =/
19:04bbloomzii-prime: ?
19:05zii-primebbloom: at least there's some reason for the way it is =/
19:05Urthwhytebbloom: that was a great read, thanks for the link
19:05zii-primebbloom: still don't like it, tho
19:07bbloomzii-prime: personally, i really like it. i quite enjoy having all of the dependencies for a file listed at top. as somebody who has written *a lot* of ruby code that has ZERO require statements and auto code loading, i can tell you that it's convenient now and nightmarish when you want to refactor
19:08zii-primebbloom: that sounds extreme . elaborate?
19:08bbloomzii-prime: Rails automatically requires modules by overloading Kernel.const_missing
19:09bbloomzii-prime: if you have a User class and another file tries to reference User, it will convert that to the string "user.rb" and then start searching auto_load_path until it finds "modules/user.rb" and then require that
19:11bbloomzii-prime: so much badness happens, it's absurd… one time, I tried I had a thing called UserBucket and all was fine. Then I moved some totally unrelated code and that UserBucket thing stopped working. turns out I was causing the load order of my AWS S3 library to be delayed a tad, so it got put on the auto require path later, there was already a UserBucket type or it was even generating XXXXBucket constants programatically.
19:11bbloomzii-prime: it was insane. took me HOURS to debug
19:11bbloomzii-prime: and then additional hours to manually re-arrange the load order to fix it
19:12bbloomzii-prime: laziness and side effects just don't play nice. it's a law of the universe as far as i'm concerned
19:12bbloomzii-prime: minus an explicit dependency graph. which, it turns out, we have: at the top of each file in the ns form :-)
19:19zii-primenew question: would merging false and nil (getting rid of false) be desirable, and what are the obstacles to doing it? I'd think "yes" and "interfacing with false-using code, confusion".
19:19tos9what would be the benefit
19:20Urthwhytenil and false are semantically different
19:22zii-primebenefit: never have to worry about whether you want to do (if object ...) or (if (nil? object) ...) and such confusions. It's even worse in javascript.
19:23tomojnever have to worry about it until you need it
19:23zii-primeit's so easy to have a bug where you do (if object ...) but meant (if (nil? object) ...), and it breaks flow having to think about it
19:24UrthwhyteSay you had a voting application
19:24tomojif you only have false, (= __ ({0 false} 1))
19:25Urthwhyte{:option1 nil :option2 false :option3 true} is different than {:option1 false :option2 false :option3 true}
19:26zii-primeso if you want to do a trilean, do an enum (clojure version: keyword)
19:26UrthwhyteI also imagine there are JVM related reasons for not doing so
19:27zii-primeno. there are not.
19:27tomoj(if :false true) :/
19:28tomojI think I'd just end up creating something an awful lot like nil on my own
19:29tomojexcept it would be truthy
19:29UrthwhyteI can't understand the rationale behind removing something with extremely low impact on cognitive load
19:29zii-primewell, yes. you could rephrase this as "make false truthy"
19:29bbloomzii-prime: many predecessor lisps has studied the false / nil / '() distinctions deeply
19:30bbloomzii-prime: search the web for "nil punning"
19:31zii-primebbloom: yes, i've read all about that . common lisp actually does a combination of this and making nil act as a seq. which it kinda does in clojure.
19:31tomojso you want to leave nil, but (true? (if false true)) ?
19:32bbloomzii-prime: clojure provides the seq function, which will convert empty sequences to nil; this forces you to opt into nil punning
19:32bbloomzii-prime: true, false, nil, and '() all being different things… on purpose
19:33zii-primebbloom: right. yes. but what is the purpose aside from interoperability? tomoj: yes
19:33bbloomzii-prime: interoperability has practically zero to do with it. in fact, it doesn't even interop well….
19:33bbloom,Boolean/FALSE
19:33clojurebotfalse
19:34bbloom,(= false Boolean/FALSE)
19:34clojurebottrue
19:34bbloom,(Boolean. "false")
19:34clojurebotfalse
19:34bbloom,(= false (Boolean. "false"))
19:34clojurebottrue
19:34bbloomhmmm...
19:34bbloomseems slightly better than i recall :-)
19:35bbloomoh, duh, i meant:
19:35zii-prime,(identical? Boolean/FALSE (Boolean. "false"))
19:35clojurebotfalse
19:35tomoj&(false? (Boolean. false))
19:35lazybot⇒ false
19:35bbloom,(if Boolean/FALSE :t :f)
19:35clojurebot:f
19:35bbloomvs:
19:35bbloom,(if (Boolean. "false") :t :f)
19:35clojurebot:t
19:35bbloomyeah, that was it :-P
19:35zii-primeoh thank goodness
19:36bbloomthanks tomoj
19:36bbloomanyway, interop isn't the reason...
19:36zii-primebbloom: interoperability with java code using true and false objects, i meant
19:37bbloomzii-prime: well, they are convenient for that purpose, but nil, false, and '() really are DIFFERENT THINGS. being able to tell them apart is important
19:39zii-primebbloom: yes. they are different. and they should exist. but why should false be falsy?
19:39bbloomzii-prime: …. because it's FALSE
19:39bbloomzii-prime: isn't that practically the definition of "falsy"?
19:39tomojwhy should false be nilly?
19:39bbloomlol
19:39bbloomthis conversation really isn't productive at all....
19:40bbloomzii-prime: are you trying to learn? or are you trying to influence clojure to change? or are you just trying to entertain yourself?
19:40zii-primebbloom: (defmacro if [test a b] `(if (nil? test) a b))
19:40UrthwhyteWell, the entire conversation is predicated on a fundamental disagreement about whether false is different than nil
19:40tomojthe idea would be that (if x ..) only checks to see if x is nil, and predicates return true or nil, I guess?
19:41zii-primebbloom: learn, really. either i learn to express why false shouldn't be falsy, or i learn that it should be. and i am confufrustrated!
19:41zii-primebbloom: also, it will determine whether i code with false myself
19:42bbloomzii-prime: idiomatic clojure code uses false
19:42bbloomzii-prime: I suggest you continue on using it and then once you have more experience working with both false and nil as separate entities, i suspect the benefits will be clear
19:42zii-primebbloom: strictly following idioms means stagnation
19:42bbloomzii-prime: you're unlikely to be convinced in irc of this
19:42tomojnot really clear to me :(
19:43bbloomzii-prime: yes, lisps were strictly following the nil punning idiom, so clojure moved on from that :-P
19:43tomojsaves you from typing (if (true? bool) ..) but no big deal
19:43zii-primebbloom: they are separate; i'm not questioning that! false is useful. but should it be FALSY??
19:43lazybotzii-prime: Definitely not.
19:43bbloomlol lazybot.
19:43zii-primelazybot: whyyy
19:44bbloomzii-prime: lazybot is a bot...
19:44zii-primebbloom: whyyy
19:44tomoj(get m k) can still return nil if not found
19:45zii-primetomoj: i started out by saying that false should be gotten rid of. that was stupid. i'm trying to talk about its falsyness
19:45tomojyeah
19:45tomoj(if (true? (get m k)) ...) would work fine
19:46tomoj(if (get m k)) tells you whether the key is not in m or nil in m
19:46zii-primeno, it doesn't
19:46zii-primeit tells you if the key is not in m, or is nil in m, or is false in m
19:46holohi
19:46zii-primei'm proposing it telling you if the key is not in m, or is nil in m
19:46tomojI'm talking about your proposal
19:47zii-primebbloom: like, it sounds like arguments for false being falsy (that is, (= :f (if false :t :f)) ) are pretty similar to arguments for '() being falsy or even "" being falsy
19:47zii-primetomoj: ohskay
19:48tomojkeep seems sort of a concession
19:48metelluszii-prime: so are you suggesting that (if false a b) should return a?
19:48tomojthis one spot in clojure.core weirdly has the semantics you want :)
19:48zii-primemetellus: yes, similar to (if '() a b) returns a
19:50holoi have a cyclic dependency exception [ /app/server ]->/app/db->/app/models/user->/app/views/user->[ /app/server ]. i'm sure /app/server is not requiring /app/db as it was before. i already cleaned everything with lein clean. shouldn't i do some manual cleansing?
19:50bbloomzii-prime: if anything, nil shouldn't be falsy… it's just too damn convenient not to be
19:50bbloomzii-prime: it's a matter of what people expect and what doesn't complicate it too much
19:51bbloomzii-prime: this is something that is never gonna change in clojure. it would break EVERYBODY. so i propose that you can go study this with a toy lisp, and publish your findings :-)
19:51tomojI think I'm tentatively convinced, nilliness > falsiness. but, what bbloom said, and I don't care much
19:54zii-primehonestly, this is in my list of "things that *really* aren't important"
19:55zii-primeit just... makes me feel bad inside every time i have to think about the fact that we're using two falsy values? and it's confufrustrating =(
19:56tomojfalse is the only falsey value which can be a datomic value
19:57zii-primeand when i use if, and not if nil?, to ask if something is nil when i know it won't be false
19:57tomojI guess that might seem to make a lot of sense given the names :)
19:57zii-primedatomic?
19:59zii-primetomoj: datomic?
19:59tomoja db, try google
19:59tomoj(fn has-attr? [db e attr] (not (false? ((d/entity db e) attr)))) :/
20:00tomojer
20:00tomoj(fn has-attr? [db e attr] (not (nil? ((d/entity db e) attr))))
20:01tomojoh that's silly ofc
20:01tomojsince [?e ?attr _] already does that
20:07zii-primebbloom: yeah, trying to get other people to do it certainly won't work; so... what are the technical problems with doing it within a particular piece of code (such as: a library)? i can think of "when other code passes me false, sometimes it means falsy and sometimes it means false"
20:33nightfly_Is there an easy equilivent-to/way-to-run `lein test` available from with a repl spawned by lein?
20:42iosicaguys I've tried several things but still can't make this work
20:42iosicaI have a func in a test.namespace
20:42iosica(defn interesting-fn [] nil)
20:43iosicaI have the name of the func and the name of namespace as 2 strings
20:43iosica"test.namespace" and "interesting-fn" how do I obtain the var
20:43iosicaso I can execute this function?
20:44tomoj&((resolve (symbol "clojure.core" "+")) 1 2 3)
20:44lazybotjava.lang.SecurityException: You tripped the alarm! resolve is bad!
20:45iosicaresolve, intersting
20:45iosicathx let me try this
20:47iosicanice, why is resolve bad?
20:47jblomolynaghk: got a minute for c2 questions?
21:00\xDE\xAD\xC0\xDEwhats the ability called in clojure that lets me (defn foo ([x] x) ([x y] (+ x y)))
21:01\xDE\xAD\xC0\xDEmultiple arity functions?
21:01Bergle_1that seems like a decen tname for it.
21:02Bergle_1not ssure its the common name for it..
21:02Bergle_1book ive got calls it 'creating a function with variable arity'
21:16holoBergle_1, isn't & args also variable arity? . in the other case, different expressions are called for different arities
21:57tomojI want a leiningen option that will turn on warnings on any unrecognized options in project.clj
21:58tomojthen if I forget it's :jvm-opts, I'll know before I start cranking on a bunch of data and have to start over
21:59bbloomtomoj: maybe head on over to #leiningen and tell them that? :-)
22:00tomojI'll just comment on my :{jvm,java}-opts issue
22:04tomoja new keyboard is on the way, but right now when I need to C-u I type M-x universal-argument (I bound <Multi_key> <p> to "u" but that doesn't work with control)
22:04tomojso every time I have to manually fix paredit's wreckage, I really notice
22:05tomojnot all that rare..
22:22tomojshould LazySeq implement IDeref?
22:22tomojif so, should other ISeqs? should nil?
22:29bbloomtomoj: no
22:30bbloomtomoj: deref is used when you you have an explicit separation between an identity and a value
22:30bbloomtomoj: lazyseqs are values, they just happen to have delayed execution semantics
22:32wingydo you put the arg list after or under the fn name
22:32wingy?
22:36tomojbbloom: indeed
22:36tomojbegging the question
22:37tomojis a (promise) a value?
22:38bbloomtomoj: i would think not
22:38bbloomtomoj: it has state
22:38tomojrealized or not?
22:38bbloomand success/failure
22:39tomojseq'ing a lazy-seq can throw an exception as well
22:39tomojrealized or not.. :/
22:39bbloombut if a lazy seq fails, it's a bug
22:40gfrederickshow does seq'ing a realized lazy-seq throw an exception?
22:40bbloomif a promise fails, you can come up with a retry policy
22:40tomojthat's OK
22:40tomojthat promise itself is permanently failed
22:40tomojyou just have a different promise which catches its exception
22:40tomojyou might do the same with lazy seqs, no?
22:41tomojif you don't call realized?, then a promise seems to have very good value semantics
22:42bbloomtomoj: the distinction is that a promise offers you an interface
22:42bbloomtomoj: where as a lazy seq is an optimization really
22:43bbloomthe interface you're offered is one of a sequence
22:43tomojyeah
22:43bbloomyou could say ok well a default sequence is just always realized
22:43bbloomand i'd argue that might even be a useful thing to do
22:44bbloompromises exist as a way to OPT IN to identity semantics for a computation
22:44bbloomvalues are nice to work with, identities are slightly more problematic
22:44bbloomso you should only use an identity, which requires dereferencing, when you need the semantics of one
22:44tomojyes
22:44bbloomagain, different things on purpose :-)
22:45tomojthe problem is if you turn the arrows the other way around, you can't just have seq hide the IDeref anymore
22:45tomojby "turn the arrows" I mean e.g. use something like cljque
22:46bbloomreactive programming is still an open research area :-)
22:46bbloomif you look at .net's Rx, you'll see issues of state creeping in
22:46bbloomin particular, IDisposable
22:46tomojyep
22:46bbloomthe value of values and all that
22:47tomojIObservable is already terrible
22:49tomojIDisposable is like C-c C-c
22:49tomojor could be, I think
22:49seangroveAnyone using Datomic at all? I'm using it for a side-projet, and it keeps getting killed on the server
22:52tomojanyone?
22:52clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
22:53tomojI mean, what, it just dies with no output?
22:53tomojthe free transactor?
22:53seangroveYeah, free transactor - I asked that way because I haven't seen anyone using it in here
22:54tomojso you start it up, it prints nothing, and dies?
22:54seangroveIt runs for awhile, but under a tiny bit of load, dies with: bin/transactor: line 31: 18060 Killed java -server $XMX $XMS $JAVA_ARGS $DATOMIC_JAVA_OPTS clojure.main --main datomic.launcher "$@"
22:54tomojah
22:54tomojodd..
22:54tomojyou aren't running out of memory? :)
22:54seangroveHaha, presumably, I'm re-tweaking the vps now to test that hypo :)
22:54tomojhmm
22:55seangroveLet me run it again with some more memory and test it
22:55seangroveReally not sure of the expected environment for datomic to run properly
22:55tomojdoes that message rule out datomic killing itself?
22:55tomojI know the transactor dies if it has a lot of trouble performing a transaction
22:56hughfdjackson:D so, the almost inevitable follow up Q to 'what should be the first clojure book i read?'
22:56hughfdjacksonwhat should the second one (after 'programming clojure') be?
22:58seangrovetomoj: Seems like it's doing better with more memory. Suppose I expected warning in the log file or something...
22:58tomojthe weird thing about cljque is that you can have non-local errors - you pass out a promise and anyone can fail it. if that API is not public, or is wrapped in a similar way as LazySeq/delay, I think some problems go away
22:58tomojseangrove: dunno.. check the Xmx?
22:59tomojdisposal is still weird
22:59yxz97Good Evening
23:00seangrovetomoj: cljque does look pretty interesting
23:01yxz97Hi I wanna ask a silly questions guys..
23:03gfrederickswell by all means just sit there and deliberate about whether or not you're going to ask it
23:03lynaghkjblomo: you still around?
23:05yxz97my question is not technical
23:05yxz97I'm wondering is there is any market for developers wanting to learn clojure..
23:07FoxboronI doubt it would work in the long run.
23:07yxz97I mean, learning a new programming language is not cheap, and we deserve very well paid jobs when we do our jobs, many people I know they just do what they do by the money, which is great, we have families, goals, etc, but also some of us just do not blend, at least so quick by the market..
23:07FoxboronLike, it would be better learning away concepts about functional programming or LISP in general.
23:07Foxboronyxz97, is there a marked for devs wanting to learn JavaScript? Java? C#? Python? etc?
23:08Foxboron( actually dont know so asking :P)
23:09yxz97Well, not sure if I use the word market for you to understand but for me is like when there are very clear needs in the market for Java enterprise developers for example or JavaScript front end developers...
23:09yxz97you know what I mean?
23:09tomojgoing to have some trouble finding freelance jobs or jobs at old and/or inflexible companies I think
23:10Foxboronyxz97, ah. THen i missunderstod your use of the word :)
23:10yxz97I have to say I'm from Costa Rica, and most of the jobs are just Java, C#, or PHP the most updated languages .. there are some in C, C++, Power Builder, etc...
23:10yxz97No problem :)
23:10Foxboronthen i think your chances are slim :P
23:11bbloomyxz97: along the axis of "hiring for a language X skill", i'd argue there are three buckets: 1) we're hiring X developers. 2) we're hiring developers, but can't afford to have somebody learn X on the job and 3) we're hiring developers
23:11bbloomclojure is not a language for companies in bucket 2
23:13yxz97I think the way goes to learn Scala..
23:13yxz97I could be wrong, but for instance, I saw a free course given by standford university to learn Scala and why they did not do it for Clojure?
23:13yxz97Scala is used by Twitter (before Ruby..)
23:14yxz97Any know bug project using Clojure?
23:14yxz97s/bug/big
23:15tufflaxyxz97, about the Stanford course: I don't know, but don't read too much into it
23:15bbloomyxz97: big projects using clojure is a question for google. you'll find plenty of companies using it
23:16yxz97Yeah that guys pursue given free lessons for different technolgies which are most demanded currently by the market .. as iPhone IOS development .. :S
23:16yxz97bbloom: yeah you are right...
23:16bbloomyxz97: universities live in markets, but aren't as beholden to market forces as you might imagine
23:16jblomolynaghk: back :)
23:17bbloomyxz97: maybe somebody at that university just happened to like scala
23:17bbloomyxz97: like tufflax said, don't read too much into it
23:17spaceshipsbbloom: i believe the guy who wrote scala is teaching it
23:17bbloommystery solved.
23:17bbloom:-P
23:17yxz97Yeah I remember yes he was the teacher!
23:17yxz97:P
23:18lynaghkjblomo: I'm cooking at the moment, but if you have any C2 questions, shoot = )
23:19yxz97ok, I been programming imperative code quit some time, java, php, ... and I wanted to learn another way of thinking, but at the same time make profit on it!
23:19lynaghkjblomo: Thanks for the histogram layout, by the way. I have been working mostly on C2PO for the past few weeks, so I've left C2 idle, unfortunately.
23:19jblomolynaghk: excellent. I think I've got it working now
23:19bbloomyxz97: learning functional programming will make you a better java/php developer which you can make a profit from
23:19jblomoI don't know why I needed the :forced-uupdate? true for unify
23:20yxz97bbloom: why better programmer?
23:21jblomolynaghk: np regarding histogram, it was nice to learn. what's the long term plan for c2 vs c2po?
23:21bbloomyxz97: again, this is a better question for google
23:22bbloomyxz97: http://www.cse.chalmers.se/~rjmh/Papers/whyfp.html
23:22tomojmapM :: (a -> Deref b) -> Seq a -> Deref (Seq b). that's mapcat where f returns lazy seqs, if you make seq a synonym of deref. but asynchronous seqs are also Traversable, they just have Defer instead of Deref — and on the jvm Defers are also Derefs, so they can play as Seq there too. if you theoretically made seq a synonym for deref in clojure.core (not really ready to say I'm proposing that..), the same code would work on all of them
23:22tomoj(on the jvm). if you parameterize by execution policy, the same code will (I think) work for e.g. an asynchronous mapcat, and maybe for asynchronous reducers
23:22tomojwow that was a lot
23:23lynaghkjblomo: c2po is a grammar of graphics built on top of c2 (and several other rendering outputs---e.g., canvas/bitmap) in addition to C2's DOM-based rendering.
23:24bbloomi keep seeng jblomo and my brain is parsing it as my handle bbloom :-/
23:24yxz97I just read this page past hour: http://www.paulgraham.com/avg.html talks about functional programming and our mind focused ... nice article ;)
23:26yediif you can rebind the same variable multiple times in a let block
23:26lynaghkjblomo: It's still an open question where full-on layouts (e.g., treemaps) fit into both C2's low-level mapping and C2PO's grammar. My gut instinct is to put it as a third transform after groupings and stats.
23:26yedicouldn't you feasibly write mutable code that way
23:27bbloomyedi: no. bindings are lexical:
23:27lynaghkjblomo: which is the approach that D3 takes. The layouts (like your histogram) transform the raw dataset into something that can be then directly mapped to the DOM.
23:27bbloom,(let [x 1] (let [x 2] x) x)
23:27clojurebot1
23:27lynaghkjblomo: are you coming up for Clojure/west in March, by the way?
23:28bbloomyedi: it's effectively "single static assignment"
23:28jblomolynaghk: OK, sounds good. I want to make sure I'm learning something that's not already deprecated :)
23:29jblomolynaghk: clojure/west is not in the cards, still can't justify trip since job is not using it yet
23:29jblomoportland?
23:29yedi,(let [x 2, y 3, x (+ x y), y (+ x y)] [x y])
23:29clojurebot[5 8]
23:29lynaghkjblomo: nah, definitely not. C2PO fills a separate space than C2. To be honest, I don't really like thinking of C2 as a thing---really you're just learning Clojure + the DOM/CSS.
23:29jblomomaybe i can submit a talk
23:29lynaghkjblomo: yep. Magical land of beer + food carts + coffee + bouldering.
23:30lynaghkjblomo: just saying. = )
23:30jblomowell, c2 wraps up bind!, unify. seems like those should go together
23:31jblomoand... uh.. coffee hiccup.. forget what you called it :)
23:31octagonhi, if i define two protocols, IFoo and IBar, and both have a method -doit, how would clojure know to call the correct one?
23:31lynaghkjblomo: singult. Yeah, C2's bind macro uses all of that under the hood.
23:31jblomolynaghk: ah yea, my main question: why do i need force-update? true for unify?
23:32jblomodoes that force a recursive comparison?
23:32yedibbloom: it's like you can write imperative code inside the let block
23:32bbloomyedi: not really. consider conditional execution: if and loop
23:32lynaghkjblomo: you would only use that if your mapping fn is a closure---i.e. it encloses some piece of mutable state that is not part of the data you're passing to unify
23:33lynaghkjblomo: by default unify is lazy, and will only touch DOM nodes for which the corresponding data has changed.
23:34jblomoahhh, looks at the data
23:34yedibbloom: ah
23:37lynaghkjblomo: yeah. D3 has the same semantics, but as far as I know there so no way to force updating of nodes. If you're wary of that option you should just merge all of the mutable state into the seq that is passed in as "data". Typically for us this is the dimension "is-selected-item?"
23:38jblomoyea, the mapping needs access to the whole dataset, not one item at a time
23:39jblomoi was thinking of passing it as (unify [[data]] ...) seemed ugly though
23:39jblomo[[@data]] i guess
23:40lynaghkjblomo: can you talk about your specific data set?
23:42seangrovelynaghk: C2 is awesome, thank you for it
23:42lynaghkseangrove: thanks!
23:43lynaghkseangrove: I never get any github issues about it, so I've never been sure if no one uses it or if it just works =P
23:43jblomolet me get the code cleaned up and i'll share
23:43jblomoseangrove: i'm interested to know what you've used it for
23:49abplynaghk: I built a data-bound table with C2. Was a litttle incovenient to have to render a row per unify because I got multiple header and separator rows, so I needed to include those in my data.
23:51lynaghkabp: I don't know when you used it, but a month or two ago the "bind!" macro landed and you can put bindings directly within hiccup
23:51jblomodoes anyone have a better way of cljs debugging than calling cljs.core.str() on the object you'd like to inspect?
23:51lynaghkabp: e.g. (bind! [:table [:thead ...] [:tbody (unify dataset-1 row-template-fn-1)]])
23:52lynaghkjblomo: (:use-macros [c2.utils :only [pp]]) brings in a macro that prn-strs your object and prints to the console
23:52lynaghkjblomo: but all-in-all the cljs debugging/profiling situation is pretty poor at the moment.
23:53jblomothen i use c2.util.pp(blah)?
23:54lynaghkjblomo: yeah
23:54lynaghker, (pp blah)
23:59abpDamned router, stays connected the whole night, while no one uses it and as soon as I use the net, it collapses. :x