#clojure log - Jan 20 2012

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

0:00 geoffeg_c: how can i add an element to a map while i create the map? { "color" "green", (if (contains shapes "square") ("is_square" "yes")) }

0:00 that doesn't seem to work

0:01 amalloy: you can't. just use assoc or conj outside the literal

0:01 geoffeg_c: ok

0:02 alex_baranosky: what is a good way to go from a LazySeq to a Cons ?

0:02 amalloy: alex_baranosky: that goal sounds highly suspicious

0:03 alex_baranosky: normally in Midje the forms of Midje macros are checked for syntax validity

0:03 amalloy: &(doc seq?)

0:03 lazybot: ⇒ "([x]); Return true if x implements ISeq"

0:03 alex_baranosky: if they are invalid you get a message saying the particular kind of invalid syntax, with the form printed out afterward

0:04 however, 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

0:04 mophd => morphed

0:05 amalloy: there, now we're at the real problem: how do you print a lazy-seq

0:05 &((juxt str pr-str) (range 3))

0:05 lazybot: ⇒ ["clojure.lang.LazySeq@7480" "(0 1 2)"]

0:05 alex_baranosky: and preferrably print a lazy seq without knowing whether it is a lazy seq or a Cons

0:06 amalloy: if you just want to print them, you can use pr(n) instead of print(ln)

0:06 alex_baranosky: ahhh so I should stop using str

0:07 thanks amalloy: that does the trick. Guess that hadn't bitten me yet

0:17 metajack: tavis`: I applied that patch to master of technomancy/swank-clojure and fired it up and got this: https://gist.github.com/1645485

0:18 oh wait. perhaps i needed to use uberjar.

0:27 tavis`: now that i've managed to install it correct, it works like a charm. thanks!

0:28 ibdknox: has anyone gotten this-as to work in CLJS

0:47 technomancy: tavis`: ISTR that being mentioned in the official slime manual (working over tramp)

0:47 or at least working over SSH

0:48 C-c C-r is a workaround though

0:53 tavis`: technomancy: I've got the filename translation working now, but the bytecompile step is leading to an error "can't load docstring file" f

0:53

0:53

0:53 metajack: is 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.

0:54 technomancy: tavis`: hmm; gotta take off; maybe start a thread on the swank mailing list?

1:54 tavis: if 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

1:55 you 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)

1:55 Raynes: Tramp is the bane of my existence.

1:56 tavis: used to be mine, but after some wrangling I love it

1:56 Raynes: I 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.

1:56 tavis: everything bar the initial loading of the slime el files works

1:57 have you tried fuse?

1:57 ibdknox: Raynes: you should mount remote volumes locally

1:57 tavis: hmm, you said as root, ignore that suggestion

1:57 ibdknox: which is what fuse does I think

1:58 Raynes: ibdknox: I haven't tried that. I'll check it out. I'd be good for me.

1:58 ibdknox: unless we're talking about two different fuses

1:58 tavis: same fuss

1:58 fuse

1:58 Raynes: ibdknox: Also, wtf, where did you come from?

1:58 ibdknox: the shadows

1:58 Raynes: Apparently.

1:58 ibdknox: I'm always here in spirit

1:59 tavis: you're from NZ?

2:00 hmm, nope confusing you with someone else

2:27 emezeske: anyone in here have moderator powers on the clojure google group?

2:28 My posts are still being moderated, and it's taking like 24+ hours for each one to show up

2:28 Makes it really hard to have a conversation :(

2:36 scottj: emezeske: have you subscribed to the group?

2:37 emezeske: scottj: yeah, I'm a member

3:29 Blkt: good morning everyone

4:08 ljos: Hi - 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.

4:08 The second time is n waits.

4:09 brehaut: ljos: http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/locking

4:09 ljos: http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/locking

4:10 brehaut: with all the caveats manual locking entails

4:11 ljos: damned this client. Didn't mean to paste again :P I don't usually sit on windows :P

4:14 Is there anywhere that explains how it works?

4:17 What 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.

4:18 Or maybe what I am asking more is how is locking implemented?

4:26 O guess I will have to try for myself. Thanks for pointing me in the right direction.

4:31 raek: ljos: a (basic) synchronized/locked piece of code can only hold one thread at a time

4:31 ljos: maybe you want a BlockingQueue

4:32 http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/BlockingQueue.html

4:32 SynchronousQueue is one implementation which works as a rendezvous channel

4:33 one thread tries to put something into the queue and one thread tries to pull something out

4:33 and the calls will block until there is a thread "on the other end"

4:34 if you don't need to transfer a value, you can also use Object.wait and Object.notify

4:35 (def lock (Object.)) (defn wait [] (locking lock (.wait lock))) (defn notify [] (locking lock (.notify lock)))

4:36 http://en.wikipedia.org/wiki/File:Monitor_(synchronization)-Java.png

4:37 there is also .notifyAll, which works like .notify but it wakes upp all threads .wait'ing

4:40 btw, when a thread calls .wait, it will go to sleep until another thread calls .notify. during this sleep it does not occupy the lock

4:44 wiseen: anyone knows the answer http://stackoverflow.com/questions/8938330/clojure-swap-atom-dequeuing ?

5:28 ljos: raek: 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).

5:56 c0smikdebris: anybody using sublime text 2 here?

5:59 raek: ljos: "(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.

6:01 on the JVM each object acts as a monitor with a single condition variable

6:06 ljos: Ah. 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.

8:57 Another question. Is there a way to stop clojure.main from taking focus the first time I compile in Emacs (SLIME)?

8:57 Another question. Is there a way to stop clojure.main from taking focus the first time I compile in Emacs (SLIME)?

9:01 Another question. Is there a way to make clojure.main not take focus the first time I compile in Emacs (SLIME)?

9:05 manutter: Take focus?

9:05 solussd_: 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)?

9:06 pisketti: I've wondered that too

9:07 ljos: manutter: when I compile the first time (i'm in osx) a process starts that takes focus from my main window.

9:08 solussd_: I think Let Over Lambda is a book you should read regardless if you program in any LISP.

9:08 solussd_: ljos: I got the impression from reviews that a non-lisper would be lost!

9:08 cemerick: ljos: If you're doing anything with Swing or AWT, that'll happen. Your beef is with Apple.

9:09 ljos: cemerick: ah. Sigh. It isn't really a problem, just irretating.

9:10 solussd_: another random question- has anyone played with javafx 2.0 in clojure?

9:10 ljos: solussd_: you will be lost on the spesific items, but there some of the things discussed is very relevant for anyone.

9:10 solussd_: ljos: excellent. ill buy. :D

9:10 cemerick: ljos: 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.

9:11 ljos: solussd_: 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.

9:12 I learned a lot about how I program and other stuff from it asside from just macros and the let over lambda structure.

9:13 solussd_: 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

9:13 ljos: cemerick: 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

9:14 solussd_: LOL actually talks about and refers to things written in On Lisp.

9:15 solussd_: awesome

9:16 cemerick: ljos: 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.

9:16 ljos: solussd_: 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.

9:21 cemerick: Thank you btw. Now to figure out why -Djava.awt.headless=true isn't triggering....

9:26 Figured it out. I had java-opts in leiningen instead of jvm-opts.

10:16 chawks: Hi... 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:18 adamspgh: chawks: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

10:18 for 1.3 it's been separated into a bunch of more independent packages.

10:19 chawks: Thanks adamspgh. Does that mean I need to create a dependency for each one I'd like to use?

10:20 adamspgh: chawks: (as far as I know) yes.

10:27 bitpimp: :w ~/spring_talk_notes

10:27 lol... oops

10:27 guess you know what I'm doing this morning

10:28 chawks: adamspgh: Thanks

10:56 semperos: giving 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:03 arkh: what's the best way to stop swank so I can move to a different project and start it again?

11:03 (short of exiting emacs)

11:03 tmciver: arkh: , quit

11:04 semperos: arkh: I use elein, which has function elein-swank, elein-kill-swank and elein-reswank that I use for starting, stopping and restarting respectively

11:04 tmciver: arkh: to be clearer: when in the slime repl type comma, then type quit.

11:05 arkh: cool - thank you both

11:05 llasram: Oh, wow. Did not know about that... SLIME? Swank? command-mode. Anything else useful you can do with it?

11:06 arkh: wow ... what are the chances: http://www.facebook.com/eswank Moving on ...

11:13 geoffeg_c: can someone explain the best way to do this? https://gist.github.com/e2459686b2ad4594b954

11:13 If data does not contain a login_id key, i don't want to add the :set to the map

11:14 every solution i've come up with seems way too verbose

11:16 semperos: another ccw question: in strict mode, any way to get the equivalent of paredit's M-s?

11:17 paredit-splice-sexp

11:17 I see splitting and joining but no splicing...

11:25 cemerick: semperos: heh, I didn't even know about split and join :-P

11:25 semperos: was just checking out the ccw wiki on googlecode, saw those two, but I only use splice in Emacs' paredit

11:26 so it's absence is felt, but otherwise ccw has come a long way

11:28 cemerick: semperos: splice = C-enter C-x C-enter C-v :-P

11:29 You could probably use one of the keyboard macro plugins to make a new shortcut for that.

11:30 semperos: cemerick: that works in eclipse?

11:30 cemerick: There's also http://www.mulgasoft.com/emacsplus for ex-emacers wanting some creature comforts in eclipse

11:31 semperos: and C is Control on the Mac in this case?

11:31 didn't work for me

11:31 cemerick: semperos: those are my bindings :-)

11:31 semperos: ah, gotcha

11:32 cemerick: C == Cmd, sorry

11:32 I have "select enclosing element" (default Cmd-Shift-up) bound to Cmd-Enter

11:32 semperos: gotcha now, your own combo of remappings

11:32 which I could capture as a keyboard macro

11:32 thanks for the idea

11:34 tmciver: cemerick: "select enclosing element", is that a paredit function?

11:34 cemerick: nope, that's eclipse-land

11:34 works across all languages

11:34 semperos: not 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:35 cemerick: semperos: depends on if your point is on a symbol already or in whitespace, probably

11:35 semperos: indeed

11:35 cemerick: mmm, gclosure deployed to central. This is promising. :-)

11:39 semperos: cemerick: thanks for your help

11:40 cemerick: semperos: np; feel free to ping again or mail the ccw ML if you have other questions.

11:40 semperos: will do

11:40 scratching the occasional itch to see how Clojure dev outside of emacs has progressed

11:41 as I can sell people on Clojure long before I can sell them on Emacs :-)

11:41 cemerick: heh, yeah

11:51 stuartsierra: GClosure has not YET been deployed to central, just staged to sonatype.

11:52 Brenton and I will be doing more testing this afternoon.

12:04 zakwilson: https://renthubnyc.com/ <-- I made a thing for a customer using Clojure. It's still in progress, but... soft launch.

12:04 mdeboard: zakwilson: Nice. Did you choose clj because it conferred some project-specific benefits or?

12:05 zakwilson: Also, did you use Compojure? Noir? Something else?

12:06 zakwilson: mdeboard: Clojure is my favorite language. I couldn't see any reason NOT to use it for this, so I did.

12:06 It'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:14 mdeboard: zakwilson: Neat. I'd not heard of Gaka.

12:16 cemerick: For 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:19 wilkes: I did a clean install of lein 1.6.2 today and now I can't run my clojure 1.3 projects

12:19 I get a "java.lang.NoSuchMethodError: clojure.lang.KeywordLookupSite"

12:19 error

12:19 I've googled and see the problem all over the place, no clear solution

12:20 any ideas?

12:20 dnolen: cemerick: array-maps are rarely faster in my experience

12:21 cemerick: yeah

12:21 well, there goes that bit of lore

12:21 frankvilhelmsen_: Clean up your libs and run lein deps

12:22 dnolen: cemerick: less memory usage probably the biggest benefit.

12:22 wilkes: frankvilhelmsen_: that only works once

12:22 frankvilhelmsen_: and you many has to add default ./ to your classpath,,

12:23 dnolen: another getting started with Clojure post, http://www.rodrigoalvesvieira.com/getting-started-with-clojure/

12:24 frankvilhelmsen_: once,, ? check your dependencies is my guess

12:24 TimMc: cemerick: Did you let HotSpot warm up?

12:24 cemerick: yeah, I don't think I'm doing anything particularly heinous w.r.t. fouling up the timings

12:24 TimMc: OK

12:25 dnolen: TimMc: even if you let HotSpot warmup hashmaps are way faster once you get past a few elements.

12:25 cemerick: I hit parity only with single-entry maps

12:25 wilkes: frankvilhelmsen_: 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:25 dnolen: you can see this behavior in a big way in core.logic. Once you get past 32 logic variables things starting screaming.

12:26 TimMc: cemerick: I only asked because you recently ran a speed check against clojurebot with only 1000 iterations. :-)

12:26 wilkes: frankvilhelmsen_: and I'm using the clojurscriptone project as my testbed

12:26 cemerick: TimMc: heh, I don't recall

12:26 I did 1e8 for the map comparisons.

12:27 chawks: Hi. Does anyone know if I can use duck-streams with clojure 1.3?

12:27 raek: wilkes: from what I can tell it looks like you have ahead of time compiled code compiled for clojure 1.2 on the classpath

12:28 chawks: it has been replaced by clojure.java.io and some functions in clojure.core since clojure 1.2

12:29 wilkes: does this happen in a fresh clojure 1.3 project?

12:29 wilkes: raek: let me check

12:30 chawks: raek: 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:31 wilkes: raek: nope, seems fine there

12:33 _carlos_: hi!

12:35 raek: chawks: don't think so. you may have to implement it yourself. (e.g. with 'with-open', 'clojure.java.io/writer', and 'doseq')

12:36 wilkes: raek: I did a clean checkout of clojurescriptone, script/deps works fine, then ran lein help and get https://gist.github.com/1648607

12:37 raek: maybe a library that clojurescriptone uses is AOT compiled for 1.2 or something

12:37 * raek does not know

12:37 chawks: raek: thanks!

12:38 raek: but this happened when you upgraded _leiningen_?

12:39 wilkes: 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:41 I 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:41 wilkes: raek: more like a re-install, cleaned up some stuff but stayed on 1.6.2

12:41 raek: wilkes: do you have any plugins installed in ~/.lein/plugins ?

12:41 wilkes: raek: not at the moment, I pulled those out for the time being

12:43 raek: the exception is thrown from within the leiningen process, I think. this suggests the problem is in a plugin or dev-dependency

12:43 technomancy_: wilkes: definitely a dev-dependency

12:46 wilkes: technomancy_: yep, I created an empty project and added the deps in one by one, running lein deps twice each iteration

12:47 it fails when I get to [marginalia "0.7.0-SNAPSHOT"]

12:47 stuartsierra: Working on getting ClojureScript JARs published...

12:47 technomancy_: stuartsierra: great news

12:47 wilkes: stuartsierra++

12:47 raek: (inc stuartsierra)

12:47 lazybot: ⇒ 1

12:48 stuartsierra: Will need people to help test in just a moment

12:48 technomancy_: wilkes: why marginalia rather than lein-marginalia?

12:48 wilkes: that's what's in clojurescriptone

12:48 technomancy_: oh right; not your project

12:48 do you see the same effect with lein-marginalia?

12:49 wilkes: technomancy_: yes

12:49 technomancy_: hum.

12:51 I don't get it; marginalia uses 1.2.0

12:52 just go ahead and remove those deps for now; can you also open an issue on Leiningen?

12:52 wilkes: technomancy_: will do, thanks for you help

12:57 raek, thanks for your help too

13:01 stuartsierra: OK, we need some help.

13:02 Here's a project.clj: https://gist.github.com/1648712

13:02 It doesn't work.

13:02 The dependencies are right, but we can't load the ClojureScript REPL.

13:03 technomancy_: how are you trying to load the repl?

13:03 stuartsierra: quickstart instructions on https://github.com/clojure/clojurescript/wiki/Quick-Start

13:05 cemerick: stuartsierra: I get "Unterminated comment" in goog/deps.js Is that the problem you see as well?

13:05 stuartsierra: yes

13:05 technomancy: I can't get the deps

13:05 is it possible I need to wait to let the mirrors propagate or something?

13:05 cemerick: technomancy: should just work, that's what the staging repo is for

13:07 technomancy: Error transferring file: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

13:07 never seen that one before

13:08 WorldOfWarcraft: hi :)

13:08 jon hu

13:08 rew

13:08 world of warcraft

13:08 thats me

13:08 sc"brssa\`drqew

13:08 babilen: ops?

13:08 WorldOfWarcraft: OPS?

13:08 ghjiko

13:08 p

13:08 TimMc: WorldOfWarcraft: You're being irritating.

13:09 WorldOfWarcraft: one sec let me look up what irratating means

13:09 babilen: WorldOfWarcraft: This is a support channel -- Please ask a question or stay silent. Thank you very much.

13:09 WorldOfWarcraft: oh...

13:09 im sorry for being

13:09 Raynes: babilen: /ignore WorldOfWarcraft

13:09 WorldOfWarcraft: irratating

13:09 cemerick: stuartsierra: I haven't the foggiest; goog/deps.js looks ok

13:09 stuartsierra: yeah

13:09 WorldOfWarcraft: STOP BEING MEAN!!!!!

13:09 cemerick: but load order could end up causing the error message to be misleading

13:09 WorldOfWarcraft: your irratating

13:10 stuartsierra: cemerick: good point

13:10 WorldOfWarcraft: BANANAS!!!!!!!!!

13:10 f

13:10 cemerick: stuartsierra: I'd have to think that the gclosure packaging is busted somehow?

13:10 WorldOfWarcraft: wow stop trolling

13:10 cemerick: chouser: around?

13:11 WorldOfWarcraft: stop being a meanie

13:11 Raynes: Freenode not-so-secret-secret: you can request that freenode take care of such problems in the absence of ops. #freenode.

13:11 mebaran151: I'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:12 stuartsierra: cemerick: seems that way

13:12 TimMc: mebaran151: Jar it up and publish to clojars.

13:12 cemerick: Raynes: I always forget about that!

13:13 seancorfield: mebaran151: also worth putting it on github so folks can look at source, send you patches etc

13:13 technomancy: mebaran151: "lein help tutorial" covers publishing libraries

13:13 Raynes: stuartsierra: You should talk to chouser about getting ops for all clojure/core members in here.

13:13 technomancy: cemerick: you're able to pull in this dep with the latest stable lein?

13:14 cemerick: technomancy: I'm using 1.6.2

13:14 * cemerick is a luddite

13:14 technomancy: no, that's what I'm using too

13:15 if 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:15 actory, WagonRepositoryConnectorFactory

13:15 cemerick: that's silly

13:15 technomancy: I know!

13:15 Raynes: I wish I had more WagonRepositoryConnectorFactories in my life.

13:16 technomancy: Raynes: upgrade to leiningen 2!

13:16 your dreams can come true

13:16 (at zombo com)

13:17 cemerick: technomancy: confirmed in pomegranate directly

13:17 technomancy: confirmed working?

13:18 cemerick: confirmed broken

13:18 technomancy: aha

13:18 cemerick: it's the https

13:18 stuartsierra: OK, hold on, going to delete the JARs I uploaded and make some more...

13:19 cemerick: good grief

13:20 technomancy: ok, got a fix. I'll push once I get back from lunch.

13:20 technomancy: great

13:21 hm; I can get other jars from sonatype staging just fine

13:21 cemerick: technomancy: are files, http, and https the only default repo types that we should care about, or is some oddball using ftp, etc?

13:22 technomancy: I wouldn't worry about ftp

13:22 and s3 stuff can use a separate wagon

13:22 cemerick: gopher? pigeon? fedex?

13:22 technomancy: qrcodes-by-webcam

13:22 cemerick: QueCat!

13:23 mebaran151: thanks technomancy

13:24 btw, is there a preferred license for publishing clojure libraries

13:24 * technomancy <3s the EPL

13:24 stuartsierra: OK, new set of JARs uploaded to Sonatype Staging.

13:25 raek: mebaran151: EPL is *very* common in Clojure-land

13:26 stuartsierra: You'll need to delete ClojureScript from your local ~/.m2/repository

13:27 Seems to be working this time.

13:27 technomancy: same issue here

13:28 looks like switching to http fixes it

13:29 stuartsierra: technomancy: OK. The special repository URL is temporary anyway.

13:31 mrBliss: compiling this application of core.match throws an exception: (match [1 '(2 3)] [a ([b c] :seq)] :ok)

13:31 -> Unable to resolve symbol: ocr-7002_tail__7004 in this context

13:34 cemerick: technomancy: what's the error you get in lein 1.6.2?

13:35 stuartsierra: New ClojureScript JARs available in staging. Same gist applies, https://gist.github.com/1648712

13:35 Can anybody else confirm it is working?

13:36 cemerick: stuartsierra: yup, looks tasty

13:36 franks: technomancy: 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:36 xeqi: stuartsierra: works for me

13:36 stuartsierra: cemerick: thanks

13:36 cemerick: That's a helluva set of dependencies though! ;-)

13:36 stuartsierra: xeqi: thanks

13:36 cemerick: you mean the stuff that gets pulled in?

13:36 That's all from the G.Closure compiler POM, which we didn't write.

13:37 franks: technomancy: for example how do I refer to a local var in the same file for the "read" option?

13:37 cemerick: stuartsierra: yeah, I figured

13:37 Bronsa: works for me too

13:37 stuartsierra: So we're considering releasing our own package with fewer dependencies. Or people can just exclude them.

13:37 cemerick: Exclusions are fine for now IMO.

13:38 technomancy: stuartsierra: just confirmed I can get a cljs repl with "lein run"; very nice.

13:38 cemerick: stuartsierra: why a classifier instead of 0.0.927?

13:38 stuartsierra: technomancy: awesome

13:38 franks: technomancy: 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:38 stuartsierra: cemerick: just to make it obvious that it's a patch number, not a version number

13:40 technomancy: doesn't know what to do with ^D, but that's minor

13:40 cemerick: I think that's intentional?

13:45 stuartsierra: OK, I think we're going to release these.

13:45 Speak now, or forever hold your peace.

13:46 cemerick: stuartsierra: oh, this isn't on hudson. o.0

13:46 stuartsierra: Nope. That's a whole 'nother day's work.

13:46 cemerick: looks good to me FWIW.

13:48 stuartsierra: thank you for your efforts :-)

13:48 ClojureScript views in Clutch, coming soon.

13:49 stuartsierra: ZE BUTTON HAZ BEEN PUSHED!

13:50 metajack1: out of curiosity, why is the EPL so popular?

13:50 technomancy: it's copyleft, but it's not viral. what's not to like? =)

13:52 metajack1: you mean it's not always viral i guess

13:52 the virality would seem the only reason to use it over Apache 2.0 or something right?

13:52 TimMc: WHat's the difference between that and LGPL?

13:53 metajack: timmc: LGPL is a little hazy on where the boundary is when you aren't dealing with C code and object files.

13:53 I'm assuming that is more clear in the EPL.

14:00 technomancy: it's pretty close to the LGPL, but it doesn't freak out the suits because it has "Eclipse" in the name.

14:01 TimMc: haha

14:02 "Enterprise Public License"

14:02 cemerick: I 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:03 Raynes: cemerick: I visualize a tidal wave of lawyers crashing down on you.

14:03 scottj: cemerick: have you released your bayes library?

14:04 technomancy: the 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:04 cemerick: Raynes: Mostly piles of random people in my twitter feed asking why I'm using license X.

14:04 "piles"

14:05 scottj: No…I'm a louse. Haven't had a lot of hacking time to tie it up since the conj. :-(

14:14 beffbernard: Gentlemen. I have a question regarding workflow using inferior-lisp/Clojure/emacs.

14:15 TimMc: There are probably 3.5 answers.

14:15 technomancy: clojurebot: inferior-lisp is a lot like http://www.penny-arcade.com/comic/2011/09/28

14:15 beffbernard: Some background.. I know my way around emacs but I'm new to clojure development

14:16 TimMc: My workflow is basically C-x C-e

14:16 hiredman: why would you use something with "inferior" in the name?

14:16 clojurebot: Ok.

14:16 TimMc: ...

14:17 Raynes: The man has a point

14:17 beffbernard: hiredman: haha because that's as far as I've gotten

14:17 ;)

14:17 TimMc: (that was in reference to hiredman)

14:17 "inferior" preumably refers to it being started from Emacs?

14:18 beffbernard: Is there a way to automatically eval the buffer when I save in my REPL?

14:18 yes

14:18 Let me re-phrase

14:18 technomancy: beffbernard: I hooked something like that up for slime; it's not hard

14:19 beffbernard: Is there a way when I save to have it reflect in my inferior buffer's REPL?

14:19 technomancy: Oh yah?

14:20 technomancy: I tried slime for a short period but I was getting slowness with the SLIME REPL so I ditched it.

14:20 technomancy: slowness when the buffer got too big?

14:20 beffbernard: technomancy: But that was probably because I did something wrong and was too lazy to figure it out

14:21 technomancy: Nope, I'd try something like (+ 234 345 4534) and there would be a pause as I was typing it

14:21 technomancy: o_O

14:21 beffbernard: One sec.. I'll get the error

14:23 hiredman: most like using an old version of swank-clojure together with clojure 1.3 and the docstring printing to the minibuffer was barfing?

14:23 beffbernard: error in process filter: Wrong type argument: listp, 1

14:24 hiredman: beffbernard: gnue emacs?

14:24 beffbernard: hiredman: yes

14:24 hiredman: using clojure-jack-in?

14:24 beffbernard: Yup

14:24 hiredman: what version of emacs?

14:25 cemerick: stuartsierra: Is there an issue/discussion somewhere re: "The most recent SVN revision does not currently work with ClojureScript."?

14:25 beffbernard: Some recent version of HEAD

14:25 hiredman: hmmm

14:25 beffbernard: swank-clojure "1.3.4"

14:26 and I'm using clojure "1.3.0"

14:27 technomancy: beffbernard: maybe an old version of slime left in your emacs config?

14:27 ibdknox: woah!

14:27 an official CLJS

14:27 [org.clojure/clojurescript "0.0-927"]

14:27 /win

14:27 cemerick: you missed the party already ;-)

14:27 stuartsierra: cemerick: dunno

14:27 beffbernard: technomancy: It's possible

14:27 technomancy: https://github.com/beffbernard/emacs is my .emacs.d

14:27 stuartsierra: taking off for a bit

14:28 ibdknox: cemerick: damn

14:28 lol

14:28 cemerick: :-)

14:28 ibdknox: I'll start my own party :D

14:29 now I just need to figure out how to get the cljs repl to work in vim

14:30 cemerick: ibdknox: or stop using vim?

14:30 sorry, was too easy

14:30 ibdknox: cemerick: pfft, what kind of solution is that?

14:30 TimMc: WHere would he put all his colons?

14:31 ibdknox: I'd have a file full of j's and k's

14:31 it'd be terrible

14:31 cemerick: technomancy: pomegranate 0.0.3 pushed and released to central, fixes that stupid HTTPS bug

14:31 And one other minor one

14:31 beffbernard: technomancy: ; SLIME 2012-01-06

14:32 technomancy: cemerick: much obliged

14:32 chawks: Hi. Does anybody know how to upload files using Noir (via a form)?

14:32 beffbernard: technomancy: Possibly too new?

14:32 technomancy: beffbernard: see if you can get rid of that version; jack-in will provide you with a compatible version

14:32 ibdknox: chawks: it was asked on the list at one point

14:32 beffbernard: ok

14:33 ibdknox: chawks: http://groups.google.com/group/clj-noir/browse_thread/thread/58e45ad02bb21571/a5e580f8f9c69b9d?lnk=gst&q=upload#a5e580f8f9c69b9d

14:33 chawks: ibdknox: Thanks a lot!

14:34 ibdknox: I guess noir-cljs will be back this weekend

14:34 :)

14:34 technomancy: ibdknox: what's the relationship between that and cljs-watch?

14:35 ibdknox: technomancy: noir-cljs would mean that a deployed server would mean no more JS artifacts checked in

14:35 they would be compiled on run

14:35 cljs-watch is mostly just a dev tool

14:35 beffbernard: technomancy: Don't I have to add slime to my load-path first? Or is jack-in doing some package magic?

14:35 ibdknox: though right now I've been checking in my generated js :(

14:36 cemerick: ibdknox: that's the way it should always be

14:36 hiredman: beffbernard: jack-in actually injects a copy of slime into emacs

14:36 ibdknox: cemerick: hm?

14:36 technomancy: beffbernard: magick

14:36 cemerick: js compiled at runtime

14:36 beffbernard: hiredman: ok

14:36 technomancy: ibdknox: excellent

14:37 cemerick: wellll... build-time.

14:37 ibdknox: technomancy: actually this resolves one of the issues we talked about at waza

14:37 if we get ckirkendell's change to let us specify externs in jars... that would mean it's time for world domination

14:38 we'd have a real library story

14:40 beffbernard: technomancy: hiredman: That worked.. Thanks

14:45 I 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:45 Or in SLIME

14:45 technomancy: beffbernard: the readme for swank-clojure has a cheat-sheet

14:45 for slime

14:45 beffbernard: ok

14:54 amalloy: sometimes it seems like every button combo you can imagine evaluates code in slime

14:54 Raynes: amalloy: Not in Vim. :D

14:55 In vim, things just beep and occasionally text disappears or moves around.

14:55 ibdknox: you should turn the beep off

14:55 Raynes: I actually know that I can do that.

14:55 I just haven't bothered.

14:56 amalloy: ibdknox: but then his computer wouldn't appear haunted to the casual observer

14:56 ibdknox: lol

14:57 I had it on for years

15:00 scottj: beffbernard: C-M-x and C-c C-l being the most common

15:01 technomancy: scottj: C-c C-k is preferred over C-c C-l unless you explicitly need a full reload

15:01 amalloy: down with C-c C-l, long live C-c C-k (not that there's any real difference)

15:01 technomancy: amalloy: there is, now.

15:01 llasram: I was about to say, I've never used either of those :-)

15:01 amalloy: technomancy: as of when? last time i tried that it definitely didn't reload

15:02 technomancy: amalloy: couple months? I dunno. I don't actually use it; maybe it doesn't work anymore?

15:02 scottj: technomancy: yeah actually I think that's what I normally use just got confused when I had to write out the letters :)

15:02 technomancy: scottj: fingers N steps ahead of the ol' brain; I know how it is =)

15:02 sritchie: C-x C-e at the end of a form is good too

15:03 technomancy: C-c C-k gets you line numbers though; so use that the most.

15:03 amalloy: sritchie: way less convenient than C-M-x in almost all cases

15:03 scottj: btw 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:03 technomancy: amalloy: good for things inside a let binding or some such

15:03 checking single values

15:03 sritchie: amalloy: I use it for evaluating forms inside of other forms

15:04 TimMc: It's funny how y'all are using the default keybindings in discussion, but so many people have these rebound or have different defaults...

15:04 amalloy: note 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:04 ibdknox: TimMc: yeah, it's a magical discussion

15:04 technomancy: do people rebind the slime ones?

15:04 ibdknox: I press R to evaluate things ;)

15:04 sritchie: amalloy: I recently discovered C-M-x, it's been transformative

15:04 TimMc: I guess some of the names are pretty long.

15:05 sritchie: ibdknox: is vimclojure the way to go?

15:05 amalloy: like, 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:05 ibdknox: sritchie: 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:06 amalloy: ibdknox: is it okay if i mockingly compare you to people who think macros sound nice but they're no less productive without them?

15:06 ibdknox: amalloy: no :p I use macros ;)

15:06 Raynes: ibdknox: 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:07 ibdknox: moreover, most of my time is spent thinking anyways, and whatever you may gain in interactivity I gain in speed of editing :D

15:07 Raynes: And my refheap.vim plugin works much better than my refheap.el plugin, so #winning.

15:07 hiredman: how can you have fast editing without paredit?

15:07 ibdknox: hiredman: I have paredit.vim :)

15:08 chawks: Does 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:09 Raynes: I think Vim has better sexp editing capabilities out of the box than Emacs, right? da( = you've just deleted the current form.

15:09 oakwise: as a vim user, I've been really happy using evil-mode in emacs

15:09 technomancy: Raynes: since you've used both, how does vim's paredit compare?

15:09 cemerick: Raynes: You've convinced me that anything is possible.

15:09 If technomancy were to switch to vim, I'd start stocking canned goods.

15:09 oakwise: all of that nice vim editing with a clean(er) backend

15:09 technomancy: cemerick: I've got lots of respect for vim. I just don't think I could stand vimscript.

15:09 amalloy: Raynes: C-M-k isn't part of paredit though, so delete-current-form isn't a convincing example

15:09 cemerick: technomancy: I ;-)

15:10 Raynes: technomancy: It works pretty well. slurp-forward is a little awkward because it moves the paren forward instead of the actual text.

15:10 cemerick: I should give vim a try in conjunction with vimclipse.

15:11 technomancy: cemerick: 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:11 Raynes: technomancy: 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:11 It's easy because paredit.vim has a function for toggling it -- just isn't bound to anything by default.

15:12 cemerick: technomancy: I think once a lein-central plugin is settled, we'll know enough to talk about that intelligently.

15:12 llasram: Raynes: Not C-q (

15:12 ?

15:12 emezeske: Raynes: When I need to force-insert or delete, I replace the single character with the 'r' command

15:12 Raynes: paredit.vim doesn't enforce balance when you replace a single character

15:12 pjstadig: i usually just copy and paste an open or close paren

15:12 cemerick: technomancy: Preview: what if Clojars could just be a Clojure-centric search UI for central?

15:13 llasram: Raynes: Oh, context again. nm

15:13 Raynes: emezeske: That works too.

15:13 technomancy: cemerick: tempting, but the delays and group-id policies make me hesitant.

15:14 Raynes: technomancy: But yeah, paredit.vim is fine for what I use it for. Your mileage may vary.

15:14 technomancy: my mileage is not likely to vary.

15:14 =)

15:14 llasram: On the Scala mailing list there was some envy recently for how easy the clojars process is vs. the comparable scala repo process

15:14 technomancy: llasram: I heard the scala equivalent of clojars just stopped accepting new uploads

15:14 pjstadig: yeah i just don't see the problem with clojars

15:14 technomancy: until they find a new sponsor or something

15:14 chewbranca: paredit.vim strongly helped convine me to move to emacs ;-)

15:14 cemerick: technomancy: I'm with you on the delay.

15:14 chewbranca: *convince

15:14 technomancy: pjstadig: releases and snapshots in the same repo is crappy.

15:15 pjstadig: i think a low barrier to entry is more important than anything else

15:15 people can sign if they want

15:15 technomancy: I don't think that's good enough

15:15 people can sign if they want right now, and no one does

15:15 cemerick: If 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:15 pjstadig: signing doesn't guarantee anything anyway

15:15 TimMc: I still don't know what signing is.

15:15 chawks: Does 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:16 hiredman: it means you are calling clojure.java.io/file on a map

15:16 technomancy: pjstadig: it guarantees that malicious uploads only happen in the case of leaked keys

15:16 ibdknox: chawks: the form would look something like this: https://refheap.com/paste/367

15:16 technomancy: pjstadig: or people turning evil, I guess =)

15:17 pjstadig: technomancy: it only guarantees that a jar came from someone you "trust", but deciding to trust someone seems to be the more important issue

15:17 chawks: thanks guys

15:17 pjstadig: and no technological feature will help you with that

15:17 besides not just anyone can push to any group id

15:17 technomancy: pjstadig: it can guarantee that future releases of a jar were released by the same person who released the older versions

15:17 pjstadig: technomancy: yeah and that's good, and i agree its a step that should be taken

15:17 technomancy: clojars uses sha1 for passwords for pete's sake =\

15:17 Raynes: ibdknox: You didn't paste that from a .clj file, did you?

15:17 pjstadig: it's not a panacea

15:18 emezeske: pjstadig: if I compromised clojars.org right now, I could taint all of the jars

15:18 ibdknox: Raynes: I set the syntax but it was just a buffer :(

15:18 emezeske: pjstadig: at least with signing, I couldn't do that

15:18 pjstadig: sure

15:18 technomancy: hm; maybe I shouldn't have said that in a publicly-logged channel

15:18 pjstadig: so let's sign

15:18 trptcolin: technomancy: your password is "sha1"? that seems pretty short.

15:18 llasram: technomancy: 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:18 pjstadig: i don't see a need to force people to sign though

15:18 Raynes: ibdknox: It determines highlighting based on file extension. I just wanted to make sure it didn't break on a .clj file.

15:18 technomancy: llasram: oh sure; sonatype makes sense

15:18 TimMc: technomancy: It's OK; I'm sure if you ask nicely everyone will go scrub their logs.

15:18 technomancy: pjstadig: I'm OK with unsigned snapshots

15:18 cemerick: llasram: link, please?

15:19 TimMc: technomancy: Just include a hidde log-scrubber in the next lein update.

15:19 pjstadig: the other issue with signing is you're assuming that a person properly protects their key

15:19 technomancy: pjstadig: necessary but not sufficient.

15:19 emezeske: pjstadig: better than nothing

15:20 pjstadig: cryptography is nice, but it's not a magic talismen

15:20 technomancy: it doesn't make it secure, it makes it possible to be secure

15:20 emezeske: pjstadig: if keys are comprimised, it will be one at a time

15:20 pjstadig: instead of the entire repository being comprimised

15:21 pjstadig: don't get me wrong...i'm not arguing against signing

15:21 ldh: i'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:21 which yields something like: "Fri, 20 Jan 2012 20:22:21 UTC"

15:21 technomancy: pjstadig: we can't close down the current clojars repository

15:21 ldh: is there a way to get that in GMT? doesn't look like JodaTime supports GMT....

15:21 technomancy: pjstadig: and I don't think we should necessarily change its policies

15:22 pjstadig: what I want to do is add a "releases" repository that's less of a mosh-pit

15:22 pjstadig: but 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:22 yeah

15:22 llasram: cemerick: https://groups.google.com/d/topic/scala-user/n0oQvMpIpBY/discussion

15:22 pjstadig: i could get behind that

15:22 cemerick: llasram: thanks

15:22 pjstadig: technomancy: so what's the timeline? :)

15:22 technomancy: pjstadig: possibly add a separate snapshots repo; possibly just use the current one

15:22 hah

15:22 yeah

15:22 well

15:22 llasram: cemerick: Top of the thread -- not sure how I linked there

15:22 technomancy: pjstadig: it'll happen before lein 2.0 is released.

15:23 which means that it will probably delay the release of lein 2.0 =)

15:23 cemerick: gd the new google groups

15:24 technomancy: spiewak is against the domain limitation; good man. =)

15:24 cemerick: technomancy: I wonder if the whole thing could be shifted onto s3 to resolve any operational concerns?

15:24 technomancy: cemerick: been planning that for months actually =)

15:25 cemerick: :-D

15:25 technomancy: clojars becomes a thin layer surrounding bucket deploys

15:25 stuartsierra: s3 goes down from time to time

15:25 * cemerick gets outta the way

15:25 technomancy: cemerick: well, I haven't actually gotten around to it, so...

15:26 hiredman: http://www.taguri.org/

15:26 cemerick: stuartsierra: probably less often than clojars, esp. if the rack clojars' box runs on burns up.

15:26 technomancy: I wonder if the respectable-clojars could actually operate fairly independently of mosh-pit clojars

15:26 pjstadig: sure

15:26 come up with a cool new name, phil

15:27 TimMc: monoclj

15:27 technomancy: pjstadig: I actually came up with the name "clojars" independently of ato c. six months before him.

15:27 TimMc: monocles are very respectable

15:27 technomancy: it's a fairly obvious portmanteau. =)

15:28 hiredman: lein.de.ps

15:28 technomancy: I'm thinking they could be fairly separate operationally but present a unified interface

15:28 TimMc: I really shouldn't say anything. I've already perpetrated one terrible name while joking.

15:28 technomancy: anyway, /me lunches

15:28 hiredman: .ps is palestine

15:28 $60/yr

15:29 * TimMc publishes a pro-Israel jar and gets the site taken down

15:36 Raynes: technomancy: VimL is pretty bad. The pain is eased somewhat by the ability to write plugins in Ruby and Python. And Scheme, I think.

16:23 solussd_: if I use a relative path in project.clj, are they relative to the directory that the project.clj is in?

16:24 sritchie: solussd_: yup

16:24 :source-path "src/clj"

16:25 solussd_: thanks

16:27 cemerick: technomancy: 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:29 llasram: It's all fun and games until someone escapes a chroot

16:35 technomancy: Raynes: true, but out-of-process plugins are an admission of defeat as far as I'm concerned

16:36 cemerick: it starts an independent dyno for the repl

16:36 Raynes: technomancy: It's out of process?

16:36 cemerick: ah, ok

16:36 JanxSpirit: I 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:36 technomancy: cemerick: working on a way to get a repl in-process, but it requires bringing your own SSH host as a proxy

16:36 JanxSpirit: we're generally looking for the fewest LOC/most elegant solve

16:37 cemerick: technomancy: ack; better to get HTTP nrepl transport humming

16:37 technomancy: cemerick: that would make it a lot easier

16:37 how far off is it?

16:37 JanxSpirit: given something like [1,2,3,4,5,6,7,8,9,10], return [[1,2],[3],[4,5,6],[7,8],[9],[10]]

16:37 the returned lists are random length 1-3

16:37 and everything stays in order

16:38 cemerick: technomancy: I'm plugging the bits together as we speak. Super rough on the githubs next week?

16:38 technomancy: excellent; please do keep me posted

16:38 cemerick: nrepl will have minimum of 3 transport impls, just to make sure the interface isn't stupid

16:39 TimMc: JanxSpirit: I'd look at the partition* functions.

16:39 JanxSpirit: excellent - thanks

16:39 TimMc: or the split funcs

16:42 brodyberg: Hey all, I have a protocol question

16:42 I am looking at an example in Joy of Clojure - 9-5. The example uses defn to setup a closure around a protocol implementation.

16:42 My 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:42 If 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:43 But the example seems to imply using the code as-is should "just work."

16:43 Ye olde gist: https://gist.github.com/1649734

16:43 What 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:48 llasram: I don't have my copy of JoC open, but the gist looks slightly confusing -- the arity of `fixo-limit' isn't consistent

16:48 brodyberg: that's true

16:49 that's a function I added when trying to figure out why the limit wasn't being respected

16:50 dnolen: JanxSpirit: do you have examples in other languages? that'll be pretty simple in Clojure.

16:50 amalloy: JanxSpirit: split-at seems like your #1 suspect

16:51 JanxSpirit: that's what I used in Scala...hang on...

16:52 dnolen: JanxSpirit: I've got something that works that probably can't get any shorter unless you programming in K or something.

16:53 TimMc: or APL

16:53 JanxSpirit: hmm...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:54 dnolen: TimMc: well K is APL-like

16:54 TimMc: amalloy: unfold might be good here

16:54 amalloy: heh, "meaningful" lines. a nice way of saying "my language makes me write extra rubbish"

16:55 llasram: brodyberg: LOL

16:55 brodyberg: Typo from hell

16:55 brodyberg: Your one-arg form of fixed-fixo doesn't have parens around the intended call to `fixed-fixo'

16:55 TimMc: dnolen: Unlike R, K doesn't seem to be Googleable by itself. :-)

16:56 dnolen: TimMc: http://en.wikipedia.org/wiki/K_(programming_language)

16:56 TimMc: yeah

16:56 llasram: brodyberg: So it just returns an empty vector (last form in the body) each time

16:56 brodyberg: llasram let me check that out

16:56 llasram: I wonder how difficult it would be to make the compiler complain about that...

16:57 technomancy: huh; apparently scala-tools.org hosted jenkins as well as mvn repos

16:57 brodyberg: llasram that was it, thanks

16:57 llasram: Because they need to recompile the world for every compiler release?

16:58 technomancy: heh

16:58 but 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:01 JanxSpirit: OK Scala one is something like this:

17:01 scala> def chunk(l: List[Int], i: Int): List[List[Int]] = l.splitAt(i) match {

17:01 | case (Nil, Nil) => Nil

17:01 | case (ch, rest) => ch :: chunk(rest, (util.Random.nextInt(3) + 1))

17:01 | }

17:01 chunk((1 to 10).toList, util.Random.nextInt(3) +1)

17:01 res12: List[List[Int]] = List(List(1), List(2, 3, 4), List(5, 6, 7), List(8), List(9), List(10))

17:02 amalloy: I come from Java, so Scala hardly feels like a lot of rubbish, but I'm always open to improvement :)

17:02 mostly I meant a single curly brace on a line hardly counts

17:02 dnolen: JanxSpirit: https://gist.github.com/1649812 if you want to see an answer

17:03 in Clojure

17:04 JanxSpirit: that's cool - gonna have to read that one over a few times ;)

17:06 what is (when (seq s) ?

17:06 Raynes: &(seq [1 2 3])

17:06 lazybot: ⇒ (1 2 3)

17:06 Raynes: &(seq [])

17:06 lazybot: ⇒ nil

17:07 Raynes: JanxSpirit: It's a clever way to check whether or not a collection is empty.

17:07 JanxSpirit: OK

17:07 Raynes: (when (seq s) ..) = when s has elements, do this stuff

17:09 JanxSpirit: cool - I think I get the rest of it...the let syntax with square brackets is a bit confusing

17:11 TimMc: ~guards

17:11 clojurebot: SEIZE HIM!

17:12 amalloy: TimMc: naw, people complaining about [] instead of () is a change for the better

17:12 TimMc: JanxSpirit: THat's destructuring.

17:12 technomancy: usually it's CL folks complaining about brackets though

17:13 llasram: Literal maps and vectors are so brilliant, man

17:13 technomancy: yeah, associative data structures in elisp are worthless

17:13 plus their vector syntax implicitly quotes everything inside

17:13 TimMc: ew

17:15 _carlos_: what is a relevant difference between "ns" and "in-ns"?

17:15 ibdknox: ns refers clojure.core

17:16 I don't think in-ns does

17:16 amalloy: also ns is a macro that handles require/use, etc

17:16 technomancy: in-ns is lower-level

17:17 TimMc: in-ns doesn't do any refers, requires, etc.

17:17 amalloy: technomancy: 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:18 technomancy: nothing implicit about that =)

17:18 amalloy: clojure's [] {} aren't exactly literals in the same sense that, say, "string" is a string literal

17:18 technomancy: ?

17:18 llasram: How so not?

17:19 technomancy: they're compound and strings are scalar

17:20 _carlos_: so basically I can use "ns" in place of "in-ns"

17:21 amalloy: it'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:21 technomancy: _carlos_: basically: never call in-ns directly in a file. it's ok to use at the repl

17:21 llasram: Ah, ok. What's a better word for "data type emitted by the reader"?

17:22 amalloy: ie, [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:22 technomancy: amalloy: suspect that definition was rooted in a language without a clear read/eval distinction

17:22 _carlos_: technomancy: thank you

17:23 technomancy: sure

17:23 amalloy: like, would anyone say that java's array syntax is literals? new String[] {"foo", myLocal};?

17:24 brodyberg: no

17:24 Somelauw: Does that work?

17:25 amalloy: how is that different from ["foo", my-local]? surely the "new String[]" doesn't somehow make it not be a literal

17:25 Somelauw: yes

17:26 brodyberg: new String[] { ... } means "make a new string array with these contents. A literal on the other hand immediately is the array of strings.

17:27 amalloy: i'm totally unconvinced by that. (defn foo [x] ["foo" x]) constructs a new vector every time foo is called

17:27 technomancy: amalloy: are you sure?

17:28 TimMc: has to

17:28 amalloy: yes

17:28 hiredman: it has to

17:28 technomancy: oh, I didn't see the x

17:28 in the vector

17:28 amalloy: technomancy: even (defn foo [x] [:foo :bar]) does, though

17:28 doesn't have to, but it does

17:28 technomancy: hm; ok

17:29 amalloy: i 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:29 cemerick: ,(letfn [(f [] [:a :b])] (identical? (f) (f)))

17:29 clojurebot: true

17:29 technomancy: oh snap!

17:30 TimMc: &(apply identical? (map (constantly [:foo]) (range 2)))

17:30 lazybot: ⇒ true

17:30 cemerick: lawyered 

17:30 amalloy: huh! maybe that changed in 1.3? or my tests were totally rubbish

17:30 TimMc: Ah. beat me to it.

17:30 amalloy: TimMc: well, yours is totally different

17:30 dnolen: I dunno, literals are literals. I believe optimizable literals like '() and [] are called constant literals in the compiler.

17:31 TimMc: amalloy: I don't see how.

17:31 amalloy: TimMc: (constantly (x)) is (let [ret (x)] (fn [& args] ret)). totally different from (fn [& args] (x))

17:32 cemerick: dnolen: I *think* amalloy is saying that the vector in (eval '[a]) isn't a literal (assuming there's an `a` in scope).

17:34 TimMc: amalloy: Where let is in this case a lambda. I see.

17:34 amalloy: i'm only really arguing this point because technomancy was complaining that elisp's vector literals can only contain constants

17:34 pjstadig: amalloy: seems do have changed from 1.2->1.3 according to my tests

17:35 amalloy: thanks pjstadig. glad to hear i'm not an idiot

17:35 pjstadig: i understand where you're coming from

17:35 but maybe it's the difference between a constant and a literal

17:35 or a constant literal like dnolen said

17:36 _carlos_: are all deprecated forms from clojure.core API tagged as so?

17:36 pjstadig: you'd expect a literal to be written to the compiled file and read in verbatim or something

17:36 like a constant pool or whatever

17:36 cemerick: AFAICT, literals are always literals, but if there's symbols in them, they may not evaluate to themselves.

17:38 pjstadig: _carlos_: i'm not sure there are any deprecated forms

17:38 though anything marked "alpha" may get yanked

17:39 cemerick: _carlos_: anything struct-related is deprecated by records, even if not marked

17:39 pjstadig: there's add-classpath, anyway

17:39 pjstadig: true

17:40 _carlos_: is :gen-class used inside (ns ... (:gen-class) nowadays?

17:43 TimMc: pjstadig: Things marked alpha: promise, all transient stuff, juxt, deftype, add-watch

17:43 ibdknox: if they remove juxt, I bet amalloy would just quite clojure on the spot.

17:43 pjstadig: TimMc: I'm just repeating what Rich said at the Conj

17:43 TimMc: yeah

17:43 ibdknox: RAGEQUIT

17:43 ibdknox: quit*

17:43 pjstadig: you can define your own

17:43 ibdknox: TimMc, srsly

17:44 amalloy: didn't that lose its alpha designation in 1.3?

17:44 TimMc: pjstadig: I can't see some of these being changed at this point.

17:44 amalloy: yes, it did

17:44 TimMc: amalloy: Oops, that was in my 1.2 repl.

17:44 technomancy: I could see transients going away in favour of pods

17:44 hiredman: also chunks

17:44 cemerick: please yes re: transients

17:44 technomancy: are chunks even documented though?

17:44 cemerick: but I have such a good blog post for those. =(

17:45 cemerick: technomancy: feh. Writing about them was hell IMO.

17:45 publish now so the post has some half-life before being obsoleted. :-P

17:46 technomancy: oh, I posted it like a year ago; it's cool. =)

17:46 http://technomancy.us/132

17:46 cemerick: nm then :-)

17:46 technomancy: two years ago

17:46 cemerick: oh, THAT

17:46 * cemerick goes to change every fifth word in that section of the book

17:46 technomancy: haha

17:46 transients are valuable because they help explain persistents

17:47 pjstadig: deftype and defrecord are Alpha in 1.2

17:47 er 1.3

17:47 ibdknox: I've been bad and haven't blogged in forever

17:47 technomancy: without the darkness we would not appreciate the light.

17:47 ibdknox: need to get back on that

17:47 pjstadig: as are watches on refs

17:47 technomancy: relevant: http://www.qwantz.com/index.php?comic=2047

17:49 pjstadig: ,(find-doc "Alpha")

17:49 clojurebot: -------------------------

17:49 clojure.core/add-watch

17:49 ([reference key fn])

17:49 Alpha - subject to change.

17:49 Adds a watch function to an agent/atom/var/ref reference. The watch

17:49 fn must be a fn of 4 args: a key, the reference, its old-state, its

17:49 new-state. Whenever the reference's state might have been changed,

17:49 any registered watches will have their functions called. The watch fn

17:49 will be called syn...

17:51 TimMc: pjstadig: Yeah, the only thing I was wrong about was juxt.

17:51 cemerick: technomancy: problem with that is that *watching* baseball is the perfect background for enjoying a beverage.

17:51 TimMc: and a good thing, that

17:52 technomancy: I dunno; you could say the same of an aquarium or roaring fire.

17:53 TimMc: Gonna say... no.

17:53 But then, I'm not a sports person.

17:54 llasram: Speaking 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:54 hiredman: at one point the ceo of sonian asked technomancy something like "how about those seahawks?" and technomancy said "I don't play pokemon"

17:54 dakrone: hiredman: best moment of that entire meetup

17:54 TimMc: My 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:55 hiredman: it was pretty coode

17:55 technomancy: hiredman: three seconds later I realized he was the CEO.

17:55 hiredman: good

17:55 amalloy: http://xkcd.com/178/ for reference

17:55 pjstadig: and that was technomancy's last day

17:55 TimMc: ah!

17:55 technomancy: haha

18:04 cemerick: hiredman: that's a gem

18:05 dnolen: llasram: you generally have to goto the source

18:07 llasram: dnolen: 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:08 dnolen: llasram: then ask away.

18:12 cemerick: llasram: 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:13 llasram: dnolen: Ok, fair enough :-). Let me see... What are the differing intents for ILookup vs Associative ?

18:14 TimMc: Intent is in the eye of the beholder, since javadoc is entirely neglected by core.

18:15 llasram: ISeq vs. Sequable ?

18:15 dnolen: llasram: Associative is anything that implements entryAt and assoc. ILookup needs to implement valAt

18:15 llasram: Seqable is something that can be coerced into an ISeq

18:17 llasram: I see. So implement ISeq if you need fine-grained control over iteration, and Seqable if you can just e.g. use lazy-seq?

18:17 dnolen: llasram: no if something satisfies ISeq it can be used as a sequence in Clojure.

18:17 arohner: are there any cron-like libraries for clojure worth recommending?

18:18 llasram: dnolen: sorry, s,iteration,enumeration,? How Clojure will actually walk the sequence being provided

18:19 dnolen: llasram: *you* control that by implementing ISeq

18:19 llasram: Right

18:20 hiredman: if you implement ISeq you are a seq, if you implement Seqable you can supply a seq if asked for one

18:21 llasram: That makes sense.

18:23 Another 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:24 amalloy: &(#{'(1 2)} [1 2])

18:24 lazybot: ⇒ (1 2)

18:24 technomancy: if you return a different value, you're probably an Assoc rather than a Set

18:24 llasram: Ahhhhhh, because equality != identity, got it

18:24 Ok, this has been very helpful. Thank you, dnolen :-)

18:25 dnolen: np

18:28 it's interesting that CLJS only defines 26 protocols

18:29 make that 25

18:30 AimHere: One for every letter of the alphabet

18:33 llasram: Except poor, forgotten '

18:44 Oh, 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:44 Idea is a set of things, but lookups map to a sequence of all the parents of the lookup key

18:45 Looks to me like I must have largely settled on the correct behaviors

19:05 frankvilhelmsen: msg

19:07 * frankvilhelmsen

19:07 dyba: hey everyone, I'm having trouble implementing a factorial function

19:07 I'm coming from a Ruby background, so I have some brain rewiring to do

19:08 I attempted to use a loop that kept track of two variables n and result

19:08 let me get a gist link first

19:11 https://gist.github.com/1650384 - Clojure Koans - Recursion.clj

19:12 I got it to work in Ruby, but I'm having trouble making the translation to Clojure

19:13 i understand that using recur rebinds the variables you use in a loop

19:14 since 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:14 but i realized that recur doesn't return anything

19:14 so my result will always be 1... not good

19:15 technomancy: you need another termination condition

19:15 dyba: then i thought back to using cond as I had tried out in common lisp

19:16 technomancy: would that be a third parameter in recur?

19:16 amalloy: haha, i like the "working so far" approach. "I've only tried it for inputs 0 and 1, and it works!"

19:16 dyba: amalloy: :)

19:17 technomancy: dyba: another if

19:17 dyba: this problem is a cinch in ruby

19:17 amalloy: technomancy: he doesn't need any more conditions, just a better result when he terminates

19:17 technomancy: heh; sure, if you know ruby

19:17 llasram: dyba: It's a cinch in Clojure too :-)

19:17 amalloy: dyba: you imply that this is like, an open problem in clojure. nobody's figured out how to do it

19:18 dyba: llasram: i bet it is, but I'm at the lowest productive point right now. Barrier to entry to Clojure is high

19:18 amalloy: dyba: just change the "then" part of the if, to return result instead of 1. done

19:19 &(apply * (range 1 6)) ;; a simpler approach to 5!, for what that's worth

19:19 lazybot: ⇒ 120

19:20 technomancy: ,((comp (partial apply *) (partial range 1) inc) 5)

19:20 clojurebot: 120

19:20 technomancy: way simpler, come on now.

19:20 dyba: i forgot about ranges!

19:21 technomancy: actually you don't need to partial range

19:22 ,((comp (partial apply *) rest range inc) 5)

19:22 clojurebot: 120

19:22 technomancy: try porting that to ruby =)

19:22 dyba: amalloy: just read the part you mentioned about changing "then", yah, I see that now

19:22 TimMc: Are you avoiding ->> for a reason?

19:23 technomancy: TimMc: it's not as ridiculous?

19:24 I guess now that plain defs can have docstrings that's one objection to point-free-mania that no longer stands

19:24 you still miss out on arglists, but most point-free stuff takes a single arg anyway

19:26 dyba: looks like i got stuck in an infinite loop when i put the recur outside the if

19:28 amalloy: technomancy: not sure i agree with that; it'd be nice to (def find-first (comp first filter))

19:28 and similar things like that

19:29 technomancy: yeah, I guess so

19:29 I wish meta-on-fns were taken more seriously

19:30 no reason comp and partial couldn't preserve arglists

19:30 amalloy: yeah, that's a good point

19:31 technomancy: what was the reasoning behind that anyway? saving space on android or something?

19:31 clj_newb: why can't I (:import (java.awt.geom.Rectangle2D Float)) ?

19:31 I wnat to create an object of type Rectangle2D::Float

19:32 llasram: clj_newb: Inner classes are a lie

19:33 (import '[java.awt.geom Rectangle2D$Float])

19:33 clj_newb: llasram: how do use them in Clojure?

19:33 Rectangle2D$Float. <-- unable to resolve clas name

19:35 llasram: Oh?

19:35 clj_newb: llasram: I had a typo

19:35 fixed now. thanks

19:35 llasram: np

19:44 wjlroe: I'm having problems using read-line - it seems to not return (running with `lein run`) - with this code: https://gist.github.com/1650490

19:45 technomancy: wjlroe: try "lein trampoline run"

19:45 (known issue)

19:45 wjlroe: ah ha

19:46 technomancy: thanks! that works - so why is that?

19:46 technomancy: wjlroe: java doesn't let you access stdin from subprocesses

19:47 trampoline works around this by not using subprocesses

19:47 it's dumb

19:47 but it's what you gotta do

19:47 wjlroe: ok

19:48 technomancy: 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:48 JohnnyL: have any of you used concurrency structures on a multicorein Clojure?

19:49 technomancy: wjlroe: no, lein run will always use a subprocess

19:49 but if you use an uberjar it won't be a problem

19:50 well, lein run might not use a subprocess in lein2

19:50 but I don't see it changing in lein1

19:50 dgrnbrg: How 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:51 JohnnyL, I know a thing or twoo

19:52 * technomancy is tempted to say that protocols and interactive development are at odds with each other

19:53 dgrnbrg: technomancy, what workflow do you use?

19:54 muhoo: interactive development is very helpful in dealing with protocols. you can query a server, see what it returns, etc.

19:54 dgrnbrg: muhoo, Protocols are a feature of clojure

19:54 sort of like types

19:54 muhoo: ah

19:54 technomancy: dgrnbrg: multimethods and defns

19:55 I have never encountered a polymorphism problem for which dispatch was a performance bottleneck

19:55 dgrnbrg: interesting

19:55 I'm writing an embedded language in clojure

19:56 I am using protocols to help gather the interfaces various concepts in the language

19:56 technomancy: I was about to say, the main driving use case for protocols are for writing clojure-in-clojure.

19:56 dgrnbrg: i wish there was a dynamic attribute to the protocols

19:56 or a global flag

19:56 technomancy: but writing lower-level code forces you to make certain compromises

19:57 wjlroe: technomancy: 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:57 technomancy: hm; you could add a hook to do that

19:57 JohnnyL: dgrnbrg: have you had it chugging away on long running processes utilizing all cores?

19:58 wjlroe: technomancy: ok, I'll have a look, see what I can hack

19:58 technomancy: wjlroe: I'd rather not add something to lein1 since I think lein2 might have a cleaner solution with in-process classloaders

19:58 wjlroe: technomancy: well if it can be done with a hook - then that's the way to do it

19:58 dgrnbrg: JohnnyL, not extensively

19:58 but i do know how it works

19:58 JohnnyL: i tried the parallel libs for python. It appears to divy up the processing smothly across all cores.

19:59 dgrnbrg: JohnnyL, taht's a very abstract description of your problem

19:59 technomancy: JohnnyL: are you talking about concurrency or parallelism?

19:59 clj_newb: crap; does java/clojure have the concept of friendship?

19:59 JohnnyL: technomancy: what does clojure support?

19:59 technomancy: concurrency is trivial in Clojure. parallelism depends a lot on the kinds of work you want to do and the shape of your data.

20:00 clj_newb: i.e. I need to define X to be a [proxy Foo], yet have acess to the protected members of [Dog]

20:00 damn it, so protected = accessible in package, but not owrld

20:01 but my proxy objects are NOT defined in the original apckage

20:01 dgrnbrg: technomancy, are you sharp w/ macros?

20:01 clj_newb: hmm, what is the right way to do this, to make this protected members public?

20:01 this seems very dirty

20:01 alternatively, can I define d aproxy to be in a different package?

20:01 dgrnbrg: I have a macro that gets a symbol as an argument, but I want to invoke a namespace-qualified version of that symbol

20:01 hiredman: JohnnyL: how does python deal with parallelism given the gil?

20:01 clj_newb: (a package that is in java land, not clojure land, even)

20:01 technomancy: dgrnbrg: I guess?

20:02 dgrnbrg: maybe ns-resolve

20:02 ,(doc ns-resolve)

20:02 clojurebot: "([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:03 dgrnbrg: that seems like it doesn't fit my use case

20:03 I'm defining a multimethod version of +

20:03 via a macro

20:03 but I want to specify that if the arguments are Numbers, use core's +

20:03 technomancy: you can't really know that at compile-time

20:03 dgrnbrg: but the macro is generating multimethod versions of everything

20:04 JohnnyL: hiredman: tcp/ip sockets across multiple 32 bit processes.

20:04 hiredman: JohnnyL: :|

20:05 dgrnbrg: technomancy, this should be clearer: http://pastebin.com/9PrnbL9u

20:05 on line 12, I want it to work

20:08 nvm, ns-resolve works :)

20:10 JohnnyL: thank you gentleman.

20:13 llasram: technomancy: re: polymorphic dispatch latency; low-latency network services?

20:15 technomancy: pretty sure anything involving I/O is going to make multimethod dispatch look like a rounding error

20:17 llasram: Hmm. 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:17 technomancy: only one way to find out

20:18 llasram: Re-implement Clojure in Clojure using multimethods?

20:18 technomancy: I didn't say it's impossible, just that I'd never worked on such a system.

20:18 and my intuition is that the majority of Clojure users will not do so either

20:24 dyba: finally got that recursion problem in the koans to work

20:25 TIL recur doesn't eat up the stack

20:26 dnolen: is swank-clojure 1.4.0-SNAPSHOT on any major repo besides clojars?

20:32 technomancy: dnolen: are there any other major repos that would take it?

20:33 dnolen: technomancy: good to know I'm not crazy, just trying to understand how to setup/run test.benchmark, thoroughly lacking in any documentation whatsoever

20:33 technomancy: I thought most of them were restrictive about group-ids and package names

20:33 I 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:34 boo on poms that refer to artifacts without declaring where they're from =\

20:36 dnolen: technomancy: test.benchmark is clearly in a half-assed state

20:36 technomancy: this is the first I've heard of it

20:36 hiredman: shocking

20:36 maybe should write some alioth benchmarks for it

20:37 dnolen: there are some benchmarks in there and they look good.

20:46 dgrnbrg: Is there a normal pattern for splicing a macro that takes an fntail?

20:46 since ~@ doesn't work because the parameters get ns-qualified

20:46 wait nvm I'm silly

20:47 wjlroe: Trying 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:48 phil: hi, is there a way to destructure a vector argument and dispatch it into a function with multiple arities?

20:48 similar to haskell

20:49 dnolen: wjlroe: metadata is put onto the var not the fn

20:50 phil: don't follow

20:50 wjlroe: dnolen: ok, so how do I do this? define a function and its metadata like that?

20:51 dnolen: wjlroe: access the metadata like this, (meta #'exit)

20:52 phil: dnolen: 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:52 preferably with core clojure (need this for clojurescript)

20:53 dnolen: phil: (apply x v)

20:53 phil: oh yes... and then just define x with multiple arities right?

20:54 dnolen: phil: yep

20:54 phil: perfect, thx :)

20:55 dnolen: np

21:01 dgrnbrg: I just implemented an extensible type system in clojure

21:01 :)

21:02 dnolen, is it possible to define unification for arbitrary types?

21:02 dnolen: dgrnbrg: yes

21:02 dgrnbrg: like, if I wanted to specify that int and float can be unified into floats

21:03 dnolen, I suppose I really want to have promotion-esque behavior

21:03 dnolen: dgrnbrg: just implement IUnify for that type, then you'll need to do a second dispatch

21:03 for 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:03 dgrnbrg: does core.logic try unifying each of the pair of objects-to-be-unified to each other to see if either direction succeeds?

21:04 TimMc: technomancy: 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:04 dnolen: dgrnbrg: nope, you have to do both sides yourself. but again you can provide the default by extending Object

21:04 dgrnbrg: hmm

21:05 dnolen: (extend-type Float IUnifyTerms ...)

21:05 (extend-type Ojbect IUnifyWithFloat (unify-with-float [_] nil))

21:05 etc

21:05 dgrnbrg: I see

21:05 I think that it'll be too difficult for me to implement this right away

21:06 I'll continue mulling it over

21:06 dnolen: is the extensible type system using core.logic?

21:06 dgrnbrg: is condu the best idiom for error reporting?

21:06 yes, it is

21:06 I'm working on an hdl

21:06 i implemented a simple unifier

21:06 dnolen: dgrnbrg: there is not idiom for error reporting yet - would love to hear ideas about htat

21:06 dgrnbrg: hdl?

21:06 dgrnbrg: hardware description language

21:07 (it's me again)

21:07 but now, I can talk about it!

21:07 dnolen: dgrnbrg: oh yeah, cool!

21:07 dgrnbrg: oooooohhhhhhh

21:07 You could do error reporting by combining the core.logic monad with a list monad

21:08 and adding errors to the list if they occur

21:08 as a goal that always succeeds and adds the error to the error-list

21:08 then again...

21:09 I think errors can't be pure logic and have a nice api and be not too hard to implement

21:09 I like the idea of using condu as an an "else error" block

21:09 flazz: anyone get indenting to properly work on textmate2 beta?

21:09 dgrnbrg: and appendo the error to an error variable you pass around

21:10 dnolen: dgrnbrg: I think there's a bit of literature out there about this stuff, I haven't looked to closely

21:11 dgrnbrg: dnolen, I tend to improvise :)

21:11 dnolen: dgrnbrg: 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:11 dgrnbrg: but not always

21:11 dnolen: recall

22:28 muhoo: does clojurescript work with multimethods?

23:04 technomancy: TimMc: lein gives maven central precedence over clojars, so that helps

23:04 but we still need signing

23:07 metajack: My emacs mode lines are getting complicated for some reason. [[[[(Clojure Slime[clojure] Paredit yas)]]]]. Why all the brackets?

23:07 My repl buffer is similar

23:10 muhoo: is tehre anything for clojure that will parse an html file, kind of like hiccup in reverse?

23:11 hmm, i suppose i could use the apache java libraries for that, nm

23:11 metajack: muhoo: I'm using enlive for that. works really well

23:11 there are also a few clojure wrappers of popular java libs for that as well

23:11 brehaut: enlive is a very good choice

23:11 muhoo: thanks

23:13 oakwise: emacs/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:13 brehaut: muhoo: theres a good tutorial on the github wiki, and the readme (i think) links to dnolans introduction as well.

23:14 oakwise: i dont know if clojure-mode knows how to connect to slime for its coloring, but generally speaking colorising lisps is quite difficult

23:15 oakwise: brehaut: darn, thanks

23:15 brehaut: oakwise: 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:15 oakwise: it's so much prettier on http://webnoir.org/ :)

23:15 right

23:15 brehaut: thats because chris busts his gut to make his documentation good

23:16 oakwise: seems so

23:16 brehaut: huh. it appears hes using gist

23:16 oakwise: which uses pygments I think?

23:17 brehaut: yeah

23:17 i know that amalloy has done some work on the pygments brush

23:18 metajack: Hmm. I seem to have gotten CDT into a state it can't get out of :(

23:19 oakwise: looks like it's highlighting anything non-quoted in the calling position of a list regardless of imports

23:24 jeremyheiler: Are there any useful libs for socket io, or is it all java interop right now?

23:25 metajack: There's aleph

23:28 jeremyheiler: metajack: looks interesting. not sure i want to depend on netty for this project, though.

23:29 metajack: thanks

23:29 metajack: I 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:30 I think part of the issue is that the Java interop is so good people don't make it to the clojure wrappers often :)

23:31 technomancy: oakwise: I think slime has something for that, but it's only wired up for CL

23:32 brehaut: yay slime :(

23:32 i for one welcome our new nrepl overlords

23:33 oakwise: technomancy: as long as I'm not the only one with non-pretty top-levels, I'm happy I guess :)

23:35 brehaut: oakwise: be thankful you arent a textmate using clojure programmer :P

23:37 jeremyheiler: metajack: yeah, good point. ideally, though, clojure core could abstract socket io a bit so it's less platform specific in library code.

23:37 oakwise: heh indeed

23:48 jeremyheiler: I wonder why clojure.contrib.server-socket was never promoted out of contrib.

23:48 brehaut: jeremyheiler: because nobody offered to do so?

23:51 jeremyheiler: brehaut: really? i figured there might have been some other reason.

23:52 brehaut: may well be? but i dont think any libraries got promoted unless someone was willing to commit to taking them on?

23:54 jeremyheiler: yeah, makes sense. maybe i'll play around with it and see if it can/should be salvaged.

23:56 brehaut: jeremyheiler: you could always track down Craig McDaniel and ask him about it? (at least, hes the listed author in the code)

Logging service provided by n01se.net