#clojure logs

2012-08-23

00:00akhudekI'm no expert on it, but from what I understand, the default generate handler accepted any form input parameter when doing updates.
00:01davejacobsthat wasn't a problem with the routes though, it was a problem with which attributes were assignable to a model based on query parameters
00:01akhudekah, ok
00:04davejacobsall right, thanks for the advice guys. i'm gonna see if i can hack away at this
00:04michaelr`good morning clojourianz!
00:06eggsbyhi michaelr`
00:10holoi have "web: lein2 with-profile $APP_ENV run" in Procfile, but logs in heroku show `lein with-profile prod run`. isn't that weird to be running a different command?
00:10holohi
00:12holooh, i got it, probably it's guessing since it can't find "lein2"
00:43emezeskeApparently people named Daniel like to contribute to lein-cljsbuild
00:43emezeskeOf the 12 contributors, 4 of them are Daniels
00:44mkperhaps it's easy for them to see themselves contributing
00:44emezeske"All the other Daniels are doing it, I should too"
00:51gtuckerkelloggi want to switch to nrepl, but even though an nrepl server starts, C-x C-e doesn't seem to evaluate
01:05gtuckerkelloggI'm trying to get the latest nrepl, nrepl.el, and lein working together
01:05gtuckerkelloggif I evaluate something like (println "hello") i get nothing in the *nrepl* buffer
01:06gtuckerkelloggbut if I evaluate (def foo 1), the var is defined properly
01:14gtuckerkelloggcemerick?
01:14clojurebotcemerick: Yeah, MacKay's book is great too.
01:14gtuckerkelloggheh
01:14emezesketechnomancy: ping
01:15cemerickgtuckerkellogg: I'm smoked, going to bed. If you're still stuck tomorrow, ping me…although I know nearly nothing about nrepl.el FWIW. :-)
01:16gtuckerkelloggok, thanks
01:16gtuckerkelloggmaybe technomancy never sleeps
01:20gtuckerkelloggahh, found the answer in the google group for nrepl.el
01:21brehautgtuckerkellogg: for those of us who have not RTFM, what was it?
01:22gtuckerkelloggwell, only the existence of the google group for nrepl.el is noted on the github site :)
01:22gtuckerkelloggbut in that group, there is an animated discussion in the last day of the same behavior I observed
01:22gtuckerkelloggand the answer is that nrepl.el *swallows* output from nrepl evaluations in the buffer
01:23gtuckerkelloggwhich seems to most people (including me) like the wrong thing to do
01:23gtuckerkelloggand is inconsistent with the default behavior of slime
01:40muhooit has
01:40rbxbxjsabeaudry and fwiw they're serving JSON, which while originally JavaScript Object Notation the agreed upon API doesn't necessarily have anything to do with JavaScript these days.
01:41rbxbxblah. clumsily worded words but you get my general point.
01:56muhoogtuckerkellogg: did you get nrepl.el squared away?
01:58gtuckerkelloggmuhoo, i found out that it does something surprising: it swallows the ouput from any evaluation in the buffer
01:58gtuckerkelloggso if I have (println "hello world") and C-x C-e eval, the *nrepl* buffer shows nothing
01:58gtuckerkelloggthis is very different from slime, of course
01:59gtuckerkelloggand not so useful when developing code that actually uses stdout or stderr
02:00gtuckerkelloggI submitted an issue on github to have it changed. From the google groups discussion, most people seem to agree
02:06muhooyes
02:07muhoois it nrepl that is swallowing stdout?
02:07muhooor nrepl.el?
02:08muhoogtuckerkellogg: wait, i just tried (println "fubar") in nrepl.el, and it worked
02:08muhoonREPL 0.1.4-preview
02:09gtuckerkelloggmuhoo, were you using nrepl-jack-in?
02:10muhoono
02:10gtuckerkelloggthat's where it happens
02:10muhooi'm running "lein trampoline repl :headless", and then connecting via the network
02:10gtuckerkellogghmmm
02:11muhoousing lein 2.0 master though
02:11gtuckerkelloggi'm just running nrepl-jac-in-from emacs
02:11gtuckerkelloggnrepl-jack-in, that is
02:11muhoomaybe try "lein repl :headless" (no trampoline), and then in emacs "M-x nrepl"
02:11gtuckerkelloggIt's documented in the group discussion here: https://groups.google.com/forum/#!topic/nrepl-el/3GDsRkX1IDE
02:13gtuckerkelloggthat still doesn't capture the output
02:13gtuckerkelloggmaybe you are using an earlier version of nrepl.el
02:13gtuckerkellogghe mentioned he had it sent to the *nrepl* buffer at one point, but changed it
02:14muhooi'm on the latest git master of nrepl as of like yesterday
02:14gtuckerkelloggoh, let me be clear: it captures if the (println "foo") is done in the *nrepl* buffer itself!
02:14muhoonrepl.el, i mean
02:14gtuckerkelloggbut if I C-x C-e in another buffer that's connected to the nrepl, it doesn't capture it
02:15muhooi did this: https://www.refheap.com/paste/4571
02:15muhoowhich was what i'd expect
02:15muhoooh, i don't C-x C-e, that'd explain that
02:16gtuckerkelloggFrom Tim himself in the google group discusison: "Presently nrepl.el swallows stdout output from evaluations in a clojure buffer. "
02:16muhoooh. well, that sucks.
02:16gtuckerkelloggi agree
02:16gtuckerkellogghe's open to changing it, though, so I submitted an issue on github
02:16muhooi saw a commit that pops up for stdin
02:17muhooi found nrepl.el super easy to hack on.
02:17gtuckerkelloggmuhoo, doing what you did in the refheap works fine for me.
02:17gtuckerkelloggit's in the *nrepl* buffer itself
02:17muhoook, good, that makes sense.
02:17gtuckerkelloggit's evaluating and sending to the nrepl buffer that swallows the output of evaluation
02:18gtuckerkelloggwhich still make sense, but it's the wrong thing to do :)
02:18muhoogtuckerkellogg: fire up yer elisp chops and fix it :-)
02:18gtuckerkelloggi'm confident tim is faster than me :)
02:18gtuckerkelloggbut I might head down that road
02:19muhooi'd recommend it. it's surprisinngly fun to be able to actually understand and modiffy a block of elisp
02:19gtuckerkelloggyes
02:19gtuckerkelloggi contributed the most minor little thing to org2blog once, and I was so f'ing proud of myself :)
02:20muhoothe nice thing about nrepl.el is it was written by clojure hackers, so it's simple and readable.
02:20gtuckerkelloggheh
03:11ro_stif i want to use my own lein project as a dependency in another lein project, does it have to exist as a jar somewhere for me to be able to use it in checkouts?
03:12ro_sti have it symlinked in checkouts but lein deps is failing when trying to resolve a jar
03:13jasonjcknro_st: shouldn't need to make jar, just the symlink should be sufficient
03:13jasonjckntry #leiningen
03:13xeqiro_st: yes; lein needs to be able to run without checkouts
03:13ro_stok. i did a lein install from the subproject
03:14ro_stdoes my checkout folder structure have to match the project name, eg, for (defproject orgname/projectname …), do i need checkouts/orgname/projectname ?
03:14xeqiI don't think so
03:15jasonjckncheckouts/sym-link
03:15jasonjcknyou can name it anything afaik
03:16ro_stexcellent, thanks guys. testing
03:17ro_stdoing the whole refactor model code out to a common project thing
03:17xeqiro_st: the thing to watch out for with checkouts is if you change the dependencies
03:18xeqithen you need to do a lein install again
03:18ro_stchange the deps in the subproject itself?
03:18ro_stthat makes sense
03:18ro_sti vaguely recall something about cloudbees being the way to privately host jars for use with lein/maven?
03:19ro_stcos i know jenkins is going to need some sane way to do all this
03:19xeqithere are a few ways
03:20xeqihttps://github.com/technomancy/s3-wagon-private
03:20xeqior running http://www.sonatype.org/nexus/
03:20ro_stawesome, thanks xeqi!
03:20xeqithere are other servers, but thats the common one
03:22ro_stwe have a java veteran joining us in september. i think i'll let him figure this part out :-)
03:25magopianwhat would be the simplest, most idiomatic way to count the number of occurences of an element in a sequence?
03:26magopiani can see two solutions already: partition-by identity (and grab the key of the "occurence value")
03:26magopianor count the filtered seq
03:27xeqi(doc frequencies)
03:27clojurebot"([coll]); Returns a map from distinct items in coll to the number of times they appear."
03:28magopianmmm, that would give something roughly around the same as partition-by identity i guess
03:28magopianthanks xeqi
03:29magopianit's not "partition-by" that i meant, but "group-by" obviously ;)
03:29magopianbut frequencies looks much better, thanks a lot xeqi ;)
03:36ro_stanyone using checkouts and cljsbuild's crossovers? :-(
03:36ro_stoh, :extra-classpath-dirs worked -phew-
03:38samrathow do I convert a string into a stream, so that I can use it with clojure.data.codec.base64?
03:39ro_stsamrat: https://github.com/mmcgrana/ring/blob/master/ring-core/src/ring/util/io.clj#L26
03:44samratro_st: apparently, base64 doesn't work with java.io.ByteArrayInputStream
03:44samratbtw, what is ^String?
03:45ro_sta type annotation so that the runtime doesn't have to use reflection to determine on what type to dispatch
03:46samratro_st: ah, okay. but any idea how to convert a string to base64?
03:47ro_sthttps://github.com/remvee/clj-base64
03:47ro_sti used this fantastic web app where you type what you're looking for and it gives you links to other webpages with answers
03:47ro_styou might have heard of it -grin-
03:48samratro_st: i was suggested clojure.codec and I kinda got lost in trying to make it work
03:49ro_stto be honest, i have no idea. never had to do it. can't think that you're the first
03:49samratthanks, anyway. I'll check out clj-base64
03:50ro_stgood luck. let us know what you find!
03:51ejacksonro_st: LMGTFY !
03:52ro_styup. was too lazy to actually use it -grin-
03:53djcoin:D
03:53djcoin"fantastic web app"
03:54hyPiRion$search Clojure base64
03:54lpetitHello there
03:54hyPiRionaight, it's not enabled.
03:56djcoinHelloO
03:57ejacksonbonjour Frenchie !
04:12lpetitejackson: hello, CCW refugee :-p
04:25magopianman, i'm proud of my solution to 4clojure's problem 94 (game of life), not using indexes of any kind ;)
04:26magopiantook me ages to come up with though, and my brain hurts now
04:26clgvlpetit: I saw you being active on the issues. next beta release today?
04:27clgvlpetit: good morning,btw ;)
04:27lpetitclgv: after the holidays, my plate is quite full, so I'm not sure
04:27lpetitgood morning :)
04:27lpetitclgv: are there some outstanding things you're waiting for ?
04:28clgvlpetit: not really. just wanted to interpret the activity ;)
04:28lpetitclgv: yeah, the activity means I'm back :)
04:28clgvlpetit: ah wel the leiningen/hooks problem annoys me a bit ;)
04:28lpetitclgv: will give it a try
04:28miaoskiHi.
04:28lpetitnot no, but in a few hours
04:28lpetitmiaoski: hi
04:29clgvlpetit: I wish I could tell CCW to just ignore it, since CCW doesnt build my uberjars anyway ;)
04:30clgvlpetit: but can't do it with profiles since lein2-preview8 had also a bug regardin hooks and profiles...
04:30lpetitclgv: are the bugs in preview8 corrected and released ?
04:30lpetitit's becoming annoying, this moving target :)
04:31clgvlpetit: dont remmeber the changelog. btw: does CCW's leiningen plugin already support using leiningen's local installation?
04:31lpetitclgv: what do you mean ?
04:32clgvlpetit: I remember that there was a thought to not only package leiningen as lib dependency for CCW but use what is installed on the system
04:33lpetitclgv: well, no, leiningen-core is currently still packaged. May not change soon.
04:37clgvlpetit: ok, just wanted to know. someone ask during the last days...
04:37clgv*assked
04:37clgv*asked
04:38tomojmagopian: you mean you don't use vector get with and index?
04:38tomojs/and/an/
04:38clgvlpetiti: what is your current development focus: CCW features or support for more leiningen features?
04:43lpetitclgv: leiningen = bug correction + slight improvements of the existing features (better error reporting, missing import wizard, etc.). And the bunch of work on the editor: adding what is missing (right now: better code completion support, and then better auto-indenting, selection indentation, file indentation). Also, Chas has been working on improving nrepl recently, so I'll have to integrate the changes. Only then will I do a second ro
04:43lpetiton leiningen: I'll have to figure a way to allow people to allow people to discover and launch tasks from within CCW (goal: they should not have a distinct local installation of leiningen2 except for exceptional occasions/situations)
04:43lpetitclgv: ah, for leinigen, a specific feature might be developed first as an exception: correct handling of :repl / :nrepl properties of project.clj, so that they are used instead of the current mechanism (if found)
04:48lpetitLOL: working extensively from live interaction with the REPL, I fix & test a bug without even having (still) saved the file, and then I'm really surprised to not be able to stage the changes via git guy :)
04:52clgvlpetit: ok. interesting. with regard to repl the :injections attribute is interesting e.g. to automaticall require/use certain namespaces by default when starting a repl
04:53lpetitclgv: yeah, :injections too
04:53lpetitclgv: it's just the equivalent of the -e flag of clojure.main, right?
04:53clgvI have some debugging stuff that I would like to be injected in every repl via the :dev profile
04:53clgvlpetit: uh, I never checked it's implementation
04:54lpetitok, I'll check later, no rush
04:54clgvlpetit: from the comments in the sample.project.clj, I would guess that it might be actually implemented in eval-in-project
04:55lpetitclgv: hmm, okay
04:55clgvlpetit: but if you would let leiningen start up the nrepl server you should have that automatically. I dont know if thats an option...
04:56lpetitclgv: right
04:56lpetitclgv: are you using the beta version?
04:56lpetitof ccw
04:56clgvnot here at work
04:56lpetitand @ home
04:56lpetit?
04:56clgvI have an old one @home
04:57lpetitokay
04:57clgvgotta update it ^^
04:57lpetitsure, the last I pushed just before going into holidays is a winner, really :)
04:57lpetitcemerick said he can't live without it :)
04:57clgvbecause of better autocompletion?
04:58lpetitclgv: yes.
04:58clgvuh, gotta try it
04:59lpetitclgv: AFAIK, nobody went back from the beta to the stable while in holidays (~3 weeks)
05:00ejacksonautocompletion !
05:03lpetitejackson: autocompletion, yea. I used clojure-complete as a basis, and tweaked it quite a bit: decomplecting (ha! the new buzz word !) it (separating rendering from filtering from sorting). And I implemented CCW specific sorting / filtering functions, trying to do something close to what TextMate / SublimeText offer (match letters in sequence, but anywhere inside a matching completion candidate)
05:03lpetitejackson: also, does not only offer suggestions based on the dynamic repl context, but from symbols / keywords found in the editor, as well.
05:04lpetitejackson: symbols / files : if you try to complete a symbol, it will also suggest symbols based on keywords (e.g. you have the keyword :dependencies, if you type dep then dependencies will be suggested)
05:05ejacksonlpetit: brilliant !!
05:05lpetitejackson, clgv: and it does keyword completion based on the keywords found in the file
05:05lpetitso yeah, this beta has a lot of potential in it
05:05nkkarthiklpetit: since we are at it... may I know what you guys think of https://github.com/ninjudd/clojure-complete/issues/12
05:07clgvlpetit: sounds like a definite update this evening ;)
05:08clgvnkkarthik: sounds good
05:08ejacksoni'm gonna develop in CCW today. Retraining my emacs-fingers is hard :)
05:10lpetitnkkarthik: the interop story (completing class names, etc.), is still a WIP in CCw. Once done, completion for classes should work like this (compare with the examples you provided): type "Fra" and you'll get "javax.swing.JFrame" (notice I did as a newby users not knowing I must prepend a J in front of Frame). No need for wildcards.
05:10nkkarthikclgv: cool, thanks :) I am not sure if others need it... I kinda found it easy for my stuff
05:12lpetitnkkarthik: I'll give you an honest answer: having the ability to type "Win*Ad" for "WindowAdapter" does not appeal to me. The wildcard is powerful, but it's a double edged sword. And it's still one character more than "WinAd" (granted, "WinAd" will return more noise than "Win*Ad" in theory, and probably still a little in practice)
05:13michaelr`humhum
05:13magopiantomoj: nope ;) i partition the board in 3x3 cells, and count the neighbours ;)
05:14nkkarthik,ccw
05:14clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ccw in this context, compiling:(NO_SOURCE_PATH:0)>
05:14ejacksonlepetit: how do I get the beta ? 0.9.0-STABLE is all I see in the "Add new software" thingie
05:14michaelr`i wonder whether has anyone built a generic admin interface in clojure, for editing database tables etc?
05:14lpetitejackson: maybe by reading the emails I send to you more carefully ? :-p
05:15lpetitejackson: http://ccw.cgrand.net/updatesite-betas/ . Different "channel"
05:15ejacksonaha !
05:15ejacksonmore carefulness needed :P
05:16nkkarthiklpetit: yeah I totally agree... just WinAd is more easy than Win*Ad
05:16mindbender1when doing nrepl-jack-in in emacs, nrepl-init-repl-buffer is called with nil and an error is thrown, any one had this experience? Here is a gist: https://gist.github.com/3434519
05:16nkkarthiklpetit: I do have to agree I did just a 15 min hack there
05:17mindbender1I'm on emacs-snapshot
05:18alfborgeI'm usinc http.async.client to get a web page. The page does not specify encoding, so the *default-encoding* is used. This is a ^dynamic ^private var. Is there a way for me to override this?
05:18brunchpoemsmindbender1: maybe your profiles.clj is wrong?
05:19brunchpoems(I'm not really sure what I'm talking about, but I had a problem earlier that was caused by that)
05:19mindbender1brunchpoems: do you mean if it's based on lein1?
05:19brunchpoemsno, nrepl requires lein 2.x I believe
05:19mindbender1my project is lein2
05:19alfborgeNevermind, got it.
05:19brunchpoemsoh, nevermind, ignore me sorry
05:20brunchpoemsI didn't have to add anything to profiles.clj to get nrepl to work, :/
05:20nkkarthiklpetit: so ccw will be merged to clojure-complete or the other way?
05:21mindbender1brunchpoems: what specifically did you do to get it to work it just might work for me too
05:21brunchpoemsmindbender1: I was actually confused between two different problems I had earlier today, the profiles.clj thing was for swank-clojure :(
05:21brunchpoemsnrepl worked out of the box for me after I installed it through the emacs package manager
05:21lpetitnkkarthik: ccw has currently a forked version of clojure-complete. When things stabilize, I'll work with clojure-complete maintainers to find opportunities to reinject generic parts of the ccw port into clojure-complete
05:22nkkarthiklpetit: I mean will I be able to use ccw without eclipse?... sorry haven't looked at it... will look at it this weekend
05:22mindbender1brunchpoems: ok np.. thanks for caring anyway
05:22brunchpoemsmindbender1: no problem, I'll do some googling to see if I can see anything related to your error message
05:22mindbender1brunchpoems: thanks.. I'd appreciate any kind of help
05:23lpetitnkkarthik: no, ccw is a lot of things, very vertical. It can't work without eclipse. But most headless parts have been developed in a library manner (paredit.clj, clojure-complete additions, etc.)
05:23nkkarthiklpetit: oh ok so when it's done it will be merged into clojure-complete... got that
05:24brunchpoemsmindbender1: did you install through emacs package manager as well
05:24brunchpoems*?
05:24clojurebot* is just for when you are lazy and sloppy
05:24mindbender1brunchpoems: yeah I did
05:25mindbender1M-x package-install [RET] nrepl [RET]
05:25brunchpoemsright, yeah
05:25nkkarthiklpetit: ah ok, I will try to look at the clojure-complete part of ccw and if I can use it
05:26lpetitnkkarthik: right now it's too early, things are not stabilized, it's even hard to find (I put it as a secondary namespace inside an existing file :) )
05:26ejacksonlpetit: hey, that autocompletion is groovy !
05:27lpetitejackson: thanks man :)
05:27nkkarthiklpetit: so kind of you :D
05:27naegis clojure really that much slower than java? http://shootout.alioth.debian.org/u32q/compare.php?lang=clojure
05:27mindbender1lpetit: does ccw work well on eclipse juno?
05:27nkkarthiklpetit: just kidding... my problem is I am not in good terms with eclispe
05:28brunchpoemsmindbender1: are you doing nrepl-jack-in from a clj file?
05:28clgvnaeg: well you have to look at the implementation that is used there before concluding anything from the charts and numbers
05:29mindbender1brunchpoems: yes
05:29nkkarthiklpetit: and yeah I understand things are in infancy... thank you for the info
05:29lpetitmindbender1: yes
05:29mindbender1lpetit: ok.. thanks will try it out
05:30naegclgv: well it says "fastest" on both sides, and java is about 3-8 times faster (depending on the problem)
05:30lpetitnkkarthik: I have vague plans (when musing under the shower) to do something else than just "within and for" Eclipse, but that's just musing. When I have time for that, it will then probably best spent extracting more libraries from CCW for use for others.
05:31clgvnaeg: I mean it depends strongly on the implementation. you can optimize your code for a givenproblem. the question is if it was done for that implementation
05:32naegclgv: but in general - can one say that java is faster than clojure?
05:33naegor, either "a bit faster", "much faster", ...
05:33clgvnaeg: another problem is that all those benchmark problems have a pretty short duration. so clojures compile time is included in the time as well
05:33nkkarthiklpetit: yeah that would be great... or someone else can also take that burden for you, I suppose
05:33lpetitnaeg: there's no point arguing that java is (and probably will, at least for a long time) be at least "a bit faster" than Clojure on the JVM
05:34lpetitnaeg: the point being, does that matter for your application or not.
05:34noidinaeg, I'd guess that your first Java version is very likely to be faster than your first Clojure version
05:35naegit doesn't matter for me actually, just talking to a prof.
05:35noidibut then again, the latter is very likely to be much more maintainable
05:35naegso, performance might be an issue when using Clojure instead of Java - but Clojure can be farely optimized
05:35noidiand as the adage goes, it's much easier to make clean code perform well than to clean up an optimized mess
05:36lpetitnoidi: very true
05:36lpetitnaeg: try to reach grand on the topic of clojure & perf. He has good "from the trenches" stories to tell about (parsley, enlive, etc.)
05:36ejacksonnoidi: write only code its own punishment
05:37noidinaeg, dnolen (david nolen) is another person who regularly helps people optimize their code on the mailing list
05:38noidiand he seems to always get the seemingly dog-slow code to run at nearly the speed of optimized Java :)
05:39naegnoidi: I'm actually far away from optimizing code. I just wanted to show my prof. Clojure and ask him what he thinks about it. His only concerns was performance, but other than that he said it's interesting
05:39mindbender1I suspect there's a bug in nrepl.el
05:41mindbender1specifically the duo of (switch-to-buffer-other-window (generate-new-buffer-name "*nrepl*"))) returns nil in my emacs
05:42mindbender1which causes it to throw an error further down
05:46brunchpoemsnone of my professors so far have been very good at the code beauty aspect of programming
05:49nkkarthikbrunchpoems: oh I am sorry to hear that... but then we have clojure bookshelf, don't we :)
05:49lpetitnkkarthik: well, performance, if taught about algorithms and their asymptotic complexity, is an important topic. Performance of the constant factors, on the other hand, is less important and should indeed not drive too much attention
05:50mindbender1nkkarthik: what do you mean exactly by code beauty
05:51mindbender1I think beauty is a vague word
05:52nkkarthiklpetit: yeah so true
05:54nkkarthiklpetit: I meant there's nothing to be obsessed about it... regarding... "his only concern is performance"
05:54nkkarthikmindbender1: wow... did I start something here :)
05:55mindbender1Well..maybe. Depends on you..this is a public forum
05:57nkkarthikmindbender1: yes, sir, it is a vague word
05:58nkkarthikmindbender1: you should hear the other guy... he said... "lisp is good for your soul"... now what kinda word is soul :)
06:00mindbender1nkkarthik: well vagueness has been a source of confusion.. like Rich Hickey says words eventually come to mean whatever you want it to mean
06:00mindbender1moreover lisp was not good for my soul when I was learning it
06:01mindbender1especially caused by people whom I suspect felt that lisp was beautiful then went ahead and complected everything
06:04nkkarthikha ha ha... yeah things tend to go wrong
06:05mindbender1nkkarthik: Also note that simplicity to me and to Rich Hickey is more important that beauty in this case
06:05nkkarthikwell, I am sorry to have complected the discussion by using a vague word
06:06mindbender1nkkarthik: no you didn't
06:06mindbender1I'm happy you brought up that word
06:08nkkarthiksimplicity is part of, if I dare use the word again, beauty :)
06:08mindbender1nkkarthik: on infoq Rich Hickey's SimpleMadeEasy will set you straight
06:11nkkarthikmindbender1: oh will get right on it, thank you
06:14michaelr`hmm
06:14michaelr`so is there anything out there to scaffold crud interfaces for clojure?
06:22tmartirohello all
06:23tmartirodoes anyone know library for facebook graph api?
06:23nkkarthiklpetit: you have a very valid point there... performance should be concerned about the nature of algorithm... rather than nature of programming language... I never participated in a language war before... was tempted to but mindbender1 set me straight :)
06:23michaelr`tmartiro: https://github.com/maxweber/clj-facebook-graph
06:24tmartiromichaelr`, thanks a lot
06:24SgeoHow easy/difficult/annoying would it be to write a a library that Java users would experience as idiomatic in Clojure?
06:24michaelr`tmartiro: i'm using it, though it has problems. check the patches submitted
06:24tmartiromichaelr`, ok
06:24SgeoBecause I know maps are used in Clojure to store data frequently, and wouldn't Java people make a class? So the Clojure way loses some of Java's static typing, afaict.
06:24michaelr`tmartiro: seems that nobody maintains it the moment so the patches are not merged
06:32josteinkhey guys. any tips on a reasonably simple ircbot/irc framework written in clojure?
06:50michaelr`so is there anything out there to scaffold crud interfaces for clojure?
06:56clgvjosteink: check the source of clojurebot and lazybot
06:58josteinkclgv: so far clojurebot seems... finicky
06:58josteinkwas first one I checked
06:58josteinkdoing a basic "lein deps" fails on lots of dependencies
06:59josteinkhave to fiddle with mixed repos. and documentation is a bit meh
06:59josteinkbut getting better results with lazybot now
07:11clgvjosteink: lazybot is probably more interesting
07:58naegI want to map a function which prints something out over a range of numbers, but with a (println) between each of them. I'm using -> for this, but I don't think that's really correct. simplified version: http://cljbin.com/paste/50361a45e4b0e7c03fb276ea
07:58naeginstead of (print %) there is my function which does something more exciting with those numbers, but also printing something out at the end
08:00jsabeaudrynaeg, (map #(println (yourfun %)) (range 5)) ?
08:01naegthanks jsabeaudry
08:02jsabeaudrywill still return a sequence of nils however, i'm not sure exaclt y what you want
08:02nkkarthiknaeg: if you don't want the mapped values you can do
08:02nkkarthik(map (comp println yourfunc) (range x))
08:02nkkarthikif you also want the mapped values you can do
08:03nkkarthik(map (comp second (juxt println yourfunc)) (range x))
08:04nkkarthikthe first one just prints values and returns nils
08:04nz-_,(doc comp)
08:04nkkarthikthe second one prints as well as returns the values
08:04clojurebot"([] [f] [f g] [f g h] [f1 f2 f3 & fs]); Takes a set of functions and returns a fn that is the composition of those fns. The returned fn takes a variable number of args, applies the rightmost of fns to the args, the next fn (right-to-left) to the result, etc."
08:04jsabeaudry(map #(doto (yourfun %) (println)) (range 5))
08:05nz-_,(doc partial)
08:05clojurebot"([f arg1] [f arg1 arg2] [f arg1 arg2 arg3] [f arg1 arg2 arg3 & ...]); Takes a function f and fewer than the normal arguments to f, and returns a fn that takes a variable number of additional args. When called, the returned function calls f with args + additional args."
08:05naegthe thingy with comp dooesn't work for me?
08:05naeg,(map #(comp println (print %)) (range 5))
08:05clojurebot(01234#<core$comp$fn__2453 clojure.core$comp$fn__2453@6664e769> #<core$comp$fn__2453 clojure.core$comp$fn__2453@6a94d303> #<core$comp$fn__2453 clojure.core$comp$fn__2453@50a9a09f> #<core$comp$fn__2453 clojure.core$comp$fn__2453@30705018> #<core$comp$fn__2453 clojure.core$comp$fn__2453@1d9a7080>)
08:05nkkarthiknaeg: there is no # with comp
08:05naeg,(map (comp println (print %)) (range 5))
08:05clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: % in this context, compiling:(NO_SOURCE_PATH:0)>
08:06nkkarthiknaeg: comp takes functions
08:06nkkarthik,(map (comp println #(print %)) (range 5))
08:06clojurebot(0nil
08:06clojurebot1nil
08:06clojurebot2nil
08:06clojurebot3nil
08:06clojurebot4nil
08:06clojurebotnil nil nil nil nil)
08:06naegoh, but I still have the nils, so it's no real difference to (map #(println (yourfun %)) (range 5)) ?
08:07nkkarthiknaeg: yes
08:07nkkarthikif you want the values as well as print you can do
08:08nkkarthik,(map (comp second (juxt println double) (range 4)))
08:08clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core$map>
08:08nkkarthik,(map (comp second (juxt println double)) (range 4))
08:08clojurebot(0
08:08clojurebot1
08:08clojurebot2
08:08clojurebot3
08:08clojurebot0.0 1.0 2.0 3.0)
08:09nkkarthiknow we both print the doubles as well as return them
08:10naegthanks all
08:10nkkarthikof course there are other ways too... :)
08:12Fossioh, can you get the bot banned for spamming with println?
08:13Fossino, you can't
08:15talioshum_ph!
08:15hum_phheyo
08:16hum_phright... time for >140 characters verbosity :)
08:16hyPiRionFossi: The bot stops after some time.
08:16taliosso… order dependant builds huh… someone was asking about that on the dev list the other day as well
08:17taliosi'm a bit behind in email so that might have been you actually :) hah
08:17hum_phnah - haven't gone that far yet - still just getting to the point of "that's odd"
08:17hum_phI'm implementing clojure scripting support for liferay... it comes in two parts - a startup hook to register the script executor, and the executor iteself
08:17taliosnice :)
08:18hum_phboth are :gen-class - and there's a 1-way dependency from the register-er to the executor
08:18hum_phfor conciseness - let's just cool them "hook" and "executor"
08:19hum_phthe hook references the executor so it can create it, pass the thread classloader in (don't ask), and then register it within liferay
08:19hum_phthe executor is self contained
08:19taliosso it works if the ns's are listed in the correct order? From memory I have them in a set currently, so order isn't guaranteed
08:19hum_phyeah
08:19hum_phClojureScriptingExecutor.clj and ClojureScriptingExecutorRegistrationAction.clj works
08:20hum_phbut - if i happen to change it so they're the other way round - kaboom
08:20cemericktalios: hallo
08:20talioshola cemerick
08:21taliosit'd be great if the clojure compiler worked out the order for us, but since its just a reader/eval that doesn't really work.
08:21cemerickyou're gonna be screweeed tomorrow morning :-)
08:21taliosif I use a List, or something that guarantees the order that should work...
08:21talioscemerick - taking the day off, driving for 5 hours to the parents place for a friends 40th
08:21hum_phthat's the reason i gave the mutually dependent scenario
08:21cemericktalios: anyway, an odd thing: it seems that unqualified usages of `resolve` cannot be used in tests run through c-m-p…?
08:21taliosso sleep in :)
08:22talioscemerick - hrm, first I've heard of that one
08:23cemerickOK, I'll see if I can replicate in a simpler project. I was pushing when I ran into it, and just patched around it in the test.
08:24talioswb
08:24hum_ph_meh... laptop crashes
08:25hum_ph_so - from my POV, it's all fine, because I happen to have things in the "right" order...
08:26hum_ph_but it feels a bit sub-par to need to name files alphabetically in the order i need them compiled
08:27hum_phand the cyclic dependency example makes that workaround unfeasible as well
08:27taliosmmm, the only way around that would be to right something that parses the discovered .clj files, and sorts based require/imports
08:28hum_phor encourage people to come up with creative names ;)
08:29talios1_hook.clj 2_controller.clj ? :)
08:30hum_phand hope to god we don't need 1.5_middleware.clj
08:32taliosany idea what leiningen does in this scenario?
08:32hum_phnope - haven't tried it
08:32cemerickwhat's the issue?
08:33hum_phdependency resolution of AOP compiled (:gen-class)es
08:33cemerickah
08:34hum_phlisted alphabetically which matches expected compilation order -- all good
08:34cemerickShould try to keep your AOT stuff quarantined, much like infectious disease.
08:34hum_phyup
08:34taliosyou dynamic language lover you :)
08:35hum_phthis is integrating with liferay code - so needs a) named java classes for implementation; b) extending abstract classes
08:35hum_phbut - it's the integration point - so everything behind that should be reasonably clean (or as clean as someone who's been writing clojure for a week can make it!)
08:38cemericktalios: if I can't load it into a REPL, then it can't be helping me very much :-)
08:39taliosdon't make me get all frege on your behind ;p it even now has a repl
08:42talioshum_ph - is it possible to declare some interfaces in java, and use them from the clojure as a way around it? mm
08:43taliosthats rather iki tho
08:44hum_phfor one of the two, I could reimplement the abstract class that provides 80% of it in clojure and then use that...
08:45hum_phthe other one no: liferay actually uses an abstract class with 1 abstract method and nothing else in lieu of an interface
08:46magopianis there a way to use the solution from http://www.learningclojure.com/2010/11/levenshtein-distance-edit-distance.html to the problem 101 on 4clojure?
08:47magopianit seems not, as it needs forward declaration, (if using the solution from fatvat)
08:47magopianor a defn (which seems to be forbidden by 4clojure)
08:48talioshum_ph - mmm, is it possible to use deftype at all - rather than gen-class?
08:48magopianotherwise i'll give a try at the "imperative way" explained in the wikipedia page
08:49hum_phfor one of the classes - yeah
08:50hum_phmeans a bit of repetition of existing abstract classes - but nothing so complex it'd be a pain to reproduce (or a waste to not use)
08:56SgeoIs conj basically just a function that "adds" to the most efficient place to put a new element?
08:58stuartsierraSgeo: yes
09:02SgeoWhy do binding forms such as let and lambda-lists use vectors?
09:03antares_Sgeo: for the bindings part to stand out visually
09:14gerry1hello
09:14gerry1can't make nrepl work
09:15gerry1i always get "couldn't bind to address " messages when "nrepl-jack-in"
09:17gerry1error in process sentinel: Could not start nREPL server
09:17gerry1i don't know what's wrong
09:19gerry1last time, i tried swank, it got same error messages
09:20gerry1any ideas?
09:23chouser"couldn't bind" -- I wonder if that means the port you're trying to use is already in use or something.
09:26amalloynrepl picks a port at random, and tries again on failure i think. so maybe he just doesn't have a network card, eh?
09:27gerry1amalloy: why nrepl can't bind to an address
09:28cemerickThe default is to use port 0, so an open port should be autoselected
09:28gerry1network card?
09:28gerry1:)
09:30gerry1how to view ports which were bind in linux?
09:30antares_gerry1: netstat -t tcp -anp
09:31cemerickoh, nrepl.el is just using `lein repl :headless` and grepping for the port number
09:31cemerickgerry1: can you run `lein repl` successfully in your project?
09:32robermannFYI: if anyone is using DB Oracle, I've just updated the entry on http://en.wikibooks.org/w/index.php?title=Clojure_Programming/Examples/JDBC_Examples&amp;stable=0#Oracle - the previous example was not working
09:33gerry1cemerick: i'm trying
09:34gerry1not work,still get same error messages
09:34gerry1Exception in thread "main" java.net.BindException: Cannot assign requested address
09:34cemerickodd
09:34cemerickgerry1: can you paste your project.clj somewhere? And, what version of lein are you using?
09:35gerry1Leiningen 2.0.0-preview8 on Java 1.7.0_05-icedtea OpenJDK Client VM
09:36cemerickwell, that's quite sane
09:39gerry1cemerick: i'm just test clojure,so my project.clj is simple
09:39gerry1(defproject myproject "JUST_TEST"
09:39gerry1 :dependencies [[org.clojure/clojure "1.4.0"]]
09:39gerry1 :plugins [[lein-swank "1.4.4"]])
09:39gerry1just it
09:40gerry1i do'nt know what's wrong
09:40cemerickhrmph
09:41cemerickgerry1: please `export DEBUG=true`, run `lein repl`, and paste the results in a pastebin somewhere
09:42jkkrameryikes, apparently nrepl.el sends code to nrepl in the same ns as your buffer, and doesn't namespace-qualify clojure.core fns
09:43jkkramerI have a fn named resolve (core's is excluded) - nrepl.el started behaving strangely
09:45amalloyjkkramer: https://github.com/kingtim/nrepl.el/blob/master/nrepl.el#L314 could use a patch, then!
09:45gerry1 cemerick: http://pastebin.com/810SFD3J
09:45jkkrameramalloy: working on it now…
09:45jkkramerI actually only noticed it when I got really bizarre compilation errors (per https://github.com/kingtim/nrepl.el/blob/master/nrepl.el#L510)
09:46amalloybut since there are quite a few chunks of code around that use `format` to construct clojure code, it's probably better to write something that acts a lot like syntax-quote and works on lists instead of strings
09:47amalloy(nrepl-send-string (clojure-backtick (if-let [pst+ (resolve 'clj-stacktrace.repl/pst)] ...)))
09:48cemericknrepl.el should really be using a different session for the tooling stuff, as well
09:49cemerickgah, nothing there
09:49jkkrameramalloy: I don't think my emacs lisp fu is strong enough for that
09:49amalloyi'm not interested in doing it either, but i think it's probably not a challenging elisp task, just a challenging task/algorithm in general
09:49cemerickgerry1: eh, I was hoping to see the command being used to start the server.
09:50xeqicould try adding :repl-options {:port 23233}
09:50amalloyyou either need some way to know that pst+ shouldn't be qualified, or a list of every symbol in clojure.core that should, for starters
09:50xeqior some other port that should be unused
09:51cemerickIf that works but port 0 doesn't, that'll be doubly interesting.
09:52hum_phI suspect I know the answer to this - but I'm going to ask anyway: is gen-class my only option for subclassing an abstract class (working with an ordinary external API)?
09:52xumingmingva stupid question, in clojure why we have a concept named *multimethod* rather than *multifunction*?
09:53amalloyyes, hum_ph
09:53amalloywell, i guess no. you can use proxy
09:53amalloydepending on your needs
09:53hum_phsorry - should also add that I need a no-arg constructor and a named class for external instantiation
09:55gerry1i'm trying port 2323
09:55amalloypersonally i'd write that in java, hum_ph. should be possible with gen-class, but would be easier to just use a language that's designed to take this kind of reflection/bean abuse
09:56gerry1lein repl :connect 2323 not response
09:57noidigen-class is quite a pain to deal with
09:58noidiat first I found it surprising that no-one's wrapped it in a nice DSL. Then I realized that there is one already and it's called Java :)
09:58hum_phheh
10:02gerry1i'm do "lein repl :connect 2323 :headless, it seems not response,but i can do "alt-x nrepl" in emacs
10:02xumingmingva stupid question, in clojure why we have a concept named *multimethod* rather than *multifunction*?
10:03tbaldridgexumingmingv: I think method here is not used in the OOP sense
10:04tbaldridgeit's not "multimethod" as much as it is "multiple method function"
10:04estebannxumingmingv: presumably because it is used for type based polymorphism
10:04gerry1repl still not work
10:04tbaldridgehttp://en.wikipedia.org/wiki/Multiple_dispatch
10:05tbaldridgeYeah, it's basically a polymorphism construct that's much more flexible than the one offered by "normal" OOP languages
10:05borkdudenot necessarily type based, any value based
10:05xeqidoes "lein repl" work? I don't think passing both subcommands would
10:05estebanntrue
10:16xumingmingvthanks, tbaldridge estebann
10:18amalloyhuh. is there no way to specify an :as alias in my :refer-clojure clause? i need to add a separate :require/:as for that?
10:22ejacksondnolen: what is a MVS ?
10:23jkkrameramalloy: a separate :require is what I do. I didn't even think to try :refer-clojure :as but it would make sense
10:23amalloyjkkramer: yeah, i checked the source and evidently a separate require is the only option, but it seems like almost every time you'd want an :as
10:37achengis it true that bean only "mapizes" one level deep?
10:38S11001001acheng: yes
10:38achengS11001001: is there a recursive version?
10:38S11001001acheng: where would you stop?
10:38achenghm. java.data...
10:39achengdon't stop til you get enough
10:39S11001001can't write an algorithm for that
10:39acheng(that was a pop culture reference :)
10:40S11001001,(bean 5)
10:40clojurebot{:class java.lang.Long}
10:40S11001001,(bean Long)
10:40clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException>
10:40TimMcThat's just a security restriction, I think.
10:40S11001001,(count (bean Long))
10:40clojurebot39
10:41TimMcHaha, what val caused the error?
10:41amalloyTimMc: most of them, probably
10:41TimMc,(take 20 (bean Long)
10:41clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
10:41amalloyi know lazybot won't let you use java.lang.reflect
10:41TimMcI needn't do the binary search in public channel. Gimme a moment.
10:42joegallo_it works fine at a local repl (for me)
10:43S11001001,(map (fn [[k v]] [k (try (pr-str v) (catch Throwable _ "ERROR"))]) (bean Long))
10:43clojurebotS11001001: Pardon?
10:43achenglooks like java.data will work for me
10:43TimMc,(key (second (drop 5 (bean Long))))
10:43clojurebot#<RuntimeException java.lang.RuntimeException: java.lang.reflect.InvocationTargetException>
10:43TimMcUhh...
10:45S11001001acheng: also keep in mind that bean is lazy in map-building and extracting properties; if yours isn't, then it will trigger errors sometimes beaning values where built-in bean wouldn't
10:45redingerhas anyone looked into using Jark with Clojure 1.5?
10:45edwAnyone know how to get sqlkorma to play nice with PostgreSQL over SSL i.e. Heroku's PostgreSQL servers?
10:45TimMc,(count (bean Long))
10:45clojurebot39
10:45TimMc,(count (drop 5 (bean Long)))
10:45clojurebot#<RuntimeException java.lang.RuntimeException: java.lang.reflect.InvocationTargetException>
10:45S11001001TimMc: to force a pair it has to extract the value
10:46TimMcYep, it's the beaning process. ##(counted? (bean Long))
10:46lazybot⇒ true
10:46achengS11001001: ok thanks. keep on with the force don't stop
11:01rossputinhey guys, I'd like to convert a param coming into a function into the correct type, if its passed in from one route its a string, from another route a num… at the moment I've got a load of (Long/valueOf x) code lying around… just looking to hear some better alternatives really
11:05antares_rossputin: can you paste an example?
11:09rossputinantares_: sure… Im doing stuff like : (q '[:find ?id :in $ ?fid :where [?id :user/someid ?fid]] (db conn) (Long/valueOf id))… I'm looking for a safer way that contends with different types coming in… sometimes string, sometimes numeric
11:09antares_rossputin: you can create a conversion protocol like here https://github.com/michaelklishin/monger/blob/master/src/clojure/monger/conversion.clj
11:10antares_rossputin: although maybe I don't understand what problem you are solving by Long/valueOf. Are all outputs always strings? and you know nothing about the schema?
11:11rossputinantares_: the id param may be a string sometimes, or sometimes numeric, depending on how the API is used (from RESTful web service or web app)
11:13rossputinantares_: just looking over the protocol example you referenced… looks pretty concise
11:14antares_rossputin: then a conversion protocol is just what you need
11:14rossputinantares_: thanks for the help.. was wondering when I'd get round to using protocols
11:15antares_rossputin: also see https://github.com/michaelklishin/welle/blob/master/src/clojure/clojurewerkz/welle/conversion.clj#L254, a slightly different case that uses multimethods
11:16rossputinantares_: are there performance characteristics of either in the RESTful web service under load scenario that would make me choose either one over the other ?
11:16antares_rossputin: protocols are more efficient, they are single dispatch
11:17rossputinantares_: thx
11:17antares_but they also dispatch on the type of the first argument, that's it
11:18amalloya web service under load will have things that take way more cpu than the difference between dispatching with a multimethod vs a protocol
11:18amalloyso i would answer no to that last question
11:18rossputinamalloy: good to know
11:18rossputinthx guys
11:21antares_rossputin: yes, when in doubt, profile first (VisualVM is a good tool for starters)
11:21rossputinantares_: I'll lookit up
11:25rossputinantares_: I've only ever done that kind of thing in terminal, so having some visual element will be nice
11:26antares_rossputin: http://visualvm.java.net. I great book on profiling JVM applications, mentions a lot of tools among other things: http://www.amazon.com/Java-Performance-Charlie-Hunt/dp/0137142528
11:27antares_*I would recommend
11:27rossputinThx
11:30AdamClementsHi everyone. A pattern I seem to be repeating a fair amount is along the lines of (when (pred x) x), is there a more concise form of that in the core libs that I could use? Along the lines of (blah pred x). It's especially annoying if x is non-trivial and i have to put it in a let binding.
11:31amalloyAdamClements: no, but nothing stops you from defining that function yourself
11:33jsabeaudryAdamClements, have a look at if-let and when-let
11:35amalloyi don't think those are relevant to his problem
11:35jsabeaudryI might not be understanding the problem correctly
11:37amalloyhe has (let [x (some big expr)] (when (pred x) x)), and he'd rather have (test-with pred (some big expr))
11:37amalloywhen-let doesn't help, because he needs to let x, and test pred
11:38jsabeaudryah, ok!
11:40jsabeaudryI'd call it only-when
11:46scriptor(first (filter pred [x])) might work
11:48AdamClementsamalloy, yeah so I could do (defn blah [pred x] (when (pred x) x)), but usually when I write little functions like that i find that ti's already in the core libraries!
11:49tbaldridgescriptor: on no, please don't do that..that'll be horribly slow
11:49scriptortbaldridge: hah :)
11:49AdamClementsjsabeaudry, when-let covers some situations I might use this in, that's true. Not all of them
11:49AdamClementsjsabeaudry, only-when, good name, that was my other issue with defining it myself!
11:49amalloyagreed, AdamClements, this is something i'd expect to find in core, but it's not there
11:49scriptordoesn't one of the bots allow searching for type signatures?
11:50amalloythose don't exist in clojure, so no? lazybot lets you search for functions if you have an input and know what output you want
11:50AdamClementsamalloy, especially given how it's idiomatic to return nil in so many situations
11:50tbaldridgeclojurebot: can you search by type signature?
11:50clojurebotdatatype is see datatypes
11:50tbaldridgehrm...guess not....
11:50scriptorah, right, that's what I meant, not types
11:50rod__noob question: is there a non-lazy version of map? or do i just (doall (map ... )) thanks
11:52metellusrod__: dorun or doseq might do what you want
11:52amalloy$findfn 3 9 12
11:52lazybot[clojure.core/+ clojure.core/unchecked-add clojure.core/+' clojure.core/unchecked-add-int]
11:52metellus$findfn 2 2 4
11:52lazybot[clojure.core/unchecked-multiply clojure.core/+ clojure.core/* clojure.core/unchecked-add clojure.core/+' clojure.core/unchecked-multiply-int clojure.core/*' clojure.core/unchecked-add-int]
11:52scriptor$findfn odd? 3 3
11:52lazybot[clojure.core/max-key clojure.core/cond clojure.core/dosync clojure.core/sync clojure.core/char-escape-string clojure.core/*data-readers* clojure.core/with-loading-context clojure.core/default-data-readers clojure.core/*clojure-version* clojure.core/case clojure... https://www.refheap.com/paste/4582
11:52rod__metellus: thanks - i haven't been able to get doseq to return the new collection yet, but i'll try again.
11:54tbaldridgerod__: for that you want doall
11:54tbaldridgejust don't do something like (doall (range)) :-P
11:54rod__heh - ok!
11:54rod__i'll stick with doall then, cheers both
11:59noidilpetit, thanks for keeping the counterclockwise "how to build" page up to date. I'm giving the instructions a go now :)
12:04noidilpetit, minor issue: "you must clone 6 repos" is followed by 8 repos
12:05lpetitnoidi: updated, thanks
12:09noidilpetit, after following the instructions, I get the following errors: http://dl.dropbox.com/u/4653951/ccw_build_errors.png
12:09noidihave I skipped a step?
12:10lpetitnoidi: create the classes/ folders for the complaining projects
12:10noidiok
12:12lpetitnoidi: added explicit instructions to do so, thanks for the feedback
12:12noidilpetit, maybe those directories could be added to the git repos like this http://stackoverflow.com/a/932982
12:13lpetitnoidi: unfortunately no because it can be destroyed by the IDE when doing project/clean
12:14llasram~juxt
12:14clojurebotjuxt is usually the right answer
12:15noidilpetit, ok
12:16lpetitclojurebot: it is "just" an answer aha
12:16clojurebotAlles klar
12:16lpetiterr "juxt" an answer
12:16noidiI added the directories and everything seems to build fine, thanks! :)
12:17noidinow what project do I need to run to see the built CCW in action?
12:19amalloyclojurebot: forget it |is| "just" an answer aha
12:19clojurebotI forgot that it is "just" an answer aha
12:20lpetitclgv: ping
12:20clgvlpetit: pong
12:21lpetitclgv: how can I reproduce Issue 409: Problem with Leiningen plugins and hooks ?
12:21lpetitclgv: I know next to nothing about plugins and hooks.
12:21lpetitoh wait
12:21lpetityour plugin is targeting lein2, right, not lein1 ?
12:21clgvlpetit: yes
12:22lpetitclgv: would have been too easy :)
12:22lpetitclgv: I need your help for coming up with a minimalistic reproducible scenario
12:23clgvlpetit: the main problem seems to be that the leiningen namespaces are not available
12:24clgvlpetit: I think the :plugin data works as expected, the exception was just confusing. so my plugin is there and tries to require/use leiningen namespaces which are not in the classpath-container, I guess
12:25lpetitclgv: while developing the plugin, or using it from a client project?
12:25clgvlpetit: while using it. but I check the former as well
12:26lpetitclgv: I think you should explicitly put a dependency on leiningen-core in your plugin's project.clj file. Do you do that?
12:26clgvlpetit: no, I do not. since I don't have to when workin with raw leiningen
12:26clgvlpetit: it provides those implicitly
12:27clgvlpetit: also I have no clojure dependency in there. since that is also provided by leiningen. so I can't eval the plugin namespaces in CCW at all
12:27lpetitclgv: I'm still not sure I totally grasp the problem
12:28lpetitby veal, you mean "load" ?
12:29lpetitclgv: ^^
12:30clgvlpetit: yes. actually after "lein2 new plugin myplugin" which is the default template for plugins there is no dependency jar in my classpath-container in CCW. but for raw leiningen that would be ok. since it is executed via ":eval-in-leiningen true" - so clojure and leiningen-core comes from the leiningen installation
12:30lpetitclgv: how is your plugin supposed to be used?
12:31clgvlpetit: currently it only adds a hook, which is supposed to change behavior when uberjar is built. so nothing that concerns CCW. but CCW gives me an error that it cant load those leiningen namespaces
12:32lpetitclgv: I still don't understand where and when in ccw do these errors occur
12:32clgvlpetit: so in that particular case, I would be happy if CCW just ignored :hooks
12:32clgvlpetit: after saving the project.clj or updating dependcies
12:32clgvor just openening the project
12:32lpetitclgv: I think I got it
12:33lpetitclgv: could you find a plugin similar to yours on clojars with which I could reproduce the problem?
12:34clgvlpetit: I think you could take any plugin that provides a hook and then specify the hook namespace in the project.clj under :hooks
12:34lpetitclgv: do you have one in mind? Would really help me focus on problem solving
12:35clgvlpetit: hm I could built a dummy from my plugin. can I upload it with the issue?
12:35lpetitclgv: can you make it available on clojars?
12:41clgvlpetit: yes. just testing it
12:42lpetitclgv: gr8 !
12:43clgvlpetiti: it's up on clojars -> [lein-myhook "0.0.1"]
12:44lpetitclgv: thanks. can you update the ticket with this & instructions for reproducing the problem?
12:45clgvlpetit: last errand for you ;)
12:45lpetit:)
12:48noidilpetit, Running any project as an Eclipse Application seems to start a new Eclipse with my compiled CCW. Does it matter which project I run?
12:49clgvlpetit: done. I think it's time to go home now ^^
12:50lpetitnoidi: running any plugin project will use the same configured "Platform" and indeed every plugin project in your workspace will be available in this Platform
12:50lpetitclgv: thaks
12:50lpetitnoidi: but usually I start it from ccw.core
12:50lpetitwhich makes the most sense to me
12:51noidiOK, thanks!
13:00noidilpetit, is it possible to package and install the latest git version of CCW into the development eclipse? or is it only possible to install from an update site?
13:01lpetitnoidi: meaning when you're happy with a change you did (as tested through the dev Eclipse runtime), and you want to install it yourself for your own eclipse?
13:02noidilpetit, yes, exactly
13:03lpetitnoidi: you create a project of kind Software Update Site. You open site.xml, you add ccw.feature, you click on "Build" => after the build, you reference your local update site directory from Help > install software … (adding a "local folder" and not an url)
13:03lpetitmust go now, good luck and see you later !
13:06noidilpetit, thanks again :)
13:13thorbjornDXI'm looking at getting into clojure, and I picked up Clojure Programming (chas emerick et al.) are there any other good resources that I should look at early on?
13:14bowleshttp://www.4clojure.com/
13:14bowles4clojure is a nice repl in browser that guides you through clojure basics http://www.4clojure.com/
13:14thorbjornDXbowles: thanks, will check it out
13:15bowlesVolkman has a pretty in-depth page I found very useful: http://java.ociweb.com/mark/clojure/article.html
13:17scriptorbowles, thorbjornDX: it's not exactly a repl
13:18scriptorhttp://tryclj.com/ is more of a browser-based repl, 4clojure interprets clojure data but it doesn't involve a loop
13:19thorbjornDX4clojure is more of a REP
13:20scriptoreven the print part is iffy
13:20thorbjornDXscriptor: hah, true.
13:20scriptorRE-GREEN-OR-RED-CIRCLE
13:20bowlesthanks for clarifying, I did like tyrclj
13:21thorbjornDXbtw: is leiningen the defacto way to write and run clojure code? or should I just be doing java -jar
13:22scriptorthorbjornDX: lein, definitely
13:22thorbjornDXscriptor: sounds good. What's the best way to get lein onto my system? Is it distributed as a .jar?
13:22scriptorthorbjornDX: just a shell script, actually!
13:23scriptorhttp://leiningen.org/
13:23technomancythorbjornDX: it could be in your package manager, but it's easy to install by hand. just be sure to get 2.x
13:23thorbjornDXtechnomancy: I'm running in a weird non-root environment, so I've had to hack a lot of stuff.
13:23scriptorwell, it has a self-install command which does the installation of all the rest, but you just need the shell script to get started
13:24technomancyyeah, manual install works fine without root
13:24thorbjornDXtechnomancy: how do I point it at my clojure.jar?
13:24thorbjornDXtechnomancy: environment variable?
13:24scriptorthorbjornDX: you don't need to
13:24technomancythorbjornDX: don't do that; just declare your dependencies
13:24technomancythorbjornDX: run `lein tutorial`
13:25thorbjornDXscriptor: technomancy: Okay, I guess I always assumed that since my project.clj was clojure syntax, it required clojure.jar to run
13:25scriptorthorbjornDX: clojure is usually listed as one of the dependencies, the page I linked above has an example on the front page
13:26scriptorso it automatically downloads clojure.jar and puts it in your project's classpath for you
13:26thorbjornDXscriptor: okay, that makes sense
13:27thorbjornDXscriptor: so lein will drop all of its requirements into ~/lib ?
13:28technomancythorbjornDX: they'll be in ~/.m2/repository, but you shouldn't need to worry about where
13:28technomancyjust start hacking and it'll handle things for you, in general
13:28thorbjornDXtechnomancy: gotcha, I'll run through the tutorial now
13:28thorbjornDXthanks for you help
13:33thorbjornDXah, this is dead simple (and blows python packaging out of the water)
13:33technomancysweet
13:34thorbjornDXtechnomancy: now I just need to learn graph theory and I can make some progress
13:34S11001001virtualenv is pretty hilariously hacky
13:35thorbjornDXS11001001: I've been trying to just run out of supposed "clean" lib/site-packages, but it always ends up messy
13:35thorbjornDXS11001001: (using pip, which at least allows me to 'uninstall')
13:35S11001001I gave up and virtualenv for everything now
13:35technomancya big part of learning clojure is unlearning all the BS and baggage you bring with you from past experience
13:37stuartsierraNever thought I'd see the day when Maven-based dependency resolution was viewed as "unlearning baggage."
13:40scriptorcould have once said the same of jvm-based languages
13:40stuartsierraKudos to technomancy are in order.
13:41duck11231(inc technomancy)
13:41lazybot⇒ 36
13:41technomancyaw shucks you guys
13:43nDuffHrm. No documentation for instant literals at http://clojure.org/reader -- where would that be?
13:45duck11231there's some stuff in the changelog. I saw that the other day, but it's not much
13:47stuartsierranDuff: It's not well-documented outside of the source.
13:47stuartsierraContributions welcome.
13:51TimMcstuartsierra: How should doc contributions be made?
13:51stuartsierradev.clojure.org
13:51TimMcAh.
13:52TimMcJust add and edit pages?
13:52stuartsierrayep
13:53nvythank you bowles @ java.oci link
13:56bowlesmany of the resources mentioned here can be found at: http://learn-clojure.com/
13:58noidilpetit, I made a tiny change to get my feet wet https://github.com/laurentpetit/ccw/pull/10
15:03dansalmois this the best way to get the difference between these two strings as "extra"? (apply str ((split-at (count "same") "sameextra") 1))
15:07noidi&(.replaceFirst "someextra" "some" "")
15:07lazybot⇒ "extra"
15:07clj_newb_23823is there a file in clojure that says "create file XYZ if it does not already exist"? I don't want to do a "check for xyz; then create" since between the check /create, the file might have bene created
15:08clj_newb_23823is & a clojure macro or a lazybot tag?
15:08clj_newb_23823&(+ 2 3)
15:08lazybot⇒ 5
15:08clj_newb_23823& (println "Yo")
15:08lazybot⇒ Yo nil
15:09clj_newb_23823is there a file in clojure that says "create file XYZ if it does not already exist"? I don't want to do a "check for xyz; then create" since between the check /create, the file might have bene created
15:09S11001001clj_newb_23823: opening a file for writing will create it if it doesn't exist
15:09clj_newb_23823&(println "Is there a way in Clojure to atomically say: [if file XYZ does not exist; create file XYZ]")
15:09lazybot⇒ Is there a way in Clojure to atomically say: [if file XYZ does not exist; create file XYZ] nil
15:09noididansalmo, I find the .replaceFirst call slightly more readable, but note that the search pattern is a regular expression, not a plain string
15:09clj_newb_23823S110010001 and if the file already exists?
15:09dansalmoThanks :nodi
15:09S11001001clj_newb_23823: if you open it in append mode, nothing
15:10clj_newb_23823urgh; so the hack is:
15:10noidi&(.replaceFirst "sameextra" (java.util.regex.Pattern/quote "same") "")
15:10clj_newb_23823open the file in append mode
15:10lazybot⇒ "extra"
15:10clj_newb_23823check to see if here's already contents in it?
15:10TimMcJust open in append mode and start writing.
15:10noidithat Pattern/quote escapes all RE magic characters from the string
15:10S11001001clj_newb_23823: it's not a hack; it's been the standard way to do it for decades, and is there precisely to eliminate the race condition you mention
15:11clj_newb_23823http://docs.oracle.com/javase/6/docs/api/java/io/File.html#createNewFile%28%29
15:11clj_newb_23823I thikn that's what I want
15:11TimMcclj_newb_23823: If the file is already there, you want to bail?
15:11clj_newb_23823yes
15:11clj_newb_23823hmm; my bad for not making that clear in my question
15:12TimMccreateNewFile seems legit, then -- as long as you are not using it for locking. :-)
15:13clj_newb_23823is Clojure's "spit" atomic wrt to the file system?
15:13clj_newb_23823i.e. if two clojure threads spit to the same file, is it guarnteed that the contents on the FS will be exactly one of the two calls
15:13clj_newb_23823or can it be some threaded/interleaved form of both?
15:13S11001001clj_newb_23823: latter
15:14S11001001clj_newb_23823: as for createNewFile, remember that it is still possible for someone to open and write to your file after you've succeeded at createNewFile, unless your umasks/stickies are set to deny them
15:14clj_newb_2398324that's unfortunate
15:14amalloygotta switch to an immutable filesystem just to be safe
15:15clj_newb_2398324hmm; yes, I need an immutable, persistent FS
15:15nvyhey, I just did M-x clojure-jack-in, and it does give me a clojure shell
15:15clj_newb_2398324I think it's called ZFS
15:15nvyhow do I make it "execute" my lein project's code?
15:15nvy(-main) clearly doesn't work
15:16technomancynvy: (doto 'my-main.ns require in-ns)
15:16technomancythen (-main) will work
15:17nvytechnomancy: will I have to do that every time I modify my clojure code?
15:17technomancynvy: no, C-c C-k will load the current buffer from emacs
15:18emezeskeclj_newb_2398324: I don't think you repeated your question enough
15:18clj_newb_2398324&(doseq [x (range 10)] (println "clj_newb's question"))
15:18lazybot⇒ clj_newb's question clj_newb's question clj_newb's question clj_newb's question clj_newb's question clj_newb's question clj_newb's question clj_newb's question clj_newb's question clj_newb's question nil
15:18clj_newb_2398324&(doseq [x (range 10)] (println "clj_newb's question\n"))
15:18lazybot⇒ clj_newb's question clj_newb's question clj_newb's question clj_newb's question clj_newb's question clj_newb's question clj_newb's question clj_newb's question clj_newb's question clj_newb's question nil
15:19clj_newb_2398324this is probably good time for me to stop before I get kicked
15:19emezeskeWell, that was enough to get you on my ignore list. *plonk*
15:19S11001001oh dear.
15:19clj_newb_2398325this nick too?
15:20clj_newb_2398325so I've rencely been using redis with clojure; and I really like the fact that I can just backup dump.rdb
15:20clj_newb_2398325is there any other datbases (something perferably document store-ish) that also supports such simple backup?
15:22S11001001zope
15:26technomancycouch is like that I believe
15:26bobajettnoob question: I have file hello.clj with (defn hello [] (println "hello world")), how can I import this into my clojure REPL so I can execute (hello) in my REPL?
15:28lynaghkbobajett: you can use the 'load-file function
15:29lynaghkbobajett: otherwise, you'll have to look at the docs for whatever editor you're using. For instance, if you're using emacs+slime you can do C-c C-l.
15:30stuartsierrabobajett: Yes, `load-file` is the simplest way to load a file. Once you have a project with real namespaces you would likely use `require` instead.
15:31bobajett$ cat hello.clj
15:31bobajettdefn hello []
15:31bobajett (println "hello world"))
15:31clj_newb_2398325you're missing a (defn
15:32bobajettcopy and paste error there. but ('load-file "hello.clj") and then at the REPL user=> (hello) gives me a "Unable to resolve symbol" error
15:33clj_newb_2398325why ('load-file "hello.clj") rather than (load-file "hello.clj")
15:33bobajettoops
15:33clj_newb_2398325the correct way to do this is to 1: create a full transcript 2) past the transcript to a paste bin 3) post a url to the paste bin here in the channel
15:33bobajettawesome! thanks guys
15:34bobajettthat worked
15:35S11001001,(doc +')
15:35clojurebot"([] [x] [x y] [x y & more]); Returns the sum of nums. (+) returns 0. Supports arbitrary precision. See also: +"
15:35S11001001funny how + documents the behavior of some other function instead :)
15:36S11001001funny how I forget to put ' even when I'm talking explicitly about that, just like said docstring
15:36S11001001,(+')
15:36clojurebot0
15:36clj_newb_2398325has anyone come up with a lazybot-clojurebot quine yet?
15:37clj_newb_2398325,?
15:37clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ? in this context, compiling:(NO_SOURCE_PATH:0)>
15:38clj_newb_2398325,(println "clj_newb is going to get kicked")
15:38clojurebotclj_newb is going to get kicked
15:38metellus&(+ 1 1)
15:38lazybot⇒ 2
15:38clj_newb_2398325ah, the => from lazybot prevents the quine; doh
15:39TimMcS11001001: They changed the name, but forgot to change the docstring.
15:40S11001001,(doc +)
15:40clojurebot"([] [x] [x y] [x y & more]); Returns the sum of nums. (+) returns 0. Does not auto-promote longs, will throw on overflow. See also: +'"
15:40S11001001TimMc: huh.
15:40TimMc,(meta #'+')
15:40clojurebot{:ns #<Namespace clojure.core>, :name +', :file "clojure/core.clj", :line 908, :arglists ([] [x] [x y] [x y & more]), ...}
15:40TimMc,(:added (meta #'+'))
15:40clojurebot"1.0"
15:40S11001001(use clj-time.travel)
15:42TimMc,(:added (meta #'+)) ;; for completeness
15:42clojurebot"1.2"
15:42S11001001I guess that's fair
15:42S11001001but wasn't it 1.3?
15:43TimMcHa, I think so.
15:43TimMcClearly 1.3 is blaming 1.2.
15:44S11001001in the tradition of emacs, change :added to :removed, for antinews
15:44scriptorI don't know why I just checked the source for clj-time.travel
15:45S11001001https://www.gnu.org/software/emacs/manual/html_node/emacs/Antinews.html
15:45TimMc1.2's reader doesn't even believe that symbol literals can end in '
15:45S11001001indeed
15:46S11001001it makes for that neat (first [+' +]) trick
15:47S11001001,(first [+' magic])
15:47clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: magic in this context, compiling:(NO_SOURCE_PATH:0)>
15:47S11001001oh yeah
15:48TimMcHaha, I like that.
15:48S11001001,(first [+' 'magic])
15:48clojurebot#<core$_PLUS__SINGLEQUOTE_ clojure.core$_PLUS__SINGLEQUOTE_@6aab998e>
15:48TimMc,((first [+' +]) Long/MAX_VALUE 1)
15:48clojurebot9223372036854775808N
15:48TimMcShould work in 1.2 as well, right?
15:49S11001001yes
15:53bobbrahmshey all: I want to add some clojure to my big java project, which is built using maven. But I want to be able to freely mix them, having clojure importing java, and having java import clojure generated classes, more or less with impunity. But when I build, either clojure or java gets built before the other guy and whichever one goes first complains about not being able to find the classes it's trying to import.
15:53bobbrahmsNow clojure gen-class seems good at making stubs.
15:54bobbrahmsCan I run the clojure maven build plugin in such a way that it can generate just the class stubs it finds in the clojure files, then do the java compile, then run the "real" clojure build again, overwriting the stubs with the actual classes?
15:55stuartsierrabobbrahms: no
15:55stuartsierraUnless you compile the stubs and the java in separate sub-modules
15:56stuartsierraBut that's not going to do the over-writing you want.
15:57bobbrahmsbut is there any problem with an approach like I am describing?
15:57stuartsierrabobbrahms: loads
15:57stuartsierraloads of problems, that is.
15:57bobbrahmswhat are some of the main things I'm missing?
15:58stuartsierraYou cannot mix two languages without an integrated compiler.
15:58bobbrahmscould I build a program to go through my clojure files, pulling out the namespace expressions with gen-class in them and then just compile those to stubs at an early stage of the build?
15:59stuartsierraI'm sure you could, but I doubt it would be less work than refactoring your design to avoid the cyclic dependencies.
15:59bobbrahmsnot really talking about cyclic dependencies here
16:00stuartsierraIf your Java code calls Clojure code which calls the Java code, in the same project, that's a cyclic dependency.
16:00bobbrahmsmore like inter-dependencies
16:00bobbrahmsI'm not talking about clojure module a referring to java mod b, which refers to clojure module a
16:01stuartsierraIt doesn't matter if it's the same module or different modules, there's no sane way to do it.
16:01bobbrahmsI'm talking about clojure module a referring to some java module which might be in the same named package/namespace
16:02bobbrahmsin the (admittedly simple) experiments i've tried, it works if I do manually what I've been describing
16:03bobbrahmsis there some other problem with that workflow? at java compile time, if it sees the stub classes, the java compile is happy
16:03stuartsierraLike I said, you could probably make it work. But my strong recommendation is to refactor your design.
16:03bobbrahmsWell, here's the thing
16:04bobbrahmsyes you can make a class, using clojure, that extends some java class, or implements some interface
16:05S11001001bobbrahms: if there's truly no cyclicality, you should be able to arrange a DAG of subprojects, alternating java and clojure
16:06bobbrahmsbut why should it be considered harmful or bad style to have, within a project, java and clojure source directories with modules of each being essentially fellow citizens?
16:07bobbrahmsI mean , yes what you say is true
16:07bobbrahmsyou should be able to arrange it that way.
16:07bobbrahmsbut it's so much more natural and easy if you could put things where they want to be.
16:07stuartsierraThe problem is that neither the Clojure compiler nor the Java compiler are aware of each other. So they have to be run in some fixed order.
16:07bobbrahmsyes.
16:08stuartsierraWhat you seem to want is a third "Clojure gen-class stub" compiler that doesn't exist.
16:08bobbrahmswhich is why I'm asking if there's any reason why I couldn't just pick up the ns declarations and use them to make stubs to make the java compile happy
16:08stuartsierraNothing's going to stop you.
16:09bobbrahmsright.. ok my question is this
16:09bobbrahmswhen I rip out everything but the ns in my clojure module, it makes a stub that makes the java import happy.
16:10bobbrahmsare there problems with this approach i'm going to run into? Are there some things that are going to fail, apart from ns declarations that contain references to java-land imported stuff that doesn't exist yet?
16:10nvyso in nrepl I do C-C C-l within my bugger, it says then "namespace auha.core" loaded, how do you then run auha.core/-main ?
16:11nvyuser> (auha.core/-main)
16:11nvyClassNotFoundException auha.core java.net.URLClassLoader$1.run (URLClassLoader.java:217)
16:11stuartsierrabobbrahms: Probably. I can't enumerate them here. Again, you could probably make it work. But it's going to be complicated and something that no one else is doing.
16:12bobbrahmsOK stuart. Thanks!
16:12stuartsierraYou're welcome.
16:13bobbrahmsif something specific comes to mind that would break this, I'd love to know about it. I'm pretty much a noob at clojure
16:15duck11231nvy: I would expect it to do this, but try requiring that ns first
16:16nvyduck11231: how would you do that?
16:16duck11231(require 'auha.core)
16:17nDuffbobbrahms: ...so, the usual approach is to just structure things such that the java can compile without the clojure
16:18nDuffbobbrahms: ...for instance, you can reference fns through vars which return objects implementing interfaces accessible only from Java code, avoiding the need for your Java to know about anything generated from compiling the clojure
16:18bobbrahmssure but wouldn't it be cool if you can refer to your clojure classes from your java code?
16:19nDuffNot really?
16:19nDuffUsing gen-class typically means you're doing something wrong
16:19nDuffso if you're doing things right, you can refer to your clojure fns, through vars, as-is.
16:19nDuff(well, "something wrong" meaning "something necessary for interop purposes")
16:19nDuff(but that you wouldn't do if you had enough control to avoid it)
16:19bobbrahmsright
16:23bobbrahmswithout gen-class, is there some way of using clojure to implement some interface, make an object and pass it around?
16:24bobbrahmsproxy?
16:24clojurebotproxy is <Chouser> proxy teases with its ease of use, then suddenly betrays.
16:24nDuffbobbrahms: gen-class isn't even the _preferred_ way to do that
16:24nDuffreify is ideal
16:24nDuffproxy if you can't use reify
16:24bobbrahmsreify? cool
16:24nDuffgen-class if you can't use proxy
16:25nDuff...if it's only implementing an interface, not a class, reify will be fine.
16:25amalloy&(.close (reify java.io.Closeable (close [this] (println 5))))
16:25lazybot⇒ 5 nil
16:27nvyok duck11231, and how to reload that namespace? C-c C-k doesn't do the trick
16:28bobbrahmsif I want to extend my java classes do I want to use gen-class?
16:28duck11231nvy: Not sure. I haven't fully made the switch to nrepl yet, but that was working when I tried it
16:28S11001001when I use gen-class, it feels so dirty that I have to make a separate library for the gen-class to keep it away from the nice code
16:28bobbrahmshahahaha awesome.
16:29nvyI have switched to the auha.core namespace already duck11231, could that be the reason? is there a way to come back to user> ?
16:29stuartsierraOne thing you can do is define interfaces in Java and implement them in Clojure with reify/deftype/defrecord.
16:29bobbrahmsis it difficult and/or wrong to create clojure based spring managed beans
16:29nvyjust assuming that nrepl is similar enough
16:30duck11231I think C-c M-n is the new C-c M-p and there-s always (in-ns 'user)
16:31S11001001bobbrahms: it's going to cut you off from config by annotations
16:31stuartsierraClojure supports annotations in gen-class and deftype, but the syntax is not documented except in unit tests.
16:32stuartsierra(Actually, not sure about gen-class. Definitely deftype.)
16:32nathanicbobbrahms: http://www.deepbluelambda.org/programming/clojure/building-ejbs-with-clojure
16:32nathanicnot quite spring but in that general direction
16:32duck11231I think it's time I swap out my "auto connect to slime" command with an "auto connect to nrepl"
16:33S11001001stuartsierra: sounds troublesome
16:34stuartsierraIt's certainly not worth the trouble of figuring it out, in my opinion. If you need annotations, just write Java.
16:34S11001001or scala, an open-source programming language designed with the cloud in mind :)
16:34nvythanks duck, I'll try it
16:35gfrederi`anybody coming to see rhickey tonight?
16:35bobbrahmsnot sure I really care about config by annotation. But practically, this is a spring app.
16:37wastrelhi
16:40scriptorgfredericks: whereat?
16:43bobbrahmsjust to be clear: when you guys say that gen-class is to be used as a last resort after reify and proxy, does this disdain extend into the use of the :gen-class parameter of ns?
16:46S11001001bobbrahms: yep
16:46bobbrahmsOK, cool. thanks
16:46thorbjornDXI'm trying to learn how recur works, In particular how it's used in last, any tips?
16:47dnolenbobbrahms: :gen-class in ns is standard if you're creating a main entry point for your app.
16:48bobbrahmsfor static functions is gen-class required?
16:48S11001001thorbjornDX: any experience in scheme?
16:49thorbjornDXS11001001: I poked through the homework for an intro to scheme course once
16:49thorbjornDXS11001001: idk if that counts as experience :P
16:49technomancyloop/recur is usually a sign that you're doing something really low-level
16:49S11001001thorbjornDX: did it cover named let, or (let lp (...)?
16:49technomancyyou probably won't need it when you're getting started
16:49thorbjornDXS11001001: yes
16:50thorbjornDXtechnomancy: I'm doing an exercise that requires me to get the last element in a collection without last
16:50S11001001thorbjornDX: imagine that every loop and fn creates a named let called "recur", that you are only allowed to call when the compiler can turn it into a goto without semantic change
16:50S11001001thorbjornDX: consider iterate instead :)
16:51thorbjornDXS11001001: okay, I'll check it out
16:51S11001001bobbrahms: is there a way to make static methods with gen-class, then?
16:57thorbjornDXS11001001: (iterate println [1 2 3 4 5]) tends to explode, does my function have to check for nil?
16:58bobbrahmsS11001001: I was assuming. in the :methods parameter you can have #^{:static true}
16:59S11001001,(take 10 (iterate rest [1 2 3 4 5]))
16:59clojurebot([1 2 3 4 5] (2 3 4 5) (3 4 5) (4 5) (5) ...)
16:59brainproxyat-at for scheduling? other recommendations?
17:00S11001001thorbjornDX: look what's in there thorbjornDX :)
17:00S11001001bobbrahms: interesting. I wonder what it does.
17:00thorbjornDXS11001001: ah, very cool. Thanks for the example.
17:03S11001001bobbrahms: though #^ is deprecated in favor of ^
17:03S11001001bobbrahms: which dates that example to pre-1.2
17:04gfredericksscriptor: chicago
17:38thorbjornDXS11001001: so now the last element of a list is a one element list containing the last element of the vector that I had before. Am I missing something?
17:39thorbjornDX,(take (count [1 2 3 4 5]) (iterate rest [1 2 3 4 5])))
17:39clojurebot([1 2 3 4 5] (2 3 4 5) (3 4 5) (4 5) (5))
17:42TimMc&(take-while seq (iterate rest [1 2 3 4 5]))
17:42lazybot⇒ ([1 2 3 4 5] (2 3 4 5) (3 4 5) (4 5) (5))
17:49konrIs there any particularly good resource on clojurescript you guys recommend?
17:51dnolenkonr: nothing besides what's available online at the moment - there's an O'Reilly book on the way.
17:51S11001001thorbjornDX: filter
17:51S11001001then...
17:57konrdnolen: thanks!
17:57konrThis tutorial looks pretty cool: http://clojurescriptone.com/
17:59technomancyif you're running leiningen from git, please pull the latest master
17:59technomancyI think we're ready to cut a preview9 release and want to make sure any issues are caught
18:00dnolenkonr: it is! though very specific to CLJSOne
18:00scottjdnolen: who's writing the cljs book?
18:00dnolenhttp://shop.oreilly.com/product/0636920025139.do
18:01Raynesdnolen: When do you think you might have a chance to take a look at that cljs -> node issue I had? Someone posted a patch that he didn't seem confident about, but some feedback would probably be great.
18:02dnolenRaynes: maybe? sometime this weekend - I looked over it quickly. Seems like just reordering the deps right?
18:02Raynesdnolen: Yep.
18:03RaynesOnce again, I'd help out, but I'm still sorting out CA stuff. :(
18:03dnolenRaynes: does the patch work fro you?
18:03RaynesI didn't apply it. I have no idea how to set up cljs without cljsbuild.
18:03RaynesI can give it a shot this weekend, I suppose.
18:05tomojRaynes: what I do is just symlink /vendor/clojurescript to my clojurescript clone, then in /project.clj :source-paths ["vendor/clojurescript/src/clj" "vendor/clojurescript/src/cljs"]
18:05dnolenRaynes: you just need to set up checkouts
18:05RaynesBleh.
18:06emezeskeRaynes: The info on how to do that is in wiki form: https://github.com/emezeske/lein-cljsbuild/wiki/Using-a-Git-Checkout-of-the-ClojureScript-Compiler
18:06emezeskeRaynes: :)
18:06RaynesYou aren't helping me get out of doing stuff.
18:07dnolenRaynes: no sirree
18:07cemerickHoly unrepeatable build, Batman.
18:07emezeskeHeh, I can't do that, but I can try to make it easier when you have to :)
18:08cemerickAdding a project.clj to the cljs source tree and then symlinking the whole mess to be a checkout dep of your project would avoid the :source-paths faffery, right?
18:10dnolencemerick: you tell us ;)
18:10cemerickdnolen: I can just barely rub two cljs sticks together at the moment. Be with you soon. :-)
18:11cemerickOn that note, it's screwy that I can grok the compiler and such, but the mechanics of things often escape me.
18:14RaynesnDuff: I do, but it is under a different name.
18:14nDuffAhhh.
18:14RaynesDon't ask.
18:16osenerhi everyone! I just pushed the initial commit of a helm source for nrepl
18:16osenerwould love to have some early feedback
18:16osenerhttps://github.com/osener/helm-nrepl/
18:17osener(I actually don't know elisp, not sure if it is apparent...)
18:18osenerhelm is a completion framework for Emacs btw
18:18oseneravailable actions are "insert symbol", "show documentation", "jump to definition"
18:18cemerickemezeske: BTW, do let me know what if anything I can do to make it so that lein-cljsbuild's REPL support can be significantly simplified. I'd hope it end up being a hook to add piggieback middleware and then delegate to leiningen.repl with some init expressions, etc.
18:18osenerI plan to add a namespace browser in near future
18:20emezeskecemerick: Ooh, the middleware being something that writes out javascript to connect to the port 9000 server or whatever?
18:22cemerickemezeske: Not at present; right now, Piggieback just makes it so that a cljs REPL can be hoisted on top of Leiningen (or any other nREPL-based tool). So, you'd get the terminal and I/O stuff out of your hair immediately, and hopefully benefit from cljs code completion when that lands in reply and lein.
18:22cemerickBut, I'm all for making this stuff easier and minimizing the aggregate amount of code needed to do so. :-)
18:22cemerickhttps://github.com/cemerick/piggieback if you haven't seen it
18:26emezeskecemerick: Ahh, I hadn't seen it, cool
18:26thorbjornDXS11001001: let me know if this is awful somehow: (fn lst [l] (first (first (filter #(= 1 (count %)) (take (count l) (iterate rest l))))))
18:27emezeskecemerick: I'll have to read up -- it's been a while since I gave much thought to repl stuff in cljsbuild. It is pretty bad right now.
18:28S11001001thorbjornDX: replace that filter #... with remove next, and the take is unnecessary
18:29cemerickemezeske: well, hopefully you can slash and burn a bunch of code in the process. Anyway, let me know what I can do to help along the way.
18:29emezeskecemerick: Sweet, thanks!
18:29S11001001thorbjornDX: there should be no calls to count left when you're done
18:30thorbjornDXS11001001: I'll give it a shot, thanks for the feedback
18:39Cr8psh, i reccommended a logging library the other day and now I need it and can't remember the name
18:39technomancytimbre?
18:39Cr8that was it
18:39SegFaultAX|work2Has anyone used Misaki?
19:02mefestoso i just switched from ubuntu to osx. i know nothing about osx and have been fumbling around all day. to get my clojure dev setup going i have installed xcode (cli tools), xquartz, and homebrew. through homebrew i installed emacs with the cocoa flag. is this a good option or is there a better one for me to try?
19:02brehautwait, to get clojure installed‽
19:03casionmefesto: that's the best option in my experience
19:03Cr8hm
19:03brehauthttp://emacsforosx.com
19:03Cr8getting a NullPointerException when lein tries to AOT compile my :main file
19:03brehautand when you try to run lein self-install for the first time, the OS should prompt you to install java
19:03mefestocasion: great, glad to hear i haven't wasted all day :)
19:04mefestobrehaut: already have java7 going and leiningen
19:04brehautthen emacsforosx should cover the rest for you
19:04casionmefesto: just install clojure mode, paredit, clojure
19:04casionand you're about done
19:04mefestobrehaut: awesome, thanks for the reference
19:04mefestocasion: yeah i have that plus nrepl going so i think im good
19:05mefestomy main concern was homebrew + emacs with cocoa flag
19:05casionmefesto: I find the homebrew emacs more useful with the NS extensions
19:05casionthan emacsforosx
19:05mefestocasion: NS ext?
19:05casionmefesto: --cocoa
19:05mefestoah i see
19:06coredhello everyone
19:06coredI'm new to clojure
19:06mefestoi was hesitant to get this machine but after using it all day im pretty happy. only minor gripe is that i miss having a right side control key
19:06coredand getting some problems with a piece of code, let me show you
19:07coredhttps://gist.github.com/3430574
19:07coredthat's the code
19:07coredand this is the error
19:07coredCompilerException java.lang.RuntimeException: No such namespace: clojure, compiling:(/home/homer/code/clojure/word.clj:2)
19:07coredany suggestion?
19:07mefestois it possible to remap the right side command and alt keys to mimic alt, ctrl respectively?
19:08coredis clearly that it doesn't find the clojure namespace but I thought that was part of the CLASSPATH is that exists in Clojure world
19:09Cr8mefesto: yes. Hit modifier keys in keyboard preferences: http://drop.crate.im/System_Preferences-20120823-160634.png
19:09nDuffcored: maybe you're thinking clojure.core?
19:09nz-Cr8: why are you using refer here?
19:09mefestoCr8: thank you!
19:09nz-d
19:09technomancycored: setting CLASSPATH is strongly discouraged
19:10nz-s/Cr8/cored/
19:10mefestoCr8: oh this is system wide? i was hoping for something emacs only
19:11coredtechnomancy: I see
19:11corednz-: I'm following this series http://writingcoding.blogspot.com/2008/06/tokenization-part-4-organization.html
19:11corednz-: he use refer there, when talking about code organization
19:12technomancywow, over four years old
19:12coredtechnomancy: the series?
19:12coredwell yes
19:12coredbut I thought that probably stuffs haven't change that much
19:12cored:-)
19:12RaynesYou've probably found the worst possible thing you could read.
19:12brehauttechnomancy: blogs are always kept relevant!
19:12technomancythat's like from before the dawn of time in clojure years
19:12Raynes4 years ago Clojure pretty much didn't exist, cored. Everything has changed.
19:13coredshits
19:13Cr8huh
19:13Cr8i apparently can't AOT compile a ns that uses timbre :{
19:13wmealing_the logger ?
19:13coredI just wanted something like https://github.com/thoughtbot/trail-map/blob/master/trails/ruby.md
19:13wmealing_Cr8: man i was looking forward to using that..
19:13coredbut for Clojure
19:14brehautits not just from the dawn of clojure time, it predates technomancy's announcement on the ML that he had made everything better
19:14Cr8well i might be doing something exceedingly dumb
19:14Cr8I haven't figured it out yet.
19:14coredsomething to follow up
19:15Frozenlo`"Error: problem requiring leiningen.js hook
19:15Frozenlo`Exception in thread "main" java.io.FileNotFoundException: Could not locate leiningen/js__init.class or leiningen/js.clj on classpath:" What's this leiningen.js?
19:15wmealing_Cr8: if you do.. let me know because i am keen.
19:15Raynestechnomancy: https://groups.google.com/d/msg/clojure/gBoCUXq37fM/841iHii--2IJ You were so cute back in 2008.
19:15Raynes2009*
19:15technomancyRaynes: the chat logs from the day I joined this channel are a real blast too
19:16Raynestechnomancy: Gib
19:16technomancy"what's this classpath thing? it smells like bullshit."
19:16brehauthaha
19:16coredso, guys what do you suggest for a beginner ?
19:17coredgrab a book and start from there?
19:17mefestolol
19:17technomancy~volkmann
19:17clojurebotvolkmann is probably the best free introduction to the Clojure language: http://java.ociweb.com/mark/clojure/article.html
19:17technomancy~beginner's guide
19:17clojurebotCool story bro.
19:17technomancy~brief beginner's guide
19:17clojurebotI don't understand.
19:17RaynesClojure Programming would be a great place to start if you were willing to throw some green at learning Clojure.
19:18coredRaynes: what :-/
19:18technomancyif you want something free, try the volkmann tutorial or the brief beginner's guide
19:18technomancyotherwise, clojurebook.com
19:18RaynesThe volkmann article is ancient but the troll under the bridge keeps it up to date, it's pretty amazing.
19:18coredI will read everything
19:18coredI find :-)
19:18RaynesExcept blog posts.
19:18coredok, except blog posts
19:18RaynesSeriously, ignore them all. Even if they're mine. Especially if they're mine.
19:18coredwell if they are from this year I think that's ok, right Raynes ?
19:19RaynesMaybe.
19:19coredI was considering in getting, the joy of clojure, practical clojure and programming clojure
19:19RaynesMake sure you avoid stuff by brehaut.
19:19brehautif a blog says its from 2012 its wrong, if its earlier, its wrong and out of date
19:19brehaut(inc raynes)
19:19lazybot⇒ 15
19:19jkkramerI learned a lot from watching the early clojure / rich hickey videos. not sure how dated they are now, though
19:19Raynes<3
19:19coredbrehaut: :-)
19:19RaynesAs dated as dated gets.
19:19coredbrehaut: how can you anybody be up to date with Clojure?
19:20RaynesHow can that sentence be reworded to make sense?
19:20Raynes:p
19:20coredhaha
19:20coredhow can anybody be up to date with Clojure, now a days
19:20thorbjornDXRaynes: is Clojure Programming (the book) any good?
19:20RaynesThey can be Rich Hickey.
19:20SegFaultAX|work2thorbjornDX: It's very good, yes.
19:21RaynesthorbjornDX: It is the latest and greatest. I haven't read the whole thing personally, but I trust cemerick's ability to make awesome.
19:21Frozenlockcored: You could consider lurking here. I'm always amazed by the little gems that can be discovered. Just by checking other problems/solutions :)
19:21SegFaultAX|work2thorbjornDX: Alongside Joy of Clojure.
19:21splunkProgramming Clojure is also really good
19:21thorbjornDXSegFaultAX|work2: Okay, I'm digging into chapter 1 of prog clojure, I'll have to check out the other one you suggested
19:21cemerickRaynes: blasphemer!
19:22coredFrozenlock: :-)
19:22splunkI'm waiting for a book that goes beyond just introducing the language
19:22coredI found this: http://learn-clojure.com/
19:22Raynessplunk: It's called The Joy of Clojure.
19:22RaynesAnd it has been available for quite a while now.
19:22Cr8mm
19:22Cr8its not timbre, its spyglass
19:22SegFaultAX|work2splunk: What are you looking for, specifically?
19:22splunkRaynes: eh...it didn't change my perspective as much as SICP for example
19:23splunkThese are good questions. Thinking...
19:23coredalso, this http://www.youtube.com/watch?v=Aoeav_T1ARU&amp;list=PLAC43CFB134E85266&amp;feature=plcp
19:23SegFaultAX|work2splunk: SICP is a completely different kind of book with a completely different goal.
19:23coredbut those videos are from three years ago, so probably won't do me any good
19:23shawnlewisis there convention for naming locals that would collide with something that's already in the current namespace? For example in python I might name a local "file_" instead of "file"
19:24technomancycored: the videos are generally more abstract, and thus a lot less likely to get out of date
19:24technomancycored: it's the "type this stuff in at the command line; use this IDE integration" stuff where everything breaks horribly
19:24brehautnot to mention people doing videos / presentations put more work into them than blog posts often get
19:24coredtechnomancy: I see, I found a presentation from Neal Ford I thought he was into Scala but now he is with Clojure, one of my personal heroes :-)
19:25SegFaultAX|work2Argh, Scala.
19:25Raynes$kill
19:25lazybotKILL IT WITH FIRE!
19:27coredhehe
19:27coredwell I saw him talking about it, don't know where but he was
19:27coredbut now he is talking about a plan for enterprise domination with Clojure, which is cool
19:30ToxicFrog...wow, I had no idea Scala was so reviled here.
19:30Raynestechnomancy: http://en.wikipedia.org/wiki/Leiningen_Versus_the_Ants Says that leiningen uses ant.
19:30RaynesToxicFrog: It isn't.
19:30technomancyRaynes: hah; I hope not
19:31Raynestechnomancy: No, it seriously does.
19:31technomancyRaynes: you mean http://en.wikipedia.org/wiki/Leiningen_(software) I think
19:31Raynestechnomancy: Look under 'See also'
19:31technomancyoh, heh
19:31technomancyyou're right
19:31coredwhat do you guys think about the clojure katas?
19:31technomancyRaynes: that's dumb; it should just link to the disambiguation page at the top I think
19:32technomancyfrom the talk page: "Awesome story... just awesome. I hope someone makes a defend the castle type game of this story."
19:55davejacobsdid compojure get rid of magic variables?
20:00SegFaultAX|work2I'm looking for a function similar to group-by, except it simply paritions a collection into 2 lists: those true for the predicate, and those false for the predicate.
20:00SegFaultAX|work2Does such a thing already exist?
20:03shaungilchristnot that I am aware of - but if you create it will you please call it dichotomize-by
20:04wmealing_would partition-by work ?
20:04SegFaultAX|work2shaungilchrist: Deal.
20:04duck1123davejacobs: I'm not sure what it's called, but I think there's a fn that gives access to the request
20:05duck1123that may only be in noir, i don't use it
20:05shaungilchristare clojurescript questions appropriate here?
20:05nDuffshaungilchrist: Yes.
20:05shaungilchristI have latest lein and it no longer has a bootstrap task so the clojurescriptone instructions do not work
20:06shaungilchristshould I just get older version of lein or is there a newer way of accomplishing same thing?
20:06nDuffshaungilchrist: ...you've hit on part of why folks tend to keep "lein1" around, even if under a different command.
20:06tmciverSegFaultAX|work2: there used to be something like that in a contrib library but you could do something like ##((juxt (fn [x] (filter even? x)) (fn [x] (filter odd? x))) [1 2 3 4 5])
20:06lazybot⇒ [(2 4) (1 3 5)]
20:07technomancyshaungilchrist: using clojurescript without cljsbuild is kind of a pain
20:08shaungilchristyeah I just got lein 1.6 and bootstrap is running fine now
20:09shaungilchristchecking out lein-cljsbuild now though
20:09tmciverSegFaultAX|work2: amalloy's is even better: (def split-pred (juxt filter remove))
20:10tmciverSegFaultAX|work2: Ah, it was called 'separate' in clojure.contrib
20:11SegFaultAX|work2tmciver: I'm not sure I understand (juxt filter remove)
20:11technomancyoh, you're in for a treat
20:11technomancyjuxt is the best
20:11SegFaultAX|work2technomancy: I understand juxt, I think.
20:12SegFaultAX|work2But I don't understand that use of filter.
20:13SegFaultAX|work2Oh wait, I understand.
20:13tmciverSegFaultAX|work2: you'd have to pass it your pred and your collection: ##((juxt filter remove) even? [1 2 3 4 5])
20:13lazybot⇒ [(2 4) (1 3 5)]
20:13SegFaultAX|work2That's pretty cool.
20:14SegFaultAX|work2,((juxt filter remove))
20:14clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: core$filter>
20:17SegFaultAX|work2Juxt is really awesome.
20:17davejacobsduck1123: sorry, missed your msg
20:18davejacobsi think if you use compojure.handler/site over your app-routes, they are supposed to get the magic variables
20:18davejacobshowever, that's not working out for me. (looks from the source code like it should)
20:18davejacobsthe Internet-at-Large says that magic variables should be bound inside the defroutes macro by default...
20:24rafikHello, I have what seems like a simple question but I can't figure it out. I need to get the values from a map in a specified order. So something like (get-values map [:a :b]). But I need the values return to be in that order. Any hints?
20:26imeredithrafik: usually maps are sorted because it helps with lookup time
20:26imeredith(im not a clj person so i could be wrong with clojure)
20:27tmciverI don't think you can rely on any ordering with a normal clojure map.
20:27tanzoniteblackrafik: clojure maps are either based on a hash-map or a sorted-map
20:27Frozenlo`rafik: If you really just want to get them in a particular order: (map #(get MAP %) [:first-key :second-key :third-key...])
20:28rafikah ok so get can take a vector of keys
20:28jeremyheiler,(map (partial get {:a 1 :b 2}) [:a :b])
20:28clojurebot(1 2)
20:28jeremyheilerdoh, Frozenlo beat me to it
20:28rafikoh nvm
20:28tmciver,(map {:b 2 :c 3 :a 1} [:a :b :c])
20:28clojurebot(1 2 3)
20:29jeremyheileroh yea, maps are functions too
20:29Frozenlo`Can't believe I forgot that.
20:29rafiktmciver: Oh wow, that's incredibly simple and makes complete sense
20:29rafikThank you guys :)
20:30rafikjeremyheiler: Thank you!
20:31SegFaultAX|work2How can I improve my implementation of quicksort? https://www.refheap.com/paste/4597
20:32wmealing_shaungilchrist/Segfault: i was waiting for a compile. is this what you meant ? http://hastebin.com/pomorececi.coffee
20:32wmealing_SegFaultAX|work2:rather
20:32rafikCould someone actually quickly explain how that worked? How do you use map on a map like that. They are functions?
20:33Frozenlockrafik: Keys are functions of a map, and vice-versa.
20:33jeremyheiler,({:a 1} :a)
20:33clojurebot1
20:33jeremyheiler,(:a {:a 1})
20:33clojurebot1
20:33jeremyheiler(get {:a 1} :a)
20:33tmciverSegFaultAX|work2: I don't think you actually need that juxt separate, try split-with.
20:33jeremyheiler,(get {:a 1} :a)
20:33clojurebot1
20:34FrozenlockMagnificent, isn't it? :P
20:34tmciver,(doc split-with)
20:34clojurebot"([pred coll]); Returns a vector of [(take-while pred coll) (drop-while pred coll)]"
20:34jeremyheileryes yes
20:34rafikFrozenlock: Oh neat! Thanks for the help
20:35SegFaultAX|work2,(split-with (partial < 10) (shuffle (range 20)))
20:35clojurebot[(18) (10 1 14 13 11 ...)]
20:35tmciverSegFaultAX|work2: hmm, no, that's not right. disregard me.
20:35FrozenlockI don't think I've used `get' a single time since I discovered this relation.
20:35jeremyheilerFrozenlock, I've had to use it when I'm stuck with string keys
20:35FrozenlockWell except just here.
20:35SegFaultAX|work2tmciver: I made that assumption, too. I realized I needed a partition function. Unfortunately none of the existing partitions match this use case.
20:36SegFaultAX|work2tmciver: That's why I asked if this function already existed.
20:36Frozenlockjeremyheiler: I usually do ((keyword "a") {:a 1}) o_O
20:36SegFaultAX|work2(Didn't want to re-invent what might already be there by a different name)
20:36tmciverSegFaultAX|work2: but you're already re-inventing sort with that function. ;)
20:37SegFaultAX|work2tmciver: Don't tell anyone. :)
20:37jeremyheilerFrozenlock, I mean I would have to do (get {"a" 1} "a")
20:37tmciverYour secret is safe with me.
20:37FrozenlockOh, string as a key!
20:37FrozenlockWhy the hell? :)
20:38Frozenlock,(name :so-easy-to-get-string-later)
20:38clojurebot"so-easy-to-get-string-later"
20:39jeremyheilerheh, it's not always worth translating the map of string keys to keyword keys.
20:40FrozenlockYES! Yes it is! ArrrAAARRR!
20:40SegFaultAX|work2Is there a function specifically to turn a list of char into a string? Eg (apply str (\f \o \o))?
20:40jeremyheilerlol
20:40SegFaultAX|work2Seems like a common enough usecase.
20:40tmciverSegFaultAX|work2: nope, that's it.
20:40SegFaultAX|work2Boo.
20:41tmciverat least, I don't think there is.
20:41Frozenlock(defn stringify [& rest] (apply str rest))
20:41jeremyheilerstr using a StringBuilder, so it's cool
20:41SegFaultAX|work2Frozenlock: I know how to do it. Again, I just don't want to re-invent something that might already exist.
20:41Frozenlockjeremyheiler: bullseye, again.
20:41jeremyheileruses*
20:43FrozenlockWasn't there `logic', or something like it, to check if we where reinventing the wheel?
20:44SegFaultAX|work2Frozenlock: Is it illogical to assume that such a thing might already exist?
20:44duck1123it doesn't have all the wheels, but check out kibit
20:45FrozenlockSegFaultAX|work2: No, I mean, the package `logic'
20:45FrozenlockThat wasn't an insult at all :)
20:45Frozenlockhttps://github.com/clojure/core.logic (but I don't know how to use it)
20:47FrozenlockYeah, achievements, I has zhem!
20:56mefestoI'm trying to get color-theme working on my system (OSX 10.8). I
20:56mefesto installed emacs with homebrew and everything else seems to be fine.
20:56mefesto I'm unable to install any other color-theme packages from marmalade.
20:56mefesto It complains that I have color-theme 6.5.x when I need 6.6.x. Any
20:56mefesto ideas (I'm new to OS X)?
20:56mefestough, im sorry about that :(
20:56mefestocut & paste gone wrong.
20:58clj_newb_27892how do I use macros in clojurescript
20:58clj_newb_27892this is baffling me
20:58clj_newb_27892so do I define them in a *.cljs file or a *.clj file, and do they go in cljs-src/* or clj-src/* ?
21:00emezeskeclj_newb_27892: You define them in a *.clj file
21:00clj_newb_27892where do I put them?
21:00emezeskeclj_newb_27892: They can go in clj-src OR cljs-src, as long as they're on the classpath you're good
21:01clj_newb_27892hmm
21:01clj_newb_27892okay
21:01clj_newb_27892let me try
21:01emezeskeclj_newb_27892: And make sure you use :require-macros instead of :require
21:01clj_newb_27892I'm using :use-macros
21:03boyscaredhow does one increase the timeout when running `lein repl'? my slow computer always gets REPL timeout errors :(
21:04clj_newb_27892what is this "lein timeout" ?
21:04clj_newb_27892I've never heard of it.
21:05boyscaredwhenever i run `lein repl' on my netbook, i get "REPL server launch timed out."
21:05boyscaredit's just because it takes so long
21:09boyscarednevermind, found it... it's :repl-options {:timeout x}
21:15clj_newb_27892this is a question about fishing, not a single fish: how do I get lein to tell me what the latest version of clojruescript is? I'm currently using [org.clojure/clojurescript "0.0-1236"] ... and I think this is part of my woes.
21:16jeremyheileryou can look it up on search.maven.org
21:16jeremyheilerhttp://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.clojure%22%20AND%20a%3A%22clojurescript%22
21:17clj_newb_27892why does the 1450 branch not show up on my "lein search clojurescript" ?
21:21clj_newb_27892okay
21:21clj_newb_27892somethign appears to work
21:22clj_newb_27892thanks :-)
21:23jeremyheilerit shows up for me. maybe you need to refresh your local index? anyway, glad stuff is working.
21:25clj_newb_27892classpath, clean, compile, deploy, deps, help, install, interactive, jar, javac, new, plugin, pom, repl, retest, run, search test, test! trampoline, uberjar, upgrade, version <-- which one of these updates my local index?
21:25clj_newb_27892oh, lein search --update hehe
21:26clj_newb_27892lein search clojurescript Warning: couldn't download index for http://repo1.maven.org/maven2
21:26clj_newb_27892hmm mauyb ethat is why it does not work for me
21:26clj_newb_27892lein version Leiningen 1.7.1 on Java 1.7.0_05 Java HotSpot(TM) 64-Bit Server VM
21:26clj_newb_27892what version of lein are you using?
21:27jeremyheiler2.0.0-preview8
21:32FrozenlockIs there any other in-browser REPL?
21:32Frozenlock(except himera)
21:39ibdknoxwow
21:39ibdknoxdid you guys see the thread on fogus's blog post about snippets?
21:41amalloyibdknox: i saw it this morning with about ten comments, has it exploded further?
21:41ibdknoxamalloy: it's at 15, but you probably saw most of it
21:42ibdknoxI'm just astounded by the bile in rich's responses
21:42amalloyi agree, it's nuts
21:42ibdknoxfogus is absolutely correct
21:42ibdknoxit is very important if only to provide a frame for what someone is looking at
21:42amalloyit's trivial to write a compelling snippet for clojure
21:42ibdknoxI completely disregarded clojure for several months because of clojure.org
21:42shaungilchristI get the feeling his bile is not directed at fogus but more at the general dumbing down/selling of languages
21:43ibdknoxshaungilchrist: it's not a matter of dumbing it down, its a matter of providing a reference point
21:43Frozenlockibdknox: could you post the link?
21:43ibdknoxhe's clearly never marketed anything
21:43ibdknoxFrozenlock: http://blog.fogus.me/2012/08/23/minimum-viable-snippet/
21:43FrozenlockThank you very much!
21:43ibdknoxdatomic suffers from a similar fate :(
21:44Frozenlockdatowhat? :)
21:44ibdknoxlol
21:44shaungilchristyeah I actually agree - if I wasn't already "into" lisp clojure would not entice me
21:46clj_newb_27892is Rich Hickey the most brilliant systems engineer since the turing award winners?
21:46ibdknoxlol
21:48clj_newb_27892I'm not kidding. Clojure has the brilliance of: functional data structures that actually works; the sending of agents _functions_ rather than _values_ is brilliant. I haven't figured out the brilliance of datomic yet, but I suspect it's sheer brilliance.
21:48clj_newb_27892That said, I don't think he'll win the turing given it's not "theoretically new enough"
21:51clj_newb_27892that said, I thikn fogus is absolutely right on the minimum vialbe snipplets
21:52amalloypersonally i'd love to see the solution to project euler #2 (sum of even fibonacci numbers less than four million) on clojure.org. the simplicity is so captivating
21:53amalloyi always use that to introduce folks to the dramatically reduced intermingling of "business logic" with bookkeeping code that clojure and FP bring
21:54FrozenlockLearning Clojure is for the masochists. No clear example on clojure.org. Still a (relatively) small community, absolutely no great tutorial to get started on the spot. (You can't get someone started on Clojure by telling him "Oh just use Emacs." If he's not already a user, that's just insulting.) Then there's the eternal `contrib' found in so many examples, yet which is now non-existent. Oh and everything assumes that you know java
21:54Frozenlockjavascript for cljs.
21:54FrozenlockI am a masochist.
21:55Frozenlockibdknox: I disregarded clojure for several months because of this: http://www.loper-os.org/?p=42
21:56clj_newb_27892Frozenlock: I thought learning Clojure was hard. They I tried writing a realtime webchat in ClojureScript w/ websockets despite not knowing CSS, HTML, JavaScript, or web standards.
21:57clj_newb_27892ClojureScript's code is the documentation.
21:57clj_newb_27892oh, I forgot to mention _via_ Google Closure library ... taht made it extra fun
21:57ibdknoxFrozenlock: wow.. that is impressively angry
21:57clj_newb_27892[/end bragging]
21:57RaynesFrozenlock: That guy is the biggest running joke we have in the Clojure community.
21:58FrozenlockRaynes: The guy from LoperOS?
21:59casion"The Clojure user who is missing some routine or other will run crying to Java for help"
21:59casionahahahaha
21:59RaynesFrozenlock: Indeed.
21:59casionthis post is hilarious… it's sattire right?
21:59casionI'm just going to assume it is so I can sleep easy
21:59TimMccasion: Hard to tell sometimes with LoperOS.
22:00Frozenlockclj_newb_27892: Clojure code is clear. However the slope is quite steep for those in this channel who are not geniuses, ie me.
22:00casionI'm pretty far removed from every clojure is, I don't use java much, I've never used lisp, I've never programmed functionally
22:00casionbut I find clojure code very easy to read
22:00clj_newb_27892truth be told, I started with haskell before Clojure ... then decided, at first, taht Clojure was not learning because Haskell convinced me I was not smart enough for functional programming
22:01casionsolving things in clojure on my own though..
22:01clj_newb_27892then, by accident, I realized Clojure was closer to scheme than Haskell in the IQ-required category
22:01casionI find that very fiddicult due to the afforementined reasons
22:01Frozenlockcasion: he has a valid point. How do you parse numbers in clojure? You call an obscure java method :)
22:02FrozenlockWell obscure for me at least.
22:02amalloy&(read-string "23490235")
22:02lazybot⇒ 23490235
22:02FrozenlockWut
22:03FrozenlockWait what....
22:03Iceland_jackCouldn't `int' also parse strings into integers though? E.g. (int "242" 9) ⇒ 200
22:03amalloyIceland_jack: couldn't "+" implicitly accept strings as well? you have to draw the line somewhere
22:03ibdknoxFrozenlock: I think that is because Clojure has not yet been correctly presented for beginners. Not because of the language itself
22:04Iceland_jackI suppose, but there is a reason why + doesn't accept strings as well
22:04amalloyand same for int, of course
22:04Iceland_jackWell + accepting strings and integers would make it non-associative, i.e. (+ "hi" 2 5) could just as well return "hi7" and "hi25"
22:04Frozenlockamalloy: Omg I love you! I don't know why, everyone I saw was always using float.parse or something like that!
22:05FrozenlockI won't feel dirty anymore!
22:05TimMcFrozenlock: read-string is a little weird for that, though.
22:05TimMc&(doc *read-eval*)
22:05lazybotjava.lang.SecurityException: You tripped the alarm! *read-eval* is bad!
22:06TimMcCareful with read on user input.
22:06amalloyIceland_jack: i didn't imagine it would perform string concatenation. (+ "3" 5) could easily return 8
22:06Frozenlockibdknox: Don't get me wrong, the language is GREAT. I'm doing more with it than I would with anything else. But some corner can be... wilder. Places where the underlying language isn't totally abstracted away.
22:07amalloybut it doesn't, because that would be bad, just like int being loose about what types it accepts
22:07Iceland_jackHm maybe, I just feel something like Python's `int' is really the way to go
22:08FrozenlockI don't want to imagine how it was before leiningen....
22:08Iceland_jackI prefer Clojure to something like Common Lisp by a mile but I dislike the amount of Javaisms at times, Integer/parseInt…
22:08brehautIceland_back: type(int) #=> <type 'type'>
22:09brehautIceland_jack: so the equivalent in clojure is to use javas Integer class
22:09brehaut,(Integer "123")
22:09clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Expecting var, but Integer is mapped to class java.lang.Integer>
22:09brehautbah
22:10FrozenlockOh.. `read-string' doesn't exist in cljs yet :(
22:10brehaut,(Integer. "123")
22:10clojurebot123
22:10Iceland_jackHm, only that doesn't work with different bases
22:11brehaut,(Integer/parseInt "AB" 16)
22:11clojurebot171
22:11brehautits not rocket surgery; just look at the javadoc
22:12Iceland_jackYeah I know how to do it :) it's an aesthetic nitpick
22:13brehauti have a nitpick with python not allowing unboxed ints, so lets call it even ;)
22:13Iceland_jackFair enough
22:14Iceland_jackClojure is a beautiful language, and the Java interop is a(n almost) neccessary part of it
22:17clj_newb_234wtf ... is (:selector hashmap) broken in clojurescript? i.e. (def x {:first "Alexander" :last "the Great"}) (:first x)
22:18tomojincidentally (int "3") works in cljs :/
22:18tomojbecause (Math/floor "3")
22:19tomojalso (= (+ 1 "1") (+ "1" 1) "11") ...
22:20tomoj(pos? "1")
22:20ibdknoxclj_newb_234: no, that's not broken
22:21clj_newb_234ibdknox: it is broken for me
22:21clj_newb_234what version of clojurescript are you using?
22:21clj_newb_234i'm using 0.0-1450
22:21clj_newb_234it worked back when I was using 0.0-12??
22:21lazybotclj_newb_234: What are you, crazy? Of course not!
22:21ibdknoxI'm using something around there
22:22ibdknoxI track master, but I'm a little behind
22:22ibdknoxclj_newb_234: exact code?
22:22clj_newb_234let me produce a minimal example with corresponding javascript
22:23clj_newb_234ibdknox: http://pastebin.com/zK6HFVAz
22:24clj_newb_234Error: Uncaught TypeError: undefined is not a function
22:24clj_newb_234I need to becareful here. If not, I might end up being useful to the clojure community rather than being a leech.
22:25clj_newb_234I ahve no optimization flags; I do have :pretty-print true
22:25Frozenlockclj_newb_234: Works for me.
22:25clj_newb_234Frozenlock: can you pastebin the generated javascript code you get?
22:25FrozenlockNo, I simply tested it in my REPL...
22:25ibdknoxclj_newb_234: what line is that error on?
22:26clj_newb_234Frozenlock: We're testing ClojureSCRIPT, not Clojure ...
22:26FrozenlockYes, my cljs repl
22:26clj_newb_234ibdknox: line 116 -- should I paste the entire genrated file?
22:27ibdknoxclj_newb_234: I'm more wondering which of the two generated lines it's on
22:27clj_newb_234oh; the "return" line
22:27ibdknoxclj_newb_234: the first call or the second?
22:27clj_newb_234the second call
22:27ibdknoxswap the order of the two call
22:27ibdknoxs
22:27ibdknoxand see what happens
22:28clj_newb_234it still dies on the (:first x) line
22:28tomojso, what, theKeyword.call is undefined?
22:28ibdknoxcljs.core.Keyword doesn't exist?
22:28clj_newb_234tomoj: I believe the problem is trying to use th ekeyword as a function.
22:29clj_newb_234ibdknox: how can I test taht?
22:29ibdknoxusing chrome?
22:29clj_newb_234 (js/console.log "printing keyword") (js/console.log cljs.core.Keyword)
22:29clj_newb_234outputs "undefined"
22:29clj_newb_234yes, using Chrome
22:30ibdknoxdo lein cljsbuild clea
22:30ibdknoxn
22:30ibdknoxsounds like your core.cljs got hosed somehow
22:30tomojhow would a Keyword have a call anyway?
22:31clj_newb_234restarting web server ....
22:31clj_newb_234(:keyword x m) should ge equiv to (get m :keyword)
22:31tomojI thought implementors of IFn don't get auto-promoted to real js functions
22:31clj_newb_234still does not work
22:32amalloytomoj: dnolen added some tricks in the compiler, so that calling a keyword literal as a function is extra-smart somehow. i don't recall the details
22:32clj_newb_234same error: cljs.core.Keyword is apparently still undefined
22:32clj_newb_234what version of clojurescript are you guys using?
22:32tomojalso I notice in my core.cljs (deftype Keyword [k] IFn (invoke [_ coll] ..))
22:32clj_newb_234I'm happy to upgrade. :-)
22:32tomojbut IFn has only -invoke
22:32tomojpeculiar...
22:33FrozenlockI don't remember downloading any particular version... is it contained in cljsbuild?
22:34clj_newb_234hmm, I'm unforunately not using cljsbuild
22:34FrozenlockNo repl an no cljsbuild o_0 you are courageous!
22:35tomojcljsbuild 0.2.5 depends on 0.0-1450
22:35ibdknoxclj_newb_234: why aren't you using cljsbuild?
22:35clj_newb_234i hacked my system so taht when I hit ctrl-l in VIM, cljsbuild is called (via require cljs.build), and then the web browser is remotely restarted
22:36ibdknoxclj_newb_234: just for kicks and giggles, turn on simple optimizations
22:36clj_newb_234actually, after I nuked .repl
22:36clj_newb_234something else is broken,
22:37clj_newb_234{return cljs.core.apply.call(null,Array.,cljs.core.map.call(null,clj__GT_js,x)); (core.js line 68)
22:37clj_newb_234so your intuition is right, something is wront with cljs core
22:37tomojamalloy: I see the bit that emits new Keyword(...).call, but not how Keyword gets a call method
22:44clj_newb_234hmm, the following is intereting:
22:44clj_newb_234WARNING: Wrong number of args (0) passed to cljs.core/array at line 115 file:/Volumes/ramdisk/crfx/lib/clojurescript-0.0-1450.jar!/cljs/core.cljs
22:44clj_newb_234wtf, is 1450 broken?
22:45clj_newb_234I'm using clojure 1.4.0
22:45mindbender1while I was learning clojure I looked up to a number of people. But now it's clearer to me who's who and those who actually know what they are doing and why they are in clojure in the first place
22:46clj_newb_234hmm
22:46clj_newb_234I havefound an offentind pieces of code (wrhtten by me)
22:46clj_newb_234(apply js/Array. (map ...))
22:47clj_newb_234apparently Js/Array. is not the right way to construct an aaray in JavaScript
22:47clj_newb_234how do I create a JavascriptArray ?
22:47ibdknoxarray
22:47ibdknoxit's a core function
22:48tomojah, I see, extend-type (which is called by deftype) notices IFn and sets .call and .apply on the prototype
22:48clj_newb_234this is completely unsatisfying: but eerything works now
22:48clj_newb_234I really wish I knew _wtf_ I did incorectly
22:49Frozenlockibdknox: Do you know if there's any plan to integrate a function similar to your clj->js from jayq in cljs.core?
22:50ibdknoxI dunno
22:50ibdknoxthere should be :)
22:50ibdknoxdnolen is the man to talk to
22:50ibdknoxor just file an issue
22:50tomojI heard someone say that it is not provided because there is no generally correct answer
22:50ibdknoxmy version from jayq recently became incorrect though
22:51FrozenlockHow comes? .core changed?
22:51ibdknox.strobj is not guaranteed to be there anymore
22:51ibdknoxsince we have for realz persistent datastructures now
22:53Frozenlocktomoj: well clojure is almost synonymous with maps. Something MUST be able to convert it to javascript compatible data.
22:53Frozenlockibdknox: As long as I don't update I'm safe :)
22:53tomojyou may be able to write a conversion function which satisfies you
22:53tomojmaybe ibdknox's would satisfy you
22:54tomojthe claim is something like that there is no one obvious solution that will satisfy everyone
22:55clj_newb_234dumb question: is there a way to tell JavaScript: "When I read an undefined variable, don't give me nil. Give me a BIG RED WARNING"?
22:55clj_newb_234this would save me an infinite amount of debugging time
22:55clj_newb_234for some value of infinite
22:56tomojI think you can get that by wrapping your code in `(function(){"use strict";<CODE>})()`
22:56Frozenlocktomoj: perhaps. I don't know js, there might be other things than json and arrays that could hold the data as well. Still, Maps are a big part of clojure. If you can't use them easily, it's a big handicap.
22:57clj_newb_234tomoj: how do I do that in clojurescript?
22:58tomojthere is no better way I know of than e.g. a shell script that adds that wrapper to the compiled output
22:58tomoj(which can be called in cljsbuild's :notify-command
22:58clj_newb_234to every *.js file in public/out/ ?
22:59tomojif you use cljsbuild with :output-to you will only get one file
22:59tomojalso I've no clue whether the generated code is strict-friendly..
23:03tomojand even if you have multiple files you probably only need the strict wrapper in the main file that contains your entry point
23:04FrozenlockAnyone tried this? https://github.com/bodil/catnip I'm too lazy to try it myself....
23:05clj_newb_234post it as a task to mechanica turk
23:09yankovanyone knows how to achieve this? (set! (symbol k) 32)
23:09yankovneed to set a value of var where name of var stored in k
23:10brehautyankov: why are you wanting to set vars programmatically?
23:11RaynesStep one: tell you how you don't really want to do this
23:11RaynesStep two: tell you how to do this
23:11yankovbrehaut: I want to write a simple data structure server as a learning expretiment
23:11RaynesStep three: tell you again how you don't want to do this.
23:12brehautyankov: have you considered having a map of keywords to values in an atom?
23:12amalloybrehaut: probably symbols to values, imo, but i guess we don't know enough context to be sure
23:13yankovbrehaut: yes, but I thought i won't be able to have a lot of keywords in a single map? would it be efficient?
23:13brehautlets leave efficency aside; avoiding madness is a better first priority
23:13yankovlike could I have millions of keys
23:13amalloyyankov: a namespace is just a map too
23:14yankovamalloy: hm.. really?
23:14yankovinteresting..
23:15amalloyit's not an IPersistentMap, but it's not magic either. demanding random access for a million keys is a slight pain either way
23:15amalloybut maps are very fast; just worry about solving your actual problem, not invented subproblems like efficiency
23:15yankovbut what would be a right way to approach it. say i wanna be able to store millions of keys
23:15yankovgotcha.. I'll try to dig this way. with maps
23:20brehaut,(count (time (into {} (map (juxt identity identity) (range 1000000)))))
23:20yankovoh, let me try :)
23:20FrozenlockThis time I won't fall for it.
23:20amalloyyou may not make it in the sandbox time limit, brehaut
23:21clojurebotExecution Timed Out
23:21brehautamalloy: looks like it takes about 5 seconds locally
23:21brehauti wasnt sure what clojurebots limit is
23:21yankovtook 2 seconds for me
23:22yankovdoes clojurebot eval stuff
23:22yankov,(+ 1 1)
23:22clojurebot2
23:22yankovnice
23:22amalloy&(let [m (time (into {} (map (juxt identity identity) (range 1000000))))] (time (count (assoc m 10 20)))
23:22lazybotjava.lang.RuntimeException: EOF while reading, starting at line 1
23:22brehautyankov: the number it gives isnt especially useful; if its a hot piece of code the JVM will reoptimize it and it will start running a bunch faster
23:22amalloy&(let [m (time (into {} (map (juxt identity identity) (range 1000000))))] (time (count (assoc m 10 20))))
23:22lazybot⇒ "Elapsed time: 2751.355012 msecs" "Elapsed time: 285.904236 msecs" 1000000
23:23tomojhuh
23:23amalloy2.5s to build the map makes sense, but 0.2s to update it seems really high
23:23tomojyes
23:23tomojgc hiccup?
23:24amalloycould be. maybe into's use of transients helps a LOT?
23:24brehautits running much faster on my local machine
23:24amalloyyeah, same here
23:24brehaut0.03s sort of thing
23:24amalloy~clojurebot
23:24clojurebotclojurebot is a cold unfeeling genderless mechanism
23:24amalloydamn it, clojurebot, tell me you're not a benchmarking platform
23:24tomoj&(let [m (time (into {} (map (juxt identity identity) (range 1000000))))] (time (count (assoc m 10 20))))
23:24lazybot⇒ "Elapsed time: 2085.048106 msecs" "Elapsed time: 222.939766 msecs" 1000000
23:25brehautit is spiking a bunch though; i suspect there is some GCing of all those vectors and seq links going on
23:25tomoj&(let [m (time (into {} (map (juxt identity identity) (range 1000000))))] (time (assoc m 10 20)))
23:25amalloybrehaut: 0.03s? for me it's like 0.03ms
23:25brehautyeahs orry, ms
23:26amalloytomoj: no good, you've printed it all
23:26lazybot⇒ "Elapsed time: 2353.310162 msecs" "Elapsed time: 321.089554 msecs" {0 0, 32768 32768, 65536 65536, 98304 98304, 131072 131072, 163840 163840, 196608 196608, 229376 229376, 262144 262144, 294912 294912, 327680 327680, 360448 360448, 393216 393216, 425984 425984, 458752 458752, 491520 491520, 5242...
23:26tomojrealized that as emacs was freezing up from me having typed it at the repl just before I sent it here :(
23:26tomojI don't get it
23:27tomojthe assoc is ~10% of the build time, where I see 0.007% here
23:30tomojmaybe it's on a micro ec2?
23:31brehautor the heap size is really low?
23:31amalloyoh sure. the heap size *is* small
23:31amalloyhe gets 60mb, or maybe 80
23:31tomojwhy would that make an assoc slow?
23:32tomojcus GC is just making everything slow?
23:34amalloyactually he seems to be accidentally running with a *large* heap, and the machine is swapping. so taht's my analysis
23:35amalloydoesn't explain why building the map is fast, i guess
23:41yankovhm, I guess if I have a one giant map atom, if I change value of one keyword and value of other keyword was changed concurrently - that'd screw it up
23:44yankovcause it'll compare a value of the entire map each time. so if one of the million of keywords was changed then it'll try to rewrite again with the new value
23:44yankovdo i make any sense ...
23:45jeremyheileryankov: thats when you'll probably want to use stm
23:47yankovjeremyheiler: yes, and I thought of creating a separate atom for each "key"
23:50jeremyheilerah i see. i suppose it depends if your map is flat or not
23:51jeremyheileror at least, that the only part you care to "manage" is the first level