#clojure log - May 03 2012

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

0:00 xeqi: wei_: (map #(when (agent-error %) (System/exit 1)) agents) ?

0:01 or doseq since map is lazy

0:02 wei_: xeql: thanks. should I use another agent to run this periodically?

0:03 xeqi: you could look at #(doc set-error-handler!) if it should happen all the time

0:04 hmm, what is it for inline bot commands?

0:07 brehaut: ##

0:08 foo ##(inc 1) bar

0:08 lazybot: ⇒ 2

0:16 wei_: ,(doc set-error-handler!)

0:16 clojurebot: "([a handler-fn]); Sets the error-handler of agent a to handler-fn. If an action being run by the agent throws an exception or doesn't pass the validator fn, handler-fn will be called with two arguments: the agent and the exception."

0:18 wmealing: i didnt know about that, thanks.

0:27 emezeske: Any midje experts in here know how to deal with prerequisite functinos that take a variable number of arguments?

0:37 leo2007: last time I tried swank-clojure which is about 1 year ago it doesn't have CDT support. How to demonstrate the CDT feature in the new swank-clojure?

0:43 sritchie: ibdknox, qq

0:43 if you were a man who used vimclojure, but had your memory wiped out --

0:44 where would you go to rediscover the installation process?

0:47 jayunit100: how does "recur" know what the "recursion point" is in absence of a "loop" ?

0:47 sritchie: jayunit100: it jumps up to the function definition

0:47 at the same arity

0:48 jayunit100: oh ok

0:48 so it looks to the nearest function definition.

0:48 or the one which it is immediately nested inside of .

0:49 hmmm one more question... Could not locate clojure/contrib/lazy_seqs__init.class?

0:50 Raynes: That is completely impossible to diagnose without more information.

0:50 What are you doing that causes that?

0:50 jayunit100: ah nevermind. i thought it was always in the cp. forgot you have to add it.

0:50 raynes: yup... my bad... contrib is external. dug

0:51 Raynes: You shouldn't be using that anyways.

0:51 jayunit100: contrib ?

0:51 Raynes: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

0:51 jayunit100: hmmm oh ok . i was looking for the prime # generator

0:52 clojure.contrib.lazy-seqs was killed off ?

0:52 Raynes: jayunit100: As of Clojure 1.3, monolithic contrib was split into a number of independent libraries (https://github.com/clojure). Some pieces of it that were inconsequential disappeared.

0:53 jayunit100: raynes: yup prob got rid of lazy primes. oh well thanks

0:53 night night gotta go sleepy

0:57 wmealing: i guess you could always move it forward in your own lib

1:23 sritchie: does anyone know how to access the previous statement in vimclojure, at the nailgun repl?

1:34 wei_: sritchie: Ctrl Up, i believe

1:34 you have to be in insert mode

1:35 sritchie: wei_: nice, thanks

1:48 wei_: i'm trying to reify a java interface, in which onMessage should dispatch an event to an agent. what's the best way to implement this? I've tried (defn make-handler [msg-fn] (reify IOCallback (on [_ msg] (msg-fn msg)))) but when I have multiple agents, each with their own socket, the messages aren't getting routed to the right agent.

2:42 leo2007: is the clojure api doc http://clojure.github.com/clojure/ built from its doc-strings?

2:44 * leo2007 waits

2:52 wmealing: it does look like it

3:03 creese: having trouble with atoms. I want to assoc into an empty hash I have the keys and vals as a list

3:04 (apply assoc {} (interleave (keys (get-hash seuss)) (vals (get-hash ))))

3:04 gives, {\c #{"cat"}, \a #{"cat" "hat"}, \t #{"cat" "hat"}, \h #{"hat"}}, this is what I want

3:05 what is correct format for swap! so I can update the atom?

3:08 I'm trying (swap! dictionary (apply assoc (interleave (keys (get-hash seuss)) (vals (get-hash seuss))))), but this isn't quite it.

3:10 leo2007: wmealing: thanks

3:10 amalloy: huh? the stuff you've glossed over makes your question difficult to understand

3:10 it sounds like you probably just want (swap! dictionary into (get-hash seuss))

3:11 creese: I didn't know you could put the hash in there directly

3:11 amalloy: (swap! a f x) => sets a to (f @a x)

3:12 to merge two maps, you can use merge, or into, or any number of things. apply/assoc/interleave is usually not the best way

3:13 if you wanted to do it that way, you could do (swap! dictionary #(apply assoc % (interleave ...)))

3:14 or, equivalently, (swap! dictionary (partial apply assoc) (interleave ...))

3:15 creese: (swap! dictionary into (get-hash seuss)) does what I want

3:15 thanks

4:15 leo2007: there is no equivalent of the hyperspec for common lisp, right?

4:30 faust45: is it clear to use agents to handle http req in async way?

4:39 tomoj: faust45: have you looked at aleph?

4:39 faust45: tomoj: no

4:39 tomoj: https://github.com/ztellman/aleph/wiki/HTTP

4:40 faust45: tomoj: thanks will take a look

4:41 tomoj: agents may work for your needs, dunno, but aleph is what I use for async http

4:41 bit complicated maybe since you need to learn lamina too

4:41 for that, http://www.infoq.com/presentations/Event-Driven-Programming-in-Clojure

4:42 is a good high level presentation

5:07 devn: http://www.youtube.com/watch?v=4eivzaGgnFw&feature=relmfu

5:09 leo2007: folks, clojure for android, is it realistic now?

5:09 In a business sense.

5:10 devn: leo2007: i dont think so yet, but im by no means an authority on that topic

5:10 leo2007: there's some active work being done on that front though

5:11 leo2007: devn: where to find out?

5:13 devn: leo2007: http://groups.google.com/group/clojure-android/browse_thread/thread/05bc8bc4fa145e67/9c828a4946877b47?show_docid=9c828a4946877b47

5:13 leo2007: didn't know there is a dedicated ml. Thanks.

5:15 devn: leo2007: happy to help. happy clojuring. :)

5:16 leo2007: any business/startups using clojurescript?

5:47 _KY_: Under "lein run", the core.clj module cannot read from *in*, how to fix that?

5:56 How can I run the project after compiling it in lein?

5:58 vijaykiran: _KY_: if you have a main class and created uberjar, you can use java -jar *jar-name.jar*

5:59 _KY_: I tried to run the main class

5:59 But it doesn't work...

5:59 Don't know why

6:02 I tried uberjar it says cannot locate main class

6:04 pooya72: _KY_: have you followed the steps in the tutorial? http://stackoverflow.com/questions/10240100/clojure-lein-package-into-jar/10244187#10244187

6:08 _KY_: Thanks... succeeded =)

6:08 pooya72: _KY_: yes!

6:08 _KY_: So.. when I run it compiled, it can read *in*

6:08 But not when running under lein

6:10 pooya72: i don't see why it shouldn't work under lein

6:11 you mean the repl or lein run?

6:27 leo2007: is idempotent a word?

6:28 bradwright: yes

6:28 http://en.wikipedia.org/wiki/Idempotence

6:29 leo2007: thanks

6:58 if I type '#(whatever %1) in the repl, it gives me (fn* [p1__2469#] (whatever p1__2469#))

6:59 but to use slime's macro expansion to get the same results?

6:59 I only have: #(whatever %)

7:00 Is this because macroexpand-all is not yet implemented?

7:13 beffbernard: Morning

7:19 pooya72: beffbernard:Morning

7:27 cshell: morning :)

7:44 y3di: did the clojurewest vids ever go up?

7:53 creese: trying to print the value of a var inside a let, but its complaining about lazy sequences, how can I force those?

8:04 _KY_: pooya72: when I do "lein run", my code does a "read" but the input is frozen...

8:04 pooya72: creese: Force evaluation: doseq dorun doall

8:04 _KY_: Seems that *in* is re-directed somewhere else

8:04 creese: _ (doall (println (words-by-letter)))

8:04 doesn't work, where do I put it?

8:06 pooya72: creese: http://clojuredocs.org/clojure_core/clojure.core/doall

8:08 _KY_: I don't know, I think I have to look at the code. But I'm a noob, so don't know how much I can help.

8:08 _KY_: Have you tried "read" under lein run?

8:08 See if your setup work =)

8:09 The code is just a simple (read)

8:09 pooya72: _KY_:

8:09 _KY_: ok

8:09 michaelr525: padLeft in clojure?

8:10 solussd_: If I want to have my webserver reply to a GET at an arbitrary URL with a file download, can I simply return (slurp "path/to/file")? it seems to work with text, but not images

8:15 cemerick: solussd_: try returning (java.io.File. "path/to/file")

8:16 Though you should use an existing static resource handler for that, so you're not accidentially serving files like e.g. "/etc/passwd" :-)

8:17 solussd_: cemerick: that worked. Can you tell me why? :)

8:18 cemerick: I provide a link that doesn't contain the filename, e.g. http://<servername>/filesubmissions/<uuid>/file, and that looks up the filepath and serves it. :)

8:19 cemerick: solussd_: oh, I see. I presume you're using compojure?

8:20 solussd_: cemerick: noir

8:20 cemerick: sure, which uses compojure underneath

8:20 solussd_: yup

8:20 cemerick: I believe that's where the automatic Content-Type handling and such is done.

8:21 Unless the files you're serving have no extension, in which case you should need to set the content type yourself.

8:21 sandGorgon: cemerick, shouldnt that be handled by something like nginx in front of the actual app ?

8:21 _KY_: How can I do (read) from a string?

8:21 solussd_: using Noir with Enlive, clojurescript+jayq for client-side, fetch for ajax (or acacs I guess), Korma for db, and Lobos for migrations. All works quite well together

8:21 cemerick: _KY_: read-string

8:22 sandGorgon: well, not if there isn't a direct mapping between the URI and the file to be served

8:22 solussd_: cemerick: i explicitely set the content-type using (noir.response/content-type <type> <stream>)

8:22 cemerick: In any case, it's *tons* simpler to not have to mess with nginx or apache or lighttpd, or…

8:22 _KY_: Ahh that works =)

8:23 solussd_: jetty seems performant. I like. :)

8:23 cemerick: Good enough for almost everything.

8:23 sandGorgon: cemerick, even if there is not, shouldnt the app should just do a redirect to the actual file path and let nginx serve it ?

8:23 cemerick: Once it's not, you're probably better off using a CDN

8:24 sandGorgon: but for what purpose?

8:24 fdaoud: solussd_: "acacs" --that's funny :)

8:24 sandGorgon: cemerick, ur comment about a CDN supersedes that anyway ;)

8:24 cemerick: :-)

8:25 hardly anyone needs whatever performance benefits nginx et al. provide, or a CDN for that matter

8:25 Those that do…use them. :-)

8:26 solussd_: fdaoud: yeah, it makes a lot of sense. No point in serializing clojure to XML- clojure is its own serialization format. (code is data! yay!)

8:26 fdaoud: indeed

8:26 pooya72: _KY_: I tried this (example 2) in lein run: http://clojuredocs.org/clojure_core/clojure.core/read and it worked

8:27 solussd_: I convinced the right people at work to let me do a couple of the projects in the pipeline in clojure. So far, so good. Nice to write clojure at work. :)

8:28 robertstuttaford: cemerick: awesome! thanks for posting the video. quick question. i'm unable to download the video from youtube (for watching later). any clue why?

8:28 cemerick: robertstuttaford: dunno; is that supposed to be possible in general?

8:29 _KY_: pooya72: why not try example 1?

8:29 I have problem when reading from standard input ... it freezes

8:29 cemerick: right, so: I posted an introductory 'Starting Clojure' screencast yesterday: http://cemerick.com/2012/05/02/starting-clojure/

8:29 robertstuttaford: yes. here in south africa, our connectivity isn't that fast so i download 'casts to watch so i don't have to wait for buffering

8:30 but for some reason when i download i only get a 1.7mb blob and then that's it

8:30 how big is your source vid ? :)

8:30 cemerick: robertstuttaford: I think it was ~300MB, but I have no idea what youtube does to it

8:31 pooya72: cemerick: thanks for the video :)

8:32 cemerick: robertstuttaford: how are you getting a download link?

8:33 robertstuttaford: using DownThemAll for firefox; it sniffs out the url that flash player requests

8:34 cemerick: ah

8:34 clgv: is there a predicate placed replace function in clojure where the replacement is determined by a given function?

8:35 pooya72: _KY_: because i assumed there was no way to get user feedback. so I assumed it wouldn't work in lein run.

8:35 _KY_: Did it work?

8:36 cemerick: clgv: you mean for string/regex replacements?

8:36 clgv: something like: (replace coll vector? #(map inc %))

8:36 _KY_: Any one else know why (read) fails to work under "lien run"?

8:36 pooya72: _KY_: No, and not in lein run, but works in uberjar. Ask technomancy, or the mailing list.

8:36 _KY_: Same here...

8:36 I have to uberjar it

8:37 clgv: cemerick: no. for items in collectionc

8:38 pooya72: _KY_: try lein trampoline run

8:38 _KY_: it worked for me

8:38 _KY_: read up on it here: https://groups.google.com/group/clojure/browse_thread/thread/a720fbb471edc040/09521c4b02c86f30?lnk=gst&q=trampoline

8:38 cemerick: clgv: Not AFAIK.

8:39 clgv: cemerick: so everyone is composing this common task for themselves right now?

8:39 cemerick: When necessary, yeah.

8:39 clgv: ok

8:41 _KY_: But "lein trampoline run" just gave me some java help

8:45 pooya72: _KY_: really? it worked for me. given the example in clojure docs for (read)

8:46 _KY_: It prints the java usage information

8:50 robertstuttaford: is there an incantation for the repl that automatically adds closing parens upon typing an opening one?

8:50 cemerick: robertstuttaford: where is your REPL?

8:51 mdeboard: I always found paredit to be kind of hard to get used to

8:52 Paren highlighting has been enough for me so far

8:52 robertstuttaford: um, lein repl

8:53 right now it's either there or whatever it is la-clojure in intellij is giving me

8:53 rnika: does clojure have a function like Scheme's for-each? Apply a function to each item in a sequence? (for-each prn '(1 2 3))

8:53 robertstuttaford: rnika: that's map, surely?

8:53 kephale: or doseq

8:54 rnika: but map builds up a result, I don't need one.

8:54 robertstuttaford: doseq, yes

8:55 ssedano1: Hi, is redis-clojure the most up-to-date client?

8:55 robertstuttaford: what's the largest production deployment (in users) of clojure that anyone knows of?

8:56 vijaykiran: robertstuttaford: http://getprismatic.com/ is built in clojure AFAIK

8:58 cemerick: robertstuttaford: paredit-style editing in a terminal is probably not going to happen

8:58 If you're not fond of IntelliJ's REPL, counterclockwise's is very nice IMO. (Of course, I'm biased.)

8:59 robertstuttaford: also: http://dev.clojure.org/display/community/Clojure+Success+Stories

8:59 robertstuttaford: ah brilliant @ success stories

8:59 i'll check the eclipse plugin

8:59 i get a bad taste in my mouth whenever i see eclipse. i blame flex/flash builder

9:00 nDuff: robertstuttaford: ...I don't see Dell in the success stories page, but they're using it too (monitoring/statistics analysis infrastructure within the SaaS division)

9:01 cemerick: robertstuttaford: a particularly bad citizen, it's true

9:01 mdeboard: Prismatic is built with clj but they've got a relatively tiny user base

9:07 robertstuttaford: simple.com too!

9:07 http://www.quora.com/Whos-using-Clojure-in-production

9:08 hhutch: robertstuttaford: Comcast also (I don't work there I just know it to be true)

9:10 leo2007: shit even after a year, lein still fails: http://paste.pound-python.org/show/20624/

9:10 clgv: leo2007: windows?

9:11 leo2007: I use rcirc on GNU Emacs 24.0.96.1 (Mac OS X 10.6.8)

9:12 when in invoked lein, it downloaded the jar in current directory and somehow failed to copy it to ~/.lein/self-installs

9:12 s/in/I/

9:19 ejlo: Is it possible to print the emitted js code from a cljs REPL?

9:23 uvtc: Using lein 2, while running `lein repl`, I see that I can run `-main` from from the repl like so: `(-main)`. However, the if I update my src/foo/core.clj file, how do I reload it in the repl?

9:24 vijaykiran: uvtc: (use 'foo.core :reload)

9:24 uvtc: Thanks, vijaykiran!

9:31 _KY_: Is there something wrong with my installation if "lein trampoline run" gives me the java usage info?

9:34 vijaykiran: _KY_: what's the output you are getting ?

9:34 can you paste your project.clj somewhere ?

9:34 _KY_: Usage: java [-options] class [args...]

9:34 (To execute a class)

9:34 Or java [-options] -jar jarfile [args...]

9:34 (To execute a jar file)

9:34 All the java usage help...

9:35 https://refheap.com/paste/2523

9:37 michaelr525: err something strange is going on here

9:39 meh defn instead of def and a cryptic error message

9:40 IllegalArgumentException Parameter declaration str should be a vector clojure.core/assert-valid-fdecl (core.clj:6465)

9:40

9:40 cshell: dakrone: Nice clj-http library

9:40 michaelr525: google saved the day again

9:40 clgv: michaelr525: erm, what do you do?

9:41 _KY_: "Lein run" works fine but "lein trampoline run" gives me java usage =(

9:42 michaelr525: clgv: i wrote this (defn base-path (str home-dir "/images"))

9:42 instead of (def

9:42 S11001001: &(doc constantly)

9:42 lazybot: ⇒ "([x]); Returns a function that takes any number of arguments and returns x."

9:42 chace: should be (def :)

9:42 clgv: ah kk

9:42 vijaykiran: _KY_: which version of lein are you using ?

9:43 fdaoud: michaelr525: I did something like that once and it took me a good hour to figure it out :(

9:43 _KY_: Leiningen 1.7.1 on Java 1.7.0_03 Java HotSpot(TM) Client VM

9:44 chace: what am I missing here: (-> (list :a) zip/seq-zip zip/down zip/remove) ? gives me a null pointer exception, while [:a] vector-zip ... works.

9:45 I would expect it to return the empty parent node

9:45 doesn't work on deeper levels either

9:45 vijaykiran: _KY_: which OS ?

9:45 trampoline seems to run this : https://github.com/technomancy/leiningen/blob/master/bin/lein#L203

9:46 _KY_: cygwin

9:47 Cygwin under winXP 32bit

9:48 robertstuttaford: cygwin is old and pretty unusable these days. _KY_, why not grab virtualbox and spin up ubuntu lucid in there and use putty to ssh into the vm instead?

9:49 vijaykiran: _KY_: I guess as a work around - you can just run the jar directly. Seems like a bug with cygwin + lein trampoline

9:49 _KY_: Yeah.. you remind me install ubuntu... =)

9:50 Right... uberjar works already

9:50 But I'm thinking "lein run" may be more convenient during development

9:50 vijaykiran: if you are trampolining that's not much of a help anyway

9:51 _KY_: Does NetBean use lein or maven?

9:51 Why not?

9:52 vijaykiran: Netbeans has support for Maven, I didn't use lein + netbeans

9:54 clgv: _KY_: why dont you use leiningen natively under windows?

9:55 _KY_: Can I do that?

9:55 vijaykiran: there's lein.bat

9:55 S11001001: _KY_: even more convenient is just to spawn your main call in your development repl

9:55 felideon: there's also linux ^_^

9:55 clgv: yeah. last time I checked windows was supported by leiningen ^^

9:56 _KY_: S11001001: you mean don't use lein at all?

9:56 S11001001: _KY_: you don't need lein run to test your app; you can just load the module with your main function in the repl, and call it

9:57 _KY_: that way you can continue to make changes to your running program, notwithstanding extant stack frames and data incompatibilities, but the benefit is well worth the occasional restart instead of the constant restarting

9:58 restart cycles are for other development environments; it's not the lisp way

9:59 _KY_: I see...

9:59 Now "lein run" works in windows, but I still can't do "lein trampoline run"

10:00 "Error: Could not find or load main class and" (sic)

10:02 Also, I can't start the REPL and then change directory to my project...

10:02 S11001001: what repl is that?

10:02 _KY_: The clojure REPL

10:02 S11001001: lein repl starts in the project

10:02 swank starts in the project

10:03 java -cp `cd proj && lein classpath` clojure.main --repl starts wherever you want

10:03 what particular clojure repl doesn't start in the project?

10:05 _KY_: Fine... lein repl fits my requirements

10:09 felideon: S11001001: why'd you 'switch' to clojure?

10:10 S11001001: felideon: immutable data, lazy sequences, a lisp (and emacs-centric like one), got a job in it

10:11 felideon: why?

10:12 felideon: S11001001: just remember you from #lisp :)

10:12 S11001001: yeah

10:12 felideon: S11001001: oh, congrats on job :)

10:12 S11001001: I did a big weblocks project for a client and got extremely frustrated with explicit state management; it was a mess

10:13 felideon: that's a problem with weblocks, though, no? not that i've ever used it.

10:14 S11001001: it's a problem with having your views reflect your state, and your controllers alter your state, and not having automatic relationships between them

10:15 felideon: right, i guess my point is that that is not a problem with Lisp, but with the framework you went with.

10:15 correct me if I'm wrong, though

10:17 we can -> /q though :)

10:18 dnolen: felideon: I think it would be a problem in any language w/o good state management.

10:19 felideon: I guess I'm not understanding 'state management' at the language level. are you talking about immmutability, laziness, et al?

10:19 S11001001: I like writing functions

10:20 the CL community doesn't lend itself to doing that for everything

10:20 qerub: Hello.

10:20 S11001001: if you stay in your own little world, using your own little okasakis, sure, all's well

10:21 felideon: okasakis?

10:21 S11001001: "purely functional data structures" :)

10:22 felideon: ah

10:27 I guess as I learn Clojure I will be enligthened. :)

10:28 mdeboard: embiggened

10:31 gfredericks: learning clojure requires a noble spirit

10:33 dgrnbrg: ,(symbol (name (ns-name *ns*)) 'my-symbol)

10:33 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to java.lang.String>

10:33 dgrnbrg: ,(symbol (name (ns-name *ns*)) "my-symbol")

10:33 clojurebot: sandbox/my-symbol

10:34 dgrnbrg: ,'hi

10:34 clojurebot: hi

10:34 bhenry: ping ibdknox: i need to bug you again. briefly.

10:34 dgrnbrg: ,`~(symbol "my-symbol")

10:34 clojurebot: my-symbol

10:34 bhenry: can i use (in) from korma with just a vector or list?

10:34 dgrnbrg: How can I take a string and get the namespace-qualified symbol?

10:35 the first thing I did works, but it seems weird to use name, ns-name, and symbol--it seems like there should be a simpler way

10:35 bhenry: ibdknox: i have tried a few different syntaxes and can't quite figure it out

10:35 Bronsa: ,(symbol (str *ns*) "symbol)

10:35 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading string>

10:35 Bronsa: ,(symbol (str *ns*) "symbol")

10:35 clojurebot: sandbox/symbol

10:36 dgrnbrg: Bronsa: thanks!

10:44 TimMc: Is there a way to add something to Lein 1.x's classpath? I have a project I'd like to have available from the REPL.

10:45 mefesto: is there a way to have leiningen create checksum files when performing a `lein install` for a project?

10:48 jakemcc: TimMc: would the checkouts directory feature do what you want? http://jakemccrary.com/blog/2012/03/28/working-on-multiple-clojure-projects-at-once/

10:49 TimMc: jakemcc: No, it's a REPL util project. I've implemented a replacement for contrib's "show", and I'd like it to be available in all my REPLs.

10:49 I *could* write a plugin whose sole purpose is to bring in this utility...

10:51 antares_: TimMc: you can specify multiple source locations

10:52 TimMc: ?

11:06 boodle: Ok, silly ? but why is this false? https://refheap.com/paste/2525

11:06 gfredericks: boodle: contains doesn't do what you think it does

11:06 contains? is a n00b trap

11:06 &(doc contains?)

11:06 lazybot: ⇒ "([coll key]); Returns true if key is present in the given collection, otherwise returns false. Note that for numerically indexed collections like vectors and Java arrays, this tests if the numeric key is within the range of indexes. 'contains?' operates constant or... https://refheap.com/paste/2526

11:07 boodle: gfredericks: so really for keys to collections, not contents per se

11:07 gfredericks: boodle: exactly

11:07 boodle: k ty

11:08 gfredericks: &(some #{58} '(58 59 60 61 62 66 69 71 72 73 78))

11:08 lazybot: ⇒ 58

11:08 TimMc: Hmm, can anyone point me to some class in the Java or Clojure std lib where there is a method override with a narrowing return type or a widening param type?

11:10 S11001001: nope

11:10 gfredericks: nobody can

11:11 TimMc: I'm trying to test out this reflection lib I'm writing. :-/

11:12 I just realized that my approach to getting all inherited methods is flawed, since I'm not shadowing out overriden methods.

11:14 stephenjb: is a "unable to resolve symbol" a scope problem?

11:14 trying to do a noir example getting that error

11:15 pandeiro: why does ring's run-jetty fn need the handler arg to be var-quoted?

11:16 gfredericks: pandeiro: I don't think it needs it

11:16 probably has something to do with reloading

11:16 pandeiro: gfredericks: ah

11:16 gfredericks: the extra level of indirection makes sure that when the var is rebound it sees the change

11:16 pandeiro: noticed noir's template does it and cemerick's screencast has it var-quoted too, so that's why. thanks

11:17 TimMc: gfredericks: Err, yes. A coworker points out that you can't override with a widening param type, only a widening exception type.

11:17 *narrowing, gah

11:17 I am so confused.

11:17 gfredericks: TimMc: huh? did I say something about your issue?

11:17 * gfredericks checks

11:17 TimMc: "nobody can"

11:17 gfredericks: ah right

11:18 I was just kinda making fun of S11001001's response

11:18 TimMc: Ah, OK!

11:18 gfredericks: I don't actually know much about it :)

11:18 but glad I was right!

11:18 mfex: pandeiro, re #' see http://groups.google.com/group/clojure/browse_thread/thread/d52bbda3ff0967c8/254a918b9ffe92b9?lnk=gst&q=run-jetty#

11:18 pandeiro: mfex: cheers

11:20 S11001001: that's what I said :)

11:21 _KY_: How come clojure has no "append" for lists?

11:21 gfredericks: &(doc concat)

11:21 lazybot: ⇒ "([] [x] [x y] [x y & zs]); Returns a lazy seq representing the concatenation of the elements in the supplied colls."

11:21 S11001001: &(doc assoc)

11:21 lazybot: ⇒ "([map key val] [map key val & kvs]); assoc[iate]. When applied to a map, returns a new map of the same (hashed/sorted) type, that contains the mapping of key(s) to val(s). When applied to a vector, returns a new vector that contains val at index. Note - index must be <= (count vector)."

11:21 S11001001: pick which is weirder

11:45 jonaskoelker: is there something like map-values which transforms {k v} to {k (f v)} (for all kv in that map)?

11:45 gfredericks: I bet flatland/useful has something like that

11:46 jonaskoelker: flatland/useful?

11:46 gfredericks: https://github.com/flatland/useful/blob/develop/src/useful/map.clj#L47

11:48 mfex: jonaskoelker, also (zipmap (keys m) (map f (vals m)))

12:01 pandeiro: why doesn't slime allow an already defined var to be redefined?

12:04 mdeboard: pandeiro: because vars are static

12:34 pandeiro: mdeboard: you mean in slime or in clojure? the stock clojure repl allows it

12:38 * nDuff scratches his head over a "No single method [...] found for function" exception while trying to use a protocol, and posts to StackOverflow: http://stackoverflow.com/questions/10435480

12:43 dnolen: nDuff: protocols fn don't support &

12:45 clgv: dnolen: there should be an error message for '& in protocol function arguments - since it doesnt do what almost everyone supposes

12:45 dnolen: clgv: probably, but somebody needs to make a patch for that.

12:46 clgv: dnolen: and that somebody needs to have the CA signed...

12:47 dnolen: clgv: no better time than now.

12:47 clgv: it's only possible via traditional mail?

12:49 jweiss: any emacs experts know how to add another keyword to clojure-font-lock-keywords?

12:50 * gfredericks wonders what an "emacs sexpert" would be

12:50 dnolen: clgv: yep

12:53 beffbernard: jweiss: in clojure-mode.el just look for (defconst clojure-font-lock-keywords …) then add there

12:53 jweiss: beffbernard: yeah, i was hoping to add a line to my own emacs.d file, not try to changed a packaged file :)

12:53 but i assume "defconst" means what i think it means in elisp.

12:53 * nDuff tries to parse just how (doc extend-type) is using & and whether that's accurate

12:55 beffbernard: jweiss: not knowing what sort of effort is involved, just bust out the list of regexes out so you can append to it from outside

12:56 then submit the patch

12:56 jweiss: while i am asking sort of obscure questions, i am trying to run autodoc from leiningen, and use the :namespaces-to-document option. but no matter what i put there, it causes the tool to just skip everything. i tried a vector of strings, a single string with comma-separated ns's, a vector of quoted namespaces, a vector of namespaces. nothing worked.

12:56 beffbernard: right, a bit too much work just to see a single macro name highlighted :)

12:57 beffbernard: jweiss: they aren't highlighted already?

12:57 jweiss: beffbernard: the built in ones are, i want it to highlight one of mine :)

12:57 beffbernard: Try downloading the latest clojure-mode.el

12:58 from technomancy I believe

12:58 I'm pretty sure it does highlight macros

12:58 jweiss: beffbernard: how is that possible without slime? clojure-mode has no way to know what is a macro.

12:58 dnolen: nDuff: extend-type is macro, the & in the sig is unrelated to the fact that protocol fns don't support &

12:59 beffbernard: jweiss: let me see

12:59 technomancy: it doesn't highlight macros specially

12:59 amalloy_ would know more about adding forms to the highlighting; he implemneted that

13:00 nDuff: dnolen: ...not in the signature, but in the example usage.

13:01 ...shortening a bit, the docs include as an example: (extend-type MyType Foo (baz ([x] ...) ([x y & zs] ...)))

13:01 dnolen: nDuff: yeah that's misleading should be [x y ...]

13:05 jamii: user=> (defn var [] (Var. (swap! next-id + 1)))

13:05 #'user/var

13:05 user=> (var)

13:05 CompilerException java.lang.NullPointerException, compiling:(NO_SOURCE_PATH:20)

13:05 user=> (Var. (swap! next-id + 1))

13:05 #user.Var{:id 4}

13:05 user=> (var)

13:05 CompilerException java.lang.NullPointerException, compiling:(NO_SOURCE_PATH:22)

13:06 um....

13:06 Am I just being dense or is that weird?

13:06 beffbernard: weavejester: ping

13:06 gfredericks: jamii: you want it to make a new var for you?

13:06 or a better error message?

13:06 jamii: gfredericks: not a clojure var

13:06 (defrecord Var [id])

13:07 I don't understand why calling the function gives a NullPointerException but calling its body works fine

13:07 gfredericks: jamii: did you (defn var ...) somewhere?

13:07 jamii: gfredericks: ^^^

13:08 gfredericks: jamii: why would (defrecord Var [id]) allow you to call (var)?

13:08 they are spelt different

13:08 jamii: That was a multiline paste, did you only get part of it?

13:08 gfredericks: oh yeah

13:08 use refheap.com

13:08 dnolen: jamii: var is a special form, you cannot redef it.

13:08 hiredman: also, since (var ...) is a clojure special form you can never call something named var like that

13:09 gfredericks: jamii: what dnolen and hiredman just said is what I was getting to

13:10 jamii: Oh 'var' is a function which I defined but '(var ...)' is a special form.

13:10 I wondered about keywords but I thought it was ok at first because

13:10 user=> var

13:10 #<user$var user$var@329f14c3>

13:10 Thanks

13:11 gfredericks: jamii: the compiler short-circuits if it sees a special form at the front of a list, no matter what you've def'd anywhere

13:11 jamii: gfredericks: Yep, that confused me for a while.

13:15 nDuff: mefesto: ...by the way, I didn't read you as suggesting everyone define their own EOF, but doing the (def EOF (Object.)) thing seems unnecessary when we have ::EOF

13:21 TimMc: nDuff: (Object.) is a better sentinal because it is *impossible* for another non-`identical?` copy to appear in a data stream.

13:24 gfredericks: TimMc: and statically typed languages are better because it is *impossible* to call a function with the wrong type

13:24 the-kenny: It's really annoying when the functions of the same protocols differ for Clojure and Clojurescript.

13:24 (Example: ILookup: valAt vs -lookup

13:25 dnolen: the-kenny: except Clojure on the JVM isn't built on protocols - it's built on Java Interfaces.

13:25 the-kenny: dnolen: Yeah, I know

13:26 dnolen: I just think the implementations should match as much as possible. I'm currently cross-compiling a "big" codebase and want to replace a defrecord with a custom defprotocol overriding ILookup, Indexed and some other stuff

13:27 gfredericks: TimMc: (just trolling)

13:27 TimMc: gfredericks: (I know)

13:27 I'm more awake now.

13:27 dnolen: the-kenny: it would be nice, but I think many of the decisions in CLJS are about getting Clojure "right".

13:28 the-kenny: you might want to take a look at the library cljx that lynaghk` created

13:29 lynaghk`: dnolen, the-kenny: right now there aren't any rewrites for protocol implementation names, though I'd like to have that functionality in the future. I'm not sure if it's possible using the core.logic rules or if there will need to be another matching system.

13:30 the-kenny: dnolen: Thanks, I will

13:30 dnolen: Oh btw. your familiar with Closure? My team ran into a few problems with data-attributes at a hackathon last weekend

13:31 dnolen: lynaghk`: btw, I think I've got the foundation for big improvements across the board for ClojureScript.

13:31 the-kenny: I don't use the Closure much, pretty much all my CLJS work is on the compiler

13:31 lynaghk`: dnolen: wooooo! I spent four hours sketching out a profiling system yesterday, btw.

13:32 dnolen: lynaghk`: nice we really need a comprehensive set of benchmarks to track performance / regressions

13:32 lynaghk`: dnolen: I will try to get it polished up and out the door in a usable state early next week.

13:32 the-kenny: dnolen: Hm ok, nevermind then. Closure was just silently discarding calls to set attributes with a data-prefix

13:32 dnolen: lynaghk`: with pretty graphs in C2 I hope ;)

13:32 lynaghk`: dnolen: definitely

13:32 dnolen: lynaghk`: SWEET

13:33 lynaghk`: dnolen: what would the architecture look like, by the way? I sort of punted on long-term data storage and comparison across cljs revisions. Right now you tag bodies of code in cljs or js and it stores the results in localStorage

13:33 dnolen: the-kenny: like a bug in Closure?

13:33 lynaghk`: so you can reload the browser a few times to do multiple runs, then open up "viewer.html" and see the output.

13:33 the-kenny: dnolen: Yeah. We didn't have the time to track it down, but it was REALLY annoying

13:34 (We used jquery as a quick hack)

13:34 dnolen: the-kenny: strange - I'd like to move to a newer version of Closure (we're almost a year out of date) but someone needs to provide a comprehensive fix for browser REPL.

13:35 the-kenny: reproducible bug reports always welcome.

13:35 lynaghk`: why not just dump a Clojure data structure to a file that can be loaded?

13:35 the-kenny: I'm pretty sure it was a Closure Bug. Might be documented behavior, we didn't check

13:35 lynaghk`: dnolen: any interest in tag-teaming a talk/session on clj/cljs interfaces at StrataConf in October NYC, btw?

13:36 dnolen: too annoying to try and dump a file from the browser. What's in localstorage is just an array of maps though, so it wouldn't be too difficult to add new keys and serialize for more serious analysis if needed

13:37 mdeboard: emacsexpertsexchange.com

13:37 dnolen: lynaghk`: haha, I'm not sure I could talk that much about CLJ/CLJS interfaces (if by that you mean UI)

13:37 lynaghk`: true, I'm just thinking it would be nice to be able to share performance profiles somehow ...

13:37 the-kenny: dnolen: What's broken in browser REPL?

13:37 clojurebot: you mean clojure.main

13:38 dnolen: the-kenny: http://dev.clojure.org/jira/browse/CLJS-35, http://dev.clojure.org/jira/browse/CLJS-161

13:38 the-kenny: I mean we're not going to move to a newer version of Closure until these tickets get resolved.

13:39 the-kenny: ah

13:39 lynaghk`: dnolen: I'm sure you could talk about the expressiveness of Clojure, power of declarative programming, &c. &c. I've got a few full-stack clojure/clojurescript projects that strataconf folks would probably eat up.

13:39 dnolen: lynaghk`: I'm up for it!

13:39 lynaghk`: dnolen: boss. I'll throw something together this evening and send it your way. Maybe we can skype or phonecall sometime tomorrow?

13:40 dnolen: lynaghk`: sounds good.

13:41 lynaghk`: dnolen: we could submit a tutorial, or if you think we could round up jashkenas, mbostock, and hadley maybe we could do a straightup panel.

13:44 dnolen: lynaghk`: that could be fun!

13:45 pandeiro: is it possible to write a function that could used to 'autoload' a set of dependencies' vars into the current slime ns?

13:46 hiredman: require?

13:46 the-kenny: Just send a require call trough the repl

13:46 pandeiro: hiredman: to be able to use them unqualified?

13:46 the-kenny: use, then.

13:47 pandeiro: yeah (defn load-deps [] (use 'foo)) doesn't work, should it?

13:49 gah dunno why it wasnt working before, nm

14:05 _KY_: I want to read a clojure object from a string using "read-string" and know where the object ends within the string, any clue?

14:06 technomancy: _KY_: maybe call subs on the string?

14:07 _KY_: But sometimes the clojure object changes its appearance

14:07 For example, with "quote" and [1,2,3,4] ==> [1 2 3 4]

14:08 robertstuttaford: cemerick: LOVING this cast

14:08 S11001001: _KY_: make your own pushbackreader, pass it to read, and see what's left in the stream after read returns

14:08 robertstuttaford: conter clockwise rocks. sold.

14:09 cemerick: robertstuttaford: glad it's working for you :-)

14:10 robertstuttaford: i just love how little code you're writing

14:10 compared to gclosure (sure, different sorts of things, of course), it's miles apart

14:10 _KY_: Does counterclockwise use lein?

14:10 antares_: _KY_: it does

14:10 robertstuttaford: it doesn't need to, from what i can tell

14:10 antares_: at least there is an option to use lein from withing ccw

14:11 cemerick: it's an optional thing; the beta support plugin is solid though

14:11 you can use maven or manage everything manually if you're a masochist, I suppose

14:11 _KY_: S11001001: so I push back my string to a stream...?

14:13 nDuff: TimMc: certainly, but I'm not sure that protecting people from themselves when they're purposely bypassing safety mechanisms (in this case, namespacing) is a concept I can get behind.

14:13 TimMc: nDuff: What's the context on this, then? I can envision accidental collisions.

14:14 nDuff: TimMc: for ::EOF (in this case, :com.mefisto.wabbitmq/EOF)?

14:15 * nDuff has trouble seeing that happening accidentally.

14:15 robertstuttaford: the ccw leiningen support. is it an eclipse plugin in the marketplace?

14:16 TimMc: nDuff: I mean, what is the nature of the data being streamed?

14:21 Also, is there any possibility of attack? Do you always control the nature of the data flowing through the system, or can a third party choose it?

14:22 Really, my main concern is cognitive load -- if you use a proper sentinal, you don't have to think about any of this.

14:22 gfredericks: (inc TimMc)

14:22 lazybot: ⇒ 5

14:24 TimMc: The only downside I know of to (Object.) is that it doesn't support serialization. I think a randomly generated string could be an effective sentinal, a la MIME boundaries.

14:24 mefesto: TimMc: it would be used in the context of a BlockingQueue (as the terminator) so this value wouldn't be serialized

14:25 I think either approach would work. (Object.) is just the way I've always done it

14:25 _KY_: How can I create an instance of this: http: ? docs.oracle.com/javase/6/docs/api/java/io/PushbackReader.html ?

14:25 nDuff: TimMc: Makes sense. In my particular use case, the data will always be packaged by my own code even if it originally came from elsewhere, but that's not necessarily universally guaranteed.

14:25 gfredericks: _KY_: (java.io.PushbackReader. ...)

14:25 * nDuff mostly prefers namespaced keywords to (Object.) on account of the former being self-describing.

14:26 _KY_: http://docs.oracle.com/javase/6/docs/api/java/io/PushbackReader.html ?

14:26 TimMc: nDuff: I hear you on that.

14:26 gfredericks: (deftype Sentinal [name])

14:27 TimMc: heh

14:27 I don't think it's bad to use ::EOF in your own code, when you control the data. I just object to it being used as a default in a lib.

14:28 sattvik: ibdknox: Just noticed yout got a 10K supporter: nice.

14:28 acheng: hi :) if I have a string that contains the name of a variable (like "foo") can my code redefine the root binding of the variable? the following doesn't seem to work for me: (def (symbol "foo") 5)

14:28 nDuff: Hmm. If the library is extensible enough that others could implement its protocols, you'd need to export the sentinel object, and be open to exactly the same form of attack...

14:28 ...though that doesn't really apply in the immediate case.

14:28 ibdknox: sattvik: yeah, an interesting one at that. :)

14:29 gfredericks: acheng: I think what you're trying to do is change the root binding of a var

14:29 so you need to get the var

14:29 ibdknox: sattvik: I don't want to make an official announcement til I talk with them first

14:29 S11001001: _KY_: pushbackreader is required for a read call, and stringreader adapts a string to the reader interface with position-state

14:29 ibdknox: I know of a few others that should come in soonish as well

14:30 gfredericks: acheng: for day-to-day things that is a messy and ill-advised thing to do

14:30 _KY_: S11001001: do I need to create a Reader instance first?

14:30 sattvik: ibdknox: Sounds great. I'm considering whether or not to up my contribution. It seems like you have a good chance of making your 200K.

14:31 S11001001: _KY_: er, yeah?

14:31 ibdknox: sattvik: it seems pretty likely, yeah :)

14:31 _KY_: Oh, you mean create a StringReader and feed it to PushbackReader?

14:32 acheng: gfredericks: but I wants it! :-P I'm trying to create an interactive web test framework. if the code discovers that some html element locator is obsolete, I want it to help the tester discover a working locator so tests can continue.... and redefining the var for all running code would work for my case

14:32 gtrak: ibdknox do you talk about dealing with side-effects in lighttable yet? I'm curious about it

14:33 _KY_: Sounds very complicated....

14:33 S11001001: it's really not

14:33 gfredericks: acheng: yeah if you're doing something meta like that it's probably justifiable. Check out the ns-resolve function

14:33 acheng: ok

14:33 S11001001: however, you will probably want to create a unit test for your function that asserts that the post-expression whitespace consumption is exactly what you mean

14:34 (see READ and READ-PRESERVING-WHITESPACE in the Common Lisp spec for an explanation)

14:35 dnolen: ibdknox: wow!

14:36 _KY_: How exactly to create a PushbackReader?

14:36 TimMc: _KY_: gfredericks showed you, above

14:36 ibdknox: gtrak: nope, my thought is that the normal caveats that apply to a repl apply here as well. But I have some neat ideas about how that could be taken care of in a relatively clean and simple way

14:36 dnolen: :)

14:36 TimMc: 14:16 < gfredericks> _KY_: (java.io.PushbackReader. ...)

14:37 _KY_: So I create a new Reader inside that?

14:38 TimMc: Or pass it one.

14:38 (PushbackReader. foo) where foo is another Reader

14:38 acheng: gfredericks: hmm... def does not like its first argument to be a return value from ns-resolve

14:39 robertstuttaford: how do i get ccw/eclipse to complete ([{ for me?

14:39 ibdknox: gtrak: one way I was thinking about handling it was through a cool way of saying something is mocked in that context

14:39 gtrak: ibdknox: yea, it's interesting, pure functions are easy

14:40 hadn't thought about mocks, that could make sense and encourage a good programming style anyway

14:40 ibdknox: gtrak: to be honest, while the "coolest" I think that'll be one of the least valuable feature across all the languages.

14:41 just wait til you see the demo I have for the week before :)

14:41 gtrak: before the kickstarter deadline? :-)

14:42 ibdknox: yeah

14:42 it involves that verbose snake language ;)

14:42 gtrak: exciting

14:42 python you mean

14:43 ibdknox: yeah

14:43 mdeboard: ibdknox: Well you know how to raise money, aiming for Python

14:44 ibdknox: mdeboard: the goal is two-fold: prove that it works for a "real" language (the masses are dumb :p) and hit a larger audience

14:44 _KY_: Shouldn't I write (new java.io.PushbackReader)?

14:44 mdeboard: Yeah nothing wrong with that

14:44 robertstuttaford: not dumb, ignorant :)

14:44 ibdknox: haha fair enough

14:44 robertstuttaford: don't know many stupid python developers

14:45 gtrak: actually python is still a hard sell to the masses

14:45 mdeboard: robertstuttaford: Come over my way, I'll introduceyou.

14:45 robertstuttaford: -grin-

14:45 having said that, i only know like one or two and they're total polyglots

14:45 ibdknox: gtrak: Java would've been the best, also one of the hardest

14:45 and probably the least valuable really

14:45 the python crowd will be much more receptive to these sorts of things

14:46 gtrak: dynamic langs are much more amenable to being dealt with in terms of text

14:47 sattvik: Yeah, Light Table would have an awfully hard time competing with the likes of Eclipse for Java.

14:47 ibdknox: yep

14:47 not worth it :)

14:50 * felideon abandons his nrepl.el fork

14:51 felideon: no point anymore!

14:51 pooya72: ibdknox: wouldn't a week before the deadline be to close to the deadline? for the python demo...

14:51 ibdknox: pooya72: based on previous kickstarters, no

14:51 most people decide within a week whether or not it'll be worth it

14:52 felideon: (i kid, i have no nrepl.el fork)

14:52 ibdknox: the key is for me to get it to as many people as I possibly can. If the demo is cool enough, that should happen somewhat on its own

14:52 pandeiro: ibdknox: do you have any trick for finding syntax errors when using noir's automatic view ns loading?

14:53 ibdknox: pandeiro: you usually get a stack on the first load

14:53 pandeiro: i am getting 'Parameter declaration hiccup.core/html should be a vector' but no lead where in my views it is

14:53 ibdknox: pandeiro: if you just save the file again and refresh you should see the trace

14:53 pooya72: ibdknox: yeah, good luck with it! glad you did the market research...

14:54 ibdknox: pandeiro: do you have a defpartial without a [] in it?

14:54 pandeiro: that's what that probably means

14:54 pandeiro: ibdknox: nice

14:55 ahh no i was trying to use defpartial with multiple arities

14:55 you can't do that? :)

14:56 ibdknox: ah, no, unfortunately it's not that smart

14:56 pandeiro: i also noticed recently defpartial also can't have a docstring... am i crazy for wanting to do that?

14:57 ibdknox: pandeiro: not at all, I think there's a magic macro somewhere that gives you the base stuff for creating your own specialized functions, but never looked into it - that might make a nice, relatively simple contribution to noir :)

14:58 pandeiro: ibdknox: awesome, i think that might be within my patching abilities :)

14:58 robertstuttaford: erk. how do i remove a parens with paredit-strict?

14:58 it won't let me kill one

14:58 gtrak: I always use M-s for that

14:58 dnolen_: mmarczyk: did you see my notes about satisfies?

14:59 carllerche: robertstuttaford: unbalanced??

14:59 lazybot: carllerche: Definitely not.

15:00 robertstuttaford: not unbalanced. thanks gtrak

15:00 TimMc: ah, splice?

15:01 acheng: robertstuttaford: if unbalanced and in emacs with paredit, you can set the mark, highlight, then cut.

15:01 gtrak: yea, that's like pretty much all I know how to use at this point :-), M-s and C-Right and C-Left

15:01 TimMc: gtrak: M-x paredit-convolute-sexp

15:01 Learn it. Live it. Love it.

15:01 robertstuttaford: um. i'm using eclipse

15:01 carllerche: gtrak: what i did to learn paredit was read the docs for every emacs function that started w/ paredit-*

15:02 gtrak: carllerche: yea, I tried to learn emacs top-down once, haha, doesn't work for me

15:04 convolute sexp? wtf is that

15:04 TimMc: Hard to describe. Basically, it allows you to turn a nested expression inside out.

15:04 gtrak: ha

15:05 TimMc: gtrak: If your point is at the beginning of line 12, here: https://refheap.com/paste/666#L-12 ... then that command puts the let outside the for.

15:05 gtrak: I see, so I could be somewhere within a sexp and decide I need a 'let', just type it and convolute?

15:06 TimMc: Sure, that could work. I've only used it where the nesting is already backwards. :-)

15:06 gtrak: that is pretty nice

15:06 amalloy: convolute is the best, man

15:06 (fn [x] (let [y] ...)) => (let [y] (fn [x] ...))

15:07 oh, TimMc already showed that. links are no fun to click on

15:07 gtrak: I bet there are some gymnast paredit users out there

15:08 acheng: hm. so how can I either change the root binding of a var or reset! an atom if all I have is a string that contains the name of it? neither of these work for me... (def (ns-resolve *ns* (symbol "foo")) new-value) .... (reset! (atom (ns-resolve *ns (symbol "foo"))) new-value)

15:09 gtrak: the name of it being the var bound to it?

15:09 amalloy: that sounds a lot like a thing you shouldn't really want to do. why do you have a string representing a var you don't know what it is?

15:09 acheng: see 18:22

15:10 amalloy: i wasn't here and am not in your time zone anyway...?

15:10 acheng: I'm trying to create an interactive

15:10 web test framework. if the code discovers that some html element

15:10 locator is obsolete, I want it to help the tester discover a working

15:10 locator so tests can continue.... and redefining the var for all

15:10 running code would work for my case

15:11 amalloy: i dunno. still sounds like a bad idea to me, but the function you want is alter-var-root

15:12 acheng: what is the better idea?

15:12 amalloy: i don't really understand what you're trying to do, so feel free to ignore my vague prejudices

15:15 acheng: this is for when a test that is driving a web browser tries something like (enter-text element-locator "hello") and the value for element-locator is now incorrect since some developer changed the web page a bit... my framework would pause the test and let the tester poke around and find the new locator... the alternative (which the rest of the selenium world lives with) is that the test dies, you get a stack trace, the browser and the

15:15 page are gone and the tester has to manually get to the same point in a new browser before he can poke around

15:18 (did i just kill the ambiance?) :-P

15:20 _KY_: PushbackReader can only unread an integer, doesn't accept a Clojure string, what's wrong?

15:22 TimMc: acheng: Sounds like a condition system.

15:23 acheng: TimMc: sure. once the tester knows the right value to use for element-locator, is there something better i should do instead of just changing the root binding for all running threads to use?

15:25 right now these locators are vars (instead of items in a map) so that the tester has symbol completion in emacs when hand-editing tests

15:26 TimMc: Sounds like you want something threadsafe, though.

15:26 _KY_: Ok.. I figured I have to use (char-array)... problem solved

15:26 acheng: why threadsafe? these locators are basically supposed to be correct constants for all threads to use as constants.

15:27 solussd__: does clojure 1.4 still depend on java 1.5 ?

15:27 acheng: the rest of the selenium world has x % of all their tests fail simply because some element locator was wrong.

15:27 jonaskoelker: what's the go-to parser generator for clojure?

15:30 acheng: TimMc: so if i have 5 threads and 3 of them pause because of the same incorrect element locator, i can fix the locator for all threads and tell each one to try their currently failed test step again. thread safe doesn't quite sound like the right thing for my use case

15:30 antares_: solussd__: clojure 1.4 should still support Java 5 as far as I know

15:31 solussd__: excellent. I thought I remembered reading somewhere it targeted 1.6, but maybe not.

15:31

15:31 TimMc: acheng: Hmm, you might be able to get away with that. :-)

15:32 acheng: I wonder if you can work a watcher in there somewhere.

15:32 acheng: TimMc: yes, but if there is a better way that doesn't go against people's instincts, then i shouldld consider it. hm... watcher...

15:32 dnolen_: jonaskoelker: not sure if there's a goto lib for that. https://github.com/richard-lyman/amotoen looked promising but hasn't been updated in 4 months.

15:34 hiredman: /win 15

15:35 pardon me

15:35 _KY_: S11001001: thanks, your solution is ingeneous =)

15:36 S11001001: _KY_: you're welcome, and congrats on implementing the generalization of read-string

15:41 fdaoud: ibdknox: I showed LT to a friend of mine and he said, "meh." Can't win 'em all, I guess. BUT he thought it was really cool that you met Sussman. Go figure :)

15:42 what does ibdknox mean, by the way?

15:42 acheng: TimMc: I think I'll be ok without a watcher. All threads should use the new value and they don't need to know that it's new. (But if it sounds like I'm missing something, I'm all ears)

15:52 felideon: fdaoud: I said 'meh' until I tried setting up a Clojure environment. :D

15:52 pandeiro: is it possible to expand a sequence into separate forms?

15:53 amalloy: if i've understood the question, pandeiro, no

15:53 pandeiro: amalloy: and i also can't do something like (apply fn [params body]) right?

15:54 mefesto: nDuff: ping

15:54 raek: pandeiro: you can rewrite the expression in arbitrary ways using a macro

15:55 Licenser: I am so torn apart, I have a project in clojure that compile to node.js but the whole compiling to node is a horrible (especially since the environment I deploy it is very restricitive) thing and node's stuff isn't fun either (gazillion callbacks). So I am pondering of rewriting the code in erlang but then agian it is often so beautiful to write in clojure -.-

15:55 fdaoud: felideon: depends on the environment you tried to set up..?

15:55 pandeiro: raek: yeah i thought about destructuring but there could be a variable number of items in the seq, not sure how to do it

15:57 raek: pandeiro: can you show an example of what your input is and what the desired result is?

15:57 but yes, you cannot apply special forms and macros

15:58 felideon: fdaoud: slime+emacs with an existing slime config

15:58 emezeske: Licenser: What's so hard about compiling clojurescript to node?

15:59 gtrak: how can you reference the 'class' of a record without importing it?

15:59 felideon: fdaoud: granted, I had no idea who Chris Granger was and it was just a blog post. when I saw he was serious and had a track record then my interest was piqued.

15:59 pandeiro: raek: i am thinking about how to get all of fn/defn's argument parsing goodness (multiple arities, docstrings, meta) with a custom function defining macro

15:59 fdaoud: felideon: ah. I set up vimclojure using https://github.com/daveray/vimclojure-easy, nice.

16:00 nDuff: mefesto: pong

16:00 Licenser: emezeske that error messages are cryptic, the code is close impossible to debug if something goes wrong in runtime, and it seems node.js programmers get payed per callback function not per hour

16:00 also bundeling all the required libraries with the project is a hackery

16:00 emezeske: Licenser: Oh, so it's not compiling that's the problem, it's after that

16:00 raek: pandeiro: so you want something like (my-defn <whatever>) to be equivalent to, say, (def (some-operation (fn <whatever>)))?

16:00 Licenser: emezeske unless somethign goes wrong during the compilation :)

16:01 dnolen_: Licenser: you could submit a patch to add source mapping to ClojureScript ;) then you could debug your running node.js app w/ a browser

16:01 amalloy: pandeiro: clojure.tools.macro/name-with-attributes

16:02 dnolen_: Licenser: also you could adapt cjfrisz TCO code to do gen callbacks automatically.

16:02 Licenser: dnolen_ I would if I had 42 hour days!

16:03 but I first would patch in something like line number/file names in compiler errors :P

16:03 dnolen_: Licenser: that's what source mapping does.

16:03 Licenser: there is nothing like searching 42 (the number isn't made up :P) source files for a syntax error

16:04 gtrak: likewise, how do you extend a protocol to a record in another namespace?

16:05 Licenser: dnolen_ doesn't source mapping applie to run time code?

16:05 dnolen_: Licenser: yes, are you talking about ClojureScript compile time errors?

16:05 Licenser: dnolen_ both

16:06 Exception in thread "main" java.lang.IllegalArgumentException: let requires an even number of forms in binding vector <- for example

16:06 it would really be cool to see where :P

16:06 dnolen_: Licenser: patch

16:07 Licenser: there we are with the time problem again

16:07 dnolen_: Licenser: if you use CLJS master, I've included file + line number for some common mistakes.

16:07 Licenser: oh that is cool

16:07 mefesto: nDuff: been playing around with a few ideas. could i get your opinion on something?

16:07 dnolen_: Licenser: you're probably wasting more time hunting errors.

16:08 Licenser: heh there you might be right

16:08 daniel: maybe someone here can help me with this http://stackoverflow.com/questions/10435310/ray-attacks-on-a-bitboard

16:09 Licenser: but the compile time errors are just very frustrating not time consuming :) paredit / compiling often is a good way to protect against them most of the time

16:09 dnolen_: Licenser: so you can subject yourself to those frustrations over and over again or do something about it.

16:10 Licenser: dnolen_ I hate to admit but you are right about that

16:10 emezeske: Licenser: So your options are cljs on node, or erlang, but not just regular old clojure?

16:10 * devn gives Licenser some rope

16:10 Licenser: devn that is a good plan

16:11 gfredericks: does implementing the rules of chess in core.logic sound totally insane?

16:11 devn: heh

16:11 gfredericks: not really

16:12 gfredericks: okay.

16:12 * gfredericks is gonna go for it

16:12 Licenser: emezeske I am working on something for SmartOS (the hypervisor part) and I don't want to demand extra dependencies. cljs was my first pick since a lot of the libraries there are already written in node, also I don't require extra dependencies safe for packing a directory with some additional libs. Erlang would be a choice since I write some other parts of the code in erlang already and also OTP applications bundle in a senfcontained manner -

16:12 not forcing any kind of dependencies

16:12 fdaoud: gfredericks: "N-Queens problem? Too easy!"

16:12 gtrak: hmm, it seems rather warty that have you to java-import a record to extend a protocol to it

16:13 devn: gfredericks: http://www.fraber.de/games/chess/

16:13 gfredericks: fdaoud: I'm interested in running chess backwards

16:13 fdaoud: gfredericks: "mate check! .... .... ... e4 to pawn."

16:13 daniel: lol

16:14 gfredericks: fdaoud: I'd like to be able to concoct bizarre positions and ask the computer if they are possible to reach

16:14 fdaoud: gfredericks: oic, that's interesting

16:15 amalloy: gtrak: you have to java-import a record to do anything at all to it, so...

16:15 emezeske: Licenser: I see. One thing I'd throw out there is "lein uberjar"; AFAIK it makes a totally self-contained thing that you can just run with java. Maybe not feasible for your situation, though.

16:15 gfredericks: e.g., I wonder if it's possible to swap the positions of the two sets of pawns

16:15 Licenser: emezeske yea true, but it still requires me to deploy java with it

16:15 gtrak: amalloy: well we have factory functions now

16:16 Licenser: also clojure combines the disadvantages of erlang and clojurescript /in this case/ (as silly as it sounds) it brings some advantages over clojurescript too true

16:16 gtrak: you just need to require the ns to use the factory function

16:16 gfredericks: gtrak: would you like if (defrecord Foo []) included a (def Foo-type Foo)?

16:16 (would that work?)

16:17 fdaoud: gfredericks: cool, so to test your solution, any given problem from a chess book that refers to a game that really took place, should work with your program.

16:17 gtrak: something like that, or just maybe (def Foo Foo)?

16:18 gfredericks: fdaoud: yep; and certain situations you can prove to be impossible should not work, in some manner or another

16:18 gtrak: oh hmmmmmmm; that looks real weird but maybe would work.

16:18 dnolen_: Licenser: http://dev.clojure.org/jira/browse/CLJS-237

16:18 gfredericks: probably would screw a lot of things up though

16:18 gtrak: I just get annoyed it screws up my M-. nav to use java imports

16:19 plus it's just gross

16:19 dnolen_: Licenser: looking more closely it looks like *ns* is not being communicated to the various macros.

16:20 Licenser: Oi

16:24 gfredericks: I'm not sure I get why the conde clauses are considered to have a "head" and a "tail"

16:24 what makes the head different from the remaining parts?

16:25 dnolen_: gfredericks: it makes a difference when using conda|u

16:25 gfredericks: dnolen_: but not conde?

16:26 dnolen_: gfredericks: yes, makes little difference there.

16:26 gfredericks: are conda|u part of minikanren? I'm now wondering why the reasoned schemer makes the distinction

16:26 dnolen_: gfredericks: it does

16:26 gfredericks: conda|u are described in TRS

16:26 gfredericks: okay; sense has been made; thx

16:34 Raynes: ibdknox: Dude! You're 30 thousand away.

16:34 If you don't make it at this point, the world is not fair.

16:35 dnolen_: Licenser: fixing now

16:35 ibdknox: Raynes: it's very unlikely it doesn't :)

16:35 Raynes: ibdknox: Someone pledged 10k!

16:36 ibdknox: yeah, hopefully I'll announce them tomorrow :)

16:36 fdaoud: Raynes: if he reaches $200,005 and stops there, I'm reducing my contrib by $10 at the last second.

16:36 Raynes: fdaoud: lulz

16:36 dnolen_: Licenser: BOOM, https://github.com/clojure/clojurescript/commit/29b85c289feaac6b4feca91e24d08cdc88ea7da1

16:37 Licenser: dnolen_ sweet :) you are great and I feel ashamed

16:37 dnolen_: Licenser: make sure you use Clojure 1.4.0 in your project

16:40 TimMc: gfredericks: There are also "implausible" situations -- board positions that are reachable if the two players cooperate, but will never happen because they involve one or both players opening themselves to attack.

16:41 So you'll want to implement a crude chess AI in core.logic as well.

16:41 gfredericks: TimMc: those I'm not interested in distinguishing from reachable

16:41 since there's no firm definition there

16:41 * gfredericks hates gray areas

16:42 TimMc: So, as long as no one moves into check or whatever?

16:42 gfredericks: any legal sequence of moves, right

16:42 TimMc: Does chess allow passing on a turn?

16:42 gfredericks: programming chess involves a lot of edge cases :/ a move can almost always be represented as a pair of squares

16:42 TimMc: nope

16:42 $google chess zugzwang

16:42 lazybot: [Zugzwang - Wikipedia, the free encyclopedia] http://en.wikipedia.org/wiki/Zugzwang

16:43 TimMc: You could probably explain that term to me before WIkipedia loads.

16:43 gfredericks: it is a position where you'd prefer passing if that were legal

16:43 technomancy: I've been wanting to finish up a go implementation since clojurewest

16:44 gfredericks: I bet go rules are a lot simpler than chess rules

16:44 TimMc: hella yes

16:44 You can play Crosscram instead. :-P https://github.com/baznex/crosscram

16:45 Some of us at BAZNEX have been writing bots to compete at that game.

16:45 fdaoud: gfredericks: zugzwang, that's interesting.

16:46 gfredericks: fdaoud: the Trebuchet shown in that article is what I think of as the canonical example

16:47 maybe just because it's easy to remember

16:49 gtrak: when we say local extension of protocols, does that mean only for your namespace, or for all code that you call from your namespace as well?

16:52 technomancy: gfredericks: the cool thing about nearly any board game is that it's just a reduce of the board state over a seq of moves

16:52 which helps a lot for calculating possible move trees, etc

16:53 gfredericks: technomancy: it's determining legality that gets hairy

16:53 technomancy: totes

16:53 I guess with ko you have to keep one past board state when calculating the legality of a move

16:53 gfredericks: mostly it's a few weird moves and also the logic of check

16:54 technomancy: plus you have to have access to the past move to detect two successive passes for endgame

16:54 gfredericks: technomancy: is this go? or something called "ko" that I haven't heard of?

16:54 technomancy: ko is one of the rules of go

16:55 http://en.wikipedia.org/wiki/Go_(game)#The_ko_rule

16:55 Raynes: amalloy is better than me at Go. :(

16:55 gfredericks: xmonad will not let me select that link

16:55 Raynes: He forced me to play him several games at the Conj. I

16:55 lost all of them.

16:56 gfredericks: I guess I can google it

16:56 Raynes: I went to my room and cried into a pillow.

16:56 technomancy: gfredericks: xmonad or your irc client?

16:56 gfredericks: technomancy: something between xmonad and urxvt

16:56 amalloy: you did that every night, though. i just tried to cheer you up afterwards with go

16:56 Raynes: His IRC client unless xmonad took away his mouse.

16:56 gfredericks: I cannot select anything in the urxvt window

16:56 technomancy: gfredericks: are you using urxvt-perls?

16:56 mmarczyk: dnolen_: yeah, I've seen your comments -- will try and act on them too :-)

16:56 technomancy: gfredericks: highly recommended

16:56 gfredericks: technomancy: is that a debian package?

16:57 * gfredericks googles

16:57 technomancy: gfredericks: I'd link you to the github page, but you know... chicken/egg

16:57 fdaoud: Raynes: and while you cried, amalloy ate a pint of bacon in victory.

16:57 amalloy: technomancy: i think a lot of board games are a reduce of the board over a seq of moves...except most games have one or two niggling exceptions that ruin everything

16:57 technomancy: gfredericks: url-select in particular

16:57 amalloy: yeah, I think you can handle most exceptions by putting metadata on the board

16:58 gfredericks: technomancy: k cool thx for the tip

16:58 the chess FEN notation has a few extra pieces of information to capture the niggling exceptions

16:58 amalloy: metadata doesn't feel right, since most cases will need the metadata every time; i'd rather reduce over a map, one of whose keys is the board

16:58 gfredericks: e.g., who is allowed to castle

16:59 amalloy: that's how I'm doing it. a position has a board

16:59 technomancy: amalloy: the cool thing about reducing over the board is that if the board's big enough then pprinting it is all you need for display

16:59 very convenient in the repl

17:02 gfredericks: technomancy: probably a lot of the niggling things aren't typically displayed

17:03 technomancy: gfredericks: they certainly aren't in a physical game =)

17:03 well, captured pieces would be actually; hmm

17:04 gfredericks: in chess those aren't relevant

17:07 devn: gfredericks: im jealous of your xmonad

17:07 gfredericks: it's buggy

17:07 devn: wha!?

17:08 gfredericks: I wouldn't uninstall it though

17:08 dnolen_: mmarczyk: excellent

17:08 gfredericks: devn: there there now, I'm sure it's not technically the proven xmonad which is buggy

17:08 devn: i have never crashed xmonad, but ive seen it behave weird depending on the kind of window and/or get crazy when i tricked out my config with all manner of layouts

17:08 technomancy: xmonad has no bugs. ghc has proven this.

17:09 devn: lol

17:09 gfredericks: devn: if you have used xmonad then why are you jealous of mine?

17:09 devn: because im on OSX

17:09 * devn angry face

17:09 mmarczyk: dnolen_: your changes to satisfies? rock, btw

17:09 dnolen_: the WIP patch rebased onto current master w/ added bool-expr hint actually seems like a perf regression when compared to master :-/

17:10 dnolen_: mmarczyk: yeah the hasOwnProperty test was a terrible idea and I take full responsibility :)

17:10 gfredericks: devn: I'm about to be given a mac at the new job; will look into installing linux on it and installing a tux sticker over the apple logo

17:10 mmarczyk: dnolen_: :-)

17:11 devn: gfredericks: ha :)

17:12 technomancy: gfredericks: I was using xmonad/debian on a vbox on a macbook for a few days and I could never get over having meta in the wrong place

17:12 gfredericks: technomancy: you could not rebind the keys?

17:13 technomancy: I couldn't figure out how to do it in OS X, but you could probably do it just inside the VM

17:13 I guess you can retrain your thumb if it's the only machine you're using though

17:13 mmarczyk: dnolen_: so if I understand correctly, the next step is to change protocol methods to do the bit-and thing like satisfies? does? the consumer-facing wrappers (seq, first etc.) already do nothing except nil check & delegate

17:13 gfredericks: that would not be the case

17:13 hiredman: my brain rebels against the idea of getting a non-apple laptop, then I think I just need emacs and a browser, then I remeber I am using a bluetooth headset to listen to music, and the back and forward buttons on the headset "just work" and wonder how many hours that would take

17:14 lynaghk`: technomancy: you seem to hack the hardware a lot. Any interest in taking a month or two sabbatical from work to CNC the ultimate laptop out of bamboo + eInk?

17:14 dnolen_: mmarczyk: I don't think protocol methods can benefit.

17:14 gfredericks: hiredman: gotta pick your battles; can't be an idealist about everything

17:14 technomancy: lynaghk`: you should have caught be before I got a new laptop yesterday =)

17:14 dnolen_: mmarczyk: next steps are just reviewing which things are better implemented by following RT.java's lead.

17:15 mmarczyk: dnolen_: well currently (seq ...) calls actually seem to take a hit

17:15 dnolen_: (seq ...) being just (when coll (-seq coll))

17:15 hiredman: gfredericks: and listening to daft punk on a wireless headset is the most futuristic thing in the world

17:15 lynaghk`: technomancy: this one would be a year or two out anyway.

17:16 technomancy: bamboo + aluminium + eInk. Kickstarter will flip its shit =P

17:16 technomancy: renewable!

17:16 mmarczyk: dnolen_: but yeah, I'll try benchmarking the RT-like reimpl of first & a few other fns

17:17 TimMc: Only if it is farmed bamboo.

17:17 Isn't China running out of the stuff?

17:17 lynaghk`: TimMC: each bamboo will be lovingly raised at urban farms in PDX. They will have names.

17:18 TimMc: :-)

17:18 lynaghk`: Has to have the same screen as the XO-1

17:18 emezeske: lynaghk`: Can I visit the bamboo farm? I want to see where the bamboos are raised

17:18 dnolen_: mmarczyk: look at RT.java seq

17:18 TimMc: I've never seen anything else like it.

17:19 dnolen_: mmarczyk: if we have a seq we don't need to call -seq

17:19 mmarczyk: dnolen_: right, of course

17:20 dnolen_: mmarczyk: so many code paths will get lighter if we have satisfies? competitive with JS instanceof

17:20 mmarczyk: dnolen_: sounds exciting :-)

17:20 lynaghk`: emezeske: frequent visitors scare the bamboo! We have fairly-traded team of old Asiatic men that nurture them.

17:20 dnolen_: mmarczyk: under advanced compilation we can store all the known protocols into partitions of 32

17:21 emezeske: lynaghk`: hahaha :)

17:21 dnolen_: mmarczyk: types will store a int value for each partition they belong to.

17:21 mmarczyk: dnolen_: I see what you mean

17:21 dnolen_: ok, I'll work that into the next patch

17:22 jodaro: free range organic bamboo?

17:22 mmarczyk: ok, need to dash for now, will be back with some new code soon

17:37 jodaro: heh

17:38 there are no listings on functionaljobs.com

17:38 amalloy: jodaro: they forgot to make the page mutable

17:38 jodaro: heh

17:39 i was considering posting one there

17:39 i can't decide if no other listings is good or bad for that, though

17:40 also, a little bit of pickled ginger with a dab of wasabi that just happens to have some of my sriracha and soy sauce concoction on it ...

17:43 madsy: Stupid question: Why doesn't lazy-seq work together with recur? Clojure tells me that it's not a tail call when it is at the tail position :)

17:44 I assume I'm supposed to using actual recursion (by function name), but I'm confused over the semantics vs the syntax.

17:45 hiredman: lazy-seq wraps the body in a thunk (0-arg fn) which means recur won't work

17:46 TimMc: &(lazy-seq (recur))

17:46 lazybot: Execution Timed Out!

17:50 amalloy: madsy: you could use lazy-loop: https://github.com/flatland/useful/blob/develop/src/useful/seq.clj#L106

17:54 lynaghk`: dnolen: @krees from Periscopic just signed on to our lil' party.

17:55 er, dnolen_.

17:55 Chousuke: madsy: if you have a function that constructs a lazy sequence recursively, then you don't need recur for the recursion (and it wouldn't work anyway, since recur is not lazy)

17:55 dnolen_: lynaghk`: cool!

17:56 lynaghk`: you know all the cool datavis folks I see :)

17:56 * dnolen_ is a datavis noob

17:56 lynaghk`: dnolen_: do you work with jashkenas? you should invite him---I haven't emailed him yet

17:56 Chousuke: madsy: that's because if you're using lazy-seq right, calling the function does nothing but return an object representing the rest of the sequence.

17:56 * lynaghk` is also total datavis n00b. I'm just about at 1-year anniversary of Clojure though =P

17:56 dnolen_: lynaghk`: I do is there a specific idea behind this panel thing you want to put together?

17:57 lynaghk`: dnolen_: I'd like to keep it a little closer to the ground w.r.t. actionable tech for people who will be listening

17:58 dnolen_: I'm all about big ideas, but I like to be able to have something to bring home and play with at the end of a talk. Personally, I'd be interested hearing about the intersection of data/programming with storytelling and journalism

17:58 madsy: Chousuke: Yep, thanks :)

17:58 Chousuke: madsy: so when it looks like you're "looping" due to the recursive call you're actually not because no work is done until the thing that the function returns is evaluated

17:59 gfredericks: is the core.logic API documented anywhere, or do I just look through the source file?

17:59 madsy: Yeah, recur turns into iteration which does't stop until it takes a non-recursive branch. While lazy-seq only does a recursive call based on the realization of the seq.

18:00 Chousuke: yes, and by the time the evaluation happens the original call has already returned

18:00 Raynes: gfredericks: In dnolen_'s head, most likely.

18:00 Chousuke: so there is no stack growth issue

18:04 gfredericks: can logic variables represent numbers?

18:05 dnolen_: gfredericks: very poorly, you want cKanren

18:06 * gfredericks just noticed clojure.core.logic.arithmetic

18:06 dnolen_: gfredericks: which isn't for representing numbers relationally.

18:06 gfredericks: hmm. well I probably don't have to.

18:09 rmunn: I think what I'm having is a Java issue rather than a Clojure issue per se, but when I do "lein2 run" on my Clojure+SWT project, I get an error: Exception in thread "main" java.lang.UnsatisfiedLinkError: Cannot load 32-bit SWT libraries on 64-bit JVM

18:09 My project.clj specifies both [org.eclipse/swt-gtk-linux-x86_64 "3.5.2"] and [org.eclipse/swt-gtk-linux-x86 "3.5.2"] so I should have both 32-bit and 64-bit libraries available

18:10 Any idea why it's not selecting the 64-bit library? This only seems to happen intermittently -- sometimes it runs correctly -- and I haven't been able to pin down a pattern as to when it selects the 32-bit or the 64-bit library. I certainly haven't been changing my project.clj in between invocations of "lein2 run"!

18:10 dnolen_: rmunn: did you try removing the other one?

18:10 rmunn: why do you need to specify both?

18:11 hiredman: rmunn: most likely both jars define the same classes, so depending on the order they end up in the classpath it loads one or the other

18:11 rmunn: I was hoping to build a single version of the program that could run on both 32 and 64 bit machines. Am I going about that the wrong way?

18:12 hiredman: it's really a swt issue, they may just expect you to build a 32bit and 64bit version of your library

18:13 technomancy: rmunn: what you want is possible, it's just an issue with the way your dependencies are packaged

18:13 the native support for Leiningen is not well-documented unfortunately

18:15 rmunn: technomancy: Any idea how I should be specifying this? I grok Lisp a little bit, but my Java experience is almost non-existent so far.

18:19 gtrak: maybe use whatever dependency makes sense for the dev-dependency and then do some packaging tricks at the end?

18:21 rmunn: Okay, now I'm *really* confused. I just removed the 32-bit dependency lines out of my project.clj (so it now specifies only [org.eclipse/swt-gtk-linux-x86_64 "3.5.2"]) and I'm still getting the same "Cannot load 32-bit SWT libraries on 64-bit JVM" error. Weird.

18:22 technomancy: rmunn: I'm not 100% sure that the native bits will be removed correctly when a dependency is removed; try an explicit lein clean?

18:22 Raynes: I'd also like to point out that Swing is pretty approachable since https://github.com/daveray/seesaw.

18:23 rmunn: Nope -- "lein2 clean" followed by "lein2 run" with only the x86_64 libraries in :dependencies is still erroring. This is utterly bizarre.

18:24 I wish I could use Seesaw, but it doesn't yet work with SWT, and Swing just looks too ugly for me to want to inflict its UI on my users. (If I ever get this project finished, that is.)

18:24 Raynes: SWT isn't ugly? :o

18:24 Swing has a lot of different look and feels that might help.

18:25 rmunn: At least it looks native, which I haven't found to be the case even with Swing's allegedly "native" look & feel.

18:25 Raynes: Fair enough, I forgot that SWT used native stuff.

18:25 Too bad they suck at maven.

18:26 rmunn: My target audience (if that's the right term) for this project is naive users, who don't care about the internals of the computer but just want to use it as a tool to get work done. So the less distracting I can make my UI (and the more similar I can make it to the other programs they've already learned), the better.

18:27 cmcbride: I thought swing could mock a native UI http://www.exampledepot.com/egs/javax.swing/LookFeelNative.html

18:27 Raynes: "..which I haven't found to be the case even with Swing's allegedly "native" look & feel."

18:28 rmunn: Raynes: Exactly. I tried the native look and feel, and it didn't look a thing like the rest of the windows on my screen. (Ubuntu Precise with Unity, though I expect most of my users will be running Windows).

18:29 Raynes: Ubuntu with unity looks like shit anyways, so doesn't it fit right in? :P

18:29 rmunn: I should probably check what Swing's native L&F looks like on Windows before I commit too heavily to SWT, of course.

18:30 Raynes: No kidding. I'd love to go back to GNOME 2, but I do have to support users who will be on Unity, so I'd better use it myself so I know how to answer their "How do I do this task that used to be so simple?" questions...

18:30 gtrak: maybe try the qt bindings

18:30 jambi

18:30 Raynes: Yeah, I understand. I'm certainly not criticizing you. Just being silly. :)

18:31 Jambi makes REPL development a pain in the ass.

18:31 rmunn: Raynes: I didn't take it as criticism... though since you couldn't see the big grin on my face as I wrote that, I can see how you could have taken it that way. :-)

18:32 Anyway, back on topic:

18:32 technomancy: Does Leiningen have a --debug flag that I could use to see more output as I run "lein2 run"?

18:33 "lein2 version" prints "Leiningen 2.0.0-preview3 on Java 1.6.0_24 OpenJDK 64-Bit Server VM", in case you're wondering

18:34 Trying "lein run" (version 1.7.1) instead of "lein2 run" gives me the same java.lang.UnsatisfiedLinkError, too.

18:35 I think I'm going to give up for the day and see if I have any bright ideas in the morning.

18:35 gtrak: rmunn: if you want to package your own dependency, you can, using maven, not sure if they messed up somehow

18:35 rmunn: Is this IRC channel logged anywhere, BTW? I'd like to see if anyone comes up with the solution while I'm gone

18:36 hiredman: ~logs

18:36 clojurebot: logs is http://clojure-log.n01se.net/

18:36 rmunn: hiredman: thx

18:36 Raynes: rmunn: http://www.raynes.me/logs/irc.freenode.net/clojure/

18:36 These are more greppable.

18:37 rmunn: Raynes: thanks also.

18:41 ieure: technomancy, Known issue that Clojure 1.3 / contrib 1.1.0 / lein 1.7.1 / lein-swank 1.4.4. don't play well together?

18:42 Running `lein swank' produces Exception in thread "main" java.lang.RuntimeException: java.lang.NoSuchMethodError: clojure.lang.RestFn.<init>(I)V

18:42 If you remove contrib from :dependencies it works fine

18:42 technomancy: ieure: yeah, monolithic contrib is hell of deprecated

18:42 clojurebot: contrib?

18:42 clojurebot: Monolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

18:42 technomancy: ieure: any particular namespace you're interested in?

18:42 ieure: technomancy, Logging.

18:43 technomancy: clojurebot: google clojure.tools.logging

18:43 clojurebot: First, out of 21000 results is:

18:43 clojure/tools.logging · GitHub

18:43 https://github.com/clojure/tools.logging

18:43 ieure: Sucks. I heard it was getting broken up but it's non-obvious from googling

18:43 technomancy: ieure: bingo

18:43 ieure: Yeah, I see it now.

18:43 technomancy: yeah, it's definitely an annoyance, but the old contrib was the Wrong Thing

18:44 old misleading docs are the bane of any high-churn young language

18:46 rmunn: technomancy: Yeah, one of my biggest problems in learning clojure has been figuring out on my own where half the stuff is. I'd love more in-depth docs on Leiningen, for example. Not that that's a hint or anything. ;-)

18:47 jodaro: ieure: this was helpful to me re logging

18:47 http://corfield.org/blog/post.cfm/clojure-and-log4j

18:47 technomancy: rmunn: what specifically about leiningen? have you read through `lein help tutorial`?

18:47 ieure: This has been the single most helpful piece of leiningen documentation: https://github.com/technomancy/leiningen/blob/preview/sample.project.clj

18:48 Everything else has been very straightforward.

18:48 technomancy: ieure: also available via `lein help sample` fwiw

18:48 ieure: But finding explanations of what stuff can go in project.clj is kind of a pain.

18:48 Okay.

18:49 technomancy: ieure: you mean the comments in the sample are too terse, or it's hard to guess what they're called?

18:49 hiredman: s/log4j/logback/ of course

18:49 ieure: technomancy, No, the sample is fine. Locating the sample is not.

18:50 Looks like the situation has improved lately.

18:50 technomancy: yeah, we should probably mention `lein help sample` in more places

18:50 ieure: Search for "leiningen project.clj options" takes you right there.

18:50 technomancy: you're probably more likely to refer to it if you don't have to context-switch out of your terminal in some cases

18:53 rmunn: technomancy: Missed seeing the tutorial somehow *blush*, so most of my questions will probably be answered there.

18:53 technomancy: rmunn: open to suggestions on how to make it more obvious if you have any

18:55 ieure: actually even just "project.clj" in "I'm feeling lucky" is enough; cool

18:55 rmunn: technomancy: The only suggestion I have right now is that lein's way of documenting command-line arguments looks really odd to someone coming to Clojure from another language. It wasn't until I got used to seeing Clojure function definitions that I understood what that "Arguments: ([project-name] [template project-name & args])" line in "lein help new" meant.

18:57 ieure: technomancy, Yeah, I feel like when I have looked in the past I have tried more specific things which return less relevant results.

18:58 rmunn: Oh, and another suggestion. I run "lein help new" and see "Subtasks available: default, template, plugin". This makes me think that "lein help new default" will tell me about the general project template, while "lein help new template" will tell me about the meta-template system. But "lein help new default" gives "Wrong number of arguments to help task", which is unhelpful to a Clojure newbie.

18:59 Anyway, it's almost 6:00 PM here and I should be heading home. So I just wanted to close with thanks for making such a useful tool.

19:01 technomancy: ieure: yeah in general I'm the last person to suggest blindly following google results due to the magnitude of harm that causes with swank

19:02 just nice that it is improving on this particular metric

19:02 rmunn: yeah, we need to make subtask help work better. that stuff is pretty new

19:03 rmunn: for the args in general though I think following Clojure's conventions for arglists etc makes the most sense. Leiningen's audience by definition needs to know some level of Clojure

19:05 gfredericks: clojure prereqs: clojure

19:05 ^ this is what is meant by "clojure in clojure"

19:09 (run* [q] (fresh [x] (== {q 12} {:foo x})))

19:09 => ()

19:09 so logic variables can only be map values?

19:13 hiredman: gfredericks: that seems kind of odd

19:13 gfredericks: I was imagining some fuzzy performance justifications for it

19:14 hiredman: oh, but actually that makes sense

19:14 gfredericks: perhaps the concrete-keys case is much more trivial to implement/reason-about

19:15 hiredman: gfredericks: I don't think what you want there is possible

19:15 gfredericks: I also considered that but haven't thought of why that might be

19:15 my special case ought to be possible, right?

19:15 hiredman: because the two maps cannot be unified

19:16 there is no sort of "toe hold" of similarity to work with

19:17 I suggest using tuples or calling seq on your maps (to make a seq of tuples)

19:19 gfredericks: this wasn't part of a larger thing; I didn't know maps/sets were used, so I was seeing what you could do with them

19:20 hiredman: so map is like an ordered set of pairs

19:20 so the unifier can't tell from {q 12} and {:foo 1} that they are unifiable

19:21 gfredericks: oh sets are funny too: (run* [q] (fresh [x] (== #{q x} #{4 5})))

19:21 hiredman: #{[q 12]} #{[:foo 1]}

19:21 gfredericks: => (5)

19:21 hiredman: it make just call seq on sets (which seems like a bad idea)

19:21 may

19:22 gfredericks: that would certainly explain that result

19:47 hiredman: gfredericks: thinking about it it seems like you could unify maps like that, if you unifier could return multiple unifications, but I'm not sure

19:49 gfredericks: not knowing much at all about the implementation, it seems odd in the context of core.logic that the unifier can't

19:49 hiredman: which is not a feature I've seen in a unifier (not that I've seen many)

19:49 gfredericks: but perhaps not

19:50 hiredman: but there maybe other tradeoffs for that kind of thing, makes unifying maps much less exact

19:51 * hiredman has a toy datalog with a toy unifier

19:51 gfredericks: an unacceptably-awfully-performant way to do it would be given two maps, fail if different sizes; then (doseq [m1' (permutations m1)] (== m1' m2))

19:52 replace doseq with the logic version :)

19:52 hiredman: yeah, you'd get a possibly much larger search tree

19:52 gfredericks: I only just started on logic programming a week ago.

19:53 thinking about it, there might be a decent-performing way to get those semantics...

19:54 hiredman: it's neat, I played with core.logic a little a few times, but writing the datalog (outside of core.logic) really made the nature of the thing clear, searching a tree

19:55 gfredericks: I feel like I understand the components well enough, but doing anything non-contrived with them has been not easy

19:57 e.g., I feel like I ought to be able to write a program which, given a positive integer, returns s-expressions involving only + and *

19:58 I'm not sure if you can work with numbers that way in core.logic though

20:07 Frozenlock: I'm playing around with Incanter and notice that some functions use FileOutputStream (seemingly bypassing any binding attempt on *out*). Is there a way to redirect the stream?

20:39 How does one redifine a function from another namespace?

20:40 *redefine

20:40 gfredericks: alter-var-root

20:40 Frozenlock: I'll try that immediately, thanks :)

20:41 ibdknox: technomancy: does lein2 not respect ^{:skip-aot true}?

20:42 dnolen: mmarczyk: I wouldn't bother w/ benchmarking Rhino for this stuff. Rhino is indicative of JS performance circa early 2000s.

20:42 technomancy: ibdknox: not as far as I know

20:42 I mean, if it doesn't, it's a big

20:42 bug

20:43 ibdknox: hm, I just switched and I'm getting the aot'd compiler mess again :(

20:43 mmarczyk: dnolen: yeah, guess so; just replied to your comment to the effect that I'll be doing some benchmarks on node

20:45 dnolen: btw, did you have time to look at the 232 & 234 patches? + 225 is a bug fix, I think

20:46 dnolen: mmarczyk: 232 & 234 I'd rather not apply until the satisfies stuff gets sorted out. It'll only slow things down.

20:47 mmarczyk: dnolen: well, depends on the use case -- the linear helpers actually roll over to the "direct" impl which the current default does not do

20:47 dnolen: oh, sorry, reduce might actually do that

20:48 dnolen: but anyway, that's fair enough

20:50 dnolen: mmarczyk: any call to satisfies? slows down many code paths

20:55 wei_: I'm having trouble configuring log4j for a java library I'm using - it seems to always send messages to (and clutter up) the console, when I'd like to suppress them or send them to a file. any ideas on configuration? I'm using clojure.tools.logging and clj-logging-config.

20:55 cshell: what's in your log4j.properties?

20:58 mmarczyk: dnolen: so do you think the satisfies?-based versions can be made to be faster than extend-type default ?

20:58 wei_: clj-logging-config does the job of a properties file I believe, and I have (set-loggers! :root {:level :error :out "/tmp/errors.log"}). going to try additivity: false so my included library doesn't inherit any settings..

20:59 dgrnbrg: How do I determine is a symbol is namespace qualified?

20:59 mmarczyk: &(namespace 'foo)

20:59 lazybot: ⇒ nil

21:00 leo2007: lein help does not show swank as a task? do I need to install a plugin for that?

21:00 dnolen: mmarczyk: what do you mean?

21:02 weavejester: leo2007: Yep, there's a plugin called… swank-clojure I think...

21:03 leo2007: Oh, the plugin itself is called lein-swank

21:03 leo2007: https://github.com/technomancy/swank-clojure

21:03 mmarczyk: dnolen: well, if a protocol doesn't have a default impl, then either every type which it might make sense to call the related functions on should implement it (ICounted on LazySeq, say -- breaking the currently stated contract of ICounted, which of course could be changed) or the client-facing function needs a satisfies? check to see if it should delegate to -method or use some default approach

21:04 leo2007: weavejester: thanks, I just found it on clojars, lein-swank. I got swank running already but was using something swank-clojure installed in .lein/bin

21:05 dnolen: mmarczyk: protocol dispatch will never be as fast as a bit test via satisfies?

21:05 mmarczyk: we need to move tests above dispatching via protocols.

21:07 dreish: So is there just no longer any reasonable way to do low-level unchecked int (not long) math, like for computing a hashcode?

21:08 mmarczyk: dnolen: protocol dispatch now is a property lookup, which on failure is followed by a bunch of fallback property lookups (on the protocol method object), right?

21:08 dnolen: mmarczyk: null check + property existence check

21:08 leo2007: I tried 'lein plugin install lein-swank 1.1.0' and it cannot find the pkg.

21:08 mmarczyk: dnolen: right.

21:09 leo2007: I then tried lein plugin install leiningen/lein-swank 1.1.0, which seems to be downloading everything from some repo.

21:09 dnolen: mmarczyk: and you have to call the protocol fn

21:09 mmarczyk: satifies? is an inlined macro

21:11 leo2007: could someone tell me the command line to install lein-swank?

21:12 gtuckerkellogg: Has anyone here worked on the clojure entries for the Shootout computer language benchmarks?

21:13 mmarczyk: dnolen: so, if I understand correctly, you'd like to remove that whole "check if I'm applicable" business from protocol methods?

21:13 dreish: Oops, nevermind. I found them. Of course, I should have grepped the Clojure clj source for "hashCode" to see if there was an example.

21:13 gtuckerkellogg: I haven't looked at the entries in detail, but was surprised to see that the Clojure entries, when compared to Java, used more code. That just seemed impossible

21:14 or on average about as much code

21:15 dreish: gtuckerkellogg: Heavily optimized code can end up being lengthy. I think that tends to be true in any Lisp.

21:16 dnolen: mmarczyk: I'm not talk about changing anything related to protocols

21:16 talking

21:17 mmarczyk: except for tracking them for efficient calls to satisfies?

21:17 gtuckerkellogg: dreish, understood. But the performance was on average 4x slower than Java, and in once case 12x slower than Java.

21:18 maybe the shootout entries are just funky

21:18 dreish: Or Clojure is still incrementally approaching the ideal.

21:19 gtuckerkellogg: or that

21:19 mmarczyk: dnolen: ok, so that buys us not calling -seq on stuff if it's already a seq -- though such a call would presumably always return `this` -- at a cost of whatever it costs to call satisfies?, which will become a (possibly minor?) perf hit for things like -seq on non-seq seqables?

21:20 dnolen: mmarczyk: it allows us to adopt the code style in RT.java which is very perf-centric and highly optimizable by JS engines.

21:29 mmarczyk: there's an incredible amount of overhead in the code paths now.

21:30 cemerick: technomancy: sweet writeup! Will RT that tomorrow.

21:30 dnolen: mmarczyk: for example, I've been looking at optimizing rest fns by emitting arrays directly for rest calls.

21:30 mmarczyk: so for 1e6, going through JS arguments object takes 4ms or so.

21:31 mmarczyk: if we emit an array I saw around ~20ms

21:31 mmarczyk: calling first on the array sends timing to ~300ms

21:31 mmarczyk: that's unnacceptale

21:31 unacceptable

21:31 mmarczyk: dnolen: um wait, 4ms w/ arguments, 20ms w/ array?

21:32 dnolen: mmarczyk: no performance right now is like >2s

21:32 sritchie: dnolen: what's a good spot to look for cljs benchmarks?

21:32 dnolen: sritchie: there's no good spot yet.

21:33 sritchie: someone else at twitter asked me -- I told him "smoking fast"

21:33 mmarczyk: dnolen: oh, so did you mean 4ms for handwritten JS w/ arguments, 20ms for CLJS w/ array, 2s right now?

21:33 dnolen: sritchie: the persistent data structures yes, idiomatic Clojure not tyet.

21:33 mmarczyk: something like that

21:33 mmarczyk: dnolen: oh man, that is horrible

21:34 dnolen: I mean the current state of affairs, that 20ms array version needs to happen asap

21:35 dnolen: so how do you envision the code path for (first arr) ?

21:36 or would it be an ArraySeq

21:36 dnolen: mmarczyk: cheap satisfies, ArraySeq is already seq, direct call first.

21:37 mmarczyk: this is the whole point about fast satisfies? we can just duplicate rhickey's genious work on RT.java

21:39 mmarczyk: dnolen: well, switching to your impl of first (from the comment on the ticket) does result in a perf win on a list -- although I'm talking Rhino again :-(

21:40 dnolen: so then first on non-seqs will always take a hit and the hope would be that this can be very minor?

21:42 dnolen: mmarczyk: first on non-seqs take a hit in Clojure little difference.

21:43 mmarczyk: and only on first, subsequent calls fast

21:43 mmarczyk: dnolen: right

21:44 dnolen: that hit is like 25% though, but yeah, first call only

21:44 dnolen: mmarczyk: 25% is nothing when you're traversing anything but the smallest vectors

21:44 mmarczyk: dnolen: true

21:44 dnolen: mmarczyk: and I'm skeptical it's 25% on V8 or SpiderMonkey or JavaScriptCore

21:45 mmarczyk: dnolen: ok, so maybe a branch / patch converting stuff to the "RT.java style" w/ no modifications to satisfies? would be useful

21:47 dnolen: because actually the best perf for first on an ISeq I've seen is with the recent master + your impl of first

21:48 dnolen: mmarczyk: yep, I'm nearly positive adopting RT.java style will results in massive performance boost across the board w/ a fast satisfies?

21:49 mmarczyk: dnolen: that might be "macroifiable", (defn first [coll] (proto-call :proto ISeq :arg coll :method -first :fallback (let [s (seq coll)] (when s (-first s))))) (w/ the obvious impl of proto-call, possibly w/o the keywords)

21:50 (macroizable? hm)

21:51 dnolen: mmarczyk: no macros :)

21:51 mmarczyk: dnolen: oh come on :-P

21:51 dnolen: ;-) of course, but out of curiosity -- why?

21:52 dnolen: mmarczyk: it just cleverness with little gain. All the different code paths will be slightly different.

21:52 mmarczyk: dnolen: ok, guess you might be right

21:53 dnolen: *if* they turn out to be the same though I'll be sure to revisit this issue :-)

21:53 dnolen: ok, another thing -- satisfies? itself

21:54 dnolen: mmarczyk: even so, I'll probably say no to any macros for this stuff. the code paths will be generally small - the code should be clear - macros add nothing.

21:56 mmarczyk: dnolen: so I guess we can store the proto mask on the instances themselves -- which will guarantee the bits are set for inlined methods, but not for protocols the type has been extended to after an instance was created

21:57 dnolen: or put it on the prototype

21:58 dnolen: mmarczyk: we can deal with extend-type later

21:58 mmarczyk: let's just focus on making core fast for the time being.

21:58 mmarczyk: dnolen: ok

21:58 dnolen: satisfies? keeps the slower checks anyway, so it's not as if this could break things

21:58 dnolen: mmarczyk: yep! :)

21:58 mmarczyk: dnolen: :-)

21:59 dnolen: so we've got a cljs$lang$protocol_mask$ property on Clojure type instances

21:59 dnolen: (always -- even if set to 0)

21:59 dnolen: mmarczyk: we should think ahead just a bit - advanced optimization, there will be more than one mask

22:00 mmarczyk: dnolen: so now satisfies? gets that, does a bit-and against the statically looked-up bit

22:01 dnolen: sure, as long as this is for core protocols, that's not a problem at all

22:01 dnolen: mmarczyk: cljs$lang$protocol_mask$partition0?

22:02 mmarczyk: dnolen: sounds good :-)

22:02 dnolen: actually it's not a problem even if it's not only for core protocols

22:03 dnolen: the proto -> bit maps could be held in an atom -- new ones added there when new (defprotocol ...) is encountered or (extend-type SomeUnknownProtocol ...) (if that's even possible? but I guess it probably is now with declare?)

22:04 dnolen: mmarczyk: leats avoid atoms for now.

22:04 mmarczyk: lets deal with extend-type later :)

22:04 mmarczyk: dnolen: and of course the straightforward approach (best for now?) is to (def map1 ...) (def map2 ...) etc. in core.clj

22:04 dnolen: at any rate, should be easy to extend in this direction

22:05 dnolen: but what I wanted to get to: ultimately, satisfies? would use it by looking up the correct partition (statically determined, of course) and doing the bit-and

22:05 dnolen: mmarczyk: yep

22:05 mmarczyk: dnolen: so you think that's going to be faster than the native property lookup?

22:06 dnolen: mmarczyk: satisifies? currently looks up the prototype chain - slow

22:06 mmarczyk: it's not a property look up on instances

22:07 mmarczyk: dnolen: right

22:08 dnolen: it's 1 step away on success, more on failure -- but on failure we're going to do those checks anyway

22:08 dnolen: hm, I think it's 1 step?

22:12 dnolen: mmarczyk: in generaly failure will not be common.

22:12 mmarczyk: (seq 1) is silly

22:12 mmarczyk: dnolen: sure, I'm not worried about that

22:13 dnolen: but if I understand correctly, on success we're going to look up a property one step away in the chain, right?

22:14 ^find the property would be better wording, I guess

22:14 dnolen: mmarczyk: property lookup is fast, going up the prototype chain is not

22:14 foo.clj$core$ISeqable$ test needs to go up the prototype chain, it's not in the instance

22:15 mmarczyk: quick tests, bit test is like <10ms, prototype chain lookup >100ms

22:16 mmarczyk: dnolen: foo.meth != null with meth attached to foo.prototype ?

22:16 dnolen: for the > 100 ms timing?

22:17 dnolen: mmarczyk: yes w/ null test

22:17 mmarczyk: dnolen: ok

22:18 dnolen: well, that's very interesting, thanks

22:18 dnolen: I've got a much more complete picture now

22:19 dnolen: and I guess the bit-and check should be wrapped in bool-expr?

22:20 dnolen: (I'm switching to node for timings *right now*, btw -- satisfies? w/ bit-and is noticeably slower on Rhino, which it shouldn't be given this result)

22:21 dnolen: mmarczyk: wrapping bool-expr probably, though it's yucky

22:22 mmarczyk: i would ignore Rhino perf results on this stuff - it's based on my understand of modern JS engines.

22:22 okaygolferyo: (doc pmap)

22:22 clojurebot: "([f coll] [f coll & colls]); Like map, except f is applied in parallel. Semi-lazy in that the parallel computation stays ahead of the consumption, but doesn't realize the entire result unless required. Only useful for computationally intensive functions where the time of f dominates the coordination overhead."

22:23 mmarczyk: dnolen: did you have a moment to look at the WIP patch, btw? just curious if you think that version of satisfies? looks about right

22:23 leo2007: is collection always finite?

22:24 mmarczyk: dnolen: yeah, it's easy enough to test things on Node -- will do that from now on

22:25 dnolen: mmarczyk: will do in a bit.

22:26 mmarczyk: dnolen: cool

22:29 dnolen: ok, so I guess I'll go and implement this stuff -- partitioned bit masks for protocols, a version of satisfies? to go with them, RT.java-style ops (all that should avoid something like the extra call to seq in first)

22:29 dnolen: and get some perf tests done in node

22:30 dnolen: thank you for a very enlightening discussion!

22:45 cemerick: replaca: Looking at lein-autodoc; would you be interested in a pull req that brings it up to spec for use with lein2?

22:46 And, if so, do you want/need to keep lein1 compatibility (either flexibly, or perhaps the impls should split based on lein version)?

22:53 jweiss: anyone here know how to use autodoc? i can't get the standalone to run at all (errors out with classes missing from classpath). The lein plugin will run, but i want to specify :namespaces-to-document, but it won't accept anything. it will either document all the namespaces, or none.

23:17 njdirk: which signature is more idiomatic in providing a HTML body alternative to plain text (message subject body) -- forking clj-aws SES support: (html-message subject body) (message subject body :as-html)

23:17 dnolen: dreish: there's unchecked-add-int

23:18 dreish: Yes, I found it by grepping for hashCode in clojure/src/clj/. Thanks, though.

23:18 dnolen: dreish: also gtuckerkellogg left but test.benchmark for fast implementation of alioth benchmarks that are competitive w/ java that aren't overly verbose.

23:19 dreish: Interesting. They're not the ones that are listed at alioth?

23:22 mdeboard: Is there a better/safer way of reloading swank when I add packages to the classpath besides killing the *swank* buffer and running clojure-jack-in again?

23:22 dnolen: dreish: they are not, the current crop @ alioth benchmarks are not very good.

23:23 dreish: in the end I think the results will be pretty uninteresting - identical perf to Java for the most part.

23:23 technomancy: mdeboard: you could theoretically add the dependency using pomegranate, but nobody's plumbed through a nice interface to that via swank yet

23:24 mdeboard: but you can just re-run M-x clojure-jack-in; it'll kill the old swank for you

23:24 mdeboard: technomancy: Ahhh ok @ killing old one.

23:25 Doesn't seem like Eclipse has great handling of that either based off cemerick's screencast

23:26 technomancy: pomegranate is still very new

23:31 cemerick: what would such an interface look like at all?

23:31 mdeboard, technomancy ^^

23:31 I suppose adding a dep to project.clj could be picked up and added to the running classpath automatically? *shudder*

23:31 mdeboard: No, don't mean like that.

23:32 technomancy: cemerick: possibly some interplay between leiningen and the subprocess?

23:32 so you don't need leiningen-core as a dep of the project

23:32 but a first-run implementation would just dump lein-core in :deps in a profile

23:32 mdeboard: I just meant a simple reload command tbh :P F5 equivalent

23:32 technomancy: (leiningen.core.injected/recalculate-deps)

23:32 cemerick: pomegranate nREPL middleware? :-O

23:32 technomancy: sure =)

23:33 cemerick: an here I thought I was trolling ;-)

23:33 mdeboard: trolls trolling trolls

23:33 cemerick: Unsurprisingly, I'm probably the most skeptical person in the room re: add-dependency

23:34 mdeboard: I agree that automatically detecing changes and reloading automatically is cringeworthy

23:36 e.g. http://ipython.org/ipython-doc/dev/api/generated/IPython.lib.deepreload.html?highlight=reload#IPython.lib.deepreload.reload

23:37 cemerick: oh yeah

23:37 I've broken teeth on python's module reloading in the past.

23:38 "Nah, you don't want reload, you want *deep* reload."

23:38 technomancy: "whoa; that's deep"

23:39 mdeboard: Sorry that Python is too advanced for you troglodytes

23:39 :P

23:39 (kidding, obviously I hope)

23:39 cemerick: heh

23:40 poor python

23:41 A friend of mine was telling me earlier how his company will simply never move to python 3. Period. They'll end up in Clojure or JRuby before that happens, apparently.

23:41 mdeboard: I like Python a lot. I write a lot of what I hope is idiomatic/"Pythonic" Python. It does what it does really well. Has some warts and stuff but nothing too awful. Sometimes it's not the right tool for the job though.

23:43 muhoo: python was my favorite language for about 7 years. until i found clojure. now i found i simply can't go back, even if i wanted to.

23:43 mdeboard: cemerick: Where did (pprint) come from at about 30:00 in your screencast? I've got lein-pprint in my profile.clj but it's not recognized

23:44 oh, different things I guess.

23:46 cemerick: mdeboard: that's clojure.pprint/pprint — which I should have required in, since it'd only be present within the namespace when the REPL is involved.

23:46 lein-pprint is a plugin that will pretty-print the project map after all middleware, hooks, etc. are applied.

23:49 mdeboard: oic

23:51 LuminousMonkey: Anyone got the seven languages in seven weeks from PragProg? Worth getting?

23:56 mdeboard: One component of our stack at work where I really miss clojure is parsing XML out into dictionaries.

Logging service provided by n01se.net