#clojure logs

2012-06-27

00:00technomancythe one thing that still makes ido-ubiquitous crawl
00:00brehauttechnomancy: awesome. tab completes pile of poo very quickly
00:00technomancybrehaut: insist on nothing less
00:00taliosYou emacs people scare me.
00:01technomancywhy is there no XMPP library on github called "gom jabbar"?
00:02technomancythat's the Internet for you. full of disappointment.
00:02brehauttalios: its much faster than Cmd-Alt-T, Emoji, People and scrolling around to find it
00:02brehaut(inc technomancy)
00:02lazybot⇒ 27
00:02technomancyemoji are for people who haven't bothered exploring the rest of the unicode plane =P
00:03brehauttechnomancy: if its not poo, or interrobangs i dont care :P
00:05technomancyhuh; I thought you could fork projects that were forks of your own on github as long as they changed the name
00:05PeregrinePDXThere streo audio again now I can go back to playing with overtone.
00:06PeregrinePDXstereo even
00:37xeqiohh, clojurebot runs everything in a custom classloader, neat
00:43spoon16Got a question about converting a vector of maps to a nested multimap… any help would be appreciated. http://stackoverflow.com/q/11219512/3957
00:49antares_spoon16: you need a combination of group by and map, give me a minute to write an example
00:51antares_spoon16: are you grouping by :customer or :country?
00:56antares_spoon16: answered
00:56xeqiantares_: don't you need an (apply merge ..)?
00:58antares_xeqi: I need to add first
00:58antares_not sure what can be merged there
00:59spoon16antares_: close
00:59spoon16I added a comment
01:00spoon16I'll play around with your approach a bit, but it looks like it's losing "cid2" at the top level
01:00spoon16ohhh man, I see the first call now
01:00antares_let me see
01:00spoon16just read it I guess :)
01:00antares_I may know why
01:00spoon16it works
01:00antares_oh, hm
01:00spoon16it's just the (first) call in your answer… you should remove that for clarity
01:00antares_yeah it was a bad idea to add it
01:01spoon16thanks for the help
01:01antares_corrected
01:02antares_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
01:02antares_spoon16: by the way, if you need specifically a vector, add (vec …). map produces a lazy sequence.
01:16antares_Raynes: just checking: are you still interested in me migrating refheap to monger?
01:17Raynesantares_: If it still supports mongodb URIs, then you bet.
01:17antares_if I remove it some heroku uses will tear me apart
01:18Raynesantares_: Yeah, like me. :p
01:19muhootrippy https://github.com/antler/caribou-core
01:32michaelr`hrr
01:32michaelr`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)
01:32michaelr`does it sound familiar?
01:33antares_michaelr`: it probably means that you set up all of them to handle / or * paths
01:34michaelr`isn't it supposed to route by hostname?
01:35michaelr`i'm talking about multiple domain names, not multiple webapps under the same domain
01:36michaelr`antares_: ^^
01:37antares_michaelr`: tomcat typically routes on paths. Frontend Web servers like apache or nginx typically separate vhosts by domain name, that's true
01:37antares_michaelr`: can you show your web descriptor?
01:37michaelr`i found this in the documentation: "Note that the directory structures under the appBase for each host should not overlap each other."
01:38michaelr`maybe that's my problem
01:38michaelr`i placed them like /webapps/host1 and /webapps/host2
01:39michaelr`one sec i'll paste the config
01:40antares_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
01:56michaelr`antares_: fixing the overlapping appbase paths didn't help
01:56michaelr`the requests are still distributed among the three hosts
01:56michaelr`tomcat is soooooo anoying
03:37kralnamaste
05:40SrPxI 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.
05:44hyPiRionSrPx: ##(first (shuffle '[Clojure CL]))
05:44lazybot⇒ CL
05:45hyPiRionSrPx: But from jokes to seriousness, I need to know what you want to learn.
05:46hyPiRionDo you want to learn a new language for fun, for learning lisp, for productivity, or for understanding new paradigms?
05:47Bronsa,(rand-nth '[Clojure CL])
05:47clojurebotClojure
05:49antares_CL has some cruft in it and is not practical today
05:49AWizzArdantares_: flaming?
05:49antares_Clojure does not have the cruft, has good time/concurrency story, very nice community and is practical
05:50antares_AWizzArd: just expressing my opinion
05:50SrPxhyPiRion: heh! I've thought that, seriously
05:50SrPxhyPiRion: +1 for actual code, nice
05:51SrPxhyPiRion: 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
05:51lucianclojure is sort of tied to the JVM (at least for now). that's both useful and very annoying
05:51SrPxantares_: what is cruft?
05:51SrPxlucian: why annoying?
05:51lucianSrPx: because it's the fucking jvm :)
05:52SrPxis this bad? :/
05:52luciansort of. it's also good
05:52antares_SrPx: stuff that many people would drop from the language or change, but cannot because of serious backwards compatibility issues
05:52lucianmany libs, excellent JIT, good GC. terrible start up time
05:52hyPiRionIt's slow to load, so scripts may take quite a while.
05:52lucianalso harder to install/manage than other runtimes
05:52antares_Clojure also runs on .NET, JavaScript VMs and even Python (not sure about how mature that port is)
05:52antares_CL does not
05:53Bronsaeg, just running the repl takes at least .5 seconds
05:53hyPiRionSrPx: My personal opinion though, is that programming Clojure is more... fun.
05:53SrPxbut why?
05:53SrPxWhat are the actual differences?
05:54SrPxon the languages themselves
05:54lucianantares_: actually, CL runs there too in some shape or form. and sadly, clojure is only self-hosted on the JVM
05:54SrPxlucian: terrible start up time?
05:54lucianthe jvm takes seconds to start up, as opposed to miliseconds
05:54lucianone major difference is that Clojure is a Lisp-1, and CL is a Lisp-2
05:54SrPxantares_: what, it can call python code from inside the language?
05:54antares_SrPx: yes
05:54lucianSrPx: with clojure-py, yes
05:54SrPxantares_: like calling any function I code on python?
05:54antares_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
05:54SrPxdoes anyone know how mature is that?
05:54lucianbut even that is hosted on the JVM
05:55lucianSrPx: it's not exactly mature. does appear to work fine, though
05:55antares_SrPx: yes, on any platform Clojure has implementations on it interoperates with the VM or language
05:55BronsaSrPx you can do the same for java on the JVM
05:55antares_so ClojureCLR can use C# and maybe even F#, JVM Clojure interoperates with Java, ClojureScript with JavaScript and clojure-py with Python
05:55SrPxalso again (I really don't know, am gathering opinions) is the immutability a problem for any of you? or the opposite?
05:55SrPxantares_: that sounds really good
05:56Bronsait's a terrific feature, not a problem
05:56SrPxterrific?
05:56lucianit makes concurrency easy
05:56Bronsaincredibly good
05:56Bronsa:)
05:56SrPxoh okay
05:56lucianit also makes it easier to reason about certain things
05:56Bronsaas in awesome
05:56hyPiRionSrPx: Generally immutability is a good thing, but it takes some time to wrap your head around it.
05:56antares_SrPx: immutability is one of the key reasons why I use Clojure for many heavy lifting kind of things
05:56SrPxbut does it make it harder for coding?
05:56lucianalso, you're free to use mutable data structures if you wish to
05:56antares_SrPx: why don't you try
05:56antares_I mean, come on
05:56Bronsayou have to change your mindset
05:56hyPiRionHowever, dynamic programming and programming competitions are usually a mess to work with.
05:56antares_just learn something, asking questions for days and days won't get you anywhere
05:57SrPxI 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
05:57antares_Google's Java library (Guava) emphasizes immutability
05:57antares_Scala has immutable collections and vals
05:57antares_and so on
05:57hyPiRionSrPx: 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.
05:58antares_Erlang goes even further with immutability
05:58SrPxhm..
05:58antares_so it is not the end of the world or super novel idea, Clojure just bakes it into the core of the language
05:58antares_you can use transients everywhere if you choose to, they are just as mutable as most of Java objects
05:58hyPiRionSrPx: If you want to program a project, I'd suggest you try out Clojure.
05:59SrPxmacros are all the same?
05:59lucianmacros are very similar in the two languages, yes
05:59hyPiRionSrPx: They are essentially the same.
05:59SrPxmultiple dispatch is the same right
05:59luciansome might say it's a flaw in both
05:59antares_SrPx: macro capabilities are pretty much the same in CL, Clojure and most of Lisps except for really old ones
05:59lucianmultiple dispatch is better in clojure
05:59SrPxlucian: lol?
05:59SrPxantares_: okay
06:00SrPxlucian: how so
06:00lucianSrPx: some might say scheme's hygienic macros are the only good ones
06:00SrPxwhat is hygienic macro
06:00lucianclojure multimethods can dispatch arbitrarily, not just on types
06:00SrPxwhat else?
06:00SrPxõo
06:00antares_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
06:00luciananything. instead of giving it a type to dispatch on, you give it a function
06:00lucianit dispatches on the value that function returns
06:01lucianof course that function can be be one that returns the type
06:01lucianwhich will make it behave like CL multimethods
06:01SrPxoh I see
06:01BronsaSrPx also, clojure's "`" have automatic namespace qualifying, that helps avoiding variable capture
06:01SrPxI didn't understand that namespace thing very well
06:01hyPiRionBronsa: I think you're kind of going too much into detail
06:01SrPxa clojure program is pretty much a namespace with some variables
06:02SrPxis that correct?
06:02lucianClojure's macros are slightly more hygienic
06:02lucianbut otherwise extremely similar to CL's
06:02SrPxthat is, the namespace 'holds' the variables
06:02antares_SrPx: namespaces have the same purpose as Python or Java packages
06:02antares_or in Python they are called modules, I don't remember
06:02lucianyes
06:02SrPxhm
06:02SrPxhold on let me open the manul
06:02hyPiRionSrPx: I would honestly suggest that you write a 1000-line project or something in both.
06:03hyPiRionThat's the best way of finding "your" language.
06:03BronsaSrPx 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
06:03mduerksenSrPx: 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)
06:04hyPiRionI kind of think of Clojure as immutable python with threads.
06:04SrPxhyPiRion: hmm
06:04SrPxhyPiRion: this is a good advice
06:04hyPiRionSrPx: You'll only get reasons why you should learn Clojure here, and only reasons why you should learn Common Lisp in their channel.
06:04Bronsaalso, clojure has better package managing tools, see leiningen
06:04SrPxmduerksen: this was also a good point
06:04lucianhyPiRion: i have a similar impression :)
06:05SrPxhyPiRion: I know, it is okay
06:05SrPxat least I can compare
06:05SrPxboth are looking awesome and have great communities
06:05hyPiRionSrPx: Yeah, but I'm just saying it's subjective.
06:06lucianas a mostly-python developer, i'd say go with clojure
06:06lucianfor what that statement is worth
06:12nonrecursiveSrPx: I started out with common lisp back in november but started doing clojure a few weeks ago and enjoy it much more
06:13SrPxnonrecursive: hmm
06:13SrPxnonrecursive: could you elaborate? (:
06:14old_soundhi do you think clojure is good for me?
06:14nonrecursiveSrPx: 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
06:15lucianhg st
06:15luciandamn, this isn't my terminal
06:15AWizzArdantares_: again, an uninformed statement that you made, about CL.
06:15antares_AWizzArd: which one?
06:15nonrecursiveSrPx: 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
06:15SrPxAWizzArd: ?
06:15SrPxnonrecursive: for example?
06:16nonrecursiveSrPx: which is another issue, there are many implementations of CL, so that's something else you have to navigate
06:16nonrecursiveSrPx: gensym - in CL it's implementation-specific
06:16nonrecursiveSrPx: wait i take that back
06:16nonrecursiveSrPx: with-gensysms is implementation-specific. In Clojure with-gensysms isn't even necessary because of the way gensyms are handled
06:17antares_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.
06:17SrPxI dont know what a gensym is, I'm googling that wait
06:17nonrecursiveSrPx: in clojure you also get function composition for free, as well as partial functions
06:17SrPxAWizzArd: this is true
06:17SrPxantares_: you are being very helpful, thanks
06:17luciannonrecursive: those aren't built-in in CL?
06:17SrPxAWizzArd: but I would like to hear you reasoning
06:17AWizzArdCL can run on the JVM, and use all data structures that Clojure has.
06:18nonrecursivelucian: as far as I could tell from, you need to write the macros for those yourself
06:18SrPxnonrecursive: hmm true
06:18AWizzArdIt is mostly a syntactical difference, Lisp1 vs LispN.
06:18AWizzArdClojure is a bit more efficient.
06:18luciannonrecursive: really? i'd hope at least they can be written as functions
06:18AWizzArdNearly all syntax from Clojure can be integrated into CL within a matter of hours.
06:19AWizzArdIn principle you can program CL on the JVM and make it nearly feel like Clojure.
06:19AWizzArdClojure is a bit more cleaned up, and a bit more consistent with its names.
06:19nonrecursivelucian: or the functions - but you still have to write it yourself
06:19luciannonrecursive: right
06:19nonrecursivelucian: 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
06:19AWizzArdBut it also lacks some important features, which it will probably get over the next years.
06:20AWizzArdThere are tons more of implementations for CL than there are for CLJ.
06:21AWizzArdI personally prefer Clojure and do use it since 2008. But from an objective point of view, CL is not really significantly “worse” than CLJ.
06:21lucianAWizzArd: i don't believe anyone here claimed that
06:22AWizzArdI 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.
06:22AWizzArdClojure does not yet have the cruft, because it still is too young. But then again, Clojure misses some useful features that CL has.
06:23AWizzArdFor example CL has a nice support for conditional compilation. This is useful as soon there are multiple implementations that you want to target.
06:23AWizzArdThe *features* list I mean, and the #+ and #- reader macros.
06:24nonrecursiveSrPx: 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.
06:24AWizzArdAnd 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.
06:24nonrecursiveSrPx: But in terms of actually being able to make stuff I'm having an easier time with Clojure
06:25AWizzArdIn 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.
06:26AWizzArdClojure is nicer to use, and does not require an initial time investment.
06:26AWizzArdI personally would always prefer it over CL, if I can. But objectively speaking… not a too dramatic difference.
06:28SrPxAWizzArd: thanks ...
06:30SrPxsomething that came to my mind now
06:30SrPxas 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
06:31SrPxcould this be a worry?
06:31SrPxor does clojure already have all the important stuff?
06:31SrPxor would converting be so easy it didnt matter?
06:32lucianbeing able to use java libs is a significant advantage
06:32gtuckerkelloggclojure is advancing very fast
06:35dbushenkoSrPx, I'd say, there is more libs for clojure even then for CL
06:35SrPxhm
06:35dbushenkoand if you take into account the java libs legacy... I think its obvious that Clojure is more practical then CL
06:36mduerksenAWizzArd: i don't know CL much, but you said "CL can run on the JVM." how would you do that?
06:36dbushenkomduerksen, abcl runs on jvm
06:36nonrecursiveSrPx: you probably won't have a difficult time translating CL to Clojure in 99% of cases
06:37dbushenkobut abcl integrates with java badly
06:38mduerksendbushenko: ah, thanks
06:38AWizzArdyup, abcl I meant
06:39AWizzArdabcl would require 1-2 days of work to get a nice java interop.
06:49SrPxhey guys gtg now
06:50SrPxthank you all for the w ords
06:52wmealingso, 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
06:52wmealingmaybe he's busy, or maybe he's given up coding, i can't tell
06:52wmealingis it bad karma to push a revision to clojars with the same name
06:53wmealingnewer version etc ?
06:56dbushenkowmealing, create your own groupid for the artifact
06:57michaelr`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
06:57michaelr`:)
07:01wmealingdbushenko, okay.
07:04dbushenkomichaelr`, and what went wrong with tomcat?
07:05antares_wmealing: you should change group id and publish it as your fork that way
07:06wmealingantares_, thats the first element after defproject ?
07:06antares_wmealing: in com.novemberain/monger, it is "com.novemberain"
07:06wmealingantares_, org.clojars.wmealing/oldthing-name
07:06antares_it may be omitted completely
07:06wmealingok
07:06antares_then just add it
07:07antares_yes, like that
07:08wmealingwell, that was painless
07:08wmealingthanks
07:38nonrecursivewhen 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" ?
07:39Bronsayes
07:40nonrecursivethanks
07:42michaelr`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
07:42michaelr`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
07:43michaelr`yesterday and today :)
07:44michaelr`lost's of xml configuration and conventions spread across directories and files
07:44ktsujiis there a way to suppress "All namespaces already :aot compiled." output when calling lein run with leiningen2?
07:44michaelr`s/lots
07:45AWizzArdIs there a way, in a Leiningen 2 project, to check for which of my dependencies a newer version is available?
07:46AWizzArd-for
07:47michaelr`i usually just run 'lein clean;lein deps'
07:48michaelr`ah, wait that's not what you asked
07:48michaelr`never mind
07:51AWizzArdI 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.”
07:51antares_AWizzArd: there is no but with upcoming clojars improvements it will be possible
07:52antares_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
07:54AWizzArdPerhaps http://search.maven.org/#api provides some useful functionality.
07:54AWizzArdThe REST API, which returns json.
07:54antares_nice
07:55antares_then it should be doable
07:55antares_but I think technomancy will ask for it to be a plugin
07:55AWizzArdsure
07:56antares_AWizzArd: talk to xeqi, he is the man to talk to about Maven repos indexing and related topics
07:58mduerksenenlive 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?
07:59mduerksenin other words, how do i AND predicates?
08:02mduerksenthe enlive readme seems to attempt to show this, but there must be a typo
08:05mduerksennevermind, i found it. and the readme-page on github has indeed a typo
08:46Chiron_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?
08:46Chiron_I'm talking about SessionEvent
08:48antares_Chiron: annotations in Clojure are only possible via gen-class and it is a relatively unknown feature
08:49Chiron:/
08:49antares_that said, annotations are only typically necessary in Java because of Java's own limitations
08:49antares_try modelling composite columns using maps and vectors first
08:49Chironin case of Astyanax, annotations are necessary
08:50ChironI guess I will wait till the next week ;)
08:53cemerickChiron, antares_: annotations can be used on any of gen-class, defrecord, or deftype
08:53cemerickProbably reify as well, but likely only at method- and argument-level there.
08:54Chironcemerick: 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
08:55ChironIMHO
08:55cemerickI'm sorry to hear that. I hope the rest of it makes up for it.
08:56Chironit was amazing, i learned a lot . I'm a better Clojure programmer because of it
08:56Chironbut you raised the bar so high :)
08:56N8Dawghi, has anyone here had experience using CDT, i'm trying to set a breakpoint on an anonymous function, is that even possible?
08:56foxdonutcemerick: I am enjoying the book, as well. How did the three of you split up authoring the chapters?
08:57cemerickfoxdonut: No particular method. Mostly based on availability, expertise, and interest.
08:59Cheirondata structure treatment was second to none.
08:59foxdonutcemerick: it would be interesting to see who wrote which chapters :)
09:02Cheironcemerick: annotation can be used with defrecord/deftype without gen-class , aot?
09:02cemerickCheiron: yes
09:04cemerickfoxdonut: I could tell you, but then I'd have to kill you. :-P
09:05foxdonutcemerick: ok, it's a deal. :D
09:06foxdonutquick and painless please. and if only one can be achieved, just make it quick.
09:08llasramWow, I did not realize that deftype/defrecord allow one to declare annotations
09:09llasramThe 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?
09:10tbaldridgethe whole deftype system is that way. That's some insanely complex code
09:11tbaldridgeBut that's the fault of the JVM, not clojure
09:21antares_cemerick: I have a quick question for you
09:21antares_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?
09:22antares_cemerick: this is reported for Monger by a Friend user
09:22cemerickIt's a small irc world. ;-)
09:23cemerickantares_: str
09:23antares_cemerick: it keeps the :
09:23cemerickThere's nothing built-in that will give you ns/foo and not :ns/foo
09:23JulioBarrosantares_ cemerick ... I've been bugging you both this morning :)
09:23antares_cemerick: ok, so our best bet is to use str + strip off the :?
09:24cemerickantares_: well, the : is important. If this is session storage, you need the : to distinguish between a symbol and a keyword.
09:25antares_cemerick: Monger currently stores keywords as strings
09:25llasram&(let [kw ::example] (str (namespace kw) "/" (name kw)))
09:25lazybot⇒ "clojure.core/example"
09:25cemerickWell, that's not going to cut it for session storage. Another library might choose to use symbols.
09:25cemerickIt's hard to get better than pr-str.
09:27antares_cemerick: ok, I will think about it
09:27antares_JulioBarros: I am not sure what to suggest, there is Ring session store in Carmine, as far as I know
09:28antares_I am thinking about something that would work for Monger and be backwards compatible but so far I can't
09:30antares_JulioBarros: I am afraid many session stores that do not try to be Clojure-specific may end up having the same problem
09:30antares_Welle's one can use application/clojure data type, though
09:31antares_JulioBarros: is running a Riak node for sessions an option for you?
09:32cemerickSurely this isn't related to the database per se; the session store just needs to support the full range of Clojure values.
09:32antares_cemerick: right
09:32antares_but I expect many session stores to choose JSON and not clojure reader
09:33antares_just for possible interop scenarios
09:33antares_cemerick: I am thinking I can add a friend-friendly session store to monger
09:33antares_since we can just use mongodb as a key/value store where values are clojure reader strings
09:35cemerickWell, whatever the db uses (JSON or not), a Ring session store impl should translate properly.
09:35cemerickThat is, this is hardly a friend-specific issue. :-)
09:35antares_cemerick: yes but if we store namespaced keyword, a Ruby app won't be able to read that value
09:35antares_sure
09:35Bronsa`,(into {} (map (juxt identity symbol?) [:a (symbol (str :a))]))
09:35antares_I think I have a solution in mind
09:35clojurebot{:a false, :a true}
09:35Bronsa`wtf
09:36antares_JulioBarros: please let me know when you are around again, I have an idea
09:36cemerickantares_: Oh! That's an interesting problem, then. Yuck.
09:37cemerickBronsa`: (symbol ":a") *is* a symbol…
09:38foxdonutcemerick: chapter 12 is a little gem. :)
09:38antares_cemerick: fortunately, monger.ring.session-store is not documented :)
09:38antares_cemerick: I may be able to add a new one and then gradually remove the old
09:38Bronsa`cemerick should we be allowed to create symbols prefixed with :?
09:39Bronsa`that may cause this to occur
09:39Bronsa`,(read-string (pr-str (into {} (map (juxt identity symbol?) [:a (symbol (str :a))]))))
09:39clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Duplicate key: :a>
09:40cemerickBronsa`: That debate has been ongoing for ~5 years. :-)
09:41Bronsa`I just don't understand why Symbol doesn't throw an exception, but ok
09:42foxdonut,(= :a (symbol (str :a)))
09:42clojurebotfalse
09:44foxdonut,(= :a (keyword (name :a)))
09:44clojurebottrue
09:44foxdonut,(read-string (pr-str (into {} (map (juxt identity symbol?) [:a (keyword (name :a))]))))
09:44clojurebot{:a false}
09:46Bronsa`foxdonut yeah, the problem is, symbol creates simbols that the reader cannot read or doesnt read like symbols
09:46Bronsa`,(symbol ":::")
09:46clojurebot:::
09:46Bronsa`,':::
09:47clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Invalid token: :::>
09:47Bronsa`I don't see the point in allowing this
09:47antares_,(let [s (slurp "http://clojure.org&quot;)] (count s))
09:47clojurebot#<AccessControlException java.security.AccessControlException: access denied ("java.net.SocketPermission" "clojure.org:80" "connect,resolve")>
09:47antares_clojurebot: good boy
09:47clojurebotNo entiendo
09:47cemerickBronsa`: The general counter-argument is that symbols are used for plenty of things that have nothing to do with printing and reading.
09:48Bronsa`I don't think it's a good enough argument, but it's not a big deal anyway, i can live with that :)
10:01fastaIf 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:02dnolenfasta: a 1 million line Clojure project?
10:02scriptorfasta: talking about light table?
10:02fastascriptor: oh, please.
10:03fastadnolen: I am just asking a question; there is no need to ask another question back in return.
10:03dnolenfasta: was asking for clarification. in general you only need to recompile the lines that change. as usually is the case with Lisps.
10:04fastadnolen: and what about linking?
10:04dnolenfasta: not necessary.
10:04fastadnolen: ok, so the whole edit-run cycle abstraction keeps working.
10:04JulioBarrosantares_: 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:05dnolenfasta: 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:05fastadnolen: do you think that's some magic upper bound? ;)
10:06fastadnolen: I think one year of development will get you 60KLOC of code already.
10:06dnolenfasta: nope
10:06dnolenfasta: the big apps I'm aware have been dev'ed for 2-3 years.
10:06foxdonut"back in return" is redundant.
10:06dnolen20-30k seems normal
10:07fastaCan I only call Java stuff or can I also call POSIX and win32 things easily?
10:08dnolenfasta: Java stuff is easy, FFI difficulty inherited from Java's support for such things.
10:09fastadnolen: well, I disagree on that.
10:09dnolenfasta: disagree on what?
10:09fastadnolen: I think if developers wanted it to be easy, it would be easy.
10:10fastaIt's perfectly possible to automatically generate interfaces to native libraries.
10:10dnolenfasta: sure, some folks have work on OSS libs to make such things easier.
10:10fastaExcept, there is a reason why that isn't done.
10:10fastaIt is to make the developers of the new language more in demand.
10:10fasta"We need <insert all the old stuff> in the new environment".
10:11fastaIt took me some time to figure that one out, but in the end that's all it comes down to.
10:11fastaPlain economics.
10:11fastaThanks for the answers.
10:11mduerksenfasta: it's an issue of priority imho. but i'm not sure you're asking to learn or asking just to be provocative
10:11tbaldridgeI imagine there has to be a good way to do FFI in Java. It's pretty straightforward in the CLR and Python
10:12fastamduerksen: let me guess: Clojure developer?
10:12fastaReally, this couldn't be much more predictable.
10:12foxdonutsmells like a troll.
10:12fastaSmells like another developer.
10:12antares_tbaldridge: JNA
10:12foxdonutI rest my case.
10:13fastaIf 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:14antares_JulioBarros: if you want to store query-able Clojure data structures, I think you need Datomic. MongoDB with Monger is fairly close
10:14antares_JulioBarros: if a key/value store would be sufficient, Welle with :content-type "application/clojure" will work great, too
10:14antares_Welle is a Riak client: http://clojureriak.info
10:15antares_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:16fastaantares_: ah, interesting. You are clueless.
10:16antares_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:16dnolenI think everyone can put fasta on ignore at this point.
10:16tbaldridgeagreed
10:17kijwho?
10:17fastaJNI doesn't exist or what?
10:17foxdonutdnolen: agreed, done.
10:18fastaI was expecting *informed* opinions here.
10:18fastaPerhaps the people that don't say anything have them.
10:18antares_fasta: get a life
10:19antares_has been long since I used the ignore command
10:19fastaantares_: learn something before you speak.
10:19fastaantares_: just because you can type things on a keyboard, doesn't mean that you should answer a question.
10:20foxdonutantares_: try /ignore fasta!*@* ALL
10:20foxdonutthen just plain /ignore to see your list
10:20fastafoxdonut: go grab a donut.
10:20antares_foxdonut: thank you, done
10:20ldopaoh shit donut burn
10:21foxdonutwelcome
10:22mduerksenantares_: first time i hear about monger. i've been using congomongo recently. i wonder if i should give monger a first look?
10:22antares_mduerksen: everything I say will be biased but take a look at http://clojuremongodb.info :)
10:23antares_mduerksen: also, folks in here may be able to tell their experience
10:23scriptornice website
10:23foxdonutantares_: I like the look of your page
10:23scriptorI'd rename 'Contribute' to just 'Source', though :)
10:23antares_monger is a part of a group of EPL-licensed projects, clojurewerkz.org
10:25kijIs 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:25antares_kij: (defn some-name [] …)
10:26antares_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:26kijantares_: Yes, its wrong. But the second form mentions "wrong", not defn.
10:26duck1123Saying 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:27duck1123there are certainly less clear error messages out there
10:27metellusit's either accepting [] as a valid name or it has issues with the arglist before it checks the validity of [] as a name
10:27tbaldridgeyeah....some of the error messages in defn, deftype, etc. are a bit wonky like that
10:27uvtcscriptor: *off-topic*, but love the name "scriptor". Sounds like either and autobot or a decepticon. :)
10:28tbaldridgeSometimes 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:28scriptoruvtc: heh, thanks, funny thing is I was thinking history when I first came up with it
10:32kijantares_: Did you say something like this should work? (defn (first [aa bb]) [] (println "hey")) - where aa and bb are defined?
10:33antares_kij: you don't need parens around the name
10:33antares_kij: what are you trying to do?
10:34metelluskij: java.lang.RuntimeException: First argument to def must be a Symbol
10:34kijantares_: Your comment: "... unless you have a function that you want to call to return the name" Trying that out, and failing :)
10:34metellusand I tried wrapping it in (symbol) too
10:35foxdonutkij: also (defn a ([x] <handle 1 arg>) ([x y] <handle 2 args>)) to have different arities
10:35antares_kij: then try this: (defn name-gen [] (symbol "abc")) (defn (name-gen) [] "I am named abc")
10:35foxdonutantares_: didn't know you could do that-- interesting
10:36kijantares_: Same :/
10:36kijfoxdonut: still needs to prove it :)
10:37Bronsa(defn #=(gensym) [])
10:38kijBronsa: cheat!
10:39antares_kij: well, symbol-generating functions are typically used in the context of a macro
10:39antares_but it is possible, without it even fairly basic metaprogramming would not be possible
10:41antares_,(defn name-gen [s] (symbol s)) (macroexpand-1 '(defn ~(name-gen "abc") [] "I am named abc"))
10:41clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
10:41antares_clojurebot: wha?
10:41clojurebotTitim gan éirí ort.
10:42Bronsayou cant def
10:44duck1123kij: 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:46duck1123oh well, I thought I had one to show, but it's not quite right
10:49tbaldridgeokay, I need to send some beer to whomever wrote clojurebot...some of the comments that thing makes are hilarious
10:49RickInGAclojurebot: orm
10:49clojurebotObject-Relational Mappers are the Vietnam of computer science.
10:49tbaldridgelol
10:49tbaldridgethe one I saw the other day: https://github.com/richhickey/clojure
10:50tbaldridgehrm...last time it triggered a comment....let's try this: https://github.com/richhickey/clojure/blob/master/src/clj/clojure/core.clj
10:50duck1123https://github.com/richhickey/clojure
10:50tbaldridgenope...anyways, it said something like "*sigh* please update your links..."
10:50RickInGAah
10:50duck1123clojurebot: https://github.com/richhickey/clojure
10:50clojureboteg, https://github.com/clojure/tools.logging is the new version of clojure.contrib.logging
10:52RickInGAIs it Raynes who does ClojureBot... don't think he is old enough... you may have to buy him root beer
10:52antares_RickInGA: outside of US he is
10:52scriptorjust take him to canada
10:52uvtcteehehe
10:52tbaldridgelol
10:53duck1123I thought Raynes was lazybot
10:53TimMcNo, lazybot is Raynes, not the other way around.
10:53cemerickclojurebot is hiredman's, lazybot is Raynes'
10:53uvtcgithub says it's hiredman
10:53scriptoroh, looks like hiredman might be behind cloj
10:53scriptorright
10:53RickInGAok, my bad
10:54antares_lazybot: what do you think about clojurebot?
10:54lazybotIt's AWWWW RIGHT!
10:54TimMcclojurebot: Who's your daddy?
10:54clojurebotPardon?
10:54duck1123Raynes once threatened me with bodily harm for getting that mixed up. :)
10:54uvtcclojurebot: fight lazybot
10:54clojurebotbotfight is http://raek.se/botfight.html
10:54uvtc!
10:55_nmmnclojurebot: add 1 to 2
10:55clojurebotPardon?
10:56uvtc$mail raek botfight is http://raek.se/botfight.html appears to be down. Also, lazybot called clojurebot's mom a script.
10:56lazybotMessage saved.
10:58uvtclazybot: does this work?
10:59foxdonutscriptor: are you alluding to our drinking 7% beer at 13 years old?
11:00scriptorfoxdonut: noooo ;0
11:01scriptormy new goal is to get clojurescript accepted for our new project
11:01scriptoralready asked documentcloud three times about tree-based relationships in backbone without an answer
11:01lazybotThe 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:02duck1123I've been wondering if talking my work into using the Closure compiler would be a good gateway into allowing me to use cljs
11:02TimMcnDuff: Try just riddell -- maybe the . is escaped.
11:02lazybotThe 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:02TimMcargh
11:02foxdonuthow do I get 'A' out of 65?
11:02nDuffTimMc: No matches there either.
11:02TimMcNo, it wouldn't be -- the response has it and isn't a regex.
11:03metellus,(char 65)
11:03clojurebot\A
11:03foxdonutthanks metellus
11:03TimMc(constantly "A")
11:03foxdonutI was trying chr and for some reason my brain froze after.
11:03duck1123,(.charValue \A)
11:03clojurebot\A
11:04duck1123nope
11:04scriptorduck1123: it'd be a good start, I think
11:04TimMc&(char \A)
11:04scriptoralthough getting them into a functional style is more of a challenge
11:04lazybot⇒ \A
11:04TimMc&(int \A)
11:04lazybot⇒ 65
11:04duck1123,(Character/getNumericValue \A)
11:04clojurebot10
11:04TimMcheh
11:05metellus,(Character/getNumericValue \M)
11:05clojurebot22
11:05metellus...
11:09achengwouldn'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:10technomancyacheng: currently that's impossible to do in a way that would preserve comments
11:10TimMcThat info isn't machine readable, though -- or even written down, for many deps.
11:10duck1123wasn't that the intended goal of "lein outdated" (never had much luck with it)
11:11cemericktechnomancy: I tinkered with sjacket a bit last month; it's super-promising.
11:11TimMcREADME files of various projects might say "Versions 2.2 thought 4.9-alpha1 will work with Clojure 1.3.0..."
11:11achengtechnomancy: i guess the user could merge comments in after, using an original
11:12TimMcIf 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:14achengTimMc: maybe the tool could do the next best thing... perhaps collate any available info in a report :-P
11:14antares_JulioBarros: please see https://github.com/michaelklishin/monger/blob/master/src/clojure/monger/ring/session_store.clj
11:14antares_JulioBarros: 1.1.0-alpha2 is up on clojars with this new store added
11:15JulioBarrosantares_: Thanks. I'll check it out.
11:16TimMcacheng: That would be quite a useful alternative, although I fear the core functionality is still impossible.
11:16wingywould be cool if clojure was used entirely for a very popular web site .. that would boost up popularity even more
11:17dbushenkowingy, clojure is already used in Twitter
11:17dbushenkofor data processing
11:18uvtcfortune
11:18uvtc$fortune
11:18lazybotNever Graduate
11:18wingydbushenko: they combine scala and clojure?
11:18uvtc$8ball
11:18lazybotuvtc: Outlook good.
11:19dbushenkowingy, data processing is done with Storm
11:19whaleydbushenko: theyuse storm, which is clojure based
11:19dbushenkoit is written with clojure, yes
11:19foxdonutheh, TDD=Talk-Driven Development?
11:19dbushenkofoxdonut, :-D
11:20whaleyoh sorry, that was intended for wingy :(
11:20gfrederickswhy did my `lein run` process spawn up two other java processes after 5 minutes of running?
11:20xumingmingvfoxdonut: :-D
11:20achengso 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:21whaleywe are becoming very dependent on storm, hence my interest in clojure right now
11:22gfredericksdo java threads have separate OS pids?
11:22whaleygfredericks: nope
11:23nDuff...well, "depends on your OS" may be more accurate; at least historically, I recall JVM thread implementations changing back when OS implementations did
11:25duck1123So if you're running Storm on Java 1.1 you're going to have problems.
11:26wingyreading 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:31foxdonutwingy: nice!
11:36technomancyacheng: there's a plugin that will tell you what needs updating, it just doesn't rewrite project.clj for you
11:37RickInGAI assme it is possible to have a project that works for both 1.7.1 and 2?
11:38achengtechnomancy: is that lein outdated ?
11:41qbert_what is lein ?
11:41qbert_##lein
11:41achenglein saves your hair
11:41RickInGAqbert_ lein = leiningen, the build tool/dependency manager for Clojure
11:43qbert_ok thanks! I'm still learning, any other tools I should know about ? What do ya'll use for an IDE ?
11:43nDuffqbert_: emacs, mostly
11:43S11001001qbert_: emacs
11:43qbert_nDuff, got it! :)
11:44nDuffqbert_: ...be sure to get set up with paredit-mode, clojure-mode and SLIME.
11:44duck1123there's pretty good support for most of the IDE's, but emacs is used most
11:44scriptora couple use vimclojure
11:44tbaldridgeyeah...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:45RickInGAqbert_: 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:45tbaldridgefor emacs modes, personally I love this one: https://github.com/overtone/emacs-live
11:45tbaldridgenotice: the fuzzy filter doesn't actually happen in emacs (thankfully
11:45ro_sthey so does anyone know if RHickey is going to put the clojure/west and euroclojure vids into the official clojure podcast?
11:46RickInGAtbaldridge: Once I learned to live with out menus, I fell in love with that setup
11:46qbert_tbaldridge, oh nice, I just have clojure-mode, that looks way better
11:46tbaldridgeand 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:47S11001001tbaldridge: you know you can make your own unicodings. I use like 15 for scala hacking
11:48tbaldridgeyeah...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:49tbaldridgeI 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:49ro_stemacs-live rocks
11:49duck1123C-h m will show the bindings for the current mode. Helpfull when messing with a new package
11:49ro_sttbaldridge: find and print the cheatsheet. i have mine stuck on the wall next to me
11:49ro_stfor paredit
11:49RickInGAduck1123: awesome, thanks!
11:50TimMctbaldridge: The only thing I don't like about greekifying (fn) is that it screws with column counts.
11:50duck1123For as many options and bindings that emacs has hidden all over, it tries hard to make them discoverable for you
11:50duck1123TimMc: and it looks horrible over putty. (I blame putty for that)
11:51S11001001duck1123: need to change putty terminal encoding
11:51tbaldridgeduck1121: or just blame windows...everyone else does
11:51wingyfor those who read Programming Clojure .. you recall how many days it took you to read it through? it's on 630 pages
11:51wingyro_st: and thanks for the suggestion its an excellent beginner book
11:51ro_stwingy: about a week. i skimmed some stuff, like the sections on numerical stuff
11:51uvtcIt's not reading that takes time, it's working through the stuff.
11:52arrdemwingy: two days... I was already familiar with Lisps
11:52wingyuvtc: yeah thats what i mean
11:52ro_stmy pleasure. it's a great book
11:52nDuffwingy: It really _isn't_ the size -- I was rereading Joy of Clojure for months before everything clicked.
11:52ro_stgotta run!
11:53wingyi 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:53uvtcBut it also takes time for things to sink in, IMO.
11:53wingyyeah i always reflect and play with the repl
11:54nDuffExactly -- if it only takes one pass through the book to fully grok its contents, you're doing remarkably well.
11:55wingynDuff: i hate to leave things behind .. since i know i always have to go back to get it later
11:55nDuffwingy: 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:56arrdemcan 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:57qbert_oh. my. god. Overtone! Holy jesus!
11:57arrdemthe 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:58wingynDuff: always for me as well .. good to read many different books though since time is a constraint
11:58wingyyou get things explained from another perspective with other words and also they cover something else the previous ones didnt
11:58RickInGAqbert_: hehe
11:58nDuff*nod*.
11:58wingyand books come out all the time for new versions .. kinda give you an excuse for reading new books on the same topic :)
11:59wingysometimes i could pause the time and just read books for a year
11:59wingythat would give me a lot of knowledge :)
11:59wingysometimes i wished..
12:00TimMcduck1123: Try KiTTY.
12:00nDuffqbert_: Just now getting familiar with Overtone? The presentation at last year's conj was great.
12:00RickInGAwingy: I have kind of gotten in a trap where the more I learn, the more I realize I don't know.
12:01wingyRickInGA: its reality
12:01duck1123TimMc: I just try to avoid windows.
12:01wingyand its good to embrace it .. once we start thinking we have all the answers we stop looking .. and won't get smarter
12:06wingyatm 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:08cgagwell if you already have the function name you can do (doc fn) or (source fn)
12:10wingycgag: 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:10qbert_nDuff, is it online anywhere ? I've haven't been this excited in a long long time
12:10wingydidn't know about source .. seems much better than doc
12:11qbert_I don't see how I can get any work done now, going home to read my clojure books, biab
12:13TimMcwingy: There's also some ClojureDocs lib you can use from the REPL.
12:16antares_JulioBarros: I pushed monger 1.1.0-SNAPSHOT with Clojure reader extensions, let me know how that goes
12:28dnolenhmm when protocols are only 1-3 methods, delegation is really pretty simple ...
12:47stainanyone of you doing RDF or Linked Data with Clojure?
12:47gtrakyea
12:50staingtrak: 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:50stainhttps://github.com/stuartsierra/clojure-rdf is 3 years old ..
12:51stainI'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:52stainyou use CRG?
12:52gtrakI work with the guy that wrote it
12:52gtrakI haven't yet had a chance to take a deep look though
12:54gtrakstain: 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:55stainseems nice, but lack of import AND export is a bit of a killer.. ;)
12:55stainOK.. this jena lib is non-opensource?
12:55gtrakyea, I was looking at what it would take to do a turtle parser as a hobby project :-)
12:55gtrakstain: ours isn't open, I think clj-plaza might help though?
12:56stainwell, as long as you take Turtle and not N3 it should not be too bad
12:56gtraktrying to remember what the other thing was
12:58staingtrak: 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:58gtrakstain: https://github.com/drlivingston/kr
12:58stainI'll give it a try.. hopefullý it's just a few bindings away
12:58gtrakI think that's what I saw a little while back
12:58staintalk about useless project names!
12:59staingtrak: that one looks great, it uses sesame or jena
13:00gtrakyea.. I've looked a bit at the jena api, it's ... complicated
13:01stainyes, it is not one of my favourites..
13:01gtrakthere's all these parallel hierarchies to plug in inference stuff
13:01stainI try to use Sesame if I can, but that is a bit more of a powerhog I feel
13:01stainkind of like postgresql vs mysql
13:01gtrakCRG is just a graph-manipulation and indexing thing, it needs a turtle parser
13:02gtrakCRG is basically MRG in clojure
13:02gtrakhttp://code.google.com/p/mrg/
13:02stainyeah, 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:03gtrakMRG actually uses ARP to parse stuff i think :-)
13:05duck1123If 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:07nuclearsandwichtechnomancy: pong
13:07stainduck1123: yeah, I saw that
13:07qubit[01]so, to my dev envirnvoment, I want swank, slime, live emacs, anything else ?
13:07stainduck1123: so what's good about clj-plaza?
13:08technomancynuclearsandwich: oh, I opened an issue for my question: https://github.com/nuclearsandwich/swarming/issues/1
13:08duck1123it makes it easy to work with rdf models. I haven't really tried many of the other libraries that are out now
13:08duck1123it suits my needs
13:09nuclearsandwichtechnomancy: to which I just replied. Sorry for the delay. My email is messed up by this Apple I'm using. :\
13:09kaoDis there any good way to step-debug Clojure code in Emacs?
13:10kaoDI'm so tired of prints/debug macros
13:10nuclearsandwichI 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:11technomancynuclearsandwich: gotcha
13:11fentonqubit[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:11xumingmingvkaoD, try CDT? (myself have not tried it though..)
13:11qubit[01]fenton, perfect thank you
13:11stainduck1123: I'll have a look.. your fork is not in clojars?
13:12fentonkaoD: 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:12kaoDxumingmingv, not sure what CDT is, let me Google that
13:12kaoDoh, thanks fenton
13:13stainduck1123: oh, found it, net.kronkltd/plaza
13:13stainduck vs kronk confused me ;)
13:13fentonkaoD: just look for the debugging section at the bottom...it's using CDT.
13:14kaoDoh, that looks promising
13:14xumingmingvFor 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:15technomancyxumingmingv: it's not common because you have to be in a really nasty situation to actually need stepping
13:16technomancyfor well-factored code the repl and occasional break-repl is enough
13:16fentonxumingmingv: 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:16fentonwith global data...
13:17technomancythe only time I used CDT was to track down what turned out to be a bug in Clojure itself
13:18TimMcStill need it from time to time.
13:18fentonits 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:18gtraktechnomancy: what is this break-repl you speak of?
13:18TimMcWell, *desire* it.
13:19technomancygtrak: (swank.core/break)
13:19kaoDfenton, IMHO, a debugger is an awesome tool
13:20kaoDit can save lots of typing when trying to debug code
13:20technomancygtrak: http://hugoduncan.org/post/2010/swank_clojure_gets_a_break_with_the_local_environment.xhtml
13:20gtrakah
13:21qubit[01]hmm, cant find out where to get swank
13:21gtrakqubit[01]: try the lein plugin
13:23qubit[01]gtrak, ok, I have this in my ~/.lien/profiles , [lein-swank "1.4.4"]
13:23qubit[01]Debugger entered--Lisp error: (error "Could not start swank server: /bin/bash
13:24qubit[01]where do I find swank itself ?
13:25gtrakthere's clojure-jack-in on the emacs side, and lein swank if you want to start the swank server from cmd-line
13:25gtrakclojure-jack-in actually runs lein swank I believe
13:25gtrakif you start it yourself, you can connect with M-x slime-connect
13:25kaoDgtrak, yes, it does
13:25nDuff...also, you can use clojure-swank and start the server yourself if your environment is too involved to be launchable via lein
13:26duck1123The plus side of launching swank from within your environment is all your nses are already required/loaded
13:27gtrakduck1123: hmm? I never a difference like that, what do you mean?
13:28kaoDduck1123, I am not sure what you mean either
13:28gtraknever noticed*
13:28kaoDM-x calls lein swank, so...
13:28wingysame thing different styles I supposed: https://gist.github.com/3005550 which one is more appropriate?
13:28wingyor simpler in the long run
13:29duck1123If 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:29duck1123C-c M-p
13:29gtrakwingy: second is clearer to me
13:29gtraksorry, the first
13:29qubit[01]lein swank , is not a task ?
13:30qubit[01]using the 2.x preview found here https://github.com/technomancy/leiningen/
13:30gtraklein swank starts the server
13:30fentonI 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:31devnclj-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:31fentonhere is my workflow documented: https://github.com/ftravers/PublicDocumentation/blob/master/clojure.md#basic-workflow
13:31qubit[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:32nDuffqubit[01]: what version of lein are you running?
13:32fentonhave you specified lein-swank as a plugin in your project.clj file?
13:32qubit[01]this one https://raw.github.com/technomancy/leiningen/preview/bin/lein
13:32nDuffSee the readme at https://github.com/technomancy/swank-clojure/ discussing installing the lein-swank plugin
13:33scriptoranyone have any links handy to clojurescript codebases?
13:33qubit[01]fenton, doh, I had it in ~./lien, sec
13:33scriptorjust to see some examples of how they're laid out
13:33fentonqubit[01]: have a look at my workflow doc...it's all there...
13:33gtrakqubit[01]: lein can download it automatically for you
13:35qubit[01]yeah, all of the problems were because I had misnamed it lein, it works!
13:35qubit[01]lien*
13:35wingya lot of abbreviations in clojure
13:35wingyis that a good or bad things?
13:35wingystrs instead of strings
13:35foxdonutabbreviation is such a long word :)
13:36fentonlol
13:36tbaldridgewingy: 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:36wingyyeah
13:36tbaldridgein clojure if you only have 3 inputs to your pure function, name them a and b instead of something longer
13:37wingyright
13:37wingyso abbrs are good
13:38duck1123also, 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:38TimMcShort enough to be interesting, long enough to cover everything.
13:38TimMcWait, that's essays, and also skirts. (Thank you, 8th grade English teacher.)
13:39tbaldridgefor which one?
13:39tmciverTimMc: lol!
13:40TimMctbaldridge: For that guideline.
13:49muhooheh, having to touch some code in another language for the first time in months, i started a comment with ;;
13:49gtrakwhy another language?!?!?!
13:49jodarodon't do it!
13:49muhooum, fixing bugs.
13:49jodarofix them in clojure
13:49kaoDgtrak, I do Python at work :(
13:49muhooi write it, i maintain it. them's the rules.
13:49gtrak:-(
13:50kaoDat least I get to use emacs
13:50muhooi am finally now deciding to try to build a product, instead of looking for clojure contract gigs
13:50muhooi've been lucky, but it seems everyone doing clojure is looking for full-timers
13:55jodaroi tried to get the contractor thing going here but was given a long explanation as to why we 'prefer' fte
13:56jodaroso now i get to do all the work myself
13:56jodarohe
13:56jodaroh
13:56technomancygoing 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:57kaoDokay, another question about coding style: https://gist.github.com/3005694
13:58jodarotrue, though to get some extra helping hands when you already have some full timers on board, i think its a decent risk
13:59technomancykaoD: I'd go with the shorter approach; I like to write with :require :as in mind
13:59duck1123require vs use/only is pretty much a matter of style choice for the particular code you're writting IMO
13:59duck1123nvm, misunderstood the question
14:00kaoDtechnomancy thanks, that's what I thought
14:00technomancyI wonder if we could get someone to create a setup.exe type installer for Leiningen on Windows
14:01kaoDtechnomancy, what do you mean exactly? I might volunteer
14:01kaoDI use Win from time to time
14:01technomancykaoD: right now lein on windows involves either installing curl or manually tracking down jars and putting them in exactly the right place
14:02technomancyit's kind of lame; I guess wizard-style installers are more common on Windows
14:02technomancysince there isn't any system-level package management
14:02kaoDtechnomancy, sure? I don't remember doing that under Win
14:02kaoDIIRC, I just downloaded a batch file and ran it
14:02kaoDalthough that was Lein 1.7
14:03technomancythat only works if you have an HTTP client present
14:03technomancymaybe you have wget via cygwin or something?
14:03kaoDyep, I have native wget
14:03gtrakhttp://nsis.sourceforge.net/Features <-- it can download stuff
14:04devnjodaro: maybe you could approach that same question but more along the lines of "contractor who has the added benefit of training others"?
14:04technomancygtrak: interesting; that's even packaged in apt
14:04technomancywould be nice if I could generate installers myself
14:05gtrakit came from winamp way back when, I believe
14:06elliottwhey, 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:07kaoDelliottw, that doesn't make sense
14:07kaoDClojure has native overloading by arity
14:07technomancyelliottw: multimethod dispatch functions are just regular functions; nothing special about them
14:07elliottwso 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:08kaoDelliottw, tags?
14:08elliottwsorry. for example, i want to write a program that titlecases a sentence
14:09elliottwif a small word is in the sentence, then keep it lowercase
14:09elliottwif that small word is the first or last word capitalize it
14:09kaoDif I got what you mean, multimethods aren't meant for that
14:10kaoDjust map over the collection
14:10raekbut it is possible with multimethods, though
14:10elliottwthe issue is that i want to easily add new "tags"
14:11kaoDI wouldn't classify the multimethod approach as easy
14:11kaoDjust keep a map of tags
14:11kaoDand update it when needed
14:11kaoDmuch cleaner, much more functional
14:12kaoDyou can even have functions instead of a map
14:12kaoD(and maps can work as functions too)
14:12raekit seems that in this case much of the logis is in finding out which tags apply
14:12raek*logic
14:12elliottwso right now there are some conditions, :first-word, :small-word, :camelcase, :email, :url
14:13elliottwand depending on how they interact, I want to run a different f
14:13kaoDyou just need a function that encodes the logic
14:13elliottwso if i pass in :small-word and :first-word, then capitalize
14:13raekmultimethods are useful when you have a fixed number of values to dispatch on (usually one)
14:13elliottwif i pass in just :small-word dont' capitalize
14:14kaoDelliottw, so what's wrong with cond?
14:14elliottwi'm using cond right now and it's getting huge
14:15raekI think a cond sounds most straight forward here too. you need to encode the priority of the rules somehow too
14:15kaoDelliottw, then craft a CoR pattern
14:15kaoDchain of responsibility
14:15elliottw? wow, that's new to me. sorry i'm just starting out on clojure
14:15kaoDdon't worry
14:15kaoDbut that's not Clojure's
14:15kaoDit's a general programming pattern
14:15elliottwi've never coded before
14:15elliottwgoogling now
14:15kaoDoh, I see
14:16kaoDin short: think of it like a chain of handlers
14:16kaoDthe first handler (a function) takes some data and acts accordingly
14:16kaoDthat includes possible passing it to the next handler in the chain
14:16raekyou could have a list of predicate-action pairs (where an "action" is capitalize or lowercase)
14:17raektry each predicate in turn and when one of them returns truthy, invoke the action and stop
14:17kaoDraek, that's kind of what I mean
14:18kaoDalthough with CoR several rules can apply
14:18kaoD(and the event can be consumed too)
14:18elliottwinteresting
14:19kaoDin fact, it's just a special case of what you mean, it's just not boolean (truthy=stop, falsey=keep trying)
14:19kaoDyou can even forget about the CoR and just create little handlers and thread them
14:20kaoD(just like Ring handlers)
14:20elliottwoh
14:21elliottwisn't that what cond is? test the first condition, if fail, keep moving?
14:21kaoDcond is more like what raek means
14:21kaoDit's just a runtime cond
14:21kaoDyou can add and remove predicates-actions as you wish
14:21elliottwso here is my code now. be gentle this is the first real program evar
14:21elliottwhttps://github.com/elliottw/titlecase/blob/master/src/noir_bootstrap/views/welcome.clj
14:22kaoDelliottw, may I ask: why did you choose Clojure to begin programming?
14:22elliottwlol
14:23elliottwit's seemed the most academically interesting
14:23elliottwi've written small scripts in perl, and was thinking of trying perl 6, but clojure seemed more different than every other language
14:23elliottwand it seems hard, which i like
14:24kaoDwell, for a simple approach you could do raek's suggestion
14:25kaoDlet me craft a little magic
14:25elliottwkaoD k
14:27amalloyelliottw: 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:27amalloybut in real life i'd just write it as (some #{word} word-list)
14:29amalloyand good on you for using join. your perl heritage, i guess; a lot of people wind up reimplementing that using lazy sequences
14:30elliottwsorry 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:31elliottwamalloy i didn't even know about #{whatev} when i wrote that f. guess that's what happens whens you don't read first
14:31amalloythat's how it goes
14:31uvtcNothing wrong with doing everything wrong. :)
14:31amalloyhah, i like that phrasing
14:32uvtc(er, {small print} only applies in this particular instance. Offer expires upon expiration. No refunds or exchanges.)
14:32elliottw 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:33aduI challenge you to write a webapp in clojure in a day, I did
14:34cgagas your first program?
14:34aduwell, my first program was hello world
14:34elliottwadu it took half a day to sign up for prgmr.com, install ubuntu, jvm, clojure/lein, noir
14:35amalloyelliottw: i wonder...it seems like you might be the target audience for ibdknox's light-table demo
14:35elliottwi saw that and almost shat myself
14:35elliottwi'm messing around with the "playground" now
14:35amalloysweet. you might also like 4clojure.com
14:36elliottwamalloy just saw this today, and am going to run through a bunch
14:38elliottwi just wish it had vim keybindings
14:38cgagi think it does / will
14:39technomancythat's your browser's job
14:39amalloyelliottw: you can disable the javascript and set your browser up to do it
14:39amalloyassuming you're talking about 4clojure and not light table - probably no good to disable js for light table
14:39elliottwyeah i was talking about light table
14:40amalloywell, ibdknox uses vim. but keybindings are probably not his priority
14:40cgagisn't it built on codemirror, i heard that already has an attempt at vim bindings
14:40elliottwamalloy i don't understand why he joined yc if he already got like 300k
14:41amalloycontacts are worth more than money in the startup world, i suspect
14:41pandeirophantomjs takes how many days to compile?
14:41uvtcelliottw, are you happy with prgmr? Prices look good.
14:43shawnlewiswhat do I need to :require to make pprint available to a browser connected (clojurescript) repl?
14:44elliottwuvtc 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:46uvtcelliottw, thanks!
14:47uvtcelliottw, 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:47elliottwalso pinboard uses prgmr for the site and if you read his blog, he seems to know what he's doing
14:48elliottwuvtc 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:48elliottwe
14:49uvtcelliottw,: Ah. Thanks. I've heard them recommended elsewhere. May finally make the leap of shared hosting and give them a try.
14:49uvtcs/of/out of/
14:50elliottwuvtc 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:50cgaglinode is more expensive, but i've been happy with them
14:50amalloyyes, linode is pretty excellent if you don't mind the money
14:51elliottwlinode is awesome, just hard for me to justify with personal projects.
14:51uvtcI'm using hurricane electric at the moment. The el-cheapo shared hosting plan I'm on is actually no longer even offered.
14:51elliottwtheir library of help files got me through a lot
14:51y3dihow can I do local running for noir apps? I have lein and swank-clojure installed.
14:51uvtcBut they've been good.
14:52amalloyuvtc: i have a linode that lives in HE's colo
14:52uvtc(el-cheapo meaning least expensive)
14:52uvtcamalloy, they seem quite professional, from my dealings with them.
14:52elliottwy3di i just followed these directions http://webnoir.org/#started
14:53amalloyuvtc: there was a really bad week or so around a year ago, when someone was DDoSing HE's fremont location
14:53y3dithanks elliottw, i'll take a look
15:01amalloydnolen: 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:02dnolenamalloy: yes a "line" is a conjunction. ST ^ R, vs. s# ^ ST ^ R
15:02dnolens# will always succeed so those expressions are equivalent.
15:02amalloyokay, 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:02clojurebotbut it gets you the balanced pairs, which is the important part IME
15:03amalloycool, that's perfect. conde is like a built-in disjunction of conjunctions, which is lovely
15:03elliottwwhere did kaoD go?
15:03dnolenamalloy: yes
15:12uvtcWhat is the "test" in an if-let? Is if-let simply checking the truthiness of the local you bind a value to?
15:13uvtcIn the docs for if-let, what does "bindings => binding-form test" mean?
15:17amalloyuvtc: well, it's checking the truthiness of the value before binding it to a local
15:19uvtcamalloy, thanks.
15:20uvtcamalloy, oh, right. Not sure what else I was expecting it to do. :)
15:21uvtcSaves you from doing (if ... (let [...] ...)).
15:22uvtcI guess I was execting the docs to say: `bindings => [local test-expr]`.
15:24y3diclojure-jack-in doesn't seem to work in lein noir projects, however works find in generic lein projects
15:24y3dihas anyone else had this issue/know how to fix it?
15:24xeqiuvtc: binding-form implies you can destructure it
15:26uvtcAh. Ok, thanks, xeqi.
15:27uvtcBut 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:29tbaldridgeuvtc: that's correct
15:30uvtctbaldridge, thanks.
15:31tbaldridgeI'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:32uvtctbaldridge: Have not yet made it to that chapter. :) But once I do, I'll take a look. Thanks for the link.
15:38amalloydnolen: 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:39kaoDelliottw, https://gist.github.com/3006297 <- this is raek's idea (or what I understood of it)
15:41dnolenamalloy: oh right, thanks for the heads up.
15:43kaoDelliottw, and here used with map https://gist.github.com/3006297
15:44kaoDsry, this -> https://gist.github.com/3006297
15:44kaoDah, it's always the last revision, nervemind
15:55uvtcI'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:58uvtcHm. zipmap maybe.
16:00wingyisn't declarative programming languages like clojure using imperative coding underneath?
16:00wingyi imagine that someone has to tell the computer what to do
16:01ivanClojure is mostly not declarative
16:01technomancywingy: of course; computers actually run opcodes in machine language
16:01ohpauleezuvtc: Typically you use reduce to grow a collection, and zipmap, interleave, and partition (usually as a stepping function)
16:01ohpauleezto build or stitch together
16:02technomancywingy: the whole point of having a compiler is so you don't have to think in terms of machine language
16:03uvtcohpauleez, Ah. Yes. Thanks. Actually, it ocurred to me that maybe there's some way to use `hash-map` with `for`...
16:04ohpauleezuvtc: More commonly is to use higher-order functions than raw loops
16:04uvtc,(for [n (range 5)] [n (* n n)])
16:04clojurebot([0 0] [1 1] [2 4] [3 9] [4 16])
16:05ohpauleezzipmap
16:05cgag,(into {} (for [n (range 5)] [n (* n n)]))
16:05clojurebot{0 0, 1 1, 2 4, 3 9, 4 16}
16:05amalloyuvtc: into/for
16:05amalloy(inc cgag)
16:05lazybot⇒ 1
16:05ohpauleezor that
16:05uvtcOh, of course. Thanks!
16:05ohpauleezzip map is if you have two collections you want to lace together
16:06ohpauleezbut what you probably want is a vector of just the values, no?
16:06ohpauleezsince you're just using integer keys?
16:07dnolenwingy: it's also possible to embed a more declarative paradigm - that's the idea behind core.logic.
16:07uvtcohpauleez, just experimenting with creating hash-maps at the moment. Thanks though.
16:07ohpauleezahh, gotcha
16:10wingyivan: could you elaborate?
16:10clojurebotHuh?
16:11wingyclojurebot: ?
16:11clojurebotexcusez-moi
16:12wingyor perhaps i won't even have the knowledge to understand any explanations yet :)
16:18nizzeHello. 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:21ivanwingy: it's functional and imperative
16:22Raynesnizze: Most people feel that is a good thing.
16:22ivanwingy: core.logic or datalog would be declarative
16:25nDuffnizze: ...see also Rich Hickey's essay on hammock-driven development.
16:25nDuffs/essay/talk/
16:25wingyivan: what is core.logic?
16:25ivanhttps://github.com/clojure/core.logic/
16:25dnolenwingy: 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:26jtoywhat is wrong with this name: lein new 3iagents => Sorry, project names must be valid Clojure symbols.
16:26cgagcan't start a symbol with a number
16:27amalloydnolen: 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:27jtoyoh, ic
16:30wingydnolen: yeah clojure seems far more declarative than typical oop langs
16:31jtoywingy: is that bad?
16:32wingyjtoy: no i feel declarative styles make you more productive and eliminates more bugs
16:33jtoyis 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:33jtoyi will be calling rm/mv/lzop many times in my clojure code
16:34nickmbaileyjtoy: http://clojure.github.com/clojure/clojure.java.shell-api.html
16:35nickmbaileythe jvm itself can have a pretty big overhead for forking processes though
16:35technomancyjtoy: don't shell out for simple things like mv and rm
16:36jtoynickmbailey: 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:37jtoyany libraries you guys recommend for turning my code into a deamon ?
16:37KirinDavetechnomancy: Hey, is it possible to tell lein to include arbitrary maven plugins?
16:38KirinDavetechnomancy: when generating the pom file
16:38technomancyKirinDave: there's a branch for that I think
16:38technomancylemme see
16:38technomancyKirinDave: https://github.com/technomancy/leiningen/pull/454
16:39technomancypull req needs to be cleaned up and generalized, but I think the basic idea is sound
16:39jodarojtoy: there is this: https://github.com/arohner/lein-daemon
16:39KirinDaveI see.
16:39KirinDaveI guess for now I'll shellhack the pom file.
16:39KirinDaveI need this stuff out today.
16:39jtoyjodaro: just saw that, is that what people actually use?
16:39KirinDaveAnd our existing deploy methodology is heavily integrated with scala-centric pom files.
16:40KirinDaveOh Jenkins, you are agony.
16:40technomancyKirinDave: add-hook on xml-tags might work too
16:40technomancyKirinDave: hopefully it'll be in the final 2.0.0 release
16:41KirinDavetechnomancy: Well let me toss in a +1 for that idea.
16:41jodarojtoy: not sure. you might look at the apache commons stuff too
16:41KirinDavepom files are an ugly but necessary part of life.
16:41jodarodepends on what kind of daemony things you want i guess
16:41KirinDaveEsp plugins like assembly.
16:41technomancyKirinDave: was thinking of doing a release today, but if you want to tackle it I could push it to tomorrow =)
16:42KirinDavetechnomancy: I have a lot more to do today than just this. Sorry.
16:42technomancyno worries
16:42KirinDaveAnd one of my hounds was keeping me up all night sick. Bummer for me
16:42technomancyit'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:43nickmbaileyjtoy: i would look for a native java lzo library before i went with the shell route
16:44jtoynickmbailey: really? command line is that bloated/slow?
16:44technomancyjava kind of ... pretends unix doesn't exist
16:44technomancyas much as it can get away with
16:45nickmbaileyrunning a shell command requires forking the process, which can be slow for the jvm especially if you have a really large heap
16:45technomancyand there's a bug in some versions of the JVM where it temporarily requires 2x the heap size to fork
16:45jodaroif you have a c library you can wrap it with jna
16:46technomancyhiredman: are you guys still working around that?
16:47hiredmantechnomancy: yes
16:49technomancy=\
16:50hiredmanof course we are still on 1.6
16:52technomancyif anyone's running lein from git, could you update and try it out?
16:52technomancyhoping 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:54cgagwhen does 2.0.0 become the standard?
16:55technomancycgag: once the clojars releases repository is populated enough to make it a feasible default
16:55technomancythe lein faq has details
16:56antares_technomancy: just tried with a few repos, works well
16:57technomancyyay
16:58jtoyin leiningen what is the diff between dependencies and dev-dependencies?
16:59technomancydev-dependencies are an old thing that leiningen 1.x used to use
16:59jtoyI'm still on 1.x because the website says its still hasn't reached rc
17:00uvtcWhat 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:00technomancyeven on 1.7.x you should use :plugins over :dev-dependencies
17:00technomancyjtoy: but at this point it's safe to upgrade to 2.x; the only reason it's not finalized is a technicality
17:00xeqi.. unless you actually want a dev-dependency?
17:00aperiodictechnomancy: seems ok from here
17:00uvtcThe "Clojure Programming" book does this on p.147 (the defn maze example).
17:01uvtcWhich is a doozie, I might add. :)
17:01technomancyxeqi: valid use cases are few and far between
17:01cgaguvtc: ha yeah it is
17:02amalloywelllll, 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:02duck11231Didn't this same question come up last week? Is it using a macro anywhere?
17:03jtoyif 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:03borkdudetechnomancy I will try to build and test it on windows xp also
17:03technomancyborkdude: you're a champ =)
17:03jtoyI'm trying to add [clj-aws-s3 "0.3.2"] , and it just errors out when i do lein deps
17:04uvtcamalloy, I don't see it using a dynamic variable ... Hm. I also don't see any macros in there.
17:04technomancyjtoy: looks like a bug in the library
17:04technomancyjtoy: jets3t is easy to use for publishing to s3
17:04jtoyhmm, i guess people aren't actually using these libraries, wtf
17:04jtoythat is not very encouraging
17:05technomancythere are abandoned broken libraries in every language and runtime
17:05technomancyhm; that one's from weavejester though; he's usually pretty good about that kind of thing
17:06duck11231I tried adding it as a plugin (cause that buffer was open) and it seems to lein deps for me
17:07technomancyjtoy: works for me
17:09jtoytechnomancy: here is my project, http://pastebin.ca/2165124 is anything wrong with it? if i comment out clj-aws-s3 it works
17:11technomancyjtoy: hm; it could be a 1.x problem I guess?
17:11technomancysee if 2.x works maybe?
17:12jtoytechnomancy: 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:12technomancyyeah, it's fine
17:12duck11231just rename one lein2 or lein1.7
17:14borkdudetechnomancy is it expected that leiningen downloads lein-newnew when first run (this happens on me in Windows XP)
17:15jcrossley3cemerick: thx for the rt :)
17:15uvtcamalloy, thanks for the answer earlier, btw.
17:15jtoytechnomancy: running the new lein with "lein repl", I just get a bunch of permission denied errors
17:15technomancyborkdude: yeah, that's in order to allow it to be updated independently of lein
17:16cemerickjcrossley3: Sure thing. Looks like good stuff, per usual. :-)
17:16jcrossley3:)
17:16borkdudetechnomancy ok.. lein prints its tasks now in preview7 in XP, great ;-)
17:16technomancyborkdude: progress!
17:16technomancyjtoy: filesystem permissions or remote permissions?
17:17jtoytechnomancy: 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:17jtoytechnomancy: viewing that link in http doesn't work for me, it could be my network then
17:17technomancythat's weird but shouldn't be fatal
17:18technomancyI mean it's not related to the aws dependency
17:18jtoyhmm, I hope my system is not borked
17:19cemerickjcrossley3: would it be absurd to use immutant on heroku or something like elastic beanstalk?
17:20cemerickI've never used jboss, so perhaps that's a dumb question. :-P
17:21jcrossley3cemerick: we've discussed it with heroku engineers (don't remember who, they gave a talk at arug here) for torquebox
17:21hiredmanmy 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:21jcrossley3cemerick: it comes down to the number of ports it wants to open iirc
17:21borkdudetechnomancy congrats, works for me on OSX and XP
17:21technomancyborkdude: thanks!
17:22tcrawleycemerick: you can, however, use immutant on openshift now with a little hacking. I don't know what the performance is like though
17:22jcrossley3cemerick: 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:22borkdudetechnomancy let's try now with throwing .m2 away...
17:22hiredmanjcrossley3: 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:22cemerickjcrossley3: Right. Presumably not a problem on beanstalk, then.
17:23hiredman(the jgroups thing is sort of a peeve of mine)
17:23cemerickhiredman: surely it doesn't *require* multicast?
17:23tcrawleyjcrossley3: is s3_ping still an option?
17:23jcrossley3hiredman: you're not alone.
17:23jcrossley3tcrawley: yes
17:24technomancycemerick: the lack of a TCP router is probably going to kill jgroups
17:24hiredmancemerick: it doesn't, but I've had less then stellar experiences using anything other than static file based discovery on ec2
17:24hiredmanwhich rules out more dynamic environments
17:24cemericktcrawley: noted
17:25tcrawleycemerick: https://github.com/projectodd/polyglot-openshift-example
17:25borkdudetechnomancy phew, yup, also works ;)
17:25cemerickI can't say I've bothered with openshift at all, since it seems mostly vapor-esque.
17:26tcrawleycemerick: 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:27jcrossley3cemerick: i don't think vapor-esque is fair now. (it was last year)
17:27cemerickSure. The premise is promising.
17:27borkdudenow waiting for instarepl/leiningen integration :P
17:30cemerickjcrossley3: 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:33jcrossley3hiredman: the auto-scaling issue (killed/moved processes) is something we're trying to workout on openshift. i have little clue atm.
17:33jcrossley3cemerick: fair
17:34jcrossley3cemerick: you sound kinda enterprisey, though. ;)
17:34hiredmanjcrossley3: I am sort of surprised no one offers zookeeper as a service
17:35Raynesjcrossley3: He totally is.
17:35Raynescemerick: They seem pretty solid.
17:35Raynescemerick: I experimented with it a while back. They plan to have pay plans pretty soon afaik.
17:36hiredmanpaxos as a service
17:37borkdudeFisher Price, Enterprise and everything in between
17:37hiredmanas far as I can tell everyone manages their own zookeeper clusters
17:37ivanwhat would the service do? don't the nodes do all the work?
17:38cemerickjcrossley3: My sarcasm detector is flummoxed. :-D
17:38jcrossley3borkdude: i used to refer to ms-windows as a "fisher price os" until my kid pointed out i was insulting fisher price. ;)
17:38taliosMornin
17:38borkdudejcrossley3 lol
17:38brehautmorning talios
17:38jcrossley3cemerick: ha!
17:39borkdudehello talios
17:41taliosOoo I'm liking the new IDEA 12 splashscreen - https://skitch.com/talios/ed132/leda
17:41talios'lo borkdude
17:48borkdudetechnomancy et al, good luck with preview7 - gtg
17:48technomancythanks =)
18:04wingyFP seems to be solving the problems with simplicity while OOP is doing the same but adding unnecessary complexity, which could lead to bugs
18:12TimMcwingy: Don't worry, there's still plenty of complexity left over.
18:14jtoyI 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:21technomancyjtoy: (doseq [item (queue)] (work-on item)) is better
18:21technomancyassuming queue is a function that returns an infinite seq
18:25jtoytechnomancy: 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:26jjttjjdoes anyone know of any example apps using korma? or any medium sized noir apps in general? (besides noir-blog/messageboard)
18:26technomancyjtoy: that will work; you asked if there was a better way
18:27jtoytechnomancy: ok, I will try to learn how to use sequences, I still don't know how to use them
18:58jtoyhow do I break out of a doseq ?
18:58brehautjtoy: :while or :when
18:59brehautwait no
18:59brehauttha
18:59brehautts not what you are asking
18:59RaynesYou don't 'break' out of a doseq.
19:00jtoythis 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:00jtoyso something like (doseq [ page (range 1 33)) (process_until_page_returns_nil page) )
19:02AimHereWouldn'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:03brehaut(dorun (take-while identity (map process_page (range 1 33))))
19:03brehauts/dorun/doall/
19:03jtoyI'm new to clojure still, so not sure what the "right way" is
19:03brehautjtoy: lazy sequences are not just about lists of things; they allow you to factor out control flow of loops into composable chunks
19:04jtoybrehaut: how exactly do sequences allow you to factor out control flow ?
19:05brehautjtoy: you write functions that perform the control flow operation that take a seq and return a seq
19:05brehautfor example, take-while factors out the 'loop until something happens and then break'
19:06jtoyok, i think i see, coll
19:06jtoycool
19:06wingyis scaling vertically (1 hardware server with as many cores/memory as you need) more optimal than scaling horizontally (more hardware servers)
19:06brehautwingy: they are orthoganal concerns.
19:07wingybrehaut: which means?
19:07brehautwingy: they arent really related
19:07wingyi wonder since clojure seems to be designed for scaling vertically, but not horizontally
19:07brehautclojure just doesnt pretend that scaling horizontally is free
19:07wingywhile erlang is doing the latter?
19:09brehauterlang is kinda tricky to put into a box that way
19:10brehautits design decisions are more about reliablity than 'scaling' per se
19:10brehautit makes some pretty hard trade offs to be reliable in the face of just about anything
19:15wingybrehaut: but is clj designed to scale horizontally?
19:15brehautwingy: i dont think thats a real question
19:15wingyhttps://gist.github.com/3007504 this looks pretty mad .. why would anyone use a vector as a key
19:15brehautlanguages dont scale, programs do
19:16brehautwhy would you not use a vector as a key?
19:16wingywhy would i?
19:16wingyis there any benefit doing that?
19:16brehautbecause its a value, and if its the appropriate key then not using it would be daft
19:17wingyhmm
19:17wingythats pretty correct
19:17brehautyes it is
19:17wingyjust not used to it from other langs
19:17wingycool in a way that anything can be used as a key
19:17wingyman i love clj
19:17wingylove the philosophy
19:18brehautthats… not true
19:18Raynes$dict pedant
19:18lazybotRaynes: noun: One who pays undue attention to book learning and formal rules.
19:18wingywhy isn't it true?
19:18brehautim pretty sure java, C#, python (for instance), all let you do the use a vector equivalent as a key in a mapping
19:18wingyRaynes: you mean me?
19:18RaynesNo.
19:19amalloybrehaut: he means not used to it from bad langs like php
19:19amalloyand js
19:19amalloyand perl?
19:19wingyphp, ruby, js
19:19nDuffbrehaut: not a list, in Python, only a tuple.
19:20amalloywingy: wrong about ruby
19:20nDuffbrehaut: only immutible types can be used as keys there -- the world is at least _that_ sane.
19:20wingyamalloy: just stayed there for a couple of months .. must have missed it
19:20amalloy{[1] => :x}[[1]] ## returns :x
19:20brehautjs is getting proper maps in a future release that accept non-strings as keys too
19:21brehautnDuff: ah yeah my bad. the vectors as listy and tuply things throws a wee spanner in that analogy
19:30brehautwingy: 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:35wingybrehaut: from what i have understood many langs cant take advantage of multi core
19:35brehautwingy: most languages make multithreaded code difficult yes, but thats not the same thing
19:38shawnlewiscan anyone recommend an open-source clojurescript web-app worth reading through (beyond twitterbuzz)?
19:41jayunit100idiomatic way to pretty print json to a string ?
19:41gfredericksfind a json lib that can pretty print?
19:41gfredericksand use with-out-str if necessary
19:42jayunit100with-out-str ?
19:42gfredericks,(with-out-str (println "foo"))
19:42clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")>
19:42gfredericks&(with-out-str (println "foo"))
19:42lazybotjava.lang.SecurityException: You tripped the alarm! pop-thread-bindings is bad!
19:42gfrederickswat
19:42jayunit100wow
19:42gfredericksjayunit100: it just redirects all printings to a string
19:43jayunit100oh wow you can wrap println thats a badass macro
19:43gfredericksjayunit100: it works in all the functions you call too, not just the lexical context
19:43jayunit100as in ?
19:44gfredericks(defn print-stuff [] (print "Stuff")) (with-out-str (print-stuff))
19:45jayunit100@gfredericks hmmm. i wonder how it does that. laziness?
19:45wingyis the choice between aleph and noir for a web server?
19:45jayunit100oh ok i see, yeah, since with-out-str is seen first, it sets the macro then.
19:45gfredericksjayunit100: it's dynamically binding *out*
19:46gfredericks(print "Stuff") prints to *out*, so you just change the value of *out* before calling print-stuff
19:46jayunit100thanks ! this is cool s**t
19:46jayunit100ok…. so i have this lib I'm using : [org.clojure/data.json "0.1.2"]
19:46gfrederickscool soot
19:47jayunit100is there a way at the repl to browse all of its available functions/ns ?
19:47gfredericksyeah; it's not _too_ user-friendly
19:47brehautwingy: noir isnt a web server.
19:47gfredericksbut (ns-publics foo.bar) will give you the public vars for a ns
19:47brehautwingy: its built on ring which is server agnostic
19:47gfredericksyou can use clojure.repl/doc to see their documentations
19:48brehautwingy: you can use jetty, anything that supports servlets, mongrel2, or pretty much anything that you either find or write an adapter for
19:49brehautwingy: 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:49gfredericksbrehaut: you can run an http server with aleph
19:49technomancybrehaut: wasn't there, like, some article about that?
19:49brehautgfredericks: does it implement http itself though?
19:49clojurebotGabh mo leithscéal?
19:49brehauttechnomancy: about aleph?
19:50jayunit100(ns-publics 'org.clojure) doesn't work :(
19:50gfredericksbrehaut: well if you're going to be that pedantic I doubt you're helping the OP
19:50technomancybrehaut: I mean about the different web libraries for clojure
19:50brehautgfredericks: i bet you lie to your kids about santa too
19:50technomancyand how they are related
19:50gfredericksjayunit100: org.clojure isn't a namespace; try (ns-publics 'clojure.data.json)
19:50brehauttechnomancy: aha, i am apparently slow
19:51wingyso its between aleph which is using netty and noir/jetty(/netty?)
19:51brehautwingy: http://brehaut.net/blog/2011/ring_introduction
19:51gfrederickswingy: compojure below noir
19:51jayunit100hmm that failed to … (ns-publics 'clojure.data.json)
19:51gfredericksjayunit100: have you required it yet?
19:52jayunit100yeah its a deps issue, my bad. odd though.
19:52gfredericksbrehaut: what is this "santa"? some kiwi thing?
19:53brehautgfredericks: i dunno, do you have cocacola in the US?
19:53gfrederickswhat kind of fruit is that?
19:55jayunit100gfredericks: how did you "know" that [org.clojure/data.json "0.1.2"] ----> clojure.data.json
19:55brehautgfredericks: in that case, santa is a big fat bearded guy who frequently wears winter weather clothes to the beach. go figure
19:55jayunit100i 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:56gfredericksjayunit100: 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:56jayunit100ah ok. so there is no 1-1 mapping between lib name and ns.
19:56jayunit100makes sense
19:56gfredericksnope; there are various conventions but just as in java/maven, nothing is enforced/required
19:57gfredericksbrehaut: you people have the strangest traditions
19:57wingyi think people would die for clojure the lang
19:58wingybut no one for js
19:58dnolenwingy: you haven't been to any JS conferences I see :)
19:58wingyhow can they die for an ugly mf?
19:59wingyits hell ugly!! its like .. i wanna beat it
19:59gfredericksnobody thinks that way about lisp
19:59wingygfredericks: irony?
19:59gfredericksa smidge
20:00dnolenwingy: I have no hatred of JS, but I find the direction the JS community at large seesm to be going ... strange.
20:00wingydnolen: strange how?
20:00gfredericksdnolen: JS everywhere? or something else?
20:02technomancylike how they're forgetting the one advantage it have over other languages is that it's the most widely deployed runtime?
20:02technomancy*has
20:02gfrederickstechnomancy: they are forgetting that?
20:02SrPxTrying 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:03technomancygfredericks: how else do you explain node?
20:03gfredericksSrPx: looks likely
20:03SrPxits hard : S
20:03gfrederickstechnomancy: so your corollary is that JS has no other advantage and therefore they shouldn't seek to deploy it any further?
20:04gfredericksotherwise I don't follow
20:04gfredericksSrPx: is it always pairs? always two of them?
20:05gfredericksif you didn't have the angle brackets there it wouldn't even require a macro
20:06gfredericksaw man cljs doesn't have future?
20:06gfredericksI need to (js/setTimeout)?
20:07SrPxgfredericks: no, it's always a list
20:07dnolengfredericks: JS is the probably ultimate Computer Science pop phenomenon.
20:07SrPxgfredericks: it could be a varaible pointing to a list
20:07SrPxgfredericks: always the same size though
20:07nDuffdnolen: ultimate? That seems awfully optimistic.
20:07amalloydnolen: 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:07dnolenamalloy: wow! great!
20:07SrPxwait who said cljs doesn't have a future?
20:08technomancyI read a blog post a while back about how someone was ditching Rails for Node "because the party's better over there"
20:08gfredericksSrPx: do you mean the angle brackets to literally be in the code, or were you signifying something else?
20:08dnolennDuff: optimistic - I didn't mean that as flattery :)
20:08metellusSrPx: map basically does what you want, depending on the angle brackets
20:08gfredericksSrPx: ha
20:08metellus,(map + [1 2] [6 10])
20:08SrPxgfredericks: they could be, not necessary, could be somethign like (bend (node [a b]) (node [c d])) or anything that works
20:08clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")>
20:09metellus&(map + [1 2] [6 10])
20:09lazybot⇒ (7 12)
20:09SrPxõo
20:09SrPxwhaa..
20:09gfredericksSrPx: I think I'd need a list of examples or something
20:09SrPxgfredericks: okay
20:10gfredericksSrPx: are you sure you need a macro?
20:10SrPxnot sure anymore
20:10jayunit100hmm this is an odd one : No matching field found: replaceAll for class java.lang.String
20:10SrPxtrying to understand what metellus did o.o
20:10nDuffdnolen: ...I expect there to be more and even worse pop phenomena in the future, but maybe that's my inner pessimist speaking. :)
20:10SrPx,(map print [a b] [c d])
20:10clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")>
20:10gfredericksjayunit100: check the args you're giving it
20:10SrPxsad that I don't know many functions yet
20:10SrPxso its hard to play w/ the lang
20:10SrPx: S
20:10metellusSrPx: look at examples from http://clojuredocs.org/clojure_core/clojure.core/map
20:10gfredericksSrPx: if that's the case then you almost certainly shouldn't be writing macros
20:11jayunit100yup but the error message itself : clearly, its an incorrect error message.
20:11amalloyjayunit100: no it's not
20:11amalloy&(.replaceAll "x")
20:11lazybotjava.lang.IllegalArgumentException: No matching field found: replaceAll for class java.lang.String
20:11amalloy&(.replaceAll "x" "x" "y")
20:11lazybot⇒ "y"
20:12jayunit100ah b/c its referring to the reflection looking for a 1 arg version of replaceAll, which doesn't exist.
20:12gfredericksyeah, it's matching on more than just the name
20:12amalloywell, it's actually looking for *either* a field or a no-arg method
20:12amalloyand decides to report that it couldn't find the field
20:12dnolennDuff: 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:12jayunit100if thats the case it should report the arg signature it tried to match also , yes?
20:12wingybrehaut: nice article .. will be a good read after my book
20:13brehautno problem
20:15xumingmingvfor type hint, how do I specify a 'array' hint? e.g. URL[]
20:16amalloy^"[Ljava.net.URL;" iirc
20:19amalloyprobably 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:20xumingmingvamalloy: thanks!
20:37shawnlewisis there something in core to check if a map is a subset of another map?
20:39gfredericks,((fn [m1 m2] (apply = (map (juxt m1 m2) (keys m1)))) {:foo 2 :bar 6} {:bar 6 :bam 23 :foo 2})
20:39clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")>
20:39gfredericks&((fn [m1 m2] (apply = (map (juxt m1 m2) (keys m1)))) {:foo 2 :bar 6} {:bar 6 :bam 23 :foo 2})
20:39lazybot⇒ false
20:39gfredericksclojurebot: go away
20:39clojurebotPardon?
20:39gfredericks&((fn [m1 m2] (every? (partial apply =) (map (juxt m1 m2) (keys m1)))) {:foo 2 :bar 6} {:bar 6 :bam 23 :foo 2})
20:39lazybot⇒ true
20:40brehaut,(let [a {:a 1 :b 2 :c 3} b {:a 1 :c 3}] (= (select-keys a (keys b)) b))
20:40clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")>
20:40brehaut&(let [a {:a 1 :b 2 :c 3} b {:a 1 :c 3}] (= (select-keys a (keys b)) b))
20:40lazybot⇒ true
20:40gfredericksbrehaut: mine's lazier
20:40hiredmanclojurebot's eval is closed until further notice
20:40brehautgfredericks: and juxtier :(
20:40gfrederickshiredman: intentionall?
20:41gfredericksy
20:41hiredmanyes
20:41gfredericksthat will be noisy
20:41gfrederickshe should forward to lazybot :)
20:41shawnlewisgfredericks, brehaut: thanks!
20:41hiredmanhopefully further notice won't be that long
20:43wingyhow can this be 2: (#(- %1 (apply + %&)) 10 8)
20:43wingyisn't it the same as: (- 10 18)
20:43gfrederickslooks like the same as (- 10 (apply + [10 18]))
20:43wingyoh its (- 10 8)
20:43brehaut&'(#(- %1 (apply + %&)) 10 8)
20:43lazybot⇒ ((fn* [p1__8501# & rest__8502#] (- p1__8501# (apply + rest__8502#))) 10 8)
20:44gfrederickswat
20:44xeqihmm, has lazybot always printed anon functions like that?
20:44brehautthats what it expands to (apply + 8) ; => 8, (- 10 8) ;=> 2
20:44gfredericksxeqi: he quoted it
20:44xeqiah
20:44brehautjust getting rid of the anon reader sugar
20:44gfredericksxeqi: quoting is a great way to see what reader macros do
20:45gfredericks&'#'foo
20:45lazybot⇒ (var foo)
20:45xeqi&'#=3
20:45lazybotjava.lang.IllegalStateException: clojure.lang.LispReader$ReaderException: EvalReader not allowed when *read-eval* is false.
20:45brehautits also a great way to look lke you are swearing at vars
20:45gfredericksbrehaut: I don't mind that because likely I am swearing at vars
20:56amalloydnolen: 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:00wingyim reading up a bit on JVM and CLR .. is there any benefits on using https://github.com/clojure/clojure-clr
21:00wingyi guess the jvm one is more mainstream?
21:01wingyfor .NET interop mainly right?
21:05dnolenamalloy: something is needed here ... but I haven't put much thought into it, open to ideas.
21:10gfredericks(map-valueo m k v)
21:11gfrederickscould be a primitive?
21:11gfredericksI assume that would take a lot of backend work though
21:12dnolenamalloy: if you had some syntax in mind that could at least get the conversation started.
21:13xumingmingvanyone recommend an easy to use java de-compiler? jd-gui's official website is broken...
21:13xumingmingv(on mac)
21:14amalloydnolen: i think gfredericks's suggestion is plausible. or (==m thing1 {:a x}) ;; unifies (:a thing1) with x
21:15amalloyi have to go, though, so i can't defend my silly suggestions tonight
21:15dnolenamalloy: will think about it, I've pondering better map support so it's something I'd like to see.
21:15amalloythanks!
21:15dnolenpondered better map support before I mean.
22:10hiredman,(println "further notice")
22:10clojurebotfurther notice
22:10gfredericks(inc hiredman)
22:10lazybot⇒ 10
22:11hiredmanmade some changes to the sandbox
22:11gfrederickshiredman: would it be easy to support eval?
22:11gfredericks,(eval '(+ 1 2))
22:11clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
22:11gfrederickshiredman: via recursion?
22:12wmealingis there a web based .. repl where you can mess with the dom live ?
22:13gfredericksfor clojurescript? himera or browser-repl depending on what you mean
22:13hiredmangfredericks: in theory I could just let eval through
22:13steveo_is there a limit on the number of items in a vector?
22:13steveo_i'm accumulating stuff in one
22:13gfrederickshiredman: oh it's all java-based security?
22:13gfrederickssteveo_: not practically
22:13TimMcgfredericks: You can already use eval.
22:13hiredmangfredericks: there is some clojure based stuff, but it not very good
22:14hiredmansteveo_: yes
22:14steveo_this might not be practical
22:14gfredericksTimMc: how so?
22:14TimMc,(let [evil (resolve (symbol "eval"))] (evil '(+ 1 2)))
22:14clojurebot3
22:14hiredmansteveo_: depending on what you mean by a limit
22:14hiredmanthere is a limit to the size of a vector literal you can use
22:14steveo_well I'm getting problems at like 3kish
22:14gfrederickshiredman: because of java class size limits?
22:15steveo_is there a better data structure for accumulating a ton of items?
22:15TimMcgfredericks: ^ The usual.
22:15gfredericksTimMc: that is unexpected
22:15gfrederickssteveo_: you're doing this at runtime, right?
22:15steveo_yeah
22:15gfredericksand how are you adding items?
22:15steveo_conj
22:16gfredericks,(time (vec (range 10000)))
22:16clojurebot"Elapsed time: 45.217663 msecs"
22:16clojurebot[0 1 2 3 4 ...]
22:16gfrederickssteveo_: what sort of problems?
22:17TimMcOh dear.
22:17TimMcWhat happened recently to make clojurebot so crashy?
22:17steveo_well I was keeping track of it by checking the count, and the count stopped going up
22:17steveo_at 3035
22:18gfrederickssteveo_: 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:18steveo_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:19steveo_ok, I have an atom with a vector it in, i'm logging stuff to the atom with (swap! my-atom conj "newthing")
22:19steveo_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:20steveo_but (count @my-atom) stopped going up at 3035
22:20gfredericks,(let [v (atom [])] (dotimes [n 100000] (swap! v conj n)) (apply max (shuffle @v)))
22:20clojurebot99999
22:20wingyi kinda see this documentation layout for many projects http://weavejester.github.com/hiccup/
22:20wingywhat are they using to generate it?
22:22weavejesterwingy: https://github.com/weavejester/codox
22:22gfrederickssteveo_: so the watcher logs for you? and it keeps printing 3035 repeatedly?
22:22steveo_no I was checking it myself to see what was going on
22:22steveo_i'll have the watcher log it and see what happens
22:23gfrederickssteveo_: without knowing anything else, it sounds much more plausible the atom isn't being swapped anymore for some reason
22:23achengclojure.test question: can i execute a single specific test at the repl? or must it always be by entire namespace?
22:24wingyweavejester: cool
22:25wmealinggfredericks, i'll look into that. .thanks
22:25steveo_gfredericks: yeah it looks like it, I just had the watcher log it and it just stopped at 2990
22:25steveo_is it possible to overload an atom?
22:26gfrederickslike update it too many times? no
22:26gfredericksmaybe you should look at whatever process is doing the swapping
22:26gfredericksit doesn't sound likely that vectors or atoms are your issue
22:27steveo_yeah I guess not
22:27steveo_alright, i'll keep digging, thanks
22:27achenghmm. 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:27meliponefor some reason my irc at work is screwed up. How can I ask questions about clojure on twitter?
22:28achengmelipone: can you ssh to somewhere else and then irc from there?
22:28jayunit100hmmm not sure if this is a clojure issue or not :
22:28meliponehmmm... I don't think so
22:28jayunit100(.replaceAll (json/json-str (rts/word-enrichment-url url)) "," ",\r\n"))
22:29jayunit100should that render as a line break in normal browsers ^^ ?
22:29gfredericksacheng: leiningen test-selectors might help some
22:29achengmelipone: my employer blocks the irc ports so i ssh to freeshell
22:29achengfreeshell = sdf public access unix system
22:29meliponeacheng: okay, I didn't know about freeshell
22:29technomancyacheng: clojure-test-mode has a way to run fixtures with a single test
22:29achengat sdf.org
22:29technomancybit of a hack
22:29gfredericksjayunit100: unless you're in a <pre>, I think you need a real <br /> to get a line break
22:30jayunit100arg… what if its plain text ?
22:30jayunit100I'm wondering how Facebook does it : https://graph.facebook.com/me/home?access_token=AAAAAAITEghMBALaSPAVOj2ugYhHtMP2TPg8IexZA2KPtuHQJZAR9muMHZAPETKc0DLFIakfUWblNtV5djHxDIhEKdETzYNpuhdj8JB1xa6M86h2u3gS
22:32jayunit100fyi I'm in composure , trying to stream plaintext
22:32gfredericksjayunit100: oh that's the browser rendering plain text. that should work fine I would think. what is it doing?
22:32jayunit100the link above (Facebook) renders plaintext just fine.
22:33jayunit100but i don't know how to get composure to output plain text
22:33xeqijayunit100: I get content-type "text/javascript" in the response headers
22:33xeqifor that page
22:35acheng(thanks technomancy gfredericks)
22:38jayunit100(GET "/text" [{:headers {"Content-Type" "text/plain"}} "This is plain text." "And some more text."]) <-- key must be integer exception.
22:39wingyisn't recur introducing imperative style?
22:39wingyloop/recur reminds me about for in loop
22:40gfredericksit's a little more functional than that
22:40gfredericksbut 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:41gfredericksI think it might perform well and so gets used when that's important
22:42xeqijayunit100: try (GET "/text" _ {:status 200 :headers {"Content-Type" "text/plain"} :body "this is plain text.\nAnd some more text"})
22:42jayunit100hmm ok y?
22:43gfrederickswingy: 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:43jayunit100xeqi !!!! works !
22:44xeqithere are probably nicer ways to build that ring response, using ring.util.response
22:54jayunit100whats the diff btwn :require vs require ?
22:55gfredericksrequire is a function you can call
22:55gfredericks:require is some syntax that the ns macro supports
22:55gfredericksso it only works there
22:55gfrederickswith :require you don't quote symbols, but with the function you have to
22:56jayunit100ah ok
22:57jayunit100gfredericks: my herok
22:57jayunit100s/herok/hero
22:57gfredericksno I prefer herok please
22:57jayunit100s/herok/heroku :)
22:57gfredericksI'm somewhere in between the two
22:58wingyim confused .. (def x 5) .. here x is a var or a symbol?
22:58gfredericksI think I killed brehaut
22:58gfrederickswingy: yes and no
22:58gfrederickssyntactically x is a symbol. but what def is doing is creating a var named x
22:58gfredericksso wherever else you use the symbol x in that namespace it should refer to that var
23:00gfredericksdangit the vars/symbols talk from clojurewest isn't video'd yet :(
23:00RaynesI should try doing the whole video editing thing one day.
23:01RaynesI completely do not understand why it takes so long for conference videos to surface.
23:01gfredericksRaynes: they don't hold them back to incentivize attendence?
23:01nickmbailey^ that
23:01RaynesI guess that's a possibility.
23:02wingyhow many people attended you think?
23:02RaynesA lot.
23:02gfredericksseven or a thousand
23:02wingycool
23:02xeqiI was told clojure/west was around 300, which sounds about the same as the conj last year
23:03wingygfredericks: you mean def is creating a var which has a symbol x .. you name a var by putting a symbol ("tag") on it
23:05gfrederickswingy: 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:05jayunit100,(map? clojure.lang.PersistentHashMap)
23:05clojurebotfalse
23:05gfredericksalso it's maybe 7 times more complicated than that
23:05gfredericksjayunit100: that's a class
23:05xeqi,(class clojure.lang.PersistentHashMap)
23:05clojurebotjava.lang.Class
23:05jayunit100oops bad example
23:06jayunit100I can't create one b/c its constructor is messed up :)
23:06wingygfredericks: can a var have multiple symbols associated to it?
23:06xeqi,(class {})
23:06clojurebotclojure.lang.PersistentArrayMap
23:06jayunit100,(map? {})
23:06clojurebottrue
23:06wingygfredericks: im thinking like unix fs .. you have pointers to the actual file
23:06gfrederickswingy: 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:07wingysymbols remind me about the pointers
23:07jayunit100ah 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:07aperiodicgfredericks, wingy: http://clojure.org/evaluation
23:07gfrederickswingy: symbols don't inherently point to anything, it is only in the context of a namespace when being compiled
23:07gfredericksoh resolved is a good word
23:07gfredericksI forgot that one
23:07wingyi see
23:51michaelr`good morning
23:51TimMcg'night
23:52michaelr`:)
23:52michaelr`actually i'd rather go to sleep than start a work day