#clojure log - Apr 20 2010

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

0:28 jsanda: i'm trying to use clojure.contrib.string but get the following error,

0:28 user=> (require '[clojure.contrib.string :as s])

0:28 java.lang.VerifyError: class clojure.contrib.string$loading__5009__auto____40 overrides final method meta.()Lclojure/lang/IPersistentMap; (NO_SOURCE_FILE:0)

0:28 my deps org.clojure/clojure "1.2.0-master-SNAPSHOT and org.clojure/clojure-contrib "1.2.0-SNAPSHOT

0:29 i downgraded them to 1.1.0 but now i get a FileNotFoundException

0:31 i'd like to use some of the functions in clojure.contrib.string. can anyone tell me what versions i ca/should use?

0:51 livingston: hello

0:52 well, I just learned a lot about IRC / getting verified with the nickserver, anyway...

0:52 technomancy: yeah, any chance now that we've got ops we could get that policy change?

0:52 livingston: I was trying to sort out the parallelization libaries in clojure

0:52 technomancy: *changed?

0:53 whenever I connect as my alt nick I can never change back to "technomancy" since it says I'm banned in this channel for not being registered =(

0:54 livingston: (I don't know, there's some documentation from freenode here, that's roughly what I did, http://freenode.net/faq.shtml#nicksetup )

0:54 sexpbot: " freenode: frequently-asked questions"

0:55 livingston: so the doc on the parallelization lib say it's depricated, but then talks about how to use it, and there are parallelization functions listed on the cheat sheat ...

0:55 anyone know what's up and what API I should be looking at seriously for that?

0:56 dakrone: ack, there are so man compojure libs on clojars, how am I supposed to know which one to use?

0:56 technomancy: dakrone: my guess would be this one: http://clojars.org/compojure

0:56 sexpbot: "compojure | Clojars"

0:57 technomancy: livingston: what's deprecated now? what's "the parallelization lib"?

0:57 dakrone: technomancy: cool, thanks

0:57 technomancy: dakrone: all "org.clojars.*" versions should be considered non-canonical

0:57 * technomancy wonders if that could be made more obvious in the clojars UI

0:58 technomancy: _ato: have you tried to get any volunteers to help implement features?

0:58 livingston: the stuff that's here: http://clojure.org/other_libraries says depricated but then talks about it

0:58 dakrone: technomancy: yea, more obvious would help

0:59 technomancy: livingston: oh dang; I didn't realize the forkjoin stuff was deprecated

0:59 I wonder what's going on there

1:00 livingston: i don't think it is, I think it's that wrapper, it's oddly worded

1:01 because then there is what's written here: http://github.com/richhickey/clojure/blob/1.1.x/changes.txt ~line 60

1:01 technomancy: oh, so maybe it's getting mainlined?

1:03 livingston: as far as I can tell, so I guess i just need to get the par branch from github, like it says, I was just wonding if anyone has done that or had any experince or docs on it.

1:05 Raynes: $example into

1:05 sexpbot: (into #{} '(a b a c d g g w)) => (w g g d c a b a)

1:29 livingston: later, thanks.

1:47 chessguy: is there some macro for evaluating an expression, but only 1 step of the evaluation, for debugging purposes?

2:09 slyphon: ok, NPE, you're on notice

2:11 woah woah woah, you can get a NPE in a destructuring bind?

2:11 WTF?

2:12 how the fuck is that possible?

2:13 carkh: the question is : what the f... where you doing ?

2:13 =)

2:13 were*

2:15 slyphon: https://gist.github.com/8d9ec7b059168c1a94ae

2:15 carkh: that

2:15 (essentially)

2:16 carkh: ah

2:16 slyphon: i'm seriously baffled

2:17 carkh: i think you should rather look at tyhe effect of passing nil values to the URI. constructor =P

2:17 slyphon: hrm

2:17 carkh: embarassing, i know !

2:17 slyphon: but why would it say that the NPE was coming from line 1 then?

2:17 no, i'm not embarassed, i make mistakes like that :)

2:18 carkh: we all do =)

2:18 * slyphon is not a Java programmer

2:18 slyphon: it's just that the traceback is telling me the wrong thing

2:18 carkh: you might want to try it at thee repl

2:18 * slyphon nods

2:18 slyphon: i'll just put in some sane defaults

2:20 ,(java.net.URI. "http" nil "localhost" 3000 "/path" nil nil)

2:20 clojurebot: #<URI http://localhost:3000/path>

2:20 slyphon: ,(java.net.URI. "http" nil "localhost" nil "/path" nil nil)

2:20 clojurebot: java.lang.NullPointerException

2:20 slyphon: fuck you, Java!

2:21 carkh: ah expecting an integer it seems =P

2:21 slyphon: ,(java.net.URI. "http" nil "localhost" 0 "/path" nil nil)

2:21 clojurebot: #<URI http://localhost:0/path>

2:21 slyphon: !!!

2:21 * slyphon HATES

2:22 carkh: ,(java.net.URI. "http" nil "localhost" 80 "/path" nil nil)

2:22 clojurebot: #<URI http://localhost:80/path>

2:22 slyphon: ,(java.net.URI. "http" nil "localhost" -1 "/path" nil nil)

2:22 clojurebot: #<URI http://localhost/path>

2:22 slyphon: mother

2:22 carkh: haha that's bad

2:22 magic value !

2:22 * slyphon mails a flaming-bag-of-poo to the standard-library guys

2:26 slyphon: GAH!

2:27 what a bunch of jerks

2:36 carkh: thanks

2:36 carkh: i needed someone to point out the obvious :)

2:36 carkh: =)

2:47 Licenser_: morningf

3:33 vIkSiT: hi all

3:34 what resources would people recommend to learn functional data structures/algorithms using clojure?

3:34 LauJensen: Morning :)

3:35 esj: Hello all

3:35 vIkSiT: hey LauJensen, esj

3:36 hrm

3:36 looks like comcast is having troubles

4:08 defn: vIkSiT: id suggest just reading Programming Clojure, reading other people

4:08 people's code

4:08 you will start to see "imperative" style clojure vs functional style

4:08 it's just time on task

4:09 aww he left

4:09 LauJensen: time on task ?

4:10 defn: yeah, making stuff work

4:10 writing code for fun

4:10 if you don't know a lick about FP I say just jump into the mix and immerse yourself -- you start to understand how it works after you fail enough

4:11 LauJensen: I say solve Eulers 1 - 50 without any sideeffects, then you're good to go

4:11 defn: totally forgot about that -- euler was a great way to learn Clojure -- I did exactly what you say

4:11 although I think I kicked the bucket at 47 :)

4:12 rys: Solve Eulers 1-50 in the same night!

4:12 LauJensen: Thats more sensible than someone like kotarak for instance, how kicked the bucket af 216 I think :)

4:12 defn: oh my god.

4:12 LauJensen: (and put the results on clojure-euler.wikispaces.com IIRC)

4:13 defn: i should go back and keep working on my euler stuff -- it's fun to watch your repository grow and grow

4:14 although i can say that euler is definitely not the best way to learn all of clojure -- i knew nothing of certain real life clojure niceties living in the euler bubble

4:14 zmila: i solved almost all of the second 50 Eulers in clojure :) the first half was in javascript

4:17 defn: :)

4:22 AntonyBlakey: Trying to run autodoc on clojure git head, gives me errors like this: ./src/clj/clojure/core_deftype.clj: failed (ex = java.lang.IllegalArgumentException: Wrong number of args passed to: core$fn (core_deftype.clj:14)). which results in no documentation for things like deftype/defrecord et al.

4:22 Anyone seen this before?

4:23 Actually, mostly this error: failed (ex = java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to clojure.lang.IPersistentVector (protocols.clj:9)).

4:23 I'm on OS/X

4:24 Chousuke: hmhm

4:25 licoresse: I've seen it a lot, earlier ;)

4:25 AntonyBlakey: Using autodoc-0.7.0-standalone.jar

4:25 zmila: the main problem in solving Eulers in Clojure is: when I get result in REPL, then I'm lazy to copy and organize the solution pretty

4:25 AntonyBlakey: I definitely have the latest sources

4:26 Chousuke: doesn't look like there's anything weird in core_deftype.clj

4:27 so most likely it's an autodoc bug

4:28 AntonyBlakey: It happens on 19 source files, yet the gh-pages doc on github includes the docs for the stuff that won't generate for me, so an autodoc bug looks unlikely

4:28 Chousuke: did you try running autodoc from git?

4:29 AntonyBlakey: my next step

4:30 Chousuke: there's nothing wrong in protocols.clj either

4:31 AntonyBlakey: Nor in any of the other files.

4:32 Chousuke: zmila: :P

4:32 zmila: use pretty-print

4:33 though I suppose even better would be to use emacs and slime and write your code nicely organised right from the start :)

4:33 AntonyBlakey: Bugger, git head has the same problem. I wonder if it's an OSX specific bug.

4:34 Chousuke: I'll give it a try

4:34 AntonyBlakey: Thanks

4:35 Chousuke: what's the command you're using to build the docs?

4:35 AntonyBlakey: java -jar<path to autodoc.jar>

4:35 In the clojure checkout

4:35 dir

4:36 hoeck: AntonyBlakey: are you using the latest clojure? there were some breaking changes to deftype recently

4:36 AntonyBlakey: right this second git head

4:37 And autodoc craps out on walk.clj, xml.clj, set.clj ...

4:37 Chousuke: I get it too.

4:38 AntonyBlakey: Hmm. I wonder how Tom generated the clojure.org docs then ... they include defrecord and deftype. Oh well.

4:39 Chousuke: it craps on the ns forms

4:41 AntonyBlakey: Not in core_deftype - it fails on the first defmacro

4:43 Chousuke: I wish it printed the entire stacktrace :/

4:52 hm. can't seem to be able to extract a stacktrace out of it

4:53 I suppose you need to send mail to the autodoc maintainer

4:54 AntonyBlakey: I can get a stacktrace with a source mod.

4:54 Chousuke: so what function throws the error? :/

4:55 or rather, what function call the function that throws the error? :P

4:55 calls*

4:55 AntonyBlakey: clojure.lang.Compiler.analyzeSeq(Compiler.java:4599)

4:56 Chousuke: hm. that's not the right one

4:56 AntonyBlakey: not much help. It's actually clojure not compiling the source

4:56 Chousuke: or if it is... eep

4:56 hm, might be a problem with the included clojure version actually

4:57 it's using 1.1.0 to laod 1.2.0 sources :/

4:57 let's try upgrading the dependencies...

4:57 AntonyBlakey: http://gist.github.com/372213

4:57 I did that, gave a different error.

4:58 Maybe that's the error to track down.

5:00 a pprint error

5:00 Chousuke: right. and that's the error that you get when you try to reload clojure.core

5:05 it doesn't seem like --load-except-list works either :(

5:07 AntonyBlakey: I can't work out how to load the param file for clojure that comes with the autodoc src.

5:08 It specifies not to load core.clj and parallel.clj

5:09 Amongst other things.

5:20 Chousuke: AntonyBlakey: I have no idea either :P

6:03 vu3rdd: LauJensen: your emacs screenshot on the grand tour blog looks awesome.

6:03 which color theme is that?

6:03 LauJensen: The one I mention in the preceding post: http://www.bestinclass.dk/index.php/2010/03/approaching-productivity/

6:03 sexpbot: "Approaching Productivity | BEST IN CLASS"

6:06 vu3rdd: LauJensen: Thanks

6:06 LauJensen: vu3rdd: np :)

6:19 defn: best way to serializing a single clojure datastructure? (spit (java.io.File. data.dat) @*some-ref*)

6:21 bsteuber: defn: I've got (with-out-writer filename (prn obj)) - but no idea if it's better or worse

6:21 LauJensen: (spit file (prn obj))

6:22 bsteuber: ,`spit

6:22 clojurebot: clojure.contrib.duck-streams/spit

6:23 LauJensen: duck-streams? A little outdated are you

6:24 unfo-: duck-streams aren't relevant anymore?

6:24 LauJensen: Not since they renamed to 'io'

6:24 unfo-: aah. kewl. ty :)

6:25 LauJensen: np :)

6:26 * licoresse test

6:27 licoresse: someone ping me

6:27 LauJensen: We'll need an IP :)

6:28 Licenser_: failed

6:28 licoresse: :) np

6:28 apple routers s***

6:29 (sometimes)

6:30 LauJensen: Goes for anything made by apple IMHO

6:31 licoresse: I'm not so clever I could survive on anything different

6:32 LauJensen: Like your post on erc

6:32 LauJensen: Great :)

6:32 licoresse: I did the same here, but using growl.el instead

6:33 I did it for compiler notifications too

6:33 LauJensen: Its quite handy I think - Only thing I need, is that if I accidentally leave Emacs in #clojure and leave the computer, I'll probably miss any and all highlights since I left :)

6:34 licoresse: just use some enlive to scrape todays log

6:35 defn: :)

6:35 enlive was so weird to me at first

6:35 but it makes so much damned sense now

6:36 Licenser_: hmm do refs have something like hooks? so I get the stuff in alter?

6:36 LauJensen: ,(doc add-watch)

6:36 clojurebot: "([reference key fn]); Experimental. Adds a watch function to an agent/atom/var/ref reference. The watch fn must be a fn of 4 args: a key, the reference, its old-state, its new-state. Whenever the reference's state might have been changed, any registered watches will have their functions called. The watch fn will be called synchronously, on the agent's thread if an agent, before any pending sends if agent or ref. Note that

6:37 Licenser_: ah neat

6:39 * licoresse wish there was a remove-all-watches fn

6:40 LauJensen: the watch is hooked on each datastructure, so I think you'll have to roll your own

6:40 licoresse: or just replace the add-watch fn

6:41 no time this week

7:38 defn: class com.stuartsierra.lazytest$loading__5009__auto____3 overrides final method meta.()Lclojure/lang/IPersistentMap;

7:39 ideas?

7:41 it's kind of a bummer to have seen circumspec, and now lazytest, and to have followed their development for what seems like ages, not ever being able to get them to work

7:41 chessguy: is there some macro for evaluating an expression, but only 1 step of the evaluation, for debugging purposes?

7:41 hoeck: defn: someone tried to extend a final method

7:41 defn: chessguy: (macroexpand-1)?

7:42 chessguy: oh i see what you mean

7:42 chessguy: yeah, not for macros

7:42 rhickey: defn: what are you doing when you get that message?

7:42 defn: (use 'com.stuartsierra.lazytest)

7:42 hoeck: chessguy: clojure-debuggers are in the works, meanwhile you can use java debuggers to do that

7:43 cemerick: defn: smells like trying to use a lib AOT-compiled for 1.1 with 1.2

7:44 defn: cemerick: that might be it -- perhaps stuart is moving lazytest to 1.2 and hasn't cleaned it all up yet

7:44 cemerick: defn: it's not a matter of cleaning anything up -- stuff that's AOT-compiled for 1.1 is not binary compatible with 1.2

7:44 defn: cemerick: i specifically saw 1.2.0-master-SNAPSHOT and 1.2.0-SNAPSHOT

7:44 chessguy: probably a code smell anyway, i need to break up these 30-line functions into smaller pieces

7:45 defn: but it might be a user error -- ill rebuild the jar -- i just found this guy hanging out in target/

7:45 cemerick: maybe, but when in doubt, load the lib from sources or a source jar instead of an AOT-compiled jar

7:46 defn: cemerick: *nod* -- im not familiar with mvn, i did a mvn install in the project root and found this in target/ as i said

7:47 anyway, before i take up anymore of your time let me try a few things -- thanks!

7:47 cemerick: sure. FYI, AOT compilation and maven are orthogonal. It's just a matter of what's been configured to happen upon building.

7:49 bpsm: I'm having a terrible time building contrib master against clojure master.

7:49 I posted a message about it

7:49 http://groups.google.at/group/clojure/browse_thread/thread/1830a793986c4935?hl=de#

7:49 any ideas?

7:50 rhickey: bpsm: the very latest? I spent the weekend and yesterday fixing that

7:50 bpsm: yea, I know...

7:50 and I'm not seeing it on my mac anymore, but I get it consistently on my quad-core linux

7:51 rhickey: bpsm: what Java on the Linux?

7:51 bpsm: Java version: 1.6.0_10

7:51 rhickey: Sun/er, Oracle's Java?

7:52 bpsm: rhickey: sun's

7:52 rhickey: um, now Oracle has 2 Java's, aargh

7:52 defn: wait...what? 2 javas?

7:52 bozhidar: yes

7:52 jrockit as well

7:52 from BEA

7:53 Licenser_: chessguy: o.O

7:53 chouser: well, the sun one is techincally oracle's now. :-/

7:53 Licenser_: 2 javas?

7:53 bozhidar: which they acquired with WebLogic...

7:53 rhickey: bpsm: you are absolutely certain you have clean builds of both Clojure and contrib, and your contrib build is using that Clojure?

7:53 chessguy: Licenser_, ?

7:53 bozhidar: Licenser_: JRockit being the second one

7:53 Licenser_: I am scared of someone having 2 javas

7:53 bpsm: rhickey: yes, I'm certain (see the reproduction script inlined in my message)

7:54 bozhidar: I hear they are planning to merge some of the features of JRockit into the standard distribution

7:54 defn: there are two javas: http://en.wikipedia.org/wiki/Java and http://en.wikipedia.org/wiki/Java_(programming_language)

7:54 sexpbot: "Java - Wikipedia, the free encyclopedia"

7:54 bpsm: rhickey: (I keep hoping I'm doing something obviously stupid, but I can't find it yet.)

7:54 bozhidar: so they might not be two for long...

7:54 bpsm: rhickey: the repo script gets fresh copies of both repositories form github and builds from those.

7:55 bozhidar: defn: there are actually more javas - the coffee, the island ... :-)

7:55 some people spell them jawa though...

7:55 rhickey: bpsm: what if you use commit 19dd3c593e7a29cbca514c6ab7424ff22e353cc6 of CLojure?

7:56 chessguy: anybody played around with porting any of the code from the SICP videos (http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/) to clojure?

7:56 defn: bozhidar: my first link was to the island :)

7:56 bpsm: rhickey: 19dd3c59, the same error, the last time I tried.

7:57 defn: chessguy: yes, let me grab the link

7:57 bpsm: rhickey: will adjust the repo script accordingly to try it again...

7:57 defn: chessguy: http://sicpinclojure.com/

7:57 sexpbot: "SICP in Clojure"

7:57 bozhidar: defn: I assumed it was the Java platform - too much Java development can do that to someone's mind :-)

7:57 rhickey: bpsm: I don't see wher eyou are forcing contrib build to use a specific version of Clojure: -Dclojure.jar=...

7:57 chessguy: mm, the book is a little different from the videos

7:58 defn: chessguy: ah, my fault -- chessguy, do you want to work on it together? id like to watch those videos

7:59 bpsm: rhickey: "mvn -e -Dclojure.jar=$CLOJURE package", no?

7:59 chessguy: defn, i already started on porting code from one of the lectures

7:59 bsteuber: bpsm: I've got exactly the same problem

7:59 defn: which lecture? perhaps we could combine, fill in the gaps and such

7:59 chessguy: defn, there's a really cool generic simplification engine that they build in episode 4a. was hacking on it until like 1 am last night

8:00 bsteuber: gave up this morning to focus on other work, though

8:00 chessguy: defn, i have yet to find any code online anywhere in any language for that

8:00 so i'm porting it directly off the slides in the video

8:00 defn: chessguy: awesome man -- ive actually downloaded all of those videos but never got around to finishing more than 1 and 2

8:00 bpsm: bsteuber: yea, I may have to move my current project back to 1.1 as contrib.json stopped working for me yesterday in connection with this problem

8:00 chouser: I just rebuilt the latest clojure and contrib on linux -- no problem at all.

8:01 defn: builds for me as well

8:01 chouser: bpsm: I didn't use -e on my mvn line

8:01 chessguy: defn, they are totally awesome. should be required watching for every single programmer

8:01 defn: i also did not use -e

8:01 bpsm: chouser: good that it works for someone.

8:01 chouser: bpsm: :-/

8:01 bpsm: chouser: I only used -e for the output it produces. i've run it without -e and gotten the same result.

8:01 chouser: this is java 1.6.0_16-b01

8:01 rhickey: bpsm: I don't grok your shell stuff well enough to see that

8:02 chessguy: defn, this simplifier is like 100 lines of code, but it would probably be 1000 in other languages, and not as expressive

8:02 though....it's not actually working yet...

8:02 bpsm: rhicky: i've rerund my repro script for 19dd3c and see the same badness. (what am I missing?)

8:03 defn: chessguy: cant wait to get to it, im going to continue watching right now in fact :) and chessyguy, if you are interested in combining code into a consumable repo of code examples for the videos let me know -- ill start compiling as i watch

8:03 rhickey: bpsm: 19dd3c is quite neutered, it's hard for me to imagine it doing anything like what preceded or followed it

8:03 chessguy: defn, i've already committed to doing a similar port of the code in 4b for the math club in our company

8:04 rhickey: bpsm: in particular, if you are getting:

8:04 Caused by: java.lang.NullPointerException

8:04 at clojure.core.protocols$fn__6000$G__5996__6004.invoke(protocols.clj:11)

8:04 bpsm: rhickey: it's hard for me to imagine too

8:04 rhickey: then you are definitely not using the right version, as protocol based reduce was commented out

8:04 bsteuber: bpsm: it builds for me with -Dmaven.test.skip=true

8:04 rhickey: Caused by: java.lang.NullPointerException

8:04 at clojure.core.protocols$fn__6000$G__5996__6004.invoke(protocols.clj:11)

8:04 at clojure.core$reduce__6111.invoke(core.clj:4719)

8:04 chessguy: defn, yeah, i probably need to start a github repo somewhere

8:05 bsteuber: though I'm not sure if everything's fine with that build

8:05 bpsm: rhickey: no, I get teh java.lang.IllegalArgumentException: No method in multimethod '*' for dispatch value errors that come from complex-numbers

8:05 rhickey: bpsm: could you please paste/gist the full stack trace you are getting with 19dd3c593e7a ?

8:06 bpsm: rhickey: will do

8:08 defn: chessguy: chessguy http://github.com/defn/clojure-sicp

8:08 chessguy: wow

8:08 that was fast

8:09 defn: chessguy: it's only a few commands

8:09 chessguy: yeah, i haven't really fiddle with github before

8:09 bpsm: rhickey: http://gist.github.com/372353 is partial, clojure unit tests don't write the full traces anywhere obvious.

8:10 defn: chessguy: oh -- it's pretty easy -- pm me if you need help with anything.

8:11 chessguy: defn, some of the code samples will be the same as or similar to the book, but i personally wouldn't mind re-implementing them anyway

8:11 defn: chessguy: yeah it's just a little knowledge project. who knows, it might be useful to someone at some point...

8:12 bpsm: rhickey: I'm trying to reproduce it in test-json by removing the test-complex-numbers test to see if I can get a clearer stack trace.

8:13 |jowag|: Hi there!

8:13 I can redirect *out* with binding macro, but it only works (correctly) for current thread. Is there a way to redirect *out* for current and all other threads created later?

8:14 chessguy: defn, am i better of /msg defn i want to clone that repository, right?

8:14 ha

8:14 #fail

8:14 cemerick: |jowag|: binding is thread-local by definition

8:15 chessguy: #morecaffeineneeded

8:16 |jowag|: cemerick: I know, that's why I'm finding something else to perform the redirection

8:16 Licenser_: jowag: you can use functions to do that

8:17 cemerick: |jowag|: rebinding *out* globally (or permanently swapping out System.out) is almost never a good idea. What are you fundamentally trying to do?

8:17 Licenser_: like (future x (fn [] (binding [*out* *out*] (your code))))

8:17 or something like that I guess

8:20 |jowag|: cemerick: I'm trying to remotelly control REPL without swank, so I assumed my custom server will need to redirect *out* so I can send it to the client :)

8:20 bpsm: rhickey: the good news is that I can't reproduce the problems with json

8:21 rhickey: those came up toward the end of the weekend thread

8:21 rhickey: and showed the connection to protocols

8:21 rhickey: bpsm: you have 2 completely unrelated problems, all those related to protocols are gone, this is just a multimethod thing with complex

8:22 bpsm: rhickey: ok. two problems. not related.

8:22 rhickey: still don't unerstand why the multi-method related builds fail for me on linux and not on mac os, but i'll continue to investigate this evening. maybe i'll figure it out.

8:24 hircus: bpsm: same JVM version on both?

8:24 cemerick: |jowag|: The rare valid use case. Most people asking that are actually looking for a logging framework or something. :-)

8:25 bpsm: hircus: 1.6.0_10, _16, _15, _19, but all on linux

8:26 cemerick: |jowag|: you want alter-var-root

8:26 ,(doc alter-var-root)

8:26 clojurebot: DENIED

8:26 cemerick: hrm

8:26 _ato: bpsm: which revision of contrib are you testing with? I can't see that in the reproduce log you posted to the list

8:27 cemerick: |jowag|: there's a variety of remote repl servers out there already though. *shrug*

8:27 |jowag|: cemerick: Yep, I was thinking about it, but I don't know if it won't have some nasty side-effects

8:27 bpsm: _ato: you're right the mvn download output barfed all over it.

8:27 _ato: it's af2a730fde0d8df0ab4a41153580105a36a20e7f

8:28 |jowag|: cemerick: well I know of swank and nailgun, any other repl servers you know of?

8:28 cemerick: |jowag|: if you do it wrong, it certainly will. Worth noting is that stuff written to System.out doesn't go through *out*, so that's something to consider.

8:28 |jowag|: enclojure has one; very nice, small, easily-embeddable API

8:31 chessguy: defn, you still around?

8:31 SynrG: win 2

8:31 buh

8:34 defn: chessguy: i am

8:34 _ato: bpsm: :/ I just ran your reproduce script on (Arch) Linux x86_64 (Sun java 2.6.0_20) and it succeeded with those revisions as well

8:37 Licenser_: sun jav 2.6?!?

8:38 _ato: typo

8:38 1

8:38 |jowag|: cemerick: thanks, I'm gonna look into it

8:38 Licenser_: ah okay IU was scared ther e:)

8:41 hi _ato by the way

8:43 _ato: aah

8:43 got it

8:43 reproduced it I mean

8:43 on a Ubuntu box with 1.6.0_15

8:43 i686

9:02 rhickey: _ato: can you please paste a stack trace?

9:06 _ato: rhickey: http://gist.github.com/372402

9:06 same as bpsm, I'm working on pulling it out of maven and trying to isolate it now

9:06 rhickey: _ato: thanks

9:12 zmila: ,(reduce (fn [acc [k v]] (assoc acc v (conj (acc v) k))) {:a 1 :b 1 :c 1})

9:12 clojurebot: java.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IPersistentCollection

9:13 zmila: ,(reduce (fn [acc [k v]] (assoc acc v (conj (get acc v []) k))) {:a 1 :b 1 :c 1})

9:13 clojurebot: java.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IPersistentCollection

9:13 zmila: ,(reduce (fn [acc [k v]] (assoc acc v (conj (get acc v []) k))) {} {:a 1 :b 1 :c 1})

9:13 clojurebot: {1 [:a :b :c]}

9:14 zmila: ,(reduce (fn [acc [k v]] (assoc acc v (conj (acc v) k))) {} {:a 1 :b 1 :c 2})

9:14 clojurebot: {2 (:c), 1 (:b :a)}

9:17 _ato: rhickey: seems the problem might actually be being triggered by clojure.contrib.test-load-all if I take that test out then test-complex-numbers succeeds

9:18 ah.. so it reloads everything

9:23 rhickey: _ato: so, depending on the set sort, may reload the defmethod that complex has already updated, not to be updated again

9:24 avar: I've forgotten the term used for "a language whose syntax is made up of its core datastructures" which applies to all lisps, someone help me out :)

9:24 chouser: homoiconic

9:24 avar: thanks:)

9:27 chouser: np

9:29 cemerick: some bold claims: http://blogs.perl.org/users/leon_timmermans/2010/04/why-perl-6-is-different.html

9:29 sexpbot: "Leon Timmermans at blog.perls.org: Why Perl 6 is different"

9:30 _ato: rhickey: yes, I think you're spot on

9:30 rhickey: so we need to either pull test-load-all or force it to run last

9:31 _ato: http://gist.github.com/372430

9:31 ^ consistent on both machines

9:32 avar: cemerick: How funny. I was just about to reply to that:)

9:32 cemerick: avar: M-expressions, fully realized (ostensibly)?

9:33 avar: cemerick: In theory anyway.

9:37 Licenser_: cemerick: I find the rules idea pretty interesting

9:37 so I think it is 'too powerful' for the easy things so it will be a cool but hardly used feature

9:38 rhickey: another option is to have defmulti generate defonce

9:38 since this is a general reloading issue

9:38 avar: Rules are used to parse Perl 6 itself. It's a very nice feature. I wish it was available in other languages, like clojure :)

9:39 AWizzArd: rhickey: if you are not too busy right now: did you see my messages to you some days ago, where I reported a bug in Cells?

9:39 cemerick: Licenser_: The syntax for rules itself looks pretty rough.

9:39 rhickey: AWizzArd: I'm not supporting cells right now

9:39 avar: Essentially perl 6 rules are just a way to move what was previously individual regex ops into subroutine calls. So you can write parsers just like you'd write classes.

9:39 rhickey: AWizzArd: got my hands full prepping for 1.2

9:39 cemerick: Most people have a hard time with sexpr macros, so more complicated metaprogramming systems are going to have even less uptake.

9:40 rhickey: AWizzArd: do you think your cells problem indicates a problem with deftype et al

9:40 ?

9:40 AWizzArd: rhickey: yes, I understand it. I just wanted to inform you about it. It's a fix of just 6 loc. It comes from deftype. (deftype Foo [a]), (:a (Foo. 10)) ==> nil

9:40 avar: cemerick: Sure, that's my worry as well. But that was always going to be the case with M-Expressions wasn't it ?:)

9:41 Licenser_: cemerick: YeaI had a really hard time to understand all the stuff even for simple things

9:41 AWizzArd: You use the field :lock in Cells, and try to access its value via (:lock some-cell). But now instead of :lock we should use (cell-sentry some-cell) instead. That's it. Shows up at 7 places in the code. Very small fix.

9:42 SynrG: win 2

9:42 Licenser_: avar: yes it is an interesting feture but the question is is it really needed?

9:43 avar: cemerick: Perl 6 (which is still evolving) does a somewhat good job of bringing you there. e.g. if you'd write (defun + (a b) (plus a b)) in lisp you'd write multi sub infix:<+>(Num $a, Num $a) { plus($a, $b) } in Perl 6. The infix:<> in turn being defined in a grammar rule that you could override

9:43 rhickey: AWizzArd: so, not a problem in deftype, but in cells.clj?

9:43 avar: Licenser_: I have no idea, for some value of "needed" :)

9:43 Licenser_: *g*

9:43 AWizzArd: rhickey: I would say so, yes. If deftype is not supposed to support the (:field obj) syntax anymore, then it is in cells.clj.

9:44 rhickey: AWizzArd: so, will have to wait

9:44 Licenser_: avar: what I mean is, it is cool but may of the cool things are nearly useless (or unused) in 90% of the cases

9:44 _ato: rhickey: yes, it would be nice if reloading was safe, but I can see this happening any time there's a an arrangement where one namespace "registers" something with another (whether by multimethods or some other means). I guess the only way to get around that would be to reload all the dependent namespaces transitively, which might well break other things

9:45 rhickey: _ato: there is a general issue for that transitive reloading, no progress recently. Too big to take on now

9:45 AWizzArd: rhickey: yes sure, was jfyi. I fixed it locally on my system.

9:45 avar: Licenser_: Being able to do more metaprogramming is always good. There's a lot of neat stuff being done in Perl 5 with the metaprogramming facilities it has already.

9:45 rhickey: AWizzArd: ok, I'm sure I'll trip over it next time I update :)

9:45 AWizzArd: great :-)

9:45 avar: Licenser_: Perl has bettes support for higher order functions and introspection than any other syntax-heavy language I know of, which gets used a lot in practice.

9:45 anyway I'm going to stop blathering about Perl 6 in #clojure :)

9:45 Licenser_: heh

9:46 chouser: modular regex I'm sure would be very nice for certain problem domains

9:46 Licenser_: I found the regexp support in java/clojure a bit sad

9:47 avar: Modular regexes are good for anything you use regexen for, them being just strings kind of sucks for anything complex

9:47 Licenser_: I wanted to write a tokenizer and failed to find a performant way to parse the syntax since I did not find something like 'find the next matching token' I'm sure perl 6 would be great there

9:48 _ato: rhickey: not sure I entirely understand the purpose of test-load-all but if it really is just a simple sanity check to make sure all namespaces in contrib are loadable, probably just taking out :reload would do it. Or I guess removing them all with remove-ns first and then loading them again (without :reload)

9:49 rhickey: _ato: I'm more inclined towards a general fix, as people trip over this in the repl as well

9:49 almost done

9:50 _ato: yep it has bitten me as well at the REPL. :)

9:53 chouser: avar: well, we do have #"" which is ever so slightly better than plain strings. But I agree something better should be possible.

9:53 It makes sense that perl would put that better thing at the root of the whole language, and it'll be interesting to see how that pans out. I think the right solution for Clojure will look a bit different.

9:53 qbg: Do any of the Clojure IDEs hid the javaness of exceptions?

9:56 *hide

9:59 hamza: gents what is the difference between >> and >>> bit operators in Java?

10:00 Licenser_: >> is much bigger and >>> is realy really much bigger?

10:00 _ato: hamza: http://java.sun.com/docs/books/tutorial/java/nutsandbolts/op3.html

10:00 sexpbot: "Bitwise and Bit Shift Operators (The Java&trade; Tutorials &gt; Learning the Java Language &gt; Language Basics)"

10:09 avar: cemerick: Anyway, I replied at http://blogs.perl.org/users/leon_timmermans/2010/04/why-perl-6-is-different.html

10:09 sexpbot: "Leon Timmermans at blog.perls.org: Why Perl 6 is different"

10:12 chouser: I was once pretty excited about Perl 6. Now I see mutable collections and just feel tired.

10:12 mefesto: I'm taking a first look at leiningen and was wondering if this is becoming the defacto standard build setup for clojure projects? Is this mainly for clojure only projects and maven for mixed?

10:13 chouser: mefesto: if you're comfortable with maven, I'm not sure there's much value in using lein.

10:13 mefesto: chouser: so it's a simpler alternative if you don't want to learn maven?

10:15 chouser: I shouldn't say much as I don't know much, but a log of people who are intimidated by maven seem to enjoy lein.

10:15 mefesto: ok thanks. looking forward to "the joy of clojure" btw.

10:16 hircus: mefesto: Incanter just moved from Maven to Lein, so you might want to ask there about the rationale

10:16 * hircus waiting for Polyglot Maven, and hoping its Clojure syntax will converge more with Lein's

10:17 Chousuke: chouser: I had to code some python the other day and I found myself continuously annoyed by little things like dictionaries throwing exceptions when keys are missing and that you can't actually do "for (k, v) in dict:" ...; or that x, _ = foo fails if foo has only one element; etc...

10:17 mefesto: hircus: will do, thanks. I've been using ant this whole time and am just fed up :)

10:18 Chousuke: chouser: overall, I think python is a nice language, but the little things are suprisingly important :/

10:19 (I think newer versions of python might support the k,v iteration of dicts but 2.4 doesn't)

10:22 also I kept assuming that methods of lists return the list :P

10:22 arbscht: Chousuke: but you can k,v iterate over dict.items() iirc

10:23 Chousuke: arbscht: yeah, but I don't see why that's necessary :/

10:23 hircus: arbscht: yes; in fact you still have to do that if you want k,v iteration even in 2.6

10:23 Chousuke: I suppose it has something to do with the python philosophy of "explicit is better than implicit" but I think it fails in this case :P

10:24 hircus: Chousuke: if Python were to support multiple return values, then there is a clean way to support both for k in d: and for k,v in d:

10:25 Chousuke: hircus: well, I really wouldn't mind if only the latter case were supported, as in Clojure.

10:25 hircus: but there'd be a performance cost, presumably, in the case where you really only want the keys

10:25 I guess d.keys() already handle that

10:25 Chousuke: yes.

10:25 digash: ,(deftype Foo [#^String bar])

10:26 clojurebot: DENIED

10:26 digash: [ 1] bar : Object


10:26 is this intentional, bug or not implemented yet?

10:30 rhickey: digash: not implemented, only primitives and Object right now

10:30 the hint will still work, but the field type will not be limited

10:31 i.e. the hint will avoid reflection in uses of the field

10:33 digash: got it, i guess the constructor signature will reflect that too when it is implemented

10:33 bsteuber: how do you guys organize your local javadoc?

10:35 rhickey: digash: right now it follows other hints, non-primitives are type hints but not storage or argument restrictions

10:38 digash: rhickey: in the future, is there any reason not to do an argument restrictions. I think it will make producing libraries for Java consumption easier.

10:39 rhickey: digash: it's on the todo list

10:40 cemerick: could you please put in an issue for the ns + :gen-class thing you found the other day?

10:40 I don't want to drop it

10:42 digash: rhickey: cool, is there an official todo list or is there a ticket I could track?

10:44 rhickey: digash: https://www.assembla.com/spaces/clojure/tickets/252-support-typed-non-primitive-fields-in-deftype

10:44 sexpbot: "#252 - Support typed non-primitive fields in deftype (New) | Clojure | Assembla"

10:44 cemerick: rhickey: sure, np.

10:45 rhickey: cemerick: you can put it in 1.2 milestone

10:45 cemerick: rhickey: you want a patch too, or no?

10:46 rhickey: cemerick: I got tripped up on something given the straightforward fix, then got pulled onto more pressing things, feel free to give it a shot

10:46 digash: rhickey: awesome, thank you.

10:52 cemerick: rhickey: the most straightforward fix seems to be (into {} (partition 2 options)) in gen-class -- that didn't pan out for you?

10:53 rhickey: cemerick: no, I got some error

10:53 cemerick: hrm, OK

10:54 rhickey: cemerick: when calling compile explicitly

10:54 cemerick: rhickey: as opposed to via clojure.lang.Compile, etc?

10:56 rhickey: cemerick: (compile 'the.thing.you.gave.me) was as far as I got

10:56 cemerick: ok

10:57 bsteuber: rhickey: do you confirm received CA's? Or should I just assume it arrived after like 2 weeks and start proposing patches?

10:58 rhickey: _ato or bpsm: could you please try the latest clojure in the context where you were seeing failed contrib build on complex? thanks

10:59 bsteuber: your name will appear here: http://clojure.org/contributing. Note I don't check every week

11:00 bsteuber: rhickey: ok, thx

11:01 rhickey: cemerick: if that's working for you then I might have tripped on the other problems, since fixed

11:02 cemerick: it should just be that simple fix

11:02 cemerick: rhickey: I'll give it a whirl later today, I'm off in faraway lands at the moment. :-)

11:03 rhickey: cemerick: I'll try again if you could point me to that gist again

11:04 cemerick: rhickey: http://paste.lisp.org/display/97911

11:05 bsteuber: rhickey, _ato, bpsm: the newest clojure commit fixes the complex number bug for me

11:06 rhickey: bsteuber: this during contrib testing phase? was it reproducible for you before the fix?

11:08 bsteuber: rhickey: yes

11:08 rhickey: bsteuber: great - thanks!

11:23 _ato: rhickey: yep, the fix worked on my machine as well

11:23 rhickey: _ato: great, thanks

11:28 shayfrendt: pop quiz of the day! why is this run-tests! method always returning a status code of 0 when run with leiningen? https://gist.github.com/31356c45d66b3594de17

11:29 (since that screams n00b, feel free to kick me back to the ruby channel... :-)

11:34 Chousuke: leiningen is actually a bash script

11:34 maybe it just ignores the return value of java?

11:34 or maybe there are no failing or erroneous tests ;P

11:35 _ato: rhickey: this fix means we can no longer redefine the multimethod (eg to change the dispatch function) though, right? (well without undefining it explicitly)

11:37 I guess it has to be one or the other

11:37 djpowell: just spotted a japanese translation of stuart's book with a quirky cover

11:38 hircus: djpowell: URL?

11:39 djpowell: http://shop.tsutaya.co.jp/book/product/9784274067891/

11:39 sexpbot: "????????Clojure/???????????? - TSUTAYA ??????????? - ?"

11:39 stuartsierra: I like the cat

11:39 shayfrendt: Chousuke: hehe console output: https://gist.github.com/9b42a842ba3049a6672a I think you're right though...perhaps the bash script isn't outputting the error codes properly

11:43 hircus: stuartsierra: yah. perhaps someone should design a cat-based mascot for Clojure? (assuming Rich is not a dog-person)

11:43 fogus_: The guy who translated Stu's book has a great Scheme site: http://practical-scheme.net/

11:49 hircus: fogus_: ah, he's the Gauche guy? cool

11:50 anyone knows if in the Japanese translation, he wrote an introduction? would be interesting to read the perspective of a Scheme expert on Clojure

11:51 rhickey: _ato: there is now remove-all-methods, but yes, must undef to change the dispatch function

11:52 hircus: (at Indiana University, where the programming language faculties are Scheme heavy, Clojure tends to meet with some.. skepticism)

11:53 rhickey: hircus: no cat mascots for Clojure please

11:54 hircus: rhickey: was half tongue-in-cheek. No animal mascot at all, then?

11:54 cemerick: hrm...

11:54 ~mascot

11:54 clojurebot: the official mascot of clojure is a futuristic ninja robot

11:54 cemerick: I was never that fond of the ninja thing, though.

11:54 rhickey: oh, seriously, their pupils are two parens! :-P

11:54 fogus_: cemerick: I was when I was 8

11:55 cemerick: ninjas are fine; ninja mascots? *shrug*

11:55 "hey mister, your ninja is draggin'!"

11:55 * cemerick wonders if anyone was into vintage MST3K

11:56 * stuartsierra likes cats

11:56 cemerick: My cat writes half my code.

11:57 fogus_: cemerick: I vote Tom Servo... or Torgo as the official mascot

11:58 pjstadig: ninja robots have stm built in

11:58 cats do not

11:58 cemerick: +1 on Tom Servo :-)

11:59 stuartsierra: looks like a Dalek

11:59 danlarkin: EXTERMINATE

12:00 pjstadig: hehe Tom Servo

12:00 fogus_: Official Clojure phrase: MITCHELL!

12:00 pjstadig: i'm not sure he looks like a ninja, tho

12:03 technomancy: shayfrendt: I haven't figured out a way to pass exit codes from the project subclassloader to the main leiningen code yet

12:03 cemerick: pjstadig: what he lacks in combat skills he more than makes up for in cunning and wit.

12:03 pjstadig: the other requirement is futuristic...can't just be a ninja robot

12:04 technomancy: the security settings of the subclassloader prevent it from exiting

12:06 hircus: gtg -- bye all

12:23 chessguy: defn, ping?

12:27 * fogus_ is reading http://codemonkeyism.com/scala-vsclojure-part-3-similarities/

12:35 cemerick: fogus_: helluva lot of hand-waving

12:36 stuartsierra: most programming language comparisons involve a lot of hand-waving

12:36 fogus_: I not even sure where to go with that post. I think I'll just stare at that XKCD comic

12:37 cemerick: Right.

12:37 fogus_: The funny thing is, lots of these sorts of "debates" are won simply by showing up and being louder.

12:38 fogus_: I tend to prefer the fingers-in-ears-screaming-lalalalalalalala method of debate

12:40 technomancy: controversy gets readers; that's how the Internet works

12:42 fogus_: technomancy: You mean things like "Macros are the equivalent of Godwin’s Law."

12:45 _ato: I've yet to read a good article that tries to "compare" Clojure and Scala -- they all seem very superficial, and as you say more about trying to generate controversy than really do any justice to either language

12:47 stuartsierra: because no one makes serious use of both at the same time

12:47 * fogus_ raises hand

12:47 stuartsierra: really?

12:47 fogus_: I work a lot in Scala at work.

12:48 Used to do some monkey work in the code itself also

12:48 stuartsierra: cool

12:48 so what's your take?

12:48 fogus_: Having said that. I think it's pointless to draw a comparison

12:48 * cemerick used scala exclusively for about a year

12:49 stuartsierra: fogus_: heh

12:49 fogus_: You can squint and say "well this looks like that, and that looks like this other thing", but that doesn't tell you much

12:51 As for that post, I wouldn't want to replace my macros with compiler plugins. :p

12:53 cemerick: About the only meaningful similarity is that they're both on the JVM -- which is an important connection. Other than that, just about everything is different enough to admit that they're on completely different branches of the family tree.

12:55 * fogus_ Wants to kick GWT today

12:55 stuartsierra: fogus_: just gwin and bear it

12:56 fogus_: I want the head of whomever invented CSS

13:00 chouser: Any discussion of Clojure that sums up its approach to concurrency as "STM" is suspect.

13:01 * cemerick will live to regret commenting on that piece.

13:02 shayfrendt: technomancy: thanks for the feedback - went out to lunch. i think for now we can probably just write a bash wrapper script with a regex that looks for "FAIL" in the console output :-)

13:03 slyphon: doh!

13:03 why isn't def- public?

13:03 * slyphon grumbles

13:03 chouser: there's no such thing as 'def-' is there?

13:03 slyphon: no?

13:04 chouser: there's defvar- in contrib

13:04 slyphon: (def #^{:private true} *blah* "this is private")

13:04 chouser: there's a def- in core

13:04 it's just not exported

13:04 public, whatev

13:05 chouser: are you sure?

13:05 tomoj: I can't seem to (:gen-class :main false)

13:05 * slyphon goes to look

13:05 tomoj: "Duplicate key: :main"

13:05 in 1.2.0

13:05 chouser: tomoj: ha! nice.

13:05 slyphon: hrm

13:05 chouser: damn, i thought i saw one

13:06 tomoj: similarly I can't supply a different :name

13:06 slyphon: i guess i just dreamed it

13:06 chouser: I've been wrong a lot today, so I wouldn't be surprised if you found it.

13:06 slyphon: :)

13:06 tomoj: I guess in 1.2.0, gen-class/proxy for jetty might be outdated?

13:06 redinger: technomancy: So do you have any kind of CI around your lein projects?

13:07 cemerick: tomoj: it's a known bug, I'll hopefully have a patch into rhickey today

13:07 sattvik: tomoj: I believe it's a bug in 1.2. I remember reading about it somewhere.

13:07 chouser: tomoj: I think gen-class itself is broken.

13:07 cemerick: oh, that's the one you were working on?

13:07 tomoj: yeah, but now we also have alternatives to gen-class, right?

13:08 cemerick: chouser: yes, though not much yet

13:08 tomoj: just take out the :main false for now

13:08 chouser: nope, nothing replaces all of gen-class yet, though that will be a happy day...

13:08 tomoj: ah

13:08 sattvik: tomoj: I don't think so, not if you want to subclass a class, rather than just interfaces.

13:09 tomoj: well I think I don't even need this gen-class stuff anyway, I'm looking at http://www.deepbluelambda.org/programming/clojure/generate-your-class-and-proxy-it-too

13:09 sexpbot: " Generate your class and proxy it too : Deep Blue Lambda"

13:09 tomoj: but all I want to do is start jetty with a .war, not create my own servlets, so.. probably don't need any of this crap

13:09 sattvik: No, you don't need gen-class or proxy for that.

13:10 chouser: you're sure you don't need a named class for a .war?

13:10 cemerick: tomoj: you need at least one gen-class, as chouser suggests.

13:10 to do a .war deployment, that is

13:11 hiredman: can't you use a deftype for that these days?

13:11 tomoj: the .war is already there

13:11 it's not clojure stuff

13:11 sattvik: tomoj: If you already have a war file, you just need to do the embedded Jetty part.

13:11 tomoj: I just want to start jetty and point it at that war in clojure, so that clojure is in the same jvm as jetty

13:11 sattvik: oi, I feel like I should already understand this with all the help you gave me

13:12 cemerick: hiredman: that's a good point -- deftype names should be stable now, though I don't know if they're stable as in "obvious" or stable as in "consistently generated".

13:12 tomoj: sattvik: thanks again

13:16 sattvik: tomoj: Something like this should work: http://gist.github.com/372766

13:16 tomoj: thanks, yeah, that's basically what I'm working on

13:16 except jetty 6, so s/eclipse/mortbay/

13:17 sattvik: tomoj: Yes, that's right.

13:17 chouser: deftype produces the ununged classname all the time now, but still won't let you extend a concrete class.

13:23 cemerick: chouser: you *could* implement javax.servlet.Servlet, but I'll bet that'll cause issues in most containers.

13:34 slyphon: is there a slime function that switches the namespace of the repl to the one the point is currently in?

13:34 * slyphon re-parses that to see if it was anywhere near grammatically correct

13:35 tomoj: slyphon: well, slime-repl-set-package can help

13:35 C-c M-p

13:35 slyphon: ah

13:35 * slyphon tries

13:35 tomoj: I had one that didn't require you to accept the default and would just switch right away, but it doesn't seem to work anymore

13:35 slyphon: oh, bummer

13:36 tomoj: would be pretty simple to fix it now that I know a bit more about swank-clojure, will let you know if I do

13:36 slyphon: awesome!

13:36 consider it a feature request :)

13:38 tomoj: it's close enough with the default

13:38 ;)

13:39 technomancy: shayfrendt: that works for now; I'd like to find a solution to the ant subclassloader issue though

13:40 redinger: nothing yet

13:40 shayfrendt: technomancy: roger dodger

13:40 technomancy: shayfrendt: hint hint, patches welcome =)

13:40 replaca: hmm, are docstrings on multimethods broken in master right now?

13:40 shayfrendt: technomancy: haha i knew that was comin

13:40 technomancy: i'll let ya know what we come up with

13:41 technomancy: shayfrendt: probably just involves some API detective work

13:41 hiredman: replaca: what do you mean broken?

13:42 replaca: I haven't done much testing, so it might be something weird in my code, but I'm seeing no doc metadata on multimethods that are declared with docstrings

13:43 (and by "much" I mean "any") :-)

13:44 this is on files loaded with "load" if it matters

13:44 hiredman: works for me

13:44 replaca: hiredman: thanks, I'll do more detective work then

13:44 hiredman: you aren't trying to use docstrings with defmethod are you?

13:44 replaca: no, defmulti

13:45 it's through all of contrib with the autodoc engine

13:45 but maybe there's something the autodoc engine is doing that's causing the prob

13:49 hiredman: replaca: the :vars in the generated json doc for contrib have been empty for a while

13:49 slyphon: is there a way with the :require clause in ns to descend into a ns, like (:require [clojure.contrib [http [agent :as agent]]])

13:49 stuartsierra: maybe since fns got metadata?

13:50 slyphon: no

13:50 slyphon: damn

13:50 hiredman: stuartsierra: docs and such still go on vars don't they?

13:50 curl http://github.com/richhickey/clojure-contrib/raw/gh-pages/api-index.json

13:50 stuartsierra: dunns

13:50 dunno

13:51 hiredman: anyway, clojurebot's ability to lookup stuff from contrib has been broken for so time

13:55 tomoj: has anyone using pmaven configured extra repositories?

14:07 ah, translating a pom.xml with an extra repo to pom.clj just leaves it out

14:08 guess this means it's impossible in pom.clj

14:08 I'm beginning to like xml

14:08 fogus_: hiredman: Whoa!

14:08 Somehow that escaped me

14:12 technomancy: back in the day we had to use proxy to add metadata to fns!

14:12 cemerick: tomoj: pmaven is quite certainly in a fetal stage. In any case, XML will be the primary project description language for some time to come, given the abundance of tools that work with it.

14:17 tomoj: "Copying 105 files to ../lib" hah

14:25 Borkdude: Can I get an Eclipse ctrl+space like autocompletion in emacs?

14:26 and I don't mean C-M-/ (dabbrev-completion)

14:26 technomancy: Borkdude: can you be more specific?

14:26 err-descriptive

14:27 Borkdude: ok, I'm on the repl and I want to see all the functions/macro's that start with do

14:28 because I want to do something 1000 times, but I don't know dotimes

14:28 say

14:29 technomancy: so you're talking about non-cycling var completion?

14:29 Borkdude: What's that and how do I do it?

14:29 technomancy: I think hiredman uses something like that

14:30 * technomancy just uses cycling completion with hippie-expand

14:30 tomoj: M-x slime-complete-symbol ?

14:30 Borkdude: (find-doc "do") isn't really helping

14:30 arohner: Borkdude: if you're running slime/emacs, "do" <tab> does it

14:30 tomoj: depending on what tab is bound to

14:30 Borkdude: arohner, ah good

14:30 arohner: M-x slime-indent-and-complete-symbol

14:30 tomoj: yeah, I have tab bound to that

14:30 arbscht: and if you must use find-doc, you probably want a regexp: (find-doc "^do.*")

14:31 tomoj: it takes a regexp as a string?

14:31 arohner: (find-doc #"^do\w+") does it for me

14:31 tomoj: ah

14:31 arohner: that finds "doc" and "dotimes", but doesn't find "do"

14:32 chouser: 'do' isn't a Var

14:32 arohner: chouser: right, but I think the regex wouldn't catch that, even if do was a var

14:32 chouser: oh

14:32 sure

14:33 (find-doc #"^do")

14:33 Borkdude: ah find-doc with regexp is very useful, I could mention that on @cleotd

14:33 because it's also IDE-independent right?

14:33 chouser: arohner: oh, nm, I see what you're saying.

14:37 Borkdude: so find-doc only finds var's?

14:38 replaca: hiredman: sorry, I was in transit. Is the json index broken? or is it an issue on clojurebot's side?

14:38 chouser: Borkdude: right, not special forms.

14:38 hiredman: replaca: if you run curl, the stuff at the end where the vars with docs would be is all empty

14:39 replaca: hiredman: oh, I see!

14:40 I'll fix that up

14:40 autodoc has been going through some changes (isn't it always) so I probably broke something

14:41 hamza: is there a equivelent to read-string that will read the whole string and return it instead of one by one, (read-string "(list :A :b) (list :c :D)") returns only the first list?

14:42 ninjudd: hamza: not that i know of, but i wrote this for a project i'm working on

14:42 replaca: ,(read-string (str "(do " "(list :A :b) (list :c :D)" ")"))

14:42 clojurebot: (do (list :A :b) (list :c :D))

14:42 ninjudd: (defn read-mult [str]

14:42 (let [r (java.io.PushbackReader. (java.io.StringReader. str))]

14:42 (loop [items []]

14:42 (try

14:42 (recur (conj items (read r)))

14:42 (catch Exception _ items)))))

14:43 replaca: ,(read-string (str "[" "(list :A :b) (list :c :D)" "]"))

14:43 clojurebot: [(list :A :b) (list :c :D)]

14:44 hamza: replica ninjudd thank you both..

14:44 ninjudd: replaca: that's a good way to do it

15:06 Borkdude: any ideas for @cleotd (Clojure Example of the Day) are welcome, if you have useful snippets to share

15:06 rhickey: cemerick: fixed

15:07 cemerick: rhickey is making me look like a slacker

15:07 ;-)

15:07 thanks

15:08 rhickey: cemerick: np

15:08 you hadn't created an issue?

15:09 cemerick: rhickey: it's literally on my day's todo list right here. It likely would have been put in around 4-ish, after I got off this call. :-/

15:25 raek: anyone know how to make paredit insert a matching bracket, even for curlies?

15:26 technomancy: raek: you need a newer version of paredit I think

15:32 Borkdude: Is Shawn Hoover of Clojure Box sometimes in this channel?

15:32 I wonder why I don't have paredit included (although I find it annoying in Eclipse CC)

15:33 chouser: Borkdude: yeah, he's here sometimes.

15:34 Borkdude: Isn't paredit much like static typing? ;-)

15:35 redinger: Except useful

15:35 Borkdude: hehe

15:46 slyphon: java's URI class is completely psychotic

15:58 Intensity: Hi. I'm using counterclockwise in Eclipse (both for the first time) in an existing Java project, and I'd like to get the Java code to call Clojure code. Is anyone acquainted with Eclipse and/or CCW enough to help me with this?

16:01 kotarak: Intensity: clojure.lang.Var someClojureFn = clojure.lang.RT.var("your.namespace", "some-clojure-fn"); someClojureFn.invoke(someArgument);

16:04 Intensity: kotarak: Thanks for the information. I've seen Java code and how it can interoperate with Clojure in the way you suggest. What I'm unsure about is Eclipse, as I'd like the current Java project (built by someone else) to know how to "include" clojure.jar. I successfully added a Clojure source file to the project, but it's not yet integrated.

16:05 kotarak: Intensity: ah, ok. Sorry. Don't use eclipse.

16:07 Intensity: kotarak: Ok. I've asked in #eclipse. I may need to learn much more about it to know how to integrate a Clojure source file. I'm also completely new to it, but hope to get over the initial barrier (minimally, being able to run code like you suggest above).

16:08 kotarak: Intensity: look out for lpetit

16:08 Intensity: he's the author of ccw and hangs out here from time to time.

16:08 Intensity: kotarak: Ok, cool. Thanks for the pointer.

16:20 tomoj: omgwtfbbq

16:20 just got a repl into solr, hurraah

16:21 cYmen: tomoj: solr?

16:22 tomoj: cYmen: http://lucene.apache.org/solr/

16:22 sexpbot: "Welcome to Solr"

16:22 Raynes: Titles should be more useful, imo.

16:27 dakrone: I asked in #compojure, but no one seems around, can anyone tell me why url is nil in this (even though I am going to localhost:8080/parse/1)? http://gist.github.com/373003

16:27 tomoj: and I can recompile my gen-class'd plugin and see the changes without restarting solr, woohoo

16:28 chouser: tomoj: you shouldn't even have to recompile if you're just changing the implementations of your gen-class methods.

16:28 tomoj: right, I mean C-c C-k

16:28 chouser: oh ok.

16:28 tomoj: so I guess that's actually reloading

16:28 * chouser assumes appropriate emacs magic.

16:28 tomoj: yeah, no .class files change

16:29 too bad there's a bunch of nasty steps to take to get into this place

16:29 had to write a solr plugin that starts a swank server, then jar it up and embed it in solr.war along with clojure and swank-clojure

16:29 kotarak: chouser: substitute with \et for suitable Vim magic. :)

16:30 tomoj: solr gets tricked into initializing my dummy plugin which just starts swank :/

16:30 chouser: :-)

16:36 slyphon: partial confuses me

16:37 chouser: it's the next level

16:37 * slyphon sighs

16:37 * slyphon goes to get *another* roll of quarters

16:37 chouser: you'll get it. What are you looking at?

16:37 lancepantz: i haven't gotten that far yet either

16:37 slyphon: clojure.contrib.http.agent

16:37 technomancy: partial is so much fun that it can be tempting to abuse

16:37 slyphon: line 225

16:37 technomancy: along with comp and reduce

16:38 kotarak: and juxt

16:38 slyphon: i used "cons" for the first time yesterday

16:38 that validated clojure for me

16:38 chouser: slyphon: ok, the first arg to partial is always a function

16:38 kotarak: I hardly ever use cons.

16:38 slyphon: kotarak: yeah, which is such a nice change from say sbcl

16:38 chouser: slyphon: do you see the function?

16:38 technomancy: the only time I've used cons was trying to debug a crazy macro

16:38 kotarak: ,((partial str "Hello" " ") "World!")

16:38 clojurebot: "Hello World!"

16:39 slyphon: chouser: yeah, it's part of *http-agent-defaults*

16:40 so buffer-bytes

16:41 chouser: heh, there are a whole lot of functions going on there.

16:41 slyphon: yeah

16:41 i think i see what he's doin' though

16:41 it's a way of binding stuff in a particular context

16:41 but it won't get evaluated until you call the generated fn

16:41 ?

16:41 chouser: handle-response is a function that will get 3 args: the agent value, the result of 'partial' and opts.

16:42 * slyphon nods

16:43 chouser: handle-response (line 111) calls that second arg "handler" and invokes it with no args at all.

16:43 slyphon: ah, so partial is creating a thunk for handle-response

16:43 chouser: yes!

16:43 good!

16:43 slyphon: :D


16:44 but you want to delay evaluation of the agent arg in that thunk until it's time? (i.e. the reply has been received)

16:44 chouser: if you know how many args partial's result will be called with (no args in this case) you can rewrite it as a fn.

16:45 slyphon: ahhh

16:45 chouser: so in this case (partial (:handler opts) a) --> (fn [] ((:handler opts) a))

16:45 slyphon: ahhh

16:45 ok

16:45 so it's a flexible way of doing that

16:45 chouser: right

16:46 slyphon: ok, not so hard

16:46 :)

16:46 chouser: so more like (fn [& args] (apply (:handler opts) a args))

16:46 slyphon: ah

16:47 i think i was expecting something more along the lines of scala's partial stuff, which i still don't really grok

16:47 where you get the foo(blah)(wtf?)

16:47 chouser: and if you're not lost yet, you can look up the source to 'partial' and see we've essentially derived it. :-)

16:47 * slyphon goes to look

16:48 slyphon: hah! sweet

16:48 ok, well, i'll have to look for a nail to hit with this hammer :)

16:48 chouser: well, scala methods can accept multiple argument lists, so ... uh ...

16:48 slyphon: yeah

16:48 * chouser loses interest and gets back to work.

16:48 slyphon: screw scala, though

16:48 :D

16:48 chouser: thanks!

16:48 chouser: np. welcome to the next level. :-)

16:49 * slyphon laughs

16:49 slyphon: wow, only one quarter!

16:49 chouser: when you're all comfortable with partial, try it out with comp and juxt. I'm easily defeated by such bosses.

16:50 slyphon: hahaha

16:50 hiredman blew my mind with his use of "trampoline" in callbacks

16:51 technomancy: you have to use the partial-gun to beat ReduceMan before you can defeat JuxtMan.

16:51 haven't you played MegaMan 3?

16:51 Chousuke: :P

16:52 chouser: MetaMan?

16:52 * slyphon up-up-down-down-left-left-right-right-b-a-b-a-select-starts!

16:53 Chousuke: It took me a while to understand how trampoline works

16:53 but I think I do now :/

17:06 bsteuber: ,(doc juxt)

17:06 clojurebot: "([f] [f g] [f g h] [f g h & fs]); Alpha - name subject to change. Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable number of args, and returns a vector containing the result of applying each fn to the args (left-to-right). ((juxt a b c) x) => [(a x) (b x) (c x)]"

17:09 tomoj: if I want to subclass an abstract java class in clojure, I'll have to use gen-class, right?

17:10 kotarak: ,((juxt inc dec) 1)

17:10 clojurebot: [2 0]

17:10 kotarak: tomoj: shouldn't this also work with proxy?

17:11 tomoj: oh, thank you very much for saying that

17:11 kotarak: tomoj: well, I don't know for sure, but I think it should work.

17:11 tomoj: in other cases I need gen-class because solr will blow up if it doesn't find a .class file, but in this case, proxy is perfect because I'm returning a single-use instance of something

17:15 slyphon: gak

17:15 & options can sometimes be a real pain

17:52 MadWombat: Hello all

17:53 I seem to be having trouble with Runtime. The following works fine in SLIME, but doesn't work when called from a jar (.. Runtime (getRuntime) (exec "uname"))

17:54 I get java.lang.IllegalArgumentException: No matching method found: exec for class java.lang.Runtime

18:01 hyp3rvigi1ant: you could download it directly from here, too, if you want: http://free.antivirus.com/hijackthis/

18:01 sexpbot: "HijackThis - Trend Micro USA"

18:01 hyp3rvigi1ant: oops

18:01 sorry

18:02 slyphon: so, if you can't await in an agent action, is there some way to "chain" agents?

18:02 rather, chain agent actions?

18:03 sattvik: MadWombat: what do you mean by ‘called from a jar’?

18:07 MadWombat: sattvik: well, I am trying to make swank-clojure cygwin aware, when I call this expression from REPL or SLIME, it runs fine, when it gets called as part of the swank process it gives me an error

18:09 nurv: Hi.

18:12 sattvik: MadWombat: Hmm.. I don't know why it would work. You could try it without the .. macro and see if that works.

18:13 MadWombat: I meant: "would not work"

18:16 MadWombat: sattvik: I tried every which way, with (.exec, with (. Runtime (getRuntime) and other combinations :(

18:17 Raynes: If you rebind *out*, how do you set it back to the default?

18:17 sattvik: MadWombat: It may be easier or perhaps even better to use (System/getProperty) or (Syste/getenv). Especially the latter since I think cygwin sets some sort of CYGWIN variable.

18:18 Raynes: System/out, or the previously bound value?

18:19 Raynes: (binding [*out* System/out] ..) doesn't seem to be.

18:19 _ato: Raynes: exit the (binding ...) form? or save the original somewhere and restore it?

18:19 ,(doc *out*)

18:19 clojurebot: "; A java.io.Writer object representing standard output for print operations. Defaults to System/out"

18:20 Raynes: (binding [*out* System/out] (println "lol")) => java.io.PrintStream cannot be cast to java.io.Writer

18:20 _ato: (binding [*out* (java.io.PrintWriter. System/out)] ...)

18:21 that doc string is somewhat misleading

18:21 Raynes: Indeed.

18:21 _ato: ,(doc *in*)

18:21 clojurebot: "; A java.io.Reader object representing standard input for read operations. Defaults to System/in, wrapped in a LineNumberingPushbackReader"

18:21 MadWombat: sattvik: I think I partially figured it out, the call I mentioned actually works, its the other one I use that causes trouble, where I call (.. Runtime (getRuntime) (exec "cygpath" path))

18:22 sattvik: ,(class *out*)

18:22 clojurebot: java.io.StringWriter

18:22 sattvik: Well, on my REPL it's a OutputStreamWriter.

18:22 _ato: MadWombat: from the javadoc: exec(String[] cmdarray)

18:23 you need to pass it a string array

18:23 Raynes: sattvik: In my REPL, it's a StringWriter. :p

18:23 Cause of swank, I guess.

18:24 sattvik: MadWombat: You can do (exec (into-array "cygpath" path))

18:28 Raynes: Checking the Clojure source: *out* is set in RT.java to new OutputStreamWriter(System.out). So, like _ato said, exit the (binding …) or save and restore the original.

18:31 MadWombat: sattvik: nah, I just use (str "cygpath " path)

18:32 I have a rather stupid question, how do I assign value to a function argument? That is if I have (defn f [x] (how do I change value of x from here?))

18:32 _ato: MadWombat: that might break on paths that have spaces in them though

18:33 MadWombat: _ato: correct, I will fix that

18:35 _ato: MadWombat: by "assign" are you talking about default arguments? (defn f ([] (f "something")) ([x] ...))

18:35 so (f) is then equivalent to (f "something")

18:36 MadWombat: _ato: no, I need to change the actual value passed into the function

18:36 _ato: either I'm misunderstanding what you mean or that's not possible in Clojure

18:37 there's shadowing: (defn f [x] (let [x (inc x)] ...))

18:37 MadWombat: _ato: in this case, I have a file name passed into a compile function and I need to check if I am under cygwin and convert the file name if I am. There is a bit of stuff done with the file, so I don't want to enclose the whole thing in the if form or something, I just want to change the file name in place

18:39 _ato: so I think shadowing is what you want... (defn f [path] (let [path (cygwin-path path)] ... normal body ... ))

18:43 scottj: MadWombat: in clojure (and I believe many other functional PLs) you don't reassign "variable names"

18:43 MadWombat: _ato: thank, seems like it does what I want

18:44 scottj: a form, by any other name...

18:54 heauxbag: what's a good starting point for someone interested in learning clojure? fairly experienced programming background but not much functional/lisp experience

18:56 * technomancy selfishly recommends the peepcode

18:56 technomancy: ~peepcode

18:56 clojurebot: peepcode is a commercial screencast series; see the Clojure one at http://peepcode.com/products/functional-programming-with-clojure by technomancy

18:57 sattvik: heauxbag: There is the Clojure 101 course starting in a few days: http://rubylearning.com/blog/2010/03/09/clojure-101-a-new-course/

18:57 sexpbot: "Clojure 101: A New Course"

18:57 technomancy: the prags' book is quite good too

18:57 cemerick: there's also the full disclojure series

18:57 The Joy of Clojure MEAP has been excellent so far.

18:58 heauxbag: technomancy: actually got the peepcode screencast, glad people recommend it

18:58 cemerick: heauxbag: Mark Volkmann's long tutorial is really fantastic. Very gentle intro: http://java.ociweb.com/mark/clojure/

18:58 sexpbot: "Mark Volkmann's Clojure Page"

18:58 technomancy: cools

18:58 cemerick: hrm, http://java.ociweb.com/mark/clojure/article.html is the actual tutorial

18:58 sexpbot: " Object Computing, Inc. - Java News Brief - March&nbsp;2009"

18:59 * technomancy will post updates modernizing the mire project to his blog soon

19:02 scottj: heauxbag: I think rich's screencasts are superb

19:02 recorded talks showing him code rather

19:28 MadWombat: is there an HTML parser for clojure?

19:30 scottj: there's java's tagsoup and enlive

19:31 MadWombat: scottj: how do I make lein recognize them as deps?

19:32 scottj: http://clojars.org/enlive

19:32 sexpbot: "enlive | Clojars"

19:33 scottj: add the lein line to project.clj. for jars I think you install them to maven (some maven commands will print out the command line in their errors) and then referencing it in project.clj also

19:34 nurv: http://github.com/nathell/clj-tagsoup

19:35 scottj: I guess tagsoup is in clojars as well so you don't have to install manually with maven

19:35 MadWombat: how do I install an arbitrary jar into a maven repo so I can use it with lein?

19:36 scottj: enlive looks promising

19:36 technomancy: MadWombat: if you edit your project.clj to reference it and then run "lein deps", the error message will include instructions of how to install it

19:36 locally anyway

19:36 MadWombat: technomancy: thanks

19:37 technomancy: sorry about erronious pull request earlier

19:37 scottj: MadWombat: the line you're looking for is like this: mvn install:install-file -DgroupId=com.google.appengine -DartifactId=appengine-api-1.0-sdk -Dversion=1.3.0 -Dpackaging=jar -Dfile=appengine-api-1.0-sdk-1.3.0.jar

19:37 MadWombat: scottj: heh

19:37 scottj: thanks

19:37 scary

19:37 technomancy: np

19:38 scottj: technomancy: what's the argument against having a dir in the project that lein will look for jars instead of going to maven dir?

19:39 is it the lack of groupid and version?

19:39 technomancy: scottj: you mean checking jars into git?

19:39 git is abysmally bad at tracking binary files

19:40 every time you upgrade a dependency, the diff will include a removal of the entire old jar plus a re-add of the new jar

19:40 pretty soon a fresh clone of your project takes twenty minutes

19:41 scottj: technomancy: nothing to do w/ git, I mean having a dir like lib that has jars that get included on classpath but they don't get deleted w/ lein clean

19:42 technomancy: so each developer is responsible for tracking down all the deps and putting them in the right place manually?

19:42 it's doable, just tedious

19:42 scottj: well, you end up doing worse than that if you have to install to local maven repo

19:43 technomancy: yeah, a local maven repo is only a temporary solution

19:44 once it's in a local repo, it's easy to rsync out somewhere so you can share it

19:47 scottj: I guess the argument against having a jars dir that's included on cp and not deleted like lib, that you'd use for jars that aren't in public repos, is that ppl should learn to use mvn local install, it's not too hard :)

19:47 technomancy: even a remote mvn server is not that tricky either

19:48 it'd be cool if someone documented how to set up a private clojars instance

19:48 * technomancy glances around, surreptitiously eyeing potential volunteers

19:49 * scottj looks surreptitiously up in the dictionary

19:50 cemerick: technomancy: can nexus, artifactory, etc., not serve as a lein deploy target?

19:50 technomancy: cemerick: good question. I haven't looked into it.

19:51 my gut tells me hudson would be the quickest way to get going, but there could be better options.

19:51 cemerick: the free version of nexus is absurdly full-featured, and dead-simple to deploy.

19:52 hudson-as-a-repo is a bit of a hack -- in particular, the fact that it doesn't prevent release redeployments is irksome

19:54 technomancy: it's worked great for us in our narrow use case, but I could see how that'd be a problem

19:54 I am interested in alternate clojars installations for other reasons though; I think down the line third-party mirrors will be come a necessity

19:55 given an optimistic projection of Clojure's growth

19:56 cemerick: I'd hope that we could start getting popular projects rolling into central. That would necessitate something like artifactory or nexus, as central is moving quickly away from ssh/scp/rsync-based mirroring.

19:57 * technomancy imagines that will only happen with ... sufficiently motivated volunteers. =)

19:58 cemerick: you mean syncing with central?

19:58 technomancy: yeah, making it easy to sync from clojars to central

19:59 cemerick: it's apparently a piece of cake if you're not trying to sync with them via rsync...even easier if you're signing the artifacts.

19:59 chessguy: 'evening

19:59 cemerick: @talios has gone through this for clojure-maven-plugin, sounds like the process has been simplified and expedited quite a bit

20:00 chessguy: anybody care to help me debug an algebraic simplifier?

20:02 cemerick: technomancy: even easier, sonatype is apparently providing nexus hosting for open source projects http://www.sonatype.com/people/2009/06/publishing-your-artifacts-to-the-central-maven-repository/

20:02 sexpbot: "Sonatype Blog &raquo; Publishing Your Artifacts to the Central Maven Repository"

20:05 technomancy: if it can match "scp pom.xml foo.jar clojars@clojars.org:" for ease-of-use, I'm all for it.

20:06 Tordek: hi, what's the - in "(defn -name...)"?

20:08 sattvik: Tordek: Generally, there is nothing special about it. Specifically, it is often the default prefix of functions that are implementing Java methods that are being generated using gen-class.

20:08 remleduff: There's an awful lot of value of being able to go to clojars and browse and *only* get clojure artifacts, I'd hate to lose that if the community moved to a nexus repository

20:08 Tordek: thanks

20:40 defn: another amazingly awesome post by nakkaya: http://nakkaya.com/2010/04/20/fractals-in-clojure-newton-fractal/

20:40 sexpbot: "Fractals in Clojure - Newton Fractal"

21:08 chessguy: hey defn

21:31 MadWombat: I need to parse a javascript array definition, so I think, I need a basic token parser. Is there a library I can use or a sample parser I can take a look at?

21:32 dakrone: MadWombat: you could give http://github.com/jrockway a shot

21:32 err

21:32 http://github.com/joshua-choi/fnparse

21:33 wrong link

21:34 chessguy: did i get banned?

21:34 _ato: ,(read-json "[1, \"hello\", 3]")

21:34 clojurebot: [1 "hello" 3]

21:34 _ato: MadWombat: ^ if you just mean parsing a JSON array

21:34 dakrone: chessguy: err, no? you're in here now

21:34 _ato: clojure.contrb.json.read

21:35 chessguy: yeah, weird, i got a strange message from freenode saying i'd been banned

21:35 _ato: clojure.contrib.json.read *

21:35 * chessguy shrugs

21:35 chessguy: defn, you around?

21:36 tomoj: _ato: how'd you know read-json was available?

21:36 MadWombat: _ato: worth a try :)

21:37 lancepantz: clj-json is much much faster than clojure.contrib.json

21:37 MadWombat: _ato: I need to extract an array from a javascript file, I use regex to separate the array definition from the rest of the code and now I need to parse the array itself

21:37 lancepantz: fwiw

21:37 _ato: tomoj: /msg clojurebot ,(read-json "[1, \"hello\", 3]")

21:37 tomoj: oh, heh

21:43 hiredman: clojurebot also has danlarkin's clojure-json stuff

21:50 chessguy: man, i sure would love it if someone could take a look at this simplifier code and help me debug it: http://ideone.com/VlRwu

21:50 sexpbot: "Ideone.com | VlRwu"

21:51 chessguy: (as an aside, the syntax-coloring on that site for clojure sucks)

22:31 wlangstroth: It seems that Scala is losing popularity on Github: http://github.com/languages/Scala

22:32 Clojure is still #18, and at #19 ... Common Lisp.

22:41 joshua-choi: I've got a question. Before deftype switched from factory function (A x y) vars to class constructors (A. x y), I often used namespace aliases with my deftypes' factory functions (require [something :as s]) (s/A x y).

22:42 Now, I seem to be unable to do that with the new constructors.

22:42 Is it possible to use namespace aliases with the deftype constructors at all? Or do I have to use import from now on?

22:50 hiredman: joshua-choi: if you switch to defrecord or make your own factory function

22:51 joshua-choi: hiredman: Actually, I'm using defrecord; I'm still running into the same problem. I didn't mention it just for conciseness

22:51 A factory method is probably my best bet, but it's unfortunate...What did you mean by defrecord, though? Does it do something different in this case?

22:52 hiredman: the same problem as in no factory functions?

22:52 joshua-choi: Yeah.

22:52 hiredman: huh

22:52 joshua-choi: Does defrecord create factory methods?

22:52 hiredman: I had thought defrecord was supposed to supply those

22:52 joshua-choi: Hmm, actually, hang on...

22:53 hiredman: factory functions

22:53 joshua-choi: hiredman: No, defrecord doesn't seem to create factory functions for me.

22:53 Does it for you, in the latest Clojure?

22:54 hiredman: let me grab the latest

22:55 actually the docstring for defrecord doesn't mention factory fns

22:56 that is some what worrying, I thought the point was to have a level of indirection between you can the class

22:57 joshua-choi: hiredman: The removal was a pretty new change; did you know about it? (I found out two days ago :( )

22:58 hiredman: I knew it was removed for deftype

22:58 remleduff: You can't have a factory function that has the name of the Class, because the Class name is now supposed to be stable, and they'd conflict

22:58 hiredman: remleduff: even if you re-defrecord?

22:59 joshua-choi: remleduff: Right. But is there a way to use namespace aliases still? Or must I (import ...) now?

22:59 hiredman: I haven't really been following it that much, I mean, I'm simple, I just use functions maps and seqs with a set here and there

23:00 remleduff: I hadn't encountered that, I guess you'd have to import. You also can't (map RecordType [values]) anymore either, there were a handful of cases Rich was trying to decide whether they were important enough to support was my impression. He'd talked about something like RecordType/create I think

23:04 http://clojure-log.n01se.net/date/2010-04-15.html#07:55

23:04 sexpbot: "#clojure log - Apr 15 2010"

23:04 joshua-choi: remleduff: How long ago did Rich mention RecordType/create?

23:04 remleduff: Was just searching for it :)

23:04 joshua-choi: Wow, at the same time. :)

23:11 remleduff: I'm surprised no one has run into that before, I guess most people don't use records from a different namespace than the one they define them in? Or else they didn't alias the namespace

23:11 * joshua-choi is still reading that conversation

23:12 joshua-choi: I'm surprised too, though

23:14 Ah, someone did ask it, on 2010-04-15 10:46.

23:17 remleduff: Hmm, that just makes the ns macro even more complicated (require and use are for clojure stuff, import is for java stuff -- except import is also for records and types)

23:19 joshua-choi: I know. I hope Mr. Hickey will figure out something about the factory methods, or at least a definite no.

23:19 No pressure though

Logging service provided by n01se.net