#clojure log - Jun 27 2012

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

0:00 technomancy: the one thing that still makes ido-ubiquitous crawl

0:00 brehaut: technomancy: awesome. tab completes pile of poo very quickly

0:00 technomancy: brehaut: insist on nothing less

0:00 talios: You emacs people scare me.

0:01 technomancy: why is there no XMPP library on github called "gom jabbar"?

0:02 that's the Internet for you. full of disappointment.

0:02 brehaut: talios: its much faster than Cmd-Alt-T, Emoji, People and scrolling around to find it

0:02 (inc technomancy)

0:02 lazybot: ⇒ 27

0:02 technomancy: emoji are for people who haven't bothered exploring the rest of the unicode plane =P

0:03 brehaut: technomancy: if its not poo, or interrobangs i dont care :P

0:05 technomancy: huh; I thought you could fork projects that were forks of your own on github as long as they changed the name

0:05 PeregrinePDX: There streo audio again now I can go back to playing with overtone.

0:06 stereo even

0:37 xeqi: ohh, clojurebot runs everything in a custom classloader, neat

0:43 spoon16: Got a question about converting a vector of maps to a nested multimap… any help would be appreciated. http://stackoverflow.com/q/11219512/3957

0:49 antares_: spoon16: you need a combination of group by and map, give me a minute to write an example

0:51 spoon16: are you grouping by :customer or :country?

0:56 spoon16: answered

0:56 xeqi: antares_: don't you need an (apply merge ..)?

0:58 antares_: xeqi: I need to add first

0:58 not sure what can be merged there

0:59 spoon16: antares_: close

0:59 I added a comment

1:00 I'll play around with your approach a bit, but it looks like it's losing "cid2" at the top level

1:00 ohhh man, I see the first call now

1:00 antares_: let me see

1:00 spoon16: just read it I guess :)

1:00 antares_: I may know why

1:00 spoon16: it works

1:00 antares_: oh, hm

1:00 spoon16: it's just the (first) call in your answer… you should remove that for clarity

1:00 antares_: yeah it was a bad idea to add it

1:01 spoon16: thanks for the help

1:01 antares_: corrected

1:02 the point really is that you should use clojure.core/group-by and then it is as easy as producing a collection out of another collection

1:02 spoon16: by the way, if you need specifically a vector, add (vec …). map produces a lazy sequence.

1:16 Raynes: just checking: are you still interested in me migrating refheap to monger?

1:17 Raynes: antares_: If it still supports mongodb URIs, then you bet.

1:17 antares_: if I remove it some heroku uses will tear me apart

1:18 Raynes: antares_: Yeah, like me. :p

1:19 muhoo: trippy https://github.com/antler/caribou-core

1:32 michaelr`: hrr

1:32 anyone here understands tomcat? i've set up three hosts in server.xml and it seems that requests for one host is routed to all of them (resulting mostly in 404)

1:32 does it sound familiar?

1:33 antares_: michaelr`: it probably means that you set up all of them to handle / or * paths

1:34 michaelr`: isn't it supposed to route by hostname?

1:35 i'm talking about multiple domain names, not multiple webapps under the same domain

1:36 antares_: ^^

1:37 antares_: michaelr`: tomcat typically routes on paths. Frontend Web servers like apache or nginx typically separate vhosts by domain name, that's true

1:37 michaelr`: can you show your web descriptor?

1:37 michaelr`: i found this in the documentation: "Note that the directory structures under the appBase for each host should not overlap each other."

1:38 maybe that's my problem

1:38 i placed them like /webapps/host1 and /webapps/host2

1:39 one sec i'll paste the config

1:40 antares_: michaelr`: it's has been a while I touched tomcat but looks like you map hosts to apps in server.xml: http://tomcat.apache.org/tomcat-7.0-doc/virtual-hosting-howto.html

1:56 michaelr`: antares_: fixing the overlapping appbase paths didn't help

1:56 the requests are still distributed among the three hosts

1:56 tomcat is soooooo anoying

3:37 kral: namaste

5:40 SrPx: I know you hate this kind of question but please help me deciding what to learn, CL or Clojure? I'm not sure I get the differences very well.

5:44 hyPiRion: SrPx: ##(first (shuffle '[Clojure CL]))

5:44 lazybot: ⇒ CL

5:45 hyPiRion: SrPx: But from jokes to seriousness, I need to know what you want to learn.

5:46 Do you want to learn a new language for fun, for learning lisp, for productivity, or for understanding new paradigms?

5:47 Bronsa: ,(rand-nth '[Clojure CL])

5:47 clojurebot: Clojure

5:49 antares_: CL has some cruft in it and is not practical today

5:49 AWizzArd: antares_: flaming?

5:49 antares_: Clojure does not have the cruft, has good time/concurrency story, very nice community and is practical

5:50 AWizzArd: just expressing my opinion

5:50 SrPx: hyPiRion: heh! I've thought that, seriously

5:50 hyPiRion: +1 for actual code, nice

5:51 hyPiRion: all of them, but I am kind of hoping this will be the language I will be able to build my big libs in and use for the rest of my life

5:51 lucian: clojure is sort of tied to the JVM (at least for now). that's both useful and very annoying

5:51 SrPx: antares_: what is cruft?

5:51 lucian: why annoying?

5:51 lucian: SrPx: because it's the fucking jvm :)

5:52 SrPx: is this bad? :/

5:52 lucian: sort of. it's also good

5:52 antares_: SrPx: stuff that many people would drop from the language or change, but cannot because of serious backwards compatibility issues

5:52 lucian: many libs, excellent JIT, good GC. terrible start up time

5:52 hyPiRion: It's slow to load, so scripts may take quite a while.

5:52 lucian: also harder to install/manage than other runtimes

5:52 antares_: Clojure also runs on .NET, JavaScript VMs and even Python (not sure about how mature that port is)

5:52 CL does not

5:53 Bronsa: eg, just running the repl takes at least .5 seconds

5:53 hyPiRion: SrPx: My personal opinion though, is that programming Clojure is more... fun.

5:53 SrPx: but why?

5:53 What are the actual differences?

5:54 on the languages themselves

5:54 lucian: antares_: actually, CL runs there too in some shape or form. and sadly, clojure is only self-hosted on the JVM

5:54 SrPx: lucian: terrible start up time?

5:54 lucian: the jvm takes seconds to start up, as opposed to miliseconds

5:54 one major difference is that Clojure is a Lisp-1, and CL is a Lisp-2

5:54 SrPx: antares_: what, it can call python code from inside the language?

5:54 antares_: SrPx: yes

5:54 lucian: SrPx: with clojure-py, yes

5:54 SrPx: antares_: like calling any function I code on python?

5:54 antares_: SrPx: in CL, data structures are mutable and you don't have the same concurrency primitives. As far as lisps go, they are quite close

5:54 SrPx: does anyone know how mature is that?

5:54 lucian: but even that is hosted on the JVM

5:55 SrPx: it's not exactly mature. does appear to work fine, though

5:55 antares_: SrPx: yes, on any platform Clojure has implementations on it interoperates with the VM or language

5:55 Bronsa: SrPx you can do the same for java on the JVM

5:55 antares_: so ClojureCLR can use C# and maybe even F#, JVM Clojure interoperates with Java, ClojureScript with JavaScript and clojure-py with Python

5:55 SrPx: also again (I really don't know, am gathering opinions) is the immutability a problem for any of you? or the opposite?

5:55 antares_: that sounds really good

5:56 Bronsa: it's a terrific feature, not a problem

5:56 SrPx: terrific?

5:56 lucian: it makes concurrency easy

5:56 Bronsa: incredibly good

5:56 :)

5:56 SrPx: oh okay

5:56 lucian: it also makes it easier to reason about certain things

5:56 Bronsa: as in awesome

5:56 hyPiRion: SrPx: Generally immutability is a good thing, but it takes some time to wrap your head around it.

5:56 antares_: SrPx: immutability is one of the key reasons why I use Clojure for many heavy lifting kind of things

5:56 SrPx: but does it make it harder for coding?

5:56 lucian: also, you're free to use mutable data structures if you wish to

5:56 antares_: SrPx: why don't you try

5:56 I mean, come on

5:56 Bronsa: you have to change your mindset

5:56 hyPiRion: However, dynamic programming and programming competitions are usually a mess to work with.

5:56 antares_: just learn something, asking questions for days and days won't get you anywhere

5:57 SrPx: I am already trying, but at a point I'll be starting to code a project on one of them and at this point it would be not fun to change minds

5:57 antares_: Google's Java library (Guava) emphasizes immutability

5:57 Scala has immutable collections and vals

5:57 and so on

5:57 hyPiRion: SrPx: It's harder if you consider programming a 50-line program, but when you're going larger than that, immutability makes the code way more easier to debug.

5:58 antares_: Erlang goes even further with immutability

5:58 SrPx: hm..

5:58 antares_: so it is not the end of the world or super novel idea, Clojure just bakes it into the core of the language

5:58 you can use transients everywhere if you choose to, they are just as mutable as most of Java objects

5:58 hyPiRion: SrPx: If you want to program a project, I'd suggest you try out Clojure.

5:59 SrPx: macros are all the same?

5:59 lucian: macros are very similar in the two languages, yes

5:59 hyPiRion: SrPx: They are essentially the same.

5:59 SrPx: multiple dispatch is the same right

5:59 lucian: some might say it's a flaw in both

5:59 antares_: SrPx: macro capabilities are pretty much the same in CL, Clojure and most of Lisps except for really old ones

5:59 lucian: multiple dispatch is better in clojure

5:59 SrPx: lucian: lol?

5:59 antares_: okay

6:00 lucian: how so

6:00 lucian: SrPx: some might say scheme's hygienic macros are the only good ones

6:00 SrPx: what is hygienic macro

6:00 lucian: clojure multimethods can dispatch arbitrarily, not just on types

6:00 SrPx: what else?

6:00 õo

6:00 antares_: SrPx: there are two schools of thinking about some features in macros, they do not limit the power of macros anyway so I consider them largely a matter of taste

6:00 lucian: anything. instead of giving it a type to dispatch on, you give it a function

6:00 it dispatches on the value that function returns

6:01 of course that function can be be one that returns the type

6:01 which will make it behave like CL multimethods

6:01 SrPx: oh I see

6:01 Bronsa: SrPx also, clojure's "`" have automatic namespace qualifying, that helps avoiding variable capture

6:01 SrPx: I didn't understand that namespace thing very well

6:01 hyPiRion: Bronsa: I think you're kind of going too much into detail

6:01 SrPx: a clojure program is pretty much a namespace with some variables

6:02 is that correct?

6:02 lucian: Clojure's macros are slightly more hygienic

6:02 but otherwise extremely similar to CL's

6:02 SrPx: that is, the namespace 'holds' the variables

6:02 antares_: SrPx: namespaces have the same purpose as Python or Java packages

6:02 or in Python they are called modules, I don't remember

6:02 lucian: yes

6:02 SrPx: hm

6:02 hold on let me open the manul

6:02 hyPiRion: SrPx: I would honestly suggest that you write a 1000-line project or something in both.

6:03 That's the best way of finding "your" language.

6:03 Bronsa: SrPx when you write a macro, you may accidentally shadow some variables, and that is a really hard bug to spot in common lisp; clojure tries his best to avoid that

6:03 mduerksen: SrPx: the thing i like best about clojure: its datastructures. vectors, lists, maps, sets - you can specify all of them as literals ( [], '(), {}, #{}, ), and they all work with all the core clojure functions like map, filter, reduce, out of the box. you also don't have to care about equality (e.g. (= [1 2 3] [1 2 3]), no worry about pointer-equality and stuff)

6:04 hyPiRion: I kind of think of Clojure as immutable python with threads.

6:04 SrPx: hyPiRion: hmm

6:04 hyPiRion: this is a good advice

6:04 hyPiRion: SrPx: You'll only get reasons why you should learn Clojure here, and only reasons why you should learn Common Lisp in their channel.

6:04 Bronsa: also, clojure has better package managing tools, see leiningen

6:04 SrPx: mduerksen: this was also a good point

6:04 lucian: hyPiRion: i have a similar impression :)

6:05 SrPx: hyPiRion: I know, it is okay

6:05 at least I can compare

6:05 both are looking awesome and have great communities

6:05 hyPiRion: SrPx: Yeah, but I'm just saying it's subjective.

6:06 lucian: as a mostly-python developer, i'd say go with clojure

6:06 for what that statement is worth

6:12 nonrecursive: SrPx: I started out with common lisp back in november but started doing clojure a few weeks ago and enjoy it much more

6:13 SrPx: nonrecursive: hmm

6:13 nonrecursive: could you elaborate? (:

6:14 old_sound: hi do you think clojure is good for me?

6:14 nonrecursive: SrPx: it's just harder to get stuff done in CL - as Bronsa mentioned the package management is much better, which really makes a big difference. You also have more libraries thanks to Java, and Clojure's syntax is much more terse

6:15 lucian: hg st

6:15 damn, this isn't my terminal

6:15 AWizzArd: antares_: again, an uninformed statement that you made, about CL.

6:15 antares_: AWizzArd: which one?

6:15 nonrecursive: SrPx: another nice thing about Clojure is that it has more good lisp ideas "built in", whereas in CL you'll have to build up those ideas yourself or else they're defined in an implementation-specific way

6:15 SrPx: AWizzArd: ?

6:15 nonrecursive: for example?

6:16 nonrecursive: SrPx: which is another issue, there are many implementations of CL, so that's something else you have to navigate

6:16 SrPx: gensym - in CL it's implementation-specific

6:16 SrPx: wait i take that back

6:16 SrPx: with-gensysms is implementation-specific. In Clojure with-gensysms isn't even necessary because of the way gensyms are handled

6:17 antares_: AWizzArd: sorry but I could not care less about your comments. I am not trying to be 100% correct, just give SrPx a high-level idea of how CL compares to Clojure in practical terms. In practical terms things like peculiarities of macro writing matter less than things like Java/JS/C# interop.

6:17 SrPx: I dont know what a gensym is, I'm googling that wait

6:17 nonrecursive: SrPx: in clojure you also get function composition for free, as well as partial functions

6:17 SrPx: AWizzArd: this is true

6:17 antares_: you are being very helpful, thanks

6:17 lucian: nonrecursive: those aren't built-in in CL?

6:17 SrPx: AWizzArd: but I would like to hear you reasoning

6:17 AWizzArd: CL can run on the JVM, and use all data structures that Clojure has.

6:18 nonrecursive: lucian: as far as I could tell from, you need to write the macros for those yourself

6:18 SrPx: nonrecursive: hmm true

6:18 AWizzArd: It is mostly a syntactical difference, Lisp1 vs LispN.

6:18 Clojure is a bit more efficient.

6:18 lucian: nonrecursive: really? i'd hope at least they can be written as functions

6:18 AWizzArd: Nearly all syntax from Clojure can be integrated into CL within a matter of hours.

6:19 In principle you can program CL on the JVM and make it nearly feel like Clojure.

6:19 Clojure is a bit more cleaned up, and a bit more consistent with its names.

6:19 nonrecursive: lucian: or the functions - but you still have to write it yourself

6:19 lucian: nonrecursive: right

6:19 nonrecursive: lucian: which isn't a huge deal, I mean just copy it from OnLisp, but it's nice to have it included in the language as in Clojure because that way you everyone's on the same page

6:19 AWizzArd: But it also lacks some important features, which it will probably get over the next years.

6:20 There are tons more of implementations for CL than there are for CLJ.

6:21 I personally prefer Clojure and do use it since 2008. But from an objective point of view, CL is not really significantly “worse” than CLJ.

6:21 lucian: AWizzArd: i don't believe anyone here claimed that

6:22 AWizzArd: I read a statement some minutes ago: “CL has some cruft in it and is not practical today”. This is BS. It is +/- as practical as Clojure.

6:22 Clojure does not yet have the cruft, because it still is too young. But then again, Clojure misses some useful features that CL has.

6:23 For example CL has a nice support for conditional compilation. This is useful as soon there are multiple implementations that you want to target.

6:23 The *features* list I mean, and the #+ and #- reader macros.

6:24 nonrecursive: SrPx: from the standpoint of learning a lisp, it might be better to go with CL because there are some great resources available. Land of Lisp, On Lisp, Paradigms of Artificial Intelligence. Those all use Common Lisp, and it might be better to learn that instead of trying to translate into Clojure when you're first starting. I started with Land of Lisp and it was great fun.

6:24 AWizzArd: And as it runs on the JVM it can use all the nice data structures of Scala and Clojure too. Lazyness, Agents that synchronize over multiple computers, JavaFX UIs, all Clojure libraries, etc.

6:24 nonrecursive: SrPx: But in terms of actually being able to make stuff I'm having an easier time with Clojure

6:25 AWizzArd: In the end it boils down to a time investment of a few days to make the usage of all those libs look nice in CL. What remains mostly is that CL will have some syntactic differences here and there.

6:26 Clojure is nicer to use, and does not require an initial time investment.

6:26 I personally would always prefer it over CL, if I can. But objectively speaking… not a too dramatic difference.

6:28 SrPx: AWizzArd: thanks ...

6:30 something that came to my mind now

6:30 as he pointed, clojure is new... so I guess if I ever need to find determined macro/function/etc, it is more likely that it will be available for cl but not for clojure

6:31 could this be a worry?

6:31 or does clojure already have all the important stuff?

6:31 or would converting be so easy it didnt matter?

6:32 lucian: being able to use java libs is a significant advantage

6:32 gtuckerkellogg: clojure is advancing very fast

6:35 dbushenko: SrPx, I'd say, there is more libs for clojure even then for CL

6:35 SrPx: hm

6:35 dbushenko: and if you take into account the java libs legacy... I think its obvious that Clojure is more practical then CL

6:36 mduerksen: AWizzArd: i don't know CL much, but you said "CL can run on the JVM." how would you do that?

6:36 dbushenko: mduerksen, abcl runs on jvm

6:36 nonrecursive: SrPx: you probably won't have a difficult time translating CL to Clojure in 99% of cases

6:37 dbushenko: but abcl integrates with java badly

6:38 mduerksen: dbushenko: ah, thanks

6:38 AWizzArd: yup, abcl I meant

6:39 abcl would require 1-2 days of work to get a nice java interop.

6:49 SrPx: hey guys gtg now

6:50 thank you all for the w ords

6:52 wmealing: so, i'm wondering about adding a jar to clojars.org .. Ive found a clj lib thats been neglected for a while.. sent the author a push request 48 hours ago

6:52 maybe he's busy, or maybe he's given up coding, i can't tell

6:52 is it bad karma to push a revision to clojars with the same name

6:53 newer version etc ?

6:56 dbushenko: wmealing, create your own groupid for the artifact

6:57 michaelr`: moved away from tomcat to nginx+tjws - feel much better now, finally things begin to work as they should instead of all kind of unexplained tomcat weird shit

6:57 :)

7:01 wmealing: dbushenko, okay.

7:04 dbushenko: michaelr`, and what went wrong with tomcat?

7:05 antares_: wmealing: you should change group id and publish it as your fork that way

7:06 wmealing: antares_, thats the first element after defproject ?

7:06 antares_: wmealing: in com.novemberain/monger, it is "com.novemberain"

7:06 wmealing: antares_, org.clojars.wmealing/oldthing-name

7:06 antares_: it may be omitted completely

7:06 wmealing: ok

7:06 antares_: then just add it

7:07 yes, like that

7:08 wmealing: well, that was painless

7:08 thanks

7:38 nonrecursive: when I want to use protocol method, do the usual namespace rules apply? For example, if the protocol is defined in "protocol-test.core", will I need to call "protocol-test.core/some-method" ?

7:39 Bronsa: yes

7:40 nonrecursive: thanks

7:42 michaelr`: dbushenko: well, first i had a problem using the aliases attribute. it just didn't work, and no one on the tomcat mailing list knew why

7:42 and today in the last two days i tried to setup multiple hosts in one instance of tomcat and it didn't work right either

7:43 yesterday and today :)

7:44 lost's of xml configuration and conventions spread across directories and files

7:44 ktsuji: is there a way to suppress "All namespaces already :aot compiled." output when calling lein run with leiningen2?

7:44 michaelr`: s/lots

7:45 AWizzArd: Is there a way, in a Leiningen 2 project, to check for which of my dependencies a newer version is available?

7:46 -for

7:47 michaelr`: i usually just run 'lein clean;lein deps'

7:48 ah, wait that's not what you asked

7:48 never mind

7:51 AWizzArd: I thought about something such as “lein check-updates” ==> prints “You are currently depending on [org.clojure/java.jdbc "0.2.2"]. Now [org.clojure/java.jdbc "0.2.3"] is available.”

7:51 antares_: AWizzArd: there is no but with upcoming clojars improvements it will be possible

7:52 AWizzArd: the key is to have an API hook on the clojars side. Not sure how it should work for other Maven repos, though, but there are ways around it

7:54 AWizzArd: Perhaps http://search.maven.org/#api provides some useful functionality.

7:54 The REST API, which returns json.

7:54 antares_: nice

7:55 then it should be doable

7:55 but I think technomancy will ask for it to be a plugin

7:55 AWizzArd: sure

7:56 antares_: AWizzArd: talk to xeqi, he is the man to talk to about Maven repos indexing and related topics

7:58 mduerksen: enlive question: [:div (attr? :some-attr)] selects any element with the attr contained in a div. how do i select a div that also has the attr?

7:59 in other words, how do i AND predicates?

8:02 the enlive readme seems to attempt to show this, but there must be a typo

8:05 nevermind, i found it. and the readme-page on github has indeed a typo

8:46 Chiron_: Hi, would you please have a look at section "composite columns" https://github.com/Netflix/astyanax/wiki/Getting-Started How to mimic that in Clojure code?

8:46 I'm talking about SessionEvent

8:48 antares_: Chiron: annotations in Clojure are only possible via gen-class and it is a relatively unknown feature

8:49 Chiron: :/

8:49 antares_: that said, annotations are only typically necessary in Java because of Java's own limitations

8:49 try modelling composite columns using maps and vectors first

8:49 Chiron: in case of Astyanax, annotations are necessary

8:50 I guess I will wait till the next week ;)

8:53 cemerick: Chiron, antares_: annotations can be used on any of gen-class, defrecord, or deftype

8:53 Probably reify as well, but likely only at method- and argument-level there.

8:54 Chiron: cemerick: I have to thank you for your book, it was really amazing but I have one thing. I was expecting much more on Macros treatment

8:55 IMHO

8:55 cemerick: I'm sorry to hear that. I hope the rest of it makes up for it.

8:56 Chiron: it was amazing, i learned a lot . I'm a better Clojure programmer because of it

8:56 but you raised the bar so high :)

8:56 N8Dawg: hi, has anyone here had experience using CDT, i'm trying to set a breakpoint on an anonymous function, is that even possible?

8:56 foxdonut: cemerick: I am enjoying the book, as well. How did the three of you split up authoring the chapters?

8:57 cemerick: foxdonut: No particular method. Mostly based on availability, expertise, and interest.

8:59 Cheiron: data structure treatment was second to none.

8:59 foxdonut: cemerick: it would be interesting to see who wrote which chapters :)

9:02 Cheiron: cemerick: annotation can be used with defrecord/deftype without gen-class , aot?

9:02 cemerick: Cheiron: yes

9:04 foxdonut: I could tell you, but then I'd have to kill you. :-P

9:05 foxdonut: cemerick: ok, it's a deal. :D

9:06 quick and painless please. and if only one can be achieved, just make it quick.

9:08 llasram: Wow, I did not realize that deftype/defrecord allow one to declare annotations

9:09 The implementation looks kind of insane though... deftype calls out to the Java Compiler to build the deftype'd class, but then Compiler calls back into the in-Clojure `add-annotations` function to add the annotations?

9:10 tbaldridge: the whole deftype system is that way. That's some insanely complex code

9:11 But that's the fault of the JVM, not clojure

9:21 antares_: cemerick: I have a quick question for you

9:21 cemerick: I see that (name ::identity) strips off the namespace, is there a version that does not do that but otherwise works as clojure.core/name?

9:22 cemerick: this is reported for Monger by a Friend user

9:22 cemerick: It's a small irc world. ;-)

9:23 antares_: str

9:23 antares_: cemerick: it keeps the :

9:23 cemerick: There's nothing built-in that will give you ns/foo and not :ns/foo

9:23 JulioBarros: antares_ cemerick ... I've been bugging you both this morning :)

9:23 antares_: cemerick: ok, so our best bet is to use str + strip off the :?

9:24 cemerick: antares_: well, the : is important. If this is session storage, you need the : to distinguish between a symbol and a keyword.

9:25 antares_: cemerick: Monger currently stores keywords as strings

9:25 llasram: &(let [kw ::example] (str (namespace kw) "/" (name kw)))

9:25 lazybot: ⇒ "clojure.core/example"

9:25 cemerick: Well, that's not going to cut it for session storage. Another library might choose to use symbols.

9:25 It's hard to get better than pr-str.

9:27 antares_: cemerick: ok, I will think about it

9:27 JulioBarros: I am not sure what to suggest, there is Ring session store in Carmine, as far as I know

9:28 I am thinking about something that would work for Monger and be backwards compatible but so far I can't

9:30 JulioBarros: I am afraid many session stores that do not try to be Clojure-specific may end up having the same problem

9:30 Welle's one can use application/clojure data type, though

9:31 JulioBarros: is running a Riak node for sessions an option for you?

9:32 cemerick: Surely this isn't related to the database per se; the session store just needs to support the full range of Clojure values.

9:32 antares_: cemerick: right

9:32 but I expect many session stores to choose JSON and not clojure reader

9:33 just for possible interop scenarios

9:33 cemerick: I am thinking I can add a friend-friendly session store to monger

9:33 since we can just use mongodb as a key/value store where values are clojure reader strings

9:35 cemerick: Well, whatever the db uses (JSON or not), a Ring session store impl should translate properly.

9:35 That is, this is hardly a friend-specific issue. :-)

9:35 antares_: cemerick: yes but if we store namespaced keyword, a Ruby app won't be able to read that value

9:35 sure

9:35 Bronsa`: ,(into {} (map (juxt identity symbol?) [:a (symbol (str :a))]))

9:35 antares_: I think I have a solution in mind

9:35 clojurebot: {:a false, :a true}

9:35 Bronsa`: wtf

9:36 antares_: JulioBarros: please let me know when you are around again, I have an idea

9:36 cemerick: antares_: Oh! That's an interesting problem, then. Yuck.

9:37 Bronsa`: (symbol ":a") *is* a symbol…

9:38 foxdonut: cemerick: chapter 12 is a little gem. :)

9:38 antares_: cemerick: fortunately, monger.ring.session-store is not documented :)

9:38 cemerick: I may be able to add a new one and then gradually remove the old

9:38 Bronsa`: cemerick should we be allowed to create symbols prefixed with :?

9:39 that may cause this to occur

9:39 ,(read-string (pr-str (into {} (map (juxt identity symbol?) [:a (symbol (str :a))]))))

9:39 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Duplicate key: :a>

9:40 cemerick: Bronsa`: That debate has been ongoing for ~5 years. :-)

9:41 Bronsa`: I just don't understand why Symbol doesn't throw an exception, but ok

9:42 foxdonut: ,(= :a (symbol (str :a)))

9:42 clojurebot: false

9:44 foxdonut: ,(= :a (keyword (name :a)))

9:44 clojurebot: true

9:44 foxdonut: ,(read-string (pr-str (into {} (map (juxt identity symbol?) [:a (keyword (name :a))]))))

9:44 clojurebot: {:a false}

9:46 Bronsa`: foxdonut yeah, the problem is, symbol creates simbols that the reader cannot read or doesnt read like symbols

9:46 ,(symbol ":::")

9:46 clojurebot: :::

9:46 Bronsa`: ,':::

9:47 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Invalid token: :::>

9:47 Bronsa`: I don't see the point in allowing this

9:47 antares_: ,(let [s (slurp "http://clojure.org")] (count s))

9:47 clojurebot: #<AccessControlException java.security.AccessControlException: access denied ("java.net.SocketPermission" "clojure.org:80" "connect,resolve")>

9:47 antares_: clojurebot: good boy

9:47 clojurebot: No entiendo

9:47 cemerick: Bronsa`: The general counter-argument is that symbols are used for plenty of things that have nothing to do with printing and reading.

9:48 Bronsa`: I don't think it's a good enough argument, but it's not a big deal anyway, i can live with that :)

10:01 fasta: If you have a 1M line project and you change a few lines, how long does it take before you can see the result of your change? I can imagine that it takes some time to translate to JVM code.

10:02 dnolen: fasta: a 1 million line Clojure project?

10:02 scriptor: fasta: talking about light table?

10:02 fasta: scriptor: oh, please.

10:03 dnolen: I am just asking a question; there is no need to ask another question back in return.

10:03 dnolen: fasta: was asking for clarification. in general you only need to recompile the lines that change. as usually is the case with Lisps.

10:04 fasta: dnolen: and what about linking?

10:04 dnolen: fasta: not necessary.

10:04 fasta: dnolen: ok, so the whole edit-run cycle abstraction keeps working.

10:04 JulioBarros: antares_: btw, is there a good/default clojure specific database? What if I really needed to store query-able clojure data structures? What could you use?

10:05 dnolen: fasta: also I seriously doubt one would ever reach 1M LOC of Clojure. Largest Clojure projects in production I've heard of are 60K LOC.

10:05 fasta: dnolen: do you think that's some magic upper bound? ;)

10:06 dnolen: I think one year of development will get you 60KLOC of code already.

10:06 dnolen: fasta: nope

10:06 fasta: the big apps I'm aware have been dev'ed for 2-3 years.

10:06 foxdonut: "back in return" is redundant.

10:06 dnolen: 20-30k seems normal

10:07 fasta: Can I only call Java stuff or can I also call POSIX and win32 things easily?

10:08 dnolen: fasta: Java stuff is easy, FFI difficulty inherited from Java's support for such things.

10:09 fasta: dnolen: well, I disagree on that.

10:09 dnolen: fasta: disagree on what?

10:09 fasta: dnolen: I think if developers wanted it to be easy, it would be easy.

10:10 It's perfectly possible to automatically generate interfaces to native libraries.

10:10 dnolen: fasta: sure, some folks have work on OSS libs to make such things easier.

10:10 fasta: Except, there is a reason why that isn't done.

10:10 It is to make the developers of the new language more in demand.

10:10 "We need <insert all the old stuff> in the new environment".

10:11 It took me some time to figure that one out, but in the end that's all it comes down to.

10:11 Plain economics.

10:11 Thanks for the answers.

10:11 mduerksen: fasta: it's an issue of priority imho. but i'm not sure you're asking to learn or asking just to be provocative

10:11 tbaldridge: I imagine there has to be a good way to do FFI in Java. It's pretty straightforward in the CLR and Python

10:12 fasta: mduerksen: let me guess: Clojure developer?

10:12 Really, this couldn't be much more predictable.

10:12 foxdonut: smells like a troll.

10:12 fasta: Smells like another developer.

10:12 antares_: tbaldridge: JNA

10:12 foxdonut: I rest my case.

10:13 fasta: If what I am saying is not true, then please tell me why people release a programming language without proper support for the systems which the rest of the world is using at those points in time.

10:14 antares_: JulioBarros: if you want to store query-able Clojure data structures, I think you need Datomic. MongoDB with Monger is fairly close

10:14 JulioBarros: if a key/value store would be sufficient, Welle with :content-type "application/clojure" will work great, too

10:14 * foxdonut ignores and goes back to more important things.

10:14 antares_: Welle is a Riak client: http://clojureriak.info

10:15 fasta: Clojure is a hosted language. When hosted on JVM and CLR (.NET), it cannot overreach JVM limitations. JVM does not let you work with POSIX APIs because it was designed to be cross platform. ClojureScript on Node.js can use POSIX APIs.

10:16 fasta: antares_: ah, interesting. You are clueless.

10:16 antares_: fasta: also, not sure why all the snark and poision. Just don't use Clojure if you don't like it. Believe it or not, a lot of software does not give a crap about calling POSIX APIs beyond open/write/read

10:16 dnolen: I think everyone can put fasta on ignore at this point.

10:16 tbaldridge: agreed

10:17 kij: who?

10:17 fasta: JNI doesn't exist or what?

10:17 foxdonut: dnolen: agreed, done.

10:18 fasta: I was expecting *informed* opinions here.

10:18 Perhaps the people that don't say anything have them.

10:18 antares_: fasta: get a life

10:19 has been long since I used the ignore command

10:19 fasta: antares_: learn something before you speak.

10:19 antares_: just because you can type things on a keyboard, doesn't mean that you should answer a question.

10:20 foxdonut: antares_: try /ignore fasta!*@* ALL

10:20 then just plain /ignore to see your list

10:20 fasta: foxdonut: go grab a donut.

10:20 antares_: foxdonut: thank you, done

10:20 ldopa: oh shit donut burn

10:21 foxdonut: welcome

10:22 mduerksen: antares_: first time i hear about monger. i've been using congomongo recently. i wonder if i should give monger a first look?

10:22 antares_: mduerksen: everything I say will be biased but take a look at http://clojuremongodb.info :)

10:23 mduerksen: also, folks in here may be able to tell their experience

10:23 scriptor: nice website

10:23 foxdonut: antares_: I like the look of your page

10:23 scriptor: I'd rename 'Contribute' to just 'Source', though :)

10:23 antares_: monger is a part of a group of EPL-licensed projects, clojurewerkz.org

10:25 kij: Is there any usecase for (defn [] (wrong)) ? (defn []) Tells me i need a name, But (defn [] (wrong)) says: Parameter declaration wrong should be a vector

10:25 antares_: kij: (defn some-name [] …)

10:26 kij: name goes right after defn and does not need to be wrapped in parens, unless you have a function that you want to call to return the name

10:26 kij: antares_: Yes, its wrong. But the second form mentions "wrong", not defn.

10:26 duck1123: Saying that the parameter declaration is wrong isn't the clearest, but at least it makes you look at the right area of the code

10:27 there are certainly less clear error messages out there

10:27 metellus: it's either accepting [] as a valid name or it has issues with the arglist before it checks the validity of [] as a name

10:27 tbaldridge: yeah....some of the error messages in defn, deftype, etc. are a bit wonky like that

10:27 uvtc: scriptor: *off-topic*, but love the name "scriptor". Sounds like either and autobot or a decepticon. :)

10:28 tbaldridge: Sometimes the macros like defn will parse the arguments in a different order than you think, so they end up throwing errors in a odd way

10:28 scriptor: uvtc: heh, thanks, funny thing is I was thinking history when I first came up with it

10:32 kij: antares_: Did you say something like this should work? (defn (first [aa bb]) [] (println "hey")) - where aa and bb are defined?

10:33 antares_: kij: you don't need parens around the name

10:33 kij: what are you trying to do?

10:34 metellus: kij: java.lang.RuntimeException: First argument to def must be a Symbol

10:34 kij: antares_: Your comment: "... unless you have a function that you want to call to return the name" Trying that out, and failing :)

10:34 metellus: and I tried wrapping it in (symbol) too

10:35 foxdonut: kij: also (defn a ([x] <handle 1 arg>) ([x y] <handle 2 args>)) to have different arities

10:35 antares_: kij: then try this: (defn name-gen [] (symbol "abc")) (defn (name-gen) [] "I am named abc")

10:35 foxdonut: antares_: didn't know you could do that-- interesting

10:36 kij: antares_: Same :/

10:36 foxdonut: still needs to prove it :)

10:37 Bronsa: (defn #=(gensym) [])

10:38 kij: Bronsa: cheat!

10:39 antares_: kij: well, symbol-generating functions are typically used in the context of a macro

10:39 but it is possible, without it even fairly basic metaprogramming would not be possible

10:41 ,(defn name-gen [s] (symbol s)) (macroexpand-1 '(defn ~(name-gen "abc") [] "I am named abc"))

10:41 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

10:41 antares_: clojurebot: wha?

10:41 clojurebot: Titim gan éirí ort.

10:42 Bronsa: you cant def

10:44 duck1123: kij: So you're looking for an example of where a function is called to produce a symbol to act as the name in a defn (or similar)?

10:46 oh well, I thought I had one to show, but it's not quite right

10:49 tbaldridge: okay, I need to send some beer to whomever wrote clojurebot...some of the comments that thing makes are hilarious

10:49 RickInGA: clojurebot: orm

10:49 clojurebot: Object-Relational Mappers are the Vietnam of computer science.

10:49 tbaldridge: lol

10:49 the one I saw the other day: https://github.com/richhickey/clojure

10:50 hrm...last time it triggered a comment....let's try this: https://github.com/richhickey/clojure/blob/master/src/clj/clojure/core.clj

10:50 duck1123: https://github.com/richhickey/clojure

10:50 tbaldridge: nope...anyways, it said something like "*sigh* please update your links..."

10:50 RickInGA: ah

10:50 duck1123: clojurebot: https://github.com/richhickey/clojure

10:50 clojurebot: eg, https://github.com/clojure/tools.logging is the new version of clojure.contrib.logging

10:52 RickInGA: Is it Raynes who does ClojureBot... don't think he is old enough... you may have to buy him root beer

10:52 antares_: RickInGA: outside of US he is

10:52 scriptor: just take him to canada

10:52 uvtc: teehehe

10:52 tbaldridge: lol

10:53 duck1123: I thought Raynes was lazybot

10:53 TimMc: No, lazybot is Raynes, not the other way around.

10:53 cemerick: clojurebot is hiredman's, lazybot is Raynes'

10:53 uvtc: github says it's hiredman

10:53 scriptor: oh, looks like hiredman might be behind cloj

10:53 right

10:53 RickInGA: ok, my bad

10:54 antares_: lazybot: what do you think about clojurebot?

10:54 lazybot: It's AWWWW RIGHT!

10:54 TimMc: clojurebot: Who's your daddy?

10:54 clojurebot: Pardon?

10:54 duck1123: Raynes once threatened me with bodily harm for getting that mixed up. :)

10:54 uvtc: clojurebot: fight lazybot

10:54 clojurebot: botfight is http://raek.se/botfight.html

10:54 uvtc: !

10:55 _nmmn: clojurebot: add 1 to 2

10:55 clojurebot: Pardon?

10:56 uvtc: $mail raek botfight is http://raek.se/botfight.html appears to be down. Also, lazybot called clojurebot's mom a script.

10:56 lazybot: Message saved.

10:58 uvtc: lazybot: does this work?

10:59 foxdonut: scriptor: are you alluding to our drinking 7% beer at 13 years old?

11:00 scriptor: foxdonut: noooo ;0

11:01 my new goal is to get clojurescript accepted for our new project

11:01 already asked documentcloud three times about tree-based relationships in backbone without an answer

11:01 * nDuff clones lazybot, does a "git grep" for the riddell.us message, comes up empty... hmm.

11:01 lazybot: The riddell.us tutorials are much more highly-ranked on Google than they deserve to be. They're old and way too complicated. If you're trying to install Clojure...don't! Instead, install Leiningen (https://github.com/technomancy/leiningen/tree/stable) and let it manage Clojure for you.hmm.

11:02 duck1123: I've been wondering if talking my work into using the Closure compiler would be a good gateway into allowing me to use cljs

11:02 TimMc: nDuff: Try just riddell -- maybe the . is escaped.

11:02 lazybot: The riddell.us tutorials are much more highly-ranked on Google than they deserve to be. They're old and way too complicated. If you're trying to install Clojure...don't! Instead, install Leiningen (https://github.com/technomancy/leiningen/tree/stable) and let it manage Clojure for you.escaped.

11:02 TimMc: argh

11:02 foxdonut: how do I get 'A' out of 65?

11:02 nDuff: TimMc: No matches there either.

11:02 TimMc: No, it wouldn't be -- the response has it and isn't a regex.

11:03 metellus: ,(char 65)

11:03 clojurebot: \A

11:03 foxdonut: thanks metellus

11:03 TimMc: (constantly "A")

11:03 foxdonut: I was trying chr and for some reason my brain froze after.

11:03 duck1123: ,(.charValue \A)

11:03 clojurebot: \A

11:04 duck1123: nope

11:04 scriptor: duck1123: it'd be a good start, I think

11:04 TimMc: &(char \A)

11:04 scriptor: although getting them into a functional style is more of a challenge

11:04 lazybot: ⇒ \A

11:04 TimMc: &(int \A)

11:04 lazybot: ⇒ 65

11:04 duck1123: ,(Character/getNumericValue \A)

11:04 clojurebot: 10

11:04 TimMc: heh

11:05 metellus: ,(Character/getNumericValue \M)

11:05 clojurebot: 22

11:05 metellus: ...

11:09 acheng: wouldn't it be nice if you could hand your project.clj to a tool and have it inc all the versions for dependencies to the latest internally-consistent set?

11:10 technomancy: acheng: currently that's impossible to do in a way that would preserve comments

11:10 TimMc: That info isn't machine readable, though -- or even written down, for many deps.

11:10 duck1123: wasn't that the intended goal of "lein outdated" (never had much luck with it)

11:11 cemerick: technomancy: I tinkered with sjacket a bit last month; it's super-promising.

11:11 TimMc: README files of various projects might say "Versions 2.2 thought 4.9-alpha1 will work with Clojure 1.3.0..."

11:11 acheng: technomancy: i guess the user could merge comments in after, using an original

11:12 TimMc: If we had :line/:col info for every form (including strings), one could do substring replaces on the original text block after reading in the file as sexprs.

11:14 acheng: TimMc: maybe the tool could do the next best thing... perhaps collate any available info in a report :-P

11:14 antares_: JulioBarros: please see https://github.com/michaelklishin/monger/blob/master/src/clojure/monger/ring/session_store.clj

11:14 JulioBarros: 1.1.0-alpha2 is up on clojars with this new store added

11:15 JulioBarros: antares_: Thanks. I'll check it out.

11:16 TimMc: acheng: That would be quite a useful alternative, although I fear the core functionality is still impossible.

11:16 wingy: would be cool if clojure was used entirely for a very popular web site .. that would boost up popularity even more

11:17 dbushenko: wingy, clojure is already used in Twitter

11:17 for data processing

11:18 uvtc: fortune

11:18 $fortune

11:18 lazybot: Never Graduate

11:18 wingy: dbushenko: they combine scala and clojure?

11:18 uvtc: $8ball

11:18 lazybot: uvtc: Outlook good.

11:19 dbushenko: wingy, data processing is done with Storm

11:19 whaley: dbushenko: theyuse storm, which is clojure based

11:19 dbushenko: it is written with clojure, yes

11:19 foxdonut: heh, TDD=Talk-Driven Development?

11:19 dbushenko: foxdonut, :-D

11:20 whaley: oh sorry, that was intended for wingy :(

11:20 gfredericks: why did my `lein run` process spawn up two other java processes after 5 minutes of running?

11:20 xumingmingv: foxdonut: :-D

11:20 acheng: so it sounds like standardized dependency metadata isn't a requirement for putting something in a public repository. that seems odd. usually when i have a good idea, others have already implemented and used hundreds of versions :-P

11:21 whaley: we are becoming very dependent on storm, hence my interest in clojure right now

11:22 gfredericks: do java threads have separate OS pids?

11:22 whaley: gfredericks: nope

11:23 nDuff: ...well, "depends on your OS" may be more accurate; at least historically, I recall JVM thread implementations changing back when OS implementations did

11:24 * nDuff remembers back when the transition away from green threads first happened on Linux, circa 1.1.x JVMs.

11:25 duck1123: So if you're running Storm on Java 1.1 you're going to have problems.

11:26 wingy: reading answer 2: http://programmers.stackexchange.com/questions/129674/how-would-functional-programming-proponents-answer-this-statement-in-code-comple seems perfect to have web apps designed like that

11:31 foxdonut: wingy: nice!

11:36 technomancy: acheng: there's a plugin that will tell you what needs updating, it just doesn't rewrite project.clj for you

11:37 RickInGA: I assme it is possible to have a project that works for both 1.7.1 and 2?

11:38 acheng: technomancy: is that lein outdated ?

11:41 qbert_: what is lein ?

11:41 ##lein

11:41 acheng: lein saves your hair

11:41 RickInGA: qbert_ lein = leiningen, the build tool/dependency manager for Clojure

11:43 qbert_: ok thanks! I'm still learning, any other tools I should know about ? What do ya'll use for an IDE ?

11:43 nDuff: qbert_: emacs, mostly

11:43 S11001001: qbert_: emacs

11:43 qbert_: nDuff, got it! :)

11:44 nDuff: qbert_: ...be sure to get set up with paredit-mode, clojure-mode and SLIME.

11:44 duck1123: there's pretty good support for most of the IDE's, but emacs is used most

11:44 scriptor: a couple use vimclojure

11:44 * nDuff thinks "pretty good" is overstating it.

11:44 tbaldridge: yeah...take it from me...I held off from learing emacs for about 2 years...now I think "emacs...where have you been all my life!"

11:45 RickInGA: qbert_: lein is the most important tool, some of the getting started documentation says to dowload the clojure jar file manually, don't. Install lein, it installs clojure for you.

11:45 tbaldridge: for emacs modes, personally I love this one: https://github.com/overtone/emacs-live

11:45 notice: the fuzzy filter doesn't actually happen in emacs (thankfully

11:45 ro_st: hey so does anyone know if RHickey is going to put the clojure/west and euroclojure vids into the official clojure podcast?

11:46 RickInGA: tbaldridge: Once I learned to live with out menus, I fell in love with that setup

11:46 qbert_: tbaldridge, oh nice, I just have clojure-mode, that looks way better

11:46 tbaldridge: and I love the fact that it puts in a greek lambda whenever I type (fn). It's the small things that make that mode awesome

11:47 S11001001: tbaldridge: you know you can make your own unicodings. I use like 15 for scala hacking

11:48 tbaldridge: yeah...I just haven't figured that out yet. I'm doing good remembering all the shortcuts I need after only two weeks of using emacs.

11:49 I have to admit though I heard people ranting about how awesome paredit was. Now that I've started using it (and know the shortcuts), yeah, that's just pure awesomeness

11:49 ro_st: emacs-live rocks

11:49 duck1123: C-h m will show the bindings for the current mode. Helpfull when messing with a new package

11:49 ro_st: tbaldridge: find and print the cheatsheet. i have mine stuck on the wall next to me

11:49 for paredit

11:49 RickInGA: duck1123: awesome, thanks!

11:50 TimMc: tbaldridge: The only thing I don't like about greekifying (fn) is that it screws with column counts.

11:50 duck1123: For as many options and bindings that emacs has hidden all over, it tries hard to make them discoverable for you

11:50 TimMc: and it looks horrible over putty. (I blame putty for that)

11:51 S11001001: duck1123: need to change putty terminal encoding

11:51 tbaldridge: duck1121: or just blame windows...everyone else does

11:51 wingy: for those who read Programming Clojure .. you recall how many days it took you to read it through? it's on 630 pages

11:51 ro_st: and thanks for the suggestion its an excellent beginner book

11:51 ro_st: wingy: about a week. i skimmed some stuff, like the sections on numerical stuff

11:51 uvtc: It's not reading that takes time, it's working through the stuff.

11:52 arrdem: wingy: two days... I was already familiar with Lisps

11:52 wingy: uvtc: yeah thats what i mean

11:52 ro_st: my pleasure. it's a great book

11:52 nDuff: wingy: It really _isn't_ the size -- I was rereading Joy of Clojure for months before everything clicked.

11:52 ro_st: gotta run!

11:53 wingy: i think i can make 50 pages per day .. that would be 11 days more for the entire book .. my goal initially was 2 days :)

11:53 uvtc: But it also takes time for things to sink in, IMO.

11:53 wingy: yeah i always reflect and play with the repl

11:54 nDuff: Exactly -- if it only takes one pass through the book to fully grok its contents, you're doing remarkably well.

11:55 wingy: nDuff: i hate to leave things behind .. since i know i always have to go back to get it later

11:55 nDuff: wingy: I usually find that multiple passes means that the second time you read something there's more context to understand it with, and thus more value to be gained, even if it seemed to make sense the first time.

11:56 arrdem: can I get some help with a macro? it's java-parser test here... https://github.com/rdmckenzie/Doubletake/blob/lang-java/test/doubletake/lang/test/java.clj

11:57 qbert_: oh. my. god. Overtone! Holy jesus!

11:57 arrdem: the desired behavior is that it will define a test with an otherwise unbound name symbol passed as an argument, but instead it just re-defs the name "test-name"

11:58 wingy: nDuff: always for me as well .. good to read many different books though since time is a constraint

11:58 you get things explained from another perspective with other words and also they cover something else the previous ones didnt

11:58 RickInGA: qbert_: hehe

11:58 nDuff: *nod*.

11:58 wingy: and books come out all the time for new versions .. kinda give you an excuse for reading new books on the same topic :)

11:59 sometimes i could pause the time and just read books for a year

11:59 that would give me a lot of knowledge :)

11:59 sometimes i wished..

12:00 TimMc: duck1123: Try KiTTY.

12:00 nDuff: qbert_: Just now getting familiar with Overtone? The presentation at last year's conj was great.

12:00 RickInGA: wingy: I have kind of gotten in a trap where the more I learn, the more I realize I don't know.

12:01 wingy: RickInGA: its reality

12:01 duck1123: TimMc: I just try to avoid windows.

12:01 wingy: and its good to embrace it .. once we start thinking we have all the answers we stop looking .. and won't get smarter

12:06 atm i have to jump between repl and doc for every lookup, hope Light Table will be released soon so I can have the function's description there just by clicking on it

12:08 cgag: well if you already have the function name you can do (doc fn) or (source fn)

12:10 wingy: cgag: using Light Table .. feels its giving a better transparency in how the code flows .. and have to use the online doc for they are showing examples

12:10 qbert_: nDuff, is it online anywhere ? I've haven't been this excited in a long long time

12:10 wingy: didn't know about source .. seems much better than doc

12:11 qbert_: I don't see how I can get any work done now, going home to read my clojure books, biab

12:13 TimMc: wingy: There's also some ClojureDocs lib you can use from the REPL.

12:16 antares_: JulioBarros: I pushed monger 1.1.0-SNAPSHOT with Clojure reader extensions, let me know how that goes

12:28 dnolen: hmm when protocols are only 1-3 methods, delegation is really pretty simple ...

12:47 stain: anyone of you doing RDF or Linked Data with Clojure?

12:47 gtrak: yea

12:50 stain: gtrak: what libraries do you use, just straight to the bone to jena/sesame or a sparql endpoint, or have you got something nice on github for me? :)

12:50 https://github.com/stuartsierra/clojure-rdf is 3 years old ..

12:51 I've started on a interface to owl-api, but it is very low-level and not very good for "I just want to pump out 6 lines of Turtle"

12:52 you use CRG?

12:52 gtrak: I work with the guy that wrote it

12:52 I haven't yet had a chance to take a deep look though

12:54 stain: we have libs that wrap jena, and libs to manipulate graphs more natively, I think that's the purpose of CRG. I also thought I saw something similar come out recently from someone else

12:55 stain: seems nice, but lack of import AND export is a bit of a killer.. ;)

12:55 OK.. this jena lib is non-opensource?

12:55 gtrak: yea, I was looking at what it would take to do a turtle parser as a hobby project :-)

12:55 stain: ours isn't open, I think clj-plaza might help though?

12:56 stain: well, as long as you take Turtle and not N3 it should not be too bad

12:56 gtrak: trying to remember what the other thing was

12:58 stain: gtrak: thanks, that does support Turtle, but not sure if it is very Clojurish, with stuff like (alter-root-rdf-ns "http://www.example.org/&quot;)

12:58 gtrak: stain: https://github.com/drlivingston/kr

12:58 stain: I'll give it a try.. hopefullý it's just a few bindings away

12:58 gtrak: I think that's what I saw a little while back

12:58 stain: talk about useless project names!

12:59 gtrak: that one looks great, it uses sesame or jena

13:00 gtrak: yea.. I've looked a bit at the jena api, it's ... complicated

13:01 stain: yes, it is not one of my favourites..

13:01 gtrak: there's all these parallel hierarchies to plug in inference stuff

13:01 stain: I try to use Sesame if I can, but that is a bit more of a powerhog I feel

13:01 kind of like postgresql vs mysql

13:01 gtrak: CRG is just a graph-manipulation and indexing thing, it needs a turtle parser

13:02 CRG is basically MRG in clojure

13:02 http://code.google.com/p/mrg/

13:02 stain: yeah, I think I'll try KR for now. Ideally CRG with a turtle export would be all I need.. in theory I could write a not-so-clever Turtle output myself.. but perhaps not for now (deadline is tomorrow)

13:03 gtrak: MRG actually uses ARP to parse stuff i think :-)

13:05 duck1123: If you're using clj-plaza, you might want to check out my fork. The official one is pretty old. (although mine isn't much better)

13:07 nuclearsandwich: technomancy: pong

13:07 stain: duck1123: yeah, I saw that

13:07 qubit[01]: so, to my dev envirnvoment, I want swank, slime, live emacs, anything else ?

13:07 stain: duck1123: so what's good about clj-plaza?

13:08 technomancy: nuclearsandwich: oh, I opened an issue for my question: https://github.com/nuclearsandwich/swarming/issues/1

13:08 duck1123: it makes it easy to work with rdf models. I haven't really tried many of the other libraries that are out now

13:08 it suits my needs

13:09 nuclearsandwich: technomancy: to which I just replied. Sorry for the delay. My email is messed up by this Apple I'm using. :\

13:09 kaoD: is there any good way to step-debug Clojure code in Emacs?

13:10 I'm so tired of prints/debug macros

13:10 nuclearsandwich: I forked swarming just before jumping on a plane and then a week later mosh was released and I stopped working on it til I had time to see if mosh would be easier than ssh.

13:11 technomancy: nuclearsandwich: gotcha

13:11 fenton: qubit[01]: I haven't been using live emacs, but I've got some notes on setting up dev environment here: https://github.com/ftravers/PublicDocumentation/blob/master/clojure-development-setup.md

13:11 xumingmingv: kaoD, try CDT? (myself have not tried it though..)

13:11 qubit[01]: fenton, perfect thank you

13:11 stain: duck1123: I'll have a look.. your fork is not in clojars?

13:12 fenton: kaoD: I've got some notes about setting up CDT (Clojure Debugging Toolkit?) here too: https://github.com/ftravers/PublicDocumentation/blob/master/clojure-development-setup.md, but i've found it a bit weird...

13:12 kaoD: xumingmingv, not sure what CDT is, let me Google that

13:12 oh, thanks fenton

13:13 stain: duck1123: oh, found it, net.kronkltd/plaza

13:13 duck vs kronk confused me ;)

13:13 fenton: kaoD: just look for the debugging section at the bottom...it's using CDT.

13:14 kaoD: oh, that looks promising

13:14 xumingmingv: For debugging, I have a dream...to have something like the debugging feature in Eclipse for java, dont know it is not easy to implement? or just no one implement it?

13:15 technomancy: xumingmingv: it's not common because you have to be in a really nasty situation to actually need stepping

13:16 for well-factored code the repl and occasional break-repl is enough

13:16 fenton: xumingmingv: functional programming, from what i understand so far as a newbie, is built up bit by bit, and shouldn't catch you by surprise like happens in java

13:16 with global data...

13:17 technomancy: the only time I used CDT was to track down what turned out to be a bug in Clojure itself

13:18 TimMc: Still need it from time to time.

13:18 fenton: its a mind set change for newbies to clojure coming from java...we are soooo used to a debugger, and can't understand how to live without it...

13:18 gtrak: technomancy: what is this break-repl you speak of?

13:18 TimMc: Well, *desire* it.

13:19 technomancy: gtrak: (swank.core/break)

13:19 kaoD: fenton, IMHO, a debugger is an awesome tool

13:20 it can save lots of typing when trying to debug code

13:20 technomancy: gtrak: http://hugoduncan.org/post/2010/swank_clojure_gets_a_break_with_the_local_environment.xhtml

13:20 gtrak: ah

13:21 qubit[01]: hmm, cant find out where to get swank

13:21 gtrak: qubit[01]: try the lein plugin

13:23 qubit[01]: gtrak, ok, I have this in my ~/.lien/profiles , [lein-swank "1.4.4"]

13:23 Debugger entered--Lisp error: (error "Could not start swank server: /bin/bash

13:24 where do I find swank itself ?

13:25 gtrak: there's clojure-jack-in on the emacs side, and lein swank if you want to start the swank server from cmd-line

13:25 clojure-jack-in actually runs lein swank I believe

13:25 if you start it yourself, you can connect with M-x slime-connect

13:25 kaoD: gtrak, yes, it does

13:25 nDuff: ...also, you can use clojure-swank and start the server yourself if your environment is too involved to be launchable via lein

13:26 * nDuff is writing JIRA plugins, so that's very much the case for him.

13:26 duck1123: The plus side of launching swank from within your environment is all your nses are already required/loaded

13:27 gtrak: duck1123: hmm? I never a difference like that, what do you mean?

13:28 kaoD: duck1123, I am not sure what you mean either

13:28 gtrak: never noticed*

13:28 kaoD: M-x calls lein swank, so...

13:28 wingy: same thing different styles I supposed: https://gist.github.com/3005550 which one is more appropriate?

13:28 or simpler in the long run

13:29 duck1123: If I just to lein swank, I need to require a namespace before I can C-c C-k to it. When I load swank from my main, all the nses are already loaded by my app, so I can jump right to the one I want

13:29 C-c M-p

13:29 gtrak: wingy: second is clearer to me

13:29 sorry, the first

13:29 * gtrak needs to not drink so much

13:29 qubit[01]: lein swank , is not a task ?

13:30 using the 2.x preview found here https://github.com/technomancy/leiningen/

13:30 gtrak: lein swank starts the server

13:30 fenton: I recommend just running M-x clojure-jack-in from emacs...its starts swank for you... you only need to install clojure-mode and off you go...

13:31 devn: clj-time/jodatime question: I have a date like: "Jun 26 17:21:05" -- I tried to create a custom formatter to parse it, but I was unsuccessful: (def custom-formatter (tf/formatter "M ee HH:mm:ss"))

13:31 fenton: here is my workflow documented: https://github.com/ftravers/PublicDocumentation/blob/master/clojure.md#basic-workflow

13:31 qubit[01]: if I do lein swank, I get the error, swank is not a task, If I do clojure-jack-in , I get Debugger entered--Lisp error: (error "Could not start swank server: jack-in is not a task. Use \"lein help\" to list all tasks.

13:32 nDuff: qubit[01]: what version of lein are you running?

13:32 fenton: have you specified lein-swank as a plugin in your project.clj file?

13:32 qubit[01]: this one https://raw.github.com/technomancy/leiningen/preview/bin/lein

13:32 nDuff: See the readme at https://github.com/technomancy/swank-clojure/ discussing installing the lein-swank plugin

13:33 scriptor: anyone have any links handy to clojurescript codebases?

13:33 qubit[01]: fenton, doh, I had it in ~./lien, sec

13:33 scriptor: just to see some examples of how they're laid out

13:33 fenton: qubit[01]: have a look at my workflow doc...it's all there...

13:33 gtrak: qubit[01]: lein can download it automatically for you

13:35 qubit[01]: yeah, all of the problems were because I had misnamed it lein, it works!

13:35 lien*

13:35 wingy: a lot of abbreviations in clojure

13:35 is that a good or bad things?

13:35 strs instead of strings

13:35 foxdonut: abbreviation is such a long word :)

13:36 fenton: lol

13:36 tbaldridge: wingy: I think long variable names are more needed in OOP when you have massive classes and you're trying to keep 20 members straight

13:36 wingy: yeah

13:36 tbaldridge: in clojure if you only have 3 inputs to your pure function, name them a and b instead of something longer

13:37 wingy: right

13:37 so abbrs are good

13:38 duck1123: also, with the way clojure indentation works, if your names are too long, it quickly pushes everything too far over and you have to resort to tricks to keep it from going to far.

13:38 TimMc: Short enough to be interesting, long enough to cover everything.

13:38 Wait, that's essays, and also skirts. (Thank you, 8th grade English teacher.)

13:39 tbaldridge: for which one?

13:39 tmciver: TimMc: lol!

13:40 TimMc: tbaldridge: For that guideline.

13:49 muhoo: heh, having to touch some code in another language for the first time in months, i started a comment with ;;

13:49 gtrak: why another language?!?!?!

13:49 jodaro: don't do it!

13:49 muhoo: um, fixing bugs.

13:49 jodaro: fix them in clojure

13:49 kaoD: gtrak, I do Python at work :(

13:49 muhoo: i write it, i maintain it. them's the rules.

13:49 gtrak: :-(

13:50 kaoD: at least I get to use emacs

13:50 muhoo: i am finally now deciding to try to build a product, instead of looking for clojure contract gigs

13:50 i've been lucky, but it seems everyone doing clojure is looking for full-timers

13:55 jodaro: i tried to get the contractor thing going here but was given a long explanation as to why we 'prefer' fte

13:56 so now i get to do all the work myself

13:56 he

13:56 h

13:56 technomancy: going with clojure is a big risk from a hiring perspective; I can see why many wouldn't want to compound that risk with contractors

13:57 kaoD: okay, another question about coding style: https://gist.github.com/3005694

13:58 jodaro: true, though to get some extra helping hands when you already have some full timers on board, i think its a decent risk

13:59 technomancy: kaoD: I'd go with the shorter approach; I like to write with :require :as in mind

13:59 duck1123: require vs use/only is pretty much a matter of style choice for the particular code you're writting IMO

13:59 nvm, misunderstood the question

14:00 kaoD: technomancy thanks, that's what I thought

14:00 technomancy: I wonder if we could get someone to create a setup.exe type installer for Leiningen on Windows

14:01 kaoD: technomancy, what do you mean exactly? I might volunteer

14:01 I use Win from time to time

14:01 technomancy: kaoD: right now lein on windows involves either installing curl or manually tracking down jars and putting them in exactly the right place

14:02 it's kind of lame; I guess wizard-style installers are more common on Windows

14:02 since there isn't any system-level package management

14:02 kaoD: technomancy, sure? I don't remember doing that under Win

14:02 IIRC, I just downloaded a batch file and ran it

14:02 although that was Lein 1.7

14:03 technomancy: that only works if you have an HTTP client present

14:03 maybe you have wget via cygwin or something?

14:03 kaoD: yep, I have native wget

14:03 gtrak: http://nsis.sourceforge.net/Features <-- it can download stuff

14:04 devn: jodaro: maybe you could approach that same question but more along the lines of "contractor who has the added benefit of training others"?

14:04 technomancy: gtrak: interesting; that's even packaged in apt

14:04 would be nice if I could generate installers myself

14:05 gtrak: it came from winamp way back when, I believe

14:06 elliottw: hey, i'm just learning about multimethods, and is there any implementation of them allowing for a varied number of arguements? does that make sense?

14:07 kaoD: elliottw, that doesn't make sense

14:07 Clojure has native overloading by arity

14:07 technomancy: elliottw: multimethod dispatch functions are just regular functions; nothing special about them

14:07 elliottw: so i mean, i want to have a list of tags associated with a piece of data, and depending on what those tags are, do a certain thing

14:08 kaoD: elliottw, tags?

14:08 elliottw: sorry. for example, i want to write a program that titlecases a sentence

14:09 if a small word is in the sentence, then keep it lowercase

14:09 if that small word is the first or last word capitalize it

14:09 kaoD: if I got what you mean, multimethods aren't meant for that

14:10 just map over the collection

14:10 raek: but it is possible with multimethods, though

14:10 elliottw: the issue is that i want to easily add new "tags"

14:11 kaoD: I wouldn't classify the multimethod approach as easy

14:11 just keep a map of tags

14:11 and update it when needed

14:11 much cleaner, much more functional

14:12 you can even have functions instead of a map

14:12 (and maps can work as functions too)

14:12 raek: it seems that in this case much of the logis is in finding out which tags apply

14:12 *logic

14:12 elliottw: so right now there are some conditions, :first-word, :small-word, :camelcase, :email, :url

14:13 and depending on how they interact, I want to run a different f

14:13 kaoD: you just need a function that encodes the logic

14:13 elliottw: so if i pass in :small-word and :first-word, then capitalize

14:13 raek: multimethods are useful when you have a fixed number of values to dispatch on (usually one)

14:13 elliottw: if i pass in just :small-word dont' capitalize

14:14 kaoD: elliottw, so what's wrong with cond?

14:14 elliottw: i'm using cond right now and it's getting huge

14:15 raek: I think a cond sounds most straight forward here too. you need to encode the priority of the rules somehow too

14:15 kaoD: elliottw, then craft a CoR pattern

14:15 chain of responsibility

14:15 elliottw: ? wow, that's new to me. sorry i'm just starting out on clojure

14:15 kaoD: don't worry

14:15 but that's not Clojure's

14:15 it's a general programming pattern

14:15 elliottw: i've never coded before

14:15 googling now

14:15 kaoD: oh, I see

14:16 in short: think of it like a chain of handlers

14:16 the first handler (a function) takes some data and acts accordingly

14:16 that includes possible passing it to the next handler in the chain

14:16 raek: you could have a list of predicate-action pairs (where an "action" is capitalize or lowercase)

14:17 try each predicate in turn and when one of them returns truthy, invoke the action and stop

14:17 kaoD: raek, that's kind of what I mean

14:18 although with CoR several rules can apply

14:18 (and the event can be consumed too)

14:18 elliottw: interesting

14:19 kaoD: in fact, it's just a special case of what you mean, it's just not boolean (truthy=stop, falsey=keep trying)

14:19 you can even forget about the CoR and just create little handlers and thread them

14:20 (just like Ring handlers)

14:20 elliottw: oh

14:21 isn't that what cond is? test the first condition, if fail, keep moving?

14:21 kaoD: cond is more like what raek means

14:21 it's just a runtime cond

14:21 you can add and remove predicates-actions as you wish

14:21 elliottw: so here is my code now. be gentle this is the first real program evar

14:21 https://github.com/elliottw/titlecase/blob/master/src/noir_bootstrap/views/welcome.clj

14:22 kaoD: elliottw, may I ask: why did you choose Clojure to begin programming?

14:22 elliottw: lol

14:23 it's seemed the most academically interesting

14:23 i've written small scripts in perl, and was thinking of trying perl 6, but clojure seemed more different than every other language

14:23 and it seems hard, which i like

14:24 kaoD: well, for a simple approach you could do raek's suggestion

14:25 let me craft a little magic

14:25 elliottw: kaoD k

14:27 amalloy: elliottw: i'm not going to read enough to comment on your actual algorithm but, for example, in-list? could use some work. if i were writing it by hand, it'd look like (and (seq word-list) (or (= word (first word-list)) (in-list? word (rest word-list))))

14:27 but in real life i'd just write it as (some #{word} word-list)

14:29 and good on you for using join. your perl heritage, i guess; a lot of people wind up reimplementing that using lazy sequences

14:30 elliottw: sorry for my blatant ignorance. i started this project when i started chapter 1 of a clojure book, and so i built it using the tools of the first few chapters. now i'm realizing how i did everything wrong

14:31 amalloy i didn't even know about #{whatev} when i wrote that f. guess that's what happens whens you don't read first

14:31 amalloy: that's how it goes

14:31 uvtc: Nothing wrong with doing everything wrong. :)

14:31 amalloy: hah, i like that phrasing

14:32 uvtc: (er, {small print} only applies in this particular instance. Offer expires upon expiration. No refunds or exchanges.)

14:32 elliottw: a friend challenged me to write a webapp in clojure in a month in my spare time. i learned a lot not knowing anything about anything before this

14:33 adu: I challenge you to write a webapp in clojure in a day, I did

14:34 cgag: as your first program?

14:34 adu: well, my first program was hello world

14:34 elliottw: adu it took half a day to sign up for prgmr.com, install ubuntu, jvm, clojure/lein, noir

14:35 amalloy: elliottw: i wonder...it seems like you might be the target audience for ibdknox's light-table demo

14:35 elliottw: i saw that and almost shat myself

14:35 i'm messing around with the "playground" now

14:35 amalloy: sweet. you might also like 4clojure.com

14:36 elliottw: amalloy just saw this today, and am going to run through a bunch

14:38 i just wish it had vim keybindings

14:38 cgag: i think it does / will

14:39 technomancy: that's your browser's job

14:39 amalloy: elliottw: you can disable the javascript and set your browser up to do it

14:39 assuming you're talking about 4clojure and not light table - probably no good to disable js for light table

14:39 elliottw: yeah i was talking about light table

14:40 amalloy: well, ibdknox uses vim. but keybindings are probably not his priority

14:40 cgag: isn't it built on codemirror, i heard that already has an attempt at vim bindings

14:40 elliottw: amalloy i don't understand why he joined yc if he already got like 300k

14:41 amalloy: contacts are worth more than money in the startup world, i suspect

14:41 pandeiro: phantomjs takes how many days to compile?

14:41 uvtc: elliottw, are you happy with prgmr? Prices look good.

14:43 shawnlewis: what do I need to :require to make pprint available to a browser connected (clojurescript) repl?

14:44 elliottw: uvtc you get what you pay for. it's great if you just want root access and to be left alone. but i upgraded to a higher plan and it took the guy two weeks to actually give me more resources

14:46 uvtc: elliottw, thanks!

14:47 elliottw, if your site wasn't under a lot of load, perhaps they looked at the logs and figured it wasn't too high priority? Hm.

14:47 elliottw: also pinboard uses prgmr for the site and if you read his blog, he seems to know what he's doing

14:48 uvtc i ran out of space. i think just the os plus JVM took up my .5 or 1gb of disc space, so i couldn't do anything until i got the upgrad

14:48 e

14:49 uvtc: elliottw,: Ah. Thanks. I've heard them recommended elsewhere. May finally make the leap of shared hosting and give them a try.

14:49 s/of/out of/

14:50 elliottw: uvtc i was on one of those big box unlimited everything shared hosting plans, and i definitely like prgmr a lot more. root access just makes a lot of things simpler. but now i kind of wish i did this first project on heroku

14:50 cgag: linode is more expensive, but i've been happy with them

14:50 amalloy: yes, linode is pretty excellent if you don't mind the money

14:51 elliottw: linode is awesome, just hard for me to justify with personal projects.

14:51 uvtc: I'm using hurricane electric at the moment. The el-cheapo shared hosting plan I'm on is actually no longer even offered.

14:51 elliottw: their library of help files got me through a lot

14:51 y3di: how can I do local running for noir apps? I have lein and swank-clojure installed.

14:51 uvtc: But they've been good.

14:52 amalloy: uvtc: i have a linode that lives in HE's colo

14:52 uvtc: (el-cheapo meaning least expensive)

14:52 amalloy, they seem quite professional, from my dealings with them.

14:52 elliottw: y3di i just followed these directions http://webnoir.org/#started

14:53 amalloy: uvtc: there was a really bad week or so around a year ago, when someone was DDoSing HE's fremont location

14:53 y3di: thanks elliottw, i'll take a look

15:01 amalloy: dnolen: reading through the little schemer, it seems to me like (conde ((some test) (result))) is equivalent to (conde (#s (some test) (result))), because they're both goals - is there something i'm misunderstanding?

15:02 dnolen: amalloy: yes a "line" is a conjunction. ST ^ R, vs. s# ^ ST ^ R

15:02 s# will always succeed so those expressions are equivalent.

15:02 amalloy: okay, that's about what i figured out. just thinking of it as a conjunction rather than a test/result pair makes it more sensible-seeming

15:02 clojurebot: but it gets you the balanced pairs, which is the important part IME

15:03 amalloy: cool, that's perfect. conde is like a built-in disjunction of conjunctions, which is lovely

15:03 elliottw: where did kaoD go?

15:03 dnolen: amalloy: yes

15:12 uvtc: What is the "test" in an if-let? Is if-let simply checking the truthiness of the local you bind a value to?

15:13 In the docs for if-let, what does "bindings => binding-form test" mean?

15:17 amalloy: uvtc: well, it's checking the truthiness of the value before binding it to a local

15:19 uvtc: amalloy, thanks.

15:20 amalloy, oh, right. Not sure what else I was expecting it to do. :)

15:21 Saves you from doing (if ... (let [...] ...)).

15:22 I guess I was execting the docs to say: `bindings => [local test-expr]`.

15:24 y3di: clojure-jack-in doesn't seem to work in lein noir projects, however works find in generic lein projects

15:24 has anyone else had this issue/know how to fix it?

15:24 xeqi: uvtc: binding-form implies you can destructure it

15:26 uvtc: Ah. Ok, thanks, xeqi.

15:27 But the `test` is performing double-duty. Not only is it providing values (or not) for the binding-form, it's also determining whether the body of the if-let gets evaluated.

15:29 tbaldridge: uvtc: that's correct

15:30 uvtc: tbaldridge, thanks.

15:31 tbaldridge: I'm not sure how comfortable you are with reading macros, but reading the source helped me clear this up a bit : http://clojuredocs.org/clojure_core/clojure.core/if-let#source

15:32 uvtc: tbaldridge: Have not yet made it to that chapter. :) But once I do, I'll take a look. Thanks for the link.

15:38 amalloy: dnolen: btw, since github took away the "message this user" feature, the note in the core.logic readme suggesting to message you on github doesn't quite make sense

15:39 kaoD: elliottw, https://gist.github.com/3006297 <- this is raek's idea (or what I understood of it)

15:41 dnolen: amalloy: oh right, thanks for the heads up.

15:43 kaoD: elliottw, and here used with map https://gist.github.com/3006297

15:44 sry, this -> https://gist.github.com/3006297

15:44 ah, it's always the last revision, nervemind

15:55 uvtc: I've noticed that reduce is sometimes used to populate a hash-map (when you're computing the keys/values from a coll). I'd've thought that a loop might be used for that. Here's an example of both: https://gist.github.com/3006397 . Is there a more common way to populate a hash-map using values computed from a coll?

15:58 Hm. zipmap maybe.

16:00 wingy: isn't declarative programming languages like clojure using imperative coding underneath?

16:00 i imagine that someone has to tell the computer what to do

16:01 ivan: Clojure is mostly not declarative

16:01 technomancy: wingy: of course; computers actually run opcodes in machine language

16:01 ohpauleez: uvtc: Typically you use reduce to grow a collection, and zipmap, interleave, and partition (usually as a stepping function)

16:01 to build or stitch together

16:02 technomancy: wingy: the whole point of having a compiler is so you don't have to think in terms of machine language

16:03 uvtc: ohpauleez, Ah. Yes. Thanks. Actually, it ocurred to me that maybe there's some way to use `hash-map` with `for`...

16:04 ohpauleez: uvtc: More commonly is to use higher-order functions than raw loops

16:04 uvtc: ,(for [n (range 5)] [n (* n n)])

16:04 clojurebot: ([0 0] [1 1] [2 4] [3 9] [4 16])

16:04 * uvtc looking for a way to turn that into a hash-map...

16:05 ohpauleez: zipmap

16:05 cgag: ,(into {} (for [n (range 5)] [n (* n n)]))

16:05 clojurebot: {0 0, 1 1, 2 4, 3 9, 4 16}

16:05 amalloy: uvtc: into/for

16:05 (inc cgag)

16:05 lazybot: ⇒ 1

16:05 ohpauleez: or that

16:05 uvtc: Oh, of course. Thanks!

16:05 ohpauleez: zip map is if you have two collections you want to lace together

16:06 but what you probably want is a vector of just the values, no?

16:06 since you're just using integer keys?

16:07 dnolen: wingy: it's also possible to embed a more declarative paradigm - that's the idea behind core.logic.

16:07 uvtc: ohpauleez, just experimenting with creating hash-maps at the moment. Thanks though.

16:07 ohpauleez: ahh, gotcha

16:10 wingy: ivan: could you elaborate?

16:10 clojurebot: Huh?

16:11 wingy: clojurebot: ?

16:11 clojurebot: excusez-moi

16:12 wingy: or perhaps i won't even have the knowledge to understand any explanations yet :)

16:18 nizze: Hello. I'm learning clojure and I noticed that it's making my brain really tired. It seems that I have to spend more time thinking than writing...

16:21 ivan: wingy: it's functional and imperative

16:22 Raynes: nizze: Most people feel that is a good thing.

16:22 ivan: wingy: core.logic or datalog would be declarative

16:25 nDuff: nizze: ...see also Rich Hickey's essay on hammock-driven development.

16:25 s/essay/talk/

16:25 wingy: ivan: what is core.logic?

16:25 ivan: https://github.com/clojure/core.logic/

16:25 dnolen: wingy: I disagree with ivan - imperative -> declarative is a spectrum. FP tends to be more declarative then imperative OO. LP (logic programming) takes it further.

16:26 jtoy: what is wrong with this name: lein new 3iagents => Sorry, project names must be valid Clojure symbols.

16:26 cgag: can't start a symbol with a number

16:27 amalloy: dnolen: btw, what is the recommended "import style" for core.logic? 'use all of the things i'll need, and exclude clojure.core/== and other clashes? or require core.logic :as logic or something?

16:27 jtoy: oh, ic

16:30 wingy: dnolen: yeah clojure seems far more declarative than typical oop langs

16:31 jtoy: wingy: is that bad?

16:32 wingy: jtoy: no i feel declarative styles make you more productive and eliminates more bugs

16:33 jtoy: is it fine to use clojure for calling lots of command line stuff, is there anything i should know about this and/or any libraries to use?

16:33 i will be calling rm/mv/lzop many times in my clojure code

16:34 nickmbailey: jtoy: http://clojure.github.com/clojure/clojure.java.shell-api.html

16:35 the jvm itself can have a pretty big overhead for forking processes though

16:35 technomancy: jtoy: don't shell out for simple things like mv and rm

16:36 jtoy: nickmbailey: yeah, for mv/rm i don't need the shell, but i need it for lzop, which i will call many times (long live process with thousands of calls an hour)

16:37 any libraries you guys recommend for turning my code into a deamon ?

16:37 KirinDave: technomancy: Hey, is it possible to tell lein to include arbitrary maven plugins?

16:38 technomancy: when generating the pom file

16:38 technomancy: KirinDave: there's a branch for that I think

16:38 lemme see

16:38 KirinDave: https://github.com/technomancy/leiningen/pull/454

16:39 pull req needs to be cleaned up and generalized, but I think the basic idea is sound

16:39 jodaro: jtoy: there is this: https://github.com/arohner/lein-daemon

16:39 KirinDave: I see.

16:39 I guess for now I'll shellhack the pom file.

16:39 I need this stuff out today.

16:39 jtoy: jodaro: just saw that, is that what people actually use?

16:39 KirinDave: And our existing deploy methodology is heavily integrated with scala-centric pom files.

16:40 Oh Jenkins, you are agony.

16:40 technomancy: KirinDave: add-hook on xml-tags might work too

16:40 KirinDave: hopefully it'll be in the final 2.0.0 release

16:41 KirinDave: technomancy: Well let me toss in a +1 for that idea.

16:41 jodaro: jtoy: not sure. you might look at the apache commons stuff too

16:41 KirinDave: pom files are an ugly but necessary part of life.

16:41 jodaro: depends on what kind of daemony things you want i guess

16:41 KirinDave: Esp plugins like assembly.

16:41 technomancy: KirinDave: was thinking of doing a release today, but if you want to tackle it I could push it to tomorrow =)

16:42 KirinDave: technomancy: I have a lot more to do today than just this. Sorry.

16:42 technomancy: no worries

16:42 KirinDave: And one of my hounds was keeping me up all night sick. Bummer for me

16:42 technomancy: it'd probably be easy to port to a plugin once the implementation is there if you want it before 2.0.0 goes final

16:43 nickmbailey: jtoy: i would look for a native java lzo library before i went with the shell route

16:44 jtoy: nickmbailey: really? command line is that bloated/slow?

16:44 technomancy: java kind of ... pretends unix doesn't exist

16:44 as much as it can get away with

16:45 nickmbailey: running a shell command requires forking the process, which can be slow for the jvm especially if you have a really large heap

16:45 technomancy: and there's a bug in some versions of the JVM where it temporarily requires 2x the heap size to fork

16:45 jodaro: if you have a c library you can wrap it with jna

16:46 technomancy: hiredman: are you guys still working around that?

16:47 hiredman: technomancy: yes

16:49 technomancy: =\

16:50 hiredman: of course we are still on 1.6

16:52 technomancy: if anyone's running lein from git, could you update and try it out?

16:52 hoping to release the current contents of master as 2.0.0-preview7 within 24 hours and would like to get any potential issues caught first

16:54 cgag: when does 2.0.0 become the standard?

16:55 technomancy: cgag: once the clojars releases repository is populated enough to make it a feasible default

16:55 the lein faq has details

16:56 antares_: technomancy: just tried with a few repos, works well

16:57 technomancy: yay

16:58 jtoy: in leiningen what is the diff between dependencies and dev-dependencies?

16:59 technomancy: dev-dependencies are an old thing that leiningen 1.x used to use

16:59 jtoy: I'm still on 1.x because the website says its still hasn't reached rc

17:00 uvtc: What is the purpose of naming a local the same as a var? That is, if you've got `(def x 3)`, then elsewhere, in some function, `(let [x x] ...)`?

17:00 technomancy: even on 1.7.x you should use :plugins over :dev-dependencies

17:00 jtoy: but at this point it's safe to upgrade to 2.x; the only reason it's not finalized is a technicality

17:00 xeqi: .. unless you actually want a dev-dependency?

17:00 aperiodic: technomancy: seems ok from here

17:00 uvtc: The "Clojure Programming" book does this on p.147 (the defn maze example).

17:01 Which is a doozie, I might add. :)

17:01 technomancy: xeqi: valid use cases are few and far between

17:01 cgag: uvtc: ha yeah it is

17:02 amalloy: welllll, the main reason is if you need to switch from dynamic binding to lexical binding, eg because you expect to use that value in a different dynamic scope but need its current value

17:02 duck11231: Didn't this same question come up last week? Is it using a macro anywhere?

17:03 jtoy: if i include a dependency that is on clojars and I get errors such as "1 required artifact is missing." is that something i need to fix, or is it a problem with the libraries on clojars?

17:03 borkdude: technomancy I will try to build and test it on windows xp also

17:03 technomancy: borkdude: you're a champ =)

17:03 jtoy: I'm trying to add [clj-aws-s3 "0.3.2"] , and it just errors out when i do lein deps

17:04 uvtc: amalloy, I don't see it using a dynamic variable ... Hm. I also don't see any macros in there.

17:04 technomancy: jtoy: looks like a bug in the library

17:04 jtoy: jets3t is easy to use for publishing to s3

17:04 jtoy: hmm, i guess people aren't actually using these libraries, wtf

17:04 that is not very encouraging

17:05 technomancy: there are abandoned broken libraries in every language and runtime

17:05 hm; that one's from weavejester though; he's usually pretty good about that kind of thing

17:06 duck11231: I tried adding it as a plugin (cause that buffer was open) and it seems to lein deps for me

17:07 technomancy: jtoy: works for me

17:09 jtoy: technomancy: here is my project, http://pastebin.ca/2165124 is anything wrong with it? if i comment out clj-aws-s3 it works

17:11 technomancy: jtoy: hm; it could be a 1.x problem I guess?

17:11 see if 2.x works maybe?

17:12 jtoy: technomancy: ok i will try that, is it fine to use lein1 and 2 together on the same system, i have a bunch of projects that use lein 1

17:12 technomancy: yeah, it's fine

17:12 duck11231: just rename one lein2 or lein1.7

17:14 borkdude: technomancy is it expected that leiningen downloads lein-newnew when first run (this happens on me in Windows XP)

17:15 jcrossley3: cemerick: thx for the rt :)

17:15 uvtc: amalloy, thanks for the answer earlier, btw.

17:15 jtoy: technomancy: running the new lein with "lein repl", I just get a bunch of permission denied errors

17:15 technomancy: borkdude: yeah, that's in order to allow it to be updated independently of lein

17:16 cemerick: jcrossley3: Sure thing. Looks like good stuff, per usual. :-)

17:16 jcrossley3: :)

17:16 borkdude: technomancy ok.. lein prints its tasks now in preview7 in XP, great ;-)

17:16 technomancy: borkdude: progress!

17:16 jtoy: filesystem permissions or remote permissions?

17:17 jtoy: technomancy: Could not transfer metadata clojure-twitter:clojure-twitter:1.2.6-SNAPSHOT/maven-metadata.xml from/to central (http://repo1.maven.org/maven2): Permission denied

17:17 technomancy: viewing that link in http doesn't work for me, it could be my network then

17:17 technomancy: that's weird but shouldn't be fatal

17:18 I mean it's not related to the aws dependency

17:18 jtoy: hmm, I hope my system is not borked

17:19 cemerick: jcrossley3: would it be absurd to use immutant on heroku or something like elastic beanstalk?

17:20 I've never used jboss, so perhaps that's a dumb question. :-P

17:21 jcrossley3: cemerick: we've discussed it with heroku engineers (don't remember who, they gave a talk at arug here) for torquebox

17:21 hiredman: my experience with bits of jboss lead me to believe it's discovery (based on jgroups) is a. pretty brittle b. hard to swap out

17:21 jcrossley3: cemerick: it comes down to the number of ports it wants to open iirc

17:21 borkdude: technomancy congrats, works for me on OSX and XP

17:21 technomancy: borkdude: thanks!

17:22 tcrawley: cemerick: you can, however, use immutant on openshift now with a little hacking. I don't know what the performance is like though

17:22 jcrossley3: cemerick: we'd love to have both torquebox and immutant (and jboss for that matter) running on heroku, but we're kinda focusing on openshift right now.

17:22 borkdude: technomancy let's try now with throwing .m2 away...

17:22 hiredman: jcrossley3: how do you think the jgroups discovery would work on a network where multicast isn't allowed and processes might get killed and moved (ec2 or heroku)

17:22 cemerick: jcrossley3: Right. Presumably not a problem on beanstalk, then.

17:23 hiredman: (the jgroups thing is sort of a peeve of mine)

17:23 cemerick: hiredman: surely it doesn't *require* multicast?

17:23 tcrawley: jcrossley3: is s3_ping still an option?

17:23 jcrossley3: hiredman: you're not alone.

17:23 tcrawley: yes

17:24 technomancy: cemerick: the lack of a TCP router is probably going to kill jgroups

17:24 hiredman: cemerick: it doesn't, but I've had less then stellar experiences using anything other than static file based discovery on ec2

17:24 which rules out more dynamic environments

17:24 cemerick: tcrawley: noted

17:25 tcrawley: cemerick: https://github.com/projectodd/polyglot-openshift-example

17:25 borkdude: technomancy phew, yup, also works ;)

17:25 cemerick: I can't say I've bothered with openshift at all, since it seems mostly vapor-esque.

17:25 * hiredman spend some time digging though infinispan trying to figure out how to wire in something other than jgroups for discovery

17:26 tcrawley: cemerick: it's come a long way in a short time, but I haven't used it other than trying out immutant & torquebox on it with simple apps

17:27 jcrossley3: cemerick: i don't think vapor-esque is fair now. (it was last year)

17:27 cemerick: Sure. The premise is promising.

17:27 borkdude: now waiting for instarepl/leiningen integration :P

17:30 cemerick: jcrossley3: As accurate as the 1-minute glance can afford, sorry. :-| I generally don't start paying attention until real for-pay plans are specified, etc.

17:33 jcrossley3: hiredman: the auto-scaling issue (killed/moved processes) is something we're trying to workout on openshift. i have little clue atm.

17:33 cemerick: fair

17:34 cemerick: you sound kinda enterprisey, though. ;)

17:34 hiredman: jcrossley3: I am sort of surprised no one offers zookeeper as a service

17:35 Raynes: jcrossley3: He totally is.

17:35 cemerick: They seem pretty solid.

17:35 cemerick: I experimented with it a while back. They plan to have pay plans pretty soon afaik.

17:36 hiredman: paxos as a service

17:37 borkdude: Fisher Price, Enterprise and everything in between

17:37 hiredman: as far as I can tell everyone manages their own zookeeper clusters

17:37 ivan: what would the service do? don't the nodes do all the work?

17:38 cemerick: jcrossley3: My sarcasm detector is flummoxed. :-D

17:38 jcrossley3: borkdude: i used to refer to ms-windows as a "fisher price os" until my kid pointed out i was insulting fisher price. ;)

17:38 talios: Mornin

17:38 borkdude: jcrossley3 lol

17:38 brehaut: morning talios

17:38 jcrossley3: cemerick: ha!

17:39 borkdude: hello talios

17:41 talios: Ooo I'm liking the new IDEA 12 splashscreen - https://skitch.com/talios/ed132/leda

17:41 'lo borkdude

17:48 borkdude: technomancy et al, good luck with preview7 - gtg

17:48 technomancy: thanks =)

18:04 wingy: FP seems to be solving the problems with simplicity while OOP is doing the same but adding unnecessary complexity, which could lead to bugs

18:12 TimMc: wingy: Don't worry, there's still plenty of complexity left over.

18:14 jtoy: I am making a beanstalkd worker on clojure, is this the basic construct ok to use: (while true (get_item_off_queue)) or is there a better way I should be doing it?

18:21 technomancy: jtoy: (doseq [item (queue)] (work-on item)) is better

18:21 assuming queue is a function that returns an infinite seq

18:25 jtoy: technomancy: its not exactly like that, is it ok to have non functional methodsin clojure? meaning every time I call process_job_from_queue once, it processes a single job off the queue/not indepotent

18:26 jjttjj: does anyone know of any example apps using korma? or any medium sized noir apps in general? (besides noir-blog/messageboard)

18:26 technomancy: jtoy: that will work; you asked if there was a better way

18:27 jtoy: technomancy: ok, I will try to learn how to use sequences, I still don't know how to use them

18:58 how do I break out of a doseq ?

18:58 brehaut: jtoy: :while or :when

18:59 wait no

18:59 tha

18:59 ts not what you are asking

18:59 Raynes: You don't 'break' out of a doseq.

19:00 jtoy: this is want I want to do exactly, I want to process (range 1 33) , those numbers are few into something else, eventually one of those numbers will not return data, and at that time I want to stop going through the rest of those numbers

19:00 so something like (doseq [ page (range 1 33)) (process_until_page_returns_nil page) )

19:02 AimHere: Wouldn't you want to use something like 'take-while' or some other sequence function, and discard the result? Or perhaps just roll your own loop .. recur construct

19:03 brehaut: (dorun (take-while identity (map process_page (range 1 33))))

19:03 s/dorun/doall/

19:03 jtoy: I'm new to clojure still, so not sure what the "right way" is

19:03 brehaut: jtoy: lazy sequences are not just about lists of things; they allow you to factor out control flow of loops into composable chunks

19:04 jtoy: brehaut: how exactly do sequences allow you to factor out control flow ?

19:05 brehaut: jtoy: you write functions that perform the control flow operation that take a seq and return a seq

19:05 for example, take-while factors out the 'loop until something happens and then break'

19:06 jtoy: ok, i think i see, coll

19:06 cool

19:06 wingy: is scaling vertically (1 hardware server with as many cores/memory as you need) more optimal than scaling horizontally (more hardware servers)

19:06 brehaut: wingy: they are orthoganal concerns.

19:07 wingy: brehaut: which means?

19:07 brehaut: wingy: they arent really related

19:07 wingy: i wonder since clojure seems to be designed for scaling vertically, but not horizontally

19:07 brehaut: clojure just doesnt pretend that scaling horizontally is free

19:07 wingy: while erlang is doing the latter?

19:09 brehaut: erlang is kinda tricky to put into a box that way

19:10 its design decisions are more about reliablity than 'scaling' per se

19:10 it makes some pretty hard trade offs to be reliable in the face of just about anything

19:15 wingy: brehaut: but is clj designed to scale horizontally?

19:15 brehaut: wingy: i dont think thats a real question

19:15 wingy: https://gist.github.com/3007504 this looks pretty mad .. why would anyone use a vector as a key

19:15 brehaut: languages dont scale, programs do

19:16 why would you not use a vector as a key?

19:16 wingy: why would i?

19:16 is there any benefit doing that?

19:16 brehaut: because its a value, and if its the appropriate key then not using it would be daft

19:17 wingy: hmm

19:17 thats pretty correct

19:17 brehaut: yes it is

19:17 wingy: just not used to it from other langs

19:17 cool in a way that anything can be used as a key

19:17 man i love clj

19:17 love the philosophy

19:18 brehaut: thats… not true

19:18 Raynes: $dict pedant

19:18 lazybot: Raynes: noun: One who pays undue attention to book learning and formal rules.

19:18 wingy: why isn't it true?

19:18 brehaut: im pretty sure java, C#, python (for instance), all let you do the use a vector equivalent as a key in a mapping

19:18 wingy: Raynes: you mean me?

19:18 Raynes: No.

19:19 amalloy: brehaut: he means not used to it from bad langs like php

19:19 and js

19:19 and perl?

19:19 wingy: php, ruby, js

19:19 nDuff: brehaut: not a list, in Python, only a tuple.

19:20 amalloy: wingy: wrong about ruby

19:20 nDuff: brehaut: only immutible types can be used as keys there -- the world is at least _that_ sane.

19:20 wingy: amalloy: just stayed there for a couple of months .. must have missed it

19:20 amalloy: {[1] => :x}[[1]] ## returns :x

19:20 brehaut: js is getting proper maps in a future release that accept non-strings as keys too

19:21 nDuff: ah yeah my bad. the vectors as listy and tuply things throws a wee spanner in that analogy

19:30 wingy: re: vertical scalability, there isn't really a language/runtime/platform that cant support more work by adding more resources to a given machine.

19:35 wingy: brehaut: from what i have understood many langs cant take advantage of multi core

19:35 brehaut: wingy: most languages make multithreaded code difficult yes, but thats not the same thing

19:38 shawnlewis: can anyone recommend an open-source clojurescript web-app worth reading through (beyond twitterbuzz)?

19:41 jayunit100: idiomatic way to pretty print json to a string ?

19:41 gfredericks: find a json lib that can pretty print?

19:41 and use with-out-str if necessary

19:42 jayunit100: with-out-str ?

19:42 gfredericks: ,(with-out-str (println "foo"))

19:42 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")>

19:42 gfredericks: &(with-out-str (println "foo"))

19:42 lazybot: java.lang.SecurityException: You tripped the alarm! pop-thread-bindings is bad!

19:42 gfredericks: wat

19:42 jayunit100: wow

19:42 gfredericks: jayunit100: it just redirects all printings to a string

19:42 * jayunit100 tries in repl

19:43 jayunit100: oh wow you can wrap println thats a badass macro

19:43 gfredericks: jayunit100: it works in all the functions you call too, not just the lexical context

19:43 jayunit100: as in ?

19:44 gfredericks: (defn print-stuff [] (print "Stuff")) (with-out-str (print-stuff))

19:45 jayunit100: @gfredericks hmmm. i wonder how it does that. laziness?

19:45 wingy: is the choice between aleph and noir for a web server?

19:45 jayunit100: oh ok i see, yeah, since with-out-str is seen first, it sets the macro then.

19:45 gfredericks: jayunit100: it's dynamically binding *out*

19:46 (print "Stuff") prints to *out*, so you just change the value of *out* before calling print-stuff

19:46 jayunit100: thanks ! this is cool s**t

19:46 ok…. so i have this lib I'm using : [org.clojure/data.json "0.1.2"]

19:46 gfredericks: cool soot

19:47 jayunit100: is there a way at the repl to browse all of its available functions/ns ?

19:47 gfredericks: yeah; it's not _too_ user-friendly

19:47 brehaut: wingy: noir isnt a web server.

19:47 gfredericks: but (ns-publics foo.bar) will give you the public vars for a ns

19:47 brehaut: wingy: its built on ring which is server agnostic

19:47 gfredericks: you can use clojure.repl/doc to see their documentations

19:48 brehaut: wingy: you can use jetty, anything that supports servlets, mongrel2, or pretty much anything that you either find or write an adapter for

19:49 wingy: i might be wrong, but i dont think aleph is a web server either. the aleph/lamina stack is build ontop of netty perhaps?

19:49 gfredericks: brehaut: you can run an http server with aleph

19:49 technomancy: brehaut: wasn't there, like, some article about that?

19:49 brehaut: gfredericks: does it implement http itself though?

19:49 clojurebot: Gabh mo leithscéal?

19:49 brehaut: technomancy: about aleph?

19:50 jayunit100: (ns-publics 'org.clojure) doesn't work :(

19:50 gfredericks: brehaut: well if you're going to be that pedantic I doubt you're helping the OP

19:50 technomancy: brehaut: I mean about the different web libraries for clojure

19:50 brehaut: gfredericks: i bet you lie to your kids about santa too

19:50 technomancy: and how they are related

19:50 gfredericks: jayunit100: org.clojure isn't a namespace; try (ns-publics 'clojure.data.json)

19:50 brehaut: technomancy: aha, i am apparently slow

19:51 wingy: so its between aleph which is using netty and noir/jetty(/netty?)

19:51 brehaut: wingy: http://brehaut.net/blog/2011/ring_introduction

19:51 gfredericks: wingy: compojure below noir

19:51 jayunit100: hmm that failed to … (ns-publics 'clojure.data.json)

19:51 gfredericks: jayunit100: have you required it yet?

19:52 jayunit100: yeah its a deps issue, my bad. odd though.

19:52 gfredericks: brehaut: what is this "santa"? some kiwi thing?

19:53 brehaut: gfredericks: i dunno, do you have cocacola in the US?

19:53 gfredericks: what kind of fruit is that?

19:55 jayunit100: gfredericks: how did you "know" that [org.clojure/data.json "0.1.2"] ----> clojure.data.json

19:55 brehaut: gfredericks: in that case, santa is a big fat bearded guy who frequently wears winter weather clothes to the beach. go figure

19:55 jayunit100: i never would have been able to guess that. I would have tried org.clojure.data.json OR org.clojure/data.json or all other sorts of incantations. :)

19:56 gfredericks: jayunit100: only because I'm familiar with the lib, or at least the naming conventions in the clojure core libs; generally you have to check the docs, or crack open the jar if you're desperate

19:56 jayunit100: ah ok. so there is no 1-1 mapping between lib name and ns.

19:56 makes sense

19:56 gfredericks: nope; there are various conventions but just as in java/maven, nothing is enforced/required

19:57 brehaut: you people have the strangest traditions

19:57 wingy: i think people would die for clojure the lang

19:58 but no one for js

19:58 dnolen: wingy: you haven't been to any JS conferences I see :)

19:58 wingy: how can they die for an ugly mf?

19:59 its hell ugly!! its like .. i wanna beat it

19:59 gfredericks: nobody thinks that way about lisp

19:59 wingy: gfredericks: irony?

19:59 gfredericks: a smidge

20:00 dnolen: wingy: I have no hatred of JS, but I find the direction the JS community at large seesm to be going ... strange.

20:00 wingy: dnolen: strange how?

20:00 gfredericks: dnolen: JS everywhere? or something else?

20:02 technomancy: like how they're forgetting the one advantage it have over other languages is that it's the most widely deployed runtime?

20:02 *has

20:02 gfredericks: technomancy: they are forgetting that?

20:02 SrPx: Trying to make a "bend" macro, that will transform (foo <a A> <b B>) into (foo a A) (foo b B), but is this even possible?

20:03 technomancy: gfredericks: how else do you explain node?

20:03 gfredericks: SrPx: looks likely

20:03 SrPx: its hard : S

20:03 gfredericks: technomancy: so your corollary is that JS has no other advantage and therefore they shouldn't seek to deploy it any further?

20:04 otherwise I don't follow

20:04 SrPx: is it always pairs? always two of them?

20:05 if you didn't have the angle brackets there it wouldn't even require a macro

20:06 aw man cljs doesn't have future?

20:06 I need to (js/setTimeout)?

20:07 SrPx: gfredericks: no, it's always a list

20:07 dnolen: gfredericks: JS is the probably ultimate Computer Science pop phenomenon.

20:07 SrPx: gfredericks: it could be a varaible pointing to a list

20:07 gfredericks: always the same size though

20:07 nDuff: dnolen: ultimate? That seems awfully optimistic.

20:07 amalloy: dnolen: loving core.logic. still a lot to learn, but with a lot of manual labor i got run* to spit out a correct answer to a puzzle

20:07 dnolen: amalloy: wow! great!

20:07 SrPx: wait who said cljs doesn't have a future?

20:08 technomancy: I read a blog post a while back about how someone was ditching Rails for Node "because the party's better over there"

20:08 gfredericks: SrPx: do you mean the angle brackets to literally be in the code, or were you signifying something else?

20:08 dnolen: nDuff: optimistic - I didn't mean that as flattery :)

20:08 metellus: SrPx: map basically does what you want, depending on the angle brackets

20:08 gfredericks: SrPx: ha

20:08 metellus: ,(map + [1 2] [6 10])

20:08 SrPx: gfredericks: they could be, not necessary, could be somethign like (bend (node [a b]) (node [c d])) or anything that works

20:08 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")>

20:09 metellus: &(map + [1 2] [6 10])

20:09 lazybot: ⇒ (7 12)

20:09 SrPx: õo

20:09 whaa..

20:09 gfredericks: SrPx: I think I'd need a list of examples or something

20:09 SrPx: gfredericks: okay

20:10 gfredericks: SrPx: are you sure you need a macro?

20:10 SrPx: not sure anymore

20:10 jayunit100: hmm this is an odd one : No matching field found: replaceAll for class java.lang.String

20:10 SrPx: trying to understand what metellus did o.o

20:10 nDuff: dnolen: ...I expect there to be more and even worse pop phenomena in the future, but maybe that's my inner pessimist speaking. :)

20:10 SrPx: ,(map print [a b] [c d])

20:10 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")>

20:10 gfredericks: jayunit100: check the args you're giving it

20:10 SrPx: sad that I don't know many functions yet

20:10 so its hard to play w/ the lang

20:10 : S

20:10 metellus: SrPx: look at examples from http://clojuredocs.org/clojure_core/clojure.core/map

20:10 gfredericks: SrPx: if that's the case then you almost certainly shouldn't be writing macros

20:11 jayunit100: yup but the error message itself : clearly, its an incorrect error message.

20:11 amalloy: jayunit100: no it's not

20:11 &(.replaceAll "x")

20:11 lazybot: java.lang.IllegalArgumentException: No matching field found: replaceAll for class java.lang.String

20:11 amalloy: &(.replaceAll "x" "x" "y")

20:11 lazybot: ⇒ "y"

20:12 jayunit100: ah b/c its referring to the reflection looking for a 1 arg version of replaceAll, which doesn't exist.

20:12 gfredericks: yeah, it's matching on more than just the name

20:12 amalloy: well, it's actually looking for *either* a field or a no-arg method

20:12 and decides to report that it couldn't find the field

20:12 dnolen: nDuff: heh I'm not sure about that. We've been beating the dead carcass of Algol-like langs and emaciated Smalltalks for 30+ years. Dart wants to keep the zombie corpse going but at least they have a couple of real ideas in there - mirrors, optional types, metadata.

20:12 jayunit100: if thats the case it should report the arg signature it tried to match also , yes?

20:12 wingy: brehaut: nice article .. will be a good read after my book

20:13 brehaut: no problem

20:15 xumingmingv: for type hint, how do I specify a 'array' hint? e.g. URL[]

20:16 amalloy: ^"[Ljava.net.URL;" iirc

20:19 probably not a bad idea to write a macro that hides the yuckiness there. (defmacro array-hint [dims class obj] (vary-meta obj assoc :tag (apply str `(~@(repeat dims "[") "L" class ";")))) (array-hint 1 java.net.URL x)

20:20 xumingmingv: amalloy: thanks!

20:37 shawnlewis: is there something in core to check if a map is a subset of another map?

20:39 gfredericks: ,((fn [m1 m2] (apply = (map (juxt m1 m2) (keys m1)))) {:foo 2 :bar 6} {:bar 6 :bam 23 :foo 2})

20:39 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")>

20:39 gfredericks: &((fn [m1 m2] (apply = (map (juxt m1 m2) (keys m1)))) {:foo 2 :bar 6} {:bar 6 :bam 23 :foo 2})

20:39 lazybot: ⇒ false

20:39 gfredericks: clojurebot: go away

20:39 clojurebot: Pardon?

20:39 gfredericks: &((fn [m1 m2] (every? (partial apply =) (map (juxt m1 m2) (keys m1)))) {:foo 2 :bar 6} {:bar 6 :bam 23 :foo 2})

20:39 lazybot: ⇒ true

20:40 brehaut: ,(let [a {:a 1 :b 2 :c 3} b {:a 1 :c 3}] (= (select-keys a (keys b)) b))

20:40 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")>

20:40 brehaut: &(let [a {:a 1 :b 2 :c 3} b {:a 1 :c 3}] (= (select-keys a (keys b)) b))

20:40 lazybot: ⇒ true

20:40 gfredericks: brehaut: mine's lazier

20:40 hiredman: clojurebot's eval is closed until further notice

20:40 brehaut: gfredericks: and juxtier :(

20:40 gfredericks: hiredman: intentionall?

20:41 y

20:41 hiredman: yes

20:41 gfredericks: that will be noisy

20:41 he should forward to lazybot :)

20:41 shawnlewis: gfredericks, brehaut: thanks!

20:41 hiredman: hopefully further notice won't be that long

20:43 wingy: how can this be 2: (#(- %1 (apply + %&)) 10 8)

20:43 isn't it the same as: (- 10 18)

20:43 gfredericks: looks like the same as (- 10 (apply + [10 18]))

20:43 wingy: oh its (- 10 8)

20:43 brehaut: &'(#(- %1 (apply + %&)) 10 8)

20:43 lazybot: ⇒ ((fn* [p1__8501# & rest__8502#] (- p1__8501# (apply + rest__8502#))) 10 8)

20:44 gfredericks: wat

20:44 xeqi: hmm, has lazybot always printed anon functions like that?

20:44 brehaut: thats what it expands to (apply + 8) ; => 8, (- 10 8) ;=> 2

20:44 gfredericks: xeqi: he quoted it

20:44 xeqi: ah

20:44 brehaut: just getting rid of the anon reader sugar

20:44 gfredericks: xeqi: quoting is a great way to see what reader macros do

20:45 &'#'foo

20:45 lazybot: ⇒ (var foo)

20:45 xeqi: &'#=3

20:45 lazybot: java.lang.IllegalStateException: clojure.lang.LispReader$ReaderException: EvalReader not allowed when *read-eval* is false.

20:45 brehaut: its also a great way to look lke you are swearing at vars

20:45 gfredericks: brehaut: I don't mind that because likely I am swearing at vars

20:56 amalloy: dnolen: is there a way to unify maps partially, or something like that? currently i have some tuples, and if i want to assert that (say) the third value of x is a, i have to do (fresh [r s t] (== x [r s a t])); i'd like to instead use a map with four keys, and just unify a single key of x with a

21:00 wingy: im reading up a bit on JVM and CLR .. is there any benefits on using https://github.com/clojure/clojure-clr

21:00 i guess the jvm one is more mainstream?

21:01 for .NET interop mainly right?

21:05 dnolen: amalloy: something is needed here ... but I haven't put much thought into it, open to ideas.

21:10 gfredericks: (map-valueo m k v)

21:11 could be a primitive?

21:11 I assume that would take a lot of backend work though

21:12 dnolen: amalloy: if you had some syntax in mind that could at least get the conversation started.

21:13 xumingmingv: anyone recommend an easy to use java de-compiler? jd-gui's official website is broken...

21:13 (on mac)

21:14 amalloy: dnolen: i think gfredericks's suggestion is plausible. or (==m thing1 {:a x}) ;; unifies (:a thing1) with x

21:15 i have to go, though, so i can't defend my silly suggestions tonight

21:15 dnolen: amalloy: will think about it, I've pondering better map support so it's something I'd like to see.

21:15 amalloy: thanks!

21:15 dnolen: pondered better map support before I mean.

22:10 hiredman: ,(println "further notice")

22:10 clojurebot: further notice

22:10 gfredericks: (inc hiredman)

22:10 lazybot: ⇒ 10

22:11 hiredman: made some changes to the sandbox

22:11 gfredericks: hiredman: would it be easy to support eval?

22:11 ,(eval '(+ 1 2))

22:11 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

22:11 gfredericks: hiredman: via recursion?

22:12 wmealing: is there a web based .. repl where you can mess with the dom live ?

22:13 gfredericks: for clojurescript? himera or browser-repl depending on what you mean

22:13 hiredman: gfredericks: in theory I could just let eval through

22:13 steveo_: is there a limit on the number of items in a vector?

22:13 i'm accumulating stuff in one

22:13 gfredericks: hiredman: oh it's all java-based security?

22:13 steveo_: not practically

22:13 TimMc: gfredericks: You can already use eval.

22:13 hiredman: gfredericks: there is some clojure based stuff, but it not very good

22:14 steveo_: yes

22:14 steveo_: this might not be practical

22:14 gfredericks: TimMc: how so?

22:14 TimMc: ,(let [evil (resolve (symbol "eval"))] (evil '(+ 1 2)))

22:14 clojurebot: 3

22:14 hiredman: steveo_: depending on what you mean by a limit

22:14 there is a limit to the size of a vector literal you can use

22:14 steveo_: well I'm getting problems at like 3kish

22:14 gfredericks: hiredman: because of java class size limits?

22:15 steveo_: is there a better data structure for accumulating a ton of items?

22:15 TimMc: gfredericks: ^ The usual.

22:15 gfredericks: TimMc: that is unexpected

22:15 steveo_: you're doing this at runtime, right?

22:15 steveo_: yeah

22:15 gfredericks: and how are you adding items?

22:15 steveo_: conj

22:16 gfredericks: ,(time (vec (range 10000)))

22:16 clojurebot: "Elapsed time: 45.217663 msecs"

22:16 [0 1 2 3 4 ...]

22:16 gfredericks: steveo_: what sort of problems?

22:17 TimMc: Oh dear.

22:17 What happened recently to make clojurebot so crashy?

22:17 steveo_: well I was keeping track of it by checking the count, and the count stopped going up

22:17 at 3035

22:18 gfredericks: steveo_: not sure what that means out of context. you're "checking the count" while some parallel process is running? or it's a debugging statement?

22:18 steveo_: I guess i'm not totally sure the items were'nt still getting added but my plan was to have a watcher check the count and once it gets to something big like 10000 write it to s3

22:19 ok, I have an atom with a vector it in, i'm logging stuff to the atom with (swap! my-atom conj "newthing")

22:19 I have a watcher that checks the count and once it's high enough it'll reset the atom to [] and "process" the accumulated items

22:20 but (count @my-atom) stopped going up at 3035

22:20 gfredericks: ,(let [v (atom [])] (dotimes [n 100000] (swap! v conj n)) (apply max (shuffle @v)))

22:20 clojurebot: 99999

22:20 wingy: i kinda see this documentation layout for many projects http://weavejester.github.com/hiccup/

22:20 what are they using to generate it?

22:22 weavejester: wingy: https://github.com/weavejester/codox

22:22 gfredericks: steveo_: so the watcher logs for you? and it keeps printing 3035 repeatedly?

22:22 steveo_: no I was checking it myself to see what was going on

22:22 i'll have the watcher log it and see what happens

22:23 gfredericks: steveo_: without knowing anything else, it sounds much more plausible the atom isn't being swapped anymore for some reason

22:23 acheng: clojure.test question: can i execute a single specific test at the repl? or must it always be by entire namespace?

22:24 wingy: weavejester: cool

22:25 wmealing: gfredericks, i'll look into that. .thanks

22:25 steveo_: gfredericks: yeah it looks like it, I just had the watcher log it and it just stopped at 2990

22:25 is it possible to overload an atom?

22:26 gfredericks: like update it too many times? no

22:26 maybe you should look at whatever process is doing the swapping

22:26 it doesn't sound likely that vectors or atoms are your issue

22:27 steveo_: yeah I guess not

22:27 alright, i'll keep digging, thanks

22:27 acheng: hmm. stuartsierra's blog post from 2010/07/05 says "individual tests cannot be run outside of run-tests" since fixtures rely on dynamic scope

22:27 melipone: for some reason my irc at work is screwed up. How can I ask questions about clojure on twitter?

22:28 acheng: melipone: can you ssh to somewhere else and then irc from there?

22:28 jayunit100: hmmm not sure if this is a clojure issue or not :

22:28 melipone: hmmm... I don't think so

22:28 jayunit100: (.replaceAll (json/json-str (rts/word-enrichment-url url)) "," ",\r\n"))

22:29 should that render as a line break in normal browsers ^^ ?

22:29 gfredericks: acheng: leiningen test-selectors might help some

22:29 acheng: melipone: my employer blocks the irc ports so i ssh to freeshell

22:29 freeshell = sdf public access unix system

22:29 melipone: acheng: okay, I didn't know about freeshell

22:29 technomancy: acheng: clojure-test-mode has a way to run fixtures with a single test

22:29 acheng: at sdf.org

22:29 technomancy: bit of a hack

22:29 gfredericks: jayunit100: unless you're in a <pre>, I think you need a real <br /> to get a line break

22:30 jayunit100: arg… what if its plain text ?

22:30 I'm wondering how Facebook does it : https://graph.facebook.com/me/home?access_token=AAAAAAITEghMBALaSPAVOj2ugYhHtMP2TPg8IexZA2KPtuHQJZAR9muMHZAPETKc0DLFIakfUWblNtV5djHxDIhEKdETzYNpuhdj8JB1xa6M86h2u3gS

22:32 fyi I'm in composure , trying to stream plaintext

22:32 gfredericks: jayunit100: oh that's the browser rendering plain text. that should work fine I would think. what is it doing?

22:32 jayunit100: the link above (Facebook) renders plaintext just fine.

22:33 but i don't know how to get composure to output plain text

22:33 * jayunit100 rtfming

22:33 xeqi: jayunit100: I get content-type "text/javascript" in the response headers

22:33 for that page

22:35 acheng: (thanks technomancy gfredericks)

22:38 jayunit100: (GET "/text" [{:headers {"Content-Type" "text/plain"}} "This is plain text." "And some more text."]) <-- key must be integer exception.

22:39 wingy: isn't recur introducing imperative style?

22:39 loop/recur reminds me about for in loop

22:40 gfredericks: it's a little more functional than that

22:40 but it is more on the imperative side of clojure's things and so it's smelly to use it if some HOF or two will suffice

22:41 I think it might perform well and so gets used when that's important

22:42 xeqi: jayunit100: try (GET "/text" _ {:status 200 :headers {"Content-Type" "text/plain"} :body "this is plain text.\nAnd some more text"})

22:42 jayunit100: hmm ok y?

22:43 gfredericks: wingy: it's more functional because when you use it you're still dealing with immutable locals, rather than imperatively punching things over and over

22:43 jayunit100: xeqi !!!! works !

22:44 xeqi: there are probably nicer ways to build that ring response, using ring.util.response

22:54 jayunit100: whats the diff btwn :require vs require ?

22:55 gfredericks: require is a function you can call

22:55 :require is some syntax that the ns macro supports

22:55 so it only works there

22:55 with :require you don't quote symbols, but with the function you have to

22:56 jayunit100: ah ok

22:57 gfredericks: my herok

22:57 s/herok/hero

22:57 gfredericks: no I prefer herok please

22:57 jayunit100: s/herok/heroku :)

22:57 gfredericks: I'm somewhere in between the two

22:58 wingy: im confused .. (def x 5) .. here x is a var or a symbol?

22:58 gfredericks: I think I killed brehaut

22:58 wingy: yes and no

22:58 syntactically x is a symbol. but what def is doing is creating a var named x

22:58 so wherever else you use the symbol x in that namespace it should refer to that var

23:00 dangit the vars/symbols talk from clojurewest isn't video'd yet :(

23:00 Raynes: I should try doing the whole video editing thing one day.

23:01 I completely do not understand why it takes so long for conference videos to surface.

23:01 gfredericks: Raynes: they don't hold them back to incentivize attendence?

23:01 nickmbailey: ^ that

23:01 Raynes: I guess that's a possibility.

23:02 wingy: how many people attended you think?

23:02 Raynes: A lot.

23:02 gfredericks: seven or a thousand

23:02 wingy: cool

23:02 xeqi: I was told clojure/west was around 300, which sounds about the same as the conj last year

23:03 wingy: gfredericks: you mean def is creating a var which has a symbol x .. you name a var by putting a symbol ("tag") on it

23:05 gfredericks: wingy: I'm not sure what your second statement means; vars are referred to implicitly in code. When a symbol is eval'd by the compiler, it is first checked if it is a local, and if not it is checked if it is a var

23:05 jayunit100: ,(map? clojure.lang.PersistentHashMap)

23:05 clojurebot: false

23:05 gfredericks: also it's maybe 7 times more complicated than that

23:05 jayunit100: that's a class

23:05 xeqi: ,(class clojure.lang.PersistentHashMap)

23:05 clojurebot: java.lang.Class

23:05 jayunit100: oops bad example

23:06 I can't create one b/c its constructor is messed up :)

23:06 wingy: gfredericks: can a var have multiple symbols associated to it?

23:06 xeqi: ,(class {})

23:06 clojurebot: clojure.lang.PersistentArrayMap

23:06 jayunit100: ,(map? {})

23:06 clojurebot: true

23:06 wingy: gfredericks: im thinking like unix fs .. you have pointers to the actual file

23:06 gfredericks: wingy: that's usually namespace dependent. So for example if you (use 'clojure.test) then the symbol 'deftest and the symbol clojure.test/deftest both point to the same var

23:07 wingy: symbols remind me about the pointers

23:07 jayunit100: ah i see its a unit test thats failing b/c I'm testing if a class is a map after running type on it.

23:07 * jayunit100 kicks self

23:07 aperiodic: gfredericks, wingy: http://clojure.org/evaluation

23:07 gfredericks: wingy: symbols don't inherently point to anything, it is only in the context of a namespace when being compiled

23:07 oh resolved is a good word

23:07 I forgot that one

23:07 wingy: i see

23:51 michaelr`: good morning

23:51 TimMc: g'night

23:52 michaelr`: :)

23:52 actually i'd rather go to sleep than start a work day

Logging service provided by n01se.net