#clojure logs

2009-06-02

00:02cadshey, I'm looking for a better shell in which to write some clojure frontend functions like commandline options and such
00:03cadsI have one written in sh but I'd like to write more complex features more easily
00:03hiredmancads: have you looked at hashdot?
00:03cadsshould I consider doing command argument processing using clojure scripts, or take the shell aproach to a higher level with something like the scheme-shell
00:03cadswill do
00:04cadsperfect
00:04cads"first class status on Unix-like operating systems"
00:04cadsnice
00:05cadswow, so perfect
00:07cadshiredman: was thinking about your uncurry function
00:07cadswrote a few variants of the concept, based on it
00:08cadsdo you get to use uncurry much?
00:08cadsI was wondering what other designs you may have considered
00:11replacatwopoint718: not exactly, the first argument is the instance of that class that you have created with the constructor
00:16hiredmancads: just the one
00:17twopoint718replaca: okay, so that explains the arity error that I was getting.
00:31twopoint718replaca: thanks, I have my test case working.
00:53replacatwopoint718: (wandered away for a few minutes) - great, glad it helped
01:21cadshey
01:24cadsI've got (? [x] (* x x)) working well using (defmacro ? [vec form] (list 'fn vec form))
01:26hiredman(defmaco ? [& foo] `(fn ~@foo))
01:27cadshow could I write that macro to take for example (? x y z . (print x y z) (* x y z)) or (? (print %1 %2 %&) (apply * %1 %2 %&))?
01:27cadsah
01:28cadsso based on the arguments to ? being either divided by . or using %, i'd like to simulate fns and #()s
01:29hiredmanyou find the . and walk backwards accumulating parameter names, then emit a fn form
01:29cadsactually I don't think I want %s in there...
01:30cadsthis is going to be neat, i will use them all the time
01:30hiredmanyou've seen transform?
01:30cadsI couldn't understand what it does :D
01:30hiredmanhmm
01:31cads"ugh, read the source. this started as a very specific function and turned into a very generic one."
01:31cadsthe doc string helps me a lot :)
01:31hiredman:P
01:31scgilardiwhere is transform?
01:31cadscan you write the haskell-like type of transform?
01:31hiredman~transform
01:31clojurebottransform is http://github.com/hiredman/odds-and-ends/blob/8a84e6ddbad9d71f714ba16c3e1239633228a7eb/functional.clj
01:32hiredmancads: uh, dunno much haskell
01:32hiredmanand it's been a while since I touched transform
01:33cadsack, I can't grok it!
01:33cadsif it's finished, then it gives out se...
01:33hiredmanso transform takes something (usually a zipper ala clojure.zip) a predicated a function to apply if the predicate returns true for any node in the zipper
01:34cadsif it's not finished it recurs in one of two ways
01:34hiredmanoh, and fin to check to see if you are finished walking the zipper
01:35hiredman,(pl inc $ inc $ inc $ 0)
01:35clojurebot3
01:35cadsyes, i've seen that trickery before :)
01:36hiredmanso pl uses transform to walk a seq-zip and make alterations
01:36hiredmanactually it uses transforml and transformr
01:36cadslol: `(do ~@(-> forms zip/seq-zip fast-fwd dollar-sign-application interpunc-comp zip/root zip/seq-zip prefix-uncurry zip/root zip/seq-zip prefix-flip zip/root))
01:37cadsnow that's functional :)
01:37hiredmanhmm
01:37cadsI think I can do the same thing for my simple .
01:37hiredmanI think you might run into problems
01:38hiredmanthe . symbol may be reserved by clojure
01:38hiredmanfor java interop
01:38hiredman,'.
01:38clojurebot.
01:38hiredman,(let [. 1] .)
01:38clojurebotjava.lang.ClassFormatError: Illegal field name "." in class sandbox$eval__2794
01:38cadsI could use -> or : as well I suppose
01:39cadsthe period just makes it look oldskool
01:39scgilardi. is our tiniest little special form
01:40cadsso we gotta edit java if we want to make it work?
01:41scgilardiyou can get your list unevaluated. at that time it's just a symbol. you may be able to get it to work.
01:41hiredmanI would recommend against repurposing a special form for something else
01:42cadsnot unless I could make it work backwards as well.. I don't want to break my implementation against other's people's code, after all
01:42cadswould be nice if the reader was fully extensible so we could fully repurpose the language if we wanted
01:43hiredmancads: it would be annoying
01:43hiredman"I wrote this in clojure, but it is completely different and all the special forms have been switched around"
01:45cadswell if you were using clojure for making a complete language for describing operations on cad drawings for example, you probably want to map different ideas to some of the special forms
01:46cadssuch code would be less than general purpose but should be expected to able to be included in normal code
01:47cadsin the long term we might see someone wanting to write a proof description language on top of clojure or something
01:48hiredmanthe set of special forms is very small, 10? I think it is no small burden to give them
01:48hiredmanup
01:50cadslol, the dispatch macro table could be especially extensible
01:51cadsjust looking at the code; when the reader sees # it just looks up the next symbol in a table to see whether it should read a set, a fn or metadata, etc.
01:53cads/ macros['|'] = new ArgVectorReader();
01:53cadserr
01:53cadsit's a line that's commented out of the lispreader.java
01:54cadsthank god :)
01:54cads(fn |x y z| ...) would be so terrible
01:55cadslike ruby blocks
05:46djpowellhmm - JDK update 14 has an option to enable escape analysis - I wonder if it speeds up clojure at all
05:46djpowellalso the disturbing: "Although G1 [garbage collection] is available for use in this release, note that production use of G1 is only permitted where a Java support contract has been purchased. G1 is supported thru Sun's Java Platform Standard Edition for Business program"
05:48ryseek
05:48rysThat smells bad
05:48piyodjpowell: http://tech.slashdot.org/article.pl?sid=09/05/29/1711203
05:51djpowellah, so G1 is in openjdk? I haven't had need to look at openjdk yet.
05:52piyofrom one commentor: "The G1 collector is still a "work in progress" so they are suggesting that you use it *in production* only if you have a support contract with Sun (Oracle?). This is not a big deal. You can still use it, just enable it with "-XX:+UnlockExperimentalVMOptions -XX:+UseG1GC" on the command line..."
05:52piyoyou can turn it on yourself, and keep the pieces when it breaks
05:53eevar2openjdk is great. never been easier to get java on debian
05:54djpowellthat doesn't placate me much. i get the impression that you would be breaking the licence agreement. surely sun wouldn't be encouraging only their paying customers to try it if it was unstable. i get the impression that this is more about making money than protecting people from experimental features - there are loads of -XX experimental features anyway
05:54eevar2just don't install any recommended packages, as they tend to pull in the gnu java stuff :/
05:54djpowelluh that slashdot thread is full of people complaining about the speed of java - it is like it is 1998 or something
05:55rysSeems like they're saying it's best to turn it on only if we can help you debug issues
05:58djpowellis G1 just about low-pause then, or does it have decent throughput too? I imagine low-pause is more of a thing for GUI apps; I doubt that is that important to most clojure people
10:31ChouserI think I'm abusing atoms.
10:31rsynnottfilth!
10:32rysPoor atoms :(
10:33Chouserturns out they behave well even if you throw exceptions from inside the fn you give to 'swap!'
10:33stuartsierraWhat happens to the value?
10:33Chouserstays what it was
10:34Chouser,(let [x (atom 5)] (swap! x inc) (swap! x #(throw (Exception. (str "foo" %)))))
10:34clojurebotjava.lang.Exception: foo6
10:34Chouseroh
10:34Chouser,(let [x (atom 5)] (swap! x inc) (swap! x #(throw (Exception. (str "foo" %)))) x)
10:34clojurebotjava.lang.Exception: foo6
10:34Chouseroh
10:34Chouserwell, anyway, it would be 6 there. :-)
10:35ChouserSo I'm hoping that counts as "free of side effects"
10:41Chousukehmm
10:42ChousukeI guess the exception just aborts the swap altogether so there's no fear that it'd get retried.
10:43Chouseroh! add-watch and add-watcher both exist.
10:43Chousukebut what would happen in a situation where the first swap doesn't throw an exception, gets retried, and that retry does throw an exception
10:44ChouserChousuke: should be the same, it's just a loop.
11:31wwmorganhas anyone been able to get clojure.contrib.pprint to work with *print-dup* on? Pretty printing {:foo :bar} spits out {:foo" ":bar} when *print-dup* is bound to true
11:35replacawwmorgan: sorry, print dup is not supported yet. But your behavior with the quotes is some kind of bug. I'll take a look.
11:36wwmorganthanks replaca
11:36replacawwmorgan: *print-dup* is coming, though!
11:58grzmanyone know if stuart sierra is still on at lispnyc next Tuesday?
12:23jensCDHi. I am new to clojure and had a problem with emacs. (I use ubuntu, emacs 22 and installed slime and swank for clojure).
12:24jensCDAfter certain gestures (e.g. resizing the emacs windows) my PC was frozen (maybe all keyboard events where catched). Did anybody had a corresponding experience?
12:28chessguy_workfor a second there, i thought you meant mouse guestures, like in firefox. that would be a....strange emacs feature
12:29technomancyjensCD: did you have any network access going on at the time?
12:30technomancyjensCD: Emacs has no concurrency support, so many operations are blocking.
12:30mattrepland of course: http://www.emacswiki.org/emacs/StrokeMode
12:30mattrepljensCD: I've noticed slowdown when the slime buffer contains longish lines
12:31jensCDIn fact I could "heal" the freeze by removing the network cable (found experiment).
12:32jensCDOnly the mouse movement reacted. But nothing else.
12:34technomancyjensCD: were you using that instance for anything else?
12:34technomancychecking mail, irc, etc?
12:34jensCDyes. Mail, firefox and others
12:35technomancyjensCD: I mean in that Emacs instance
12:35jensCDno
12:36jensCDThe freezing is reproducable e.g. after resizing the emacs window.
12:37technomancyjensCD: that's very strange; I've never seen anything like it. I know the X font rendering engine changed in 23, maybe you could try upgrading
12:37technomancythe package is called emacs-snapshot
12:38jensCDWhat is the preferred editor in the community? Maybe I switch to something else?
12:39technomancynah; nothing beats slime. =)
12:40cemerickjensCD: here be dragons. Don't listen to technomancy anyway -- he's on the take. ;-)
12:40cemerickjensCD: I use netbeans + enclojure, FWIW
12:41cemerickI hear the intellij environment is getting decent. There's also an eclipse plugin, though I don't know much of anything about that.
12:42jensCDTechnomancy/Cemerick: Thanks for the remarks. I will continue investigating.
12:43technomancyjensCD: they would probably know better in #emacs; they're usually pretty helpful in there
12:43jensCDok. Thx.
12:44technomancybut if you're on Ubuntu there's very little reason to stick with version 22.
12:45jensCDYou recommend to go for 23?
12:46technomancyyeah, the upgrade path is really easy
12:46technomancyat least check to see if the same problem manifests there
12:46jensCDok. I will give it a try.
12:59replacajensCD: in ubuntu (at least uptodate versions) snapshot == 23 if you've updated in in the last 6 months or so
13:19gnuvinceWho was the blad hobo with Schwartz during the keynote?
13:20gnuvince*bald
13:46hlshipwhen is Rich's talks on Clojure at JavaOne?
13:52replacaI think the script bowl is about to begin and then I think his overview talk is early afternoon
13:52replacabut I don't have the schedule in front of me
13:53replacaI'm watchig the twitter stream from JavaOne at http://twitterfall.com/?trend=javaone
13:54ataggartI don't know what to make of the still strong interest in EJBs
13:56hlshiptoo bad, I don't get there until tomorrow
13:57Chousertwitterfall seems to be a bit behind?
13:57replacait looks like it just stalled. Is it twitterfall or twitter, I wonder.
13:58replacaIt was zooming along for a while
13:58technomancywhat's this talk of a JDK7 announcement?
13:58replacadunno what it means
13:58ataggartthe tweets get queued
13:58ChouserI've a got a search for javaone on twitter open, and it seems to be up to date.
13:59technomancydoes Clojure run on the JDK7?
13:59ataggartI can't hitnk of why it wouldn't
14:00technomancythere's no timeline on a release though right?
14:00technomancylast I heard they hadn't even decided if TCO was going to make it in.
14:00ataggartwhich means it won't
14:00technomancyjerks
14:00ataggartya
14:01ataggartI still haven't figured out how invokedynamic would help (assuming it even makes it in)
14:01technomancyataggart: it doesn't help clojure; it's for jruby and friends
14:01ataggartmy bytecode level understanding of java is lacking
14:01ataggarthrm
14:02technomancysad that Ruby will get TCO before Clojure.
14:02ataggarthey, at least we know python won't ;)
14:03ataggartyou going to the thing tomorrow?
14:03technomancyyep
14:03ataggartnice
14:04cemericktechnomancy: you mean cruby or merv or whatever?
14:04technomancyhmm; the JRuby dev seems to think TCO is a done deal in Java 7 as of three months ago
14:04technomancycemerick: ruby 1.9.1 (yarv) has it implemented but turned off by default
14:04technomancythat's the latest stable "canonical" Ruby implementation
14:04cemerickah, yarv, right.
14:05technomancyheh
14:06technomancyhttp://www.ruby-forum.com/topic/180790#791664 <= re jdk7 development and TCO
14:08replacarich is up, according to http://twitter.com/kaarenilsen
14:11Chouserand now scala. so that was it?
14:11gnuvinceOh great...: "maudrit Clojure - too many parentesis for my taste"
14:12ataggart"Showing Life-application. A lot of code to make it work ..."
14:12cemerickdamn, has he looked at the curly-braces in other languages?
14:12ataggartRich should have asked Stuart if he could use the StringUtils example from the book
14:13ataggart*less* loc, branches, etc than the java version
14:13ataggarterm... fewer
14:16gnuvincecemerick: that's usually what I say, but apparently braces are "different"
14:16ataggartnot that I agree with the conclusions, but there is a different visual effect which can help convey information
14:16gnuvinceAlso, I wonder if a not-too-trivial program written in Clojure and Java wouldn't have more braces + parens than Clojure has parens.
14:17cemerickI think it's actually the depth of nesting that one often sees. )))))))) can be frightening, if you're not familiar with editors that make dealing with that trivial.
14:17cemerickgnuvince: they do, almost universally.
14:17ataggartwriting java intrp-op in clojure certainly seems to involve less parens
14:17gnuvinceI think nesting is more a property of functional programming I think than Clojure itself.
14:18gnuvinceLook at programs written in Clojure, Erlang, Haskell, etc. they usually have a lot more indentation than equivalent imperative programs
14:18gnuvincedo_this();
14:18gnuvincedo_that();
14:18gnuvincevs.
14:18gnuvincetake_this(
14:18gnuvince take_that(
14:18cemerickeh, scala avoids it because of the convention. If it closed top-levels with }}}}}}}, I think the complaint would be the same.
14:18gnuvince filter_those()))
14:19cemerickmaybe demo code should have (most?) close-parens on their own lines, indented sensibly
14:19cemerick(that's obviously a bad idea)
14:19gnuvinceWhen you're in functional mode, a function is usually a single expression, so having a bunch of lines indented at the same level makes no sense.
14:19gnuvinceI don't think trying to pretend that we write code this way is a good idea
14:20ataggartor you could take the )))))) and drop it down to a line by itself, and then just don't scroll down all the way
14:20ChouserI think if you're used to reading procedural code, you're not used to holding the deep nesting context in your head. Instead you hold your complex mutable state (args, local variables, instanace members, etc.)
14:21technomancyif people are dismissing clojure because of the literal shape that its programs take, they probably aren't interested in actually evaluating it.
14:21ataggart^^
14:21technomancythey're probably just looking for justification to stay inside their comfort zone
14:21ataggartin other news: http://e3.g4tv.com//e32009/g4onthefloor/wiebecam/
14:21cemerick+1 technomancy
14:23technomancythere are a lot of people who just want to believe that they're going to stay relevant by just churning out Java forever because they don't want to go through the initial "I suck at this" phase of learning something new. so their subconsciousness invents reasons for them.
14:23technomancyit's a neat trick your mind can pull on you. =)
14:24gnuvinceI'm actually afraid of the exact opposite
14:24gnuvince"Oh no, I don't know Java, C#, C++, Haskell, etc. I need to get cracking right now!"
14:24Chouserround two of scriptbowl
14:25ataggartby "round" do you mean language, or is it really some kind of "rounds" scheme going on?
14:25ChouserThere are *so* many languages, and the effort required to really learn one well is so significant, you have to have some way of dismissing 90% of them without a full evaluation.
14:26Chouserataggart: they did some kind of 4 minute demo for each language, now I think they're going around again with 4 minutes each for "cummunity features" or something.
14:26ataggart"OK gentlemen, your next challenge: implement a red-black tree. GO!"
14:26ataggartahh ok
14:29gnuvinceChouser: sure, but I think there's a way to pick a few ones.
14:29Chousukeataggart: that'd make clojure look bad I think :/
14:30ataggartthe RBT?
14:30Chousukeyeah
14:30ataggartit was the first CS-y thing I could think of
14:30ChousukeI think it'd be quite slow because of immutability, and probably pretty complex too.
14:32Chousersorted-map is an immutable red-black tree.
14:33Chouserlots more "cool jruby" and "cool groovy" tweets than "cool clojure"
14:33ChousukeChouser: but it's actually implemented in java.
14:33ChouserChousuke: yes
14:33cemerickChouser: to be expected, I think
14:33ChouserBut *I* can implement it in clojure like this: (sorted-map)
14:33Chouser:-)
14:34ataggartWould I be correct to think the "coolness" may be an artifact of the app and not the language?
14:34ChousukeChouser: :)
14:34cemerickChousuke: yes, I've done an RB tree in clojure, and it is pretty painful
14:34cemerickit's a mismatch really -- many better ways to get to the same objective.
14:35Chouserataggart: probably, cure.
14:35Chousersure
14:37stuhood...implemented in java
14:37stuhoodoops
14:37cemerickdoes anyone know what the objective is in terms of promoting clojure in general? Is there a particular critical mass that is desired, etc.?
14:38technomancycemerick: I don't think there's a Master Plan
14:38Chousercemerick: the objective for the rest of us is to be able to get jobs writing Clojure full time.
14:39danlarkinaye!
14:39Chousercemerick: you're just ahead of the game. :-)
14:39Chouser"Interesting how #Clojure source almost looks like #Spring xml configuration files."
14:39ataggartDamning with faint praise, eh?
14:39technomancyChouser: careful; you'll make me spill my drink
14:40replacaChouser: lisp is strange when you first see it! People love their curly braces. This was Gosling's insight that led to Java's success.
14:41Chouserheh
14:41cemerickChouser: I was going to say, I've got that one covered already, so what's the big hub-bub, bub? ;-)
14:41technomancyif you write XML, it will keep you fit and trim: http://justlooking.recursion.org/camping-xml-situps.png
14:41Chouser"Groovy is clearly winning the Script Bowl right now. Clojure too complicated to get across. Scala-guy not prepared enough."
14:41ataggarttechnomancy: awesome!
14:42hiredmanChouser: *rabble* *rabble*
14:42cemerickwe should have a product launch this summer. Maybe we'll just start growing like a weed, and hire the entire population of clojure programmers. :-P
14:43technomancythe great thing about hiring clojure programmers right now is even though the pool is small the supply of jobs is even smaller. =)
14:44cemerickyeah, probably right.
14:44replacaI just poked my head into the #scala group and they're talking about contra-variance. I don't think clojure's more complex than that! :-)
14:44rysAre there any case studies or what have you from people using it in production?
14:44cemerickEspecially since I'd be perfectly comfortable hiring anyone with a functional programming background.
14:45hiredmanreplaca: #scala goes on and on about "Arrows"
14:45replacahiredman: of cource, half the conversation in here isabout how to get slime set up :-)
14:46replacaack, spelling fail
14:46hiredmantoo bad technomancy over wrote all the emacs factoids
14:46hiredman"emacs is hard, lets go shopping!"
14:46technomancyhiredman: we still have you to say them, even if clojurebot has forgotten
14:47ataggartthat the first thing a java guy has to deal with when looking at clojure is emacs... it's less than ideal.
14:47ChouserIs atom-abuse a crime, or just frowned-upon?
14:47technomancymost of the questions are from folks who found a seven-month-old blog post about using Clojure together with Common Lisp and checking out about seven repositories by hand...
14:47cemerickataggart: enclojure is top-notch, and pretty, and fast :-)
14:48ataggartI couldn't grok how netbeans was laid out. Been working in eclipse too long.
14:48Chouseremacs really isn't a requirement.
14:48Chouser"The winner is between Groovy and Scala"
14:49technomancynot my fault if Google ranks out-of-date stuff over my tutorial. =)
14:49Chouser"scripting shootout winner is? groovy from the sounds of the applause. then probably scala then jruby "
14:49Chouser"according the applause groovy is the winner of the script bowl"
14:49Chouser"Ruby is the winner of the #ScriptBowl"
14:49Chouser"script bowl winners: groovy followed by scala"
14:49technomancyand groovy just ... happens to be the closest to Java in terms of syntax.
14:49technomancycoincidence?
14:49cemerickChouser: man, reviled by the lispers, ignored by the java folks
14:49replacasounds like familiarity is winning out, which is to be expected
14:49Chouser"Groovy the clear audience favorite."
14:49gnuvinceGroovy happens to be the least interesting language of the bunch.
14:50replacabut if what you're after is "dynamic java," groovy is pretty compelling
14:50ataggartanyone know what Rich was using to demo clojure?
14:50technomancyreplaca: the right answer to the wrong question. =)
14:51replacait matches the platform really well and it's very easy for Java folks to get
14:51Chousersounds like he showed the parallel life thing
14:51replacatechnomancy: depends what you're trying to accomplish
14:51gnuvinceToo bad he only had a dual core
14:51Chouser"Heading to Hall E 133 for the Clojure intro. I liked the Clojure approach to coding from the Script Bowl."
14:51Chousertell me to stop posting tweets so I can get work done.
14:52gnuvinceIf a 32-core Sun machine had been available and he could've shown all those cores crunching, that would've made some people go "whoa!"
14:52stuhoodstop posting tweets! everyone watch http://twitter.com/#search?q=script%20bowl
14:52ataggartchouser: more tweets!
14:52gnuvinceI don't understand though how Robert Fischer can represent for Groovy
14:53gnuvinceGuy is a big, big fan of static typing and Groovy is like the total opposite of that.
14:53hiredmanstuhood: I could turn on clojurebot's twitter gateway
14:54ataggartis there nothing clojurebot can't do?!
14:54stuhoodhiredman: i think the flood of script bowl tweets has mostly flowed
14:54gnuvinceSo now we watch what people think of the Clojure introduction?
14:57replacaapparently it's at 12:30
14:58jensCD@cemerick/technomancy et al.: Just for your information: After installing emacs 23 snapshot the reported problems have disappeared. Thanks again for support!
14:58technomancyjensCD: cool. 23 is a lot nicer on X since the font backend was revamped, so I think you'll be better off with that anyway.
14:59cemerickjensCD: glad you're set up. Welcome!
14:59technomancyjensCD: it's technically not released yet, but I've been using it for years, and it's very stable for me.
14:59cemerickyears?
15:00cemerickthat emacs release cycle is something else ;-)
15:00technomancywell I started using it right after 22 was released. =)
15:00technomancynever had a crash
15:03rysIs the peepcode screencast worth the 9 bucks?
15:05Chouserwow what a great photo: http://www.mobypicture.com/user/dedwards/view/252762
15:05ataggartit's good if you don't know anything about clojure and don't want to look at the website
15:06technomancyrys: depends on a lot of factors... how much have you done with clojure so far... how much have you done with other similar languages... how much is $9 worth to you vs time spent figuring it out on your own. =)
15:06gnuvinceStupid lazy evaluation... Rich didn't need his face yet, so it hasn't been computed.
15:06Chousergnuvince: ha!
15:06gnuvinceThose lazy evaluation jokes are just too easy
15:06gnuvince:)
15:07Chousukegnuvince: I have an infinite supply of them. it's just problematic to compute one when needed :/
15:07gnuvince;)
15:10Chouser"Script bowl session has really piqued my interest in Clojure" ...that's better.
15:10hiredman"The Clojure guy was very hardcore. No smooth presentation for us that are a bit slow"
15:11rysAh, what the hell, $9 is made while waking up in a morning over coffee at work
15:11cemerickseparates the wheat from the chaff, etc.
15:11danlarkintechnomancy: $$$
15:11technomancyrys: disclosure: I wrote the peepcode script. =)
15:12cemerickI still don't get the peepcode thing. I guess my head just isn't wired for that kind of learning.
15:12ataggartI would have paid more than $9 if they got Stephen Fry to narrate it.
15:12rysWell, I found the link from your site, so I figured you might have had a hand somewhere along the line!
15:13technomancyrys: heh; should probably put a disclosure there too
15:13ryshehe
15:13ataggartcemerick: it's a nice shortcut to see if something appeals to you without having to invest a significant amount of time.
15:14technomancyeveryone's got a different learning style
15:14replacaNew Clojure motto: "Too hardcore if you're a bit slow" :-)
15:14rysMy brains seems to absorb information presented like that pretty well, so I might as well
15:15ataggartI'll be happy if we never get the hype of Ruby
15:15technomancyataggart: to some degree that's unavoidable
15:15rysPlus, I hack using vim, so I need all the help I can get with emacs and slime :)
15:16ataggartanyone use TextMate for clojure on a regular basis?
15:16cemerickreplaca: nice :-)
15:16cemericklast I saw, it's plugin system uses regexes for syntax highlighting, etc. Not so hot for something like a lisp.
15:16cemericks/it's/its
15:17technomancyrys: oh, are you talking about the Emacs peepcode or the Clojure one?
15:17rysI got both in the end
15:18technomancyrys: we're working on a free promotional "editors for clojure" screencast, but it's gotten bogged down in production. =\
15:19ataggartheh, I spent like 20 mins looking for that "free" cast
15:19technomancyataggart: =(
15:19ataggartno worries
15:19rysI'd seen the sample clojure one not too long ago, and now I've decided to learn the language properly, which probably means emacs if I want to be truly productive in the beginning....it's worth me getting both
15:20hiredmanrys: vim works fine
15:20ataggartdespite being fairly feature-free, I still manage to get more done with the eclipse plugin than with emacs
15:21ataggartbut that's largely a function of me wanting to learn clojure, not emacs
15:21technomancyit really depends on your workflow. if you like all-keyboard usage, you'll be happier with an environment that targets those kinds of users. if you like mousing around (I'm told some people do) then maybe try an IDE.
15:22ataggarthe says, looking down his nose... :)
15:22technomancyataggart: yeah, I'm allergic to mouse usage.
15:22technomancyI guess it shows.
15:22ataggartthe mousiness is nice when you don't know how everything works yet
15:22replacacemerick: awww, you're making me famous in the twittersphere :-)
15:23cemerickreplaca: workin' on it :-)
15:23technomancywhen I really want to get work done I take the keyboard nipple off my thinkpad.
15:23ryslol
15:23cemerickthat was a fine piece of work
15:23ataggartI find that using the mouse gives me time to think about what I want to write ;)
15:23technomancyataggart: that's what test runs are for. =)
15:23ataggartlol
15:24rysI'm very happy the mouse is there, but I tend not to move it around *that* often
15:24ataggartI actually don't use the mouse much anymore in eclipse, now that I know all the keybinds
15:24ataggartbut I know the keybinds because they're listed in the mouse menus
15:25technomancyyeah, the best way to learn Emacs keybindings is my watching someone who's really good at it.
15:25technomancy*by
15:27ataggartalas, I work from home.
15:30rysThe cool thing about the screencasts (and the epub of Stuart's book) is they're likely perfect train or bed or lunchtime fodder since I've always got my phone or laptop, so they'll be useful for time passing and watching more than once to let it sink in
15:37Chouser"Clojure. Interesante. La gente se quedo sorprendida de que todo es inmutable. Mas cuando explican los beneficios de esto"
15:37Chouser"Clojure. Interesting. People are surprised that it is immutable. But when they explained the benefits of this"
15:37Chouserthe clojure talk should be rolling now
15:38ataggartchouser: where are you seeing that?
15:39Chouserthat quote is from twitter
15:39Chouserthe clojure talk was scheduled to start at 12:30 pm pacific time, I believe.
15:39ataggartwhich twitter feed are you using? I'm not seeing those tweets
15:40Chouserhttp://twitter.com/#search?q=clojure
15:40ataggartthx
15:50Chouserwhat does #fb mean in twitter?
15:51hiredmanhttp://www.intertwingly.net/blog/2009/06/01/Wave-Robot-Ruby-Client
15:52rysChouser: I think it tells some plugin somewhere to post to your facebook status too
15:53Chouserrys: ah
15:53Chouserthanks
15:54hiredmanclojurebot: twitter?
15:54clojurebottwitteronia is where shaq lives
15:54hiredmanI see
15:54hiredmanclojurebot: twitter is <reply>http://haicolon.wordpress.com/tweetility/
15:54clojurebot'Sea, mhuise.
15:55lisppaste8Chouser pasted "swap!-when" at http://paste.lisp.org/display/81237
15:55Chouser^^^ atom abuse
15:56Chouseranyway, I think I need something like that.
16:01hiredmanI don't understand
16:02hiredmanso you have the swap depend on a side-effect driven predicate?
16:02Chouserwell, on some external state as checked by the predicate, yes.
16:03hiredman(when (pred) (swap! the-atom fn))
16:04ChouserI've got a bunch of threads trying to do things to the-atom, and I want each to either succeed (if we're not @quitting) or fail with a return value (if we are @quitting)
16:04Chouserhiredman: exactly like that, except without the race condition.
16:04hiredmanOh
16:04hiredmanI see
16:04hiredmansounds like you want refs maybe
16:05hiredmanif you can make the predicate into a ref instead of a function
16:07ChouserI thought about that, but wasn't quite sure if it would work.
16:08ChouserThe predicates I'm using check an atom, so they could check a ref instead.
16:08Chouserbut since the outcome would depend on the value of that ref, I'd need to use 'ensure', I think.
16:09hiredman~def ensure
16:09Chouseranyway, I think I understand the performance profile of this -- a single atom swap! that does flying reads on another atom!
16:09ChouserI'm pretty certain I don't know how a transaction would behave here.
16:10Chouserre scriptbowl: "Clojure and Scala had no community story."
16:10hiredmanlying dogs!
16:10technomancymaybe we should start story hour.
16:10technomancygather the kids around, grab a book from the library, etc.
16:10rysha, the reason I chose clojure was because of the community
16:11hiredmantechnomancy: read aloud from programming clojure
16:11technomancyhiredman: if only the chapters ended in cliffhangers
16:12ataggartnothing like appealing to ethos and pathos, while ignoring logos
16:13hiredmannext week we discover if Chouser can defeat Race Condition the evil warlock
16:14cemerickthat's odd -- this is the most pleasant programming community experience I've ever had.
16:15Chouserpretty hard to present that in 4 minutes, I suppose.
16:15technomancycemerick: maybe he's talking about impressions from the presentation
16:16cemerickRich could have just said "we're not assholes", and various other factions (who shall go unnamed) would just slide down in their seat a little bit. ;-)
16:16Chouserhehe
16:16ataggartI think clojure just has too many profound ideas that all work together, that it really can't be shown off in a few mins.
16:17Chouser"number of google group members: 2000. number of c.l.l-style flame wars in the last year: 0"
16:17Chousuke:)
16:17hiredmanmaybe it needed more pandering to java?
16:18ataggarthiredman, that'd be my guess
16:18triddellI'll bet that Rich got through to those in the room who were ready for clojure (no pun intended.)
16:18hlshipI've been liking the IDEA plugin, now that it can launch a REPL, but it still has a ways to go
16:19mattreplhas anyone worked on getting the slime debugger working with jdpa (the java debugging framework)?
16:19Chouser"Clojure has a lot of "there" there."; "Really enjoyed the #clojure session at #javaone" Could it be done already?
16:20hiredmanit's been 40 minutes
16:23replacaalready a blog post on the script bowl: http://tech.puredanger.com/2009/06/02/javaone-script-bowl/
16:23technomancyis he a Terracotta employee?
16:23dnolen_mattrepl: do you mean jdb? or is that something different?
16:23replacatechnomancy: dunno
16:24mattrepldnolen_: think it's what Sun calls jdb these days, I think they're the same
16:24dnolen_mattrepl: yes someone posted a very simple jdb elisp project on the mailing list
16:24hlshipI bet Clojure would have represented better at the script bowl if Stu Halloway had presented (not intended as a dig at Rich)
16:24dnolen_mattrepl: for breakpoint setting and checking locals it works well. lots of issues but better than println'ing all over the place.
16:25mattrepldnolen_: I saw that, but didn't appear to be integrated with sldb, will look closer. nice
16:25dnolen_mattrepl: oops, no it's not integrated with sldb (slime-db right?)
16:25technomancyreplaca: it sounds like rich focused on compojure when talking about the community. since that's a pretty small slice of the community maybe that's why folks thought the "community story" was lacking
16:26technomancyhah; scala talked about couchdb access.
16:26mattrepldnolen_: ah, ok. right.
16:27technomancystuartsierra: ah nice. I was wanting something like that when I was working on chrono; ended up making something slightly ugly w/ proxy
16:27hlshipIf you think that presenting the best technology is all it takes, I've got eight years of experience with Tapestry as a counter-example
16:27stuartsierratechnomancy: consider it experimental for now, but I included a few tests
16:28hlshipI've struggled hard with explaining to "ordinary" developers how cool the functional approach is
16:28dnolen_hlship: I think Clojure is like very subtle and very profound. it's hard to explain in the benefits in a immediate way.
16:29replacatechnomancy: well, the community is still getting started. Seems strong to those of us in the midst of it, but it is still small compared to the others (JRuby and Jython can leverage their parents, Groovy's been around for a long time and Scala's been doing a good job on community - hopefully we can learn from it)
16:30hlshipI agree! subtle and powerful means it takes time to embrace, time you don't have in a 60 - 90 minute slot (or 40 mins at JavaOne)
16:30technomancyhlship: not to mention 4 minutes at the script bowl.
16:30dnolen_hlship: it's really tricky, even lispers don't get it. one person thought multimethods were just like CLOS generic functions.
16:31replacalook at this kind of event to see some of what's going on with scala
16:31replacahttp://scalaliftoff.com/
16:34tbatchellihlship: I pm'd the developer of IntelliJ's clojure plugin about the meetup tomorrow in SF. He said 90% chances he'll come... maybe it is a good time to put pressure on him? I agree the plugin has ways to go ...
16:35Chousertbatchelli: "He" == Halloway?
16:35tbatchelliHe == the developer of the clojure plugin for IntelliJ
16:35Chouserah, sorry, I see that now.
16:36cp2interesting
16:36cp2'clojure with emacs and slime/swank on ubuntu' is the 7th result for a google search of 'emacs setup slime'
16:37tbatchelliIn the last Bay Area meetup there was a pretty impressive demo of integration between emac's JDB and clojure's REPL ... I really think the people from JetBrains should see that :)
16:38dnolen_tbatchelli: is that something that's released, or the same that appeared on the ML awhile ago?
16:38triddellcp2: I wrote that :-)
16:38cp2triddell: well congrats, you're popular (i guess?)
16:38tbatchellidnolen_ I think it's on github now ... let me find it
16:39technomancytriddell: care to update it? clojure-mode comes with an M-x clojure-install function that handles a lot of that stuff for you.
16:39dnolen_tbatchelli: http://github.com/GeorgeJahad/cljdb/tree/master this one?
16:39tbatchelliyup
16:39dnolen_yes that works well, same as the one the ML
16:39dnolen_has a couple of issues, but it's a great start
16:42tbatchellidnolen_ : IntelliJ on the other end has awesome Java/Clojure integration when it comes to completion ... but the debugging is not there yet, and I don't know how easy/difficult for them will be to integrate the REPL in the same way emacs does ...
16:43dnolen_tbatchelli: haven't looked at IntelliJ yet, Enclojure/NetBeans looks good. I'm an Emacs nerd now tho, too late to save me.
16:43tbatchelli... and so getting the guy from IntelliJ watch George Jahad's demo tomorrow is an attempt to matchmaking :D
16:43ataggartrevealing my ignorance: "tries" is not the same thing as "trees", right?
16:44stuartsierranot quite
16:45tbatchellidnolen_: long time user of Emacs for lisp... had to abandon it when working in Java, ... IntelliJ is a good alternative, but sometimes I still miss emac's alt-x ... nothing beats that
16:45lisppaste8Chouser annotated #81237 "abuse of IRef's in general" at http://paste.lisp.org/display/81237#1
16:46Chouseroops. that's untested
16:47hiredmanChouser: have you looked at the various BlockingQueues for coordination?
16:48Chouserhiredman: yes. I think they don't apply here. But of course I could be wrong.
16:48hiredmanI'll take your word for it then
16:49dnolen_tbatchelli: true, i am also now completely sold on paredit + colored parens (i won't move until I see this in other IDEs)
16:49Chouserin this case I've got a hash-map in an iref. As msgs come in, their handler is found in the hash-map, called, and removed.
16:49technomancyparedit is a killer feature. I had no idea how addicting it would be till I tried it.
16:49ChouserI want to block until the hash-map is empty. So it's not really a queue at all.
16:50hiredmancorrect
16:52hiredmantechnomancy: I have something similar in vim, and I tried netbeans the other day, it was hard going without it
16:53technomancyhiredman: cool, what's it called in vim?
16:53technomancyI get annoyed by the lack of paredit every time I work in a non-lisp too. =\
16:53clojurebotlisp is the red pill
16:53Hun`technomancy: you know... paredit works fine in C, too :)
16:54technomancyHun`: well I'd get annoyed writing C for other reasons. =)
16:54Hun`(and other languages...)
16:54hiredmantechnomancy: mine is mostly cobbled together
16:54cp2ah
16:54cp2paredit looks pretty neat
16:55technomancyHun`: whoa; it works in Ruby. not in JS though, oddly.
16:55technomancyoh, just not js2; works in regular javascript-mode.
16:55Hun`paredit works just on the () by default. you can M-x customize the expanded patterns to []{} though
16:55Hun`js2 does a lot of things
16:56lisppaste8Chouser annotated #81237 "await-iref (tested)" at http://paste.lisp.org/display/81237#2
16:56technomancyHun`: I think clojure-mode hacks paredit to honor []{} correctly, so I'm golden
16:57Chouserrhickey: wb. How'd the talks go?
16:57ChouserI've been posting copies of tweets here all afternoon.
16:58rhickeythey went well
16:59rhickeyI think Clojure came in 3rd, after Groovy and Scala, both of which are kind of java.next stories, so I'm satisfied
16:59rhickeynice audience for the subsequent Clojure talk
17:03hiredman"The Clojure talk was great. I didn't know you could precompile and deploy the resulting classes"
17:03cp2heh
17:08replacacp2: paredit has changed the way I think about writing code
17:09replacarhickey: congrats on your talks!
17:10replacatechnomancy: that is correct
17:10hiredmanclojurebot: bytecode?
17:10clojurebotPardon?
17:10hiredmanclojurebot: bytecode is <reply>http://homepages.inf.ed.ac.uk/kwxm/JVM/codeByNo.html
17:10clojurebotIn Ordnung
17:10cp2replaca: yeah, i like it
17:11dnolen_slurp and barf, good ol paredit
17:12replacalove that slurpin' but when I slurp too much, then I have to barf
17:13triddelltechnomancy: I'll look at the M-x clojure-install sometime soon and create a simplified tutorial. Is there anywhere quick to get the details on that?
17:13wlrlong-time lispers say "What parentheses?" when talking about reading code. paredit allows one to program that way, too by dealing with structure not just characters.
17:13technomancytriddell: my tutorial is at http://technomancy.us/126
17:14technomancyfeel free to copy or link
17:14opqdonutparedit just takes some getting used to
17:14opqdonutone has to think about (for example) structure flattenings in a more explicit way
17:14opqdonutinstead of just removing parentheses and bashing indent
17:14cp2oh wow
17:15dnolen_M-s splice to flatten one level
17:15dnolen_M-r to raise is genius
17:15cp2paredit has loads of useful things ( http://www.emacswiki.org/emacs/PareditCheatsheet )
17:16dnolen_yup
17:16triddelltechnomancy: ok, thanks. I think I ran across that the other day... I thought you were initially specifically referring to my tutorial as "very out of date and far more complicated than necessary." :-)
17:16technomancyeven if you don't learn all the commands, the simple "you have to try to end up with invalid structure" is a huge win.
17:17dnolen_but learn all the commands
17:17dnolen_force yourself
17:17technomancytriddell: no! I was referring to Bill Clementson's.
17:17dnolen_you will be happy.
17:17technomancytriddell: the stuff in yours still works; his references sourceforge repositories.
17:17triddelltechnomancy: it could probably be said for mine too but my initial reaction was "Hey!"
17:18technomancyshould probably re-word that
17:18technomancywe just get so many people in here and on the mailing list that are (rightly) confused by this diagram: http://bc.tech.coop/blog/images/clojure-emacs-setup.png
17:19cp2its not that bad
17:19cp2but i think a tree style structure would look better
17:19cp2as in, like a dir tree output
17:19triddelltechnomancy: nah, I looked at those instructions too which is why I had to write my own just to figure things out... as a newbie then at least is was way over my head
17:19technomancycp2: it's bad if it's the first thing someone reads about slime.
17:20cp2i suppose
17:23technomancyI don't understand the motivation behind paredit's version of M-; though
17:26Chousukethe fnmap thingy in contrib is neat.
17:29technomancyhiredman: any way you could get clojurebot to not announce the auto-doc commits?
17:30gnuvince_Is it normal that with a very large list (235,000 words) the following code overflows the stack: maximumBy (comparing length) myWords
17:30hiredmantechnomancy: sure
17:31technomancythanks
17:31Chousukewhy would it? :/
17:32Chousukegnuvince_: I don't think it's normal.
17:32gnuvince_Wrong channel
17:32gnuvince_I meant to ask in #haskell
17:32gnuvince_and apparently, it's expected :)
17:33Chousukeweird.
17:33hiredmantechnomancy: won't take effect until the next time I restart clojurebot though
17:34gnuvince_Chousuke: too much thunking
17:34gnuvince_Not enough reducing
17:34technomancyhiredman: no problem... assuming that's a matter of days rather than months. =)
17:34gnuvince_Lazy evaluation looks great on paper, but it seems that in practice, it's always getting in the way...
17:34gnuvince_It's not the first time I've had weird stack overflows
17:39technomancyI saw some code the other day that produced a lazy seq from a Java object and then closed it when the seq had been fully realized... anyone know of a good example of that?
17:40technomancyI guess it's not that tricky
17:40hiredmanerm
17:40hiredmanwith-open?
17:41hiredmanwell, I guess not, but yeah, it's not so tricky
17:44ChousukeI guess all you really need is a (when (was-last-item-in source) .(close source)) in the function that produces the items for the seq.
17:44Chousukeoops, . in wrong place :P
17:45Chousukeof course, that's somewhat fragile, as the source is not closed unless everything is consumed :/
17:45technomancyyeah, the only tricky bit is that the source itself is iterable, so the recursion needs to pass the original java object of the source as well as the seq based on it
17:45technomancyhrm; true
17:45mrsolocan you do * on (import) ?
17:46Chousukehmm.
17:46ChousukeI don't think so.
17:46Chousukeit's bad practice anyway.
17:47mrsoloyes but handy while prototyping
17:48dnolen_mrsolo: yeah, comes up a lot, but I don't think it's going to happen anytime soon. it's OK, Clojure makes up on the other aspects of prototype in spades.
17:48dnolen_prototyping
17:48technomancy(that would be an elisp function)
17:48technomancywill be sure to post to the ML if I ever get that written
17:57ataggartis there a simple way to see what the code output from a macro would be given some args to the macro?
17:57ataggartI looked at macroexpand, but that didn't seem to be it
17:57hiredmanuh
17:57hiredmanthat is exactly what macroexpand does
17:58ataggartok, what do I do with whatever macroexpand is giving me?
17:58ataggartbecause I want to see code
17:58Hun`ataggart: did you quote the argument to macroexpand?
17:58ataggartah
17:58ataggarthm
17:58ataggart,(macroexpand 'import)
17:58clojurebotimport
17:59ataggartnot quite what I had in mind
17:59hiredman,(macroexpand '(let [[a b] '(1 2)] a))
17:59clojurebot(let* [vec__2842 (quote (1 2)) a (clojure.core/nth vec__2842 0 nil) b (clojure.core/nth vec__2842 1 nil)] a)
17:59Hun`what did you have in mind? a macro usually has arguments ;)
17:59ataggartlol fair point
18:00hiredmanI don't think import is a macro anyway
18:00Chousukeclojure destructuring could probably be improved a bit when the source is fully known at compile time
18:00ataggartwell the doc says "form". so wasn't sure if that included the would-be args
18:00hiredmanor even a var
18:00hiredmanwell
18:00ataggartimport is a macro
18:01hiredman,#'import
18:01clojurebot#'clojure.core/import
18:01ChousukeI mean, (let [[a b] '(1 2)] ...) is not equivalent to (let [a 1 b 2] ...) :/
18:01hiredman,^#'import
18:01clojurebot{:macro true, :ns #<Namespace clojure.core>, :name import, :file "clojure/core.clj", :line 1852, :arglists ([& import-symbols-or-lists]), :doc "import-list => (package-symbol class-name-symbols*)\n\n For each name in class-name-symbols, adds a mapping from name to the\n class named by package.name to the current namespace. Use :import in the ns\n macro in preference to calling this directly."}
18:01Hun`,(macroexpand '(import (Hello world)))
18:01clojurebot(do (clojure.core/import* "Hello.world"))
18:01hiredmanah
18:01hiredmanimport*, of course
18:38ataggartwhoa
18:41cp2:(
18:41danlarkinhah, that was nothing
18:42danlarkinoh... but for you I guess it was huge, nevermind
18:42cp2yeah
18:42cp2ive seen some pretty big splits
18:43hiredmanwhich is why irc needs to be replaced with xmpp
18:49cp2does xmpp have group chat? (by that i mean channels)
18:51dnolenhttp://xmpp.org/extensions/xep-0045.html
18:51hiredman yes
18:51hiredmanMUC
18:52hiredmanmulti-user-somethingorother
18:52cp2cool
18:52technomancynobody's ever used it on the scale of freenode afaik; it may have annoyances just as bad as netsplits.
18:52hiredmantechnomancy: true
18:53cp2on a good network netsplits arent very frequent anyway
18:53technomancyplus my IRC client has a much nicer UI than my XMPP client. so let's stay here please. =)
18:53cp2yeah
18:53cp2i love irssi =P
18:54technomancyIRC is pretty decent given its age. it gets unicode right, which is somewhat surprising.
18:54hiredmanthere are irssi xmpp plugins
18:54Chousuketechnomancy: it doesn't get unicode at all ;P
18:54cp2yeah ^
18:54Chousuketechnomancy: all text is just bytes to it.
18:54cp2thats why it gets it right, because it doesnt do anything to it
18:54technomancyChousuke: oh, well it does well enough for me to never notice any problems. =)
18:55technomancyI guess because all clients agree that there's only one sane encoding.
18:55cp2hiredman: i thought that in the back of my mind, didnt care enough to verify though, heh
18:55Chousukewell, irssi has problems with channels if their names are not encoded in the charset you're using
18:55hiredmantechnomancy: http://metajack.im/2009/01/07/emacs-and-jabber-happy-together/
18:55Chousuketechnomancy: I wish they did.
18:55Chousuketechnomancy: ISO-8859-1 is still popular in Finland.
18:56technomancyChousuke: I'm sorry.
18:56ChousukeI use UTF-8 though.
18:56technomancyhiredman: yeah, but I have to use pidgin because I have to talk with co-workers on skype. =(
18:56hiredman:(
18:56Chousukebut there were some nasty flamewars over this issue.
18:56cp2yuck
18:56gnuvince_technomancy: pidgin supports skype?
18:56Chousukesome channels would kick you if they detected UTF-8 characters.
18:56hiredmanskype is horrible
18:56cp2wow Chousuke
18:56cp2thats kinda terrible
18:57technomancygnuvince_: you have to keep the skype binary running at the same time, but all the UI goes through pidgin.
18:57technomancyit's lame, but it's far better than the skype client's UI
18:57technomancyChousuke: channels about racism?
18:57cp2 hah
18:59gnuvince_Neat
19:00Chousukecp2: well, it was understandable though. if you went to a mainly latin1 channel and used UTF-8, your text would look like "ääliömäistä mössöä"
19:00Chousukethough that's a worst-case example.
19:01cp2heh
19:01technomancygnuvince_: only text chat is supported though
19:02rys??q? uo p??oq??? ? ?nq ? ???? ?s?? ??? s? s???
19:03rysmmm, sweet unicode + irssi
19:03cp2(= oo? ?d?d??? ???? ? '???
19:03technomancypbhyq or jbefr gubhtu
19:04technomancy(if your client doesn't support rot13--it's time to find a new client)
19:04cp2oh man i didnt even noticed that was rot13'd
19:04cp2i thought you flipped it at first
19:05cp2and then i though you were typing gibberish to mess with us
19:05cp2(into thinking it was flipped)
19:05rysit was the "or" that threw me off
19:05technomancyhehe
19:05technomancyI guess gubhtu does kind of sound like a new linux distro
21:29quidnuncDeep, unspeakable suffering may well be called a baptism, a regeneration, the initiation into a new state.
21:43RaynesWell that sucked.
21:43RaynesI was just about to recommend Clojure as a first language, but realized, I really couldn't. :\
21:59arohnerso I have methods that I want to mark private, but I also want to have unit tests for the private method, preferrably in another file
22:00arohnerand I'd like the unit tests to have an ns declaration
22:00arohneranyone have suggestions for how to work around that?
22:02hiredmanyou can put the unit tests in the same namespace but a different file
22:06arohnerhiredman: yeah, but that seems kind of hackish to say (ns foo) (in-ns 'bar)
22:06hiredmaneh?
22:06hiredmanjust do (ns bar)
22:07hiredmanactually
22:07hiredmanjust (in-ns bar) would be best I believe
22:07arohnerright, but then I don't get the standard (ns bar (:require baz)) niceities
22:08arohnerI'm looking for something better than the hack :-)
22:08hiredmanuh
22:08hiredmanit is not a hack
22:09hiredmancore.clj does the samething with core_print.clj
22:10hiredmanthe correspondence between a namespace and a file is very loose
22:10arohnerand once I do (load "core_print"), I can't do (ns core_print)
22:11hiredmanarohner: there is no core_print namespace
22:11arohnerI want an ns because that's how all "normal" files do require and import
22:11arohnerI understand.
22:11arohnerI want 1) a file to contain unit tests 2) that has it's own requires and imports 3) that calls private fns in other namespaces
22:12arohnerif I use load and in-ns, I can't use (ns)
22:13arohnerand I want a separate ns because the unit tests shouldn't affect the original file
22:14arohnerby :require'ing and :use'ing namespaces that aren't in the original file
22:46patrick_hello all
22:47arohnerpatrick_: hi
22:48patrick_hi arohner
22:49patrick_I was wondering whether you have any experience with quasi-quotation, specifically unsplice within Clojure
22:50arohnersure
22:51arohnerwhat's your trouble?
22:51patrick_great! I have a macro that is attempting to pack rest parameters into the literal hash-map syntax using quote unsplice...
22:51arohnerclojurebot: paste
22:51clojurebotlisppaste8, url
22:51lisppaste8To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste.
22:52patrick_on my way
22:52arohnerpatrick_: do you have some example code you can paste?
22:52patrick_I do, I am pasting it currently
22:58patrick_hmmm, paste.lisp is throwing an error when I submit
22:58patrick_one sec
22:58lisppaste8paddy pasted "quote unsplice into literal hashmap syntax" at http://paste.lisp.org/display/81257
22:59patrick_nm
23:00arohneryou found it?
23:01arohnerI have an idea, I just need to wait for my unit tests to finish to try it out
23:01lisppaste8paddy annotated #81257 "throws this error:" at http://paste.lisp.org/display/81257#1
23:01sunwukongmaybe you cannot use the { } syntax inside a syntax-quote
23:01sunwukongbut you can use hash-map
23:02sunwukongso `(hash-map ~@args) should do the trick
23:02patrick_yeah, I am thinking so, that did work - I was curious why it wouldn't work within the literal syntax, as the expansion should.
23:03sunwukongis `{' implemented as a macro character?
23:03patrick_I'm thinking it has something to do with the way Rich enforces hygiene...alternately, could be my error...and lastly, a bug :)
23:05arohnersunwukong is right. try (let [properties# (hash-map ~@keyword-params)] ...)
23:05sunwukongthe problem may be that { } is "run" before the macro definition
23:05hiredmanhttp://asymmetrical-view.com/2009/06/02/incanter-amqp-benchmark.html <-- nice
23:06sunwukongso it complains because inside the curly brackets you only have one thing, and not pairs
23:06patrick_could you expand on that sunwukong? Mr. Hickey does supply the { as the equiv to a reader char - {:key1 "key1 :key2 "key2"}
23:06sunwukongyes, so when the parser reads your macro definition, it parses just as you've written
23:07hiredmanpatrick_: that error usually means you are missing a value or a key
23:07sunwukongthat is, it tries to parse {~@args}
23:07sunwukongbut it is only one "thing", not a key-value pair
23:07patrick_hmmm interesting, you think the reader macro doesn't get defined until after macro expansion?
23:07hiredman,{:a}
23:07clojurebotjava.lang.ArrayIndexOutOfBoundsException: 1
23:07hiredman,{:a 1}
23:07sunwukong(at the parsing stage it does not know that ~@args will actually be expanded)
23:07clojurebot{:a 1}
23:08sunwukongso the '{' is a kind of "immediate" (a la Forth) kind of thing, even if you are inside a backquote, it is evaluated
23:09sunwukong(at least I think so :)
23:09patrick_ok, I'm processing what you said :)
23:12arohnerright. imagine you're writing the parser for {}. the rule for that is { pairs of things }
23:12arohneryou don't have a pair inside your {}
23:28patrick_ok, when I (defsomething A-symbol :key1 "key 1" :key2 "another value"), I was under the assumption that the elements :key1 "key 1" :key2 "another value" got packed up in the keyword-params list
23:30hiredmanerm
23:30hiredmankeyword params list?
23:30hiredmannever heard of such a thing
23:31patrick_its the rest parameter defined in a macro http://paste.lisp.org/display/81257
23:31patrick_I just named it keyword-params, as that is really what I am trying to accomplish.
23:32hiredman{} is a literal
23:32hiredmanso the reader barfs if it does not have the correct syntax
23:32hiredmanI thought this was just explained?
23:33hiredmanand in any case, I doubt ~@ will splice into anything but a list
23:33patrick_understood...I guess my question then is why isn't the quote unsplice dropping the elements :key1 "key 1" :key2 "another value" in between the braces
23:33hiredmanit would
23:33hiredmanbut
23:34hiredmanit never gest to that stage
23:34hiredmanso you have text source -> reader -> datastructure -> compiler
23:34patrick_ahhh *lightbulb explodes*
23:34patrick_I follow you now,
23:35patrick_wow I'm thickheaded
23:35patrick_thanks everyone, its all clear now
23:41patrick_so, the {} literal characters get expanded at "read time", which apparently occurs before "macro-expansion time" :)
23:41patrick_what a crazy world