#clojure logs

2012-06-29

00:04technomancyhircus: no, that would be 2.x
00:05technomancy2.x doesn't really need maven actually, just aether, which should be significantly smaller
00:06brehautcemerick, amalloy: my complaint with use of type when you mean class is to do with intent; class is about concrete implementation, type is about abstract taxonomy
00:07brehautit happens that the concrete implementation is used as taxonomy, but its not necessarily the case
00:08xeqiJulioBarros: I think you're looking for http://docs.oracle.com/javase/6/docs/api/java/security/MessageDigest.html
00:11anieroaperiodic: sweet, this appears to be working. not that i can easily test high concurrency yet, but still!
00:12hircustechnomancy: ah, ok; in case the Maven2 maintainer keeps dragging his feet we'll have to take a look at that
00:12technomancyhircus: there are more dependencies on the clojure side, but I think fewer total
00:12brainproxyJulioBarros: linux distros usually come with hashing libs and cli frontends for them either installed by default or easily installed with a package manager
00:13hircuswe'll still have to wait until it can be built without bootstrapping using Leiningen 1.x, right?
00:13technomancyI don't think that will be difficult
00:14technomancyin fact, it might be enough just to check pom.xml into the packaging branch and run mvn install
00:14technomancyonce leiningen-core's dependencies are packaged anyway
00:14hircusah, ok
00:15technomancythat same process (store the pom in the packaging branch, run mvn install) will probably work for the clojure dependencies lein has
00:16technomancyor just a simple `jar -cf [...]` invocation if you prefer
00:18technomancyhircus: all the deps of leiningen: http://p.hagelb.org/lein-deps.html
00:18hircusthanks
00:18technomancyall the signed ones are in Central and build without lein
00:18hircustechnomancy: that'd work out great, as currently there's no Maven in RHEL / CentOS / Scientific Linux *at all* :)
00:19technomancyO_O
00:19technomancywow
00:20technomancyclucy and hooke have mvn-less packaging already for debian's lein1 packaging
00:21technomancyhttps://github.com/technomancy/robert-hooke/blob/debian/debian/rules
00:21hircustechnomancy: yup, we resorted to doing that, since Maven is really unhappy with source-only packages anyway
00:23hircustechnomancy: most of the great leaps in Fedora's Java tooling support happens post-Fedora 12, it seems (prior to that the focus was on getting Eclipse packaged, and *those* people don't use Maven much).
00:23hircusand RHEL 6 is... branched from Fedora 12
00:27cemericktechnomancy: that list is out of date; pomegranate is 0.0.13
00:27technomancycemerick: yeah, but I don't think the number of dependencies has changed since we excluded ring
00:28cemerickOK; just wanted to make sure no one was depending on that for anything. :-)
00:28cemerickBTW, Eclipse is *great* at builds. Click-click, and you've got an application built.
00:28technomancyright; I just wanted to give an impression of the magnitude of the task
00:28technomancycemerick: sure, if everyone on your team uses it
00:28cemerickIt even uses ant underneath, which is nice.
00:28technomancyincluding a fellow named Jenkins
00:29technomancyas well as his buddy Travis
00:31technomancy"It even uses ant underneath" actually sounds like something you'd say to cushion the statement
00:32technomancyI'm all over the place today
00:33cemericktechnomancy: that's what makes that troll sing :-)
00:33xeqiwait, you guys don't use java.awt.robot to click eclipse buttons to build?
00:34cemerickxeqi: I already do, but all my coordinates are going to get screwed up on the new retina displays.
00:35cemerickI think I can use AppleScript to convert them dynamically.
00:35cemerick"There's an API for that!"
00:35xeqithat only for an apple right?
00:36technomancyoh man come on...
00:36technomancyclucy doesn't declare a license
00:36cemerickcue Raynes
00:37RaynesWhat? I have nothing to do with clucy.
00:37cemerickDude, you're gettin' an Apple!
00:37RaynesOh.
00:37Raynesxeqi: I tweeted earlier, paraphrased, "If you refer to an Apple product as 'an Apple' and you're in reaching distance, I will not hesitate to punch you in the face."
00:37RaynesI meant it.
00:37RaynesStop.
00:38technomancybut he's not within punching range
00:38RaynesI've got a keyboard and I know how to use it.
00:38cemerickRaynes: What do you want from me, I'm porting documentation from a Word doc to something sane @ 12:30am.
00:38wingycool post about web dev with cljs: http://notehub.org/2012/6/16/how-notehub-is-built
00:39hircusRaynes: could be worse, some people refer to them as MACs
00:39hircuseven, mind-bogglingly, in networking textbooks where you'd think they'd know better
00:40RaynesI take offense to it because 'an Apple' could be any number of a zillion products.
00:40xeqilike an apple record
00:40RaynesI've watched people refer to an Apple TV and a macbook pro as 'an Apple' in the same breath.
00:40xeqior an actual apple
00:40amalloyRaynes: that's fine though, right? you can say "i'm going to the store to get a toy"
00:41amalloywithout having to be specific about exactly what toy you're referring to; it's entirely accurate and useful
00:41Raynesamalloy: There is no fruit that I know of that shares its name with that word.
00:41technomancydid Apple, Inc. ever pay out to the Beatles's company after breaking their agreement over the trademark?
00:41RaynesA toy is a type of product. Apple is a company.
00:42amalloy*shrug* an Apple is a type of product too
00:42RaynesYeah, a fruit.
00:42TheBusbytechnomancy: there were a couple of lawsuits that were settled
00:42RaynesI think the comparison here is……. Apples to oranges.
00:42Raynes~rimshot
00:42clojurebotBadum, *tish*
00:43technomancyclojurebot: caruso
00:43clojurebotTitim gan éirí ort.
00:43technomancy=(
00:44TimMc~suddenly
00:44clojurebotBOT FIGHT!!!!!111
00:53brehauti think raynes just wants to show off his alabama education and correct everyone to 'A Apple'
00:56cemerickMoving to L.A. @ however-old-he-is. I wish I had had an Alabama education. :-P
00:57RaynesI think I'd be 18 at this point.
00:57cemerickI think I knew that.
00:57TimMcamalloy: Any idea what the license is on java-getopt? Trying to figure out how to license my program that uses clojopts...
00:58RaynesWhy would you use that?
00:58RaynesI'm actually curious, not criticizing.
00:58TimMcamalloy: Never mind! GPL v2.
00:58cemerickNo one can ever guess how old I am, so I don't feel too bad about being off by a year or two on other people. :-)
00:58TimMcRaynes: I really, really like getopt's conventions.
01:00TimMcMy project links against GPL, EPL, Apache License, and MIT License... that makes it GPL, right? I hate this stuff. >_<
01:29ScriptorTimMc: if what you're distributing contains compiled gpl code...I guess?
01:29Scriptornot sure about the specifics, but it's something like tha
01:43xeqiTimMc: java-getopt has the LGPL in the source tree as the license
01:45xeqiso unless you're linking against another GPL project you can license it however, IANAL and all that
01:46TheBusbyWhat's the name of the Clojure core function that is essentially, (take-while #(.hasNext foo) (repeatedly #(.get foo)))
01:46TheBusbysorry, for the life of me I can't remember/find it, but I swear I've used it a couple times before for interfacing with java stuff especially.
02:02mmarczykTheBusby: iterator-seq ?
02:03amalloy$findfn (.iterator (java.util.ArrayList. [1 2 3 4])) [1 2 3 4]
02:03lazybot[clojure.core/iterator-seq]
02:04TheBusbymmarczyk: er, works for the above example but not for the general case.
02:04eckwhat's the right way to force a lazy sequence to become a list or something else? i have a variable that i want to print, but when i print it i just get something showing lazyseq, not the actual contents of the sequence which i want to see
02:04TheBusbyI guess my brain is playing tricks on me and I may have imagined it...
02:05amalloyTheBusby: i'm pretty sure it works for all cases?
02:05TheBusbyeck: doall ?
02:05TEttinger2eck: take
02:05amalloyeck: you want pr/pr-str, not print/print-str
02:05TEttinger2(take 5 (repeat 7))
02:06amalloydoall and take have no relevance to how the thing prints
02:06TEttinger2,(take 5 (repeat 7))
02:06clojurebot(7 7 7 7 7)
02:06eckamalloy: thanks
02:07eckpr-str seems to do the trick
02:38devnlol im having such a hard time ignoring this thread now that meikel starting golfing in it
02:38devn,(range 1 6 2)
02:38clojurebot(1 3 5)
02:38devn,(map first (partition 2 2 (range 1 7)))
02:38clojurebot(1 3 5)
02:38devn(filter odd? (range 1 6))
02:38devn,(filter odd? (range 1 6))
02:38clojurebot(1 3 5)
02:39devnI wonder how many <4 function ways (1 3 5) can be produced
02:40hiredman,(doc take-nth)
02:40clojurebot"([n coll]); Returns a lazy seq of every nth item in coll."
02:56alexyakushevHello, could please someone help me with type hints? I have a macro that defines a function, I want the arguments in this generated function to be type-hinted, but I don't know the type beforehand (it comes as an argument to a macro). So the macro looks like:
02:56alexyakushev(defmacro foo [klass]
02:56alexyakushev `(defn bar [~'this]
02:56alexyakushev (.method ~'this)))
02:56alexyakushevBut I want the call to .method be non-reflective
02:57amalloy(.method ~(vary-meta 'this assoc :tag class))
03:03alexyakushevamalloy: Thanks! But unfortunately this doesn't work:( I still get the reflection warning
03:04alexyakushevI even tried to replace class arg with the real class but it doesn't eliminate the reflection too
03:12alexyakushevamalloy: I'm sorry, I was hinting with the parent type instead of the right one. You solution works great, thank you!
03:12aperiodicaniero: yeah, i'm fairly confident that that scheme will work. if you like, i could give a formal proof, but note that this is basically how this sort of problem is solved by people much smarter than me for things like CRCW PRAM machines. that being said, if there are issues, please let me know!
03:23alcarcould anyone recommend me some books on clojure focused on game prog? I'm a beginner in clojure but I've programmed in other languages
03:28alcaranyone?
03:28clojurebotJust 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 ..."
03:29michaelr`alcar: i think there no clojure books focused on game programming
03:31antares_alcar: I don't think any of the books focuses on games specifically and there are many subjects related to game dev
03:32antares_alcar: start with Clojure Programming from O'Reilly (clojurebook.com), once you get some experience, I believe there is a small game example in Programming Clojure 2nd ed from PragProg. Or was it The Joy of Clojure…
03:33alcarok, I'll do that
03:34alcarany other kind of material?
03:34alcarlike youtube channels, wikis..?
03:34aperiodicalcar: this guy on github has some projects that are games in clojure/clojurescript: https://github.com/thomcc
03:35aperiodicalcar: dunno if they're any good, though ;)
03:35antares_alcar: planet.clojure.in has game-related topics probably every month or so, there are projects on github, also feel free to ask here or on the Clojure mailing list
03:35aperiodicyeah, people love to kibitz, don't be afraid to ask for help
04:35SrPxCan you guys point me again to the place where it explained map with multiple arguments?
04:36amalloy~zip
04:36clojurebotzip is not necessary in clojure, because map can walk over multiple sequences, acting as a zipWith. For example, (map list '(1 2 3) '(a b c)) yields ((1 a) (2 b) (3 c))
04:36aperiodicSrPx: http://clojuredocs.org/clojure_core/clojure.core/map is one such place
04:37aperiodicSrPx: some of the examples show usage with multiple collection arguments
04:37SrPxThanks, I was looking at http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/map
05:59mystiiqhey, how can I split string ("hello.txt") by dot delimiter, and then insert random string in front of the last element, so I'd have ("hello" "-timestamp" "txt") and the final thing to do is to join that vector
06:00borkdudemystiiq ##(.split "hello.txt" .)
06:00lazybotjava.lang.RuntimeException: Unable to resolve symbol: . in this context
06:00borkdudemystiiq ##(.split "hello.txt" \.)
06:00lazybotjava.lang.ClassCastException: java.lang.Character cannot be cast to java.lang.String
06:00borkdudemystiiq ##(.split "hello.txt" ".") ;; then
06:00lazybot⇒ #<String[] [Ljava.lang.String;@955cf3>
06:01borkdude,(let [[f l] (.split "hello.txt" ".")] (str f "-timestamp" l))
06:01clojurebot"-timestamp"
06:01borkdudehmm no, wait up ;)
06:07borkdude,(count (.split "hello.txt" "."))
06:07clojurebot0
06:07borkdudehm. something with .?
06:10borkdude,(let [[f l] (.split "hello.txt" "\\.")] (str f "-timestamp" "." l))
06:10clojurebot"hello-timestamp.txt"
06:45mduerksendoes anyone have suggestions: how to integrate css-generation (less/sass) in a java/clojure environment? i've seen asual/lesscss-engine, but it has the downside of not being easily upgradeable to the latest less-version, and it seems buggy
06:56ro_stwhat do you want this integration to do, mduerksen?
07:02mduerksenro_st: my ring-powered webservice wants to generate css on demand (style.less -> style.css)
07:03ro_stassumedly only when less files have changed?
07:03ro_stwouldn't it be better to compile when .less files change?
07:03ro_streduces the request/response turnaround
07:04ro_stin fact, our devs (and i) use auto-compilers on our dev machines and only deploy .css files (although .less is in git too)
07:05ro_sti know that doesn't answer your question :-) sorr
07:05ro_sty
07:05mduerksenwell, it would suffice if the generation would happen automatically, it doesn't need to be rendered each time
07:05mduerksenbut for development it would be nice if the generation would happen without any interaction
07:05ro_stif you're on mac, grab LESS.app
07:06ro_stor livereload.com or one of the other great tools that handle this sort of thing
07:07AWizzArdOho, Groovy 2.0 now comes with a type checker.
07:08Natchif you just want to regen a file when source changes and you know a bit of ruby have a look at the watchr gem
07:09mduerksenro_st: i need it to happen when the project is built on a build server, without any extra manual step, so less.app won't help me. never heard of livereload, looking into it right now
07:09ro_stwell, less is a commandline binary, so you should be able to shell out to invoke it on your .less files
07:09ro_stthese apps simply put a ui ontop of this
07:11mduerksenro_st: i thought less was a .js-file which had to be invoked on node.js
07:12ro_stthere is a js version of less
07:12ro_sti believe there's an ix binary too
07:13mduerkseni don't know node.js: can i just invoke a node-script from commandline?
07:13ro_stsomeone's writing these less files, right? presumably they're testing them too. therefore, it follows that whomever this is can ensure that css files are present when code is committed
07:13ro_stabsolutely. that's the default way
07:13mduerksenbecause then i could, as you say, invoke the less compiler on build
07:14mduerksenthanks ro_st, i think thats what i needed
07:19ro_sthth :-)
07:32CheironHi. why I'm getting this error every time I try to bootstrap clojurescript? http://pastie.org/4170908
08:24zaamkablamI just came here seeking clojure.
08:25zaamkablamRight, macro questions here.
08:25zaamkablamIs there a way, to know the name of the macro in its body?
08:26zaamkablamC'mon, #clojure, don't let me down.
08:26zaamkablamName of the macro from within its body.
08:27ro_stcan you do this for fns?
08:27zaamkablamNot that I know of, no.
08:28ro_sti suspect this will be the case for macros, too
08:28zaamkablamYeah, I was afraid of that.
08:29Iceland_workzaamkablam: Write a `defmacro+' ;)
08:29ro_stdon't take my word for it, though. i'm still a massive clojure newbie
08:29zaamkablamYou mean, something akin to (defmacro defmacro+ [name & body] ... ?
08:29Iceland_workyes
08:29zaamkablamI'm a more massive clojure newbie. Physically and mentally.
08:30zaamkablamYou, sir, make sense.
08:30Iceland_workI once wrote a Common Lisp defun+ where the function could anaphorically access its own source code
08:30Bronsazaamkablam (first &form)
08:31ro_stboom
08:35zaamkablamOh, wow.
08:37Bronsaremember that &form and &env are avaiable only from within a macro though
08:40zaamkablamBronsa, I seriously love you, man.
08:40Bronsalol
09:00zaamkablambrb, checking out another client.
09:01sisciahi guys, does anybody know anything about Raposo (bayesian network library developed by Chas Cemerick that himself talked about during the conj 2) ???
09:01lazybotsiscia: Oh, absolutely.
09:06zerokarmaleftsiscia: last i talked to him about it, it's on the backburner, on account of writing his book mostly
09:07root_right
09:07root_shit
09:09CheironHi. why I'm getting this error every time I try to bootstrap clojurescript? http://pastie.org/4170908
09:15sisciazerokarmaleft: thanks, yes i definitely understand the book is way more important, but if he would find the time just to push everything on github in the mean would be nice too...
09:15sisciawell of course i can't ask anything, so everything is waaaaay more than good
09:15sisciathanks though...
10:03achengi have (defmulti name "doc string" :key) ... but (doc name) doesn't
10:03acheng show "doc string"... what did i do wrong?
10:05borkdudewhat kind of a mathematician names his child "Vi" (Vi Hart)… as a revenge I expect some kids being named emacs "Emacs Johanson" or smth
10:05antares_acheng: it does for me
10:05antares_borkdude: I think they usually spell it E. Max Johansson
10:06antares_acheng: doc is in clojure.repl, so maybe you did not run (use 'clojure.repl)?
10:07zaamkablamE. Klipse Oksedental must be a cripple, then...
10:08borkdudeNano Yakamoto
10:08borkdudeEd …
10:09achengantares_: hm. yes doc works but the doc string doesn't appear for me. and yes i did compile after writing it. sadness.
10:09achengdocstring shows up for my normal fns
10:09antares_acheng: doc will print the doc string, not return it
10:09achengbut not for my multimethod.
10:10antares_I am curious if it is one of those cases when metadata is not preserved (in the REPL)
10:11antares_I could reproduce it now once but if I define a different multimethod (multi-m instead of multi, for example), doc string is printed as it should
10:14borkdude,(with-out-str (doc +))
10:14clojurebot""
10:14achengah. with a new repl it works as well
10:14achengso you are right
10:15achengthanks antares_ !
10:15borkdude,(doc +)
10:15clojurebot"([] [x] [x y] [x y & more]); Returns the sum of nums. (+) returns 0. Does not auto-promote longs, will throw on overflow. See also: +'"
10:15borkdude,(with-out-str (doc +))
10:15clojurebot""
10:15borkdudehuh?
10:16borkdude&(doc +)
10:16lazybot⇒ "([] [x] [x y] [x y & more]); Returns the sum of nums. (+) returns 0. Does not auto-promote longs, will throw on overflow. See also: +'"
10:16borkdude,(println "foo")
10:16clojurebotfoo
10:18achengantares_: is this normal behavior for the repl (re: metadata) or is it an issue that should be fixed eventually?
10:19antares_acheng: I am not sure but since things in the REPL are constantly redefined, reevaluated and so on, it may be a side effect that you will never come across in running apps but may in the REPL
10:20achengok. i read recently about getting slimed. this feels similar. cool.
10:23wingycould anyone explain what this mean: ({:a 5 :b 6} :c 7)
10:23dnolenwingy: that code is incorrect.
10:24borkdude,({:a 5 :b 6} :c 7)
10:24clojurebot7
10:24wingyyeah but what does it mean
10:24borkdudewingy probably maps as fns behave as get on themselves
10:24dnolenwingy: data structures in Clojure are functions.
10:24dnolenwingy: a better example is,
10:24borkdudewingy and get accepts a fall back argument (not found)
10:24dnolen,({:a 5 :b 6} :a)
10:24clojurebot5
10:25wingy7 is a default value?
10:25borkdude,({:a 5 :b 6} :c :lets-see)
10:25clojurebot:lets-see
10:25wingyoh yeah it makes sense
10:25borkdude,(get {:a 5 :b 6} :c :lets-see)
10:25clojurebot:lets-see
10:25dnolenwingy: note that writing it that way is a short-hand for get as borkdude showed.
10:26dnolenhonestly never thought about using ({...} k default) before ...
10:26borkdudednolen me neither, vectors behave like nth I believe
10:26borkdude,([1 2] 3 :not-found)
10:26clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: PersistentVector>
10:26borkdude,(get [1 2] 3 :not-found)
10:26clojurebot:not-found
10:27borkdudednolen is this in clojurescript the same? ;)
10:27TimMcxeqi: Oh hey, you're right -- that's the *L*GPL. Neato.
10:28dnolenborkdude: why should it be different?
10:28borkdudednolen because someone forgot to implement it? I dunno
10:29wingyits a big diff between this channel and others i have participated in
10:29wingyhere a lot of people care about the lang and educate a lot .. while thats not the same in other langs
10:29borkdudednolen: clojurescript => ([1 2] 3 :not-found)
10:29borkdude:not-found
10:29wingyor channels
10:30dnolenborkdude: it's the same, fn calls on data structures go through ILookup, for Vector types that goes through nth.
10:30borkdudednolen apparently not...
10:30dnolen"that then goes trhough"
10:30dnolenborkdude: oh heh - you're right. But nth also takes a not found param - which I guess make sense.
10:31dnolen,(nth [0 1 2] 4 :not-found)
10:31clojurebot:not-found
10:31borkdudednolen ok, so hmm… then there is a subtle difference between clojure and clojurescript, maybe it should be addressed?
10:32dnolenborkdude: yeah I guess Clojure Vector types should implement the other ILookup arity.
10:32nDuffwingy: There's a substantial culture difference too. Frankly, there are channels I'm in where people care about the language just as much and are similarly willing to educate others, but have less patience or tolerance for people who don't help themselves / bring in off-topic chatter / etc.
10:33borkdudewingy that might be because clojure is a very lovable language
10:33TimMcWell, that'll teach me to read software licenses at 01:30 >_<
10:33xeqiTimMc: if you see GPL java stuff, and it doesn't have the "classpath exception" written somewhere it should sound alarm bells
10:34noidihow can I provide a constructor to a proxy?
10:34noidiI need to call a protected method on the base class, so I can't do it after the instance has been created
10:35noidiat least I suspect the "protected" bit is what's causing a "No matching method found" when I try to call the method on the instance
10:36noidiah, it seems that proxy can't handle protected methods, and I'll need to use gen-class
10:37TimMcxeqi: Why? Wouldn't that just invoke the standard viral aspect?
10:39xeqiTimMc: yeah, but its very rare in java world
10:41borkdudednolen should I send an e-mail about this on the clojure mailing list, or is this something you want to register in the issue tracking system (I have no access to it)
10:42gtraknDuff: if you hang out in ##java long enough you'll feel the same way, for instance you don't see people coming here with homework problems. I think the floor is much higher.
10:43foodoogtrak: Or teacher's just don't give homework tasks in Clojure ;)
10:44dnolenborkdude: send in your CA so you can open a ticket. Sounds like a simple fix.
10:44borkdudednolen I still have to do it… paperwork ;)
10:44wingyclojure reminds me about LEGO .. and i loved it as a child
10:45wingyfinally after 3 years of web dev im learning real programming!
10:45borkdudewingy Lisp in general is what made programming fun for me on the level that I liked it as a kid
10:45wingyoop reminds me about management work .. you think you are coding but you are not
10:45borkdudewingy fun level, addiction level, etc
10:45wingyyeah
10:45wingyim so addicted
10:46borkdudewingy great line, I tweeted it right away ;)
10:46wingywhats your tweet?
10:46wingytwitter
10:47borkdude@borkdude
10:55borkdudeprinting out this CA and actually sending it to the USA reminds me of sending a thank you note to the USA to someone who had created a nice free game and his address was printed when you quit the game..
10:55borkdudewhen I was a kid
10:56borkdudeand the internet didn't exist (in my world)
10:56gfredericksborkdude: where did one obtain free games pre-internet?
10:56borkdudegfredericks trading disks
10:56gfredericksfloppies?
10:57gfredericksflippy floppies?
10:57borkdudegfredericks yes and also diskettes (the 3.5" ones)
10:57borkdudegfredericks we used to have two-weekly meetings in our village (10k people), one half of the room Amiga, other half PCs
10:57gfredericksclojure is a nice free game
10:58borkdudegfredericks it was one giant software copying party...
10:58gfredericksborkdude: 10k is the village, not the meetings, I take it
10:58borkdudegfredericks yes
10:58borkdudegfredericks but the game I played was actually free or Shareware
10:59wingyi remember those 3.5" .. damn our world has changed
10:59cemerickpoor ol' Amiga
10:59TimMcThank goodness we're past CDs.
10:59TimMcThey were pretty amazing, but really, really finicky.
10:59gfredericksthoes things were a little fragile
10:59borkdudeit was amazing how fast viruses could spread even then, remember dealing with "Tequila", almost everyone in our neighbourhood had it :P
10:59wingybut now blueway is here .. i still can't get why we want that
11:00TimMcI received my wedding photos (14.5 GB) as a tiny flash stick in a padded envelope.
11:00wingywe want things over an internet connection
11:00borkdudewingy what is blueway?
11:00wingyblueray
11:01gfredericksblueway == cheap blueray knockoff
11:01gfredericksOR
11:01borkdudednolen is clojurescript dev also a part of this Rich Hickey CA?
11:01gfredericksblueray for kids
11:01borkdudeI never had a blueray disc so far
11:01wingyborkdude: what does CA mean?
11:02borkdudeI don't even own a TV anymore
11:02nDuffwingy: contributor agreement
11:02borkdudewingy contributor agreement
11:02wingyborkdude: you just have to own an iPad ... the movies follow you wherever you are
11:02borkdudewingy I own a macbook air… ipad is too limited imho
11:03wingyyeah
11:03wingynDuff: why now?
11:04nDuffwingy: ...hardware finally hitting the kind of capability / price point ratio that interests me, basically.
11:07Cheiron_Hi. why I'm getting this error every time I try to bootstrap clojurescript? http://pastie.org/4170908
11:08elliottwanyone have a noir app running on the same server as nginx?
11:10nDuffelliottw: ...not particularly, but given as noir apps are just Java servlets, any of us who've ever deployed a servlet can probably help with your questions... so why don't you describe your problem, rather than opening with a poll?
11:11borkdudecan anyone tell me if clojurescript requires a separate mention on the CA in case you want to contribute?
11:11borkdudeI'm sending paper to the USA, might as well include it
11:11elliottwnDuff sorry. good point. I've got a prgmr account with my static html blog (elliottw.com) and i want to run an app from the same server and have titlecase.org point to it
11:12elliottwcurrently noir at default runs at elliotw.com:8080
11:12KirinDaveelliottw: If you've got a static blog, why not s3?
11:13elliottwKirinDave all these things are just learning experiences. i wanted to get to know *nix, hence prgmr
11:14KirinDaveAh
11:14nDuffelliottw: ...so, if you want to do this as a learning experience, I'd build a WAR with your Clojure app, deploy it into a servlet container, and use AJP to communicate between nginx and that container.
11:14KirinDaveelliottw: I host my static blog on s3, they have this CDN thing.
11:14michaelr`elliottw: so what is your question? btw, what is prgmr?
11:14KirinDaveWhy not just deploy it via a self-hosted jetty?
11:14elliottwmichaelr` sorry, prgmr is a vps
11:14hiredmanfuh, the cool kids are on google cloud storage
11:15KirinDavehiredman: I switched to that from Dropbox for book and academic paper hosting
11:15elliottwi'm thinking of saying screw it and just deploy on heroku
11:15KirinDaveSlap a few jetty responers up under a spread of ports via a tool like God.rb or whatever
11:15KirinDaveThen use nginx on top.
11:15KirinDaveThat's a pretty realistic deploy for a professionally delivered product.
11:16KirinDaveIncreasingly .war stuff is only for very managed services.
11:16michaelr`KirinDave: what is managed services?
11:16KirinDavemichaelr`: Um, like amazon elastic beanstalk?
11:17michaelr`ah
11:17KirinDavenDuff: I wish daemontools, runit et all were more robust. I am not a fan of God.rb either, but it does a lot more than the competition.
11:17michaelr`i'm deploying my site as a war
11:18michaelr`i just copy the war file into the webapps directory
11:18KirinDaveFor all our internal endpoints, I use the uberjar-jetty approach.
11:18nDuffKirinDave: I've run some very big sites on runit. Yes, we had our own tools above it for remote management / querying, but that's going to features, not robustness.
11:18KirinDavenDuff: I use runit too.
11:18KirinDavenDuff: I just don't think it's much better than God.rb. :)
11:19nDuff*shrug*. It's certainly smaller. I have something of a fondness for being able to use the same tool on a tiny embedded system as I use everywhere else.
11:19KirinDaveYeah, I can see that
11:19nDuffGranted, that's not much of an argument for people who don't also do embedded systems. :)
11:19KirinDaveI only use ec2 nodes these days so there is plenty of room for a carefully written god instance.
11:20hiredmanwar+jetty-runner is very nice
11:20elliottwwow, thanks guys, looks like i have a lot of learning to do
11:21hhutchdone't forget you can always manage a war+jetty deployment with palletops.com
11:21wingyset is just an ordered vector?
11:21KirinDaveIs there some advantage to a .war over just having an uberjar?
11:21elliottwi've never "deployed" anything, just started learning clojure a month ago, and learning this whole server thing a month ago too… crazy
11:21wingyor a vector with unique values i mean
11:21KirinDaveelliottw: Yeah it's a steep learning curve.
11:22elliottwKirinDave would you suggest i stick to something like heroku until i know what the h i'm doing?
11:22KirinDaveelliottw: Hah, never.
11:22KirinDaveChallenge yourself.
11:22elliottwlol, i thought i was doing that once i picked up that clojure book. now i realize learning a language is about half of what it takes
11:22KirinDaveNot even 1/10th.
11:22elliottwKirinDave why no heroku?
11:23elliottwKirinDave true
11:23KirinDaveelliottw: Don't get me wrong, technomancy is doing great work there.
11:23KirinDaveI just think you'll get a lot more learning opportunities by standing up your own server from scratch in a cloud service.
11:23elliottwKirinDave technomancy is working to clojure up on heroku?
11:23KirinDavePretty sure that's the case.
11:24elliottwseems like i could get my very first app up today w heroku, next week if i go another roll my own route
11:24KirinDaveYep
11:24wingydepends on what he wanna do .. launch an app or learning how to manage cloud infractructure
11:24KirinDaveProbably true.
11:24KirinDaveAnd wingy has it dead on.
11:24KirinDaveAnd you could always do both.
11:25wingyif the former, just git push it to heroku
11:25gtrakmeh, server admin is an unfulfilling PITA
11:25KirinDavegtrak: #devops man. Ain't nobody who can do it like you.
11:25hhutchgtrak: wow, i couldn't disagree more
11:25KirinDaveThat said, I loathe working with chef.
11:25KirinDaveEffing loathe that software.
11:25KirinDaveThe Worst Software.
11:25hhutchKirinDave: pallet!
11:25gtrakmaybe it's just me :-)
11:25KirinDavehhutch: I work in a chef organization.
11:26wingyalso if he wanna be developer or sysadmin .. if the former . just git push
11:26KirinDaveI'm working on getting pallet integrated but it's tough. It needs to register with the chef server and kick off vpn server chef client runs to generate keys and whatnot.
11:26KirinDavewingy: What is the difference?
11:26KirinDaveA "developer" is just someone who doesn't like delivering products. A sysadmin is someone who doesn't like making them.
11:26hhutchi've never worked in a place where i didn't do alot of both administrative work and development
11:26KirinDaveThese days, you may have to do things from start to finish.
11:27KirinDaveEsp with cloud services.
11:27cemerickelliottw: Don't burn yourself doing/learning things that you aren't necessarily interested in.
11:27KirinDavePart of what distributed software is, is resource management.
11:27cemerickGood way to burn out on the whole effort.
11:27elliottwthanks cemerick
11:27KirinDaveelliottw: Cemerick espouses a path of weakness. Get huge. :)
11:27elliottwi don't want to burn out
11:27cemerickThere's always next week, or next month. :-)
11:27elliottwKirinDave lol
11:27wingyKirinDave: agreed .. why you have to learn to leverage existing tools letting you do more with less
11:27gtrakhhutch: when I was in college I didn't mind messing around so much, now, time is more scarce.
11:28hhutchgtrak: right, but that's why you get more effecient
11:28KirinDaveCuz like, being a full-time software engineer is as much about problem solving, research, and troubleshooting as it is about writing code.
11:28elliottwgtrak yeah, i gotta still make a living. it took me half a day just for vps, install ubuntu, install jvm, clojure, etc etc
11:28wingypeople cant make your app for you .. they can host/load balance/proxy it etc
11:28wingyimo you should let them and care about your domain .. the app
11:28KirinDaveelliottw: Well that's not bad for a beginner.
11:28gtrakelliottw: and you'll do it a slightly different way each time... and forget how you did it
11:28KirinDaveelliottw: Not bad at all, actually.
11:29elliottwand i LOVE clojure. i do not love sysadmin
11:29hhutchwingy: i disagree with that sentiment... all those things you listed, they are part of the deployed app
11:29cmiles74Certainly there are places where it's really useful to be able to use a tool like Vagrant. I'm not convinced that everyone needs to be able to deploy to Rackspace or Amazon's cloud offering.
11:29hhutchthey're just libraries/resouces
11:29wingythey handle deployment .. you handle development
11:29KirinDaveWell I guess I have the unfortunate situation of working with systems that no one else would ever manage for me
11:29KirinDaveLike custom kafka->storm solutions.
11:30KirinDaveWhere do I click to get a zookeeper server in heroku? :)
11:30elliottwmy main concern with things like heroku is that the knowledge is not portable
11:30hhutchelliottw: heroku is fairly standard for basic deployments
11:30elliottwwhen/if i go to my own server, all that proprietary stuff would be a waste won't it?
11:30wingyyou use it when you can .. heroku wasnt here 5 years ago
11:30gtrakelliottw: it takes like 20 minutes to deploy a clojure app to heroku... the non-portable knowledge isn't substantial
11:30cemerickhiredman: That's the second time in as many days I've seen someone independently validate your startup idea. :-P
11:30wingybut time changes
11:30cmiles74I hear what you're saying, KirinDave. I was really the Hadoop sysadmin guy until the company was comfortable with the product; at that point I handed it off to FT sysadmin people.
11:30elliottwhhutch i mean if i deploy on a vps, it should be really close to deploying on my own server one day
11:31HodappKirinDave: The advantage to a WAR, as I see it, is that you can deploy it directly in a lot of application servers / servlet containers.
11:31hiredmancemerick: look, everyone needs a zookeeper cluster
11:31elliottwgtrak touche
11:31KirinDavecmiles74: But a jar is just an executable with 2 words before it on the shell tolaucnh. :)
11:31hiredmanhow else are you supposed to run the unit tests for avout
11:31KirinDavehiredman: People doing boring things don't need a zookeeper cluster.
11:31hhutchelliottw: my 2 cents. make a demo app, deploy it to heroku ... rest a few days, use palletops.com and try to deploy your own server in virtualbox .. then deploy your app using pallet
11:31cemerickhiredman: you could do it all lean and stuff, and handle requests on a single server with a shell script to validate demand.
11:32KirinDaveBut the minute you do anything interesting in the distributed space, not using it is crazy unless you're working with erlang.
11:32KirinDaveIf only because distributed process coordination is made so much easier by zookeeper.
11:32KirinDaveAll these ruby asses using Resque and Redis timeout locks like that solves the problem. :\
11:32Wild_Catis there a nice Clojure lib to make HTTP requests (POST/GET/PUT/DELETE -- basically, a Clojure equivalent to http://docs.python-requests.org/en/latest/index.html )?
11:33KirinDaveWild_Cat: https://github.com/dakrone/clj-http/
11:33cmiles74I'm with elliottw; if you can deploy to Vagrant then you have enough detail handled that you can feel comfortable working with a larger team of sysadmin people.
11:33KirinDaveClojure has it so much better than other jvm languages
11:33cmiles74Er, IMHO Vagrant + Virtualbox are closely tied; it's worth looking at.
11:33KirinDaveWorking directly with apache's lib is pure pain.
11:34Wild_CatKirinDave: perfect. Looks like exactly what I need.
11:34KirinDaveScala has this incredibly goofy Databinder Dispatch library which even the author admits is terrible
11:34elliottwi think i'm going with hhutch. make a demo on heroku. pat myself on the back for my first "deployed" web app evar. grab a a drink. dive into server stuff next week
11:35KirinDaveelliottw: Honestly it sounds like you've done the hard part of server provisioning.
11:35KirinDaveThat first mile is always the most irritating.
11:35KirinDaveIt's near and dear to my heart right now as well. I'm preparing to do a 24-hour hackathon to raise money for charity
11:36elliottwthis month i've started to learn clojure, it took a whole day to understand github and why the hell version control matters so much, then running my own vps, spending way too much time fiddling with Vim and rainbow parens. it's been a good month
11:36KirinDaveMy goal is to make an eventually consistent low-cost version of hackernews in clojure, using kafka and amazondynamodb
11:36KirinDaveGonna try and raise money for adainitiative an the anita borg institute.
11:37elliottwKirinDave that sounds like a great project. wish i could help out, but you can obviously tell i have no idea what i'm doing
11:37elliottw… yet
11:38KirinDaveI dunno if I will productize it.
11:39KirinDaveIt's more just to do something fun for charity and answer all these questions I get about site scaling in a way more interesting than a boring slide deck
11:39wingyare you guys using jQuery or Google Closure on frontend for DOM interactions?
11:39elliottwi hope none of you guys are yc fans, but i find that they are huge dbs a lot of the time
11:40KirinDavewingy: Next month we should have clojurescript derived javascript on some of our frontend stuff deployed.
11:40KirinDaveIt's in testing now
11:41wingyKirinDave: what does "clojurescript derived javascript on some of our frontend stuff deployed" mean?
11:41wingybesides clj my eng is not that excellent :)
11:43wingyyou mean you will have DOM manipulation built into cljs?
11:45gtrakIs there a way to call a specific protocol implementation's method manually without going through the dispatch?
11:47mmarczykdnolen: cljs-324 applies on top of cljs-328.
11:47dnolenmmarczyk: ok, thx
11:48dnolengtrak: on Clojure JVM?
11:48gtrakya
11:48dnolengtrak: why would you want to do that?
11:48gtrakI can work around it, but just curious :-)
11:48gtrakto save me a step from refactoring the implementation into its own function
11:50gtrakgenerally, to decomplect the logic from the arg-type
11:51dnolengtrak: I can't imagine the refactoring taking very much time, since protocol implementations look like regular functions. Just remove the field accesses right?
11:51gtrakyea
11:51gtrakpretty trivial actually
11:53wingyare you like me that don't understand the texts _at all_ but get the examples almost immediately: http://clojuredocs.org/clojure_core/clojure.core/group-by
11:53wingyit seems much easier to get something by having something to look at than reading texts
11:54borkdudednolen I asked previously if in the CA you had to describe clojurescript as a seperate project if you want to contribute (not sure if I ever will, but might be handy to include when sending the papers anyway)
11:54borkdudednolen but now I already sent it ;)
11:57michaelbartonCould anyone tell me what I am doing wrong here? https://gist.github.com/a4d619e035725b8160ca
11:58llasramclojurebot: contrib
11:58clojurebotMonolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
11:58michaelbartonI get this error: ava.io.FileNotFoundException: Could not locate clojure/contrib/string__init.class
11:59jweiss(defmacro [& forms] ... ) how do i fill in the blank so that macro does the same thing with forms as if i'd syntax quoted it? is that possible?
11:59michaelbartonI am using leiningen
11:59llasrammichaelbarton: clojure-contrib is split and gone for >1.3. For clojure.contrib.string, all the good stuff was moved to clojure.string by 1.2 anyway
11:59zerokarmaleftmichaelbarton: very useful to bookmark that link if you're working off of clojure 1.2 examples
11:59llasram>=1.3 even
11:59dnolenborkdude: I don't think specifying the projects matters much.
11:59borkdudednolen great
12:00michaelbartonI have run lein deps
12:04llasrammichaelbarton: The particular error you're getting is because clojure-contrib 1.1.0 doesn't include the clojure.contrib.string namespace
12:04llasramOh, oh well
12:05michaelbartonI think I just got disconnected
12:05michaelbartonI
12:05michaelbartonI'
12:06llasramTo repeat then, michaelbarton: clojure-contrib is split and gone for >1.3. For clojure.contrib.string, all the good stuff was moved to clojure.string by 1.2 anyway
12:06llasramoops
12:06llasramTo repeat the right thing, michaelbarton: The particular error you're getting is because clojure-contrib 1.1.0 doesn't include the clojure.contrib.string namespace
12:07michaelbartonI see
12:07michaelbartonThank you
12:07llasramBUT
12:07llasramclojure-contrib does not work with clojure >=1.3
12:08llasramWhatever source of example you're using is out-dated
12:08michaelbartonI see
12:08michaelbartonI think the example I copied is at the top of the page here - http://richhickey.github.com/clojure-contrib/string-api.html
12:08lazybotNooooo, that's so out of date! Please see instead http://clojure.github.com/clojure-contrib/string-api.html and try to stop linking to rich's repo.
12:08llasramhah
12:09llasramCloser, lazybot!
12:09michaelbartonI think Rich Hickey's GH repo is the top hit on google for clojure contrib string. For me at least anyway
12:09dnolenmmarczyk: patches applied! thx!
12:09michaelbartonBut then I guess I'm writing the wrong query!
12:10llasrammichaelbarton: What led you you to be searching for "clojure contrib string"?
12:10mmarczykdnolen: great, thx!
12:10cmiles74michaelbarton Indeed, it is.
12:10llasrammichaelbarton: Here's my recommendation: http://clojuredocs.org/clojure_core/clojure.string
12:11michaelbartonNot sure really. I think perhaps I have an out of date version of clojure on my system, but I'm fetching the most up to date version in my lein projects.
12:11llasramHmm. Although clojuredocs appears to need an update for 1.4...
12:12michaelbartonSo I should avoid clojure contrib from now on?
12:13llasrammichaelbarton: Right. The parts which hadn't already been merged into core were split into their own libraries, as described on http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
12:13michaelbartonGood to know, thank you.
12:13llasramWell, sans some parts which have been abandoned
12:14technomancydeprecation: it's good for the soul
12:14technomancyand probably the colon too
12:15llasramYou can't spell ^:deprecated without a colon!
12:15michaelbartonhttp://clojuredocs.org/ has a link to clojure.contrib, are these depreciated libraries?
12:16raekmichaelbarton: yes
12:16TimMcllasram: Quite the catch-22.
12:16michaelbartonOK
12:16llasrammichaelbarton: They work if you're using Clojure 1.2, but not for later versions
12:16michaelbartonThat's a little confusing for a beginner like me.
12:17bsteuberI'd like noir to store uploaded files in byte-arrays instead of tempfiles, but I can't find the middleware already responsible for it - can anyone help?
12:24gfredericksis there a lot of data structure speedup between the current cljs that lein-cljsbuild uses and cljs-HEAD?
12:28dnolengfredericks: no, I think lein-cljsbuild is fairly up to date now.
12:28gfredericksk
12:28gfredericksmaybe I should use a deftype for complex numbers instead of a [r i] vector
12:29gfredericksthat could simplify the rect <-> polar logic as well
12:30dnolengfredericks: representing types with vectors rarely recommended.
12:31gfredericksdnolen: good advice; thx
12:31tbaldridgednolan: so I'm asking this here instead of asking in the mailing list as I don't want to feed the trolls. Your comment about last being a seq function instead of a collection function. I get that. But why is it this way? Is there a reason I'm missing that it can't be polymorphic?
12:32tbaldridgeI understand that it would make last mean two different things. I guess, I'm wondering why last was defined as a seq function. Or is it just the way it's always been
12:33dnolentbaldridge: Clojure fns are well partitioned against the existing protocols / interfaces. That thread is what I would call an "opinion-fest"
12:33technomancyI would guess it's the same reason contains? hasn't been renamed.
12:33hiredman,(+ 68 79)
12:33clojurebot147
12:33goodieboyif I have a regular expression defined within the body of a function, is it created every time i call the function? Would it be better to "def" it out side the function?
12:33technomancyit's a trap designed to trick newbies into thinking about big-o notation
12:34TimMcclojurebot: contains? is a trap designed to trick newbies into thinking about big-O notation
12:34clojurebotIn Ordnung
12:34dnolentbaldridge: newcomers are going to know the protocol/interface partitioning so they focus on names and "speed".
12:34dnolenare not goign to know.
12:35TimMcI'm surprised last is even provided, given how some inclusion decisions seem to have been made.
12:36dnolenTimMc: that makes no sense. You might have a sequence and you might need to get the last item.
12:37TimMcTHen you're using the wrong data structure. :-P
12:37gfredericksgoodieboy: no I think it gets compiled at read-time
12:37dnolenTimMc: is Clojure source represented with vectors? or seqs?
12:37gfredericksgoodieboy: into a java pattern object
12:38goodieboygfredericks: oh really? ok, so no sense in putting it into a def for improved performance?
12:38gfredericksgoodieboy: I don't know for sure, but I seriously doubt it.
12:38goodieboygfredericks: ok thanks, good to know
12:38gfredericksgoodieboy: I'm assuming it's a regex literal and not something thrown together at runtime
12:38konrAre there other graph libraries besides clojure.contrib.graph? It seems that it pressuposes I already have constructed a graph.
12:39goodieboygfredericks: yes, something like #"[0-9]+" etc.
12:39tbaldridgednolan: thanks that helps. I knew I was missing something. I will now sit and ponder this until enlightened.
12:40TimMcdnolen: (I know, just idly playing devil's advocate.)
12:41tbaldridgewhat I find funny about all this though is that C# reacts exactly the same way in this situation. Using Linq to do (List<int> f).Last() will do a linear scan. So I agree that people just never think about how common this position really is.
12:41uvtcDidn't know clojuredocs.org still pointed to the v1.2 monolithic contrib. Thanks, michaelbarton for pointing it out. Updated: http://www.unexpected-vortices.com/clojure/brief-beginners-guide/libs-available.html#contrib and added note about monolithic vs. modular contrib.
12:41tbaldridgeand that syntax was crap, but you get the idea
12:42brainproxykonr: what kind of graphs are you wanting to construct?
12:43konrbrainproxy: simple, undirected; maybe with some weight in the edges
12:45brainproxykonr: okay, well there's a java based graph database called orientdb, and there's a clojure wrapper for it, called orient-clj (I think)
12:46brainproxywhoops, clj-orient: https://github.com/eduardoejp/clj-orient
12:47konrthanks, brainproxy!
12:48nDuff...Atlassian has a bunch of javascript libraries they inject into the headers during page render; I'm unclear on this point as to how to make them available at build time, and how much of an impediment it's going to be if that isn't feasible.
12:50brainproxynDuff: for advanced compilation, you'd probably need to work up an externs file, like you have to do for adv comp of cljs libs that make use of jayq
13:09dakroneso I haven't really announced anything about it yet, but I would really appreciate people giving https://github.com/dakrone/lein-clojuredocs a try with their lein2 project, just to make sure the generating is working
13:09dakroneand opening an issue on the project if it doesn't work
13:15uvtcs/awy/way/
13:15uvtc(sorry, wrong window)
13:18justditsorry to ask, but couldn't find any working library for oauth. clj-oauth seems not working with clojure > 1.2
13:19technomancyjustdit: for simple use cases just clj-http is plenty
13:19technomancyyou can authenticate against github's oauth implementation in ~7LOC
13:20justdittechnomancy: yep, it's the only solution I've for now
13:21duck11231justdit: are you sure? I was using clj-oauth with 1.3 the other day and it worked fine for me.
13:22duck11231I was using "1.3.1-SNAPSHOT" if it makes any difference
13:42notbrentcould anyone link me to a simple noir project on github that you would recommend reading to get a sense of how to build web apps in clojure?
13:51RickInGAnotbrent: have you looked at the documentation at webnoir.org
13:52technomancyclojars is a mid-sized real-world clojure web app
13:52RickInGAnotbrent: at the bottom of http://webnoir.org/tutorials there is a link to a sample blog built with noir
13:52technomancyit's compojure, but compojure is awesome
14:02borkdudeis there a function called left or right, like (fn [a b] a), (fn [a b] b)? not the first time I have this question I think
14:03technomancy(comp first list)?
14:03TimMcborkdude: Sample input and output?
14:03TimMcOh, misread as "left to right".
14:03borkdudeTimMc for example in use with merg-with
14:04TimMcIn that case I'd prefer the inline fn: (fn [old new] new)
14:05TimMcWith well-named args, you don't have to remember argument order.
14:07borkdudeI might be mistaking but I remember from lambda calculus these functions had standard names like left and right
14:08borkdudecan't find it through google though
14:09wingyi thought about one thing .. data is data in memory .. so if memory could be increased or harddisks as fast as memory that would mean that we dont have to have databases?
14:09wingysince everything is stored in memory and it's persistent between shut downs
14:13nDuffwingy: You'd still want a query interface. You'd still want a centralized source of truth for distributed operations, and a way to have semantics for avoiding or resolving conflicts.
14:13technomancyborkdude: in SKI calc each fn only has one arg, so some of those notions don't apply
14:14technomancybut that's basically what comping list onto it does; it makes it so there's only one arg
14:14wingynDuff: since it's just data in lets say in persistent memory then we could just use the functions provided in clojure to get what we want
14:14borkdudetechnomancy yes: (lambda x (lambda y x)) and (lambda x (lambda y y))
14:14wingyfilter .. map .. find etc
14:14ldopaborkdude: http://en.wikipedia.org/wiki/Church_encoding#Church_booleans
14:14wingynDuff: isnt that correct?
14:14nDuffwingy: Doesn't address the problem of distributed systems.
14:15wingynDuff: ok lets go to the extreme case
14:15wingyits not only persistent memory, but infitite in size
14:15nDuff...which still doesn't address synchronization issues.
14:15nDuffDoesn't matter if you can afford to store a copy of everything everywhere
14:15borkdudeldopa ah that's it, the true and false "values as functions"
14:16wingyone computer to host your database .. like the only memory you have (like every person only has one memory)
14:16wingybut replicated for backup
14:16nDuffwingy: Asynchronous replication still leaves you with the exact same synchronization issues.
14:16wingynDuff: that would make things simpler than today?
14:16wingynDuff: but there is no synchronyzation .. everything is in one space
14:17nDuffwingy: Synchronous replication means... that you need to decide on the tradeoffs you're going to take to have it in the first place.
14:17nDuff*sigh*.
14:17nDuffwingy: ...so, you put everything in one place, and then you have latency getting to that one place from your geographically distributed DCs, and you have failover issues.
14:17nDuffwingy: The problems don't go away.
14:17technomancywingy: this might be relevant: http://en.wikipedia.org/wiki/Fallacies_of_Distributed_Computing
14:18wingyright
14:18wingyi was just thinking about using clojure functions to query data
14:18nDuffDatomic is actually a pretty big deal along those lines
14:18wingyif those could be persistent .. why have another query lang
14:18nDuffbut it doesn't "get rid of databases"
14:18shawnlewispersistence isn't related to the query language
14:19nDuff*nodnod*.
14:19shawnlewisyou could have an on disk database that you query with map, filter etc
14:19kmicu"get rid of databases" ;]
14:19shawnlewisI should say disk-backed rather than on disk
14:20nDuff...though having the query language be amenable to optimization is a rather big thing.
14:20nDuffhence folks writing code in imperative programming languages using declarative query languages.
14:20borkdudeusing clojure reducers would be useful there too: less intermediate results
14:21borkdudeI guess..
14:22cgagi need to read more about reducers, i had trouble wrapping my head around them the first time i read the announcement
14:23amalloycgag: the general thrust is that as long as your end-goal is a reduce, you don't need laziness in the middle
14:24amalloy(reduce + 0 (map inc coll)) could be written as (reduce (fn [acc x] (+ acc (inc x))) 0 coll)
14:24wingywhen i saw how data was organizated easily in clojure i thought it had to have good use cases: (group-by #(rem % 3) (range 10))
14:25amalloyand the reducer framework provides versions of lazy functions like map that instead of producing a lazy sequence just transform your reduce function
14:25wingydb -(data)-> app server -(data)-> browser .. if it's the db query lang that filters, organizes the data etc .. then i wouldn't use clojure functions as much in app server or even in browser with cljs
14:26borkdudeamalloy nice summry
14:30cgagis doing that reduction over the lazy-seq significantly slower than using that alternative?
14:34amalloyyes
14:34cgagthat's a good summary though, I'll go reread hickey's post with that in mind
14:36borkdudewe tried to read through the reducer "framework" (library?) and wondered what happens if you don't have that third party library around in java 6
14:37borkdudethe one with jsr166y.ForkJoinPool.
14:37amalloyborkdude: you can't use fold
14:37borkdudeamalloy will it throw errors, or what?
14:38amalloyprobably
14:38borkdudeamalloy we tried running with and without, we thought we saw some performance difference, but no erros
14:38borkdudeerros
14:38borkdudeerrors (grr)
14:38borkdudeamalloy I didn't know if we used fold though, I think just mapping and reduce
14:38amalloyyou didn't use fold, then
14:39borkdudeamalloy so the difference we have seen must be co-incidence?
14:40amalloyyes
14:40amalloywell, maybe not
14:40amalloythere might be some operations that implicitly use fold if possible, but i don't think so
14:41borkdudeamalloy mapping -> map from reducers I mean
14:44borkdudecemerick I would love to know what that tweet about lifestyle business is about ;)
14:50cemerickborkdude: Just another typical holier-than-thou revenue-less startupper pissing on someone's profitable life's work.
14:52qubit[01]well now I want to read it
14:52cemerickI probably shouldn't bother reacting…but I hate seeing people chasing the lottery for the wrong reasons.
14:53technomancycemerick: never hate, only ever destroy
14:53technomancy=)
14:53cmiles74I'm sure their startup project is incredibly clever and original. Surely not something like another top news site or grocery list manager.
14:54cemericktechnomancy: Working on it. :-) In the meantime, I'm a weak, weak person.
14:54cemerickThe Twitter snark slurry calls with its siren song, etc.
14:54TimMc"It's like Bitcoin meets ZocDoc."
14:54TimMchttp://nonstartr.com/
14:56cemerickTimMc: Oh, sweet.
14:58cgagIt's like Klout, but for self-proclaimed social media experts.
14:58cgagthis thing is great
14:58cmiles74"It's like Fliboard meets Chatroulette" See, I know that could work. :P
14:59TimMcHalf joke, half useful? :-P
15:04amalloywait, when did (= 1 1.0) become false? 1.4?
15:05hiredman1.3 I would expect
15:06hiredman(since that is lame, and 1.3 is lame)
15:06dnolen1.3
15:09dustingetzclojure 1.3 has clojure.contrib.map-utils/deep-merge-with
15:09dustingetzhow can i get that in clojure 1.4
15:09dustingetzi'm having trouble googling for this, maybe it didn't get ported, how can i find the answer to that myself
15:09dustingetzand should i be re-implementing this?
15:11dustingetzseparate question, im not sure i want deep-merge-with - i want to merge two deeply nested maps, but i want to combine maps at nested level
15:11dustingetzis there an api for this, or do i need to do it myself
15:17gtrakhey guys, just curious, where in the source do these get implemented: static public interface OODD{double invokePrim(Object arg0, Object arg1, double arg2);}
15:17gtrak
15:18amalloygtrak: (defn f ^double [x y ^double z] ...)
15:19gtrak ah.. hmm, codegen?
15:22gtrakah, found it: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#5176
15:22dustingetzit might be (deep-merge-with merge map1 map2)
15:24dustingetzseems to work
15:24dustingetzso, how can i get access to deep-merge-with (defined in 1.3 clojure.contrib.map-utils) in clojure 1.4
15:24dustingetzi'm about to just copy paste it from the clojure.contrib source
15:26technomancycemerick: oh, for the record "never hate, only ever destroy" wasn't chastising you, it was quoting a blog post
15:26technomancyhttp://gilesbowkett.blogspot.com/2008/05/never-hate-only-ever-destroy.html
15:26cemericktechnomancy: Yup, I know. :-)
15:27technomancyI realized that could have come across wrong
15:27cemerickIt's probably his best piece of work.
15:27technomancyagreed
15:27timvisher_technomancy: so there's definitely something about the mac that makes swank.cdt work for lein2
15:27timvisher_just tried it again under windows and it's still broke…
15:27timvisher_same version and everything
15:28cemerickFunnily enough, I think he has me blocked.
15:30technomancytimvisher_: hm; apple cleaning up after oracle's messes? that'd be a pleasant role reversal.
15:30technomancycemerick: from what I gather he's a bit of an unstable personality
15:31timvisher_technomancy: for reelz
15:31xeqitechnomancy timvisher_: https://maven.apache.org/general.html#tools-jar-dependency
15:31xeqilooks like its included on the runtime already for osx
15:31xeqi*the classes are
15:32timvisher_xeqi: well looky there…
15:32technomancyxeqi: makes me wonder how good of an idea auto-activated profiles based on JDK version or OS would be
15:35timvisher_what do the scope and systemPath elements do?
15:35timvisher_can i configure those in leiningen?
15:36timvisher_i do have tools.jar in my filesystem
15:36xeqitimvisher_: you can add a scope in lein, but I don't think it affects anything
15:37xeqithere is no systemPath equivalent
15:37timvisher_nor, apparently, does tools.jar exist in central either, so that won't help me :(
15:37timvisher_manually add it to the classpath?
15:38xeqiin maven: scope allows you to specify wether a dependency is needed at compile time, run time, expect to be on the classpath already, etc
15:39xeqiyou could try to add it to the classpath, though lein2 does not have an "official" way to do so
15:41timvisher_xeqi: know how to do it unofficialy?
15:43xeqihmm, theres a mailing list thread where technomancy mentions adding it to :resoure-paths *might* work
15:44xeqithough you wouldn't want to jar/uberjar it like that
15:45timvisher_i'm more interested in seeing if that resolves the problem
15:45timvisher_i just really badly want cdt to work right now
15:46kovasb_the locals clearing issue makes it not worth it for me personally...
15:57timvisher_kovasb_: was that in reference to cdt?
15:58kovasb_yup
15:58timvisher_care to explain?
15:58timvisher_i'm still trying to try out cdt, so any negative opinions would be helpful
15:58kovasb_have you heard of the locals clearing problem?
15:59kovasb_looks like it might have been fixed in 1.4
15:59timvisher_i had not
16:00kovasb_the problem was you couldn't actually see the values of your "variables" when you stepped through the program
16:00nDuff(clearing locals is desirable in some cases -- not doing so can lead to lazy sequences' heads being held onto unnecessarily -> memory leaks)
16:00kovasb_right
16:00timvisher_ah
16:00timvisher_when i've gotten it working on my mac, the locals were visible just fine
16:00kovasb_the idea is to change the behavior for development purposes. hence the compiler flag
16:00timvisher_except in some cases, like in java files etc
16:01nDufftimvisher: the question is whether they're still visible after the last time when they can potentially be referenced
16:01kovasb_when i was playing around with it last year it was killing me
16:01timvisher_i understood it be somewhat non-deterministic
16:01timvisher_nDuff: understood
16:02kovasb_are you using it in emacs?
16:02timvisher_yes
16:03PeregrinePDXAh a productive day at work. Setting up a clojure development environment and showing some things off to co-workers.
16:04timvisher_PeregrinePDX: did it go well? ^_^
16:04timvisher_i still have horrific memories of a time i tried to give a demo of emacs and my system basically spent the whole time crashing
16:04PeregrinePDXWell other then I am pretty new to clojure and wasn't able to give answers to everything. It went ok.
16:05PeregrinePDXWe had some fun playing around with Overtone despite the fact that it's completely unrelated to work.
16:11HodappPeregrinePDX: Overtone does look interesting.
16:12HodappToo bad I'm music-tarded.
16:12timvisher_,(long 7)
16:12clojurebot7
16:12timvisher_is that a boxed long?
16:12timvisher_or a `long`
16:15amalloyboth, depending on context
16:15timvisher_cool
16:15Gnosis-amalloy: am I correct in thinking that it doesn't matter, because it's immutable in Clojure?
16:16amalloyi don't see how that's relevant
16:16Gnosis-okay
16:17amalloyi think it usually doesn't matter because clojure is dynamically typed, but on occasion (eg for performance reasons) it matters
16:17gfrederickshave there been any languages with mutable numbers?
16:17amalloyyes
16:17cgagi'm sure i've read about that
16:18cgagredefining the value of 2
16:18technomancygfredericks: can't you reopen Fixnum eigenclasses in ruby?
16:18gfrederickstechnomancy: Fixnums have a single-word representation I think
16:18duck112312 = 2.5 ;; that way my radiohead test passes
16:18gfredericksand so almost certainly are copied by value
16:18amalloyclojure/java have mutable Integer objects if you hack them with reflection
16:19gfrederickstechnomancy: "no virtual class for Fixnum"
16:19hiredmanwhich, since auto boxed numbers are cached, is a Really Bad Idea(tm)
16:19amalloyindeed
16:19wingywow .. free versioning of data for free
16:19wingythere is free lunch!
16:20technomancygfredericks: you can redefine + on Fixnum though
16:21qubit[01]you guys use conditions alot ? In the book I'm reading he is seperating the two out, one function does the work, the other is just conditions
16:21gfrederickstechnomancy: sure, at the class level; that's not stored per-number
16:22wingynDuff: ok so if the only server is down, then it's down .. no more keeping things in sync
16:22wingynDuff: kinda like if i die, then i die
16:22wingynDuff: wouldn't that be better than having sync issues
16:24nDuffwingy: If you're the person taking that attitude, you're _not_ the person being hired to run high availability for a site where downtime means real and immediate financial losses.
16:24nDuff("the only server"? Heh.)
16:25TimMcamalloy: Huh, wallhacks can remove "final"?
16:25hiredmanfinal gets no love
16:25wingylucky me im not a real programmer :) .. i so hate duplicated functionalities
16:26technomancywingy: if you're interested in this problem there's lots of background reading you could do, starting with http://en.wikipedia.org/wiki/CAP_theorem and http://en.wikipedia.org/wiki/Fallacies_of_Distributed_Computing
16:26hiredmanhttp://www.azulsystems.com/blog/cliff/2011-10-27-final-fields-part-2
16:26wingyaight
16:27wingynDuff: that was cool
16:27qubit[01]this book has #(catt (dec n )) , but hasn't explained what # does, whats that called ?
16:27TimMcfunction literal syntax
16:28TimMc&'#(+ % 5)
16:28lazybot⇒ (fn* [p1__14540#] (+ p1__14540# 5))
16:28cgag,(#(* % %) 5)
16:28clojurebot25
16:34nDuffwingy: ...also, "the only server" is fantasy beyond a given scale. Services eventually need to cluster, and their nature doesn't always allow them to be stateless or uncoordinated.
16:35qubit[01],(#(* %1 %2) 5 20 )
16:35clojurebot100
16:38gfredericksqubit[01]: it's the #(...) syntax specifically, not just "#"; the "#" plays several different syntactic roles
16:39qubit[01]hmm
16:40hiredman# means "use the other dispatch table in the reader"
16:40TimMcqubit[01]: # tells the reader to do something different with what follows.
16:40gfredericksqubit[01]: clojure.org/reader
16:40hiredmanso the normal dispatch table in the reader sees { and reads a map, the other dispatch table sees { and reads a set
16:41hiredmanso { starts a map and #{ starts a set
16:41hiredmanin the normal dispatch table ( starts a list, in the other dispatch table ( starts a function literal
16:41hiredmanso ( starts a list and #( starts a function literla
16:41Gnosis-how compatible are the JVM, CLR, and JS versions of Clojure?
16:41hiredmanliteral
16:42hiredmanbarely?
16:42TimMcGnosis-: I'm sure (+ 1 2) will work the same way in all of them. :-P
16:42gfredericksTimMc: not really
16:42gfredericksconsidering numeric types
16:42TimMchaha
16:42hiredmanclojurescript doesn't have vars
16:43Gnosis-that does not sound good. what about compatibility with concurrency and lazyseqs?
16:43hiredmanclojureclr has to deal with clr types, and not erased generics
16:43gfredericksGnosis-: cljs has little need for concurrency. but it does have atoms
16:43gfredericksdoes it have agents?
16:43hiredmanand the jvm types that you use in clojure are not available in ither of the others
16:43gfredericksI wanted future the other day but it didn't have it
16:43wingynDuff: perhaps the questions is then: 1. could we proxy our data in clojure so that where the data is stored is irrelevant. no need to use SQL anymore to get/filter/group etc. do whatever you are doing in clojure for that 2. could we have our database bundled together with our backend .. no need for a TCP connection between server and database .. your db is running in your app (think neo4j could do that)
16:43hiredmanjavascript doesn't have threads
16:43qubit[01]hiredman, ok :)
16:44TimMcgfredericks: No blocking.
16:44hiredmanfutures and agents run on threads
16:44ivanbrowsers have Worker and SharedWorker
16:44ivantoo bad they're more like Erlang processes
16:45hiredmantrivial programs, or highly algorithmic programs (no i/o, no concurrency, etc) may port
16:45Gnosis-ah, okay. what about only between JVM and CLR?
16:46hiredmanthe same really
16:46Gnosis-oh :(
16:46ivanCLR has no leiningen
16:46hiredmanwell, you might be able to get away with more
16:46gfredericksTimMc: oh right
16:46gfredericksTimMc: so I wanted defer then :)
16:47wingynDuff: im just day dreaming about a transparent way of working with data where db specific lang doesn't matter
16:47gfrederickswhy doesn't clojure have defer?
16:47hiredmanwhat is defer?
16:47hiredman,(doc delay)
16:47clojurebot"([& body]); Takes a body of expressions and yields a Delay object that will invoke the body only the first time it is forced (with force or deref/@), and will cache the result and return it on all subsequent force calls. See also - realized?"
16:48hiredman,(doc promise)
16:48clojurebot"([]); Alpha - subject to change. Returns a promise object that can be read with deref/@, and set, once only, with deliver. Calls to deref/@ prior to delivery will block, unless the variant of deref with timeout is used. All subsequent derefs will return the same delivered value without blocking. See also - realized?."
16:48hiredman,(doc future)
16:48clojurebot"([& body]); Takes a body of expressions and yields a future object that will invoke the body in another thread, and will cache the result and return it on all subsequent calls to deref/@. If the computation has not yet finished, calls to deref/@ will block, unless the variant of deref with timeout is used. See also - realized?."
16:48gfrederickshiredman: a future where you don't care about the return value
16:48hiredmanmust be one of those 3
16:48gfredericksfuture-for-side-effects
16:48hiredmangfredericks: that is just future
16:48Raynesgfredericks: That's a thread, right?
16:48RaynesWell, not really.
16:48RaynesIf you don't get the return value of a future, you don't even see exceptions.
16:48gfrederickshiredman: but delay is useful in CLJS, while bringing in future by name would be a bit weird
16:49gfrederickswhich I assume is why it hasn't been done
16:49nDuffwingy: datomic is pretty close in some respects -- but familiarity with the current solutions and their limitations might be a good place to start, such to have better grounding for generating _potentially useful_ daydreams..
16:49hiredmanjs is just so horrible, as a language and a runtime
16:50gfredericksI'll not argue with that
16:50nDuffwingy: ...if you don't understand the problem space, you're just going to be reinventing square wheels (and there've been a lot of them).
16:50wingyi guess
16:51wingyoh its rich hickeys
16:55ordnungswidrigdoes anybody know about functional lenses for clojure? I know that for maps there is update-in and get-in.
16:58gfredericksassoc-in as well
16:59wingynDuff: in the datomic video, by apps he means my backend server in clojure?
16:59gfredericks,(apropos "-in")
16:59clojurebot(unchecked-inc-int gen-interface get-in with-in-str ns-interns ...)
17:00ScorchinHow are people doing integration testing of web apps (compojure) with their full stack? E.g. running server, loading pages, making javascript calls, etc.
17:00CheironHi, why I'm getting this error when trying to bootstrap ClojureScript? http://pastie.org/4170908
17:00technomancyScorchin: take a look at what clojars uses; it's pretty great but the name escapes me at present
17:00technomancyxeqi wrote it
17:01Scorchintechnomancy: thanks!
17:02Scorchintechnomancy: I'm also considering whether to separate out my JS (not ClojureScript I'm afraid) or to keep it in the same repo. If I was to keep it within the same repo, is there an idiom for folder placement of the JS files and their related tests?
17:03technomancyI don't know anything about JS, sorry
17:04xeqiScorchin: I've got a couple libraries for staying in ring, no server up/js testing
17:04xeqikerodon could still use some work, but the basics are there
17:04xeqitheres clj-webdriver for full stack stuff
17:04wingyScorchin: i would keep all source files for a project within the same repo
17:04xeqiwhich could load something like jasmine for js unit testing
17:05Scorchinxeqi: thank you
17:05Scorchinwingy: but the question is, what directory?
17:06Scorchinwingy: I don't just want a plain JS file, I want to hook up full unit and integration tests of the JS and how it interacts with the Clojure code I've written
17:07wingysorry cant give any advices on that .. very new to clojure
17:07ScorchinTo keep things simple I was thinking about separating the repos just so I can have lein for the Clojure stuff and Rake + Jasmine for the JS. I'd then create minified/packaged artefacts which I can publish when a build is green for the JS app
17:07wingyso JS is for the client?
17:07wingyhow about /server/..
17:07wingy/client/..
17:07Scorchinyup
17:07Scorchinno, the server is written in Clojure
17:08wingydont mix different langs/tools in root
17:08wingyyeah thats what im saying .. perhaps keeping clojure things in /server/ and js things in /client/
17:08wingyor clojure things in root/
17:08wingyand there you have root/client/
17:09wingywhere root is the root for your project /
17:09Scorchinhmmm, true
17:09wingysimple .. makes sense
17:09wingyive done that in other projects
17:13wingyi dont know about splitting them up .. the server usually serves the client stuff .. i would have it in one repo
17:14wingybut im coming from node.js where this is pretty standard .. the js back and front is kinda tied together
17:26aduhow do I add a key-value pair to a hash-map?
17:27gtrakadu: assoc
17:27aduthanks
17:30goodieboyis it possible to use gen-class, to define nested classes, and then refer to the nested class in a parent class method?
17:32amalloyjust write java, man
17:35gfredericksassemble strings of java source and then shell out to javac
17:35hiredmanjust don't write nested classes
17:35hiredmaninner classes are a figment of the java language, the jvm doesn't care
17:36goodieboythanks!
17:37gfrederickshiredman: I guess that means there would be no reason whatsoever for clojure to support it, even if we all thought they were fantastic?
17:37wingyrich is really a genious .. cool perspectives
17:37wingymakes me wanna use datomic asap
17:38hiredmangfredericks: correct
17:38aperiodicgfredericks: i wish it did, so i could add counters to my mapreduce jobs without writing a java wrapper, but that's more of an issue with hadoop sucking.
17:39hiredmanaperiodic: how does hadoop require you to use inner classes?
17:40hiredmanI am pretty sure that is not enforcable
17:40technomancyrlb: I heard wheezy was going into a freeze tomorrow (!)
17:41rlbI'm building as we speak ;>
17:41technomancygodspeed
17:41rlbHad a couple more problems I had to fix.
17:41rlbBut I think we may be OK now.
17:42aperiodichiredman: it appears to require static enum in the class you give to hadoop
17:42hiredman:|
17:42goodieboyin a class that extends another (via gen-class) ... how do you call the super method?
17:42hiredmanand uses reflection to find it
17:42hiredmanugh, that is horrible
17:42aperiodiclike i said, hadoop sucks
17:43aperiodicit's very capable, but it sucks in so many ways
17:44gfredericksconvincing a generation of devs that OOP is a good idea has some very weird results
17:45aperiodicgoodieboy: you'll need to use gen-class's :exposes-methods to rename the super and then call the renamed method on an instance of your gen'd class
17:45goodieboyaperiodic: cool thanks!
17:58atoiAhh, good, there is a clojure room. I figured there would be. :)
18:05aduwhy does noir use an old version of hiccup?
18:06Raynesadu: It does?
18:11gfredericksdeftype in cljs does not generate factory functions?
18:11adunoir 1.2.1 uses hiccup 0.3.7
18:11gfredericksnm it does
18:12rlbtechnomancy: I've uploaded emacs24 to unstable
18:12rlbdon't know how long it might take to get through NEW
18:12xeqiadu: that was the version of hiccup that was out when 1.2.1 was released
18:12rlbnote that the emacs metapackage still points to emacs23
18:13eckadu: https://github.com/noir-clojure/noir/blob/master/project.clj
18:13eckmaster/head is up to date
18:13aduso if I change 1.2.1 to noir 1.3.0-beta10 then it should work?
18:14eckhopefully
18:14Urm3lhey guys
18:14Urm3li am really new to clojure and i have a problem
18:14Urm3lcan i use records as keys in a map?
18:14technomancyrlb: so it sounds like the freeze doesn't apply if the package is in sid by tomorrow?
18:15rlbtechnomancy: hopefully; suppose we'll see.
18:16gfredericksoh maybe it doesn't
18:16Urm3li defined coordinates as records and have them stored in a hashmap with the matching value but get always returns nil if i use it with a similar coordinate record
18:17technomancyUrm3l: are you sure you want records?
18:17technomancywhen you're starting out you usually don't
18:18Urm3lAt Uni we had half a year of scheme and we did everything with records there.. so i thought it might work out
18:18Urm3lbut we never used hashmaps in scheme anyways..
18:19scottjUrm3l: (defrecord point [x y]) (get {(point. 1 2) "cool"} (point. 1 2)) => "cool"
18:20Urm3lis (point. 1 2) equivalent to (->point 1 2) ?
18:20technomancyUrm3l: I mean it should work, but I'd stick with the big 4 types for your first 3 months in clojure
18:20aperiodicUrm3l: the rule of thumb is to stick with to maps by default, and only move to records if you need a) fast dispactching for multimethods or b) to implement some protocols/interfaces using the record
18:20augustlare there any canonical ways of serializing and deserializing clojure data structures to disk?
18:20Urm3lo god i am stupid
18:20Urm3li mixed up the arguments -.- i put the hashmap second
18:21Urm3lOk so how would you implement coordinates?
18:21Urm3li am trying to do some kind of game of life implementation
18:21technomancyvectors are good for that
18:21rlbaugustl: for some purposes, read and prn might be sufficient.
18:22scottjUrm3l: I think the result of (point. 1 2) and (->point 1 2) is the same, but ->point is a function so you can pass it to functions.
18:22xeqi&(doc pr-str)
18:22lazybot⇒ "([& xs]); pr to a string, returning it"
18:22augustlit'll just be vectors, maps, numbers and strings
18:23augustlI'll look up those, thanks
18:23Urm3lok ill give vectors a try
18:23Urm3lthanks a lot
18:24scottjUrm3l: when you want to use records, normally use maps. this might be an exception if it's just [x y]
18:24aperiodici use maps that look like {:x 1, :y 2}, since i find it hard to remember that (nth coord 0) means "get the x component of coord"
18:25aperiodicinices are hard, guize
18:25aperiodics/inices/indices
18:25aperiodicspelling is hard, too
18:26aperiodicalthough i guess with destructuring that objection becomes moot: (let [[x y] coord] ...)
18:29scottjaperiodic: until you use more than one point, then you have to name all the individual x's and y's. ssyntax is nice here. a.x a.y b.x b.y
18:30aperiodicscottj: that doesn't resolve as a package-qualified classname?
18:32augustlso, I just found https://github.com/danlarkin/clojure-json. Now I want to figure out what to add to my project.clj. Is there a tutorial out there for that?
18:32augustlno idea where to search to find the package name and version
18:32technomancyaugustl: use cheshire
18:32technomancythat library is deprecated
18:32augustlah
18:32scottjaperiodic: I think the class a.x would be unaccessible (trying to find my hacked clojure to try it out)
18:33scottjaperiodic: there are other options, such as a!x or a:x
18:33augustlthat tutorial I requested would still be useful though, the next time I find a library :)
18:33technomancyaugustl: try `lein help tutorial`
18:33augustlcool, thanks :)
18:34technomancysure thing
18:35aperiodicscottj: my understanding of symbol resolution is that that would cause an error, and http://clojure.org/evaluation agrees
18:36aperiodicscottj: but yeah, using something like a|x would let you keep destructuring without losing much in the way of readability
18:37aperiodicis it bad that one of my favorite features of clojure is just that you can stick almost anything in symbols?
18:37gtrak,$#@
18:37clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: $# in this context, compiling:(NO_SOURCE_PATH:0)>
18:40gtrak,($#&&&&&& 5) ; <-- I can't believe this one hasn't been used yet
18:40clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: $#&&&&&& in this context, compiling:(NO_SOURCE_PATH:0)>
18:40aperiodicwhy wasn't the @ in the symbol in your first example?
18:41gtrakhmm... guessing @ is a reader macro?
18:41gtrak,(read-string "$#@")
18:41clojurebot$#
18:41gtrak,(read-string "$#@53")
18:41clojurebot$#
18:41gtrak,(read-string "$@53")
18:41clojurebot$
18:41aperiodicok, that's a good reason
18:41scottjaperiodic: one of my favorite features of clojure is that few clojure libraries use entirely non-alphabetical function names.
18:43lynaghk`ping: dnolen
18:43dnolenlynaghk`: pong
18:43lynaghk`I found an issue with core.match on CLJS, but I'm not sure if it's a bug or design change.
18:44dnolenlynaghk`: when it comes to core.match, probably a bug :)
18:44lynaghk`Should protocols be namespaced in cljs? I.e., should we be writing "cljs.core.ILookup" or just "ILookup"?
18:45augustlis it possible to generate XML with hiccup? It seems to be able to handle tagsoups, so I suppose I could just write the "<?xml ... ?>" tag as a string, by hand
18:45lynaghk`core.match uses the former style, which stopped working in cljs 2aeb3d8.
18:46amalloyaugustl: don't do it, man. use data.xml
18:46lynaghk`dnolen: i.e., in the latest cljs release (satisfies? ILookup {:a 1}) gives true, but (satisifies? cljs.core.ILookup {:a 1}) is false.
18:46augustlamalloy: what's data.xml?
18:46RaynesIt's a library.
18:46Rayneshttps://github.com/clojure/data.xml
18:46amalloy$google github clojure data.xml
18:46lazybot[clojure/data.xml · GitHub] https://github.com/clojure/data.xml/
18:46atoiarguments in Clojure are just separated by whitespace? hmm
18:47dnolenlynaghk`: oof, that sounds like a bug in CLJS, ticket please!
18:47Raynesatoi: You can separate them with commas if you want, but they're just whitespace too.
18:47amalloycommas are for languages where everything is a special case
18:47atoigotcha.
18:47augustlRaynes, amalloy thanks
18:47lynaghk`dnolen: so both cljs.core.ILookup and ILookup should work? I'll open a ticket.
18:47dnolenlynaghk`: oh right, yeah jonasen brought this up but I've been busy - cljs.core/ILookup will work.
18:48atoiI'll probably continue to have obvious questions for the next few hours, though I'll check the docs. This one just didn't google well.
18:48atoiRiemann is forcing me to learn Clojure. :)
18:48dnolenlynaghk`: but I'm starting to think that either cljs.core.ILookup or cljs.core/ILookup should work.
18:48gtrak&,(#(,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,inc,,,,,,,,,,,,,,,,,,5))
18:48lazybot⇒ 6
18:49aperiodicRiemann? I thought he was dead.
18:49chrislnI was looking for some clojure material and found this: http://vimeo.com/14709925 it's so awesome T_T wondering if anyone could recommend me some material on clojure game prog/opengl integration?
18:49lynaghk`dnolen: or ILookup, right? Since that core is imported to every file.
18:49atoiaperiodic, :) http://aphyr.github.com/riemann/index.html
18:50technomancywow, a deb?
18:50amalloyaugustl: search that readme for "hiccup", btw - data.xml supports a hiccup-style syntax as well as the "standard" one that's rather bulku imo
18:51augustlamalloy: nice!
18:52aperiodicchrisln: there's penumbra (https://github.com/ztellman/penumbra), but if you just wanna mess around with making pretty things in clojure i'd highly recommend quil (https://github.com/quil/quil)
18:53chrislnaperiodic: that looks awesome, I'll surely take a look!
18:53chrislnaperiodic
18:53chrislnbtw, anything on game prog?
18:54chrislnnot exactly libs or stuff like that, more like resources or books or tutorials, perhaps?
18:55aperiodicchrisln: there's tetris and asteroids implementations in penumbra/src/example. haven't found much on the way of guides or tutorials on writing games in clojure
18:57chrislnaperiodic: oh, I see.. that's a shame tho, I really wanted to get into clojure game programming, just not sure where to start :(
18:59kovasbso i just upgrade to the new clojurescript build
18:59kovasband now I'm getting java.lang.IndexOutOfBoundsException
18:59kovasbat clojure.lang.RT.nthFrom(RT.java:784)
19:00kovasbwhen I try to compile my cljs.. anyone seen this?
19:00lynaghk`kovasb: yeah, I just got some of that myself
19:00kovasbouch
19:00kovasbdid u figure out what it was?
19:00lynaghk`kovasb: cleaning seemed to make it go away.
19:00kovasblemme try that
19:00aperiodicchrisln: yeah, my impression is that there's not a whole lot of game programming in clojure going on (the overwhelming use-case seems to be web apps). do you have much of a functional background?
19:01lynaghk`kovasb: not really. I've been tracking down other new cljs bugs. Today has been, "hey, wait. This worked before, I swear" debugging party :/
19:01gtrakchrisln: I made a little game loop and physics simulation (mostly works) with quil if you want to take a look: https://github.com/gtrak/quilltest/
19:01kovasbhmm still getting it
19:01kovasbi did lein clean and lein cljsbuild clean
19:01chrislngtrak: thanks dude, I'll surely do!
19:01kovasbFML
19:02lynaghk`kovasb: I'm out of ideas then, sorry dude. I'm just leaving. I'll catch you later if I find out what's up.
19:02chrislnaperiodic: but do you think it's not something clojure could do quite well?
19:02kovasbthanks! catch u later
19:02aperiodicchrisln: oh yeah, definitely.
19:03chrislnaperiodic: to be quite honest, I don't. I have some background in non-functional languages, like Pascal, Python, Java, Ruby, etc. I've started learning the concepts a few days ago, with Haskell and Lisp
19:03chrislnaperiodic: and I wanted to focus on game prog, just don't know how, haha
19:04aperiodicchrisln: there are guides to writing games in other dialects of lisp (http://nostarch.com/index.php?q=lisp.htm), so that might be a better place to start
19:05chrislnaperiodic: oh, I read that book, but it's focused on CLisp :/
19:05Iceland_jackchrisln: If you're interested in serious game programming, for certain values of serious, languages like Haskell and Clojure would not be your best bet
19:06technomancybut, but ... rain cat!
19:06chrislnIceland_jack: well, I know it'd be better to do some C++ or Java or even C#/XNA programming, but I really liked the way functional programming works, and I'm not trying to make the next WoW, just want to have fun, haha
19:06technomancyare you saying http://raincat.bysusanlin.com/ is not serious? =)
19:06aperiodici don't think the languages aren't up to the task, but there's definitely not a development community that could help you out. you'll be figuring out a lot of stuff on your own.
19:06Iceland_jackI tried qualifying that as much as I possibly could
19:07chrislnI think aperiodic is right, that's exaclty the problem..
19:07Iceland_jackLanguages with GC are generally not up to the task of making graphics and AI intensive games at all
19:07gtrakIceland_jack: at least as good as XNA
19:07chrislnexactly*
19:08Iceland_jackbut if chrisln is more interested in functional programming than in actual game development then using fun projects like games as a motivating factor is a good idea
19:08chrislnbut I'm not trying to make Crysis on Clojure, just some nice small 2D/3D ones..
19:08aperiodicwell, there are a fair amount of games written in java these days, though not AAA ones
19:08chrislnindeed :D
19:09gtrakthough I think C#'s native-bindings are a bit better than java's, and the XNA framework is pretty neat itself
19:10chrislnhow available are the Java libs to Clojure programming?
19:10chrisln(noob question, btw)
19:10gtrakchrisln: fully
19:10Iceland_jackvery
19:10chrislnis that so?
19:10Iceland_jacksic.
19:10gtrak,(.toString "Hells yea!")
19:10clojurebot"Hells yea!"
19:10chrislnso Clojure is like the functional side of Java? it even runs on JVM, doesn't it?
19:11Iceland_jackClojure is almost wholly unrelated to Java the language
19:11chrislnok, I didn't express my point quite well
19:11chrislnI meant, I can use the power of the Java as if I were writing Java game applets, but with the nice functional side of Clojure?
19:12chrislnof the Java libs*
19:12gtrakIceland_jack: I think that's not quite right.. clojure can do java-style stuff just as well or better
19:12gtrakit's a thin layer on top
19:12gtrakof bytecode, not java-source
19:12Iceland_jackThat depends on how much you mean by “Java the language” in that it's not a “functional side” of it
19:13chrislnfor example, could I use "paint", "sleep" and "threads" in clojure?
19:13Iceland_jackyes
19:13chrislnhm, that's quite interesting
19:14aperiodicchrisln: if your question is 'can i use java game development library X', it will always be possible to do so (regardless of X), but it may or may not be pleasant
19:14gfredericksthere's a very good chance it won't be less pleasant than doing it in java though
19:14Iceland_jackTrue
19:15chrislnthat's kinda exciting, my background in Java may be of some help
19:15Iceland_jackIt could also be a daunting task to tackle game dev and functional programming at the same time if you're new to them
19:15jayunit100ha yeah : big mistake I made was trying to couple clojure to other new stuff i was learning.
19:15gtrakwhat's so hard about FP?
19:16technomancygtrak: unlearning bad habits
19:16Iceland_jackIt's different in a lot of ways
19:16gfredericksgtrak: trying to learn it while thinking in OOP
19:16chrislnwell, as long as I have good resources on learning stuff.. I'm used to getting beat down by prog languages, lol
19:16gtrakyea.. for some reason immutability just wasn't that big a deal to me? Everyone seems to fuss about it
19:16jayunit100if you try to learn FP and GP at the same time you'll end up writing mediocre clojure code for boring games. :) better to start with something like sorting algorithms, database i/o, file parsing, etc… stuff you already know.
19:16clojurebotclojure is like life: you make trade-offs
19:17Iceland_jackgtrak: Immutability means you can't do a (def value (inc value)) quite the same way as you might do a value++;
19:17gtrakI always hated value++ anyway, it was hard to read
19:17Iceland_jackwhich is fundamental enough to some paradigms that it's enough to make people annoyed
19:17gfredericksIceland_jack: I do that stuff a surprising amount at the repl :)
19:18gfredericksgtrak: so apparently you're problem is you think imperative code is hard :D
19:18gfrederickss/you're/your/
19:18chrislncan I tweak the stuff I import from Java on CLojure
19:18chrislnClojure*?
19:18gfrederickstweak?
19:18Iceland_jackProbably means modifying their value?
19:18chrislnok, bad choice of words, redefine, perhaps?
19:19gtrakgfredericks: I guess... :-)
19:19technomancyif the java lib uses interfaces and abstract classes in the right places, then you can have tons of flexibility
19:19gtrakhence, why is FP supposed to be hard?
19:19technomancybut some java libs hard-code a lot of things
19:19chrisln:/
19:19gtrakthe thing I find most hard about clojure is just the dynamicity and code-organization
19:19Iceland_jackgtrak: other people people may have different experiences to you?
19:20aperiodicgtrak: i think, ultimately, because people in general grok turing machines much more readily than the lambda calculus
19:20gfredericksthat's only because there's a greek letter in it
19:21gtrakIceland_jack: perhaps, I think telling someone they're going to have a hard time with a conceptually simple thing sets up the wrong expectation
19:21Iceland_jackgfredericks: and the fact it includes the word “calculus” isn't going to set up mental barriers? ;)
19:21aperiodicgfredericks: probably want to get rid of 'calculus' while you're at it
19:21Iceland_jackhah exactly
19:21gfredericksW-codez
19:21gtrakif you write code and aren't thinking about what you're doing for 15 years, then I suppose yes, it's a hassle
19:21gfredericksLambda-Machines?
19:22Iceland_jackBobby Machines
19:22Iceland_jackfriendly name, Bobby
19:22gfredericksdone
19:22aperiodicmarketing coup of the century
19:22gfredericksguys bobbymachines.com is available
19:22gfredericksnot sure how it's been overlooked this long
19:22technomancy"little Bobby tables, we call him"