#clojure log - Apr 23 2012

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

0:01 felideon: I meant from Emacs/SLIME though. i open a swank server but when doing a slime-connect I get the error:

0:02 error in process filter: slime-intern-indentation-spec: Wrong type argument: listp, 1\

0:02 might be an issue with my slime setup?

0:13 yeah, i disabled slime-fancy and slime-indentation and got rid of the errors. still no repl though P)

0:32 technomancy: felideon: best way to run a swank server on its own right now is to run `lein swank` inside a checkout of swank-clojure unfortunately

0:32 no reason why `lein swank` couldn't work outside a project, but nobody's implemented it yet

0:55 alexbaranosky: any easy way to right justify a string in Clojure?

0:56 zakwilson: Do you mean pad it with spaces?

0:56 alexbaranosky: zaargy, yeah

0:56 I recall Java doesn't have convenient way to do so... but perhaps one of the Clojure libraries comes with a function for it

0:59 technomancy: ,(vals (ns-publics 'clojure.string))

0:59 clojurebot: (#'clojure.string/trim #'clojure.string/lower-case #'clojure.string/split #'clojure.string/join #'clojure.string/upper-case ...)

1:00 technomancy: I'd guess no

1:03 zakwilson: (defn pad-left [len s] (str (apply str (repeat (- len (count s)) \space)) s))

1:03 (you should make that cleaner if you want to use it)

1:04 ,(str (apply str (repeat (- 20 (count s)) \space)) "foo bar")

1:04 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: s in this context, compiling:(NO_SOURCE_PATH:0)>

1:04 zakwilson: ,(let [s "foo bar"] (str (apply str (repeat (- 20 (count s)) \space)) s)

1:04 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

1:04 zakwilson: ,(let [s "foo bar"] (str (apply str (repeat (- 20 (count s)) \space)) s))

1:04 clojurebot: " foo bar"

1:19 muhoo: there's always format

1:21 seancorfield: I've been surprised by the (negative) reaction to LightTable in some circles...

1:21 alexbaranosky: which circles?

1:22 seancorfield: Anyone read the Chronon Systems blog post? And the attendant HackerNews feeding frenzy?

1:22 muhoo: &&(format "%40s\n" "foo")

1:22 lazybot: java.lang.RuntimeException: Unable to resolve symbol: & in this context

1:22 muhoo: eh

1:22 ,(format "%40s\n" "foo")

1:22 clojurebot: " foo\n"

1:22 muhoo: there it is

1:22 alexbaranosky: thanks muhoo

1:22 muhoo: ,(format "%40s" "foo")

1:22 seancorfield: &(format "%40s\n" "foo")

1:22 clojurebot: " foo"

1:22 lazybot: ⇒ " foo\n"

1:23 alexbaranosky: ,(format "%20s" "1")

1:23 clojurebot: " 1"

1:23 muhoo: ah ##(format "%40s\n" "foo")

1:23 lazybot: ⇒ " foo\n"

1:23 alexbaranosky: ,(format "%2s" "1")

1:23 clojurebot: " 1"

1:23 muhoo: soo it's ONE & for clojurebot, but TWO ##'s

1:23 lazybot: ⇒ s

1:23 muhoo: *sigh*

1:23 seancorfield: One of the comments was that the LightTable demo was contrived because "real world code" wouldn't have such short functions...

1:23 alexbaranosky: how do I get it to pad with 0's though

1:23 muhoo: seancorfield: there's an old yiddish saying: "Never show a fool a half-done job."

1:24 alexbaranosky: seancorfield, I actually am not too surprised, only because the world is full of haters -- nothing that is the best is ever commonly accepted

1:24 seancorfield: ,(format "%02s" "1")

1:24 clojurebot: #<FormatFlagsConversionMismatchException java.util.FormatFlagsConversionMismatchException: Conversion = s, Flags = 0>

1:24 seancorfield: oops :)

1:24 alexbaranosky: never commonly accepted, I mean

1:25 seancorfield: It made me look at our code at World Singles - 11.5 lines per function on average in 4Kloc

1:25 And that includes some nasty functions that I wrote early on that should be refactored... my more recent code is cleaner :)

1:26 Even my FW/1 (web framework port to Clojure) is only 8.32 lines per function - and that includes whitespace etc

1:27 technomancy: crazy defence/apologia for immutability on emacs-devel: sent

1:27 seancorfield: ,(format "%05d" 1)

1:27 clojurebot: "00001"

1:27 technomancy: I think I need to blog about egal

1:27 muhoo: technomancy: you are fighting the good fight

1:27 technomancy: muhoo: thanks =)

1:27 seancorfield: Not sure you can pad a string with zeros alexbaranosky

1:27 alexbaranosky: Chris GRanger has a lot of experience with IDEs -- I'm sure the blog author doesn't know that

1:27 muhoo: but... maybe it'd be better to write clojacs from scratch

1:28 hehehee, clojacs

1:28 alexbaranosky: seancorfield, In Java I've had to use some library code to do it

1:28 technomancy: muhoo: they are trying to get elisp running on guile

1:28 muhoo: http://upload.wikimedia.org/wikipedia/en/thumb/4/44/Kojaktelly.jpg/170px-Kojaktelly.jpg

1:28 alexbaranosky: gotta go, thanks for the chat

1:28 technomancy: muhoo: so clojure-scheme would be an option

1:28 I have my doubts as to its feasibility

1:29 muhoo: guile emacs has been discussed for many years, IIRC

1:29 i think even rms was behind it at one point.

1:29 technomancy: muhoo: most of the devs have adopted an "I'll believe it when I see it" attitude

1:29 muhoo: then again, much as i love emacs, i'd kind of rather put the devlopment effort into lighttable

1:31 technomancy: I would implement the live-tracing stuff myself except I don't want to code against swank, and the nrepl adapter for elisp doesn't exist yet.

1:32 but if I could compile Clojure to elisp (or guile if that's the same runtime) then I would be a lot more likely to write nrepl.el

1:34 muhoo: it will be fascinating what happens when clojure can run on almost any other language

1:36 technomancy: by the way, side question. i was thinking about clj-python, and wondering, how will jar files and lein work with that?

1:36 so many libraries are distributed as jars in maven repos. what'll happen when all these other runtimes have clojure support?

1:38 espeed: I'm trying to pipe the output of the parts-of-speech function into the index-words function and print the resulting output using the thread macro (-> parts-of-speech index-words println). But the index-words func returns an iterator-seq, and I'm not sure how to iterate it in this context because I'm new to Clojure (see https://gist.github.com/2468965)

2:30 sritchie: espeed: still around?

2:30 espeed: yes

2:31 sritchie: since you have a sequence, you probably want to print each thing --

2:31 so you can map println across that iterator-seq

2:31 and then call "doall" to force it to print each thing

2:31 (doall (map println (index-words (parts-of-speech))))

2:31 another way to write this is with doseq:

2:31 (doseq [word (index-words (parts-of-speech))]

2:31 (println word))

2:35 espeed: sritchie: Thanks. (parts-of-speech) returns an array -- I'm trying to learn how to use the -> (thread) macro, but I'm missing something

2:35 sritchie: -> just rewrites the code

2:35 so (-> (parts-of-speech) index-words) gets rewritten into what I had above

2:36 you could do this:

2:36 (->> (parts-of-speech) index-words (map println) doall)

2:36 that's equivalent to (doall (map println (index-words (parts-of-speech))))

2:37 espeed: why would you use the ->> over the simpler -> ?

2:40 replaca: ibdknox: you there?

2:45 espeed: ->> will thread through as the last arg, which will be correct for (map println) and irrelevant to all the others

2:48 espeed: replaca: thanks. I changed it slightly, added (map index-words) -- this works: (->> (parts-of-speech) (map index-words) (map println) doall)

2:48 replaca: espeed: yup, looks good

2:49 espeed: is that "idomatic" clojure?

2:50 replaca: espeed: sure, though the decision to use -> or ->> over nested parenthesis is somewhat personal. You'll see the same programmer use both styles depending on what emphasizes their intent best in that context

2:53 espeed: Thanks. Someone told me today that the "dot" interop macro is "outdated": (. POS values) and it's better to use (.values POS) -- is this true?

2:53 replaca: espeed: yeah, that's right. You never see a lone . in the wild

2:55 espeed: ok cool, that clears things up a bit -- thanks for your help Tom and Sam

2:56 replaca: espeed: np

3:00 muhoo: hmm, clojurescript views are still experimental for cloudant/couchdb, eh?

3:12 laurus: How would one slice an array in Clojure-py?

3:36 amalloy: replaca: well, "never". (. foo bar baz) is great for macro writers

3:37 eg, (defmacro memfn [method] `(fn [obj#] (. obj# ~method))) compared to (defmacro memfn [method] `(fn [obj#] (~(symbol (str "." method)) obj#)))

5:01 solarnet: Does anyone have any tips for packaging native libraries so I can push them to clojars so I don't have to embaed them in my project?

5:09 fliebel: solarnet: Do tell if you find out. I'm still looking for a nice RxTx package.

5:10 solarnet: I did find a blog post describing the process...

5:10 http://nakkaya.com/2010/04/05/managing-native-dependencies-with-leiningen/

5:11 solarnet: I believe that is old and outdated

5:13 fliebel: solarnet: What makes you believe that?

5:24 solarnet: my own insanity

5:24 I think I may have this figured out

5:25 Raynes: http://en.wikipedia.org/wiki/Lunatic_asylum

5:27 solarnet: I 'member you >.>

5:27 Raynes: We've met?

5:27 * solarnet hisses at Raynes

5:29 * Raynes squints at solarnet

5:32 Raynes: I feel like I'm supposed to know who you are and feel bad because I don't.

5:32 :(

5:33 solarnet: nah it was a while ago you probably don't remeber me

5:59 does lein only load jars which are in dependencies?

6:00 (i.e. I recently fired up an old project, and nothing that is found in jars I dropped in the lib path by hand is being used)

7:29 jimp: I'm wondering, given that i have a bunch of records in a list and i want to instanciate them. How do i go about that? The dot operator and new macro both want a classname, not a class so i am drawing a blank here

7:30 for instance, i have these two records defined: (defrecord rec1 [one two]) (defrecord rec1 [one two])

7:30 now i am trying to do something like this (map (fn [rec] (new (nametype step) 1 2 3)) [rec1 rec2])

7:31 sorry, like this: (map (fn [rec] (new rec 1 2 3)) [rec1 rec2])

7:33 sattvik: jimp: Which version of Clojure are you using?

7:34 jimp: 1.3

7:35 sattvik: I think you now have a factory function you can use, let me check.

7:35 jimp: sattvik: cool, thanks alot

7:37 sattvik: jimp: Yeah, there is now ->rec1 and ->rec2 functions.

7:37 So you can do something like (map #(% 1 2) [->rec1 ->rec2])

7:38 jimp: hmm, but how do i get the get the constructor function for an unknown record

7:39 i just have a list of records which all implement a protocol, but i don't know which one i am instanciating at a given time

7:39 forsakendaemon: Have to use a macro for that I think.

7:40 sattvik: That's trickier.

7:41 jimp: forsakendaemon: could you give an example of that? I am not quite sure how to go about it

7:41 i honestly thought this would be an easy thing to do :)

7:41 forsakendaemon: If you have a list of them at runtime, then a macro won't work. I was thinking of a different use case.

7:42 Doesn't ->rec1 delegate to something that you can call normally?

7:44 jimp: hmm, maybe let me try to expand it

7:45 sattvik: jimp: Are the fields for the records all named the same?

7:45 jimp: hmm, (macroexpand-1 '(->rec-test1 1 2 3)) just expands to (->step-test1 1 2 3)

7:46 sattvik: yes, and they all implement the same protocol

7:50 i might have found a solution

7:50 (clojure.lang.Reflector/invokeConstructor (resolve (symbol (typename rec-test1))) (to-array[1 2 3]))

7:51 that's just crazy ugly code considering i just want to instanciate a record :(

7:51 and slow i expect

7:52 sattvik: jimp: Yeah I was thinking about reflection, too. Is there some reason why it's not just all the same record type?

7:52 forsakendaemon: Shouldn't be any slower than the convenience form, especially if that's what it expands into.

7:54 jimp: sattvik: well i have this whole flow where i define the steps to be executed as records which implement a protocol with thier own specific implementation. The flow only knows the steps until runtime where it is instanciated

7:55 sattvik: An alternative is that the code that calls this code, instead of passing a class name, pass a record with a default value.

7:56 jimp: heh, of couse i don't really need the whole resolving bit :o)

7:56 looks like this now: (clojure.lang.Reflector/invokeConstructor step-test1 (to-array[1 2 3]))

7:57 sattvik: hmm, not sure how that would look

7:58 sattvik: Well, in whatever code would send the record class, instead send an instance. A way to get an 'empty' record would be to do something like (map->rec1 {}). Or, you could just put in some dummy values, (rec1. nil nil)

7:59 Then, your code can just treat it like a map, (map #(assoc % :a 1 :b 2) empty-records)

8:00 jimp: sattvik: Ahh, good point

8:01 sattvik: can't decide which solution is uglier :P

8:02 `thomas: hello -- i'm getting this error with `lein deps': Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipException: error in opening zip file (NO_SOURCE_FILE:0)

8:02 sattvik: jimp: Well, I'd go with the records as map approach. It seems less brittle.

8:03 jimp: sattvik: true

8:04 mfex: `thomas, are you trying to use the friend library?

8:05 `thomas: mfex: i'm trying to install overtone

8:06 i was logged out of the network at some point so i wonder if lein downloaded a login page instead of a jar...

8:06 mfex: `thomas, I have seen that exception before for dependencies that are distributed as only a pom file, and not a jar and pom file

8:06 jimp: sattvik: thanks btw, i think i'll go with your solution :)

8:06 xeqi: `thomas: can yo upaste the full stack trace on refheap.com ?

8:07 mfex: i don't know anything in particular about the overtone installation process

8:07 sattvik: jimp: Happy to help.

8:12 `thomas: xeqi: here it is: https://refheap.com/paste/2305

8:13 xeqi: ugh, I was hoping for a filename somewhere

8:14 you can `rm ~/.m2/repository` to remove all the jars that have been downloaded

8:16 `thomas: xeqi: thanks for the tip; trying again now...

8:45 _KY_: I don't understand the use of hash-map... seems that what I need is a hash table, with possibly duplicate keys

8:46 I want to quickly look up some items using a search key, but there may be multiple items for a key

8:46 fliebel: _KY_: If duplicate keys where allowed, how would you retrieve items?

8:46 _KY_: I'll get multiple items, and decide which one I need (may I need them all)

8:46 *maybe

8:46 xeqi: so a hash-map from a key to a vector of values?

8:46 fliebel: (get {:a 1 :a 2 :b 3} :a) ?

8:47 _KY_: Ah... I see

8:47 Good idea =)

8:47 That is the traditional idea of hash table, isn't it

8:48 fliebel: &(merge-with vector {:a 1 :b 2} {:a 1})

8:48 lazybot: ⇒ {:a [1 1], :b 2}

8:48 _KY_: Fabulous... =)

8:53 netrino: Good day. I'm new to clojure and learn web developing with noir right now. Please, can someone explain me, what the problem in the following snippet https://gist.github.com/57e7f71802294bca5ced i've got a RuntimeException with message 'No such var admin/login' and other. If I comment out the admin-links def and replace it with text-links it works

8:55 dxlr8r: hey. clojure noob. been writing some code in emacs at work and through ssh -X to emacs at work from home. I'm not a big emacs fan since I am not 60 years old, so I have been trying to get clojure to work in eclipse. so I installed "Counterclockwise" and it worked. now I want to connect to the repl at work. so I tried to forward the port at which my repl is at at work...

8:55 ssh -L 1337:localhost:4008 foo@foo.org

8:56 but eclipse hangs when I try to connect to 127.0.0.1 at port 1337

8:57 any ideas? connecting to 4008 works in emacs through ssh -X works, so the repl is up

8:57 xeqi: netrino: common.clj doesn't have a require :as admin

8:59 netrino: xeqi: actually it has. I didn't post all the common.clj, should I? Cause when I comment the definition which link to the admin-view module it works

9:00 xeqi: well, at least the full stack trace

9:02 netrino: Here it is https://gist.github.com/0e0577320214c04bd43f

9:02 laurus: dxlr8r, have you tried Ergoemacs?

9:03 dxlr8r: still the same problem though. can't seem to connect to the repl through ssh

9:03 so the only way I can connect to it is through ssh -X and running emacs from the server

9:03 laurus: (I was referring to the "I'm not 60 years old" part ;) )

9:03 dxlr8r: hehe :P I have a mac though

9:03 laurus: dxlr8r, honestly I know nothing about trying to ssh through

9:04 dxlr8r: http://asymmetrical-view.com/2009/08/20/emacs-slime-remote-repl.html

9:04 laurus: dxlr8r, I don't use the whole distribution of Ergoemacs, I just use the keybindings.

9:04 dxlr8r: this guy has done it :/

9:04 laurus: Wow, impressive.

9:05 xeqi: whats at learning/models/admin.clj:27 ?

9:05 laurus: dxlr8r, if you want to try just the Ergoemacs keybindings, you can get them from http://code.google.com/p/ergoemacs/downloads/list . I would never use Emacs personally if I didn't have this.

9:05 (ergoemacs-keybindings-5.3.9.zip)

9:06 dxlr8r: we currently all use the same user on the server, lazy-ness I guess :P haha

9:06 laurus: Oh, sheesh, okay.

9:06 dxlr8r: so I can't modify the emacs config file

9:06 don't think the boss will be happy :P

9:06 laurus: dxlr8r, the layout is here: http://ergoemacs.org/i/ergonomic_emacs_layout_qwerty_5.3.4.png

9:06 In case you try it someday :)

9:07 dxlr8r: why do they have the arrow keys on ijkl? why not use the arrows keys! that's why they are there

9:07 :P

9:07 atleast they got undo, copy/paste/cut right

9:08 zerokarm1left: ijkl is at the home position for typing

9:09 laurus: dxlr8r, you can still use the arrow keys

9:09 That map doesn't show everything

9:09 Also, Ctrl+O opens a file, Ctrl+N makes a new file, etc., etc.

9:10 Good luck with the remote repl thing.

9:12 dxlr8r: thx :)

9:12 anyone else? :/ would be great to connect to the remote repl through ssh

9:39 bolic: Is this channel logged?

9:40 beffbernard: Yup, http://www.raynes.me/logs/irc.freenode.net/clojure/

9:42 Hey guys, I need some help with a function I'm working on.. I'm trying to merge a list of id's with a list of items… so [1,2,3] and [{:name "Trev"}, {:name "Dog"} {:name "Cat"}]

9:42 I want the end result to be [(:id 1 :name "Trev"} {:id 2 :name "Dog}}…]

9:43 assoc-in seems like the logical choice but I can't get it working :S

9:43 S11001001: beffbernard: fill in the f: (map f ids items)

9:45 beffbernard: S11001001: that's my problem, lol

9:45 S11001001: beffbernard: write a function that takes an id and an item and sticks the id in

9:46 Bronsa: ,(vec (map #(assoc %2 :id %1) [1 2 3] [{:a 1} {:b 2} {:c 3}]))

9:46 clojurebot: [{:id 1, :a 1} {:id 2, :b 2} {:id 3, :c 3}]

9:46 S11001001: great.

9:46 beffbernard: (map #(merge %1 {:id %2}) patterns ids)

9:46 this works too

9:46 Thanks guys

9:56 jamii: error: java.lang.ClassFormatError: Duplicate method name&signature in class file shackles/bounded/BoundedInteger

9:56 Kind of wish it would tell me what the dupe is...

9:57 netrino: I think I understand what was my problem

9:59 common.clj depends on the functions, defined but not compiled at the moment from the admin.clj, but admin.clj uses partials from common.clj. Strange, that compiler didn't fail compilation with error-message, throwing NPE and different other confusing exceptions instead

10:01 Interesting that if in common.clj replace admin's functions with something else before run, and then replace them back while runtime, it all works

10:40 technomancy: muhoo: it may be that people port Leiningen to the CLR or python runtime, but it would be a port of Leiningen rather than lein itself

10:41 TimMc: technomancy: lein == lein.sh?

10:42 technomancy: TimMc: no, I mean it would be a different project entirely

10:43 cemerick: technomancy: might not need to be given ikvm :-P

10:45 technomancy: cemerick: ah, clever; hadn't thought of that

10:46 .net library support could be just a plugin

10:46 * cemerick been deploying on .NET for years without knowing their APIs

10:46 cemerick: Startup time isn't helped, of course.

10:49 technomancy: apparently it's a pretty big complaint re: clojureCLR

10:50 cemerick: that's the way it goes re: DLR

11:03 dgrnbrg: I have a command line program that spits out a very long classpath string (like "foo.jar:/sys/path/bar.jar:…"), and I'd like to add that to my project's class path. What's the best way to do this? Should I write a lein plugin, or can I do it at runtime w/in the project? Or can I do it w/ the project.clj?

11:04 MGT: 1list

11:10 TimMc: dgrnbrg: pseudo-code: :classpath-extra #=(sh/sh "other-prog.sh") :-P

11:10 (This is terrible, don't do it.)

11:11 gfredericks: TimMc: omg

11:12 TimMc: if that works, you could also make a project.clj self-referential by doing (sh/sh "lein ...")

11:14 technomancy: cemerick: naming request: whoever ends up implementing an inspector middleware for nrepl; could you try to convince them to call it javert?

11:14 TimMc: you can unquote inside defproject; that's cleaner

11:14 cemerick: technomancy: deal :-)

11:14 TimMc: oh yeah

11:18 technomancy: "cleaner"

11:19 * cemerick refuses to be trolled re: unquote :-P

11:20 technomancy: oh wait, this is about arbitrary jars?

11:20 get 'em in a repo!

11:21 zerokarmaleft: cemerick: ooc, what's the status on https://github.com/cemerick/raposo?

11:23 cemerick: zerokarmaleft: utterly neglected still :-|

11:23 zerokarmaleft: i can understand if finishing the book got in the way of pushing the repo to GH :D

11:23 cemerick: heh, finishing the book got in the way of a lot of things ;-)

11:23 I'm still catching up, really.

11:24 Raposo isn't helped by the fact that I'm going to be afk for all of May.

11:24 zerokarmaleft: Were you the fellow that asked me about it at ClojureWest?

11:26 zerokarmaleft: cemerick: no, i couldn't fit clojurewest into my schedule this year, sadly

11:26 TimMc: dgrnbrg: Can you make a pom.xml depend on all those jars? (What's the scenario?)

11:30 gfredericks: does primarily using maven preclude using all the tasty lein plugins without too much project-configuration-duplication?

11:32 cemerick: zerokarmaleft: Ah; anyway, yes, there are a variety of people waiting with bated breath for Raposo. "Right as soon as I can" is my best answer at the moment.

11:32 (Sorry! :-|)

11:33 S11001001: gfredericks: yes

11:34 gfredericks: S11001001: okeedoke. thanks :)

11:35 technomancy: gfredericks: I thought your boss was going to let you switch

11:35 gfredericks: technomancy: oh that was only if I stuck around

11:36 technomancy: I hope it doesn't offend you that his offer didn't change my mind :)

11:36 technomancy: haha; no, good luck at your new place wherever that may be =)

11:37 * gfredericks is going to Groupon

11:37 S11001001: because maven builds are easier to maintain than lein ones? huh.

11:37 technomancy: ah, abedra's team?

11:37 TimMc: S11001001: Easier to integrate with existing Maven projects. :-/

11:38 gfredericks: technomancy: I do not yet have precise enough expectations to answer that

11:38 ask me in two weeks

11:38 S11001001: fair

11:39 gfredericks: S11001001: yeah I don't know the precise reasoning. Definitely had something to do with integrating with other stuff.

11:39 has mostly been a big pain so far

11:39 had to reinvent lein-cljsbuild

11:40 not to mention I've wanted to use checkouts on like 4 separate occasions

11:40 S11001001: checkouts is the best

11:42 gfredericks: although mostly I just want it to check out other people's projects and insert debugging statements, and it just ocurred to me that I could do that at runtime in my own code, so maybe those aren't the most compelling use cases

11:44 ambrosebs: Why doesn't ISeqable extend to nil in Clojurescript?

11:50 cemerick: gfredericks: congrats :-)

11:52 gfredericks: cemerick: thanks

12:01 dgrnbrg: TimMc: Sorry, I just saw your message. I've never written a pom.xml. My situation is that I am integrating my build system at work w/ lein. It's a hugely complex build system with hundreds of codebases that produce jars, and it's all Makefile based. There is a command line program that can output a class path with the closure of the dependencies for a project. I want to have lein integrate with that tool to create the classpath for the project

12:01 so that I can use our proprietary code w/ clojure in lein, and also use lein's dependency management to integrate w/ other 3rd party libs

12:07 TimMc: Makefiles. niiiiice

12:07 Yeah, unquoting might be your best bet. :-(

12:09 dgrnbrg: TimMc: what do you mean, unquoting?

12:09 Is there a way for a lein plugin to alter the class path of the project?

12:10 with an :extra-classpath-dirs hook?

12:10 TimMc: Hmm, a plugin would be cleaner, you're right.

12:11 I'm not sure what the best approach is, given that.

12:12 The only plugin I've written uses new lein tasks that munge the project map and chain to other tasks. You'd want to adjust the behavior of existing tasks, yes?

12:13 mdeboard: I'll tell you what, writing Clojure has made me grow so very, very weary of big, heavy, monolithic interfaces

12:13 dgrnbrg: why doesn't "lein install lein-pprint 1.1.1" work?

12:13 pipeline: weary or wary

12:13 mdeboard: yes

12:13 more weary than wary

12:13 dgrnbrg: TimMc: I think I'd need to use robert.hooke to modify the class path for everything

12:16 technomancy: dgrnbrg: `lein plugin install`??

12:16 lazybot: technomancy: Uh, no. Why would you even ask?

12:16 dgrnbrg: technomancy: I'm on lein 1.7 :/

12:17 i tried adding it to my dev-deps and it worked

12:17 technomancy: do you have any advice for writing a plugin that adds some stuff to the class path of a project?

12:17 as far as what I should hook? or the names of functiosn/vars to look at?

12:18 technomancy: dgrnbrg: if you want to get more jars on the classpath I highly recommend getting them into ~/.m2 first

12:18 anything else is going to be a nasty hack

12:18 though if you're resigned to nasty hacks I can advise further

12:19 TimMc: He's already in a twisty little maze of Makefiles, all alike.

12:19 dgrnbrg: technomancy: I have hundreds of jars I need to include, and they're all under heavy lockdown on isolated servers

12:20 I already have a bunch of hacks to get lein to work through some firewalls

12:20 so I'm resigned :/

12:20 suppose I can get the list of class files: /path/to/foo.jar:/path/to/bar.jar:/path/to/baz.jar:…(100x more)

12:21 technomancy: on lein1 it might be best to add a hook to leiningen.classpath/get-classpath-string

12:22 dgrnbrg: can I do that w/o writing a plugin? or is a plugin the only way?

12:22 technomancy: you could just call add-hook in project.clj after defproject

12:23 * eggsby is annoyed the introduction to clojure course on codelesson hasn't started yet

12:23 dgrnbrg: I didn't realize that project.clj was executed--cool!

12:34 nDuff: gfredericks: ...as someone who recently left a top-5 player in the group buying industry, good luck.

12:42 __Isaac__: I completed the Clojure Koans; I'm curious if there is a more idiomatic way to call an instance method than (= ["HI" "THERE"] (map #(.toUpperCase %) ["hi" "there"]))

12:44 TimMc: Nope.

12:44 There's memfn, but it's a little weird.

12:44 raek: __Isaac__: nope. you need a function objects, and java methods aren't objects (except when using the reflection features, but then they don't implement the necessary interface)

12:45 __Isaac__: but in this particular case you can use clojure.string/upper-case

12:47 __Isaac__: raek: thank you

12:57 hugod: Licenser: vmwebadm looks very interesting

12:57 we're just starting to think about smartOS support for pallet, so it is very timely

13:00 dnolen: CLJS users if you've got a second please clone - http://github.com/swannodette/himera

13:01 use the synonym branch, start with: lein run 8080, and point your browsers at localhost:8080/synonym.html

13:01 it's basically http://synonym.dartlang.org/ for ClojureScript, curious what else people think should be added

13:08 RickInGA: dnolen: I keep getting a 404 when I try to go to localhost:8080/synonym.html

13:09 dnolen: RickInGA: did you checkout synonym branch

13:09 ?

13:09 RickInGA: think so, let me try again

13:10 ibdknox: dnolen: interesting that Dart doesn't provide the ability to modify classes.

13:10 dnolen: ibdknox: i imagine for performance reason tho I don't see how that could matter that much given how much work they've done on V8

13:11 ibdknox: dnolen: we should convince someone to write a nice string interpolation lib for CLJS :D

13:11 RickInGA: dnolen: you were right, checked out wrong branch

13:12 hugod: gfredericks: the zi plugin for maven allows you to use checkouts

13:13 dnolen: ibdknox: heh, I think getting this up is important. A good way for people to compare what ClojureScript offers over Dart, CoffeeScript - a lot.

13:14 ibdknox: dnolen: I agree, anything you need help with there?

13:14 RickInGA: dnolen: I would add some discussion of the different collection types. list/set/map have meaning to clj folks, but not js folks.

13:15 dnolen: RickInGA: yep planning on doing that, was mostly curious if people like the general idea

13:16 ibdknox: dnolen: I should fix println

13:16 dnolen: ibdknox: nah it's a pretty simple long list of examples - mostly interested in hearing what things people would like to see that perhaps isn't covered at all in the Dart synonyms

13:16 RickInGA: dnolen I saw the dart list when you linked it here last week. Dart's version was so imperative, wasn't sure how to translate it. yours looks great

13:17 ibdknox: dnolen: looks good, definitely want to throw something in there for syntax highlighting though

13:18 RickInGA: dnolen: under optional parameters, it looks like neither js nor cljs support optional parameters (other than cljs multiple arity)

13:19 dnolen: ibdknox: is there an easy brush to incorporate?

13:19 ibdknox: brehaut had one, unfortunately he's not here right now

13:19 dnolen: I might steal whatever marg uses

13:19 dnolen: RickInGA: but that's true unless you do map destructuring on arguments.

13:20 ibdknox: dnolen: or this: http://brehaut.net/blog/2011/clojure_brush

13:20 dnolen: what about [a b & [c d]]

13:20 dnolen: I do that all the time in my CLJ code

13:21 dnolen: ibdknox: ah nice one - see that's why I'm sharing :)

13:21 ibdknox: I'm not sure if I like that brush.

13:21 ibdknox: dnolen: marg's might work better

13:22 ex: http://fogus.me/fun/marginalia/

13:24 sattvik: I think Marginalia is using Brehaut's brush.

13:24 dnolen: sattvik: ah, just different colors?

13:24 ibdknox: dnolen: regex's work in CLJS don't they?

13:24 dnolen: ibdknox: yes though there a couple of issues around the fact that JS and Java support different options

13:24 sattvik: dnolen: Perhaps. I think the color scheme and the highlighter/parser are orthogonal.

13:25 ibdknox: sattvik: dnolen: yeah, they are

13:25 RickInGA: if you use an array in cljs, is it mutable?

13:25 dnolen: RickInGA: yes, same as arrays in Clojure

13:25 eggsby: marginalia is nice, docco is cool

13:25 dnolen: RickInGA: necessary in fact if you want to have performant persistent data structures

13:26 sattvik: I've alwys wondered if a cljs-derived brush would be superior.

13:27 RickInGA: dnolen: that list of translations is awesome. That is going to be very useful as I try to learn cljs.

13:28 dnolen: RickInGA: yes, the current state of online CLJS documentation for beginners is really bad.

13:29 RickInGA: dnolen: I thought so too last week, then I set about trying to write some, and I realized the biggest issue I had with the documentation was me.

13:29 dnolen: RickInGA: ?

13:30 RickInGA: dnolen: when I was trying to use cljs to do animations on a canvas, the getting started documentation was awful. when I was trying to figure out how to get started with cljs and specifically lein-cljsbuild it was step by step exactly what I needed

13:31 jeffdik``: dnolen: looks very nice, thanks for creating it

13:31 dnolen: jeffdik``: no problem - will probably add a bunch of improvements later this evening and will look into incorporating a brush. thanks for the feedback all.

13:32 RickInGA: I did a post over the weekend that was 'hello world' in cljs, which didn't do much more than rehash what was on lein-cljsbuild, and already it has gotten more views than all but a couple of my posts.

13:33 I plan to play around with canvas over the next couple of weeks. do you want a section on using a canvas on your synonyms?

13:34 dnolen: RickInGA: that's a bit too specific a use case, though basic DOM interop is probably a good idea.

13:41 also made some initial progress this weekend in tracking down why rest fns in CLJS are so darn slow - that's the last crazy CLJS bottleneck that I'm aware of.

13:44 ibdknox: dnolen: have you ever looked at why seqs are so slow?

13:45 dnolen: ibdknox: seqs I don't think seqs are that slow, but chunking should help a lot when we get around to that.

13:45 ibdknox: if there any rest fns in your code path - your perf goes out the window - lots seq functions use rest fns.

13:46 ibdknox: ah

13:47 dnolen: ibdknox: also the reason why str is unbearably slow

13:48 ibdknox: yeah I noticed that one

13:53 elliottw: this seems like a really lame question, but i'm just learning and am trying to see if the first character in a string is an alphabetic character

13:54 for this type of stuff i've been using re-seq #"[a-zA-Z]" and seeing if anything is in the list, but that's probably not the best way

13:54 joegallo: ,(Character/isLetter (first "foo"))

13:54 clojurebot: true

13:54 _KY_: (Character/isLowerCase (first x)))

13:54 joegallo: ,(Character/isLetter (first "123"))

13:54 clojurebot: false

13:55 ibdknox: like magic the answer appears

13:56 elliottw: lol

13:56 S11001001: ,(Character/isLetter (first "ábc"))

13:56 clojurebot: true

13:56 elliottw: so do I need to load Character?

13:56 joegallo: no

13:56 S11001001: relatively good locale

13:56 joegallo: it's java.lang.Character, it's just there.

13:56 TimMc: ,(Character/isLetter (first "\u0639"))

13:56 clojurebot: true

13:56 elliottw: i tried: (Character.isLetter (first "foo"))

13:57 and got classnotfoundexception

13:57 joegallo: no. the slash is important.

13:57 elliottw: damnit

13:57 S11001001: ,(Character/isLetter (first "α"))

13:57 TimMc: elliottw: Is it OK if Arabic letters are passed by your check? :-)

13:57 clojurebot: true

13:57 S11001001: huh

13:57 elliottw: thanks, got it

13:57 joegallo: hey, if alpha and beta aren't alphabetic characters, then i don't want to live on this planet anymore.

13:58 elliottw: so what if i wanted to see if a word is camelcase. I've been using re-seq to split on capitals, and then see if i end up with an empty list but that doesn't seem like the "right" way

13:58 S11001001: ,(java.util.Locale/getDefault)

13:58 clojurebot: #<Locale en_US>

13:58 elliottw: or not split, nut you know what i mean

13:58 joegallo: elliotw: what would that logic look like in english? because it sounds to me like the only thing you could check is the first character...

13:59 TimMc: &(re-seq #"^([A-Z][a-z]*)+$" "CamelCase")

13:59 lazybot: ⇒ (["CamelCase" "Case"])

13:59 joegallo: and see whether it's titlecase (or perhaps uppercase or not).

13:59 TimMc: &(re-seq #"^([A-Z][a-z]*)+$" "notCamelCase")

13:59 lazybot: ⇒ nil

13:59 technomancy: oh, I had an awesome idea while falling asleep last night. if slamhound were implemented as a logic program, you could run it forwards and backwards... which might mean that you could say "given the state of the project, calculate the ns form" but also "given the state of this ns form, calculate and insert the defns needed to make it compile

13:59 joegallo: right, but isn't Camelcasethisiscrap also camelcase?

13:59 technomancy: any core.logic fans want to make it happen? =)

13:59 joegallo: i mean, all you're checking is the first letter...

14:00 TimMc: technomancy: Wake up, it's time to make sense.

14:00 elliottw: sorry, so i want to check to see if the first char is a letter, then check to see if i have any capitals in the rest of the word

14:00 technomancy: TimMc: but, but... logic!

14:00 TimMc: you're still dreaming

14:00 joegallo: elliotw, is that second part allowed?

14:00 S11001001: ,(Character/isLetter (first "ǽ"))

14:00 clojurebot: true

14:00 technomancy: I don't want to wake up; everything is wonderful here

14:01 elliottw: i don't see 7up or 7Up at camelcase

14:01 joegallo: you're saying FooBar is camelcase, but Foo is not. right?

14:01 technomancy: I also dreamed that typed clojure would make NPEs impossible

14:01 elliottw: joegallo: correct

14:01 TimMc: technomancy: I *am* intrigued, though -- do you have an example I/O?

14:02 joegallo: filter the string for uppercase characters and check that the result is greater than length two, i suppose, then.

14:02 technomancy: TimMc: you'd just write the ns form as if the namespaces/defns you want already existed, then run M-x slamhound-ex-nihilo or whatevs

14:03 elliottw: that's what i've been doing. (empty? (re-seq #"[A-Z] (subs "fooBar" 1)) or something like that

14:03 technomancy: then it populates your src/ directory with all the empty functions needed to make your namespace compile

14:03 joegallo: k, seems reasonable, i guess

14:03 elliottw: i just htought it was kind of hacky to create a list of capitals and then look to see how long that list is

14:03 technomancy: I wonder if it would be possible to get arities that way

14:03 ibdknox: technomancy: TimMc: there's such a features in VS

14:04 technomancy: ibdknox: yeah, much easier in a static language I'm sure

14:04 S11001001: elliottw: yes, you can write a regex that will only match at all if you match it against a camelcase word

14:04 technomancy: slamhound as it currently exists is straight out of eclipse

14:04 ibdknox: technomancy: still really hard lol

14:04 technomancy: I really don't understand why Clojure doesn't perform arity checking at compile time though

14:04 ibdknox: not if you have the Power of Logic!

14:05 TimMc: technomancy: OK, so this would generate other namespaces in your current project.

14:05 ibdknox: technomancy: I think the cljs compiler might check arity at compile time now

14:05 technomancy: dnolen would know ^

14:05 technomancy: ibdknox: I guess that's probably a good indicator that we might see it in Clojure some day

14:06 ibdknox: mhm :)

14:06 timvisher: technomancy: why would I be able to install a plugin using :dev-dependencies while trying to install via lein plugin install fails with not-found errors?

14:06 Borkdude: what is the canonical way to run tests (using clojure.test) in Eclipse?

14:06 elliottw: S11001001: i guess that's just beyond my regex skills :-(

14:07 technomancy: timvisher: very strange; no idea. what's the plugin?

14:07 timvisher: rather, I get connection refused from the plugin install path but not from the other

14:07 eastwood

14:07 i'm on windows

14:07 sattvik: timvisher: Do you use a proxy?

14:08 Licenser: hugod cool, what is pallet?

14:08 timvisher: we have historic issues from within our firewall of dealing with maven, but I consistently can run deps after using dev-dependencies but I've never successfully gotten an install to work

14:08 almost as if they're using separate backends

14:08 and yes, on the proxy

14:08 had to configure that via .m2/settings.xml

14:08 sattvik: timvisher: I have that same issue, too.

14:09 timvisher: no problem whatsoever on my mac at home

14:09 dgrnbrg: technomancy: is it possible to package lein into an uberjar? I need to have a single jar solution for leiningen

14:09 timvisher: sattvik: I'm not alone! ;)

14:09 technomancy: dgrnbrg: you've already got it =)

14:09 ls ~/.lein/self-installs

14:09 timvisher: sorry, proxy support is not great. it should be better in lein2 though

14:09 timvisher: and the plugin in question is eastwood

14:09 but all plugins behave the same way

14:09 dgrnbrg: technomancy: I can't run lein w/ the lein.sh script--I need to use some shitty java runner to integrate in another environment

14:09 timvisher: at least that i've tried to use

14:10 technomancy: have you tried it with lein2?

14:10 timvisher: dgrnbrg: seen ,,lein-exec ?

14:10 ,lein-exec

14:10 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: lein-exec in this context, compiling:(NO_SOURCE_PATH:0)>

14:10 timvisher: bah, i'm thinking of #emacs

14:10 dgrnbrg: isn't that for scripts?

14:11 sattvik: timvisher: What I usually end up doing is just adding the plug-in as a dev-dependency temporarily. It's not just Leiningen, other JVM tools have issues with proxies, too.

14:11 dgrnbrg: I need to run a lein project and develop it, but I must use a crazy environment that uses native libs linked in w/ LD_PRELOAD, among other things

14:11 * timvisher sighs. I'm just not thinking clearly today...

14:11 timvisher: sorry. :)

14:11 technomancy: timvisher: lein2 should put all downloads (except search indices) through the same settings

14:12 timvisher: sounds like lein2 might solve my problems

14:12 sattvik: it's not that i don't have that workaround. The question was more why the discrepancy

14:12 technomancy: actually search indices use proxies, just not mirrors

14:12 timvisher: i tried upgrading to lein2 this morning and i couldn't figure out where to go to get a windows bat file for it

14:12 am i missing something obvious?

14:12 the bat file linked from master is for 1.7.1

14:12 TimMc: &(re-seq #"^([A-Z][a-z]*){2,}$" "Notcamelcase")

14:12 lazybot: ⇒ nil

14:12 TimMc: &(re-seq #"^([A-Z][a-z]*){2,}$" "CamelCase")

14:12 lazybot: ⇒ (["CamelCase" "Case"])

14:13 TimMc: elliottw: ^ there you go

14:13 technomancy: timvisher: https://github.com/technomancy/leiningen/blob/master/bin/lein.bat

14:13 oh, I guess the readme hasn't been updated yet

14:13 timvisher: so that's a yes, i was missing something obvious... facepalm. :(

14:13 lol

14:14 dnolen: technomancy: ibdknox: yes it warns at compile time now

14:14 elliottw: TimMc: interesting

14:14 dnolen: technomancy: ibdknox: pretty nice too - caught some easy miss bugs in the new persistent data structures.

14:14 technomancy: dnolen: great. any idea if it's coming to Clojure proper?

14:14 elliottw: TimMc: i would also say iPhone is a camelcase-ish thing

14:15 TimMc: elliottw: How about USSR?

14:15 And URLDecoder?

14:15 elliottw: TimMc: not camel case… you raise an interesting point

14:15 timvisher: on a mildly related note, anyone know why my java processes don't seem to respect HOME in my environment on Windows?

14:15 technomancy: timvisher: oh man... the bugs I get over the fact that the Windows JVM can't keep its notion of HOME straight...

14:15 elliottw: there has to be a mix of upper and lowercase, probably avoid strange things with numbers, dots, hyphens… like La-La is probably not camel

14:16 TimMc: And there's always sTuPiDcApS

14:16 dnolen: technomancy: seems like a simple warning to add if somebody comes up with a patch.

14:16 technomancy: dnolen: cool; I guess that means it's not an intentional omission

14:17 dnolen: technomancy: yes it needs to be a warning since redef means arities can change.

14:18 technomancy: sure

14:19 timvisher: it's not my fault! I swear! :)

14:20 TimMc: timvisher: Need an export somewhere? (grasping for straws...)

14:21 Or is that only a UNIXy thing?

14:22 timvisher: TimMc: unixy thing. it's a pretty common issue

14:22 you set HOME in the System settings panel and something like Emacs just works but you run a java process and ask it about the environment variable HOME and it returns the default (c:/documents and settings/<username>), sometimes...

14:23 hugod: Licenser: http://palletops.com/

14:24 Licenser: hugod just found it :)

14:24 TimMc: timvisher: How about under Cygwin?

14:24 Licenser: I'd gladly support you with the integration if you're interested, I'm building a GUI right now so I've some experience with the client side by now too

14:24 TimMc: timvisher: Do other env vars have this problem? You could do FOO=$HOME java -jar ...

14:26 hugod: Licenser: hey thanks - we're not too advanced yet, but several people in #pallet are actively interested in working with smartOS in combination with pallet.

14:27 elliottw: thanks for all the help all.

14:28 timvisher: TimMc: don't remember having any issues under cygwin but for other reasons that's not feasible here

14:28 Licenser: smartOs is very nice

14:28 timvisher: cygwin runs _dog slow_ on our boxen

14:28 pipeline: cygwin is insanely slow on every box

14:28 speed is kind of a secondary concern for them

14:28 want speed? use interix/sfu/sua

14:29 timvisher: pipeline: i ran cygwin very happily on a windows box for years at my previous position and when I got here, i'm talking (very scientifically of course) orders of magnitude slower

14:29 it's obviously never going to be as fast as native, but it was quite tolerable at my old job

14:33 dnolen: `fogus: you're probably busy, but just checking you saw my Himera pull request.

14:34 `fogus: dnolen: I did. I will check it out first chance I get. Thanks!

14:40 dnolen: `fogus: thx!

14:42 Licenser: hugod so if you've any questions feel free to hit me up, I'm hanging out here and on #SmartOS :)

14:43 hugod: Licenser: thanks, will do :)

14:46 Licenser: hugod also look at this: https://github.com/Licenser/erllibcloudapi

14:46 it's a client implementation (not clojure but erlang) but it shoudl give you the basic idea

14:51 juhu_chapa: hi guys!, perhaps this is a common one. I can't read from console using (read-line) from REPL, any docs explaining this?

14:51 mstump: In clojurescript I'm trying to call a method which is on a property of an object 'npm' is this the correct syntax: https://gist.github.com/2472982 I'm getting stack size exceeded.

14:52 technomancy: juhu_chapa: there are issues with stdin and jvm process handling; how are you launching your process?

14:52 hugod: Licenser: should help, assuming my erlang is up to par ;)

14:52 juhu_chapa: technomancy: lein run

14:52 Licenser: heh

14:52 technomancy: juhu_chapa: try lein trampoline run

14:53 Licenser: I propably also could hack together a simple clojure library it'd help

14:56 juhu_chapa: technomancy: it works!, thank you.

14:56 technomancy: sure

14:57 dnolen: mstump: you need to js/npm to prevent Closure mangling your names.

15:01 acheng`: hello. i have a lein question -- i think i'm missing something obvious. i've run lein install in one of my projects foo, added a line for it in the project.clj :dependencies of another project bar, run lein deps for bar, i see the foo jar in bar's lib/, and now i'm trying to (use 'foo.core)... but it says Could not locate foo/core__init.class or foo/core.clj on classpath: [Thrown class java.io.FileNotFoundException] ... does

15:01 foo/project.clj need :aot or something else?

15:02 technomancy: acheng`: maybe you need to restart your repl?

15:03 acheng`: tried that. i can try again.

15:03 technomancy: check if `lein classpath` includes the jar you expect

15:04 acheng`: lein classpath does include foo-0.0.0.jar

15:04 technomancy: and does the jar contain the .clj file you expect?

15:05 acheng`: the last file in the jar's manifest (as viewed in emacs) is foo/core.clj

15:05 and has some length (non-zero)

15:06 technomancy: there must be something else going on then

15:06 acheng`: leiningen 1.7.1 on java 1.7.0 java hotspot

15:07 technomancy: acheng`: if you can provide a repro case I can look further, but what you're describing works fine here

15:08 TimMc: acheng`: Does foo have any hyphens or underscores in it?

15:08 acheng`: ah. yes foo is actually raw-elk

15:08 and is on a windows machine

15:10 "why hypens? aren't they our friends now?"

15:10 hxiao: if there are hyphens in the namespace i think you need underscores in the source file's path instead of the hyphens

15:10 raek: acheng`: hyphens in namespace names corresponds to underscores in filenames

15:10 hxiao: src/raw_elk/core.clj

15:11 acheng`: ok. will try. thanks for all the help!

15:14 emezeske: technomancy: The hyphen/underscore issue seems to come up somewhat frequently. I wonder if leiningen could issue a warning during some tasks (e.g. jar) if it noticed that there were any fishy filenames. Is that something you might accept a pull request for?

15:15 technomancy: emezeske: we've just been discussing an extensible check mechanism that could do linty-type things

15:15 emezeske: technomancy: ah, cool!

15:15 I need to pay more attention to the ML

15:16 xeqi: seems like most discussion happens in the irc chan

15:16 technomancy: emezeske: #leiningen actually

15:17 emezeske: technomancy: that too :)

15:18 technomancy: should get better about posting plans to the list though

15:21 sattvik: Congrats to Clojure's Google Summer of Code students!

15:22 alexyakushev: sattvik: Thank you!

15:26 devn: woo!

15:26 lucky kids with their paid code summers...

15:26 * devn grumbles

15:26 gfredericks: if only there were a way for us grownups to exchange work for money...

15:28 muhoo: i would love to be able wrap my brain around ths whole nosql thing. i can't stop thinking in terms of data structure, and i keep running into the sneaking suspicion that something is very wrong with pretending that relational data isn't relational.

15:29 fp didn't take me very long to get. nosql, is just a struggle.

15:29 dnolen: muhoo: you should take a look at datomic

15:29 samaaron: i wish someone would pay for me to hack on overtone

15:30 acheng`: TimMc/hxiao/raek/technomancy: you were right about the hyphens and it works for me now. movie quote was from terminator 2

15:30 samaaron: i had to pay for myself for a year - which was awesome fun but not sustainable

15:31 gfredericks: samaaron: gave yourself a sabbatical?

15:31 muhoo: dnolen: thanks, will do.

15:32 samaaron: gfredericks: yup, i did

15:33 gfredericks: and worked harder and was more productive than ever before

15:33 gfredericks: I oughta start saving for one of those...

15:33 samaaron: gfredericks: it's well worth it

15:34 gfredericks: I'd probably just end up enrolling in a phd program

15:34 samaaron: gfredericks: i did one of those first :-)

15:34 gfredericks: oh I've agonized over that option for years now

15:35 samaaron: gfredericks: don't do one unless you *really* *really* want to

15:35 or if you think a life in academia is your calling

15:35 you'd be better off hacking on your own cool project(s) for a few years

15:35 ibdknox: the last one is the important bit I think

15:35 everyone I've ever talked to has said don't do it unless you want to be in academia

15:35 gfredericks: samaaron: I think I'd consider it a calling if I was more confident about the future of academia :/

15:36 ibdknox: heh

15:36 samaaron: ibdknox: yup, i'd generally agree with that

15:36 ibdknox: I looked into it for a while

15:36 samaaron: gfredericks: and I also agree - academia is going to get a serious shake-up soon

15:36 muhoo: academia is a bubble atm

15:36 samaaron: especially with the internet delivering so much quality material these days

15:37 jedmtnman1: gfredericks: my wife did a phd and i had to join (AA) Academics Annon. to recover

15:37 samaaron: hahaha

15:37 ibdknox: lol

15:37 samaaron: my PhD nearly destroyed me

15:37 and I was spat out the other end in not particularly good shape

15:37 physically, mentally or skill-wise

15:37 gfredericks: between the lots-of-money-for-a-degree-you-don't-use bubble and the internet-induced-free-learning-identity-crisis I have a hard time giving up a dev salary for years just in case it'll be awesome

15:38 samaaron: one thing it did do was to teach myself a lot about myself

15:38 in a zen-like way

15:38 ibdknox: My problem with academia is that there isn't enough doing

15:38 muhoo: or a neitzche-like way

15:38 samaaron: ibdknox: they have a different definiteion of doing :-)

15:39 but in general I would agree

15:39 there is not enough emphasis played in building stuff

15:39 have people looked into the Bauhaus?

15:39 ibdknox: yeah, which in my opinion is the only way to prove anything

15:39 gfredericks: ibdknox: proofs can also prove things :P

15:39 samaaron: ibdknox: unless it's purely theoretical

15:40 mdeboard: gfredericks: tautologies are tautologies!

15:40 ibdknox: pure theory isn't very useful ;)

15:40 It has to be applied at some point

15:40 samaaron: ibdknox: i don't know about that...

15:40 gfredericks: ibdknox: now THAT sounds like a tautology

15:40 ibdknox: haha

15:40 gfredericks: is not useful till you use it

15:40 samaaron: :-)

15:40 ibdknox: :D

15:41 gfredericks: ibdknox: there's a lot of pure math that I enjoy for its own sake

15:41 samaaron: but seriously, I think we should be studying the Bauhaus model

15:41 ibdknox: enjoy != useful (necessarily)

15:41 samaaron: Bauhaus?

15:41 samaaron: i think those guys did a lot of stuff right

15:42 ibdknox: A German design 'institute'

15:42 ibdknox: ach so

15:42 samaaron: they did huge amounts of innovation

15:42 the whole Ikea style is rooted in their work

15:42 ibdknox: samaaron: this one http://www.cs.umb.edu/~alilley/bauhaus.html ?

15:43 samaaron: ibdknox: http://en.wikipedia.org/wiki/Bauhaus

15:43 ibdknox: yeah, not sure why I passed over that one

15:43 muhoo: datomic looks pretty interesting. though i'm a little lost because there's no project.clj in it :-)

15:44 samaaron: the cool thing about Bauhaus was that they taught through studying theory AND working on REAL industry projects

15:44 ibdknox: samaaron: that sounds right up my alley :)

15:44 samaaron: ibdknox: I thought it would be :-)

15:45 I really think it's an important education model to study

15:45 TimMc: Urgh, can't figure out querystring destructuring in Noir. {:keys [foo]} seems to expect :foo in the route itself.

15:45 ibdknox: TimMc: it doesn't

15:45 TimMc: just that a field named foo was submitted

15:45 TimMc: :-(

15:45 ibdknox: TimMc: post or get request?

15:45 TimMc: get

15:46 ibdknox: /someurl?foo=blah

15:46 would fill that in

15:46 TimMc: Ah!

15:46 mdeboard: TimMc: Did you ever get your answer about the schema

15:46 ibdknox: or alternatively

15:46 mdeboard: from last night

15:46 (or this morning?)

15:46 TimMc: mdeboard: Not really.

15:46 ibdknox: /someurl/:foo => /someurl/blah

15:47 TimMc: All the Java forums talk about writing SQL parsers. >_<

15:47 ibdknox: would be another way to do it :)

15:47 mdeboard: Oh, awesome

15:47 seems weird, but I know nothing about jdbc muckery

15:48 TimMc: ibdknox: I'm writing a pre-route, actually, so I don't want to restrict the inputs.

15:48 ibdknox: TimMc: gotcha

15:48 felideon: TimMc: why did you find Lobos unsuitable?

15:48 ibdknox: TimMc: pre-routes give you the whole request, since they are often used for filtering on headers and such

15:48 TimMc: felideon: Can't figure it out.

15:48 ibdknox: TimMc: that might be the issue

15:48 jeffdik: muhoo: http://datomic.com/company/resources/integrating-peer-lib

15:48 felideon: I guess it's like Rails migrations, but if you haven't used those...

15:49 ibdknox: TimMc: {{:keys [foo]} :params}

15:50 TimMc: ibdknox: That's the one!

15:50 felideon: I've only seen one Lobos example, and it was horrifying.

15:50 muhoo: jeffdik: yyep, reading that now

15:50 felideon: TimMc: you just want to be able to execute raw SQL which contains your db boot script? or do you want a wrapper so you can write such a script in a lispy way?

15:51 TimMc: felideon: As far as I can tell, in Lobos the "uppermost" schema is not represented as a single thing you can read all at once, it is scattered across a bunch of migrations.

15:51 muhoo: looks like it's aot compiled :-0

15:51 TimMc: felideon: I want any reasonable way of initing a DB with a schema. Splitting on semicolons is sort of not OK.

15:51 felideon: TimMc: yeah that's what it seems like. which is different than a "db boot" type of DSL

15:52 TimMc: splitting on semicolons?

15:52 ibdknox: TimMc: there's some rough stuff in korma.incubator for that stuff

15:52 lots of "stuff" going on there lol

15:52 TimMc: felideon: (apply jdbc/do-commands (.split (slurp "foo.sql") ";"))

15:53 muhoo: so funny how all these things end up basically reinventing sql with different syntax

15:53 TimMc: This should be a solved problem, right?

15:53 felideon: TimMc: oh, right.

15:53 TimMc: it's been solved in Real Lisps.

15:54 amalloy: TimMc: oh man. i hope you never have any semicolons in your strings

15:54 TimMc: amalloy: Right.

15:54 felideon: but that just means no one has done it for Clojure, it seems.

15:54 TimMc: Or Java, apparently?

15:55 felideon: TimMc: well... what can I say.

15:55 muhoo: felideon: how do other lisps solve it?

15:55 felideon: ibdknox: so what are the current limitations of the schema stuff in korma.incubator

15:56 ibdknox: felideon: I have no idea, I threw it together in an hour to see what it would be like. It's annoyingly vendor specific

15:56 felideon: ibdknox: postgres?

15:56 ibdknox: TimMc: I think exec-raw will let you execute multiple statements in one call

15:56 TimMc: in korma, but I haven't tested that theory

15:56 TimMc: ibdknox: Not DDL.

15:56 ibdknox: :(

15:56 TimMc: Silently fails.

15:57 ibdknox: jdbc sucks :/

15:57 felideon: muhoo: http://marijnhaverbeke.nl/postmodern/postmodern.html#tabledef

15:57 ibdknox: TimMc: easier would be to just shell out and run the damn sql file lol

15:57 TimMc: :-(

15:57 felideon: muhoo: http://clsql.b9.com/manual/ch02s02.html

15:57 ibdknox: that is -not- the lisp way! :P

15:57 ibdknox: felideon: that's what I was writing it against

15:58 sadger: cemerick: Got my copy of the clojure programming today, great so far!

15:58 TimMc: I like the general idea behind Lobos, but the current version of the schema should be explicit. Like, a list of migrations followed by the current schema.

15:58 Some duplication, but that's life.

15:59 gfredericks: "Life is some duplication" -- TimMc

16:00 TimMc: -- gfredericks

16:02 felideon: granted in Lisp the benefit is that you are also defining your models with the same DSL, which is very OOP-ish I guess?

16:02 dnolen: nice http://himera.herokuapp.com/synonym.html

16:03 will add more goodies later

16:03 felideon: ibdknox: so jdbc was what caused you to 'hit a wall' ?

16:04 ibdknox: felideon: no, it can be done, someone just needs to care enough :)

16:04 felideon: even with jdbc

16:04 ?

16:04 ibdknox: felideon: It wasn't a problem I needed to solve, people just kept asking about it

16:04 felideon: sure

16:04 felideon: right, sounds like a fun thing for me to do

16:04 to learn me some clojir

16:04 ibdknox: that's why I put it in incubator :)

16:06 dnolen: `fogus: thx!

16:07 Bronsa: `fogus: missing closing paren on "Assign a function to a variable" example

16:07 ibdknox: dnolen: ^

16:07 felideon: does anyone know why swank-clojure depends on an old slime version? does there need to be more support from the slime side for things to work a bit better?

16:08 dnolen: Bronsa: it's a Github project, fork and submit pull request.

16:09 if anyone else wants to improve please do - at the moment it's just a simple HTML file.

16:09 Bronsa: oh ok!

16:10 Borkdude: I guess "lein test" is the most practical way of running tests, even if I have an Eclipse project?

16:11 (not that I want to use Eclipse, I'm just trying to see it from the perspective of my students)

16:13 amalloy: felideon: because slime devs don't do releases at all - your code has to work with CVS HEAD, which is constantly changing

16:14 so technomancy (or someone) just picked a revision and said "Here. This is the version we're going to use."

16:15 felideon: "screw the lispers who want to keep a nice slime-enabled REPL side-by-side" :)

16:15 amalloy: but yeah, i see what you mean.

16:15 amalloy: felideon: volunteering to publish and maintain a version of swank that keeps up with the constantly-breaking slime revision?

16:15 the-kenny: Let's face it: Slime has a horrible codebase. Desparately needs a re-write.

16:16 felideon: amalloy: i might, if thrush operators, square brackets, and ()-is-not-nil doesn't drive me crazy enough to drop Clojure :P

16:18 ambrosebs: @technomancy: mmm nice dream :) (typed clojure preventing NPE)

16:18 muhoo: it is tragic how set in our ways we get. i.e. ()-is-not-nill driving feliedon crazy, no joins in nosql db's driving me crazy.

16:19 felideon: the-kenny: I almost thought you were kenny tilton for a second. but that's physically impossible.

16:19 the-kenny: felideon: Nah :)

16:20 llasram: muhoo: I'm not sure those are comparable... Maybe this is my bias, but I think ()-nil in/equality is something you'd just get used to and get over, while annoyance at the lack of joins in your NoSQL datastore of choice perhaps suggests a problem-datastore match?

16:20 felideon: he's not a slime fan either :P

16:20 llasram: s,match,mis-match,

16:21 texnomancy: the-kenny: I really want someone who isn't me to make nrepl.el awesome

16:21 https://github.com/technomancy/nrepl.el <- fork and have at it

16:21 the-kenny: There was some other programming related channel where people were rude to me, thinking I was making fun of some guy with a nickname which also contained "kenny".

16:21 texnomancy: TimMc: I don't think the dream of "declare your migrations in one backend-agnostic format" is ever going to deliver; databases just vary too for you to be able to swap them out cleanly as an abstracted-away implementation detail

16:21 despite what activerecord claims

16:22 the-kenny: texnomancy: Hm, I'll add it to my 'Someday' list

16:22 TimMc: texnomancy: I'm not even looking for DB-agnostic.

16:22 muhoo: llasram: that's entirely possible, thanks.

16:22 texnomancy: TimMc: sure; I'm saying that's my beef with lobos

16:22 muhoo: actually, migrations and activerecord/orms are what drive me crazy about sql

16:22 texnomancy: I think its goal is unrealistic

16:22 * felideon reads about nrepl

16:22 TimMc: I'm not seeing the problem with migrations.

16:23 llasram: Yeah. A *lack* of any coherent way of doing migrations is one of the biggest problems I'm facing with the NoSQL datastores my company is using

16:24 jtoy: how would I turn this function into a function that returns true/false ? (re-find #"^http://&quot; word)

16:24 llasram: I agree on ORMs though :-)

16:25 felideon: technomancy: nrepl.el is something that could be used instead of SLIME, for instance?

16:25 daniel_: vening all, im trying to learn clojure by writing a chess computer. Have started to realise

16:25 metellus: jtoy: there's probably a better way but you could wrap it in (not (nil?

16:25 amalloy: jtoy: well, first why do you care if it returns true/false? you can just use the string/nil in a boolean context

16:26 Bronsa: jtoy: (boolean (re-find #"^http://&quot; word))

16:26 amalloy: but if you really want a boolean, you can just call (boolean ...)

16:26 daniel_: that i have a lot of functions (get-piece, move-piece, valid-move?) that all take the current board as an argument

16:26 muhoo: texnomancy: moved to the lone-star state, have you?

16:26 jtoy: amalloy: it is expected for other methods I call,

16:26 t

16:26 hx

16:26 daniel_: i think im missing a functional programming technique here, how should i keep a running state of the current board

16:27 muhoo: daniel_: atom?

16:27 amalloy: daniel_: taking the current board as an argument is probably the best way. alternatively you can introduce either mutability or monads, both of which sound pretty unpleasant to me

16:28 daniel_: i didnt really want to introduce mutability, but it also seems a bit daft and repetitive having all my functions taking the current board as an argument

16:28 amalloy: daniel_: it's only daft if you imagine that such a thing as the "current board" exists and can change

16:28 technomancy: felideon: that's the idea

16:28 felideon: texnomancy: why did you lose interest in nrepl.el?

16:29 hmm twins.

16:29 technomancy: felideon: I don't have time for it and don't enjoy writing elisp since Clojure has spoiled me

16:29 felideon: if I ever got a clojure->elisp compiler working I'd be much more likely to work on it

16:29 felideon: yeah I don't blame you.

16:30 amalloy: the idea is that your functions can operate on any board, and you can have multiple boards in existence at once. perhaps you're searching the problem space for the "right" move, so you speculately create a new board then want to go back, then...it's much easier if you just pass a board explicitly

16:30 felideon: so what's a good clojure dev setup right now? (i came from emacs/SLIME spoilage) pretty much clojure-jack-in ?

16:30 daniel_: i suppose amalloy, muhoo ill look at atoms aswell. Not too familiar with them atm

16:31 felideon: s/came/come

16:31 technomancy: felideon: until nrepl.el is written, yeah =)

16:31 daniel_: amalloy: good point about searching for the right move with multiple boards

16:31 amalloy: daniel_: i strongly recommend against using an atom to hold the current board. it makes backtracking, multitasking, and lots of other things you would want to do with a chess board so much harder

16:31 technomancy: felideon: GNU emacs 24, lein-swank plugin, clojure-mode, and M-x clojure-jack-in

16:32 felideon: s/nrepl.el/light table

16:32 technomancy: daniel_: take a look at the reduce approach here: https://github.com/technomancy/swarm-go/blob/master/src/swarm/go.clj

16:32 felideon: sure, if you don't like SSH

16:32 felideon: why emacs 24? elpa?

16:32 technomancy: heh true

16:34 amalloy: daniel_: my first clojure project was a minimax solver for contract bridge. you might be interested in some of what's going on at https://github.com/amalloy/ddsolve/blob/master/src/ddsolve/ai.clj

16:34 cemerick: technomancy: not to rain on it, but isn't nrepl.el just the tip of the iceberg? i.e. supporting swank is a long way from offering SLIME

16:34 muhoo: daniel_: hmm, amalloy is right. atom might be too blunt an instrument depending on what you're doing.

16:34 felideon: technomancy: elpa/built-in elpa

16:34 daniel_: thanks all

16:34 amalloy: multithreading and backtracking in the minimax solver to improve performance (which was still awful), enabled because i didn't have a notion of the current game

16:35 daniel_: might be hard for me to understand that one, not only because im not too familiar with clojure, but because i havent a clue how bridge is played :p

16:36 i'

16:36 ll take a look though

16:36 technomancy: felideon: 24 is just more stable/better overall

16:37 cemerick: depends how much can be implemented server-side

16:37 amalloy: yeah, i'm not sure it makes sense to me anymore either. like i said, my first clojure project so it's a bit of a mess

16:37 technomancy: I'm not sure

16:41 muhoo: llasram: wow you are right. i've wasted so much time trying to shove this rather square, mundane business problem into a round nosql hole, that perhaps i could do in postgres/korma in 30 minutes what has taken me days to try to grok in bigtable/couchdb/mongo

16:41 * muhoo facepalms

16:42 llasram: muhoo: Glad to help...? I was worried that'd come off as too condescending, but I guess forest, trees, etc sometimes

16:44 muhoo: llasram: you were very polite. but perhaps sometimes condescension can the correct tool for the job :-)

16:46 patchwork: How do I call a java method from clojure that has variable arguments?

16:46 amalloy: pass it a java array

16:46 patchwork: method(ClassThing… args)

16:46 So to-array?

16:47 (Class/method (to-array args))

16:47 amalloy: into-array is usually more convenient

16:47 but yes

16:47 patchwork: I tried that and it failed on a class cast exception

16:47 amalloy: specify the type of the array

16:47 patchwork: Aha

16:47 amalloy: &(into-array ["X" 2])

16:47 lazybot: java.lang.IllegalArgumentException: array element type mismatch

16:47 amalloy: &(into-array Object ["X" 2])

16:47 lazybot: ⇒ #<Object[] [Ljava.lang.Object;@ab0220>

16:48 patchwork: Got it, thanks

16:48 let me try that

16:49 Same error, it just says "No message." and under that [Thrown class java.lang.ClassCastException]

16:49 Here is my code: (Scalr/resize vvv 200 (into-array BufferedImageOp []))

16:50 where vvv is a BufferedImage

16:50 felideon: the-kenny: so do you have any experience writing elisp?

16:50 solussd: anyone here use lobos? I'm getting a cryptic error when I try to perform a migration: [SQLITE_ERROR] SQL error or missing database (near "lobos": syntax error).

16:50 the-kenny: felideon: Not much

16:50 muhoo: patchwork:: also, is it a static method? if not, then maybe (.method instance (to-array args)) . also, the items in the array all have to be the same typ

16:50 patchwork: muhoo: It is a static method

16:50 Also, I am passing it an empty vector, so there are no items in the array

16:51 felideon: the-kenny: i'll add that to my 'someday' list too then :P

16:51 the-kenny: :D

16:51 Let's see whose someday comes first

16:52 technomancy: you don't need elisp experience, you need a compiler that targets elisp

16:53 or alternately an emacs implementation on another multi-language runtime

16:53 hiredman: source->source is an option too

16:53 (no need to restrict the target to elisp bytecode)

16:54 technomancy: definitely

16:55 hiredman: did you see my post to emacs-devel?

16:55 Stefan was slightly more receptive than I expected

16:56 hiredman: no, I am not on any emacs lists

16:56 technomancy: don't blame you

16:57 http://lists.gnu.org/archive/html/emacs-devel/2012-04/msg00684.html if you're interested; apparently immutable strings are not as unrealistic as I'd expected

16:58 hiredman: technomancy: I would really hope that people don't go around mutating them as a matter of course

17:02 llasram: I

17:02 I mutate every string I get my hands on, just to confuse other libraries

17:03 gfredericks: llasram: every noun in that sentence has a non-technical sense, which makes the sentence a lot weirder

17:03 huangjs: is there a lein-swank 1.5.0-SNAPSHOT that I can use?

17:03 * gfredericks imagines llasram is a librarian

17:04 kasterma: I am wondering if there is a more idiomatic way to do what I do in https://gist.github.com/2473791

17:05 * llasram imagines exposing twine to controlled level of radiation

17:05 kasterma: tt is a vector that determines if we update the map mm at value of as by va.

17:05 I know my variable naming is not optimal, but this is as small as I can get the example to be.

17:05 huangjs: anyone using lein-swank 1.5.0?

17:06 technomancy: huangjs: there is no lein-swank 1.5.0

17:06 you can use lein-swank 1.4.4 with swank-clojure 1.5.0; just add it to :dependencies

17:06 gfredericks: kasterma: the first/rest stuff can be done with destructuring in the update-mm arg list

17:06 huangjs: technomancy: ah, ok

17:07 kasterma: gfredericks: Indeed. What about the recursion to use assoc to update the map.

17:07 Any better ideas for that?

17:07 gfredericks: kasterma: having trouble understanding what the algorithm is doing

17:07 dnolen: yoklov: so what state did you game end up in?

17:07 huangjs: technomancy: works like perfect, thanks for the help!

17:07 technomancy: no problem

17:08 kasterma: Start with some map (mm) if tt[idx] is not nil, set mm[idx] to be mm[idx] + va[idx].

17:08 Run through all idx in the domain.

17:08 amalloy: this looks like a reduce over the tuple [t a b] accumulating in m, or something

17:08 yoklov: dnolen: still in progress, i have 3 hours left. it's very good so far

17:08 kasterma: Oops, set mm[idx] to be mm[as[idx]] + mm[as[idx]] + va[idx]

17:09 gfredericks: kasterma: yeah 96% of the time you don't need recursion

17:09 kasterma: The recursion does look a little ugly to me, but I don't know how to rid myself of it.

17:10 (the actual context is trying to update a factor in a probabilistic graphical model to take some evidence into account).

17:10 gfredericks: kasterma: also, if you want a map with keys of (0...n-1), a vector can be that

17:10 though I see you're using (1..3)

17:10 dnolen: yoklov: awesome! still a 1st person thing?

17:11 kasterma: I didn't find an assoc for vectors.

17:11 yoklov: dnolen: no, you're not supposed to use existing code. it's mostly paths with the canvas, which is a large reason it tool longer than I though. figuring those out is tough.

17:12 dnolen: yoklov: gotcha, looking forward to trying it out! :)

17:12 mmarczyk: kasterma: assoc is assoc for vectors

17:12 gfredericks: &(assoc [100 101 102 103] 2 :foo)

17:12 lazybot: ⇒ [100 101 :foo 103]

17:12 yoklov: dnolen: awesome! I'll post here and probably on twitter too

17:12 mmarczyk: yoklov: ^ as am I :-)

17:14 kasterma: mmarczyk: Thanks, I'll update that too in the code. It's getting better already. Now to get rid of the recursion.

17:15 TimMc: &(associative? [1 2 3])

17:15 lazybot: ⇒ true

17:15 gfredericks: there oughta be a dissociative? too

17:16 TimMc: (def dissociative? associative?)

17:16 gfredericks: maybe (def dissociative? map?)

17:16 since not vectors

17:16 TimMc: Oh right, vectors only append and replace.

17:17 huangjs: technomancy: i have another problem, when i do swank-connect, emacs reports "can't find suitable coding-system". I've set slime-net-coding-system to 'utf-8-unix. do I need to specify any options to lein swank?

17:17

17:17 gfredericks: and pop

17:17 technomancy: huangjs: very strange; I haven't seen that one

17:17 raek: huangjs: lein swank uses UTF-8 by default

17:17 huangjs: strange

17:17 raek: so it's only the slime side you may need to configure

17:18 huangjs: raek: my locale is also utf-8

17:19 raek: huangjs: are you using slime-connect or clojure-jack-in? did you install slime yourself, and if so, from where?

17:20 huangjs: if you type M-: slime-net-coding-system <RET> do you see utf-8-unix or 'utf-8-unix?

17:22 (also: if you use clojure-jack-in, that variable should be set to the right thing (utf-8-unix) automatically)

17:34 solussd: is there a way to get a map of all keyvals passed to a page in noir, rather than explicitly naming the ones you want?

17:37 jtoy: any of you guys deal with url unrolling on a massive scale?

17:37 all these url shorteners cause so many probems

17:38 solussd: never mind.. I'm assuming I can use {:keys [a b c] :as allkeys}

17:38 ivan: jtoy: what do you mean by url unrolling?

17:39 jtoy: bit.ly/blah -> real url

17:39 emezeske: god url shorteners are stupid

17:39 thanks, twitter

17:39 ivan: urlteam has massive databases of shortened URLs and probably tools

17:40 jtoy: I'm trying to get stats on about a million urls, so i have to resolve them all to find what the real urls are, 1 at a time is too slow, i was doing a 100 at a time and that was flooding t.co

17:41 technomancy: jtoy: map/reduce over amqp! =)

17:41 jtoy: ivan: this one http://urlte.am/ ? cool, that is really useful, i was trying to find something like this

17:41 ivan: yes

17:41 technomancy: https://github.com/technomancy/die-roboter

17:41 ivan: they're on efnet #urlteam but minimal activity

17:41 also #archiveteam

17:42 jtoy: hmm, it looks like the don't do t.co

17:43 which 90% of twitter goes through t.co, and even if the url was already shortened, twitter adds another layer of t.co !!!!!

17:44 such a waste of bandwidth too

17:44 technomancy: such nonsense

17:44 jodaro: yo dawg, i heard you liked your urls shortened so i shortened your shortened urls

17:44 amalloy: jtoy: t.co just uses url shortening as an excuse; the reason is to collect usage/click statistics

17:44 sattvik: amalloy: Exactly. And I hate it.

17:44 jtoy: amalloy: yeah i know

17:45 amalloy: jtoy: i did some large-scale url following in php, but it's all closed-source and i don't have it anymore

17:45 technomancy: I bet nathan marz loves it though =)

17:45 jtoy: yeah

17:45 huangjs: technomancy: the reason is (slime-connection-coding-systems) returns nil instead of ("utf-8-unix" "iso-latin-1-unix")

17:47 drewr: why does (-> (node/require "optimist") (.boolean "v") .-argv) compile to cljs.nodejs.require.call(null, "optimist").boolean$("v").argv?

17:47 that dollar is throwing a wrench in my plans

17:48 jtoy: technomancy: was this for me? https://github.com/technomancy/die-roboter

17:48 dnolen: drewr: it's known bug

17:49 drewr: we shouldn't munge property access names.

17:49 jtoy: To paraphrase James Dennis, ØMQ is like Git (essentially distributed) whereas AMQP is like SVN (essentially centralized).

17:50 technomancy: jtoy: just throwing it out there as an easy way to distribute a bunch of calls like that

17:50 drewr: dnolen: is it special to `boolean`?

17:50 dnolen: drewr: any JS reserved word.

17:50 technomancy: ØMQ sounds a lot like git before github; very roll-your-own.

17:50 drewr: dnolen: right

17:52 dnolen: no workarounds I'm trying seem to work

17:52 dnolen: drewr: nothing will work

17:52 drewr: oh

17:52 dnolen: drewr: patch to complier required.

17:52 drewr: I see

17:54 dnolen: drewr: if you provide one I'll happily apply it.

17:54 nDuff: Is it possible to provide explicit constructors for a class generated with deftype or defrecord?

17:54 mebaran151: is there a verion of the arrow operator that halts processing if anything result comes up nil

17:55 something like -nil?>

17:55 amalloy: there's one in contrib

17:55 -?>

17:55 mebaran151: I know I could pull out a maybe monad, but it seems like overkill

17:55 amalloy: if you're already comfortable with monads then maybe wouldn't be the worst solution either

17:56 mebaran151: I just hate to add one more dependency

17:56 in this case I could do a quick null check inline, but was thinking maybe core had something for me

17:56 huangjs: technomancy: raek: more problems lol, if i set the return value to be ("utf-8-unix" "iso-latin-1-unix"), clojure reports "Wrong number of args (3) passed to: basic$eval1254$create-repl", it's called from swank-clojure 1.4.0 instead of 1.5.0, maybe I should not mix lein-swank with swank-clojure?

17:56 jtoy: technomancy: cool, I might use it, how does it compare to storm? in regards to remote rpc, it is the same?

17:56 mebaran151: also has anyone here every worked with OrientDB

17:57 technomancy: jtoy: it's several orders of magnitude simpler than storm

17:57 mebaran151: I was looking for an embedded Mongo and it looked a little promising

17:58 technomancy: jtoy: the clojure part is about 100 LOC

17:58 jodaro: jtoy: i'm late to the conversation ... are you trying to do some distributed processing of urls?

17:58 technomancy: storm bends over backwards to avoid the need for a centralized server and to work around some of the shortcomings of cassandra

17:58 jtoy: jodaro: yes,i want to "unroll" ~ 1.5 M urls

17:58 technomancy: if you don't need data locality, amqp is far simpler

17:59 jtoy: technomancy: i haven't played with storm yet, but am thinking of using it , i don't think its tied to cassandra?

17:59 jodaro: have you done this before?

17:59 jodaro: jtoy: i played around with the 0mq majordomo pattern stuff a few months ago

18:00 jtoy: https://github.com/joshrotenberg/md-clj

18:00 technomancy: jtoy: it's not tied to cassandra, but the reason it avoids the much simpler queued workers model is due to a shortcoming of cassandra.

18:00 according to the strangeloop talk I saw on storm

18:00 jodaro: jtoy: may or may not be what you want but its pretty straightforward and simple

18:00 basically just client/broker/worker

18:00 dnolen: ibdknox: yowza, daringfireball

18:00 technomancy: https://github.com/technomancy/die-roboter/blob/master/src/die/roboter.clj <- I guess it's almost up to 200 LOC now

18:00 ibdknox: dnolen: yeah :D

18:01 that should... help

18:01 jtoy: ibdknox: nice job!

18:01 ibdknox: I had nothing to do with it

18:01 lol

18:02 jtoy: would love to know how much traffic daring fireball drives

18:02 technomancy: huangjs: very little has changed in swank-clojure 1.4 -> 1.5, but you could try falling back to see if the problem goes away

18:02 ibdknox: I wish I could tell you

18:02 he sent them directly to the kickstarter

18:02 huangjs: technomancy: sure

18:03 ibdknox: and I haven't found any analytics there

18:03 nm

18:03 jodaro: if only he had used t.co

18:03 ibdknox: I can find out how many pledges were referred from there

18:03 but not the actual traffic

18:04 jtoy: so you guys wouldn't recommend storm? i didn't know the architect was not good

18:04 technomancy: jtoy: if you can't use the standard workers-on-a-queue approach and need realtime results, storm looks really great

18:05 * nDuff tries to grok whether the constructors generated by various defrecord replacements/wrappers (ie. defrecord2) actually make their way into the Java signature of generated code

18:05 technomancy: jtoy: I just don't see a need to jump to a complicated tool for a simple workflow

18:06 jtoy: technomancy: I could use standard workers, from reading the docs of storm, what is supposed to be good about it is that you don't have to deal with all the infrastructure piees

18:06 technomancy: storm has a huge mental surface area

18:06 ibdknox: lol Jason Fried just pledged

18:06 jtoy: Jason Fried doesn't code ?!?

18:07 technomancy: what does that mean? upfront cost to get started?

18:08 technomancy: conceptual cost, sure. your use case seems like a great fit for the 200-line approach.

18:08 for your consideration: https://github.com/technomancy/bludgeon

18:09 ibdknox: lol

18:09 mebaran151: I like the project name

18:09 ibdknox: technomancy: great name

18:09 technomancy: thanks

18:09 jtoy: technomancy: haha,nice

18:09 jodaro: heh

18:11 jtoy: technomancy: what do you think of cascalog? I've been playing with that library

18:11 technomancy: jtoy: if you need data locality, it seems like the best way to achieve it

18:12 not a good fit for the problem you described though

18:13 jtoy: technomancy: I've been using it for some other data processing, but yeah, not for the url stuff

18:14 huangjs: technomancy: latest slime added some keyword parameters to swank:create-repl so in basic.clj it should be (defslimefn create-repl [target & ignore] '("user" "user"))

18:15 technomancy: huangjs: oh, latest slime is definitely going to break

18:15 need to use the version that comes with swank

18:15 huangjs: technomancy: ah, ok

18:16 technomancy: i might try to fix that since i need to use sbcl as well :)

18:16 technomancy: huangjs: if you can do it in a backwards-compatible way that would be nice, but there are lots of other issues with CVS slime as well

18:16 I won't break compatibility with the snapshot everyone is using

18:17 huangjs: technomancy: ah i see. i'll try the old slime

18:18 technomancy: you could also try ritz; I think it might work better with new slime

18:18 huangjs: technomancy: oh i didn't know that. i'll try. thanks!

18:19 technomancy: not sure about that, but it might be worth a shot

18:20 hugod: I haven't tested slime head with ritz recently...but would be open to updating to support it

18:21 technomancy: srsly, somebody plz write nrepl.el so I can deprecate this thing already =)

18:22 felideon: ritz might give me a better chance to have slime work with both CL and Clojure?

19:13 yoklov: if you do (def foo), what should the value of foo be?

19:14 nil, right?

19:14 tmciver: my repl gives IllegalStateException: Var user/foo is unbound.

19:15 yoklov: oh, hm

19:15 tmciver: You must give it a root binding (nil if you want)

19:16 yoklov: if you do (def ^:dynamic foo) it works though, right? or am I just insane for thinking that I remember that

19:16 tmciver: Nope, not for me.

19:16 Same exception

19:17 yoklov: weird.

19:17 that makes sense then.

19:17 tmciver: Maybe you have old bindings leftover?

19:19 brehaut: are you thinking of declare ?

19:20 yoklov: yeah, i think i'm thinking of declare

19:20 brehaut: so declare creates an unbound var, which is different to one bound to nil

19:20 yoklov: oh

19:20 huh.

19:20 brehaut: (because derefing it throws the above exception)

19:21 amalloy: (declare foo) is identical to (def foo)

19:21 brehaut: im pretty sure you can declare a non dynamic var too

19:21 gfredericks: oh man how do I open a directory in dired while ido-mode is on?

19:21 technomancy: C-d should do it

19:22 gfredericks: (inc technomancy)

19:22 lazybot: ⇒ 23

19:22 gfredericks: oooooh

19:22 * gfredericks upgrades to technomancy version 23

19:23 * technomancy redeems his LazyBot points for a vacation to scenic Tulsa

19:23 gfredericks: oh there's a fun phrase to google

19:24 brehaut: wow, technomancy has almost caught up to emacs

19:24 gfredericks: nevermind it wasn't fun

19:24 brehaut: the singularity is imminent

19:26 gfredericks: so there's a movie about P=NP I just found out today

19:30 mjreed: Hello. Trying to read from a JMS queue; (reify MessageListener (onMessage [msg]...)) gives me "Can't define method not in interfaces: onMessage", even though the method is clearly in the interface....

19:31 what am I doing wrong?

19:31 gfredericks: mjreed: do you need to make 'this' an explicit first arg?

19:33 mjreed: gfredericks: d'oh! the Java class that I was using as an example has a static class, and for some reason I was thinking that meant no "this". Too many languages in the pot.

19:33 Thanks!

19:36 gfredericks: yeah for static methods I'd think there'd be no need for reify

19:36 mjreed: methods aren't static..

19:36 class is.

19:36 that's where I got confused.

19:37 gfredericks: static inner class?

19:37 mjreed: right.

19:37 gfredericks: gotcha

19:43 mjreed: And it works. Woot!

19:43 Thanks again, gfredericks.

19:44 gfredericks: rich hickey at railsconf??

19:44 lazybot: gfredericks: What are you, crazy? Of course not!

19:45 hiredman: I think he is keynoting

19:45 I thought I heard that somewhere

19:45 gfredericks: he is

19:45 just finished up probably

19:45 I did not expect that. That's a terribly interesting pairing.

19:46 scottj_: anyone know what he talked about?

19:46 gfredericks: https://twitter.com/#!/deadprogram/status/194556427627536384

19:47 there's a few others under the #railsconf hashtag

19:47 technomancy: huh; I didn't know rich knew about bludgeon

19:49 mdeboard: Man that's a great quote.

19:49 because it's true.

19:51 That was a tautology, wasn't it.

19:51 gfredericks: no

19:51 LuminousMonkey: Is it?

19:51 I don't think it is..

19:52 mdeboard: "Not all great quotes are true." -- Matt DeBoard

19:52 #railsconf

19:53 scottj_: https://github.com/newhavenrb/railsconf2012/wiki/Rich-Hickey-Keynote

19:53 gfredericks: scottj_: good link

19:56 "Programmer convenience =~ Programmer replaceability" oh wow

19:58 technomancy: I want to hear more about the Kazoo Fighters

19:59 muhoo: "What if the Foo Fighters became the Kazoo Fighters?" -- wtf??

19:59 lazybot: muhoo: Definitely not.

19:59 gfredericks: my only guess was that "foo" -> X symbolizes code changing

20:00 amalloy: a lot of people are asking for lazybot's opinion today

20:00 mdeboard: really??

20:00 lazybot: mdeboard: Definitely not.

20:00 brehaut: hes very knowledgable

20:00 mdeboard: oh

20:01 gfredericks: man did he basically just go there and tell them that rails and ruby are terrible?

20:01 technomancy: sure; why waste an opportunity?

20:01 mdeboard: lolirl

20:01 technomancy: =D

20:02 gfredericks: I wonder if he had to submit a proposal

20:04 muhoo: rhickey is a new yorker. it was fun watching his nyc lisp group presentation in the early days of clojure.

20:05 technomancy: I wonder if we'll see an uptake of rubyists joining the channel to see what the fuss is about

20:05 gfredericks: "What do you guys think about making '=>' whitespace?"

20:06 technomancy: haha!

20:06 brehaut: gfredericks: i think we should make functions only be allowed to take a single ifn arg

20:07 gfredericks: brehaut: do you think we could work out a macro for blocks?

20:07 one requirement is you have to be able to call (yield)

20:07 brehaut: best potential abuse of of map literals ever

20:07 gfredericks: lol!

20:08 (foo bar baz do |okay| (+ 1 2) end)

20:08 muhoo: actually, this presentation looks a lot like stuart hollaway's conj presentation on simplicity

20:09 brehaut: actually, i think it'd need to be a set literal

20:09 gfredericks: muhoo: and also rich's later talk @strangeloop?

20:09 brehaut: dang we'd lose the order of the expressions either way

20:09 do small sets come out in the same order?

20:10 ,(= [3 4 5 6] (seq #{3 4 5 6}))

20:10 brehaut: gfredericks: lack of ordering will just emphasis the problems of concurrent programming. its a benefit

20:10 clojurebot: true

20:10 gfredericks: ,(= [6 5 4 3] (seq #{6 5 4 3}))

20:10 clojurebot: false

20:10 gfredericks: aw crap

20:10 brehaut: lol

20:11 i know! line numbers!

20:11 gfredericks: o_O

20:11 muhoo: like basic?

20:11 brehaut: like basic

20:11 muhoo: GOTO 12

20:11 gfredericks: code is just a map from labels to commands

20:12 {:label1 (goto :label2) :label3 (noop) :label2 (println "I'm label 2")}

20:12 septomin: automatic semicolon insertion, but semicolons still introduce comments

20:12 gfredericks: maybe rename :label1 to :main

20:12 muhoo: you guys... are implementing basic as a DSL in clojure? um.. ok.

20:12 brehaut: no, ruby blocks

20:12 basic is just a seasoning

20:12 muhoo: haha

20:13 amalloy: $google fogus baysick

20:13 lazybot: [fogus: Baysick: A Scala DSL Implementing BASIC] http://blog.fogus.me/2009/03/26/baysick-a-scala-dsl-implementing-basic/

20:13 brehaut: (that way fogus will will implement it for us)

20:13 damn. sniped

20:13 gfredericks: it's the new zealand lag

20:13 muhoo: too kinky for me.

20:13 damn, i have spent the entire day procrastinating, and now i hate myself.

20:14 gfredericks: correlation does not imply causality

20:14 perhaps you procastinated because you hate yourself

20:19 muhoo: i'll have to run it backwards through core.logic and see

20:20 brehaut: careful, core.logic might produce an unbounded set of ways to procrastinate if you do that

20:22 kyle_wm: hi guys, i was wonderinng if there a more idiomatic way to say (map #(if (pred %) (f %) %) coll) ? looking for something sort of like SQL's UPDATE WHERE

20:23 gfredericks: I bet flatland/useful has a fn that does that

20:23 amalloy: kyle_wm: well, if you don't mind pulilng in useful (https://github.com/flatland/useful/blob/develop/src/useful/fn.clj), you can write (map (to-fix pred f) coll)

20:23 gfredericks: BAM

20:23 amalloy: well done, sir

20:24 mdeboard: lol

20:24 kyle_wm: thanks again Alan (you helped me on SO the other day too :) )

20:24 technomancy: to-fix?

20:24 amalloy: arguably the name sucks

20:24 * technomancy would guess There's a Combinator for That™ but can't put his finger on it

20:24 brehaut: i believe haskell calls it @^$$>

20:24 clojurebot: Gabh mo leithscéal?

20:25 technomancy: amalloy: so named because there's a ";; TO FIX: name this function" comment above the defn? =)

20:25 amalloy: the idea was that (to-fix x string? read-string coll? first) reads kinda like "if x is a string, fix it by calling read-string; if it's a collection fix it by calling first"

20:25 er, drop the x

20:25 gfredericks: oh it takes multiple pairs?

20:25 technomancy: hm; maybe "coerce"?

20:25 * gfredericks goes to look at the impl

20:26 amalloy: yeah, it has loads of flexibility nobody ever really needs

20:26 although i did use two clauses for a postwalk a while ago

20:26 oh, for a tree-seq

20:27 to see all the values stored in the leaves of a nested collection of map/seqs: (tree-seq (any map? sequential?) (to-fix map? vals, sequential? seq) the-big-map)

20:27 gfredericks: so it short-circuits?

20:28 amalloy: yeah

20:31 gfredericks: (= useful.fn/any some-fn)

20:32 technomancy: so the egal paper has all this stuff about how to compare functions, but it only works if you have the source

20:33 I wonder if an appeal to Baker would help the plea to get serializable-fn mainlined

20:33 gfredericks: comparing functions? wouldn't that be the halting problem?

20:33 amalloy: gfredericks: well (a) any is way older, and (b) some-fn does some crazy nonsense if you pass more than one argument

20:34 technomancy: gfredericks: not if you're happy with lots of false negatives

20:34 amalloy: &((some-fn even?) 1 2 3 4)

20:34 lazybot: ⇒ true

20:34 gfredericks: technomancy: well okay

20:34 as long as that's in the contract

20:34 technomancy: right; operational equivalence is obviously not feasible

20:34 but you should read the paper! =)

20:35 gfredericks: $google the egal paper

20:35 lazybot: [The Eagle - Bryan/College Station, Texas | News, Weather ...] http://www.theeagle.com/

20:35 amalloy: IMO any and all are still way better than some-fn and any-pred

20:35 gfredericks: thanks google

20:35 amalloy: er, every-pred

20:36 technomancy: clojurebot: equal rights for functional objects?

20:36 clojurebot: Equal Rights for Functional Objects is Baker's paper on equality and why it's impossible to define sensible equality in the presence of mutable data structures: http://www.pipeline.com/~hbaker1/ObjectIdentity.html

20:36 gfredericks: amalloy: if you're talking about naming then I agree

20:36 amalloy: gfredericks: i'm talking about what they do

20:37 ((any = not=) x y) => (or (= x y) (not= x y))

20:37 ((some-fn = not=) x y) => (or (= x) (= y) (not= x) (not= y))

20:37 gfredericks: technomancy: I will read this paper.

20:38 o_O

20:38 cartesian product?

20:39 amalloy: yes, completely useless. it's easy to derive some-fn or every-pred from any/all, but to go the other direction you have to rewrite the whole thing

20:39 muhoo: &(doc any)

20:39 lazybot: java.lang.RuntimeException: Unable to resolve var: any in this context

20:40 amalloy: muhoo: it's in useful

20:40 muhoo: ah

20:56 budu: hi, does someone here is good with core.logic?

20:58 amalloy: ~anyone

20:58 clojurebot: Just a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."

20:58 budu: i'd like to know if it's possible for some goals to be applied only in the case where another set of goals fails

20:59 dnolen: budu: there is no general negation support if that's what you're looking for.

21:00 budu: for example, say i have a 'cousin' goal that also returns the siblings would there be a way to prune them?

21:00 in a family tree example app

21:02 dnolen: budu: there's condu and conda for pruning - but those operators are non-relational.

21:03 budu: good books of Prolog applicable here.

21:03 budu: yeah, i've tried them, but i couldn't find a way to prune enough!

21:03 still need more practice to use them

21:04 gfredericks: okay. I think I need to buy a book on all this cool stuff. Is "The Reasoned Schemer" the thing to do? or does it have prereqs?

21:04 dnolen: gfredericks: no besides a little Scheme knowledge.

21:04 budu: there's not much examples on conda and condu out there (on the web)

21:05 dnolen: budu: there's not enough core.logic examples period :)

21:05 budu: yep, working on that

21:05 dnolen: budu: excellent!

21:05 budu: i'll do a talk on core.logic tomorrow at the montreal clojure user group

21:05 dnolen: budu: I try to avoid conda / condu, so I can't speak that much on their usage.

21:06 budu: that's great

21:06 budu: anyway i think i've got enough material for a introduction

21:06 dnolen: budu: I'm sure you do

21:07 budu: don't want to make frighten people (again)

21:07 dnolen: budu: the moment you should anything running backwards people will be scratching their heads.

21:07 s/should/show

21:07 budu: @dnolen: btw, i've found a small mistake in a docstring

21:08 @dnolen: in lvaro, i think it should read 'non-ground'

21:09 dnolen: budu: thx

21:11 Frozenlo`: For the Noir users: Is there a way to redirect to the "previous page" when doing a login?

21:12 (or compojure users)

21:14 ibdknox: Frozenlo`: store the page you redirected from in the session, then when they login check if there's a stored page and redirect to that instead

21:15 amalloy: Frozenlo`: 4clojure does that, if you want to take a look

21:15 Frozenlo`: ibdknox: How do you get the page you are redirected from?

21:16 amalloy: 4clojure uses Noir?

21:16 gfredericks: Frozenlo`: should be the current page right?

21:16 amalloy: compojure

21:16 Frozenlo`: Close enough :P

21:16 gfredericks: (:uri req)?

21:16 _ato: I prefer passing it to the login page as a query/post parameter when doing the redirect. storing it the session behaves confusingly if you open things up in multiple tabs

21:18 Frozenlock: _ato: Good point. In addition someone could simply leave the login page and come back later, being redirected then.

21:22 Dr_Zorg24: Any reccomendations for a clojure tutorial/book (pregerably free or inexpensive)?

21:24 anyone?

21:24 clojurebot: Just a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."

21:25 Dr_Zorg24: I'd like a reccomendation for a good clojure tutorial/book (preferably free or inexpensive)?

21:25 gfredericks: Dr_Zorg24: clojurebot did not mean what he said

21:26 cemerick: Dr_Zorg24: http://java.ociweb.com/mark/clojure/article.html is a popular introduction.

21:26 amalloy: Dr_Zorg24: irc is not a realtime protocol. if someone hasn't answered your question within a minute, the right response is to wait. if it's been half an hour, then it's okay to repeat it

21:26 Dr_Zorg24: amalloy, ok fair enough

21:26 dnolen: Dr_Zorg24: not free, but the new O'Reilly one looks awesome.

21:27 Dr_Zorg24: thanks dnolen I'll look at that

21:27 rhc: does clojure have any notations or conventions for pure/impure functions?

21:27 mdeboard: I can confirm overenthusiastically that the new O'Reilly book is amazing.

21:27 Dr_Zorg24: oh thanks cemerick too

21:28 ok I'll definitely look into that O'Reilly book then

21:28 cemerick: Dr_Zorg24: http://clojurebook.com will give you an idea if it's right for you.

21:28 Dr_Zorg24: are we talking the latest edition or a specific one?

21:28 If what's right for me? Clojure?

21:29 cemerick: Dr_Zorg24: No, the book.

21:29 mdeboard: the book--

21:29 Dr_Zorg24: oh ok

21:29 rhc: here's the first chapter http://cdn.oreilly.com/oreilly/booksamplers/9781449394707_sampler.pdf

21:29 Dr_Zorg24: rhc thanks

21:29 rhc: (from cemerick 's link)

21:31 Dr_Zorg24: which of these is the right book?

21:31 http://books.google.com/books?id=nZTvSa4KqfQC&lpg=PR15&dq=o'reilly%20clojure%20book&pg=PP1#v=onepage&q&f=false

21:31 or http://books.google.com/books?id=p7uyWPcVGZsC&lpg=PP1&dq=o'reilly%20clojure%20book&pg=PP1#v=onepage&q&f=false

21:32 cemerick: Dr_Zorg24: the latter is not about Clojure

21:32 Google Closure is an unrelated javascript technology.

21:32 Dr_Zorg24: oh ok

21:33 gfredericks: good thing it's unrelated or it would be difficult to have conversations that involved both.

21:33 * gfredericks sighs deeply

21:34 emezeske: It's sure confusing to talk about the clojurescript compiler, which uses google closure

21:34 gfredericks: I see that you agree :)

21:34 gfredericks: emezeske: golly that's three things you could mean by the time you've gotte the syllables of "clojure" out of your mouth

21:34 Dr_Zorg24: so by using the JVM am forced to use the same ridiculousness that java does

21:34 am I*

21:35 gfredericks: Dr_Zorg24: some of the ridiculousnesses

21:35 Dr_Zorg24: like everything being a class?

21:35 gfredericks: only underneath

21:35 Dr_Zorg24: yay

21:35 that's fine I guess

21:36 gfredericks: probably the biggest sore is just the startup time

21:36 Dr_Zorg24: how bad is it?

21:36 gfredericks: and people who like doing low-level system stuff can have gripes about what they don't have access to

21:36 Dr_Zorg24: I've never done low level stuff

21:36 gfredericks: Dr_Zorg24: eh...a second or so? it probably varies a lot but it is a pain if you use it to do a task that is itself only a second or less

21:37 Dr_Zorg24: ok, then I can stick to python for really fast stuff

21:38 eggsby: Dr_Zorg24: I come from python and I love clj

21:38 Dr_Zorg24: eggsby, thanks for that, its encouraging to here (I started on java, then python, now I plan to learn clojure)

21:39 gfredericks: Dr_Zorg24: aside from what I said previously, I think the jvm part of clojure is only awkward if you haven't used java before, so you should be fine

21:40 mdeboard: Dr_Zorg24: If you are coming from Java and Python, I *STRONGLY* recommend "Clojure Programming" book

21:40 Dr_Zorg24: so does it use JIT compiling?

21:40 gfredericks: I think that's a jvm feature, so implicitly yes?

21:41 mdeboard: Dr_Zorg24: Lots of great intro on what makes lisps lisps, i.e. what makes them unique/different, as well as explanation & overview of functional programming concepts and their implementation in Clojure. Plus along the way they compare idioms in Clojure to their analogs in Ruby/Python/Java. It's very effective.

21:41 zakwilson_: Clojure can be compiled to JVM bytecode JIT or AOT. Bytecode *may* be compiled to machine code JIT if the runtime decides it's a good idea.

21:42 budu: @dnolen: where could i find your solution to the zebra puzzle?

21:44 Dr_Zorg24: gfredericks, how would the JVM part be awkward?

21:44 mdeboard, do you have a link please?

21:44 mdeboard: Dr_Zorg24: Same one linked earlier http://www.clojurebook.com/

21:45 gfredericks: Dr_Zorg24: clojure has lots of excellent java interop capabilities; the flipside of that is that often the java world leaks through, and so if you don't know anything about java/jvm it can be confusing to try to learn about both worlds at once

21:46 Dr_Zorg24: gfredericks, oh that makes sense

21:47 kasterma: mdeboard: how does it compare to The Joy of Clojure?

21:47 Dr_Zorg24: mdeboard, so that's the O'Reilly book right?

21:47 mdeboard: Dr_Zorg24: Yeah

21:47 Dr_Zorg24: k cool

21:48 dnolen: budu: it's in the core.logic repo

21:48 Dr_Zorg24: Oh cool O'Reilly on their site does print and ebook for $5 more than print

21:48 dnolen: budu: it can be cleaned up a bit symbol-macrolet

21:49 for demonstration purposes

21:49 mdeboard: kasterma: It's been awhile, tbh. Joy of.. and Practical Clojure both have strengths and are written by very smart guys who are way way way more talented than me. But I believe the latest one is the best intro to Clojure book available.

21:50 kasterma: mdeboard: thx. I have both of these in front of me now. :-)

21:50 budu: @dnolen: found it, thx for your work, it's inspiring!

21:50 dnolen: budu: no problem

21:51 Dr_Zorg24: wow if anyone wants the O'Reilly book get it on amazon, they a great price

21:51 they have*

21:51 budu: i'm out, good night everyone

21:55 muhoo: i have found personally that reading the o'reilly clojurebook reduced my stupid-question output by an order of magnitude

21:57 my short-circuiting algorithm for answers goes (comp clojurebook google irc), and almost always gets a hit on the first one

21:58 echo-area: muhoo: Do you mean Clojure Programming? I find it a great book as well

21:58 gfredericks: muhoo: I'm not sure that function does what you think it does

21:58 cemerick: muhoo: you mean (comp irc google clojurebook) ;-)

21:58 gfredericks: maybe you should read the clojurebook about comp

21:59 well google first, since we're already discussing it on irc so we must be going in that order

22:04 yoklov: heh, http://www.ludumdare.com/compo/ludum-dare-23/?action=preview&uid=7728

22:04 that was intense to make.

22:06 gfredericks: how do I move

22:06 oh that must be a png

22:07 pngs make terrible games

22:07 yoklov: yup, all the links at the top except source lead here: http://thomcc.github.com/ld23/ and you click to move

22:07 but the main image is a png

22:08 ivan: yoklov: heh, I won without collecting some things I needed

22:08 I want to keep playing though

22:09 yoklov: yeah you don't actually need the radar

22:10 dnolen: yoklov: neat! seems like a fairly small amount of code?

22:10 gfredericks: I guess I shouldn't have inferred based on the red highlight of "glass-like substance" that I should go stand in the red zones

22:10 sritchie_: can anyone here successfully use division on http://himera.herokuapp.com/index.html

22:10 ?

22:10 yoklov: dnolen: looks like about 1000

22:10 and about half of it is rendering

22:11 sritchie_: when I try (/ 1 2), I get Compilation error: RangeError: Maximum call stack size exceeded

22:11 ivan: now I am really curious about function Wf() in the compiled code was compiled from

22:11 gfredericks: sritchie_: I think it's a himera bug; dunno what to do about it

22:12 dnolen: sritchie: I think the CLJS on himera is old.

22:12 gfredericks: sritchie_: it was doing that for me back when it was first deployed

22:12 sritchie_: got it

22:12 I'll file a bug

22:12 * gfredericks goes to bed

22:15 dnolen: yoklov: yeah I was looking at the advanced output and it looked really compact.

22:16 yoklov: oh, really?

22:16 Huh, yeah.

22:18 looks like basically all of my rendering functions got inlined

22:18 which is good.

22:19 dnolen: yoklov: nice! yeah GClosure is pretty good about that if you're justing calling a function from only one place.

22:33 yoklov: dnolen: by the way, is there an idiomatic way to create a javascript object initialized with some values in cljs yet?

22:33 i guess (doto (js-obj) (aset "key" val)…) works

22:36 mmarczyk: yoklov: goog.object/create

22:37 yoklov: :/

22:37 That is how I feel about that.

22:37 mmarczyk: why's that?

22:38 I was thinking of adding a variadic overload to js-obj

22:38 calling gobject/create

22:38 so you could write (js-obj "key" val ...)

22:39 but haven't got 'round to it yet

22:39 would you feel better about that? :-)

22:39 yoklov: yeah, thats probably enough better

22:40 overall though, I still feel like clojurescript's interop isn't really good enough.

22:40 mmarczyk: actually I guess I have a better idea for "literals"

22:40 yoklov: callbacks suck as much as they do in js

22:40 dnolen: yoklov: yeah that could be better

22:40 mmarczyk: (that is, objects with fixed number of key-val pairs, as opposed to (apply gobject/create ...) time stuff)

22:41 dnolen: yoklov: I think the new reader literals could help but I'm not sure.

22:41 yoklov: dnolen: in general, or in terms of callbacks?

22:41 dnolen: yoklov: no, I only meant JS object creation

22:41 yoklov: callbacks is another thing entirely.

22:41 yoklov: yeah

22:42 okay

22:42 well no the first thing then

22:42 first thing is much more common

22:43 and I don't think it's just the canvas api which requires setting lots of values awkwardly

22:43 in general whenever it needs to be done it feels awkward

22:44 dnolen: yoklov: yeah not sure what else can be done except cleaning it up with a little macro sugar.

22:45 yoklov: dnolen: yeah, me neither. It's a bummer, clojure's java interop is so consistent and so awesome, but clojurescripts JS interop is just… not quite as good.

22:45 dnolen: yoklov: many Java APIs are just as imperative, I'm not sure how this is different.

22:46 yoklov: dnolen: having to break up dotos, for one

22:46 dnolen: yoklov: Penumbra is a good example of the kind of thing you encounter w/ stuff like Canvas.

22:46 yoklov: why do you have to do that? because you have some intermediate logic?

22:47 yoklov: setting values, though I guess you can do "aset", though I feel like I've had that work weird when closure compiled, but maybe i'm thinking of something else

22:48 honestly though I've just been doing (do (set! (.-foo bar) baz)) in the middle

22:48 as hacky as it is.

22:51 dnolen: yoklov: I thought you used a simple sets! macro?

22:52 yoklov: no, it ended up not working well with anything else

22:53 dnolen: yoklov: I kind of see what you mean.

22:53 yoklov: in Java you have setters

22:53 yoklov: in JS it's an assignment.

22:53 yoklov: dnolen: yeah, exactly

22:54 the interop is basically the same as clojures

22:54 but, java and javascript are only really superficially similar

22:55 much of it is more-or-less ignorable though

22:56 dnolen: yoklov: hmm, I wonder if (set! ...) should support

22:56 (set! o property v)

22:56 yoklov: would that address the issue?

22:57 yoklov: hm

22:57 you know, that actually might

22:58 dnolen: yoklov: I think it would, then doto could work.

22:58 yoklov: right

22:58 mmarczyk: ohhh, that's very nice

22:59 does this seem useful? https://github.com/michalmarczyk/clojurescript/tree/js-obj-init

22:59 Frozenlock: If I've intercepted a request using the (noir.request/ring-request) function, can I resend it? Something like (render [(:request-method XX) (:uri XX)] (:params XX)) ??

22:59 lazybot: Frozenlock: What are you, crazy? Of course not!

22:59 mmarczyk: (variadic js-obj + compiler macro)

22:59 dnolen: yoklov: http://dev.clojure.org/jira/browse/CLJS-198

23:00 Frozenlock: Sometimes these bots seems alive..

23:00 /s/seems/seem

23:01 dnolen: mmarczyk: that is kind of nice and in line with the implementation of array, create a tickt and a patch.

23:01 mmarczyk: dnolen: cool, off to create right now

23:02 yoklov: mmarczyk: so would the ks be symbols? or…

23:02 mmarczyk: yoklov: strings

23:03 yoklov: okay, and it would die horribly if they werent?

23:03 mmarczyk: yoklov: well, the JS engine would try to convert

23:03 dnolen: yoklov: let's stick w/ strings for now, no validation.

23:04 mmarczyk: yoklov: (js-obj 1 2) -> (js* "{1: 2}") -> (js* "{'1': 2}")

23:04 dnolen: yoklov: if you're using js-obj that explicit interop, JS expects strings.

23:05 yoklov: dnolen: right, i'm not judging, just trying to figure out what exactly it did

23:05 mmarczyk, yeah okay, that makes sense

23:05 mmarczyk: http://dev.clojure.org/jira/browse/CLJS-199

23:06 dnolen: yoklov: mmarczyk: with that patch + the fact that array emits literals - I think that should remove some pain around JS interop.

23:07 (js-obj "foo" (array 1 2 3)) compiles doesn to {"foo": [1 2 3]}

23:07 compiles down

23:07 mmarczyk: dnolen: yeah, hopefully

23:07 yoklov: oh, that would be very nice

23:07 mmarczyk: I mean, hopefully will remove some pain

23:08 dnolen: I believe there are a few spots in TwitterBuzz which could take advantage of this, I'll submit a separate patch for that later

23:13 dnolen: yoklov: mmarczyk: CLJS-199 resolved

23:13 mmarczyk: dnolen: thanks!

23:13 dnolen: yoklov: I look into improving set!

23:13 mmarczyk: dnolen: I've been looking into TransientVector and at first glance it seems that pvector nodes might need to become wrappers around arrays instead of arrays to support it; do you see any problems with that?

23:14 dnolen: btw, about CLJS-198 -- how about (set! object -property val) (rather than .-property)

23:14 dnolen: mmarczyk: oh yeah because they were Nodes before.

23:14 mmarczyk: oops my mistake, yes that's right

23:14 mmarczyk: ticket updated.

23:14 mmarczyk: :-)

23:15 dnolen: mmarczyk: I see no problem w/ that. V8 should be able to optimize that just fine.

23:15 mmarczyk: I suppose you need methods on those Nodes?

23:15 mmarczyk: dnolen: actually I need a field -- "edit" -- true or false

23:15 dnolen: so yeah, an XY problem here

23:16 dnolen: mmarczyk: oh right, yeah seems fine to me.

23:17 yoklov: Oh, I meant to mention: I dunno what causes it, but there are definitely times when chrome runs a page great in whitespace and advanced comp. mode, and firefox runs it great in advanced, but firefox in whitespace-only compilation mode runs absolutely terribly.

23:17 mmarczyk: dnolen: great. in that case, I'll be back with a patch sometime soon.

23:18 yoklov: something about big closurey conditionals, i think.

23:28 mmarczyk: dnolen: yoklov: just implemented hash code caching for CLJS collections, what do you think? https://github.com/michalmarczyk/clojurescript/tree/hash-caching

23:29 kovasb: anyone know of an api-compatible replacement for clojure.contrib.string?

23:29 dnolen: mmarczyk: excellent idea

23:31 mmarczyk: dnolen: cool, I need to fix one corner case (hash might be 0 -- should check (coercive-= nil)), then I'll create a ticket

23:31 kovasb: clojure.string is like a totally different thing

23:31 yoklov: mmarczyk: yeah, i was definitely concerned about repeatedly hashing some vectors in my game

23:33 mmarczyk: yoklov: :-)

23:35 dnolen: http://dev.clojure.org/jira/browse/CLJS-200

23:39 spjt: What is more difficult learn, Clojure or Emacs?

23:42 eggsby: heh

23:42 gonna go on a limb and say clojure

23:44 mdeboard: do what, how can you even --

23:44 What's more difficult to learn, golf or sewing?

23:44 the mamba or spanish?

23:45 xeqi: golf, mamba

23:45 mdeboard: checkmate

Logging service provided by n01se.net