#clojure logs

2010-12-10

00:00cemericktechnomancy: seems odd -- into works on collections via conj, but strings are scalars
00:02technomancycemerick: it seems like into is the converse of seq
00:03hiredmanso what does (into "" [{:a 1} {:b 2}]) do?
00:03hiredmanand why?
00:03cemerickseq isn't an operation
00:04technomancycemerick: I don't follow
00:06cemerickThat was poor wording.
00:07cemerick`seq` is a polymorphic function that returns a persistent sequential "view" over a collection.
00:07technomancywhereas into forces things?
00:07cemerickA "converse" of that would have to be able to build up arrays, strings, iterables, etc.
00:08cemericki.e. that polymorphism is opaque
00:08technomancyright; I guess it would be unrealistic to expect everything to be reversible
00:08cemerickand unidirectional almost by definition
00:09technomancywell, there's good reason you couldn't into any arbitrary iterable
00:09technomancystrings and arrays seem feasible
00:10technomancybut I guess hiredman's point is also valid
00:10cemerickThere's also the implementation detail.
00:11cemerickinto is really just a reduction of conj
00:11technomancyif you look at it that way it does start to fall apart
00:11cemerickYou would not like the result of that with strings.
00:14technomancyfair enough
00:23joshua__I'm trying to use \d in a clojure regular expression and it is saying that the escape character \d is undefined?
00:25hiredman,"\d"; like this?
00:25clojurebotUnsupported escape character: \d
00:25hiredmanbecause that just means you aren't in a regular expression
00:25hiredman,#"\d"
00:25clojurebot#"\d"
00:33amalloy#"\d"
00:33amalloywhoops, late to the party
00:37joshua__Ah... I had done (re-pattern "\d")
00:37joshua__,(re-pattern "\d")
00:37clojurebotUnsupported escape character: \d
00:37hiredman,"\\d"
00:37clojurebot"\\d"
00:37joshua__Oh.
00:37joshua__Ohhhhhhh
00:37joshua__Thanks!
00:37hiredman\ is an escape, so you have to escape it
00:37hiredmaninside strings
00:38joshua__That was dumb of me =/.
00:39joshua__clj-time was the library that we talked about the last time we talked about working with time units right?
00:40joshua__I'm writing a function right now to convert a Hacker News style timestamp ("(\d+) (minutes|hours|days) ago") to a date. =)
00:42joshua__(Don't do it for me, I'm learning the language =p)
00:42amalloyyes, clj-time
00:44joshua__technomancy your the guy who is behind incanter right? =)
00:44technomancyno, not me.
00:44amalloyleiningen though
00:44technomancythat's liebke
00:44joshua__oh
00:44technomancyI wrote the first rev of clj-time, called chrono, which at one point was part of incanter.
00:45technomancymy version wasn't very good though
00:45technomancyexcept for the name.
00:46joshua__I see.
00:49cemericknot having a prefer-method corollary for protocols is *very* unfortunate
00:53cemerickThat *almost* makes me want to say that extend-* should only support concrete types, at least until a prefer-* facility is available.
01:16joshua__technomancy: do you know if there is a strip function for datetime (like you give it a datetime and it gives you back a date)? Or should I roll one myself?
01:18joshua__Going to make it myself =) Seems simple enough in my head.
01:20technomancyI haven't followed it at all--it's been rewritten since I was involved
01:21joshua__No problem at all. It actually took me longer to ask you that question than it did to write the function o.0.
01:22technomancynice
01:22joshua__Maybe I'm to fast to ask questions. Thing is when I don't I end up spending all day on the problem and you guys figure it out in a second.
01:22joshua__Function to grab the date of a hacker news comment is completed =) woot
01:24joshua__I can't wait to finish this project so I can share it with people. So excited, I think people might actually use it ;P.
01:55scottjit's silly that there's no rss feed for comments on an article.
01:56scottjon HN
02:38joshua__Now that I'm digging into Hacker News I'm finding that there are a lot of things that are silly. For example.. "0 minutes ago"..
02:38joshua__omg omg
02:39joshua__Thank God I just said that, my parser might be broken. I confused zero and one.
02:40cky"ID01T"? :-P
02:44joshua__yes
02:48joshua__For some reason I was under the impression for the last hour that 0 was where you expected a singular, so I thought that the lack of one was an idiosyncrasy. Turns out that 1 is where a singular belongs and is handled just fine. Thankfully, the fix should be pretty easy. Just change the cond to expect a singular form and use (minute|hour|day)s? instead of (minutes|hours|days).
02:49joshua__I hope o.0
02:50joshua__Yep, fixed and working =P
02:50joshua__Programming is so much fun!
02:52joshua__Just a warning to anyone who is doing what I'm dong.. building something on top of Hacker News is extremely hard. It is way too easy to get distracted. I mean seriously imagine if you had to browse reddit to get work done.
02:54technomancyit's open source; you could run your own instance and seed it with boring articles =)
02:57joshua__technomancy: I think you might have just discovered how lorem ipsum dummy text came to be.
02:57joshua__The original content was just way to distracting ;p
03:04amalloycky: !D10T, perhaps? much easier to pass off as "identity", and as an added bonus actually looks like you can spell :)
03:05ckyamalloy: It's actually a comment about joshua__'s "confused zero and one".
03:05amalloyaha. a little too meta for me, it seems
03:07joshua__amalloy: I missed it too. I like it now that I get it though.
03:07amalloycky: go hang out in #mensa, clearly too clever by half for #clojure
03:08ckyamalloy: Hahahahahahaha.
03:08cky(I laughed because I'm a Mensan IRL, but, I don't think they have a strong presence on IRC.)
03:09ckyjoshua__: :-)
03:20joshua__Good night all.
04:29zz_auseranyone up?
04:40scgilardi'course we are
04:40technomancylies!
04:40zz_auserheh
04:41bobo_:-(
05:02zz_auseranyone have an experience with BlockingQueue (java) from within clojure?
05:03hiredmanworks great
05:03hiredmana++ would block on this queue again
05:03zz_auserinteresting...
05:03zz_auserdid you use a :gen-class with BlockingQueue?
05:03zz_auserfor the worker?
05:04zz_auserjust looking at: http://www.java2s.com/Tutorial/Java/0160__Thread/CreatingaBoundedWorkQueue.htm
05:04hiredmanuh, why would you create your own blocking queue?
05:04hiredmanjust use one from java.util.concurrent
05:04zz_auserI don't want to, I mean't for the worker
05:04zz_auserhow do you define the run() method?
05:04hiredmanwhy do you need a run method?
05:05zz_auserSo this is what I'm trying to implement in clojure: http://www.hazelcast.com/documentation.jsp#Queue
05:06zz_auserI'm feeling a little lost I suppose (this is my first day on clojure :))
05:07bobo_i cant see any run method?
05:07bobo_i might be blind, that has happend before =)
05:07zz_auseryeah, I'm wrong on that...
05:09zz_auserokay... so... umm... wanna help me turn that into a clojure fun?
05:09zz_auserheh
05:09zz_auserI've spent the last hour trying
05:10zz_auserit's probably pretty easy for someone experienced in clojure
05:10bobo_(def q (Hazelcast/getQueue"task"))
05:10bobo_(. q put (Mytask.))
05:10fbru02zz_auser: so when i used it was only a matter of saying BlockingQueue. and then using .put .get etc
05:10bobo_(def task (. q take))
05:11bobo_does taht help you zz_auser ?
05:11zz_auseryep, it definitely does... Think Mytask can be a method?
05:11zz_auserand um... are those local variables? I mean, do they have to be in a method, rather... they do, right?
05:12fbru02zz_auser: just saw godfoca replying to your tweet :)
05:12zz_auserthanks, by the way bobo_
05:12zz_auseroh yep
05:13zz_auserI'm feverishly trying (clearly less than 24 hours later :)
05:13fbru02err zz_auser here we don't have methods , we have functions :)
05:13zz_auseryep, you're right
05:13fbru02also there are not "variables" they are bindings
05:14zz_auseroh
05:14bobo_that example i would say do it anyway you like, since its just an example that doesnt realy do anytthing
05:15fbru02so the rule of thumb is that when you see square brackets [] is that you are doing a binding, there are couple of ways to do them, the usual is passing a func some argzs or in a let method
05:15zz_auseroh boy, I'm going to have to do some more reading
05:15bobo_=)
05:16bobo_http://twitter.com/#!/dysinger/status/28515272157 that might interest you zz_auser
05:16zz_auserI saw that, actually
05:16zz_auser(:use [apparatus config cluster]) :)
05:18fbru02zz_auser: what are you reading as introduction (just curious )
05:18zz_ausertwo things primarily, the clojure docs and a clojure bookprogramming erlang
05:19zz_auserbut it's split brained
05:19bobo_a clojure book programing erlang?
05:19zz_auserhaha
05:20zz_ausersorry, told ya, a little split brained today
05:20bobo_:-p
05:24zz_auserhm, promise I won't ask any more "dumb" questions (at least tonight), but fbru02 how did you pull tasks out of the BlockingQueue?
05:26zz_auserwow, clojure is so cool
05:26zz_auserheh
05:32bobo_=)
05:54zz_ausernight
06:06licoresseHi group, when compiling in emacs it seems to "Fontify" twice, does any bell ring for someone?
06:07licoresseI've been away for some time
06:11licoressefount it; (setq font-lock-verbose nil)
06:41fbru02zz_zz_auser: i was out , ping me when u are here
07:55eckrothI'm having a problem: I have some code that uses proxy's to add event listeners on swing components, for example; I run lein compile, but then when I run the app, I get classnotfoundexception
07:56eckroththe exception is fixed if I "modify" the files with the proxy's (by adding a space, then deleting it, then saving), then running again
07:56eckrothI assume it's something to do with AOT
07:56eckrothI'm running like this: java -cp `lein classpath` myapp.core
08:03eckroththis happens also when I do "lein clean" then "lein run"
09:20chouserintermittent failure from clojure-maven-plugin
09:25kzarWhat do you think of this? http://paste.lisp.org/display/117522 It's used to run things in a new thread, but somehow it crashes Java after a while
09:25stuartsierrachouser: ?
09:25chouserstuartsierra: awesome, right?
09:26cemerickkzar: use an agent or a future, don't create threads yourself
09:26stuartsierracan you give details
09:26cemerickand certainly never use .stop!
09:26chouserstuartsierra: I'm still fiddling. If I discover anything useful, I'll share.
09:27kzarcemerick: Heh I just kinda guessed my way along to be honest
09:27gtrakyea, clojure can take of most of that stuff for you, they already did the heavy lifting
09:28cemerickkzar: you don't even need the .stop in there -- after the function has completed, the thread will die on its own
09:28cemerickthe brutal execution of it is probably what led the jvm into the weeds
09:28kzarcemerick: Ah gotya
09:28cemerickkzar: even so, use an agent or a future :-)
09:30_atokzar: Personally, I've no objection to using a manual thread if that's what you need. But you don't need proxy as well, this should do you: (doto (Thread. #(apply f args)) (.start))
09:31cemerick_ato: why wouldn't you make use of the threadpools that exist already?
09:32gtrakit's not idiomatic clojure if you can avoid using a manual thread right?
09:33_atocemerick: because you may not want to use a thread pool (eg something that blocks) and sometimes you may not be interested in the return value (hence future is overkill)
09:33_atosometimes you really just want a plain old new thread :-)
09:33cemerickgtrak: exactly
09:33kzarThanks for the ideas everyone
09:33bozhidardoes anyone around here know how to insert code snippets in OpenOffice Impress? I can't find anything online, except for some non-working plugin Coooder and I'm getting close to making screenshots of the code...
09:33gtrakyea, but i'm betting kzar probably doesn't :-)
09:33cemerick_ato: the threadpool that send-off and future use isn't limited, and therefore never blocks…?
09:34Raynescemerick: I think the sandbox guys and I may have the one undeniable usage of .stop.
09:34Raynescemerick: All of the sandboxes, including clojail, use .stop to kill a thread after so many seconds have passed so that long-running evaluations are terminated.
09:34cemerickRaynes: sure, entirely reasonable
09:34kzarWell my step-sequencer seems to pretty much be working :D it sounds like crap but it's working
09:35RaynesIt seems like it would be difficult to do otherwise.
09:35gtrakstep-sequencer?
09:35gtraklike fl studio?
09:35RaynesOf course, it wont work forever, since it's deprecated. I imagine it'll disappear in future JVMs.
09:35cemericknREPL may end up doing the same in order to offer a "force interrupt" of a running expression.
09:35kzarOH crap it just crashed Java again, I guess there's another problem appart from the threads
09:35_atokzar: crashed how?
09:36gtrak#java
09:36kzarInvalid memory access of location 0x0 rip=0x11a38abc1
09:36kzarInvalid memory access of location 0x0 rip=0x11a38b54a
09:36dnolenkzar: are you using a native lib?
09:36_atoeek
09:36kzar(This is pretty much practice for Java interop and what not so it's probably all pretty fucked heh)
09:38kzardnolen: Yea I'm using javax.sound.sampled stuff to synthesize the sounds and swing stuff for the graphics and Thread for threads
09:38gtrakneato
09:38kzargtrak: I'm not sure what fl studio is, it's like http://lab.andre-michelle.com/tonematrix but way way way crapper
09:38RaynesI don't think I've ever managed to crash the JVM. Randomly, sure, but not consistently.
09:39gtrakfl studio is pretty sweet
09:39cemerickRaynes: you will, you will ;-)
09:39cemerickkzar: perhaps the sound stuff is not threadsafe…?
09:39_atohehe, I've done it all too often
09:39kzarcemerick: Oh yea maybe, I didn't think of that
09:40dnolenkzar: cemerick: or it's a bad native call
09:40cemerickyeah, either-or
09:40neotykGuys is any of you aware of OPS5 similar library in Clojure?
09:41dnolenkzar: if your Clojure code is improperly calling out into some OS native library that will take down the JVM.
09:41kzarThing is it works for a while and then crashes
09:54fliebelUgh, this is weird. I did the JFastCGI ring middlewhare, but comparing Jetty versus Apache I get that Jetty is slow, and php-cgi shuts down after a few hundred requests. But on the other hand, Apache seems to drop 80% of the connections when doing ab.
10:09chouserstuartsierra, cemerick: here's what I've got about my clojure/maven failure: https://gist.github.com/736310
10:10chouserany insight you might have would be deeply appreciated
10:12chousernote that if I take the [DEBUG] Command line: shown in the log and run it myself, I have yet to see it fail. It works and returns a success exit code 0 every time I've tried it.
10:13stuartsierrachouser: Why Clojure 1.3.0-alpha3 and contrib 1.2.0?
10:14cemerickchouser: this is intermittent?
10:14chouserlazytest requires Clojure 1.3.0-alpha3. congomongo requires contrib with the old-style artifact name
10:14chousercemerick: yes.
10:15cemerickwhew
10:16chouserI tried to patch clojure-maven-plugin to give more info about the failure, but my attempts to build it failed -- syntax errors in .java files (trying to extract docs from variatic args or something?)
10:17hugodlooks like the catch blocks in AbstractClojureCompilerMojo could use some better reporting
10:19cemerickheh } catch (IOException e) { status = 1 } :-P
10:25cemerickchouser: yeah, you really need to get a cmp build with better error reporting there.
10:25cemerickI don't think it'll be possible to solve without it.
10:26chouserbuilding clojure-maven-plugin, I get: com.thoughtworks.qdox.parser.ParseException: syntax error @[292,72] in file:/home/chouser/build/clojure-maven-plugin/src/main/java/com/theoryin
10:26chouserpractise/clojure/AbstractClojureCompilerMojo.java
10:29stuartsierraSo one of two things is happening:
10:29stuartsierra1. clojure.lang.Compile returns exit status non-zero
10:30stuartsierra2. while trying to run clojure.lang.Complie (in a separate process), clojure-maven-plugin encounters an IOException
10:30chouseryep
10:31stuartsierra(2) seems unlikely.
10:31stuartsierraUnless it's a filesystem / OS / permissions issue.
10:34chouserok, building the plugin seems to be doing better at the moment. taking it's time, though.
10:34stuartsierraclojure.lang.Compile catches exceptions and does not set error status, so it's unlikely to be returning non-zero exit status...
10:35stuartsierraUnless something is throwing a RuntimeException during compile.
10:35chouserI don't understand the PumpStreamHandler thing -- what's supposed to be happening to the output of the java sub-process?
10:35stuartsierraPumpStreamHandler copies the sub-process's STDOUT to Maven's STDOUT
10:37rata_hi
10:38chouserstuartsierra: so that appears to be producing nothing at all
10:38fliebelrata_: hi
10:39rata_hi fliebel
10:40cemerickchouser: I'm betting on a RuntimeException of some sort prior to any output being emitted.
10:41stuartsierraWouldn't that be caught and printed to STDERR by the JVM?
10:43cemerickstuartsierra: hrm, yes; maybe there's a race condition between the failing of the build and the stream handler flushing output to the mvn stdout?
10:44stuartsierraexec.execute on line 452 should not return until the sub-process has completed
10:45stuartsierraOh, but maybe PumpStreamHandler hasn't finished, I see.
10:45rata_hi chouser
10:46chouserrata_: hi
10:46stuartsierrachouser: Try adding handler.stop() in a "finally" block
10:47rata_chouser: do you remember my problem with counted-sorted-sets and maps? I finally made a compare fn for maps that uses hash and handles hash collisions, it's here: https://github.com/rhz/kapjure/blob/master/src/kappa/maps.clj#L121
10:47chouserstuartsierra: ok. I just lost my connection to my dev machine ,so it may be a minute.
10:47rata_but the problem is, when I use disj it sometimes doesn't find the element I want to remove
10:48rata_even when the element is present in the set
10:48chouserhmm
10:48rata_do you know what could be a possible reason for that?
10:51cemerickchouser: lost your connection? Do you guys use some fancy VDI system?
10:52rata_I have an example of a particular counted-sorted-set that's giving me this problem, but it's a very long set... so if you would like to see it, let me know and I put it in a gist
10:52chousercemerick: no, multiple devs on one box. we like to make it thrash for each other.
11:05rata_chouser: any ideas?
11:06chouserrata_: what happens if you remove from your set everything except the item that you're looking for (which currently fails)
11:10rata_I'll check
11:14fliebelWhat does a Aleph does with its output? After a lot of requests, it just halts. And then when I quit it, it trows log messages all over me.
11:14chousercemerick: I can't get it to fail now, with either the original or patched plugin
11:15fliebelI'm afraid it fills up some buffer and then just blocks on writing to that.
11:15cemerickchouser: this is after a restart or something?
11:15jcromartiewhere does lein install maven?
11:15chousercemerick: no, but some other java process have been killed off
11:16cemerickthat's bizarre
11:16chousercemerick: so I'm wondering if perhaps the sub process was failing due to memory shortage or something
11:16chouserSo I guess we'll proceed for now and do more analysis if it begins to fail later.
11:19rata_chouser: when I do (second (split-tree (.tree s) #{m})), where s is the counted-sorted-set and m the map I want to remove, it returns a map that's not equal to m
11:19rata_(I'm still figuring out a short way to do what you asked me, as the set is very big)
11:36rata_chouser: if I remove everything except the item I'm looking for, it does the right thing
11:36chouserrata_: uh oh. that smells like a finger tree bug. :-(
11:37rata_(that is, I end up with a counted-sorted-set that just has the item I'm looking for)
11:38chousercan you map across the sorted set in order, running your compare function on a sliding window of pairs, to make sure they're getting inserted in order?
11:40rata_to do it I used this form: (reduce (fn [s m] (if (= m wanted-m) s (disj s m)) s s)... is that ok right?
11:40chouserlike: (every? #{-1} (map (fn [[a b]] (map-compare a b)) (partition 2 1 your-set)))
11:41chouserrata_: yeah, that looks right
11:42rata_chouser: it returns true
11:42chouserhm
11:43chouserwhich suggests they're in order in the tree. so ... why can't isn't it found?
11:43chouserwhen you do the split on the item it can't find, is the one you want nearby?
11:43chouseras in at the end of the previous tree or beginning for the subsequent?
11:44rata_I'll check
11:45rata_no, it splits the tree at the last element
11:46rata_(let [[l x r] (split-tree (.tree s) #{wanted-m})] [(peek l) x (first r)]) returns [{17 27294, 18 26692} {17 27393, 18 27024} nil]
11:52chouserrata_: can you have your compare function log its return values each time it's called during that split?
11:52rata_and also its input values?
11:53chouserif it returns 1 every time, then finger tree is "correct" in slitting at the end
11:54rata_ok
11:56rata_I must recreate the counted-sorted-set though to change the compare fn... or can I change it in-place?
11:56chouserhmm
12:05rata_chouser: it does no comparison
12:05chouserhmph!
12:11rata_chouser: btw, did you see the issue I opened some days ago?
12:13chouserrata_: yes, thanks
12:13rata_=)
12:13rata_you're welcome
12:13chouserMy non-work clojure time is going into the book right now, but once that's been tamped down again, finger trees will get some love.
12:14chouserrata_: I wasn't sure if you had a CA in -- I can't accept a patch without that, and also it should be submitted via the ticket system.
12:14chouserregardless of all that, thanks for trying out the code and spotting weak points -- that's very helpful.
12:15rata_where's the ticket system? I thought issues was the right place to put it
12:16rata_what's exactly the CA? the thing I use to push to my git repos?
12:17hiredmanclojurebot: ca?
12:17hiredman!
12:17hiredmanclojurebot: ping?
12:17chouserrata_: oh! ha, didn't see you'd used the github issues.
12:17chouserlet's see...
12:18amalloy$whatis ca
12:18sexpbotca does not exist in my database.
12:18amalloy$whatis CA
12:18sexpbotCA does not exist in my database.
12:18amalloyman wtf. bots both sucky here
12:19hiredmanping?
12:19RaynesWe should really rename $whatis to $explain
12:19clojurebotPONG!
12:19hiredmanclojurebot: ca?
12:19clojurebotCA is Contributor Agreement: http://clojure.org/contributing
12:19gtrakclojurebot: agent?
12:19rata_chouser: where did you see it then? I don't remember putting the patch elsewhere
12:19clojurebotI don't understand.
12:19chouserrata_: you sent email
12:21rata_really? did I sent you an email? I don't remember doing that
12:21chouserrata_: I guess I don't know where the right place is to file bugs for this "new contrib" system
12:22chouserrata_: ah, nm, when you created the issue, it emailed me
12:22rata_oh ok... but is github's issues then an acceptable place?
12:23chouserprobably not long term, but I guess it's fine for now. The CA is more important. Without at least that I'll just need to creat my own fix for the problem.
12:26rata_ok... I must mail it to rhickey, right?
12:26chouseryes
12:26rata_mmm ok
12:27rata_that will take a while, as I am in Chile
12:28chousersorry about that. I don't have any way I can ease that pain.
12:28rata_don't worry
12:28rata_anyway, that patch just adds two lines to finger-tree.clj
12:30chouseryeah, it shouldn't be a problem for me to fix now that you've reported it.
12:34rata_=)
12:34rata_chouser: also, please let me know if I can help you more with this split-tree thing
12:40Islonhow can I see swank clojure output in cake?
13:00amalloyIslon: i don't understand the question. can you be more specific about what you want?
13:05Islonamalloy: how do I see cake's output, already discovered myself: .cake/project.log
13:28edwClojure does *not* support nested DEFNs, correct?
13:28stuartsierracorrect
13:29edwThanks.
13:35stuartsierraI'm looking at an alternative approach to CLJ-322
13:36stuartsierraInstead of introducing LOAD_LEVEL, just bind a set of symbols for names that should be written out.
13:42cemerickstuartsierra: with (constantly true) indicating transitivity?
13:42stuartsierrasomething like that
13:43cemerickstuartsierra: seems reasonable; but let me ask…
13:43clojurebotstuartsierra is retiring
13:43stuartsierraheh ;)
13:43cemerickwhere the $#!* were you two months ago?
13:44cemericksaid with all due ;-) and :-D of course ;-)
13:44stuartsierraHmmm… I think I was still eyeballs-deep in testing frameworks at that point.
13:44stuartsierraSpending the past 3 weeks or so on Maven has gotten me thinking about compilation.
13:44stuartsierraSpeaking of which...
13:45cemerickstuartsierra: I'm totally just screwing with you. Your idea sounds far superior on the face of it.
13:45stuartsierrajava.lang.Class is Serializable. Anybody know what happens if you serialize it?
13:46cemerickbytes that will be deserialized into a Class?
13:46stuartsierraWhat I'm wondering is, do you get a normal .class file?
13:46stuartsierraI'd guess not.
13:46cemerickHrm, no.
13:47stuartsierraMaybe what we really want is not non-transitive compilation, but *selective* emitting of .class files.
13:47stuartsierrathat is, compiling source and writing .class files are two different things.
13:48stuartsierraYou always want to compile your sources; they're not much use otherwise.
13:48cemerickexcept the relationships between namespaces, functions, and class files are roughly an implementation detail
13:48stuartsierraBut it's a deterministic relationship, right?
13:49cemerickBut I get your point -- AOT compilation is a good sanity check in any case, classfile emitting or not
13:49stuartsierraCould we have a function/macro like (emit-classfile-for symbol)?
13:49cemerickprobably not after we've dropped the byte[] of the generated classfile on the floor once it's loaded into the VM
13:50stuartsierraHmm, yes.
13:50cemerickI think if you said that the set would be namespaces for which classfiles would be written, that makes sense.
13:51cemerickAnd allows for AOT-loading without necessarily AOT-classfile-emission
13:53stuartsierraWhat I'm wanting is to leave "compile" as-is, and add a new thing "write-classfile"
13:54hiredmanthe whole point of compile is to write class files
13:54cemericknot true
13:55stuartsierraright, but most of the time people use "compile" just because they need *one* class file, like a main class or a gen-class
13:55hiredmancemerick: that is exactly what it is for
13:56stuartsierra"clojure.core/compile" does 3 things: load, generate bytecode, write classfile
13:56cemerickhiredman: Perhaps that's it's explicit purpose, but AOT-compiling to a temp dir is just good practice at this point so as to ferret out any loading issues.
13:56stuartsierraI want to separate out the third step, writing the classfile, so it can be invoked selectively.
13:57hiredmancemerick: or you can just load the namespace
13:57cemerickstuartsierra: there are scenarios where comprehensive classfile emission is required.
13:57stuartsierraYes, absolutely.
13:57hiredmanI never call "compile" to check if a file loads
13:57stuartsierraAnd I want to leave that available.
13:57hiredmanI call load
13:57hiredmanor require or use
13:58cemerickhiredman: sure, sure. But AOT is the hook that's available to load everything in a given project, so…
13:58stuartsierracemerick, hiredman: this is immaterial
13:59hiredmancemerick: I think you are confusing what your tool chain offers as "compiling" with what clojure's compile does
13:59stuartsierraWhat are the situations where you *need* to write a .class file for things to work?
13:59stuartsierra1. gen-class
13:59hiredmandefprotocol
13:59stuartsierrahiredman: how so?
13:59hiredmanwell
13:59hiredmansort of
13:59cemerickhiredman: I'm quite sure I know what Clojure's compile does. I'm being fast and loose with language though.
14:00hiredmandepends what you are doing with protocols and records
14:00stuartsierraIf you want the protocol to make an interface you can call from Java, you certainly need a .class file.
14:00hiredmancemerick: aot compiling a namespace in no way loads an entire "project" it will only load what that namespace loads, so you may as well just use load
14:00hiredmanstuartsierra: rigth
14:01stuartsierraSame for deftype/defrecod.
14:01cemerickstuartsierra: same goes for def/gen-interface
14:02stuartsierraand "clojure.core/compile" doesn't help you if you just want to write a .class file for a protocol, for example, because it works at the level of namespaces
14:03stuartsierraWith gen-class, you can work around it by putting all your "gen-class" declarations in a separate file and loading it with *compile-files* set true
14:03stuartsierraBut if I want a .class file for my protocol / datatype, and nothing else, I'm stuck.
14:23suehshave you ever seen the lein repl hang intermitently?
14:25raeksuehs: there was a bug a time ago that caused the output to not be flushed. try evaling 1... does the output appear then?
14:29suehsthat seems to work fine:
14:29suehsuser=>1
14:29suehs1
14:29suehsas well as (eval 1) and some toying with some lists
14:30suehsand if I jiggle it with an extra () the rest of the output falls out and I get another prompt
14:30suehsI'll try dropping rlwrap in my classpath.
14:31suehsmaybe it goes back to the j readline differences
14:35raekhrm, I can't find the ticket, but IIRC it was a bug in clojure itself (it has been fixed, btw)
14:42suehsI am using 1.2.0. I'll check for a later version.
14:42suehsI'm also playing with incanter. I don't think that's a problem though
14:48technomancysuehs: latest version should fix all that
14:51suehslatest stable release or do I need to be adventurous?
14:51technomancystable's fine.
15:11chousercemerick: https://gist.github.com/736310#file_with extra error reporting .txt
15:12amalloychouser: that link looks a little dubious :P
15:12chouserheh, yeah. spaces in my fake filename
15:13cemerickchouser: "error=12, Cannot allocate memory" has lots of hits on google, though nothing that makes immediate sense
15:13cemericksounds like you've got local environment issues, tho
15:13chousercemerick: yeah, seems likely
15:14cemerickchouser: Do get your error reporting patch over to Mark though
15:15hiredmandepending on how maven is launching java, the way java forks on linux the child process when it begins tries to allocate the same amount of memory as its parent
15:15hiredmanhttp://stackoverflow.com/questions/209875/from-what-linux-kernel-libc-version-is-java-runtime-exec-safe-with-regards-to-m
15:17rata_chouser: I made a mistake before, because I was using #{wanted-m} instead of #(>= 0 ((.cmpr s) wanted-m (:right %))) as the predicate fn for split-tree
15:18rata_when I use the latter, I get {17 2812, 18 20990}, but I'm looking for {18 23554, 17 215}
15:21rata_and the surroundings of the element returned by split-tree are {17 3544, 18 20255} (last element in the left tree) and {17 2580, 18 21300} (first element in the right tree)
15:21rata_so the map I'm looking for doesn't appear there
15:22rata_(the log of the comparisons is "1 -1 1 -1 1 -1 1 1 1 -1 1 -1 -1")
15:23chouserweird
15:23chouserso it appears to be hunting through the set in roughly the kind of pattern one would hope for
15:24chouserand indeed ends up in the middle somewhere, but not next to the one you're looking for
15:25rata_yes
15:25rata_and when I run (get s wanted-m) it prints the same log and returns nil
15:26rata_(well, that is expectable)
15:32rata_oh! it's in the left tree and when I do (split-tree l #(>= 0 ((.cmpr s) wanted-m (:right %)))) it founds it!
15:32rata_(printing the log "1 1 1 0")
15:32rata_chouser: ^
15:34chouserwounds like it's down the right-hand side of the left tree
15:34chousersounds
15:35rata_yes
15:36rata_also, the hash values of the first found by split-tree and the map I'm looking for are similar: &(hash {17 2812, 18 20990}) and &(hash {18 23554, 17 215})
15:37rata_&(hash {17 2812, 18 20990})
15:37sexpbot⟹ 23769
15:37rata_&(hash {18 23554, 17 215})
15:37sexpbot⟹ 23766
15:37chouserso "near" in the tree
15:37rata_I don't know if that could have to do with the issue
15:37rata_yes
15:38rata_in fact, (peek (pop l)) is the map I'm looking for
15:46rata_chouser: I keep thinking is my map-compare fn the root of the problem
15:47chouserrata_: I'd like to believe that :-) ...but I'm not seeing anything you did wrong.
15:48rata_maybe the part that handles hash collisions is "diverting" to the wrong path the search
15:49rata_in fact, in this tree there are two maps with the same hash code
15:50rata_(being one of those map the one I'm looking for)
15:52rata_thus I think when it arrives to the other map with the same hash code, the split fn choose the wrong path
15:52chouserhm
15:52rata_do you know of a better way to have a guaranteed unique hash fn?
15:53amalloyrata_: guaranteed unique is kinda the opposite of a hash
15:53chousersha1 etc come close, but that's not really what's wanted here
15:53rata_or should I just use (compare (vec (sort-by > (vals m1))) (vec (sort-by > (vals m2))))
15:54rata_that's way slower than comparing hashes
15:54chouserrata_: you could try that to see if it "works", and then add more complexity
15:54rata_ok
15:59rata_the creating of the reaction-chamber (no matter what that is) takes now 86secs vs 58secs using the hash-based compare fn
15:59rata_but let's see if the simulation part works
16:02stuartsierraSo I think I have a version of selective compilation
16:05stuartsierrahttps://github.com/stuartsierra/clojure/tree/write-classes
16:06anonymouse89I'm going through some VERY large XML files with clojure.xml/parse like this: (let [items (parse file)] (doseq [item items] do stuff))
16:06chouseroh, as opposed to automatic transitive?
16:06stuartsierrayes
16:06chouserexcellent
16:07anonymouse89I would like to drop the head of the items sequence as this conusmes a lot of memory and give me OOM errors
16:07stuartsierraInstead of changing "compile", I added "compile-write-classes"
16:08stuartsierrahttps://github.com/stuartsierra/clojure/blob/write-classes/src/clj/clojure/core.clj#L5320
16:08hiredmanI still fail to see why you wouldn't just change compile
16:09stuartsierra"compile" by itself isn't enough in the face of deftype
16:09stuartsierrahiredman: how would you change "compile" to get .class files for deftype/defprotocol?
16:09rata_chouser: it doesn't work either :(
16:09chouserrata_: bleh. ok, sorry. gotta run.
16:10rata_chouser: ok
16:10hiredmanstuartsierra: beats me, I'm not the one with a proposed solution
16:10stuartsierra:)
16:10rata_I'll continue searching for a solution
16:11hiredmanmaybe we need to split clojure source file types
16:11rata_chouser: so if you could help me afterwards, that'd be cool
16:11hiredmanone type can generate classes the other can't
16:11rata_I need to have some results of this simulation for monday =S
16:12stuartsierrahiredman: there's still some value to "compile" doing AOT-compile on everything, for example when you want to release a pre-built app with minimal load time
16:12hiredmanI tried to use aot to cut down on load times, but it didn't do much
16:12stuartsierraSelective compilation is more important for Java interop or library releases
16:13stuartsierrahiredman: yeah, the bulk of the load time is loading clojure.lang.RT anyway
16:32Messangerworld leaders setting you all up right now to get microchipped by RFID microchips with identity/healthcare/credit information into their new world order why they are folding the economy , their solution to the problem they are causing is the RFID microchip http://www.scribd.com/doc/44997148/The-Mark-of-the-Beast Romans 10:13 all who call upon the name of the Lord shall be saved.
16:34amalloyi...i can't really put a lot of credibility in anyone named Messanger
16:35technomancyamalloy: he's angry about messiness; makes sense to me.
16:36stuartsierraAdded my patch with comments to CLJ-322
16:36tonylnow that was weird
17:19lpetithello, missa missing this channel!
17:20tonyllol
17:50npoektophi. If i literally translate how russians call bad written code with many copy/pastes: hindu code. How to translate it correctly?
17:54amalloynpoektop: there are a lot of ways to say it in english :P
17:54amalloycopypasta is a good one: spaghetti code that's also copy/pasted
17:54Adamantnpoektop: copypasta works
17:54Adamantso does cut and paste
17:55AdamantI've heard JCS (Java Coder Syndrome)
17:55Adamantbut that's pretty obscure
18:05m7di am hoping i can get a bit of help: can i get a recommendation for libraries to use to do credit card transactions? especially for authorize.net?
18:05m7di am guessing it would probably be a java lib that i need to interact with from clojure
18:07m7dalso, any pointers for a tutorial or screencast that shows the whole path to setting up a clojure env on os x? i use CL currently so i am used to slime,etc.
18:08m7doh, i see there is a clojure-authorize for cc stuff
18:09pdkhttp://mischneider.net/?p=171
18:09pdkhttp://kylecordes.com/2010/emacs-osx
18:10m7dpdk: good links , thanks, did the instructions work for you?
18:10pdki'm not on os x so couldn't vouch for em
18:10m7dpdk: yeah, i have found some links on google, just hoping to find something that is for sure up to date, etc.
18:10pdkon windows at least there is clojure box which has clojure + emacs + slime all bundled together and configured, the package might be available for os x/linux too
18:11m7dpdk: i'll check that out, thanks
18:11pdkyou probably just have to change any hardcoded references to the clojure version number like 1.1.0 or 1.2.0 etc
18:11m7dpdk: is lein the way things are gelling or cake?
18:12pdki haven't tried either enough to say, iirc cake is probably newer
18:12amalloym7d: some of both
18:12amalloycake is definitely newer, but lein is older, so they both win that one :P
18:12m7damalloy & pdk: ok, does it seem like one will win out realistically?
18:12amalloyi like cake for its nailgun functionality, personally
18:13m7damalloy: i just looked up cake, what is nailgun?
18:13amalloym7d: http://blog.raynes.me/?p=48
18:13amalloyclojurebot: nailgun?
18:13clojurebotnailgun is http://www.ruby-forum.com/topic/186850#815956
18:14m7damalloy: thanks, nice bot feature
18:14amalloy$whatis nailgun
18:14sexpbotnailgun does not exist in my database.
18:14amalloysexpbot is the bot i actually work on, m7d, but i confess clojurebot's lookup/whatis feature is a lot more convenient
18:15m7damalloy: so looks jruby specific, nailgun that is
18:15amalloynono
18:15amalloyjanything :P
18:15amalloyit really just keeps a jvm running
18:15m7damalloy: oh, i see
18:15amalloyi don't know if cake actually uses nailgun or re-implements the functionality, but either way it acts the same
18:16m7damalloy: like a supervisor daemon or something
18:16amalloyyou can ask around in #cake.clj, or ninjudd/Raynes/lancepantz are the cake whizzes
18:16m7damalloy: ok, thanks
18:16technomancyleiningen does that now with the interactive task
18:16pdkdo they recommend apple pumpkin or black forest
18:16amalloyor ask technomancy if you want someone to defend leiningen :)
18:16m7dtechnomancy: thanks for the emacs rig by the way
18:17technomancym7d: starter-kit?
18:17m7dyep
18:17technomancyyeah, I'm working on rewriting that
18:18m7dtechnomancy: you should know the answer to this then: a blog post that gets me quickly through clojure setup? I am common lisper, rubyist, with past java experience so it isn't all foreign, but i don't have hours to mess up
18:18lancepantzcake doesn't use nailgun
18:18technomancym7d: I don't know a good way to use slime that works for both clojure and CL
18:19technomancym7d: but the swank-clojure readme should be the canonical reference for a slime setup that works with clojure 1.2 and older.
18:19m7dtechnomancy: i see, no problem, maybe i'll go slimeless for a while in clojure
18:19technomancygenerally blog posts about slime are not very reliable since they get out of date and nobody updates them
18:20technomancycase in point: http://technomancy.us/126
18:20m7dyeah, it is all moving fast, just like early rails days, brings back good but painful memories too
18:21technomancythe difference being that rails never really got good Emacs support =\
18:21technomancyfor templating at least
18:21m7dtechnomancy: yeah, that is very true
18:21lancepantzoh jesus, views are hell in raisl
18:21lancepantz*rails (in emacs)
18:22technomancyspeaking as the co-author of rhtml-mode... that was a disaster.
18:23m7das an example, it was sort of difficult to build penumbra (see on github) starting from nothing, still don't have it working cuz i didn't want to spend more time on it and some of the stuff online is way out of date apparently
18:23lancepantzi'd ask zach, he's really good about responding
18:24m7dlancepantz: is that zach beane?
18:24lancepantzzach tellman
18:24m7doh, ok
18:24m7dthere is a zach in lisp who is really helpful and a rippin good lisper
18:25m7dlancepantz: thanks
18:25m7dzach: r u here?
18:25lancepantzmaybe it's just all zachs? :)
18:25m7dlancepantz: i think it is :)
18:26technomancyI dunno; my 1-year-old Zach is not.
18:26lancepantzi'm sure he will be :)
18:26lancepantzthat's it, i'm naming my kid zach
18:26m7dtechnomancy: patience, give him time
18:26lancepantzi've never known a bad zack
18:26lancepantz*h
18:31m7dis it possible to work with projects defined in lein using cake?
18:31slyrusm7d: xach
18:31dnolenm7d: yup
18:31slyrusand you can usually find him in #quicklisp
18:32m7dslyrus: yep, quicklisp is great, it has made things easier for sure
18:32slyrusglad to hear it. I'm a fan as well.
18:32m7ddnolen: cool, some special cake command that makes it parse lein package defs or something?
18:33lancepantzm7d: we just use the same syntax
18:33m7dlancepantz: excellent
18:33lancepantzfor defproject
18:33m7di'll install the gem now
18:38m7dactually i ended up doing lein self-install
18:40m7dit blew up trying to build penumbra though via lein deps and suggested i just get the project from it's website...oh well
18:41m7dit looked like it was almost done too, darn
18:42m7dwell, penumbra looks like a hairy project with lots of dependencies so maybe it isn't a good representative project for lein
18:42technomancypure-JVM projects are going to be simpler
18:43technomancyas in any language, foreign dependencies muck things up something nasty
18:43m7dtechnomancy: yep, you created lein right? thanks for doing it, that looks like a lot of work
18:43technomancyit's actually pretty simple
18:43technomancyit only passed 1000 LOC recently
18:43m7dtechnomancy: yep, like building elephant in cl which i eventually, without too much trouble did, but it wasn't quicklispable
18:44m7dtechnomancy: well, that's cool, seems like a great contribution
18:45technomancythanks
18:45m7dtechnomancy: welcome
18:46m7dknow of any clojure projects that start getting close to the machinery needed for an ecommerce project?
18:46m7das a starting off point?
18:46m7di see clojure-authorize on github and now i need to figure out persistence, probably relational for ecommerce
18:47amalloym7d: clojureql? i haven't tried it, but it's brand new and looks very appealing
18:47m7damalloy: thanks, i'll check that out
18:48lancepantzclojureql is awesome
18:48amalloyplus, if you need help with it you can bug Laujensen, which will be fun (and give you a reason to stay up late, if you're not in europe)
18:49m7damalloy: hah, cool - yeah clojureql looks pretty nice - i like getting my composed sql back in a repl, that's nice
18:51tomojwhen you want to do something outside clojureql's features, do you have to drop down to c.c.sql?
18:52amalloytomoj: it's hard to imagine that not being the case
18:53tomojthen I guess the question is, how hard would it be for me to add the features I need to clojureql
18:53scottjI suspect it has a function where you can enter sql statements.
18:58m7di know it's early in clojure's life, but is there any standard vetted way of doing persistence in clojure? the clojureql lib looks great, but i am not looking for something so new that i feel their development pain
19:01raektomoj: from what I have heard, it should be very simple to instert custom strings of SQL into the query in ClojureQL
19:11scottjm7d: if you limit persistence to just sql then maybe c.c.sql
19:12scottjbut there's nothing that encompasses sql + all the other persistence things. clojurize wants to do that though.
19:12m7dscottj: thanks, i'll check it, i am creating a proj and setting up clojureq, c.c.sql next
19:12m7ds/clojureq/clojureql
19:12sexpbot<m7d> scottj: thanks, i'll check it, i am creating a proj and setting up clojureql, c.c.sql next
19:14m7dah, so clojure uses the directory namespace matching stuff from java
19:15m7dclojure.test looks to have the same interface as stefil from cl, so that's nice
19:16scottjthere are lots of newer frameworks than c.test but none have won out yet
19:16m7dscottj: thanks for the info
19:16amalloym7d: clojure seems to have chosen not to use java's long, domain-qualified namespaces/packages, fwiw
19:17m7dscottj: learning from my rails/merb days, i'll just stick with the standard offering on testing
19:18m7dtechnomancy: are there better alternatives to slime for clojure dev? or good ones at least? i have eclipse installed on my machine. since cl slime integration and clojure slime integration are difficult to attain simultaneously
19:18scottjamalloy: was interesting how quickly that changed, I think in large part due to lein
19:19amalloyscottj: i showed up after the decision was made, i think
19:19amalloym7d: counterclockwise for eclipse is supposed to be good
19:19scottjm7d, slime is the best. vim and ccw are probably next.
19:20m7damalloy: thanks
19:20scottjyou can use slime w/ cl and clojure, I do it
19:20m7dscottj: i use vi in emacs so that could work
19:20m7dscottj: yeah, mind sharing your .emacs relevant to it?
19:20m7di dig slime
19:20m7dmuscle memory and all that
19:21scottjI don't think I have anything special, it just works. requiring clojure-test-mode will break it though
19:21m7dscottj: is that the red green stuff?
19:21scottjI slime-connect to everything. I don't run clojure or sbcl from inside emacs
19:21m7dscottj: yeah, you are smart not too. i need to stop doing that
19:21scottjm7d: yeah and a few other things
19:22m7di saw a screencast of that and it caught my eye
19:22amalloyagreed, slime-connect is easier
19:22scottjI have some screencasts at http://youtube.com/emailataskcom covering emacs/slime/clojure stuff
19:23m7dscottj: thanks, i'll check it now - i just got the lein stuff sorted and clojure installed and a project started, now i need my tools!
19:26m7dscottj: cool screencast, which screencast covers getting setup? i am watching the latest right now
19:28scottjI don't cover getting setup, that's too boring :)
19:29m7dscottj: ok, fine, i'll find out :)
19:31scottjbasically add clojure-mode swank-clojure and slime and slime/contrib to load-path then require clojure-mode and slime and run (slime-setup '(slime-fancy)) require clojure-mode and slime (I use from trunk, don't expect support though if you have problems)
19:32scottjcut the second require clojure-mode and slime bit
19:33m7dscottj: ok, i'll check that out - i also found a link to an article from a lisper i respect: http://nklein.com/2010/05/getting-started-with-clojureemacsslime/
19:34technomancyhard enough keeping one set of docs up-to-date
19:35scottjm7d: that's a lot more code than you need if you don't mind running slime-connect
19:35m7dscottj: ok, i'll try for the slime-connect and fix my cl emacs stuff at the same time
19:35m7dgetting clojure-mode right now
19:36m7dcool that's done
19:36scottjI bet you could do cl/clojure just fine installing everything from elpa
19:36m7dscottj: i did if that is the same as M-x packages-install followed by clojure-mode
19:37m7di'll try the others from elpa too as you suggest
19:38scottjslime from elpa doesn't have contrib (I think) so if you want fancy stuff you need trunk
19:38m7dscottj: i just grabbed the swank-clojure bits from elpa and i'll do a cvs checkout on my slime install
19:39technomancyswank-clojure.el is deprecated; skip it
19:39technomancyyou just want slime-repl, clojure-mode, and paredit from package.el
19:40m7dtechnomancy: ok, i'll check those instead, i use paredit all the time for cl, so maybe i don't need that and now i have clojure-mode, so i'll grab slime-repl
19:40m7d\
19:40m7dgot the new slime bits
19:40scottjif you're going cvs you don't need slime-repl from elpa
19:40m7dscottj: k, thanks...doin it now
19:41technomancyparedit 20 is missing a few features that are good to have in clojure
19:41m7di guess i already have slime-repl since i use slime for cl all the time, i just tried to get it and it said i already have it
19:42m7dso now i guess i just need to load things up in my .emacs
19:43scottjtechnomancy: following up on yesterday, so where are you seeing difftest output? lein test, in repl on C-c C-, or in C-c '?
19:44technomancyscottj: yeah, I misspoke; it's just lein test
19:45m7dtechnomancy: how do i get those missing features then?
19:45technomancym7d: the swank-clojure readme shows how to add "technomancy" as a package source; once you do that you can get paredit 22
19:46m7dtechnomancy: ok, thanks
19:47m7dtechnomancy: i thought swank-clojure was deprecated? don't i want that for slime-connect?
19:48technomancyslime-connect is part of slime
19:48scottjjust the emacs lisp file is deped
19:48m7dright, what am i say, sorry, drinking from the firehose, this is my first hour of clojure
19:49technomancyit's confusing
19:49m7ds/say/saying
19:49sexpbot<m7d> right, what am i saying, sorry, drinking from the firehose, this is my first hour of clojure
19:49alexykwow, sexpbot has come a long way! it evolved into a vi
19:49scottjclojure box for windows is really nice
19:49amalloyalexyk: soon we'll be adding non-modal editing :)
19:49technomancyit'll be a lot easier once Emacs 24 is released with built-in package.el
19:50alexykscottj: did you mean, windows box for clojure is nice? :)
19:50scottjhaha
19:50m7dwell, it wasn't any easier getting setup with cl, i just want to do this as fast as possible
19:51m7dmy cl emacs rig is tricked out so i guess i have to invest the time here as well
19:51scottjif you use lein, install swnak-clojure as a plugin, and use slime-connect it's pretty easy
19:52scottjif you already had slime for cl then you'd just need clojure-mode, just like any other programming language mode for emacs
19:53m7dscottj: thanks, that's sounds more direct
20:03aoeu256err under the clojure box slime repl how do you terminate your input after calling (read)?
20:03vIkSiTlo all
20:04vIkSiTI've got a function that returns a list or a seq
20:04hiredmanlists are seqs
20:04vIkSiThow would i declare 2 vars to get the value of list[0] and list[1]?
20:04vIkSiThiredman, indeed..
20:05vIkSiTI'd like to have a and b assigned to 1 and 2 respectively, given [1 2]
20:05vIkSiThow would I do that?
20:05aoeu256(def a (first list))
20:05aoeu256(def b (second list)) ?
20:05tomojdo you really mean 'vars'? :(
20:06amalloy&(let [[a b] [1 2]] (print a b))
20:06sexpbot⟹ 1 2nil
20:06amalloyaoeu256: ^^
20:07vIkSiTamalloy, aah.
20:07vIkSiTis there a way to do that for globally scoped variables?
20:07amalloyvIkSiT: no. but don't do it :P
20:07vIkSiTtomoj, er, vars have a special meaning do they?
20:07vIkSiTamalloy, right :)
20:09amalloyvIkSiT: vars are one of clojure's mutable reference types. they're used [almost] exclusively for storing globals, like defns and defs
20:10_ato(def a 1) <-- var
20:10m7dtechnomancy: so i did lein install swank-clojure and got swank running fine, but when i slime-connect it says my version of slime and swank are different versions "do you want to continue?" continuing blows up
20:11tomojwhat do we call the things let establishes? local bindings?
20:11vIkSiTamalloy, aah
20:11amalloytomoj: i think so. locals, maybe
20:11_atoyeah, lexical binding or local binding or let binding
20:11technomancym7d: that's a bug in slime's packaging; it's fixed in the version from my personal archive
20:12technomancyoh wait, never mind
20:12m7di have a brand new slime checkout
20:12technomancythe bug is that it asks
20:12technomancym7d: oh, yeah I don't know how swank works with cvs slime. many problems have been reported.
20:12m7dtechnomancy: m, ok, lesson learned
20:13technomancysome people have gotten it working supposedly, but I haven't paid attention since I'm not interested in CL
20:13m7dright
20:13technomancyand they haven't contributed any docs or upstream fixes
20:13m7di think that article i referenced will be a good one since he is doing both, i'll have to wade through it or similar i guess
20:14m7di definitely don't want to break my cl slime stuff
20:14aoeu256Question: In the slime repl how do you terminate your input after calling (read)?
20:16amalloyaoeu256: iirc slime doesn't play very nice with stdin
20:16amalloyyou could try C-j or C-o or something, if ret doesn't work, but i wouldn't hold my breath
20:17_atoaoeu256: try the *inferior-lisp* buffer if you launched clojure from within emacs with M-x slime. Otherwise try the terminal you ran swank from
20:18vIkSiTalso, does anyone here use aleph?
20:19tomojyep
20:20tomojthat I use aleph doesn't mean I can answer your question, but maybe someone who doesn't answer your meta-question can
20:27ossareh'lo all
20:28aoeu256_ato: thanks
20:28amalloyclojurebot: ask?
20:28clojurebotI don't understand.
20:30amalloyanyway vIkSiT, it's very tempting to ask whether anyone can help before you ask an actual question, because it feels more "polite", but all it does is waste everyone's time; nobody knows they can help until they hear a real question
20:38vIkSiTamalloy, i agree, i'm a bit proponent of "dont ask to ask" :) but that *was* my question - curious to see how many people use it
20:38vIkSiTbig*
20:44amalloyhah
21:13technomancyclojurebot: anyone?
21:13clojurebotPlease do not ask if anyone uses, knows, is good with, can help you with <some program or library>. Instead, ask your real question and someone will answer if they can help.
21:13technomancyamalloy_: I think that's what you're looking for =)
21:23tomojvIkSiT: I see
21:23tomojlooking over the aleph mailing list gives you some idea
21:23tomojI think I saw you posted there recently
21:38vIkSiTtomoj, indeed. I was curious to see if there was an overlap from the mailing list to IRC..
22:00unclebob_I could use a hand setting up emacs for clojure. Anybody willing?
22:03amalloytechnomancy?
22:03clojurebottechnomancy is to blame for all failures
22:03hiredman~botsnack
22:03clojurebotthanks; that was delicious. (nom nom nom)
22:04unclebob_Yeah, technomancy
22:06unclebob_It's some kind of problem with elpa
22:06unclebob_it can't download clojure jars
22:06unclebob_and it can't acquare clojure-test-mode
22:06unclebob_Perhaps I should try a different emacs.
22:08technomancyunclebob_: the swank-clojure readme has advice for a more up-to-date packgae.el version
22:14ossarehI'm making use of the :handler option in c.c.http.agent - what is the clojureish way to read the entire body in this situation - you're obliged to use (stream httpagent) to get a HTTPInputStream - and I could read it all - but I feel this is wrapped up nicely somewhere for me.
22:15amalloyossareh: slurp?
22:16ossareh,(doc slurp)
22:16clojurebot"([f & opts]); Reads the file named by f using the encoding enc into a string and returns it."
22:17ossarehamalloy: I considered that but stopped on the back of it requiring a file.
22:18ossarehworks beautifully
22:18unclebob_No luck. I think I'll give up for awhile.
22:18ossarehthanks amalloy ! (I think that is at least 5 beers you're owed from me)
22:19amalloyossareh: i think slurp just works on input streams really, and will coerce things to input streams if necessary
22:21ossarehamalloy: certainly seems that way - I'm going to have to work reading core.clj into my self study
22:45ossarehhmm - so I am using pmap to map a function onto 50k elements - the function triggers a http.agent which returns an agent. I don't care about the returned data, but the returned data is causing me to OOM. Any thoughts? the functions are impure so I care only about a data structure that is updated as part of my mapped function.
22:46ossarehI guess I could return nil - perhaps I wont oom with 50k nils?
22:48amalloyossareh: pcall
22:48amalloy&(doc pcall)
22:48sexpbotjava.lang.Exception: Unable to resolve var: pcall in this context
22:48amalloy&(doc pcalls)
22:48sexpbot⟹ "([& fns]); Executes the no-arg fns in parallel, returning a lazy sequence of their values"
22:48ossarehnice!
22:48amalloyhm, i guess not. that's still returning values
22:49amalloy#(do (uninteresting-data-with-side-effects) nil)?
22:50ossarehpretty much what I'm doing
22:50ossarehI'm OK with the nils being returned - cheers.
22:51ossarehI think asking the question initially helped my brain realise the issue - there should be a channel for that #randomstatementstohelpmethink
22:51amalloyossareh: #/dev/null
22:53ossarehnow an auto-join room for me ;)
22:53amalloyossareh: you could also do (comp boolean myfunc), which is probably shorter than the (do) nonsense, still lets you tell nil from non-nil
23:04ossarehamalloy: I guess I could wrap it in a filter with (not= nil x)
23:04amalloyossareh: ##(doc keep)
23:04sexpbot⟹ "([f coll]); Returns a lazy sequence of the non-nil results of (f item). Note, this means false return values will be included. f must be free of side-effects."
23:05ossarehI'll give it show once my current pmap stops
23:05amalloyalso, (complement nil?) is the same as #(not= nil %)
23:06ossarehah, that is nice
23:06ossarehI have not-nil? defined in most of my projects
23:07amalloyossareh: i like to (def ! complement), so i can write (! nil?)
23:08hiredman(comp not nil?) is shorter
23:09ossareh(comp not nil?) is nice
23:09amalloyhiredman: (comp not foo) is shorter than (complement foo); if that were sufficient reason not to use complement, it wouldn't exist
23:10hiredmanamalloy: hey, man, if it was up to me it wouldn't
23:10amalloyhiredman: heh, not unreasonable. personally i'm glad to have it but wish it had a shorter name
23:11ossarehemacs error: "Variable binding depth exceeds max-specpdl-size"
23:11ossarehany emacs people able to help me with ^
23:12technomancyossareh: that's a stack overflow
23:15ossarehswank.commands.basic$eval985$invoke_nth_restart_for_emacs__986.invoke(basic.clj:447)
23:15ossarehthat seems to be the top level exception - pressing "0" to quit to slime causes the other exception
23:15technomancyM-x toplevel might be of help
23:16ossarehtechnomancy: gets me back to slime, thanks - though I can't do anything - seems it is fubar.
23:17technomancyM-x slime-connect will get you a fresh connection
23:18ossarehslime-net-filter(#<process SLIME Lisp> "000023(:write-string \"nil\n\" :repl-result)000016(:return (:ok nil) 66)000019(:debug-activate 1 1 nil)")
23:18auserhola technomancy ... I've got a q for you... I want to run a function before all the tests run when using 'lein test' Is that possible?
23:19technomancyauser: yeah, that's what robert hooke is for; see the prepend macro
23:19auserthanks :)
23:19technomancyhttps://github.com/technomancy/robert-hooke
23:19auserhow about all the tests globally?
23:20auserbefore everyone, I mean
23:20auserlooking, thanks for the link technomancy
23:21technomancyalso possibly relevant: http://technomancy.us/141
23:52cemerickBack in the compojure 0.3.x days, a response vector's contents would be intelligently merged into a single response map for ring. That looks to have been removed; is the equivalent still available somewhere in the current revs of compojure or ring?
23:57cemerickhrm, I suppose not; that behaviour was implemented by an update-response multimethod with a variety of impls