#clojure log - Jun 29 2012

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

0:04 technomancy: hircus: no, that would be 2.x

0:05 2.x doesn't really need maven actually, just aether, which should be significantly smaller

0:06 brehaut: cemerick, 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

0:07 it happens that the concrete implementation is used as taxonomy, but its not necessarily the case

0:08 xeqi: JulioBarros: I think you're looking for http://docs.oracle.com/javase/6/docs/api/java/security/MessageDigest.html

0:11 aniero: aperiodic: sweet, this appears to be working. not that i can easily test high concurrency yet, but still!

0:12 hircus: technomancy: ah, ok; in case the Maven2 maintainer keeps dragging his feet we'll have to take a look at that

0:12 technomancy: hircus: there are more dependencies on the clojure side, but I think fewer total

0:12 brainproxy: JulioBarros: linux distros usually come with hashing libs and cli frontends for them either installed by default or easily installed with a package manager

0:13 hircus: we'll still have to wait until it can be built without bootstrapping using Leiningen 1.x, right?

0:13 technomancy: I don't think that will be difficult

0:14 in fact, it might be enough just to check pom.xml into the packaging branch and run mvn install

0:14 once leiningen-core's dependencies are packaged anyway

0:14 hircus: ah, ok

0:15 technomancy: that same process (store the pom in the packaging branch, run mvn install) will probably work for the clojure dependencies lein has

0:16 or just a simple `jar -cf [...]` invocation if you prefer

0:18 hircus: all the deps of leiningen: http://p.hagelb.org/lein-deps.html

0:18 hircus: thanks

0:18 technomancy: all the signed ones are in Central and build without lein

0:18 hircus: technomancy: that'd work out great, as currently there's no Maven in RHEL / CentOS / Scientific Linux *at all* :)

0:19 technomancy: O_O

0:19 wow

0:20 clucy and hooke have mvn-less packaging already for debian's lein1 packaging

0:21 https://github.com/technomancy/robert-hooke/blob/debian/debian/rules

0:21 hircus: technomancy: yup, we resorted to doing that, since Maven is really unhappy with source-only packages anyway

0:23 technomancy: 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).

0:23 and RHEL 6 is... branched from Fedora 12

0:24 * technomancy is afraid of people who think eclipse is a build tool

0:27 cemerick: technomancy: that list is out of date; pomegranate is 0.0.13

0:27 technomancy: cemerick: yeah, but I don't think the number of dependencies has changed since we excluded ring

0:28 cemerick: OK; just wanted to make sure no one was depending on that for anything. :-)

0:28 BTW, Eclipse is *great* at builds. Click-click, and you've got an application built.

0:28 technomancy: right; I just wanted to give an impression of the magnitude of the task

0:28 cemerick: sure, if everyone on your team uses it

0:28 cemerick: It even uses ant underneath, which is nice.

0:28 technomancy: including a fellow named Jenkins

0:29 as well as his buddy Travis

0:30 * cemerick seems to suck so bad at dry irc sarcasm :-P

0:31 technomancy: "It even uses ant underneath" actually sounds like something you'd say to cushion the statement

0:32 I'm all over the place today

0:33 cemerick: technomancy: that's what makes that troll sing :-)

0:33 xeqi: wait, you guys don't use java.awt.robot to click eclipse buttons to build?

0:34 cemerick: xeqi: I already do, but all my coordinates are going to get screwed up on the new retina displays.

0:35 I think I can use AppleScript to convert them dynamically.

0:35 "There's an API for that!"

0:35 xeqi: that only for an apple right?

0:36 technomancy: oh man come on...

0:36 clucy doesn't declare a license

0:36 cemerick: cue Raynes

0:37 Raynes: What? I have nothing to do with clucy.

0:37 cemerick: Dude, you're gettin' an Apple!

0:37 Raynes: Oh.

0:37 xeqi: 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."

0:37 I meant it.

0:37 Stop.

0:38 technomancy: but he's not within punching range

0:38 Raynes: I've got a keyboard and I know how to use it.

0:38 cemerick: Raynes: What do you want from me, I'm porting documentation from a Word doc to something sane @ 12:30am.

0:38 wingy: cool post about web dev with cljs: http://notehub.org/2012/6/16/how-notehub-is-built

0:39 hircus: Raynes: could be worse, some people refer to them as MACs

0:39 even, mind-bogglingly, in networking textbooks where you'd think they'd know better

0:40 Raynes: I take offense to it because 'an Apple' could be any number of a zillion products.

0:40 xeqi: like an apple record

0:40 Raynes: I've watched people refer to an Apple TV and a macbook pro as 'an Apple' in the same breath.

0:40 xeqi: or an actual apple

0:40 amalloy: Raynes: that's fine though, right? you can say "i'm going to the store to get a toy"

0:41 without having to be specific about exactly what toy you're referring to; it's entirely accurate and useful

0:41 Raynes: amalloy: There is no fruit that I know of that shares its name with that word.

0:41 technomancy: did Apple, Inc. ever pay out to the Beatles's company after breaking their agreement over the trademark?

0:41 Raynes: A toy is a type of product. Apple is a company.

0:42 amalloy: *shrug* an Apple is a type of product too

0:42 Raynes: Yeah, a fruit.

0:42 TheBusby: technomancy: there were a couple of lawsuits that were settled

0:42 Raynes: I think the comparison here is……. Apples to oranges.

0:42 ~rimshot

0:42 clojurebot: Badum, *tish*

0:43 technomancy: clojurebot: caruso

0:43 clojurebot: Titim gan éirí ort.

0:43 technomancy: =(

0:44 TimMc: ~suddenly

0:44 clojurebot: BOT FIGHT!!!!!111

0:53 brehaut: i think raynes just wants to show off his alabama education and correct everyone to 'A Apple'

0:56 cemerick: Moving to L.A. @ however-old-he-is. I wish I had had an Alabama education. :-P

0:57 Raynes: I think I'd be 18 at this point.

0:57 cemerick: I think I knew that.

0:57 TimMc: amalloy: Any idea what the license is on java-getopt? Trying to figure out how to license my program that uses clojopts...

0:58 Raynes: Why would you use that?

0:58 I'm actually curious, not criticizing.

0:58 TimMc: amalloy: Never mind! GPL v2.

0:58 cemerick: No 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. :-)

0:58 TimMc: Raynes: I really, really like getopt's conventions.

1:00 My project links against GPL, EPL, Apache License, and MIT License... that makes it GPL, right? I hate this stuff. >_<

1:29 Scriptor: TimMc: if what you're distributing contains compiled gpl code...I guess?

1:29 not sure about the specifics, but it's something like tha

1:43 xeqi: TimMc: java-getopt has the LGPL in the source tree as the license

1:45 so unless you're linking against another GPL project you can license it however, IANAL and all that

1:46 TheBusby: What's the name of the Clojure core function that is essentially, (take-while #(.hasNext foo) (repeatedly #(.get foo)))

1:46 sorry, 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.

2:02 mmarczyk: TheBusby: iterator-seq ?

2:03 amalloy: $findfn (.iterator (java.util.ArrayList. [1 2 3 4])) [1 2 3 4]

2:03 lazybot: [clojure.core/iterator-seq]

2:04 TheBusby: mmarczyk: er, works for the above example but not for the general case.

2:04 eck: what'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

2:04 TheBusby: I guess my brain is playing tricks on me and I may have imagined it...

2:05 amalloy: TheBusby: i'm pretty sure it works for all cases?

2:05 TheBusby: eck: doall ?

2:05 TEttinger2: eck: take

2:05 amalloy: eck: you want pr/pr-str, not print/print-str

2:05 TEttinger2: (take 5 (repeat 7))

2:06 amalloy: doall and take have no relevance to how the thing prints

2:06 TEttinger2: ,(take 5 (repeat 7))

2:06 clojurebot: (7 7 7 7 7)

2:06 eck: amalloy: thanks

2:07 pr-str seems to do the trick

2:38 devn: lol im having such a hard time ignoring this thread now that meikel starting golfing in it

2:38 ,(range 1 6 2)

2:38 clojurebot: (1 3 5)

2:38 devn: ,(map first (partition 2 2 (range 1 7)))

2:38 clojurebot: (1 3 5)

2:38 devn: (filter odd? (range 1 6))

2:38 ,(filter odd? (range 1 6))

2:38 clojurebot: (1 3 5)

2:39 devn: I wonder how many <4 function ways (1 3 5) can be produced

2:40 hiredman: ,(doc take-nth)

2:40 clojurebot: "([n coll]); Returns a lazy seq of every nth item in coll."

2:56 alexyakushev: Hello, 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:

2:56 (defmacro foo [klass]

2:56 `(defn bar [~'this]

2:56 (.method ~'this)))

2:56 But I want the call to .method be non-reflective

2:57 amalloy: (.method ~(vary-meta 'this assoc :tag class))

3:03 alexyakushev: amalloy: Thanks! But unfortunately this doesn't work:( I still get the reflection warning

3:04 I even tried to replace class arg with the real class but it doesn't eliminate the reflection too

3:12 amalloy: I'm sorry, I was hinting with the parent type instead of the right one. You solution works great, thank you!

3:12 aperiodic: aniero: 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!

3:23 alcar: could anyone recommend me some books on clojure focused on game prog? I'm a beginner in clojure but I've programmed in other languages

3:28 anyone?

3:28 clojurebot: Just 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 ..."

3:29 michaelr`: alcar: i think there no clojure books focused on game programming

3:31 antares_: alcar: I don't think any of the books focuses on games specifically and there are many subjects related to game dev

3:32 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…

3:33 alcar: ok, I'll do that

3:34 any other kind of material?

3:34 like youtube channels, wikis..?

3:34 aperiodic: alcar: this guy on github has some projects that are games in clojure/clojurescript: https://github.com/thomcc

3:35 alcar: dunno if they're any good, though ;)

3:35 antares_: 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

3:35 aperiodic: yeah, people love to kibitz, don't be afraid to ask for help

4:35 SrPx: Can you guys point me again to the place where it explained map with multiple arguments?

4:36 amalloy: ~zip

4:36 clojurebot: zip 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))

4:36 aperiodic: SrPx: http://clojuredocs.org/clojure_core/clojure.core/map is one such place

4:37 SrPx: some of the examples show usage with multiple collection arguments

4:37 SrPx: Thanks, I was looking at http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/map

5:59 mystiiq: hey, 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

6:00 borkdude: mystiiq ##(.split "hello.txt" .)

6:00 lazybot: java.lang.RuntimeException: Unable to resolve symbol: . in this context

6:00 borkdude: mystiiq ##(.split "hello.txt" \.)

6:00 lazybot: java.lang.ClassCastException: java.lang.Character cannot be cast to java.lang.String

6:00 borkdude: mystiiq ##(.split "hello.txt" ".") ;; then

6:00 lazybot: ⇒ #<String[] [Ljava.lang.String;@955cf3>

6:01 borkdude: ,(let [[f l] (.split "hello.txt" ".")] (str f "-timestamp" l))

6:01 clojurebot: "-timestamp"

6:01 borkdude: hmm no, wait up ;)

6:07 ,(count (.split "hello.txt" "."))

6:07 clojurebot: 0

6:07 borkdude: hm. something with .?

6:10 ,(let [[f l] (.split "hello.txt" "\\.")] (str f "-timestamp" "." l))

6:10 clojurebot: "hello-timestamp.txt"

6:45 mduerksen: does 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

6:56 ro_st: what do you want this integration to do, mduerksen?

7:02 mduerksen: ro_st: my ring-powered webservice wants to generate css on demand (style.less -> style.css)

7:03 ro_st: assumedly only when less files have changed?

7:03 wouldn't it be better to compile when .less files change?

7:03 reduces the request/response turnaround

7:04 in fact, our devs (and i) use auto-compilers on our dev machines and only deploy .css files (although .less is in git too)

7:05 i know that doesn't answer your question :-) sorr

7:05 y

7:05 mduerksen: well, it would suffice if the generation would happen automatically, it doesn't need to be rendered each time

7:05 but for development it would be nice if the generation would happen without any interaction

7:05 ro_st: if you're on mac, grab LESS.app

7:06 or livereload.com or one of the other great tools that handle this sort of thing

7:07 AWizzArd: Oho, Groovy 2.0 now comes with a type checker.

7:08 Natch: if you just want to regen a file when source changes and you know a bit of ruby have a look at the watchr gem

7:09 mduerksen: ro_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

7:09 ro_st: well, less is a commandline binary, so you should be able to shell out to invoke it on your .less files

7:09 these apps simply put a ui ontop of this

7:11 mduerksen: ro_st: i thought less was a .js-file which had to be invoked on node.js

7:12 ro_st: there is a js version of less

7:12 i believe there's an ix binary too

7:13 mduerksen: i don't know node.js: can i just invoke a node-script from commandline?

7:13 ro_st: someone'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

7:13 absolutely. that's the default way

7:13 mduerksen: because then i could, as you say, invoke the less compiler on build

7:14 thanks ro_st, i think thats what i needed

7:19 ro_st: hth :-)

7:32 Cheiron: Hi. why I'm getting this error every time I try to bootstrap clojurescript? http://pastie.org/4170908

8:24 zaamkablam: I just came here seeking clojure.

8:25 Right, macro questions here.

8:25 Is there a way, to know the name of the macro in its body?

8:26 C'mon, #clojure, don't let me down.

8:26 Name of the macro from within its body.

8:27 ro_st: can you do this for fns?

8:27 zaamkablam: Not that I know of, no.

8:28 ro_st: i suspect this will be the case for macros, too

8:28 zaamkablam: Yeah, I was afraid of that.

8:29 Iceland_work: zaamkablam: Write a `defmacro+' ;)

8:29 ro_st: don't take my word for it, though. i'm still a massive clojure newbie

8:29 zaamkablam: You mean, something akin to (defmacro defmacro+ [name & body] ... ?

8:29 Iceland_work: yes

8:29 zaamkablam: I'm a more massive clojure newbie. Physically and mentally.

8:30 You, sir, make sense.

8:30 Iceland_work: I once wrote a Common Lisp defun+ where the function could anaphorically access its own source code

8:30 Bronsa: zaamkablam (first &form)

8:31 ro_st: boom

8:35 zaamkablam: Oh, wow.

8:37 Bronsa: remember that &form and &env are avaiable only from within a macro though

8:40 zaamkablam: Bronsa, I seriously love you, man.

8:40 Bronsa: lol

9:00 zaamkablam: brb, checking out another client.

9:01 siscia: hi guys, does anybody know anything about Raposo (bayesian network library developed by Chas Cemerick that himself talked about during the conj 2) ???

9:01 lazybot: siscia: Oh, absolutely.

9:06 zerokarmaleft: siscia: last i talked to him about it, it's on the backburner, on account of writing his book mostly

9:07 root_: right

9:07 shit

9:09 Cheiron: Hi. why I'm getting this error every time I try to bootstrap clojurescript? http://pastie.org/4170908

9:15 siscia: zerokarmaleft: 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...

9:15 well of course i can't ask anything, so everything is waaaaay more than good

9:15 thanks though...

10:03 acheng: i have (defmulti name "doc string" :key) ... but (doc name) doesn't

10:03 show "doc string"... what did i do wrong?

10:05 borkdude: what 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:05 antares_: acheng: it does for me

10:05 borkdude: I think they usually spell it E. Max Johansson

10:06 acheng: doc is in clojure.repl, so maybe you did not run (use 'clojure.repl)?

10:07 zaamkablam: E. Klipse Oksedental must be a cripple, then...

10:08 borkdude: Nano Yakamoto

10:08 Ed …

10:09 acheng: antares_: hm. yes doc works but the doc string doesn't appear for me. and yes i did compile after writing it. sadness.

10:09 docstring shows up for my normal fns

10:09 antares_: acheng: doc will print the doc string, not return it

10:09 acheng: but not for my multimethod.

10:10 antares_: I am curious if it is one of those cases when metadata is not preserved (in the REPL)

10:11 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:14 borkdude: ,(with-out-str (doc +))

10:14 clojurebot: ""

10:14 acheng: ah. with a new repl it works as well

10:14 so you are right

10:15 thanks antares_ !

10:15 borkdude: ,(doc +)

10:15 clojurebot: "([] [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:15 borkdude: ,(with-out-str (doc +))

10:15 clojurebot: ""

10:15 borkdude: huh?

10:16 &(doc +)

10:16 lazybot: ⇒ "([] [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:16 borkdude: ,(println "foo")

10:16 clojurebot: foo

10:18 acheng: antares_: is this normal behavior for the repl (re: metadata) or is it an issue that should be fixed eventually?

10:19 antares_: 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:20 acheng: ok. i read recently about getting slimed. this feels similar. cool.

10:23 wingy: could anyone explain what this mean: ({:a 5 :b 6} :c 7)

10:23 dnolen: wingy: that code is incorrect.

10:24 borkdude: ,({:a 5 :b 6} :c 7)

10:24 clojurebot: 7

10:24 wingy: yeah but what does it mean

10:24 borkdude: wingy probably maps as fns behave as get on themselves

10:24 dnolen: wingy: data structures in Clojure are functions.

10:24 wingy: a better example is,

10:24 borkdude: wingy and get accepts a fall back argument (not found)

10:24 dnolen: ,({:a 5 :b 6} :a)

10:24 clojurebot: 5

10:25 wingy: 7 is a default value?

10:25 borkdude: ,({:a 5 :b 6} :c :lets-see)

10:25 clojurebot: :lets-see

10:25 wingy: oh yeah it makes sense

10:25 borkdude: ,(get {:a 5 :b 6} :c :lets-see)

10:25 clojurebot: :lets-see

10:25 dnolen: wingy: note that writing it that way is a short-hand for get as borkdude showed.

10:26 honestly never thought about using ({...} k default) before ...

10:26 borkdude: dnolen me neither, vectors behave like nth I believe

10:26 ,([1 2] 3 :not-found)

10:26 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: PersistentVector>

10:26 borkdude: ,(get [1 2] 3 :not-found)

10:26 clojurebot: :not-found

10:27 borkdude: dnolen is this in clojurescript the same? ;)

10:27 TimMc: xeqi: Oh hey, you're right -- that's the *L*GPL. Neato.

10:28 dnolen: borkdude: why should it be different?

10:28 borkdude: dnolen because someone forgot to implement it? I dunno

10:29 wingy: its a big diff between this channel and others i have participated in

10:29 here a lot of people care about the lang and educate a lot .. while thats not the same in other langs

10:29 borkdude: dnolen: clojurescript => ([1 2] 3 :not-found)

10:29 :not-found

10:29 wingy: or channels

10:30 dnolen: borkdude: it's the same, fn calls on data structures go through ILookup, for Vector types that goes through nth.

10:30 borkdude: dnolen apparently not...

10:30 dnolen: "that then goes trhough"

10:30 borkdude: oh heh - you're right. But nth also takes a not found param - which I guess make sense.

10:31 ,(nth [0 1 2] 4 :not-found)

10:31 clojurebot: :not-found

10:31 borkdude: dnolen ok, so hmm… then there is a subtle difference between clojure and clojurescript, maybe it should be addressed?

10:32 dnolen: borkdude: yeah I guess Clojure Vector types should implement the other ILookup arity.

10:32 nDuff: wingy: 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:33 borkdude: wingy that might be because clojure is a very lovable language

10:33 TimMc: Well, that'll teach me to read software licenses at 01:30 >_<

10:33 xeqi: TimMc: if you see GPL java stuff, and it doesn't have the "classpath exception" written somewhere it should sound alarm bells

10:34 noidi: how can I provide a constructor to a proxy?

10:34 I need to call a protected method on the base class, so I can't do it after the instance has been created

10:35 at 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:36 ah, it seems that proxy can't handle protected methods, and I'll need to use gen-class

10:37 TimMc: xeqi: Why? Wouldn't that just invoke the standard viral aspect?

10:39 xeqi: TimMc: yeah, but its very rare in java world

10:41 borkdude: dnolen 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:42 gtrak: nDuff: 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:43 foodoo: gtrak: Or teacher's just don't give homework tasks in Clojure ;)

10:44 dnolen: borkdude: send in your CA so you can open a ticket. Sounds like a simple fix.

10:44 borkdude: dnolen I still have to do it… paperwork ;)

10:44 wingy: clojure reminds me about LEGO .. and i loved it as a child

10:45 finally after 3 years of web dev im learning real programming!

10:45 borkdude: wingy Lisp in general is what made programming fun for me on the level that I liked it as a kid

10:45 wingy: oop reminds me about management work .. you think you are coding but you are not

10:45 borkdude: wingy fun level, addiction level, etc

10:45 wingy: yeah

10:45 im so addicted

10:46 borkdude: wingy great line, I tweeted it right away ;)

10:46 wingy: whats your tweet?

10:46 twitter

10:47 borkdude: @borkdude

10:55 printing 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:55 when I was a kid

10:56 and the internet didn't exist (in my world)

10:56 gfredericks: borkdude: where did one obtain free games pre-internet?

10:56 borkdude: gfredericks trading disks

10:56 gfredericks: floppies?

10:57 flippy floppies?

10:57 borkdude: gfredericks yes and also diskettes (the 3.5" ones)

10:57 gfredericks we used to have two-weekly meetings in our village (10k people), one half of the room Amiga, other half PCs

10:57 gfredericks: clojure is a nice free game

10:58 borkdude: gfredericks it was one giant software copying party...

10:58 gfredericks: borkdude: 10k is the village, not the meetings, I take it

10:58 borkdude: gfredericks yes

10:58 gfredericks but the game I played was actually free or Shareware

10:59 wingy: i remember those 3.5" .. damn our world has changed

10:59 cemerick: poor ol' Amiga

10:59 TimMc: Thank goodness we're past CDs.

10:59 They were pretty amazing, but really, really finicky.

10:59 gfredericks: thoes things were a little fragile

10:59 borkdude: it was amazing how fast viruses could spread even then, remember dealing with "Tequila", almost everyone in our neighbourhood had it :P

10:59 wingy: but now blueway is here .. i still can't get why we want that

11:00 TimMc: I received my wedding photos (14.5 GB) as a tiny flash stick in a padded envelope.

11:00 wingy: we want things over an internet connection

11:00 borkdude: wingy what is blueway?

11:00 wingy: blueray

11:01 gfredericks: blueway == cheap blueray knockoff

11:01 OR

11:01 borkdude: dnolen is clojurescript dev also a part of this Rich Hickey CA?

11:01 gfredericks: blueray for kids

11:01 borkdude: I never had a blueray disc so far

11:01 wingy: borkdude: what does CA mean?

11:02 borkdude: I don't even own a TV anymore

11:02 nDuff: wingy: contributor agreement

11:02 borkdude: wingy contributor agreement

11:02 wingy: borkdude: you just have to own an iPad ... the movies follow you wherever you are

11:02 borkdude: wingy I own a macbook air… ipad is too limited imho

11:03 wingy: yeah

11:03 * nDuff is finally starting to get excited about the generation of Android tablets in process of getting released

11:03 wingy: nDuff: why now?

11:04 nDuff: wingy: ...hardware finally hitting the kind of capability / price point ratio that interests me, basically.

11:07 Cheiron_: Hi. why I'm getting this error every time I try to bootstrap clojurescript? http://pastie.org/4170908

11:08 elliottw: anyone have a noir app running on the same server as nginx?

11:10 nDuff: elliottw: ...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:11 borkdude: can anyone tell me if clojurescript requires a separate mention on the CA in case you want to contribute?

11:11 I'm sending paper to the USA, might as well include it

11:11 elliottw: nDuff 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:12 currently noir at default runs at elliotw.com:8080

11:12 KirinDave: elliottw: If you've got a static blog, why not s3?

11:13 elliottw: KirinDave all these things are just learning experiences. i wanted to get to know *nix, hence prgmr

11:14 KirinDave: Ah

11:14 nDuff: elliottw: ...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:14 KirinDave: elliottw: I host my static blog on s3, they have this CDN thing.

11:14 michaelr`: elliottw: so what is your question? btw, what is prgmr?

11:14 KirinDave: Why not just deploy it via a self-hosted jetty?

11:14 elliottw: michaelr` sorry, prgmr is a vps

11:14 hiredman: fuh, the cool kids are on google cloud storage

11:15 KirinDave: hiredman: I switched to that from Dropbox for book and academic paper hosting

11:15 elliottw: i'm thinking of saying screw it and just deploy on heroku

11:15 KirinDave: Slap a few jetty responers up under a spread of ports via a tool like God.rb or whatever

11:15 Then use nginx on top.

11:15 That's a pretty realistic deploy for a professionally delivered product.

11:16 Increasingly .war stuff is only for very managed services.

11:16 * nDuff isn't a big fan of God.rb -- much fonder of runit, daemontools, supervisor, &c. -- but generally agrees with KirinDave here.

11:16 michaelr`: KirinDave: what is managed services?

11:16 KirinDave: michaelr`: Um, like amazon elastic beanstalk?

11:17 michaelr`: ah

11:17 KirinDave: nDuff: 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:17 michaelr`: i'm deploying my site as a war

11:18 i just copy the war file into the webapps directory

11:18 KirinDave: For all our internal endpoints, I use the uberjar-jetty approach.

11:18 nDuff: KirinDave: 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:18 KirinDave: nDuff: I use runit too.

11:18 nDuff: I just don't think it's much better than God.rb. :)

11:19 nDuff: *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:19 KirinDave: Yeah, I can see that

11:19 nDuff: Granted, that's not much of an argument for people who don't also do embedded systems. :)

11:19 KirinDave: I only use ec2 nodes these days so there is plenty of room for a carefully written god instance.

11:20 hiredman: war+jetty-runner is very nice

11:20 * nDuff has done the runit-as-init thing a few times (as opposed to the layering-on-SysV-init thing). Makes for a very clean and orderly process tree.

11:20 elliottw: wow, thanks guys, looks like i have a lot of learning to do

11:21 hhutch: done't forget you can always manage a war+jetty deployment with palletops.com

11:21 wingy: set is just an ordered vector?

11:21 KirinDave: Is there some advantage to a .war over just having an uberjar?

11:21 elliottw: i've never "deployed" anything, just started learning clojure a month ago, and learning this whole server thing a month ago too… crazy

11:21 wingy: or a vector with unique values i mean

11:21 KirinDave: elliottw: Yeah it's a steep learning curve.

11:22 elliottw: KirinDave would you suggest i stick to something like heroku until i know what the h i'm doing?

11:22 KirinDave: elliottw: Hah, never.

11:22 Challenge yourself.

11:22 elliottw: lol, 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:22 KirinDave: Not even 1/10th.

11:22 elliottw: KirinDave why no heroku?

11:23 KirinDave true

11:23 KirinDave: elliottw: Don't get me wrong, technomancy is doing great work there.

11:23 I just think you'll get a lot more learning opportunities by standing up your own server from scratch in a cloud service.

11:23 elliottw: KirinDave technomancy is working to clojure up on heroku?

11:23 KirinDave: Pretty sure that's the case.

11:24 elliottw: seems like i could get my very first app up today w heroku, next week if i go another roll my own route

11:24 KirinDave: Yep

11:24 wingy: depends on what he wanna do .. launch an app or learning how to manage cloud infractructure

11:24 KirinDave: Probably true.

11:24 And wingy has it dead on.

11:24 And you could always do both.

11:25 wingy: if the former, just git push it to heroku

11:25 gtrak: meh, server admin is an unfulfilling PITA

11:25 KirinDave: gtrak: #devops man. Ain't nobody who can do it like you.

11:25 hhutch: gtrak: wow, i couldn't disagree more

11:25 KirinDave: That said, I loathe working with chef.

11:25 Effing loathe that software.

11:25 The Worst Software.

11:25 hhutch: KirinDave: pallet!

11:25 gtrak: maybe it's just me :-)

11:25 KirinDave: hhutch: I work in a chef organization.

11:26 wingy: also if he wanna be developer or sysadmin .. if the former . just git push

11:26 KirinDave: I'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:26 wingy: What is the difference?

11:26 A "developer" is just someone who doesn't like delivering products. A sysadmin is someone who doesn't like making them.

11:26 hhutch: i've never worked in a place where i didn't do alot of both administrative work and development

11:26 KirinDave: These days, you may have to do things from start to finish.

11:27 Esp with cloud services.

11:27 cemerick: elliottw: Don't burn yourself doing/learning things that you aren't necessarily interested in.

11:27 KirinDave: Part of what distributed software is, is resource management.

11:27 cemerick: Good way to burn out on the whole effort.

11:27 elliottw: thanks cemerick

11:27 KirinDave: elliottw: Cemerick espouses a path of weakness. Get huge. :)

11:27 elliottw: i don't want to burn out

11:27 cemerick: There's always next week, or next month. :-)

11:27 elliottw: KirinDave lol

11:27 wingy: KirinDave: agreed .. why you have to learn to leverage existing tools letting you do more with less

11:27 gtrak: hhutch: when I was in college I didn't mind messing around so much, now, time is more scarce.

11:28 hhutch: gtrak: right, but that's why you get more effecient

11:28 KirinDave: Cuz like, being a full-time software engineer is as much about problem solving, research, and troubleshooting as it is about writing code.

11:28 elliottw: gtrak yeah, i gotta still make a living. it took me half a day just for vps, install ubuntu, install jvm, clojure, etc etc

11:28 wingy: people cant make your app for you .. they can host/load balance/proxy it etc

11:28 imo you should let them and care about your domain .. the app

11:28 KirinDave: elliottw: Well that's not bad for a beginner.

11:28 gtrak: elliottw: and you'll do it a slightly different way each time... and forget how you did it

11:28 KirinDave: elliottw: Not bad at all, actually.

11:29 elliottw: and i LOVE clojure. i do not love sysadmin

11:29 hhutch: wingy: i disagree with that sentiment... all those things you listed, they are part of the deployed app

11:29 cmiles74: Certainly 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:29 hhutch: they're just libraries/resouces

11:29 wingy: they handle deployment .. you handle development

11:29 KirinDave: Well I guess I have the unfortunate situation of working with systems that no one else would ever manage for me

11:29 Like custom kafka->storm solutions.

11:30 Where do I click to get a zookeeper server in heroku? :)

11:30 elliottw: my main concern with things like heroku is that the knowledge is not portable

11:30 hhutch: elliottw: heroku is fairly standard for basic deployments

11:30 elliottw: when/if i go to my own server, all that proprietary stuff would be a waste won't it?

11:30 wingy: you use it when you can .. heroku wasnt here 5 years ago

11:30 gtrak: elliottw: it takes like 20 minutes to deploy a clojure app to heroku... the non-portable knowledge isn't substantial

11:30 cemerick: hiredman: That's the second time in as many days I've seen someone independently validate your startup idea. :-P

11:30 wingy: but time changes

11:30 cmiles74: I 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:30 elliottw: hhutch i mean if i deploy on a vps, it should be really close to deploying on my own server one day

11:31 Hodapp: KirinDave: 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:31 hiredman: cemerick: look, everyone needs a zookeeper cluster

11:31 elliottw: gtrak touche

11:31 KirinDave: cmiles74: But a jar is just an executable with 2 words before it on the shell tolaucnh. :)

11:31 hiredman: how else are you supposed to run the unit tests for avout

11:31 KirinDave: hiredman: People doing boring things don't need a zookeeper cluster.

11:31 hhutch: elliottw: 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:31 cemerick: hiredman: you could do it all lean and stuff, and handle requests on a single server with a shell script to validate demand.

11:32 KirinDave: But the minute you do anything interesting in the distributed space, not using it is crazy unless you're working with erlang.

11:32 If only because distributed process coordination is made so much easier by zookeeper.

11:32 All these ruby asses using Resque and Redis timeout locks like that solves the problem. :\

11:32 Wild_Cat: is 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:33 KirinDave: Wild_Cat: https://github.com/dakrone/clj-http/

11:33 cmiles74: I'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:33 KirinDave: Clojure has it so much better than other jvm languages

11:33 cmiles74: Er, IMHO Vagrant + Virtualbox are closely tied; it's worth looking at.

11:33 KirinDave: Working directly with apache's lib is pure pain.

11:34 Wild_Cat: KirinDave: perfect. Looks like exactly what I need.

11:34 KirinDave: Scala has this incredibly goofy Databinder Dispatch library which even the author admits is terrible

11:34 elliottw: i 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:35 KirinDave: elliottw: Honestly it sounds like you've done the hard part of server provisioning.

11:35 That first mile is always the most irritating.

11:35 It'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:36 elliottw: this 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:36 KirinDave: My goal is to make an eventually consistent low-cost version of hackernews in clojure, using kafka and amazondynamodb

11:36 Gonna try and raise money for adainitiative an the anita borg institute.

11:37 elliottw: KirinDave 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:37 … yet

11:38 KirinDave: I dunno if I will productize it.

11:39 It'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:39 wingy: are you guys using jQuery or Google Closure on frontend for DOM interactions?

11:39 elliottw: i hope none of you guys are yc fans, but i find that they are huge dbs a lot of the time

11:40 KirinDave: wingy: Next month we should have clojurescript derived javascript on some of our frontend stuff deployed.

11:40 It's in testing now

11:41 wingy: KirinDave: what does "clojurescript derived javascript on some of our frontend stuff deployed" mean?

11:41 besides clj my eng is not that excellent :)

11:43 you mean you will have DOM manipulation built into cljs?

11:45 gtrak: Is there a way to call a specific protocol implementation's method manually without going through the dispatch?

11:47 mmarczyk: dnolen: cljs-324 applies on top of cljs-328.

11:47 dnolen: mmarczyk: ok, thx

11:48 gtrak: on Clojure JVM?

11:48 gtrak: ya

11:48 dnolen: gtrak: why would you want to do that?

11:48 gtrak: I can work around it, but just curious :-)

11:48 to save me a step from refactoring the implementation into its own function

11:50 generally, to decomplect the logic from the arg-type

11:51 dnolen: gtrak: I can't imagine the refactoring taking very much time, since protocol implementations look like regular functions. Just remove the field accesses right?

11:51 gtrak: yea

11:51 pretty trivial actually

11:53 wingy: are 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:53 it seems much easier to get something by having something to look at than reading texts

11:54 borkdude: dnolen 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:54 dnolen but now I already sent it ;)

11:57 michaelbarton: Could anyone tell me what I am doing wrong here? https://gist.github.com/a4d619e035725b8160ca

11:58 llasram: clojurebot: contrib

11:58 clojurebot: Monolithic 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:58 michaelbarton: I get this error: ava.io.FileNotFoundException: Could not locate clojure/contrib/string__init.class

11:59 jweiss: (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:59 michaelbarton: I am using leiningen

11:59 llasram: 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

11:59 zerokarmaleft: michaelbarton: very useful to bookmark that link if you're working off of clojure 1.2 examples

11:59 llasram: >=1.3 even

11:59 dnolen: borkdude: I don't think specifying the projects matters much.

11:59 borkdude: dnolen great

12:00 michaelbarton: I have run lein deps

12:04 llasram: michaelbarton: The particular error you're getting is because clojure-contrib 1.1.0 doesn't include the clojure.contrib.string namespace

12:04 Oh, oh well

12:05 michaelbarton: I think I just got disconnected

12:05 I

12:05 I'

12:06 llasram: To 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:06 oops

12:06 To 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:07 michaelbarton: I see

12:07 Thank you

12:07 llasram: BUT

12:07 clojure-contrib does not work with clojure >=1.3

12:08 Whatever source of example you're using is out-dated

12:08 michaelbarton: I see

12:08 I think the example I copied is at the top of the page here - http://richhickey.github.com/clojure-contrib/string-api.html

12:08 lazybot: Nooooo, 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:08 llasram: hah

12:09 Closer, lazybot!

12:09 michaelbarton: I think Rich Hickey's GH repo is the top hit on google for clojure contrib string. For me at least anyway

12:09 dnolen: mmarczyk: patches applied! thx!

12:09 michaelbarton: But then I guess I'm writing the wrong query!

12:10 llasram: michaelbarton: What led you you to be searching for "clojure contrib string"?

12:10 mmarczyk: dnolen: great, thx!

12:10 cmiles74: michaelbarton Indeed, it is.

12:10 llasram: michaelbarton: Here's my recommendation: http://clojuredocs.org/clojure_core/clojure.string

12:11 michaelbarton: Not 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:11 llasram: Hmm. Although clojuredocs appears to need an update for 1.4...

12:12 michaelbarton: So I should avoid clojure contrib from now on?

12:13 llasram: michaelbarton: 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:13 michaelbarton: Good to know, thank you.

12:13 llasram: Well, sans some parts which have been abandoned

12:14 technomancy: deprecation: it's good for the soul

12:14 and probably the colon too

12:15 llasram: You can't spell ^:deprecated without a colon!

12:15 michaelbarton: http://clojuredocs.org/ has a link to clojure.contrib, are these depreciated libraries?

12:16 raek: michaelbarton: yes

12:16 TimMc: llasram: Quite the catch-22.

12:16 michaelbarton: OK

12:16 llasram: michaelbarton: They work if you're using Clojure 1.2, but not for later versions

12:16 michaelbarton: That's a little confusing for a beginner like me.

12:17 bsteuber: I'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:24 gfredericks: is there a lot of data structure speedup between the current cljs that lein-cljsbuild uses and cljs-HEAD?

12:28 dnolen: gfredericks: no, I think lein-cljsbuild is fairly up to date now.

12:28 gfredericks: k

12:28 maybe I should use a deftype for complex numbers instead of a [r i] vector

12:29 that could simplify the rect <-> polar logic as well

12:30 dnolen: gfredericks: representing types with vectors rarely recommended.

12:31 gfredericks: dnolen: good advice; thx

12:31 tbaldridge: dnolan: 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:32 I 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:33 dnolen: tbaldridge: Clojure fns are well partitioned against the existing protocols / interfaces. That thread is what I would call an "opinion-fest"

12:33 technomancy: I would guess it's the same reason contains? hasn't been renamed.

12:33 hiredman: ,(+ 68 79)

12:33 clojurebot: 147

12:33 goodieboy: if 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:33 technomancy: it's a trap designed to trick newbies into thinking about big-o notation

12:34 TimMc: clojurebot: contains? is a trap designed to trick newbies into thinking about big-O notation

12:34 clojurebot: In Ordnung

12:34 dnolen: tbaldridge: newcomers are going to know the protocol/interface partitioning so they focus on names and "speed".

12:34 are not goign to know.

12:35 TimMc: I'm surprised last is even provided, given how some inclusion decisions seem to have been made.

12:36 dnolen: TimMc: that makes no sense. You might have a sequence and you might need to get the last item.

12:37 TimMc: THen you're using the wrong data structure. :-P

12:37 gfredericks: goodieboy: no I think it gets compiled at read-time

12:37 dnolen: TimMc: is Clojure source represented with vectors? or seqs?

12:37 gfredericks: goodieboy: into a java pattern object

12:38 goodieboy: gfredericks: oh really? ok, so no sense in putting it into a def for improved performance?

12:38 gfredericks: goodieboy: I don't know for sure, but I seriously doubt it.

12:38 goodieboy: gfredericks: ok thanks, good to know

12:38 gfredericks: goodieboy: I'm assuming it's a regex literal and not something thrown together at runtime

12:38 konr: Are there other graph libraries besides clojure.contrib.graph? It seems that it pressuposes I already have constructed a graph.

12:39 goodieboy: gfredericks: yes, something like #"[0-9]+" etc.

12:39 tbaldridge: dnolan: thanks that helps. I knew I was missing something. I will now sit and ponder this until enlightened.

12:40 TimMc: dnolen: (I know, just idly playing devil's advocate.)

12:41 tbaldridge: what 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:41 uvtc: Didn'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:41 tbaldridge: and that syntax was crap, but you get the idea

12:42 brainproxy: konr: what kind of graphs are you wanting to construct?

12:43 konr: brainproxy: simple, undirected; maybe with some weight in the edges

12:45 brainproxy: konr: 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:46 whoops, clj-orient: https://github.com/eduardoejp/clj-orient

12:47 konr: thanks, brainproxy!

12:47 * nDuff tries to figure out the feasibility of using cljs for building javascript for use in Atlassian plugins (which really comes down to determining the feasibility of Google's Closure Compiler for same).

12:48 nDuff: ...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:50 brainproxy: nDuff: 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:09 dakrone: so 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:09 and opening an issue on the project if it doesn't work

13:15 uvtc: s/awy/way/

13:15 (sorry, wrong window)

13:18 justdit: sorry to ask, but couldn't find any working library for oauth. clj-oauth seems not working with clojure > 1.2

13:19 technomancy: justdit: for simple use cases just clj-http is plenty

13:19 you can authenticate against github's oauth implementation in ~7LOC

13:20 justdit: technomancy: yep, it's the only solution I've for now

13:21 duck11231: justdit: are you sure? I was using clj-oauth with 1.3 the other day and it worked fine for me.

13:22 I was using "1.3.1-SNAPSHOT" if it makes any difference

13:42 notbrent: could 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:51 RickInGA: notbrent: have you looked at the documentation at webnoir.org

13:52 technomancy: clojars is a mid-sized real-world clojure web app

13:52 RickInGA: notbrent: at the bottom of http://webnoir.org/tutorials there is a link to a sample blog built with noir

13:52 technomancy: it's compojure, but compojure is awesome

14:02 borkdude: is 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:03 technomancy: (comp first list)?

14:03 TimMc: borkdude: Sample input and output?

14:03 Oh, misread as "left to right".

14:03 borkdude: TimMc for example in use with merg-with

14:04 TimMc: In that case I'd prefer the inline fn: (fn [old new] new)

14:05 With well-named args, you don't have to remember argument order.

14:07 borkdude: I might be mistaking but I remember from lambda calculus these functions had standard names like left and right

14:08 can't find it through google though

14:09 wingy: i 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:09 since everything is stored in memory and it's persistent between shut downs

14:13 nDuff: wingy: 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:13 technomancy: borkdude: in SKI calc each fn only has one arg, so some of those notions don't apply

14:14 but that's basically what comping list onto it does; it makes it so there's only one arg

14:14 wingy: nDuff: 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:14 borkdude: technomancy yes: (lambda x (lambda y x)) and (lambda x (lambda y y))

14:14 wingy: filter .. map .. find etc

14:14 ldopa: borkdude: http://en.wikipedia.org/wiki/Church_encoding#Church_booleans

14:14 wingy: nDuff: isnt that correct?

14:14 nDuff: wingy: Doesn't address the problem of distributed systems.

14:15 wingy: nDuff: ok lets go to the extreme case

14:15 its not only persistent memory, but infitite in size

14:15 nDuff: ...which still doesn't address synchronization issues.

14:15 Doesn't matter if you can afford to store a copy of everything everywhere

14:15 borkdude: ldopa ah that's it, the true and false "values as functions"

14:16 wingy: one computer to host your database .. like the only memory you have (like every person only has one memory)

14:16 but replicated for backup

14:16 nDuff: wingy: Asynchronous replication still leaves you with the exact same synchronization issues.

14:16 wingy: nDuff: that would make things simpler than today?

14:16 nDuff: but there is no synchronyzation .. everything is in one space

14:17 nDuff: wingy: Synchronous replication means... that you need to decide on the tradeoffs you're going to take to have it in the first place.

14:17 *sigh*.

14:17 wingy: ...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:17 wingy: The problems don't go away.

14:17 technomancy: wingy: this might be relevant: http://en.wikipedia.org/wiki/Fallacies_of_Distributed_Computing

14:18 wingy: right

14:18 i was just thinking about using clojure functions to query data

14:18 nDuff: Datomic is actually a pretty big deal along those lines

14:18 wingy: if those could be persistent .. why have another query lang

14:18 nDuff: but it doesn't "get rid of databases"

14:18 shawnlewis: persistence isn't related to the query language

14:19 nDuff: *nodnod*.

14:19 shawnlewis: you could have an on disk database that you query with map, filter etc

14:19 kmicu: "get rid of databases" ;]

14:19 shawnlewis: I should say disk-backed rather than on disk

14:20 nDuff: ...though having the query language be amenable to optimization is a rather big thing.

14:20 hence folks writing code in imperative programming languages using declarative query languages.

14:20 borkdude: using clojure reducers would be useful there too: less intermediate results

14:21 I guess..

14:22 cgag: i need to read more about reducers, i had trouble wrapping my head around them the first time i read the announcement

14:23 amalloy: cgag: the general thrust is that as long as your end-goal is a reduce, you don't need laziness in the middle

14:24 (reduce + 0 (map inc coll)) could be written as (reduce (fn [acc x] (+ acc (inc x))) 0 coll)

14:24 wingy: when 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:25 amalloy: and the reducer framework provides versions of lazy functions like map that instead of producing a lazy sequence just transform your reduce function

14:25 wingy: db -(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:26 borkdude: amalloy nice summry

14:30 cgag: is doing that reduction over the lazy-seq significantly slower than using that alternative?

14:34 amalloy: yes

14:34 cgag: that's a good summary though, I'll go reread hickey's post with that in mind

14:36 borkdude: we 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:37 the one with jsr166y.ForkJoinPool.

14:37 amalloy: borkdude: you can't use fold

14:37 borkdude: amalloy will it throw errors, or what?

14:38 amalloy: probably

14:38 borkdude: amalloy we tried running with and without, we thought we saw some performance difference, but no erros

14:38 erros

14:38 errors (grr)

14:38 amalloy I didn't know if we used fold though, I think just mapping and reduce

14:38 amalloy: you didn't use fold, then

14:39 borkdude: amalloy so the difference we have seen must be co-incidence?

14:40 amalloy: yes

14:40 well, maybe not

14:40 there might be some operations that implicitly use fold if possible, but i don't think so

14:41 borkdude: amalloy mapping -> map from reducers I mean

14:44 cemerick I would love to know what that tweet about lifestyle business is about ;)

14:50 cemerick: borkdude: Just another typical holier-than-thou revenue-less startupper pissing on someone's profitable life's work.

14:52 qubit[01]: well now I want to read it

14:52 cemerick: I probably shouldn't bother reacting…but I hate seeing people chasing the lottery for the wrong reasons.

14:53 technomancy: cemerick: never hate, only ever destroy

14:53 =)

14:53 cmiles74: I'm sure their startup project is incredibly clever and original. Surely not something like another top news site or grocery list manager.

14:54 cemerick: technomancy: Working on it. :-) In the meantime, I'm a weak, weak person.

14:54 The Twitter snark slurry calls with its siren song, etc.

14:54 TimMc: "It's like Bitcoin meets ZocDoc."

14:54 http://nonstartr.com/

14:56 cemerick: TimMc: Oh, sweet.

14:58 cgag: It's like Klout, but for self-proclaimed social media experts.

14:58 this thing is great

14:58 cmiles74: "It's like Fliboard meets Chatroulette" See, I know that could work. :P

14:59 TimMc: Half joke, half useful? :-P

15:04 amalloy: wait, when did (= 1 1.0) become false? 1.4?

15:05 hiredman: 1.3 I would expect

15:06 (since that is lame, and 1.3 is lame)

15:06 dnolen: 1.3

15:09 dustingetz: clojure 1.3 has clojure.contrib.map-utils/deep-merge-with

15:09 how can i get that in clojure 1.4

15:09 i'm having trouble googling for this, maybe it didn't get ported, how can i find the answer to that myself

15:09 and should i be re-implementing this?

15:11 separate 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:11 is there an api for this, or do i need to do it myself

15:14 * nDuff doesn't quite grok the distinction between what dustingetz wants and what deep-merge-with provides.

15:17 gtrak: hey guys, just curious, where in the source do these get implemented: static public interface OODD{double invokePrim(Object arg0, Object arg1, double arg2);}


15:18 amalloy: gtrak: (defn f ^double [x y ^double z] ...)

15:19 gtrak: ah.. hmm, codegen?

15:22 ah, found it: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#5176

15:22 dustingetz: it might be (deep-merge-with merge map1 map2)

15:24 seems to work

15:24 so, how can i get access to deep-merge-with (defined in 1.3 clojure.contrib.map-utils) in clojure 1.4

15:24 i'm about to just copy paste it from the clojure.contrib source

15:26 technomancy: cemerick: oh, for the record "never hate, only ever destroy" wasn't chastising you, it was quoting a blog post

15:26 http://gilesbowkett.blogspot.com/2008/05/never-hate-only-ever-destroy.html

15:26 cemerick: technomancy: Yup, I know. :-)

15:27 technomancy: I realized that could have come across wrong

15:27 cemerick: It's probably his best piece of work.

15:27 technomancy: agreed

15:27 timvisher_: technomancy: so there's definitely something about the mac that makes swank.cdt work for lein2

15:27 just tried it again under windows and it's still broke…

15:27 same version and everything

15:28 cemerick: Funnily enough, I think he has me blocked.

15:30 technomancy: timvisher_: hm; apple cleaning up after oracle's messes? that'd be a pleasant role reversal.

15:30 cemerick: from what I gather he's a bit of an unstable personality

15:31 timvisher_: technomancy: for reelz

15:31 xeqi: technomancy timvisher_: https://maven.apache.org/general.html#tools-jar-dependency

15:31 looks like its included on the runtime already for osx

15:31 *the classes are

15:32 timvisher_: xeqi: well looky there…

15:32 technomancy: xeqi: makes me wonder how good of an idea auto-activated profiles based on JDK version or OS would be

15:35 timvisher_: what do the scope and systemPath elements do?

15:35 can i configure those in leiningen?

15:36 i do have tools.jar in my filesystem

15:36 xeqi: timvisher_: you can add a scope in lein, but I don't think it affects anything

15:37 there is no systemPath equivalent

15:37 timvisher_: nor, apparently, does tools.jar exist in central either, so that won't help me :(

15:37 manually add it to the classpath?

15:38 xeqi: in 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:39 you could try to add it to the classpath, though lein2 does not have an "official" way to do so

15:41 timvisher_: xeqi: know how to do it unofficialy?

15:43 xeqi: hmm, theres a mailing list thread where technomancy mentions adding it to :resoure-paths *might* work

15:44 though you wouldn't want to jar/uberjar it like that

15:45 timvisher_: i'm more interested in seeing if that resolves the problem

15:45 i just really badly want cdt to work right now

15:46 kovasb_: the locals clearing issue makes it not worth it for me personally...

15:57 timvisher_: kovasb_: was that in reference to cdt?

15:58 kovasb_: yup

15:58 timvisher_: care to explain?

15:58 i'm still trying to try out cdt, so any negative opinions would be helpful

15:58 kovasb_: have you heard of the locals clearing problem?

15:59 looks like it might have been fixed in 1.4

15:59 * nDuff thought 1.4 made that optional

15:59 timvisher_: i had not

16:00 kovasb_: the problem was you couldn't actually see the values of your "variables" when you stepped through the program

16:00 nDuff: (clearing locals is desirable in some cases -- not doing so can lead to lazy sequences' heads being held onto unnecessarily -> memory leaks)

16:00 kovasb_: right

16:00 timvisher_: ah

16:00 when i've gotten it working on my mac, the locals were visible just fine

16:00 kovasb_: the idea is to change the behavior for development purposes. hence the compiler flag

16:00 timvisher_: except in some cases, like in java files etc

16:01 nDuff: timvisher: the question is whether they're still visible after the last time when they can potentially be referenced

16:01 kovasb_: when i was playing around with it last year it was killing me

16:01 timvisher_: i understood it be somewhat non-deterministic

16:01 nDuff: understood

16:02 kovasb_: are you using it in emacs?

16:02 timvisher_: yes

16:03 PeregrinePDX: Ah a productive day at work. Setting up a clojure development environment and showing some things off to co-workers.

16:04 timvisher_: PeregrinePDX: did it go well? ^_^

16:04 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:04 PeregrinePDX: Well other then I am pretty new to clojure and wasn't able to give answers to everything. It went ok.

16:05 We had some fun playing around with Overtone despite the fact that it's completely unrelated to work.

16:11 Hodapp: PeregrinePDX: Overtone does look interesting.

16:12 Too bad I'm music-tarded.

16:12 timvisher_: ,(long 7)

16:12 clojurebot: 7

16:12 timvisher_: is that a boxed long?

16:12 or a `long`

16:15 amalloy: both, depending on context

16:15 timvisher_: cool

16:15 Gnosis-: amalloy: am I correct in thinking that it doesn't matter, because it's immutable in Clojure?

16:16 amalloy: i don't see how that's relevant

16:16 Gnosis-: okay

16:17 amalloy: i think it usually doesn't matter because clojure is dynamically typed, but on occasion (eg for performance reasons) it matters

16:17 gfredericks: have there been any languages with mutable numbers?

16:17 amalloy: yes

16:17 cgag: i'm sure i've read about that

16:18 redefining the value of 2

16:18 technomancy: gfredericks: can't you reopen Fixnum eigenclasses in ruby?

16:18 gfredericks: technomancy: Fixnums have a single-word representation I think

16:18 duck11231: 2 = 2.5 ;; that way my radiohead test passes

16:18 gfredericks: and so almost certainly are copied by value

16:18 amalloy: clojure/java have mutable Integer objects if you hack them with reflection

16:19 gfredericks: technomancy: "no virtual class for Fixnum"

16:19 hiredman: which, since auto boxed numbers are cached, is a Really Bad Idea(tm)

16:19 amalloy: indeed

16:19 wingy: wow .. free versioning of data for free

16:19 there is free lunch!

16:20 technomancy: gfredericks: you can redefine + on Fixnum though

16:21 qubit[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:21 gfredericks: technomancy: sure, at the class level; that's not stored per-number

16:22 wingy: nDuff: ok so if the only server is down, then it's down .. no more keeping things in sync

16:22 nDuff: kinda like if i die, then i die

16:22 nDuff: wouldn't that be better than having sync issues

16:24 nDuff: wingy: 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:24 ("the only server"? Heh.)

16:25 TimMc: amalloy: Huh, wallhacks can remove "final"?

16:25 hiredman: final gets no love

16:25 wingy: lucky me im not a real programmer :) .. i so hate duplicated functionalities

16:26 technomancy: wingy: 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:26 * nDuff 's n-2 employer had 7 datacenters worldwide with over 1000 servers in the larger ones, all as part of a single SaaS product. And a team of two people, of which he was one, writing the deployment automation for same.

16:26 hiredman: http://www.azulsystems.com/blog/cliff/2011-10-27-final-fields-part-2

16:26 wingy: aight

16:27 nDuff: that was cool

16:27 qubit[01]: this book has #(catt (dec n )) , but hasn't explained what # does, whats that called ?

16:27 TimMc: function literal syntax

16:28 &'#(+ % 5)

16:28 lazybot: ⇒ (fn* [p1__14540#] (+ p1__14540# 5))

16:28 cgag: ,(#(* % %) 5)

16:28 clojurebot: 25

16:34 nDuff: wingy: ...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:35 qubit[01]: ,(#(* %1 %2) 5 20 )

16:35 clojurebot: 100

16:38 gfredericks: qubit[01]: it's the #(...) syntax specifically, not just "#"; the "#" plays several different syntactic roles

16:39 qubit[01]: hmm

16:40 hiredman: # means "use the other dispatch table in the reader"

16:40 TimMc: qubit[01]: # tells the reader to do something different with what follows.

16:40 gfredericks: qubit[01]: clojure.org/reader

16:40 hiredman: so the normal dispatch table in the reader sees { and reads a map, the other dispatch table sees { and reads a set

16:41 so { starts a map and #{ starts a set

16:41 in the normal dispatch table ( starts a list, in the other dispatch table ( starts a function literal

16:41 so ( starts a list and #( starts a function literla

16:41 Gnosis-: how compatible are the JVM, CLR, and JS versions of Clojure?

16:41 hiredman: literal

16:42 barely?

16:42 TimMc: Gnosis-: I'm sure (+ 1 2) will work the same way in all of them. :-P

16:42 gfredericks: TimMc: not really

16:42 considering numeric types

16:42 TimMc: haha

16:42 hiredman: clojurescript doesn't have vars

16:43 Gnosis-: that does not sound good. what about compatibility with concurrency and lazyseqs?

16:43 hiredman: clojureclr has to deal with clr types, and not erased generics

16:43 gfredericks: Gnosis-: cljs has little need for concurrency. but it does have atoms

16:43 does it have agents?

16:43 hiredman: and the jvm types that you use in clojure are not available in ither of the others

16:43 gfredericks: I wanted future the other day but it didn't have it

16:43 wingy: nDuff: 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:43 hiredman: javascript doesn't have threads

16:43 qubit[01]: hiredman, ok :)

16:44 TimMc: gfredericks: No blocking.

16:44 hiredman: futures and agents run on threads

16:44 ivan: browsers have Worker and SharedWorker

16:44 too bad they're more like Erlang processes

16:45 hiredman: trivial programs, or highly algorithmic programs (no i/o, no concurrency, etc) may port

16:45 Gnosis-: ah, okay. what about only between JVM and CLR?

16:46 hiredman: the same really

16:46 Gnosis-: oh :(

16:46 ivan: CLR has no leiningen

16:46 hiredman: well, you might be able to get away with more

16:46 gfredericks: TimMc: oh right

16:46 TimMc: so I wanted defer then :)

16:47 wingy: nDuff: im just day dreaming about a transparent way of working with data where db specific lang doesn't matter

16:47 gfredericks: why doesn't clojure have defer?

16:47 hiredman: what is defer?

16:47 ,(doc delay)

16:47 clojurebot: "([& 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:48 hiredman: ,(doc promise)

16:48 clojurebot: "([]); 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:48 hiredman: ,(doc future)

16:48 clojurebot: "([& 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:48 gfredericks: hiredman: a future where you don't care about the return value

16:48 hiredman: must be one of those 3

16:48 gfredericks: future-for-side-effects

16:48 hiredman: gfredericks: that is just future

16:48 Raynes: gfredericks: That's a thread, right?

16:48 Well, not really.

16:48 If you don't get the return value of a future, you don't even see exceptions.

16:48 gfredericks: hiredman: but delay is useful in CLJS, while bringing in future by name would be a bit weird

16:49 which I assume is why it hasn't been done

16:49 nDuff: wingy: 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:49 hiredman: js is just so horrible, as a language and a runtime

16:50 gfredericks: I'll not argue with that

16:50 nDuff: wingy: ...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:50 wingy: i guess

16:51 oh its rich hickeys

16:55 ordnungswidrig: does anybody know about functional lenses for clojure? I know that for maps there is update-in and get-in.

16:58 gfredericks: assoc-in as well

16:59 wingy: nDuff: in the datomic video, by apps he means my backend server in clojure?

16:59 gfredericks: ,(apropos "-in")

16:59 clojurebot: (unchecked-inc-int gen-interface get-in with-in-str ns-interns ...)

17:00 Scorchin: How are people doing integration testing of web apps (compojure) with their full stack? E.g. running server, loading pages, making javascript calls, etc.

17:00 Cheiron: Hi, why I'm getting this error when trying to bootstrap ClojureScript? http://pastie.org/4170908

17:00 technomancy: Scorchin: take a look at what clojars uses; it's pretty great but the name escapes me at present

17:00 xeqi wrote it

17:01 Scorchin: technomancy: thanks!

17:02 technomancy: 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:03 technomancy: I don't know anything about JS, sorry

17:04 xeqi: Scorchin: I've got a couple libraries for staying in ring, no server up/js testing

17:04 kerodon could still use some work, but the basics are there

17:04 theres clj-webdriver for full stack stuff

17:04 wingy: Scorchin: i would keep all source files for a project within the same repo

17:04 xeqi: which could load something like jasmine for js unit testing

17:05 Scorchin: xeqi: thank you

17:05 wingy: but the question is, what directory?

17:06 wingy: 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:07 wingy: sorry cant give any advices on that .. very new to clojure

17:07 Scorchin: To 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:07 wingy: so JS is for the client?

17:07 how about /server/..

17:07 /client/..

17:07 Scorchin: yup

17:07 no, the server is written in Clojure

17:08 wingy: dont mix different langs/tools in root

17:08 yeah thats what im saying .. perhaps keeping clojure things in /server/ and js things in /client/

17:08 or clojure things in root/

17:08 and there you have root/client/

17:09 where root is the root for your project /

17:09 Scorchin: hmmm, true

17:09 wingy: simple .. makes sense

17:09 ive done that in other projects

17:13 i dont know about splitting them up .. the server usually serves the client stuff .. i would have it in one repo

17:14 but im coming from node.js where this is pretty standard .. the js back and front is kinda tied together

17:26 adu: how do I add a key-value pair to a hash-map?

17:27 gtrak: adu: assoc

17:27 adu: thanks

17:30 goodieboy: is it possible to use gen-class, to define nested classes, and then refer to the nested class in a parent class method?

17:32 amalloy: just write java, man

17:35 gfredericks: assemble strings of java source and then shell out to javac

17:35 hiredman: just don't write nested classes

17:35 inner classes are a figment of the java language, the jvm doesn't care

17:36 goodieboy: thanks!

17:37 gfredericks: hiredman: I guess that means there would be no reason whatsoever for clojure to support it, even if we all thought they were fantastic?

17:37 wingy: rich is really a genious .. cool perspectives

17:37 makes me wanna use datomic asap

17:38 hiredman: gfredericks: correct

17:38 aperiodic: gfredericks: 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:39 hiredman: aperiodic: how does hadoop require you to use inner classes?

17:40 I am pretty sure that is not enforcable

17:40 technomancy: rlb: I heard wheezy was going into a freeze tomorrow (!)

17:41 rlb: I'm building as we speak ;>

17:41 technomancy: godspeed

17:41 rlb: Had a couple more problems I had to fix.

17:41 But I think we may be OK now.

17:42 aperiodic: hiredman: it appears to require static enum in the class you give to hadoop

17:42 hiredman: :|

17:42 goodieboy: in a class that extends another (via gen-class) ... how do you call the super method?

17:42 hiredman: and uses reflection to find it

17:42 ugh, that is horrible

17:42 aperiodic: like i said, hadoop sucks

17:43 it's very capable, but it sucks in so many ways

17:44 gfredericks: convincing a generation of devs that OOP is a good idea has some very weird results

17:45 aperiodic: goodieboy: 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:45 goodieboy: aperiodic: cool thanks!

17:58 atoi: Ahh, good, there is a clojure room. I figured there would be. :)

18:05 adu: why does noir use an old version of hiccup?

18:06 Raynes: adu: It does?

18:11 gfredericks: deftype in cljs does not generate factory functions?

18:11 adu: noir 1.2.1 uses hiccup 0.3.7

18:11 gfredericks: nm it does

18:12 rlb: technomancy: I've uploaded emacs24 to unstable

18:12 * technomancy rubs his hands together

18:12 rlb: don't know how long it might take to get through NEW

18:12 xeqi: adu: that was the version of hiccup that was out when 1.2.1 was released

18:12 rlb: note that the emacs metapackage still points to emacs23

18:13 eck: adu: https://github.com/noir-clojure/noir/blob/master/project.clj

18:13 master/head is up to date

18:13 adu: so if I change 1.2.1 to noir 1.3.0-beta10 then it should work?

18:14 eck: hopefully

18:14 Urm3l: hey guys

18:14 i am really new to clojure and i have a problem

18:14 can i use records as keys in a map?

18:14 technomancy: rlb: so it sounds like the freeze doesn't apply if the package is in sid by tomorrow?

18:15 rlb: technomancy: hopefully; suppose we'll see.

18:16 gfredericks: oh maybe it doesn't

18:16 Urm3l: i 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:17 technomancy: Urm3l: are you sure you want records?

18:17 when you're starting out you usually don't

18:18 Urm3l: At Uni we had half a year of scheme and we did everything with records there.. so i thought it might work out

18:18 but we never used hashmaps in scheme anyways..

18:19 scottj: Urm3l: (defrecord point [x y]) (get {(point. 1 2) "cool"} (point. 1 2)) => "cool"

18:20 Urm3l: is (point. 1 2) equivalent to (->point 1 2) ?

18:20 technomancy: Urm3l: I mean it should work, but I'd stick with the big 4 types for your first 3 months in clojure

18:20 aperiodic: Urm3l: 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:20 augustl: are there any canonical ways of serializing and deserializing clojure data structures to disk?

18:20 Urm3l: o god i am stupid

18:20 i mixed up the arguments -.- i put the hashmap second

18:21 Ok so how would you implement coordinates?

18:21 i am trying to do some kind of game of life implementation

18:21 technomancy: vectors are good for that

18:21 rlb: augustl: for some purposes, read and prn might be sufficient.

18:22 scottj: Urm3l: 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:22 xeqi: &(doc pr-str)

18:22 lazybot: ⇒ "([& xs]); pr to a string, returning it"

18:22 augustl: it'll just be vectors, maps, numbers and strings

18:23 I'll look up those, thanks

18:23 Urm3l: ok ill give vectors a try

18:23 thanks a lot

18:24 scottj: Urm3l: when you want to use records, normally use maps. this might be an exception if it's just [x y]

18:24 aperiodic: i 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:25 inices are hard, guize

18:25 s/inices/indices

18:25 spelling is hard, too

18:26 although i guess with destructuring that objection becomes moot: (let [[x y] coord] ...)

18:29 scottj: aperiodic: 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:30 aperiodic: scottj: that doesn't resolve as a package-qualified classname?

18:32 augustl: so, 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:32 no idea where to search to find the package name and version

18:32 technomancy: augustl: use cheshire

18:32 that library is deprecated

18:32 augustl: ah

18:32 scottj: aperiodic: I think the class a.x would be unaccessible (trying to find my hacked clojure to try it out)

18:33 aperiodic: there are other options, such as a!x or a:x

18:33 augustl: that tutorial I requested would still be useful though, the next time I find a library :)

18:33 technomancy: augustl: try `lein help tutorial`

18:33 augustl: cool, thanks :)

18:34 technomancy: sure thing

18:35 aperiodic: scottj: my understanding of symbol resolution is that that would cause an error, and http://clojure.org/evaluation agrees

18:36 scottj: but yeah, using something like a|x would let you keep destructuring without losing much in the way of readability

18:37 is it bad that one of my favorite features of clojure is just that you can stick almost anything in symbols?

18:37 gtrak: ,$#@

18:37 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: $# in this context, compiling:(NO_SOURCE_PATH:0)>

18:40 gtrak: ,($#&&&&&& 5) ; <-- I can't believe this one hasn't been used yet

18:40 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: $#&&&&&& in this context, compiling:(NO_SOURCE_PATH:0)>

18:40 aperiodic: why wasn't the @ in the symbol in your first example?

18:41 gtrak: hmm... guessing @ is a reader macro?

18:41 ,(read-string "$#@")

18:41 clojurebot: $#

18:41 gtrak: ,(read-string "$#@53")

18:41 clojurebot: $#

18:41 gtrak: ,(read-string "$@53")

18:41 clojurebot: $

18:41 aperiodic: ok, that's a good reason

18:41 scottj: aperiodic: one of my favorite features of clojure is that few clojure libraries use entirely non-alphabetical function names.

18:43 lynaghk`: ping: dnolen

18:43 dnolen: lynaghk`: pong

18:43 lynaghk`: I found an issue with core.match on CLJS, but I'm not sure if it's a bug or design change.

18:44 dnolen: lynaghk`: when it comes to core.match, probably a bug :)

18:44 lynaghk`: Should protocols be namespaced in cljs? I.e., should we be writing "cljs.core.ILookup" or just "ILookup"?

18:45 augustl: is 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:45 lynaghk`: core.match uses the former style, which stopped working in cljs 2aeb3d8.

18:46 amalloy: augustl: don't do it, man. use data.xml

18:46 lynaghk`: dnolen: i.e., in the latest cljs release (satisfies? ILookup {:a 1}) gives true, but (satisifies? cljs.core.ILookup {:a 1}) is false.

18:46 augustl: amalloy: what's data.xml?

18:46 Raynes: It's a library.

18:46 https://github.com/clojure/data.xml

18:46 amalloy: $google github clojure data.xml

18:46 lazybot: [clojure/data.xml · GitHub] https://github.com/clojure/data.xml/

18:46 atoi: arguments in Clojure are just separated by whitespace? hmm

18:47 dnolen: lynaghk`: oof, that sounds like a bug in CLJS, ticket please!

18:47 Raynes: atoi: You can separate them with commas if you want, but they're just whitespace too.

18:47 amalloy: commas are for languages where everything is a special case

18:47 atoi: gotcha.

18:47 augustl: Raynes, amalloy thanks

18:47 lynaghk`: dnolen: so both cljs.core.ILookup and ILookup should work? I'll open a ticket.

18:47 dnolen: lynaghk`: oh right, yeah jonasen brought this up but I've been busy - cljs.core/ILookup will work.

18:48 atoi: I'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:48 Riemann is forcing me to learn Clojure. :)

18:48 dnolen: lynaghk`: but I'm starting to think that either cljs.core.ILookup or cljs.core/ILookup should work.

18:48 gtrak: &,(#(,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,inc,,,,,,,,,,,,,,,,,,5))

18:48 lazybot: ⇒ 6

18:49 aperiodic: Riemann? I thought he was dead.

18:49 chrisln: I 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:49 lynaghk`: dnolen: or ILookup, right? Since that core is imported to every file.

18:49 atoi: aperiodic, :) http://aphyr.github.com/riemann/index.html

18:50 technomancy: wow, a deb?

18:50 amalloy: augustl: 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:51 augustl: amalloy: nice!

18:52 aperiodic: chrisln: 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:53 chrisln: aperiodic: that looks awesome, I'll surely take a look!

18:53 aperiodic

18:53 btw, anything on game prog?

18:54 not exactly libs or stuff like that, more like resources or books or tutorials, perhaps?

18:55 aperiodic: chrisln: 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:57 chrisln: aperiodic: oh, I see.. that's a shame tho, I really wanted to get into clojure game programming, just not sure where to start :(

18:59 kovasb: so i just upgrade to the new clojurescript build

18:59 and now I'm getting java.lang.IndexOutOfBoundsException

18:59 at clojure.lang.RT.nthFrom(RT.java:784)

19:00 when I try to compile my cljs.. anyone seen this?

19:00 lynaghk`: kovasb: yeah, I just got some of that myself

19:00 kovasb: ouch

19:00 did u figure out what it was?

19:00 lynaghk`: kovasb: cleaning seemed to make it go away.

19:00 kovasb: lemme try that

19:00 aperiodic: chrisln: 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:01 lynaghk`: 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:01 gtrak: chrisln: 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:01 kovasb: hmm still getting it

19:01 i did lein clean and lein cljsbuild clean

19:01 chrisln: gtrak: thanks dude, I'll surely do!

19:01 kovasb: FML

19:02 lynaghk`: 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:02 chrisln: aperiodic: but do you think it's not something clojure could do quite well?

19:02 kovasb: thanks! catch u later

19:02 aperiodic: chrisln: oh yeah, definitely.

19:03 chrisln: aperiodic: 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:03 aperiodic: and I wanted to focus on game prog, just don't know how, haha

19:04 aperiodic: chrisln: 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:05 chrisln: aperiodic: oh, I read that book, but it's focused on CLisp :/

19:05 Iceland_jack: chrisln: 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:06 technomancy: but, but ... rain cat!

19:06 chrisln: Iceland_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:06 technomancy: are you saying http://raincat.bysusanlin.com/ is not serious? =)

19:06 aperiodic: i 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:06 Iceland_jack: I tried qualifying that as much as I possibly could

19:07 chrisln: I think aperiodic is right, that's exaclty the problem..

19:07 Iceland_jack: Languages with GC are generally not up to the task of making graphics and AI intensive games at all

19:07 gtrak: Iceland_jack: at least as good as XNA

19:07 chrisln: exactly*

19:08 Iceland_jack: but 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:08 chrisln: but I'm not trying to make Crysis on Clojure, just some nice small 2D/3D ones..

19:08 aperiodic: well, there are a fair amount of games written in java these days, though not AAA ones

19:08 chrisln: indeed :D

19:09 gtrak: though I think C#'s native-bindings are a bit better than java's, and the XNA framework is pretty neat itself

19:10 chrisln: how available are the Java libs to Clojure programming?

19:10 (noob question, btw)

19:10 gtrak: chrisln: fully

19:10 Iceland_jack: very

19:10 chrisln: is that so?

19:10 Iceland_jack: sic.

19:10 gtrak: ,(.toString "Hells yea!")

19:10 clojurebot: "Hells yea!"

19:10 chrisln: so Clojure is like the functional side of Java? it even runs on JVM, doesn't it?

19:11 Iceland_jack: Clojure is almost wholly unrelated to Java the language

19:11 chrisln: ok, I didn't express my point quite well

19:11 I 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:12 of the Java libs*

19:12 gtrak: Iceland_jack: I think that's not quite right.. clojure can do java-style stuff just as well or better

19:12 it's a thin layer on top

19:12 of bytecode, not java-source

19:12 Iceland_jack: That depends on how much you mean by “Java the language” in that it's not a “functional side” of it

19:13 chrisln: for example, could I use "paint", "sleep" and "threads" in clojure?

19:13 Iceland_jack: yes

19:13 chrisln: hm, that's quite interesting

19:14 aperiodic: chrisln: 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:14 gfredericks: there's a very good chance it won't be less pleasant than doing it in java though

19:14 Iceland_jack: True

19:15 chrisln: that's kinda exciting, my background in Java may be of some help

19:15 Iceland_jack: It could also be a daunting task to tackle game dev and functional programming at the same time if you're new to them

19:15 jayunit100: ha yeah : big mistake I made was trying to couple clojure to other new stuff i was learning.

19:15 gtrak: what's so hard about FP?

19:16 technomancy: gtrak: unlearning bad habits

19:16 Iceland_jack: It's different in a lot of ways

19:16 gfredericks: gtrak: trying to learn it while thinking in OOP

19:16 chrisln: well, as long as I have good resources on learning stuff.. I'm used to getting beat down by prog languages, lol

19:16 gtrak: yea.. for some reason immutability just wasn't that big a deal to me? Everyone seems to fuss about it

19:16 jayunit100: if 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:16 clojurebot: clojure is like life: you make trade-offs

19:17 Iceland_jack: gtrak: Immutability means you can't do a (def value (inc value)) quite the same way as you might do a value++;

19:17 gtrak: I always hated value++ anyway, it was hard to read

19:17 Iceland_jack: which is fundamental enough to some paradigms that it's enough to make people annoyed

19:17 gfredericks: Iceland_jack: I do that stuff a surprising amount at the repl :)

19:18 gtrak: so apparently you're problem is you think imperative code is hard :D

19:18 s/you're/your/

19:18 chrisln: can I tweak the stuff I import from Java on CLojure

19:18 Clojure*?

19:18 gfredericks: tweak?

19:18 Iceland_jack: Probably means modifying their value?

19:18 chrisln: ok, bad choice of words, redefine, perhaps?

19:19 gtrak: gfredericks: I guess... :-)

19:19 technomancy: if the java lib uses interfaces and abstract classes in the right places, then you can have tons of flexibility

19:19 gtrak: hence, why is FP supposed to be hard?

19:19 technomancy: but some java libs hard-code a lot of things

19:19 chrisln: :/

19:19 gtrak: the thing I find most hard about clojure is just the dynamicity and code-organization

19:19 Iceland_jack: gtrak: other people people may have different experiences to you?

19:20 aperiodic: gtrak: i think, ultimately, because people in general grok turing machines much more readily than the lambda calculus

19:20 gfredericks: that's only because there's a greek letter in it

19:20 * gfredericks renames it the W-calculus

19:21 gtrak: Iceland_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:21 Iceland_jack: gfredericks: and the fact it includes the word “calculus” isn't going to set up mental barriers? ;)

19:21 aperiodic: gfredericks: probably want to get rid of 'calculus' while you're at it

19:21 Iceland_jack: hah exactly

19:21 gfredericks: W-codez

19:21 gtrak: if you write code and aren't thinking about what you're doing for 15 years, then I suppose yes, it's a hassle

19:21 gfredericks: Lambda-Machines?

19:22 Iceland_jack: Bobby Machines

19:22 friendly name, Bobby

19:22 gfredericks: done

19:22 aperiodic: marketing coup of the century

19:22 gfredericks: guys bobbymachines.com is available

19:22 not sure how it's been overlooked this long

19:22 technomancy: "little Bobby tables, we call him"

Logging service provided by n01se.net