#clojure logs

2012-01-20

00:00geoffeg_chow can i add an element to a map while i create the map? { "color" "green", (if (contains shapes "square") ("is_square" "yes")) }
00:00geoffeg_cthat doesn't seem to work
00:01amalloyyou can't. just use assoc or conj outside the literal
00:01geoffeg_cok
00:02alex_baranoskywhat is a good way to go from a LazySeq to a Cons ?
00:02amalloyalex_baranosky: that goal sounds highly suspicious
00:03alex_baranoskynormally in Midje the forms of Midje macros are checked for syntax validity
00:03amalloy&(doc seq?)
00:03lazybot⇒ "([x]); Return true if x implements ISeq"
00:03alex_baranoskyif they are invalid you get a message saying the particular kind of invalid syntax, with the form printed out afterward
00:04alex_baranoskyhowever, tabular forms are being mophd into LAzySeqs in the process of processing them, and so when there is a problem with the syntax it isn't printing out properly
00:04alex_baranoskymophd => morphed
00:05amalloythere, now we're at the real problem: how do you print a lazy-seq
00:05amalloy&((juxt str pr-str) (range 3))
00:05lazybot⇒ ["clojure.lang.LazySeq@7480" "(0 1 2)"]
00:05alex_baranoskyand preferrably print a lazy seq without knowing whether it is a lazy seq or a Cons
00:06amalloyif you just want to print them, you can use pr(n) instead of print(ln)
00:06alex_baranoskyahhh so I should stop using str
00:07alex_baranoskythanks amalloy: that does the trick. Guess that hadn't bitten me yet
00:17metajacktavis`: I applied that patch to master of technomancy/swank-clojure and fired it up and got this: https://gist.github.com/1645485
00:18metajackoh wait. perhaps i needed to use uberjar.
00:27metajacktavis`: now that i've managed to install it correct, it works like a charm. thanks!
00:28ibdknoxhas anyone gotten this-as to work in CLJS
00:47technomancytavis`: ISTR that being mentioned in the official slime manual (working over tramp)
00:47technomancyor at least working over SSH
00:48technomancyC-c C-r is a workaround though
00:53tavis`technomancy: I've got the filename translation working now, but the bytecompile step is leading to an error "can't load docstring file" f
00:53tavis`
00:53tavis`
00:53metajackis there something special i need to do to get the cursor pointer in cdt for what line the current stack fram is on? i see it in the video, but my emacs doesn't have it.
00:54technomancytavis`: hmm; gotta take off; maybe start a thread on the swank mailing list?
01:54tavisif anyone is interested in playing with swank-clojure and clojure-jack-in over tramp, I've got it mostly working here: https://github.com/tavisrudd/clojure-mode and https://github.com/tavisrudd/swank-clojure
01:55tavisyou just need to run it locally first to get the .el payloads loaded properly (haven't figured out how to bytecompile them over tramp yet)
01:55RaynesTramp is the bane of my existence.
01:56tavisused to be mine, but after some wrangling I love it
01:56RaynesI was hoping that Vim's remote stuff would be better, but it's meh too. Mostly, I just want to be able to edit files with sudo remotely without logging in as root.
01:56taviseverything bar the initial loading of the slime el files works
01:57tavishave you tried fuse?
01:57ibdknoxRaynes: you should mount remote volumes locally
01:57tavishmm, you said as root, ignore that suggestion
01:57ibdknoxwhich is what fuse does I think
01:58Raynesibdknox: I haven't tried that. I'll check it out. I'd be good for me.
01:58ibdknoxunless we're talking about two different fuses
01:58tavissame fuss
01:58tavisfuse
01:58Raynesibdknox: Also, wtf, where did you come from?
01:58ibdknoxthe shadows
01:58RaynesApparently.
01:58ibdknoxI'm always here in spirit
01:59tavisyou're from NZ?
02:00tavishmm, nope confusing you with someone else
02:27emezeskeanyone in here have moderator powers on the clojure google group?
02:28emezeskeMy posts are still being moderated, and it's taking like 24+ hours for each one to show up
02:28emezeskeMakes it really hard to have a conversation :(
02:36scottjemezeske: have you subscribed to the group?
02:37emezeskescottj: yeah, I'm a member
03:29Blktgood morning everyone
04:08ljosHi - is there a way to create locking between a Java thread and Clojure thread? I have some java code that runs and that clojure has to wait for. Then the java thread does some more work and the clojure thread has to wait again.
04:08ljosThe second time is n waits.
04:09brehautljos: http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/locking
04:09ljoshttp://clojure.github.com/clojure/clojure.core-api.html#clojure.core/locking
04:10brehautwith all the caveats manual locking entails
04:11ljosdamned this client. Didn't mean to paste again :P I don't usually sit on windows :P
04:14ljosIs there anywhere that explains how it works?
04:17ljosWhat happens if I wait for a lock that java holds and how do I make java hold the lock on the object that clojure waits for? I can't seem to wrap my head around how that works.
04:18ljosOr maybe what I am asking more is how is locking implemented?
04:26ljosO guess I will have to try for myself. Thanks for pointing me in the right direction.
04:31raekljos: a (basic) synchronized/locked piece of code can only hold one thread at a time
04:31raekljos: maybe you want a BlockingQueue
04:32raekhttp://docs.oracle.com/javase/6/docs/api/java/util/concurrent/BlockingQueue.html
04:32raekSynchronousQueue is one implementation which works as a rendezvous channel
04:33raekone thread tries to put something into the queue and one thread tries to pull something out
04:33raekand the calls will block until there is a thread "on the other end"
04:34raekif you don't need to transfer a value, you can also use Object.wait and Object.notify
04:35raek(def lock (Object.)) (defn wait [] (locking lock (.wait lock))) (defn notify [] (locking lock (.notify lock)))
04:36raekhttp://en.wikipedia.org/wiki/File:Monitor_(synchronization)-Java.png
04:37raekthere is also .notifyAll, which works like .notify but it wakes upp all threads .wait'ing
04:40raekbtw, when a thread calls .wait, it will go to sleep until another thread calls .notify. during this sleep it does not occupy the lock
04:44wiseenanyone knows the answer http://stackoverflow.com/questions/8938330/clojure-swap-atom-dequeuing ?
05:28ljosraek: thanks, that was what I was looking for (wait notify). I just didn't know if that was how locking worked. (I couldn't test right now as I don't have it available and I'm a bit too impatient to not ask instead of waiting to try).
05:56c0smikdebrisanybody using sublime text 2 here?
05:59raekljos: "(locking x ...)" or "synchronized (x) { ...}" is the locking part of the whole. "Monitor" is the term for the whole thing that, locking, .wait, and .notify participates in.
06:01raekon the JVM each object acts as a monitor with a single condition variable
06:06ljosAh. Thank you for explaining. I didn't know that. I haven't worked a lot with concurrency and suddenly have to learn a lot on my own. I was trying to do some stuff with wait and notify earlier, but I didn't get it to work and got a lot of strange errors. I think I understand how it works now and can fix it later when I get back to it.
08:57ljosAnother question. Is there a way to stop clojure.main from taking focus the first time I compile in Emacs (SLIME)?
08:57ljosAnother question. Is there a way to stop clojure.main from taking focus the first time I compile in Emacs (SLIME)?
09:01ljosAnother question. Is there a way to make clojure.main not take focus the first time I compile in Emacs (SLIME)?
09:05manutterTake focus?
09:05solussd_has anyone read let over lambda? is it a worthwhile read as an advanced lisp book for someone with some CL experience, but predominately clojure (w.r.t. lisps)?
09:06piskettiI've wondered that too
09:07ljosmanutter: when I compile the first time (i'm in osx) a process starts that takes focus from my main window.
09:08ljossolussd_: I think Let Over Lambda is a book you should read regardless if you program in any LISP.
09:08solussd_ljos: I got the impression from reviews that a non-lisper would be lost!
09:08cemerickljos: If you're doing anything with Swing or AWT, that'll happen. Your beef is with Apple.
09:09ljoscemerick: ah. Sigh. It isn't really a problem, just irretating.
09:10solussd_another random question- has anyone played with javafx 2.0 in clojure?
09:10ljossolussd_: you will be lost on the spesific items, but there some of the things discussed is very relevant for anyone.
09:10solussd_ljos: excellent. ill buy. :D
09:10cemerickljos: If you're not doing anything with an actual UI (i.e. just using Java2D, etc), then you can likely get by with setting AWT to run in headless mode.
09:11ljossolussd_: I read it a while ago and will read it again soon as I have a better understanding of macros now. If you don't understand macros completely you really have to make an effort to read into the meta-level of what is being disussed and not worry about the actual implementation that is happening.
09:12ljosI learned a lot about how I program and other stuff from it asside from just macros and the let over lambda structure.
09:13solussd_ljos: I read on lisp a couple years ago- steep learning curve, but it got me comfortable w/ macros. Sounds like this book is at about the same level w.r.t. macros
09:13ljoscemerick: hmm.. maybe i'll try that. I am not actually shure what is going on because the UI code is not mine.. it is also in java and not really used :P
09:14ljossolussd_: LOL actually talks about and refers to things written in On Lisp.
09:15solussd_awesome
09:16cemerickljos: The focus interaction on OS X is prompted by the AWT thread starting, which comes as a result of loading certain classes. There's certainly no requirement that the AWT reference be in your project, etc.
09:16ljossolussd_: I think if you have read and understood On Lisp you will find LOL very informative and you'll understand most of things that are going on. LOL goes a bit further and some things went completely over my head, but then again, I didn't really understand macros before I read it.
09:21ljoscemerick: Thank you btw. Now to figure out why -Djava.awt.headless=true isn't triggering....
09:26ljosFigured it out. I had java-opts in leiningen instead of jvm-opts.
10:16chawksHi... I have a basic question. I am trying to create a project using Clojure 1.3, but I also need contrib. However, I'm not sure which version number I need to use for clojure-contrib in my lein project.clj file. Can anyone please help?
10:18adamspghchawks: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
10:18adamspghfor 1.3 it's been separated into a bunch of more independent packages.
10:19chawksThanks adamspgh. Does that mean I need to create a dependency for each one I'd like to use?
10:20adamspghchawks: (as far as I know) yes.
10:27bitpimp:w ~/spring_talk_notes
10:27bitpimplol... oops
10:27bitpimpguess you know what I'm doing this morning
10:28chawksadamspgh: Thanks
10:56semperosgiving ccw a whirl (heavy emacs user); is there a keyboard shortcut to take my cursor from the file I'm currently editing to the REPL started by ccw?
11:03arkhwhat's the best way to stop swank so I can move to a different project and start it again?
11:03arkh(short of exiting emacs)
11:03tmciverarkh: , quit
11:04semperosarkh: I use elein, which has function elein-swank, elein-kill-swank and elein-reswank that I use for starting, stopping and restarting respectively
11:04tmciverarkh: to be clearer: when in the slime repl type comma, then type quit.
11:05arkhcool - thank you both
11:05llasramOh, wow. Did not know about that... SLIME? Swank? command-mode. Anything else useful you can do with it?
11:06arkhwow ... what are the chances: http://www.facebook.com/eswank Moving on ...
11:13geoffeg_ccan someone explain the best way to do this? https://gist.github.com/e2459686b2ad4594b954
11:13geoffeg_cIf data does not contain a login_id key, i don't want to add the :set to the map
11:14geoffeg_cevery solution i've come up with seems way too verbose
11:16semperosanother ccw question: in strict mode, any way to get the equivalent of paredit's M-s?
11:17semperosparedit-splice-sexp
11:17semperosI see splitting and joining but no splicing...
11:25cemericksemperos: heh, I didn't even know about split and join :-P
11:25semperoswas just checking out the ccw wiki on googlecode, saw those two, but I only use splice in Emacs' paredit
11:26semperosso it's absence is felt, but otherwise ccw has come a long way
11:28cemericksemperos: splice = C-enter C-x C-enter C-v :-P
11:29cemerickYou could probably use one of the keyboard macro plugins to make a new shortcut for that.
11:30semperoscemerick: that works in eclipse?
11:30cemerickThere's also http://www.mulgasoft.com/emacsplus for ex-emacers wanting some creature comforts in eclipse
11:31semperosand C is Control on the Mac in this case?
11:31semperosdidn't work for me
11:31cemericksemperos: those are my bindings :-)
11:31semperosah, gotcha
11:32cemerickC == Cmd, sorry
11:32cemerickI have "select enclosing element" (default Cmd-Shift-up) bound to Cmd-Enter
11:32semperosgotcha now, your own combo of remappings
11:32semperoswhich I could capture as a keyboard macro
11:32semperosthanks for the idea
11:34tmcivercemerick: "select enclosing element", is that a paredit function?
11:34cemericknope, that's eclipse-land
11:34cemerickworks across all languages
11:34semperosnot sure if it depends on ccw version, but to get the same behavior as emacs paredit splice, you have to do C-enter twice, with your mapping
11:35cemericksemperos: depends on if your point is on a symbol already or in whitespace, probably
11:35semperosindeed
11:35cemerickmmm, gclosure deployed to central. This is promising. :-)
11:39semperoscemerick: thanks for your help
11:40cemericksemperos: np; feel free to ping again or mail the ccw ML if you have other questions.
11:40semperoswill do
11:40semperosscratching the occasional itch to see how Clojure dev outside of emacs has progressed
11:41semperosas I can sell people on Clojure long before I can sell them on Emacs :-)
11:41cemerickheh, yeah
11:51stuartsierraGClosure has not YET been deployed to central, just staged to sonatype.
11:52stuartsierraBrenton and I will be doing more testing this afternoon.
12:04zakwilsonhttps://renthubnyc.com/ <-- I made a thing for a customer using Clojure. It's still in progress, but... soft launch.
12:04mdeboardzakwilson: Nice. Did you choose clj because it conferred some project-specific benefits or?
12:05mdeboardzakwilson: Also, did you use Compojure? Noir? Something else?
12:06zakwilsonmdeboard: Clojure is my favorite language. I couldn't see any reason NOT to use it for this, so I did.
12:06zakwilsonIt's Compojure, Hiccup, Gaka, some other stuff. I might migrate to Noir, but I think Noir wasn't quite as ready when this started.
12:14mdeboardzakwilson: Neat. I'd not heard of Gaka.
12:16cemerickFor exactly what operations / usage patterns are array-maps faster than hash-maps? My not-very-serious microbenchmarking shows them at par, at best, with a variety of data sizes and operations.
12:19wilkesI did a clean install of lein 1.6.2 today and now I can't run my clojure 1.3 projects
12:19wilkesI get a "java.lang.NoSuchMethodError: clojure.lang.KeywordLookupSite"
12:19wilkeserror
12:19wilkesI've googled and see the problem all over the place, no clear solution
12:20wilkesany ideas?
12:20dnolencemerick: array-maps are rarely faster in my experience
12:21cemerickyeah
12:21cemerickwell, there goes that bit of lore
12:21frankvilhelmsen_Clean up your libs and run lein deps
12:22dnolencemerick: less memory usage probably the biggest benefit.
12:22wilkesfrankvilhelmsen_: that only works once
12:22frankvilhelmsen_and you many has to add default ./ to your classpath,,
12:23dnolenanother getting started with Clojure post, http://www.rodrigoalvesvieira.com/getting-started-with-clojure/
12:24frankvilhelmsen_once,, ? check your dependencies is my guess
12:24TimMccemerick: Did you let HotSpot warm up?
12:24cemerickyeah, I don't think I'm doing anything particularly heinous w.r.t. fouling up the timings
12:24TimMcOK
12:25dnolenTimMc: even if you let HotSpot warmup hashmaps are way faster once you get past a few elements.
12:25cemerickI hit parity only with single-entry maps
12:25wilkesfrankvilhelmsen_: it's weird, because everything was working sorta fine (lein deps was slow), so I blew everything away and reinstalled lein 1.6.2
12:25dnolenyou can see this behavior in a big way in core.logic. Once you get past 32 logic variables things starting screaming.
12:26TimMccemerick: I only asked because you recently ran a speed check against clojurebot with only 1000 iterations. :-)
12:26wilkesfrankvilhelmsen_: and I'm using the clojurscriptone project as my testbed
12:26cemerickTimMc: heh, I don't recall
12:26cemerickI did 1e8 for the map comparisons.
12:27chawksHi. Does anyone know if I can use duck-streams with clojure 1.3?
12:27raekwilkes: from what I can tell it looks like you have ahead of time compiled code compiled for clojure 1.2 on the classpath
12:28raekchawks: it has been replaced by clojure.java.io and some functions in clojure.core since clojure 1.2
12:29raekwilkes: does this happen in a fresh clojure 1.3 project?
12:29wilkesraek: let me check
12:30chawksraek: Thanks... do you know if there's anything like write-lines (writing a seq of string to a file)? I tried looking there but didn't find anything
12:31wilkesraek: nope, seems fine there
12:33_carlos_hi!
12:35raekchawks: don't think so. you may have to implement it yourself. (e.g. with 'with-open', 'clojure.java.io/writer', and 'doseq')
12:36wilkesraek: I did a clean checkout of clojurescriptone, script/deps works fine, then ran lein help and get https://gist.github.com/1648607
12:37raekmaybe a library that clojurescriptone uses is AOT compiled for 1.2 or something
12:37chawksraek: thanks!
12:38raekbut this happened when you upgraded _leiningen_?
12:39raekwilkes: something like this: (defn write-lines [stream lines & options] (with-open [writer (apply io/writer stream options)] (doseq [line lines] (.write line) (.write "\n"))))
12:41raekI think the reason read-lines was not carried over had to do with laziness vs. resource management. it's hard to encapsulate the closing of the stream while having laziness
12:41wilkesraek: more like a re-install, cleaned up some stuff but stayed on 1.6.2
12:41raekwilkes: do you have any plugins installed in ~/.lein/plugins ?
12:41wilkesraek: not at the moment, I pulled those out for the time being
12:43raekthe exception is thrown from within the leiningen process, I think. this suggests the problem is in a plugin or dev-dependency
12:43technomancy_wilkes: definitely a dev-dependency
12:46wilkestechnomancy_: yep, I created an empty project and added the deps in one by one, running lein deps twice each iteration
12:47wilkesit fails when I get to [marginalia "0.7.0-SNAPSHOT"]
12:47stuartsierraWorking on getting ClojureScript JARs published...
12:47technomancy_stuartsierra: great news
12:47wilkesstuartsierra++
12:47raek(inc stuartsierra)
12:47lazybot⇒ 1
12:48stuartsierraWill need people to help test in just a moment
12:48technomancy_wilkes: why marginalia rather than lein-marginalia?
12:48wilkesthat's what's in clojurescriptone
12:48technomancy_oh right; not your project
12:48technomancy_do you see the same effect with lein-marginalia?
12:49wilkestechnomancy_: yes
12:49technomancy_hum.
12:51technomancy_I don't get it; marginalia uses 1.2.0
12:52technomancy_just go ahead and remove those deps for now; can you also open an issue on Leiningen?
12:52wilkestechnomancy_: will do, thanks for you help
12:57wilkesraek, thanks for your help too
13:01stuartsierraOK, we need some help.
13:02stuartsierraHere's a project.clj: https://gist.github.com/1648712
13:02stuartsierraIt doesn't work.
13:02stuartsierraThe dependencies are right, but we can't load the ClojureScript REPL.
13:03technomancy_how are you trying to load the repl?
13:03stuartsierraquickstart instructions on https://github.com/clojure/clojurescript/wiki/Quick-Start
13:05cemerickstuartsierra: I get "Unterminated comment" in goog/deps.js Is that the problem you see as well?
13:05stuartsierrayes
13:05technomancyI can't get the deps
13:05technomancyis it possible I need to wait to let the mirrors propagate or something?
13:05cemericktechnomancy: should just work, that's what the staging repo is for
13:07technomancyError transferring file: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
13:07technomancynever seen that one before
13:08WorldOfWarcrafthi :)
13:08WorldOfWarcraftjon hu
13:08WorldOfWarcraftrew
13:08WorldOfWarcraftworld of warcraft
13:08WorldOfWarcraftthats me
13:08WorldOfWarcraftsc"brssa\`drqew
13:08babilenops?
13:08WorldOfWarcraftOPS?
13:08WorldOfWarcraftghjiko
13:08WorldOfWarcraftp
13:08TimMcWorldOfWarcraft: You're being irritating.
13:09WorldOfWarcraftone sec let me look up what irratating means
13:09babilenWorldOfWarcraft: This is a support channel -- Please ask a question or stay silent. Thank you very much.
13:09WorldOfWarcraftoh...
13:09WorldOfWarcraftim sorry for being
13:09Raynesbabilen: /ignore WorldOfWarcraft
13:09WorldOfWarcraftirratating
13:09cemerickstuartsierra: I haven't the foggiest; goog/deps.js looks ok
13:09stuartsierrayeah
13:09WorldOfWarcraftSTOP BEING MEAN!!!!!
13:09cemerickbut load order could end up causing the error message to be misleading
13:09WorldOfWarcraftyour irratating
13:10stuartsierracemerick: good point
13:10WorldOfWarcraftBANANAS!!!!!!!!!
13:10WorldOfWarcraftf
13:10cemerickstuartsierra: I'd have to think that the gclosure packaging is busted somehow?
13:10WorldOfWarcraftwow stop trolling
13:10cemerickchouser: around?
13:11WorldOfWarcraftstop being a meanie
13:11RaynesFreenode not-so-secret-secret: you can request that freenode take care of such problems in the absence of ops. #freenode.
13:11mebaran151I'm finishing a little library I think might be of use to the community, a quick library to read and write Excel files (based on the Apache POI). What's the best way to release it?
13:12stuartsierracemerick: seems that way
13:12TimMcmebaran151: Jar it up and publish to clojars.
13:12cemerickRaynes: I always forget about that!
13:13seancorfieldmebaran151: also worth putting it on github so folks can look at source, send you patches etc
13:13technomancymebaran151: "lein help tutorial" covers publishing libraries
13:13Raynesstuartsierra: You should talk to chouser about getting ops for all clojure/core members in here.
13:13technomancycemerick: you're able to pull in this dep with the latest stable lein?
13:14cemericktechnomancy: I'm using 1.6.2
13:14technomancyno, that's what I'm using too
13:15technomancyif I use lein2 I get this: org.sonatype.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.clojure:clojurescript:pom:0.0-927 from/to oss-sonatype-staging (https://oss.sonatype.org/content/groups/staging/): No connector available to access repository oss-sonatype-staging (https://oss.sonatype.org/content/groups/staging/) of type default using the available factories FileRepositoryConnectorF
13:15technomancyactory, WagonRepositoryConnectorFactory
13:15cemerickthat's silly
13:15technomancyI know!
13:15RaynesI wish I had more WagonRepositoryConnectorFactories in my life.
13:16technomancyRaynes: upgrade to leiningen 2!
13:16technomancyyour dreams can come true
13:16technomancy(at zombo com)
13:17cemericktechnomancy: confirmed in pomegranate directly
13:17technomancyconfirmed working?
13:18cemerickconfirmed broken
13:18technomancyaha
13:18cemerickit's the https
13:18stuartsierraOK, hold on, going to delete the JARs I uploaded and make some more...
13:19cemerickgood grief
13:20cemericktechnomancy: ok, got a fix. I'll push once I get back from lunch.
13:20technomancygreat
13:21technomancyhm; I can get other jars from sonatype staging just fine
13:21cemericktechnomancy: are files, http, and https the only default repo types that we should care about, or is some oddball using ftp, etc?
13:22technomancyI wouldn't worry about ftp
13:22technomancyand s3 stuff can use a separate wagon
13:22cemerickgopher? pigeon? fedex?
13:22technomancyqrcodes-by-webcam
13:22cemerickQueCat!
13:23mebaran151thanks technomancy
13:24mebaran151btw, is there a preferred license for publishing clojure libraries
13:24stuartsierraOK, new set of JARs uploaded to Sonatype Staging.
13:25raekmebaran151: EPL is *very* common in Clojure-land
13:26stuartsierraYou'll need to delete ClojureScript from your local ~/.m2/repository
13:27stuartsierraSeems to be working this time.
13:27technomancysame issue here
13:28technomancylooks like switching to http fixes it
13:29stuartsierratechnomancy: OK. The special repository URL is temporary anyway.
13:31mrBlisscompiling this application of core.match throws an exception: (match [1 '(2 3)] [a ([b c] :seq)] :ok)
13:31mrBliss-> Unable to resolve symbol: ocr-7002_tail__7004 in this context
13:34cemericktechnomancy: what's the error you get in lein 1.6.2?
13:35stuartsierraNew ClojureScript JARs available in staging. Same gist applies, https://gist.github.com/1648712
13:35stuartsierraCan anybody else confirm it is working?
13:36cemerickstuartsierra: yup, looks tasty
13:36frankstechnomancy: trying to make changes to the "repl-options" function in your repl.clj code... but I'm truly confused by all the (back-)quoting and delayed eval, which starts to feel like black magic...
13:36xeqistuartsierra: works for me
13:36stuartsierracemerick: thanks
13:36cemerickThat's a helluva set of dependencies though! ;-)
13:36stuartsierraxeqi: thanks
13:36stuartsierracemerick: you mean the stuff that gets pulled in?
13:36stuartsierraThat's all from the G.Closure compiler POM, which we didn't write.
13:37frankstechnomancy: for example how do I refer to a local var in the same file for the "read" option?
13:37cemerickstuartsierra: yeah, I figured
13:37Bronsaworks for me too
13:37stuartsierraSo we're considering releasing our own package with fewer dependencies. Or people can just exclude them.
13:37cemerickExclusions are fine for now IMO.
13:38technomancystuartsierra: just confirmed I can get a cljs repl with "lein run"; very nice.
13:38cemerickstuartsierra: why a classifier instead of 0.0.927?
13:38stuartsierratechnomancy: awesome
13:38frankstechnomancy: say I have a local function "myprint", and I want to assign that function inside of the repl-options to the read option... how would I "quote" that?
13:38stuartsierracemerick: just to make it obvious that it's a patch number, not a version number
13:40technomancydoesn't know what to do with ^D, but that's minor
13:40cemerickI think that's intentional?
13:45stuartsierraOK, I think we're going to release these.
13:45stuartsierraSpeak now, or forever hold your peace.
13:46cemerickstuartsierra: oh, this isn't on hudson. o.0
13:46stuartsierraNope. That's a whole 'nother day's work.
13:46cemericklooks good to me FWIW.
13:48cemerickstuartsierra: thank you for your efforts :-)
13:48cemerickClojureScript views in Clutch, coming soon.
13:49stuartsierraZE BUTTON HAZ BEEN PUSHED!
13:50metajack1out of curiosity, why is the EPL so popular?
13:50technomancyit's copyleft, but it's not viral. what's not to like? =)
13:52metajack1you mean it's not always viral i guess
13:52metajack1the virality would seem the only reason to use it over Apache 2.0 or something right?
13:52TimMcWHat's the difference between that and LGPL?
13:53metajacktimmc: LGPL is a little hazy on where the boundary is when you aren't dealing with C code and object files.
13:53metajackI'm assuming that is more clear in the EPL.
14:00technomancyit's pretty close to the LGPL, but it doesn't freak out the suits because it has "Eclipse" in the name.
14:01TimMchaha
14:02TimMc"Enterprise Public License"
14:02cemerickI try to use BSD or MIT on pure open source stuff, but the whole "same license as Clojure's" is a hard tide to stand in front of.
14:03Raynescemerick: I visualize a tidal wave of lawyers crashing down on you.
14:03scottjcemerick: have you released your bayes library?
14:04technomancythe main difference between BSD and MIT-X11 is that with BSD you have to clarify that it's not the annoying 4-clause version, right?
14:04cemerickRaynes: Mostly piles of random people in my twitter feed asking why I'm using license X.
14:04cemerick"piles"
14:05cemerickscottj: No…I'm a louse. Haven't had a lot of hacking time to tie it up since the conj. :-(
14:14beffbernardGentlemen. I have a question regarding workflow using inferior-lisp/Clojure/emacs.
14:15TimMcThere are probably 3.5 answers.
14:15technomancyclojurebot: inferior-lisp is a lot like http://www.penny-arcade.com/comic/2011/09/28
14:15beffbernardSome background.. I know my way around emacs but I'm new to clojure development
14:16beffbernardTimMc: My workflow is basically C-x C-e
14:16hiredmanwhy would you use something with "inferior" in the name?
14:16clojurebotOk.
14:16TimMc...
14:17RaynesThe man has a point
14:17beffbernardhiredman: haha because that's as far as I've gotten
14:17beffbernard;)
14:17TimMc(that was in reference to hiredman)
14:17TimMc"inferior" preumably refers to it being started from Emacs?
14:18beffbernardIs there a way to automatically eval the buffer when I save in my REPL?
14:18beffbernardyes
14:18beffbernardLet me re-phrase
14:18technomancybeffbernard: I hooked something like that up for slime; it's not hard
14:19beffbernardIs there a way when I save to have it reflect in my inferior buffer's REPL?
14:19beffbernardtechnomancy: Oh yah?
14:20beffbernardtechnomancy: I tried slime for a short period but I was getting slowness with the SLIME REPL so I ditched it.
14:20technomancyslowness when the buffer got too big?
14:20beffbernardtechnomancy: But that was probably because I did something wrong and was too lazy to figure it out
14:21beffbernardtechnomancy: Nope, I'd try something like (+ 234 345 4534) and there would be a pause as I was typing it
14:21technomancyo_O
14:21beffbernardOne sec.. I'll get the error
14:23hiredmanmost like using an old version of swank-clojure together with clojure 1.3 and the docstring printing to the minibuffer was barfing?
14:23beffbernarderror in process filter: Wrong type argument: listp, 1
14:24hiredmanbeffbernard: gnue emacs?
14:24beffbernardhiredman: yes
14:24hiredmanusing clojure-jack-in?
14:24beffbernardYup
14:24hiredmanwhat version of emacs?
14:25cemerickstuartsierra: Is there an issue/discussion somewhere re: "The most recent SVN revision does not currently work with ClojureScript."?
14:25beffbernardSome recent version of HEAD
14:25hiredmanhmmm
14:25beffbernardswank-clojure "1.3.4"
14:26beffbernardand I'm using clojure "1.3.0"
14:27technomancybeffbernard: maybe an old version of slime left in your emacs config?
14:27ibdknoxwoah!
14:27ibdknoxan official CLJS
14:27ibdknox[org.clojure/clojurescript "0.0-927"]
14:27ibdknox /win
14:27cemerickyou missed the party already ;-)
14:27stuartsierracemerick: dunno
14:27beffbernardtechnomancy: It's possible
14:27beffbernardtechnomancy: https://github.com/beffbernard/emacs is my .emacs.d
14:27stuartsierrataking off for a bit
14:28ibdknoxcemerick: damn
14:28ibdknoxlol
14:28cemerick:-)
14:28ibdknoxI'll start my own party :D
14:29ibdknoxnow I just need to figure out how to get the cljs repl to work in vim
14:30cemerickibdknox: or stop using vim?
14:30cemericksorry, was too easy
14:30ibdknoxcemerick: pfft, what kind of solution is that?
14:30TimMcWHere would he put all his colons?
14:31ibdknoxI'd have a file full of j's and k's
14:31ibdknoxit'd be terrible
14:31cemericktechnomancy: pomegranate 0.0.3 pushed and released to central, fixes that stupid HTTPS bug
14:31cemerickAnd one other minor one
14:31beffbernardtechnomancy: ; SLIME 2012-01-06
14:32technomancycemerick: much obliged
14:32chawksHi. Does anybody know how to upload files using Noir (via a form)?
14:32beffbernardtechnomancy: Possibly too new?
14:32technomancybeffbernard: see if you can get rid of that version; jack-in will provide you with a compatible version
14:32ibdknoxchawks: it was asked on the list at one point
14:32beffbernardok
14:33ibdknoxchawks: http://groups.google.com/group/clj-noir/browse_thread/thread/58e45ad02bb21571/a5e580f8f9c69b9d?lnk=gst&amp;q=upload#a5e580f8f9c69b9d
14:33chawksibdknox: Thanks a lot!
14:34ibdknoxI guess noir-cljs will be back this weekend
14:34ibdknox:)
14:34technomancyibdknox: what's the relationship between that and cljs-watch?
14:35ibdknoxtechnomancy: noir-cljs would mean that a deployed server would mean no more JS artifacts checked in
14:35ibdknoxthey would be compiled on run
14:35ibdknoxcljs-watch is mostly just a dev tool
14:35beffbernardtechnomancy: Don't I have to add slime to my load-path first? Or is jack-in doing some package magic?
14:35ibdknoxthough right now I've been checking in my generated js :(
14:36cemerickibdknox: that's the way it should always be
14:36hiredmanbeffbernard: jack-in actually injects a copy of slime into emacs
14:36ibdknoxcemerick: hm?
14:36technomancybeffbernard: magick
14:36cemerickjs compiled at runtime
14:36beffbernardhiredman: ok
14:36technomancyibdknox: excellent
14:37technomancycemerick: wellll... build-time.
14:37ibdknoxtechnomancy: actually this resolves one of the issues we talked about at waza
14:37ibdknoxif we get ckirkendell's change to let us specify externs in jars... that would mean it's time for world domination
14:38ibdknoxwe'd have a real library story
14:40beffbernardtechnomancy: hiredman: That worked.. Thanks
14:45beffbernardI want to evaluate my clojure code in emacs. I know I can C-x C-e but are there other ways to evaluate the clojure code in the editor?
14:45beffbernardOr in SLIME
14:45technomancybeffbernard: the readme for swank-clojure has a cheat-sheet
14:45technomancyfor slime
14:45beffbernardok
14:54amalloysometimes it seems like every button combo you can imagine evaluates code in slime
14:54Raynesamalloy: Not in Vim. :D
14:55RaynesIn vim, things just beep and occasionally text disappears or moves around.
14:55ibdknoxyou should turn the beep off
14:55RaynesI actually know that I can do that.
14:55RaynesI just haven't bothered.
14:56amalloyibdknox: but then his computer wouldn't appear haunted to the casual observer
14:56ibdknoxlol
14:57ibdknoxI had it on for years
15:00scottjbeffbernard: C-M-x and C-c C-l being the most common
15:01technomancyscottj: C-c C-k is preferred over C-c C-l unless you explicitly need a full reload
15:01amalloydown with C-c C-l, long live C-c C-k (not that there's any real difference)
15:01technomancyamalloy: there is, now.
15:01llasramI was about to say, I've never used either of those :-)
15:01amalloytechnomancy: as of when? last time i tried that it definitely didn't reload
15:02technomancyamalloy: couple months? I dunno. I don't actually use it; maybe it doesn't work anymore?
15:02scottjtechnomancy: yeah actually I think that's what I normally use just got confused when I had to write out the letters :)
15:02technomancyscottj: fingers N steps ahead of the ol' brain; I know how it is =)
15:02sritchieC-x C-e at the end of a form is good too
15:03technomancyC-c C-k gets you line numbers though; so use that the most.
15:03amalloysritchie: way less convenient than C-M-x in almost all cases
15:03scottjbtw I cover a couple interesting eval keystrokes in my screencasts at http://youtube.com/emailataskcom one is eval parent expression (like C-M-x but not top level) and another is eval threaded up to point
15:03technomancyamalloy: good for things inside a let binding or some such
15:03technomancychecking single values
15:03sritchieamalloy: I use it for evaluating forms inside of other forms
15:04TimMcIt's funny how y'all are using the default keybindings in discussion, but so many people have these rebound or have different defaults...
15:04amalloynote i carefully included "almost". it's still pretty rare that something in a let-binding doesn't refer to some local that won't be picked up by C-x C-e
15:04ibdknoxTimMc: yeah, it's a magical discussion
15:04technomancydo people rebind the slime ones?
15:04ibdknoxI press R to evaluate things ;)
15:04sritchieamalloy: I recently discovered C-M-x, it's been transformative
15:04TimMcI guess some of the names are pretty long.
15:05sritchieibdknox: is vimclojure the way to go?
15:05amalloylike, if the code is inside a function at all, then there are args to the function that C-x C-e won't pick up when you eval a piece of it
15:05ibdknoxsritchie: I like it, but it's definitely not at the level of emacs. That being said, I don't think I'm any less productive as a result.
15:06amalloyibdknox: is it okay if i mockingly compare you to people who think macros sound nice but they're no less productive without them?
15:06ibdknoxamalloy: no :p I use macros ;)
15:06Raynesibdknox: If I had ever used or cared about half of what SLIME gave me, I'd be less productive in Vim. But I didn't and I don't and I'm fine with Vim for now. I'm giving it an honest run for its money.
15:07ibdknoxmoreover, most of my time is spent thinking anyways, and whatever you may gain in interactivity I gain in speed of editing :D
15:07RaynesAnd my refheap.vim plugin works much better than my refheap.el plugin, so #winning.
15:07hiredmanhow can you have fast editing without paredit?
15:07ibdknoxhiredman: I have paredit.vim :)
15:08chawksDoes anyone know how to define a form for uploading files in Noir? My defpage which is supposed to get the file just receives nil instead
15:09RaynesI think Vim has better sexp editing capabilities out of the box than Emacs, right? da( = you've just deleted the current form.
15:09oakwiseas a vim user, I've been really happy using evil-mode in emacs
15:09technomancyRaynes: since you've used both, how does vim's paredit compare?
15:09cemerickRaynes: You've convinced me that anything is possible.
15:09cemerickIf technomancy were to switch to vim, I'd start stocking canned goods.
15:09oakwiseall of that nice vim editing with a clean(er) backend
15:09technomancycemerick: I've got lots of respect for vim. I just don't think I could stand vimscript.
15:09amalloyRaynes: C-M-k isn't part of paredit though, so delete-current-form isn't a convincing example
15:09cemericktechnomancy: I ;-)
15:10Raynestechnomancy: It works pretty well. slurp-forward is a little awkward because it moves the paren forward instead of the actual text.
15:10cemerickI should give vim a try in conjunction with vimclipse.
15:11technomancycemerick: some time we need to have a chat about signing artifacts and how that would mesh with moving away from clojars' current mosh-pit model.
15:11Raynestechnomancy: I also can't find a way to force insert and delete parens (if they get mismatched somehow). You can toggle it on and off, but there isn't a command for doing that. I added one to my .vimrc. Wasn't hard.
15:11RaynesIt's easy because paredit.vim has a function for toggling it -- just isn't bound to anything by default.
15:12cemericktechnomancy: I think once a lein-central plugin is settled, we'll know enough to talk about that intelligently.
15:12llasramRaynes: Not C-q (
15:12llasram?
15:12emezeskeRaynes: When I need to force-insert or delete, I replace the single character with the 'r' command
15:12emezeskeRaynes: paredit.vim doesn't enforce balance when you replace a single character
15:12pjstadigi usually just copy and paste an open or close paren
15:12cemericktechnomancy: Preview: what if Clojars could just be a Clojure-centric search UI for central?
15:13llasramRaynes: Oh, context again. nm
15:13Raynesemezeske: That works too.
15:13technomancycemerick: tempting, but the delays and group-id policies make me hesitant.
15:14Raynestechnomancy: But yeah, paredit.vim is fine for what I use it for. Your mileage may vary.
15:14technomancymy mileage is not likely to vary.
15:14technomancy=)
15:14llasramOn the Scala mailing list there was some envy recently for how easy the clojars process is vs. the comparable scala repo process
15:14technomancyllasram: I heard the scala equivalent of clojars just stopped accepting new uploads
15:14pjstadigyeah i just don't see the problem with clojars
15:14technomancyuntil they find a new sponsor or something
15:14chewbrancaparedit.vim strongly helped convine me to move to emacs ;-)
15:14cemericktechnomancy: I'm with you on the delay.
15:14chewbranca*convince
15:14technomancypjstadig: releases and snapshots in the same repo is crappy.
15:15pjstadigi think a low barrier to entry is more important than anything else
15:15pjstadigpeople can sign if they want
15:15technomancyI don't think that's good enough
15:15technomancypeople can sign if they want right now, and no one does
15:15cemerickIf you look 5 years up, having Clojars be such a linchpin of the entire dev process is going to freak out mainstream sorts that we'd really rather have in the fold.
15:15pjstadigsigning doesn't guarantee anything anyway
15:15TimMcI still don't know what signing is.
15:15chawksDoes anyone know what this error means "No implementation of method: :as-file of protocol: #'clojure.java.io/Coercions found for class: clojure.lang.PersistentArrayMap" ?
15:16hiredmanit means you are calling clojure.java.io/file on a map
15:16technomancypjstadig: it guarantees that malicious uploads only happen in the case of leaked keys
15:16ibdknoxchawks: the form would look something like this: https://refheap.com/paste/367
15:16technomancypjstadig: or people turning evil, I guess =)
15:17pjstadigtechnomancy: it only guarantees that a jar came from someone you "trust", but deciding to trust someone seems to be the more important issue
15:17chawksthanks guys
15:17pjstadigand no technological feature will help you with that
15:17pjstadigbesides not just anyone can push to any group id
15:17technomancypjstadig: it can guarantee that future releases of a jar were released by the same person who released the older versions
15:17pjstadigtechnomancy: yeah and that's good, and i agree its a step that should be taken
15:17technomancyclojars uses sha1 for passwords for pete's sake =\
15:17Raynesibdknox: You didn't paste that from a .clj file, did you?
15:17pjstadigit's not a panacea
15:18emezeskepjstadig: if I compromised clojars.org right now, I could taint all of the jars
15:18ibdknoxRaynes: I set the syntax but it was just a buffer :(
15:18emezeskepjstadig: at least with signing, I couldn't do that
15:18pjstadigsure
15:18technomancyhm; maybe I shouldn't have said that in a publicly-logged channel
15:18pjstadigso let's sign
15:18trptcolintechnomancy: your password is "sha1"? that seems pretty short.
15:18llasramtechnomancy: Oh, yeah. Shows how carefully I read that mailing list -- comparison is clojars vs. sonatype, which is apparently what the Scala community is doing now
15:18pjstadigi don't see a need to force people to sign though
15:18Raynesibdknox: It determines highlighting based on file extension. I just wanted to make sure it didn't break on a .clj file.
15:18technomancyllasram: oh sure; sonatype makes sense
15:18TimMctechnomancy: It's OK; I'm sure if you ask nicely everyone will go scrub their logs.
15:18technomancypjstadig: I'm OK with unsigned snapshots
15:18cemerickllasram: link, please?
15:19TimMctechnomancy: Just include a hidde log-scrubber in the next lein update.
15:19pjstadigthe other issue with signing is you're assuming that a person properly protects their key
15:19technomancypjstadig: necessary but not sufficient.
15:19emezeskepjstadig: better than nothing
15:20pjstadigcryptography is nice, but it's not a magic talismen
15:20technomancyit doesn't make it secure, it makes it possible to be secure
15:20emezeskepjstadig: if keys are comprimised, it will be one at a time
15:20emezeskepjstadig: instead of the entire repository being comprimised
15:21pjstadigdon't get me wrong...i'm not arguing against signing
15:21ldhi'm trying to get an RFC 1123 timestamp with clj-time. For starters I've got: (unparse (formatter "EEE, dd MMM yyyy HH:mm:ss z") (time/now))
15:21ldhwhich yields something like: "Fri, 20 Jan 2012 20:22:21 UTC"
15:21technomancypjstadig: we can't close down the current clojars repository
15:21ldhis there a way to get that in GMT? doesn't look like JodaTime supports GMT....
15:21technomancypjstadig: and I don't think we should necessarily change its policies
15:22technomancypjstadig: what I want to do is add a "releases" repository that's less of a mosh-pit
15:22pjstadigbut just because the jars are published by the same person doesn't mean they can't be malicious or introduce a bonehead bug that destroys data
15:22pjstadigyeah
15:22llasramcemerick: https://groups.google.com/d/topic/scala-user/n0oQvMpIpBY/discussion
15:22pjstadigi could get behind that
15:22cemerickllasram: thanks
15:22pjstadigtechnomancy: so what's the timeline? :)
15:22technomancypjstadig: possibly add a separate snapshots repo; possibly just use the current one
15:22technomancyhah
15:22technomancyyeah
15:22technomancywell
15:22llasramcemerick: Top of the thread -- not sure how I linked there
15:22technomancypjstadig: it'll happen before lein 2.0 is released.
15:23technomancywhich means that it will probably delay the release of lein 2.0 =)
15:23cemerickgd the new google groups
15:24technomancyspiewak is against the domain limitation; good man. =)
15:24cemericktechnomancy: I wonder if the whole thing could be shifted onto s3 to resolve any operational concerns?
15:24technomancycemerick: been planning that for months actually =)
15:25cemerick:-D
15:25technomancyclojars becomes a thin layer surrounding bucket deploys
15:25stuartsierras3 goes down from time to time
15:25technomancycemerick: well, I haven't actually gotten around to it, so...
15:26hiredmanhttp://www.taguri.org/
15:26cemerickstuartsierra: probably less often than clojars, esp. if the rack clojars' box runs on burns up.
15:26technomancyI wonder if the respectable-clojars could actually operate fairly independently of mosh-pit clojars
15:26pjstadigsure
15:26pjstadigcome up with a cool new name, phil
15:27TimMcmonoclj
15:27technomancypjstadig: I actually came up with the name "clojars" independently of ato c. six months before him.
15:27TimMcmonocles are very respectable
15:27technomancyit's a fairly obvious portmanteau. =)
15:28hiredmanlein.de.ps
15:28technomancyI'm thinking they could be fairly separate operationally but present a unified interface
15:28TimMcI really shouldn't say anything. I've already perpetrated one terrible name while joking.
15:28technomancyanyway, /me lunches
15:28hiredman.ps is palestine
15:28hiredman$60/yr
15:36Raynestechnomancy: VimL is pretty bad. The pain is eased somewhat by the ability to write plugins in Ruby and Python. And Scheme, I think.
16:23solussd_if I use a relative path in project.clj, are they relative to the directory that the project.clj is in?
16:24sritchiesolussd_: yup
16:24sritchie:source-path "src/clj"
16:25solussd_thanks
16:27cemericktechnomancy: re: `heroku run lein repl` — am I reading this right that that pipes a REPL from the deployed app (or, maybe, one of the 'dynos' serving the deployed app)?
16:29llasramIt's all fun and games until someone escapes a chroot
16:35technomancyRaynes: true, but out-of-process plugins are an admission of defeat as far as I'm concerned
16:36technomancycemerick: it starts an independent dyno for the repl
16:36Raynestechnomancy: It's out of process?
16:36cemerickah, ok
16:36JanxSpiritI have a puzzle that has been solved in several languages but not Clojure, and I just started looking at Clojure, so I don't know how to do it
16:36technomancycemerick: working on a way to get a repl in-process, but it requires bringing your own SSH host as a proxy
16:36JanxSpiritwe're generally looking for the fewest LOC/most elegant solve
16:37cemericktechnomancy: ack; better to get HTTP nrepl transport humming
16:37technomancycemerick: that would make it a lot easier
16:37technomancyhow far off is it?
16:37JanxSpiritgiven something like [1,2,3,4,5,6,7,8,9,10], return [[1,2],[3],[4,5,6],[7,8],[9],[10]]
16:37JanxSpiritthe returned lists are random length 1-3
16:37JanxSpiritand everything stays in order
16:38cemericktechnomancy: I'm plugging the bits together as we speak. Super rough on the githubs next week?
16:38technomancyexcellent; please do keep me posted
16:38cemericknrepl will have minimum of 3 transport impls, just to make sure the interface isn't stupid
16:39TimMcJanxSpirit: I'd look at the partition* functions.
16:39JanxSpiritexcellent - thanks
16:39TimMcor the split funcs
16:42brodybergHey all, I have a protocol question
16:42brodybergI am looking at an example in Joy of Clojure - 9-5. The example uses defn to setup a closure around a protocol implementation.
16:42brodybergMy question is that when I went to go try to use the symbol the example defines my invocations of the symbol implementations of the protocol don't appear to happen. In fact I know they don't happen because I get an exception from class.lang.PersistentVector.
16:42brodybergIf I then cause PersistentVector to implement the protocol I can see that even when I am trying to invoke the first protocol implementation the PersistentVector implementation is chosen.
16:43brodybergBut the example seems to imply using the code as-is should "just work."
16:43brodybergYe olde gist: https://gist.github.com/1649734
16:43brodybergWhat I want to learn is how to use fixed-fixo to end up with something that enforces the limit to the vector size that the code advertises.
16:48llasramI don't have my copy of JoC open, but the gist looks slightly confusing -- the arity of `fixo-limit' isn't consistent
16:48brodybergthat's true
16:49brodybergthat's a function I added when trying to figure out why the limit wasn't being respected
16:50dnolenJanxSpirit: do you have examples in other languages? that'll be pretty simple in Clojure.
16:50amalloyJanxSpirit: split-at seems like your #1 suspect
16:51JanxSpiritthat's what I used in Scala...hang on...
16:52dnolenJanxSpirit: I've got something that works that probably can't get any shorter unless you programming in K or something.
16:53TimMcor APL
16:53JanxSpirithmm...can't find it right now but I can rewrite it - basically the Scala one used a splitAt and pattern match and recursion...it was 3 or 4 meaningful lines
16:54dnolenTimMc: well K is APL-like
16:54TimMcamalloy: unfold might be good here
16:54amalloyheh, "meaningful" lines. a nice way of saying "my language makes me write extra rubbish"
16:55llasrambrodyberg: LOL
16:55llasrambrodyberg: Typo from hell
16:55llasrambrodyberg: Your one-arg form of fixed-fixo doesn't have parens around the intended call to `fixed-fixo'
16:55TimMcdnolen: Unlike R, K doesn't seem to be Googleable by itself. :-)
16:56dnolenTimMc: http://en.wikipedia.org/wiki/K_(programming_language)
16:56TimMcyeah
16:56llasrambrodyberg: So it just returns an empty vector (last form in the body) each time
16:56brodybergllasram let me check that out
16:56llasramI wonder how difficult it would be to make the compiler complain about that...
16:57technomancyhuh; apparently scala-tools.org hosted jenkins as well as mvn repos
16:57brodybergllasram that was it, thanks
16:57llasramBecause they need to recompile the world for every compiler release?
16:58technomancyheh
16:58technomancybut that explains why they didn't want to keep it up; running everyone's tests like that is a lot more expensive than just serving up a bunch of static files
17:01JanxSpiritOK Scala one is something like this:
17:01JanxSpiritscala> def chunk(l: List[Int], i: Int): List[List[Int]] = l.splitAt(i) match {
17:01JanxSpirit | case (Nil, Nil) => Nil
17:01JanxSpirit | case (ch, rest) => ch :: chunk(rest, (util.Random.nextInt(3) + 1))
17:01JanxSpirit | }
17:01JanxSpiritchunk((1 to 10).toList, util.Random.nextInt(3) +1)
17:01JanxSpiritres12: List[List[Int]] = List(List(1), List(2, 3, 4), List(5, 6, 7), List(8), List(9), List(10))
17:02JanxSpiritamalloy: I come from Java, so Scala hardly feels like a lot of rubbish, but I'm always open to improvement :)
17:02JanxSpiritmostly I meant a single curly brace on a line hardly counts
17:02dnolenJanxSpirit: https://gist.github.com/1649812 if you want to see an answer
17:03dnolenin Clojure
17:04JanxSpiritthat's cool - gonna have to read that one over a few times ;)
17:06JanxSpiritwhat is (when (seq s) ?
17:06Raynes&(seq [1 2 3])
17:06lazybot⇒ (1 2 3)
17:06Raynes&(seq [])
17:06lazybot⇒ nil
17:07RaynesJanxSpirit: It's a clever way to check whether or not a collection is empty.
17:07JanxSpiritOK
17:07Raynes(when (seq s) ..) = when s has elements, do this stuff
17:09JanxSpiritcool - I think I get the rest of it...the let syntax with square brackets is a bit confusing
17:11TimMc~guards
17:11clojurebotSEIZE HIM!
17:12amalloyTimMc: naw, people complaining about [] instead of () is a change for the better
17:12TimMcJanxSpirit: THat's destructuring.
17:12technomancyusually it's CL folks complaining about brackets though
17:13llasramLiteral maps and vectors are so brilliant, man
17:13technomancyyeah, associative data structures in elisp are worthless
17:13technomancyplus their vector syntax implicitly quotes everything inside
17:13TimMcew
17:15_carlos_what is a relevant difference between "ns" and "in-ns"?
17:15ibdknoxns refers clojure.core
17:16ibdknoxI don't think in-ns does
17:16amalloyalso ns is a macro that handles require/use, etc
17:16technomancyin-ns is lower-level
17:17TimMcin-ns doesn't do any refers, requires, etc.
17:17amalloytechnomancy: it's not so much implicit quoting as "dude this is a literal", right? the same as (quote (a b c)) implicitly quotes a, b, and c
17:18technomancynothing implicit about that =)
17:18amalloyclojure's [] {} aren't exactly literals in the same sense that, say, "string" is a string literal
17:18technomancy?
17:18llasramHow so not?
17:19technomancythey're compound and strings are scalar
17:20_carlos_so basically I can use "ns" in place of "in-ns"
17:21amalloyit's been a while since my compilers/languages courses, but my understanding is a "literal" syntactically is a fixed value, as opposed to being something with pluggable "slots" like the [] syntax
17:21technomancy_carlos_: basically: never call in-ns directly in a file. it's ok to use at the repl
17:21llasramAh, ok. What's a better word for "data type emitted by the reader"?
17:22amalloyie, [a b c] is a vector literal containing the three symbols a, b, and c. but if you're using it to represent some other vector with three values, referring to locals a, b, and c at runtime, then it's not really a literal
17:22technomancyamalloy: suspect that definition was rooted in a language without a clear read/eval distinction
17:22_carlos_technomancy: thank you
17:23technomancysure
17:23amalloylike, would anyone say that java's array syntax is literals? new String[] {"foo", myLocal};?
17:24brodybergno
17:24SomelauwDoes that work?
17:25amalloyhow is that different from ["foo", my-local]? surely the "new String[]" doesn't somehow make it not be a literal
17:25amalloySomelauw: yes
17:26brodybergnew String[] { ... } means "make a new string array with these contents. A literal on the other hand immediately is the array of strings.
17:27amalloyi'm totally unconvinced by that. (defn foo [x] ["foo" x]) constructs a new vector every time foo is called
17:27technomancyamalloy: are you sure?
17:28TimMchas to
17:28amalloyyes
17:28hiredmanit has to
17:28technomancyoh, I didn't see the x
17:28technomancyin the vector
17:28amalloytechnomancy: even (defn foo [x] [:foo :bar]) does, though
17:28amalloydoesn't have to, but it does
17:28technomancyhm; ok
17:29amalloyi tried to write a macro that would convert that to (let [v [:foo :bar]] (defn foo [x] v)), but it's really hard :P
17:29cemerick,(letfn [(f [] [:a :b])] (identical? (f) (f)))
17:29clojurebottrue
17:29technomancyoh snap!
17:30TimMc&(apply identical? (map (constantly [:foo]) (range 2)))
17:30lazybot⇒ true
17:30cemericklawyered 
17:30amalloyhuh! maybe that changed in 1.3? or my tests were totally rubbish
17:30TimMcAh. beat me to it.
17:30amalloyTimMc: well, yours is totally different
17:30dnolenI dunno, literals are literals. I believe optimizable literals like '() and [] are called constant literals in the compiler.
17:31TimMcamalloy: I don't see how.
17:31amalloyTimMc: (constantly (x)) is (let [ret (x)] (fn [& args] ret)). totally different from (fn [& args] (x))
17:32cemerickdnolen: I *think* amalloy is saying that the vector in (eval '[a]) isn't a literal (assuming there's an `a` in scope).
17:34TimMcamalloy: Where let is in this case a lambda. I see.
17:34amalloyi'm only really arguing this point because technomancy was complaining that elisp's vector literals can only contain constants
17:34pjstadigamalloy: seems do have changed from 1.2->1.3 according to my tests
17:35amalloythanks pjstadig. glad to hear i'm not an idiot
17:35pjstadigi understand where you're coming from
17:35pjstadigbut maybe it's the difference between a constant and a literal
17:35pjstadigor a constant literal like dnolen said
17:36_carlos_are all deprecated forms from clojure.core API tagged as so?
17:36pjstadigyou'd expect a literal to be written to the compiled file and read in verbatim or something
17:36pjstadiglike a constant pool or whatever
17:36cemerickAFAICT, literals are always literals, but if there's symbols in them, they may not evaluate to themselves.
17:38pjstadig_carlos_: i'm not sure there are any deprecated forms
17:38pjstadigthough anything marked "alpha" may get yanked
17:39cemerick_carlos_: anything struct-related is deprecated by records, even if not marked
17:39cemerickpjstadig: there's add-classpath, anyway
17:39pjstadigtrue
17:40_carlos_is :gen-class used inside (ns ... (:gen-class) nowadays?
17:43TimMcpjstadig: Things marked alpha: promise, all transient stuff, juxt, deftype, add-watch
17:43ibdknoxif they remove juxt, I bet amalloy would just quite clojure on the spot.
17:43pjstadigTimMc: I'm just repeating what Rich said at the Conj
17:43TimMcyeah
17:43TimMcibdknox: RAGEQUIT
17:43ibdknoxquit*
17:43pjstadigyou can define your own
17:43ibdknoxTimMc, srsly
17:44amalloydidn't that lose its alpha designation in 1.3?
17:44TimMcpjstadig: I can't see some of these being changed at this point.
17:44amalloyyes, it did
17:44TimMcamalloy: Oops, that was in my 1.2 repl.
17:44technomancyI could see transients going away in favour of pods
17:44hiredmanalso chunks
17:44cemerickplease yes re: transients
17:44technomancyare chunks even documented though?
17:44technomancycemerick: but I have such a good blog post for those. =(
17:45cemericktechnomancy: feh. Writing about them was hell IMO.
17:45cemerickpublish now so the post has some half-life before being obsoleted. :-P
17:46technomancyoh, I posted it like a year ago; it's cool. =)
17:46technomancyhttp://technomancy.us/132
17:46cemericknm then :-)
17:46technomancytwo years ago
17:46cemerickoh, THAT
17:46technomancyhaha
17:46technomancytransients are valuable because they help explain persistents
17:47pjstadigdeftype and defrecord are Alpha in 1.2
17:47pjstadiger 1.3
17:47ibdknoxI've been bad and haven't blogged in forever
17:47technomancywithout the darkness we would not appreciate the light.
17:47ibdknoxneed to get back on that
17:47pjstadigas are watches on refs
17:47technomancyrelevant: http://www.qwantz.com/index.php?comic=2047
17:49pjstadig,(find-doc "Alpha")
17:49clojurebot-------------------------
17:49clojurebotclojure.core/add-watch
17:49clojurebot([reference key fn])
17:49clojurebot Alpha - subject to change.
17:49clojurebot Adds a watch function to an agent/atom/var/ref reference. The watch
17:49clojurebot fn must be a fn of 4 args: a key, the reference, its old-state, its
17:49clojurebot new-state. Whenever the reference's state might have been changed,
17:49clojurebot any registered watches will have their functions called. The watch fn
17:49clojurebot will be called syn...
17:51TimMcpjstadig: Yeah, the only thing I was wrong about was juxt.
17:51cemericktechnomancy: problem with that is that *watching* baseball is the perfect background for enjoying a beverage.
17:51TimMcand a good thing, that
17:52technomancyI dunno; you could say the same of an aquarium or roaring fire.
17:53TimMcGonna say... no.
17:53TimMcBut then, I'm not a sports person.
17:54llasramSpeaking of things for which more documentation might be nice, is there a good description of the core interfaces anywhere? I needed to implement a seq-able deftype the other day, and found several decent examples, but little real explanation
17:54hiredmanat one point the ceo of sonian asked technomancy something like "how about those seahawks?" and technomancy said "I don't play pokemon"
17:54dakronehiredman: best moment of that entire meetup
17:54TimMcMy response is "I don't follow soccer", and hope they weeren't talking about a soccer team. But I'm going to steal that one...
17:55hiredmanit was pretty coode
17:55technomancyhiredman: three seconds later I realized he was the CEO.
17:55hiredmangood
17:55amalloyhttp://xkcd.com/178/ for reference
17:55pjstadigand that was technomancy's last day
17:55TimMcah!
17:55technomancyhaha
18:04cemerickhiredman: that's a gem
18:05dnolenllasram: you generally have to goto the source
18:07llasramdnolen: I did do that, but it's difficult to tell what's necessarily the right/best way to do things. There are quite a few fine-grained interfaces, and it's not clear to me what the intent of all of them is
18:08dnolenllasram: then ask away.
18:12cemerickllasram: http://www.clojureatlas.com can sometimes help; I need to do some work to add decent descriptions to all of the key interfaces you'd want to implement, but it's perhaps a useful thing to get a handle on how they relate to each other
18:13llasramdnolen: Ok, fair enough :-). Let me see... What are the differing intents for ILookup vs Associative ?
18:14TimMcIntent is in the eye of the beholder, since javadoc is entirely neglected by core.
18:15llasramISeq vs. Sequable ?
18:15dnolenllasram: Associative is anything that implements entryAt and assoc. ILookup needs to implement valAt
18:15dnolenllasram: Seqable is something that can be coerced into an ISeq
18:17llasramI see. So implement ISeq if you need fine-grained control over iteration, and Seqable if you can just e.g. use lazy-seq?
18:17dnolenllasram: no if something satisfies ISeq it can be used as a sequence in Clojure.
18:17arohnerare there any cron-like libraries for clojure worth recommending?
18:18llasramdnolen: sorry, s,iteration,enumeration,? How Clojure will actually walk the sequence being provided
18:19dnolenllasram: *you* control that by implementing ISeq
18:19llasramRight
18:20hiredmanif you implement ISeq you are a seq, if you implement Seqable you can supply a seq if asked for one
18:21llasramThat makes sense.
18:23llasramAnother question: why does IPersistentSet/get return a value used as the return of set lookup (in RT/get etc IIRC)? Is it valid to for lookup in a set to return some other object entirely?
18:24amalloy&(#{'(1 2)} [1 2])
18:24lazybot⇒ (1 2)
18:24technomancyif you return a different value, you're probably an Assoc rather than a Set
18:24llasramAhhhhhh, because equality != identity, got it
18:24llasramOk, this has been very helpful. Thank you, dnolen :-)
18:25dnolennp
18:28dnolenit's interesting that CLJS only defines 26 protocols
18:29dnolenmake that 25
18:30AimHereOne for every letter of the alphabet
18:33llasramExcept poor, forgotten '
18:44llasramOh, right, that's what I'd been implementing. Was looking at totally the wrong thing -- no wonder had a hard time recalling issues. Was this: https://github.com/llasram/playground.clj/blob/master/src/playground/util.clj#L267
18:44llasramIdea is a set of things, but lookups map to a sequence of all the parents of the lookup key
18:45llasramLooks to me like I must have largely settled on the correct behaviors
19:05frankvilhelmsenmsg
19:07dybahey everyone, I'm having trouble implementing a factorial function
19:07dybaI'm coming from a Ruby background, so I have some brain rewiring to do
19:08dybaI attempted to use a loop that kept track of two variables n and result
19:08dybalet me get a gist link first
19:11dybahttps://gist.github.com/1650384 - Clojure Koans - Recursion.clj
19:12dybaI got it to work in Ruby, but I'm having trouble making the translation to Clojure
19:13dybai understand that using recur rebinds the variables you use in a loop
19:14dybasince everything is immutable in clojure, i thought this would be one approach to decrement n and calculate the result, making sure to keep track of both
19:14dybabut i realized that recur doesn't return anything
19:14dybaso my result will always be 1... not good
19:15technomancyyou need another termination condition
19:15dybathen i thought back to using cond as I had tried out in common lisp
19:16dybatechnomancy: would that be a third parameter in recur?
19:16amalloyhaha, i like the "working so far" approach. "I've only tried it for inputs 0 and 1, and it works!"
19:16dybaamalloy: :)
19:17technomancydyba: another if
19:17dybathis problem is a cinch in ruby
19:17amalloytechnomancy: he doesn't need any more conditions, just a better result when he terminates
19:17technomancyheh; sure, if you know ruby
19:17llasramdyba: It's a cinch in Clojure too :-)
19:17amalloydyba: you imply that this is like, an open problem in clojure. nobody's figured out how to do it
19:18dyballasram: i bet it is, but I'm at the lowest productive point right now. Barrier to entry to Clojure is high
19:18amalloydyba: just change the "then" part of the if, to return result instead of 1. done
19:19amalloy&(apply * (range 1 6)) ;; a simpler approach to 5!, for what that's worth
19:19lazybot⇒ 120
19:20technomancy,((comp (partial apply *) (partial range 1) inc) 5)
19:20clojurebot120
19:20technomancyway simpler, come on now.
19:20dybai forgot about ranges!
19:21technomancyactually you don't need to partial range
19:22technomancy,((comp (partial apply *) rest range inc) 5)
19:22clojurebot120
19:22technomancytry porting that to ruby =)
19:22dybaamalloy: just read the part you mentioned about changing "then", yah, I see that now
19:22TimMcAre you avoiding ->> for a reason?
19:23technomancyTimMc: it's not as ridiculous?
19:24technomancyI guess now that plain defs can have docstrings that's one objection to point-free-mania that no longer stands
19:24technomancyyou still miss out on arglists, but most point-free stuff takes a single arg anyway
19:26dybalooks like i got stuck in an infinite loop when i put the recur outside the if
19:28amalloytechnomancy: not sure i agree with that; it'd be nice to (def find-first (comp first filter))
19:28amalloyand similar things like that
19:29technomancyyeah, I guess so
19:29technomancyI wish meta-on-fns were taken more seriously
19:30technomancyno reason comp and partial couldn't preserve arglists
19:30amalloyyeah, that's a good point
19:31technomancywhat was the reasoning behind that anyway? saving space on android or something?
19:31clj_newbwhy can't I (:import (java.awt.geom.Rectangle2D Float)) ?
19:31clj_newbI wnat to create an object of type Rectangle2D::Float
19:32llasramclj_newb: Inner classes are a lie
19:33llasram(import '[java.awt.geom Rectangle2D$Float])
19:33clj_newbllasram: how do use them in Clojure?
19:33clj_newbRectangle2D$Float. <-- unable to resolve clas name
19:35llasramOh?
19:35clj_newbllasram: I had a typo
19:35clj_newbfixed now. thanks
19:35llasramnp
19:44wjlroeI'm having problems using read-line - it seems to not return (running with `lein run`) - with this code: https://gist.github.com/1650490
19:45technomancywjlroe: try "lein trampoline run"
19:45technomancy(known issue)
19:45wjlroeah ha
19:46wjlroetechnomancy: thanks! that works - so why is that?
19:46technomancywjlroe: java doesn't let you access stdin from subprocesses
19:47technomancytrampoline works around this by not using subprocesses
19:47technomancyit's dumb
19:47technomancybut it's what you gotta do
19:47wjlroeok
19:48wjlroetechnomancy: so would there be a way to set that in the args passed to :main in the project.clj - just to cut down on the command line stuff?
19:48JohnnyLhave any of you used concurrency structures on a multicorein Clojure?
19:49technomancywjlroe: no, lein run will always use a subprocess
19:49technomancybut if you use an uberjar it won't be a problem
19:50technomancywell, lein run might not use a subprocess in lein2
19:50technomancybut I don't see it changing in lein1
19:50dgrnbrgHow am I supposed to debug protocols in a repl if the I keep getting compiler errors that the class has already been defined (but now I want to change it)?
19:51dgrnbrgJohnnyL, I know a thing or twoo
19:53dgrnbrgtechnomancy, what workflow do you use?
19:54muhoointeractive development is very helpful in dealing with protocols. you can query a server, see what it returns, etc.
19:54dgrnbrgmuhoo, Protocols are a feature of clojure
19:54dgrnbrgsort of like types
19:54muhooah
19:54technomancydgrnbrg: multimethods and defns
19:55technomancyI have never encountered a polymorphism problem for which dispatch was a performance bottleneck
19:55dgrnbrginteresting
19:55dgrnbrgI'm writing an embedded language in clojure
19:56dgrnbrgI am using protocols to help gather the interfaces various concepts in the language
19:56technomancyI was about to say, the main driving use case for protocols are for writing clojure-in-clojure.
19:56dgrnbrgi wish there was a dynamic attribute to the protocols
19:56dgrnbrgor a global flag
19:56technomancybut writing lower-level code forces you to make certain compromises
19:57wjlroetechnomancy: what I mean is, instead of controlling this JVM trampoline using the command line "lein trampoline run", pop that in the project.clj file so you don't have to remember the special case. So maybe a key in the project like :trampoline-run true ?
19:57technomancyhm; you could add a hook to do that
19:57JohnnyLdgrnbrg: have you had it chugging away on long running processes utilizing all cores?
19:58wjlroetechnomancy: ok, I'll have a look, see what I can hack
19:58technomancywjlroe: I'd rather not add something to lein1 since I think lein2 might have a cleaner solution with in-process classloaders
19:58wjlroetechnomancy: well if it can be done with a hook - then that's the way to do it
19:58dgrnbrgJohnnyL, not extensively
19:58dgrnbrgbut i do know how it works
19:58JohnnyLi tried the parallel libs for python. It appears to divy up the processing smothly across all cores.
19:59dgrnbrgJohnnyL, taht's a very abstract description of your problem
19:59technomancyJohnnyL: are you talking about concurrency or parallelism?
19:59clj_newbcrap; does java/clojure have the concept of friendship?
19:59JohnnyLtechnomancy: what does clojure support?
19:59technomancyconcurrency is trivial in Clojure. parallelism depends a lot on the kinds of work you want to do and the shape of your data.
20:00clj_newbi.e. I need to define X to be a [proxy Foo], yet have acess to the protected members of [Dog]
20:00clj_newbdamn it, so protected = accessible in package, but not owrld
20:01clj_newbbut my proxy objects are NOT defined in the original apckage
20:01dgrnbrgtechnomancy, are you sharp w/ macros?
20:01clj_newbhmm, what is the right way to do this, to make this protected members public?
20:01clj_newbthis seems very dirty
20:01clj_newbalternatively, can I define d aproxy to be in a different package?
20:01dgrnbrgI have a macro that gets a symbol as an argument, but I want to invoke a namespace-qualified version of that symbol
20:01hiredmanJohnnyL: how does python deal with parallelism given the gil?
20:01clj_newb(a package that is in java land, not clojure land, even)
20:01technomancydgrnbrg: I guess?
20:02technomancydgrnbrg: maybe ns-resolve
20:02technomancy,(doc ns-resolve)
20:02clojurebot"([ns sym] [ns env sym]); Returns the var or Class to which a symbol will be resolved in the namespace (unless found in the environement), else nil. Note that if the symbol is fully qualified, the var/Class to which it resolves need not be present in the namespace."
20:03dgrnbrgthat seems like it doesn't fit my use case
20:03dgrnbrgI'm defining a multimethod version of +
20:03dgrnbrgvia a macro
20:03dgrnbrgbut I want to specify that if the arguments are Numbers, use core's +
20:03technomancyyou can't really know that at compile-time
20:03dgrnbrgbut the macro is generating multimethod versions of everything
20:04JohnnyLhiredman: tcp/ip sockets across multiple 32 bit processes.
20:04hiredmanJohnnyL: :|
20:05dgrnbrgtechnomancy, this should be clearer: http://pastebin.com/9PrnbL9u
20:05dgrnbrgon line 12, I want it to work
20:08dgrnbrgnvm, ns-resolve works :)
20:10JohnnyLthank you gentleman.
20:13llasramtechnomancy: re: polymorphic dispatch latency; low-latency network services?
20:15technomancypretty sure anything involving I/O is going to make multimethod dispatch look like a rounding error
20:17llasramHmm. I think that's probably true for individual instances, but my intuition is that the latency would add up if used pervasively for fundamental interfaces
20:17technomancyonly one way to find out
20:18llasramRe-implement Clojure in Clojure using multimethods?
20:18technomancyI didn't say it's impossible, just that I'd never worked on such a system.
20:18technomancyand my intuition is that the majority of Clojure users will not do so either
20:24dybafinally got that recursion problem in the koans to work
20:25dybaTIL recur doesn't eat up the stack
20:26dnolenis swank-clojure 1.4.0-SNAPSHOT on any major repo besides clojars?
20:32technomancydnolen: are there any other major repos that would take it?
20:33dnolentechnomancy: good to know I'm not crazy, just trying to understand how to setup/run test.benchmark, thoroughly lacking in any documentation whatsoever
20:33technomancyI thought most of them were restrictive about group-ids and package names
20:33technomancyI think stuart S pushed an early version out to maven central and tweaked the group-id, but that's the only one I'm aware of
20:34technomancyboo on poms that refer to artifacts without declaring where they're from =\
20:36dnolentechnomancy: test.benchmark is clearly in a half-assed state
20:36technomancythis is the first I've heard of it
20:36hiredmanshocking
20:36hiredmanmaybe should write some alioth benchmarks for it
20:37dnolenthere are some benchmarks in there and they look good.
20:46dgrnbrgIs there a normal pattern for splicing a macro that takes an fntail?
20:46dgrnbrgsince ~@ doesn't work because the parameters get ns-qualified
20:46dgrnbrgwait nvm I'm silly
20:47wjlroeTrying to add my own metadata to a function, but it's not working well: https://gist.github.com/1650711 (have to compile twice to see it and if I run normally, it's not there)?
20:48philhi, is there a way to destructure a vector argument and dispatch it into a function with multiple arities?
20:48philsimilar to haskell
20:49dnolenwjlroe: metadata is put onto the var not the fn
20:50dnolenphil: don't follow
20:50wjlroednolen: ok, so how do I do this? define a function and its metadata like that?
20:51dnolenwjlroe: access the metadata like this, (meta #'exit)
20:52phildnolen: i mean lets say a have a fn x, i wanna be able to do the following: (x [1]) (x [1 2]) (x [1 2 3]) and then pattern match (destructure) the vector elements without having to resort to ifs or vector size tests
20:52philpreferably with core clojure (need this for clojurescript)
20:53dnolenphil: (apply x v)
20:53philoh yes... and then just define x with multiple arities right?
20:54dnolenphil: yep
20:54philperfect, thx :)
20:55dnolennp
21:01dgrnbrgI just implemented an extensible type system in clojure
21:01dgrnbrg:)
21:02dgrnbrgdnolen, is it possible to define unification for arbitrary types?
21:02dnolendgrnbrg: yes
21:02dgrnbrglike, if I wanted to specify that int and float can be unified into floats
21:03dgrnbrgdnolen, I suppose I really want to have promotion-esque behavior
21:03dnolendgrnbrg: just implement IUnify for that type, then you'll need to do a second dispatch
21:03dnolenfor the second argument, default is of course to return nil, you only need to implement the second dispatch for the types you caere about.
21:03dgrnbrgdoes core.logic try unifying each of the pair of objects-to-be-unified to each other to see if either direction succeeds?
21:04TimMctechnomancy: Yeah, the whole Maven deps system kind of weirds me out. How long is it going to be before someone uploads a malicious jar (to a different repo) masquerading as, say, Apache Commons...
21:04dnolendgrnbrg: nope, you have to do both sides yourself. but again you can provide the default by extending Object
21:04dgrnbrghmm
21:05dnolen(extend-type Float IUnifyTerms ...)
21:05dnolen(extend-type Ojbect IUnifyWithFloat (unify-with-float [_] nil))
21:05dnolenetc
21:05dgrnbrgI see
21:05dgrnbrgI think that it'll be too difficult for me to implement this right away
21:06dgrnbrgI'll continue mulling it over
21:06dnolenis the extensible type system using core.logic?
21:06dgrnbrgis condu the best idiom for error reporting?
21:06dgrnbrgyes, it is
21:06dgrnbrgI'm working on an hdl
21:06dgrnbrgi implemented a simple unifier
21:06dnolendgrnbrg: there is not idiom for error reporting yet - would love to hear ideas about htat
21:06dnolendgrnbrg: hdl?
21:06dgrnbrghardware description language
21:07dgrnbrg(it's me again)
21:07dgrnbrgbut now, I can talk about it!
21:07dnolendgrnbrg: oh yeah, cool!
21:07dgrnbrgoooooohhhhhhh
21:07dgrnbrgYou could do error reporting by combining the core.logic monad with a list monad
21:08dgrnbrgand adding errors to the list if they occur
21:08dgrnbrgas a goal that always succeeds and adds the error to the error-list
21:08dgrnbrgthen again...
21:09dgrnbrgI think errors can't be pure logic and have a nice api and be not too hard to implement
21:09dgrnbrgI like the idea of using condu as an an "else error" block
21:09flazzanyone get indenting to properly work on textmate2 beta?
21:09dgrnbrgand appendo the error to an error variable you pass around
21:10dnolendgrnbrg: I think there's a bit of literature out there about this stuff, I haven't looked to closely
21:11dgrnbrgdnolen, I tend to improvise :)
21:11dnolendgrnbrg: I recall seeing interesting things when I was investigating implementing Definite Clause Grammars - the Prolog NLP people were interested in this kind of thing if I call.
21:11dgrnbrgbut not always
21:11dnolenrecall
22:28muhoodoes clojurescript work with multimethods?
23:04technomancyTimMc: lein gives maven central precedence over clojars, so that helps
23:04technomancybut we still need signing
23:07metajackMy emacs mode lines are getting complicated for some reason. [[[[(Clojure Slime[clojure] Paredit yas)]]]]. Why all the brackets?
23:07metajackMy repl buffer is similar
23:10muhoois tehre anything for clojure that will parse an html file, kind of like hiccup in reverse?
23:11muhoohmm, i suppose i could use the apache java libraries for that, nm
23:11metajackmuhoo: I'm using enlive for that. works really well
23:11metajackthere are also a few clojure wrappers of popular java libs for that as well
23:11brehautenlive is a very good choice
23:11muhoothanks
23:13oakwiseemacs/clojure-mode newb question: is there a way to get emacs to color :require'd/:use'd funcs and macros? e.g. defhtml from hiccup
23:13brehautmuhoo: theres a good tutorial on the github wiki, and the readme (i think) links to dnolans introduction as well.
23:14brehautoakwise: i dont know if clojure-mode knows how to connect to slime for its coloring, but generally speaking colorising lisps is quite difficult
23:15oakwisebrehaut: darn, thanks
23:15brehautoakwise: if you cant inspect a running enviroment to find out about the macros that are provided you have to run on guess work and heuristics
23:15oakwiseit's so much prettier on http://webnoir.org/ :)
23:15oakwiseright
23:15brehautthats because chris busts his gut to make his documentation good
23:16oakwiseseems so
23:16brehauthuh. it appears hes using gist
23:16oakwisewhich uses pygments I think?
23:17brehautyeah
23:17brehauti know that amalloy has done some work on the pygments brush
23:18metajackHmm. I seem to have gotten CDT into a state it can't get out of :(
23:19oakwiselooks like it's highlighting anything non-quoted in the calling position of a list regardless of imports
23:24jeremyheilerAre there any useful libs for socket io, or is it all java interop right now?
23:25metajackThere's aleph
23:28jeremyheilermetajack: looks interesting. not sure i want to depend on netty for this project, though.
23:29jeremyheilermetajack: thanks
23:29metajackI ran across a few things that were protocol specific (eg. websockets) that didn't use netty, but aleph seemed to be the best out there.
23:30metajackI think part of the issue is that the Java interop is so good people don't make it to the clojure wrappers often :)
23:31technomancyoakwise: I think slime has something for that, but it's only wired up for CL
23:32brehautyay slime :(
23:32brehauti for one welcome our new nrepl overlords
23:33oakwisetechnomancy: as long as I'm not the only one with non-pretty top-levels, I'm happy I guess :)
23:35brehautoakwise: be thankful you arent a textmate using clojure programmer :P
23:37jeremyheilermetajack: yeah, good point. ideally, though, clojure core could abstract socket io a bit so it's less platform specific in library code.
23:37oakwiseheh indeed
23:48jeremyheilerI wonder why clojure.contrib.server-socket was never promoted out of contrib.
23:48brehautjeremyheiler: because nobody offered to do so?
23:51jeremyheilerbrehaut: really? i figured there might have been some other reason.
23:52brehautmay well be? but i dont think any libraries got promoted unless someone was willing to commit to taking them on?
23:54jeremyheileryeah, makes sense. maybe i'll play around with it and see if it can/should be salvaged.
23:56brehautjeremyheiler: you could always track down Craig McDaniel and ask him about it? (at least, hes the listed author in the code)