#clojure log - Feb 09 2009

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

5:30 bakkdoor: i have trouble with defining a macro that expands into a defmacro form... anyone here who might be able to help me?

5:31 hoeck: bakkdoor: sure

5:31 bakkdoor: cool

5:31 wait i'll paste my code

5:31 hoeck: k

5:31 AWizzArd: Do you want to write your own macro engine?

5:36 bakkdoor: http://paste.lisp.org/display/75111

5:37 thats my code

5:42 but i basically get this error message: java.lang.Exception: Unable to resolve symbol: actionPerformed in this context (NO_SOURCE_FILE:1)

5:42 hoeck: bakkdoor: and the problem is?

5:42 bakkdoor: and i dont know how to solve it.

5:44 heres what it expands into: http://paste.lisp.org/display/75111#1

5:46 am i missing a quote or unquote or something? i guess it has to do with the double backquoting within the defevent macro, but i cant find the error. and it only tells me it cant resolve actionPerformed. but i dont even want it to be resolved i guess, it should just take it as a symbol for the call to the with-event-listener macro

5:46 which itself calls the proxy macro predefined in clojure

5:49 heres the expansion via macroexpand-1: http://paste.lisp.org/display/75111#2

5:54 hoeck: bakkdoor: hmm, looks like you need to quote actionPerfomed like this: ~'~actionPerformed

5:54 bakkdoor: hm ok

5:55 hoeck: using this leads me to a correctly expanded [java.awt.event.ActionListener actionPerformed] arg-vector to with-event-listener

5:56 Chousuke: ~'~? :/

5:56 clojurebot: I don't understand.

5:56 Chousuke: ,`~'~actionPerformer

5:56 clojurebot: (clojure.core/unquote actionPerformer)

5:56 Chousuke: ,`~'actionPerformer

5:56 clojurebot: actionPerformer

5:56 hoeck: ,`(`~'~actionPerfomed)

5:56 clojurebot: java.lang.Exception: Unable to resolve symbol: actionPerfomed in this context

5:57 Chousuke: ,`'~actionPerformer

5:57 clojurebot: java.lang.Exception: Unable to resolve symbol: actionPerformer in this context

5:57 Chousuke: okay, so it's ~'

5:58 hoeck: ,(let [sym 'actionPerformed] `(~'~sym))

5:58 clojurebot: ((clojure.core/unquote sym))

5:58 hoeck: ,(let [sym 'actionPerformed] `(`~'~sym))

5:58 clojurebot: ((quote actionPerformed))

5:58 hoeck: mhh

5:59 Chousuke: ,(let [sym 'ap] `'~sym)

5:59 clojurebot: (quote ap)

5:59 Chousuke: ,(let [sym 'ap] `~sym)

5:59 clojurebot: ap

5:59 Chousuke: ,(let [sym 'ap] `~'sym)

5:59 clojurebot: sym

6:00 bakkdoor: hoeck: defevent now doesnt complain anymore. it also generates the macro. but i call the generated macro, i get an error: http://paste.lisp.org/display/75111#3

6:03 Chousuke: wait, you're using nested defmacros? :/

6:04 hoeck: Chousuke: yes

6:05 Chousuke: hmmh

6:06 that might be problematic, as ~ is kind of special inside `

6:07 hoeck: bakkdoor: untquote-quote-unqote the event-listener-sym in the defevent macro

6:09 bakkdoor: hm

6:11 hoeck: while expanding, ~~ evaluates event-listener-sym to a class object, but proxy somehow wants a symbol and not a class

6:11 i guess

6:13 bakkdoor: hm ok

6:18 Chousuke: I think ~@~body-sym is not going to work

6:31 hoeck: Chousuke: strangely enough, ~@~ expands correctly :)

6:32 bakkdoor: is it working now?

6:51 djpowell: am I generally better off using (into {} (map ...)), rather than (reduce (assoc ...) {} ...)

7:03 Chousuke: djpowell: I think (into {} ...) is more idiomatic

7:04 (doc into=

7:04 clojurebot: Returns a new coll consisting of to-coll with all of the items of from-coll conjoined.; arglists ([to from])

7:04 Chousuke: oops

7:04 heh

7:05 I created a github repo for small clojure utils. for now, I only have two functions in it though :P

7:24 djpowell: hmm, I wonder if an implementation of "selection sort" would be useful for seqs. handy if you are going to call first on the sorted seq, or just get the first few elements from it, cause it wouldn't need to sort the rest of the list.

7:26 Chousuke: hmm

7:31 djpowell: i found myself calling (first (sort xs)), and thought that that was probably a bit wasteful

7:32 Chousuke: isn't there a function in contrib for finding the smallest/greatest item.

7:34 djpowell: maybe, i've been a bit slow at looking at contrib. likewise, i'm still using inferior-lisp rather than slime

7:34 zakwilson: (doc max)

7:34 clojurebot: Returns the greatest of the nums.; arglists ([x] [x y] [x y & more])

7:34 djpowell: zakwilson: doesn't work with strings

7:34 zakwilson: So I see from the docstring.

7:35 So what you want is a generic max, or one that can take a comparison function as an argumnet.

7:35 djpowell: yeah, i think there is one in contrib

7:35 i kind of got a massive boost from using clojure and inferior-lisp, and doing stuff with them is taking priority over the lesser boost i'd get from looking at contrib and slime. i'm lazy

7:49 * djpowell has installed clojure-contrib. worth it for repl-utils/show alone

9:33 hellask: ah so nice, sometimes in clojure i feel like i wish there was something like X and Im not evenr sure I know exactly what X is but then I find X and it is awes ome :). last one was ->

9:34 anyonme here a good webdeisnger?

9:36 jdz: define good. but thickey might be, anyway.

9:41 hellask: how do I set public fields?

9:41 http://www.textpresso.org/clustering-software/javadoc/libsvm/SVM_Problem.html

9:41 Chouser: 'set!'

9:42 (set! (.l problem) 5) ; or some such

9:49 cemerick: I wonder if anyone else has been caught by this ClassFormatError?: http://groups.google.com/group/clojure/browse_frm/thread/4049115d4d1205c8?hl=en#

9:50 Chouser: Nobody compiles Clojure like you do, cemerick. ;-)

9:50 cemerick: Chouser: hrm, rhickey said something similar last week. :-)

9:52 I'm about 3/4 of the way towards having a solid clojure build subant file. That might hit github eventually.

9:52 rhickey: cemerick: that doesn't seem to be related to partial building per se, but a large codelength - do you have large data literals in your code files?

9:52 cemerick: I guess my problem is that I generally assume that I'm trailing everyone else, at least when it comes to pure geekery.

9:52 Chouser: next time you hit the error, you might tar up your classes before clearing them out.

9:52 that tarfile would give people a place to start hunting for the bug

9:54 cemerick: Chouser: true, but we'd have to identify which classfiles are involved so that nothing sensitive was released

9:54 rhickey: that's interesting -- yes, we have one file in a test lib that has a literal list of ~2500 objects

9:55 rhickey: cemerick: there are classfile size limits that come into play - for large data I recommend using read instead of compiling a literal

9:57 cemerick: rhickey: ah ha. That's certainly doable, though unfortunate. Why doesn't it fail all the time, though?

9:57 rhickey: cemerick: I can't tell from that info

9:58 hellask: how do i get an attribute?

9:59 cemerick: rhickey: Would it help if I posted the classfile?

10:00 rhickey: cemerick: I don't think so - that classfile is over the limit, the question is why only on a partial build

10:03 Chouser: hellask: (.instanceMember instance) documented http://clojure.org/java_interop

10:04 cemerick: rhickey: and only sporadically, for that matter. Does c.l.Compile (or the stuff it hooks into) always load classfiles for each lib it's provided, or does it do so only when the corresponding source files have changed?

10:06 rhickey: cemerick: compile should be a no op if nothing has changed, but possibly something is being loaded due to reference

10:10 cemerick: anyone going to ILC 2009? http://ilc09.org

10:11 rhickey: cemerick: I hope so!

10:12 Chouser: cemerick: trying to decide it it's worth it for me. Should I go?

10:12 cemerick: rhickey: yeah, I saw you on the schedule for Sunday. Are you there only Sunday? It looks like a scheme and CL-fest otherwise.

10:12 AWizzArd: For me it's in the wrong Cambridge ;)

10:12 Chouser: I don't know how much good a week of CL is going to do.

10:13 cemerick: Chouser: I can't vouch for it, having never gone. Myself and wwmorgan are probably going to go if rhickey and the enclojure guys are there.

10:13 rhickey: cemerick: I'm also on the Future of Lisp panel

10:13 AWizzArd: Has anyone of you been on the ELC 2006?

10:13 rhickey: I would say *you are* that panel :)

10:14 rhickey: AWizzArd: Lisp has many futures

10:14 cemerick: rhickey: nice :-P

10:15 AWizzArd: Agreed. Lots of love for clojure here, but as entertaining it is to watch the scheme and CL worlds from afar, I don't see much point (for me/us) in getting hip-deep in them.

10:15 rhickey: There are many interesting talks throughout the week - even if they are CL/Scheme, the domains they are tackling are those Clojure could too

10:16 danlarkin: Hmmm are they not doing per diem this year?

10:16 rhickey: danlarkin: no, but $210 early reg is not bad

10:16 Chouser: danlarkin: the week price seems to me to be about the same as the per diem last time.

10:16 * danlarkin can't take a week off :)

10:17 Chouser: If I go, it's unlikely I'll stay the whole week. Maybe through Tuesday or something.

10:18 cemerick: rhickey: See, we rely on you to bring all that forward-thinking back to the sane, broader world ;-)

10:19 rhickey: Next time you guys should submit some Clojure papers!

10:23 AWizzArd: cemerick: I am doing CL now since 6 years and actually work as a CL dev :) But currently I am transforming this in a full time Clojure job *g*

10:24 Chouser: rhickey: I don't even know how that works. Do they just waive the fees if they accept your paper, or do the fees start flowing the other direction?

10:25 cemerick: rhickey: wwmorgan might have something for a lisp-focussed group, but I'd end up presenting something like "Integrating Clojure with JMS for Sane Scalability" or somesuch. I'd have to wear a poncho.

10:25 AWizzArd: good on you. BTW, did you ever put Jambi through its paces?

10:25 rhickey: Chouser: there's no money flowing my way, that's for sure :(

10:26 Nor, at those rates, for anyone else either - just an educational/intellectual endeavor

10:26 * Chouser nods

10:27 cemerick: I was pretty shocked by the low rate, actually. $200 is nothing compared to most conferences.

10:28 rhickey: cemerick: yeah, it's great, and if you've never heard Sussman or Moon et al - these guys are tops

10:28 AWizzArd: cemerick: Never touched Jambi. I am a swing person so far, and not the happiest. For example just today I learned that one can not simply change the background color of a cell in a JTable. I hoped for something like (.setBackgroundColor my-table cell-x cell-y [r g b]). But instead one needs to provide a rendering method.

10:29 Chouser: cemerick: that's a good point. Perhaps I should seize the chance. It's just a pretty long drive and big slice of time for a lark.

10:29 AWizzArd: rhickey: if possible please let someone record you. Would be nice to have new Clojure vids online.

10:29 cemerick: Chouser: hey, I'll buy ya a beer. Should make it *all* worthwhile. :-P

10:31 rsynnott: what would the most sensible way to go about making clojure available from a larger java application (jetty or something) be?

10:31 cemerick: AWizzArd: yeah, the table stuff is not pretty. If you can believe it, it's a metric ton better than the document model, though.

10:32 rsynnott: (that is, allow the java app to call clojure functions/methods)

10:34 AWizzArd: cemerick: you mean like writing texts into an editor pane and have there specific words in red color and italic and such?

10:35 cemerick: AWizzArd: yeah, the whole javax.swing.text.* mess. Pain, pain, pain, and nothing but.

10:36 of course, Swing the worst UI toolkit -- except for all of the others. :-P

10:41 AWizzArd: maybe doing these things is really much easier with qt

10:41 but qt is not free for commercial development as I see it

10:42 cemerick: AWizzArd: even with the LGPL that's coming down the pike?

10:42 forest: AWizzArd it will be soon)

10:46 jbondeson: 4.5 RC1 was released last week, so it currently is.

10:49 AWizzArd: oh, hmm

10:50 let me know when this happened.. could be interesting

10:50 WizardofWestmarc: couple weeks ago?

10:50 it's pretty recent

10:52 cemerick: AWizzArd: I was actually just reading about this over the weekend. Link with attendant peanut gallery: http://www.reddit.com/goto?id=7plau

10:54 jbondeson: they announced LGPL on Jan 14th, and the first RC of 4.5 dropped Feb 5th

10:54 http://www.qtsoftware.com/about/news/qt-4.5-release-candidate-available

10:56 AWizzArd: thx

10:56 cemerick: I don't think Jambi will ever work for us, just because of the difficulties (known and unknown) of having to track distributions for multiple platforms. That, and it's strictly impossible to deploy in the browser.

10:56 AWizzArd: so, as I understand this lgpl stuff: if I use qt as a lib (jambi) I won't need to open my sources.

10:57 cemerick: didn't Chouser and Lau work with Jambi some months ago?

10:57 cemerick: AWizzArd: right -- only modifications to the lib need to be LGPL'ed as well.

10:58 AWizzArd: I don't know -- I was absent from the goings on here for a couple of months.

10:59 AWizzArd: Chouser: you got the qt gui-builder working some time ago, yes?

11:01 Chouser: AWizzArd: yes

11:01 hellask: how the hell do I come up with a good name for a visual search engine?

11:02 Chouser: I don't think I've yet seen a correct Clojure repl interacting with a correct Qt/Jambi thread, though I've seen some broken attempts.

11:02 AWizzArd: it shouldn't be hard, and maybe somebody's done it, but I've not seen it yet.

11:03 hellask: what is better about jambi? webkit interop?

11:03 because i love swing+miglayout

11:08 rsynnott: hellask: QT tends to look more native on its supported platforms

11:09 clojurebot: svn rev 1253; added #_ ignore form reader macro added IDeref above IRef, made delays and futures implement IDeref renamed/moved IRef.get() -> IDeref.deref() deref/@ maps to IDeref/deref added future-calls and future implement pmap on future implement pcalls on pmap

11:10 rhickey: new goodies: futures

11:12 jwinter: What are futures?

11:13 hellask: concurrency constructs i think

11:13 rhickey: jwinter: references to a computation on another thread, deref/@ blocks until done

11:14 jwinter: oh

11:14 hiredman: like a FutureTask?

11:15 rhickey: hiredman: a thin wrapp on j.u.concurrent.Futures, supports @

11:15 hiredman: Neat

11:15 danlarkin: ohhhh yeah very neat

11:15 rhickey: also future macro, packages up exprs in closure and fires off in thread pool

11:16 also pmap now written with futures, so can nest

11:16 Chouser: nice

11:17 jwinter: Futures: http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/Future.html . This is like 20 pages ahead of where I am in Java Concurrency in Practice.

11:18 AWizzArd: hellask: the mean thing about swing is that in some areas it sucks. For example: when you have a JTable and want to change the background color of a specific cell. How can you do it?

11:18 rhickey: Chouser: yeah, pmap much tidier: http://code.google.com/p/clojure/source/browse/trunk/src/clj/clojure/core.clj?spec=svn1253&r=1253#3924

11:19 AWizzArd: hellask: I hoped for something like (.setBackgroundColor my-table cell-x cell-y [r g b]).

11:19 Chouser: but now I'm going to have to figure out when I want futures.

11:19 AWizzArd: I don't think it's terribly hard. I may even have some example code...

11:19 rhickey: Chouser: anytime you are using agents only for threads, i.e. not identity

11:19 AWizzArd: Chouser: it is much harder than what I dreamed of :)

11:20 hellask: AWizzArd: ok wasnt aware of that, I was mainly speaking from an amateur point of view on that matter, I have never made professional GUIs but for making an mp3player or something it was betetr than anythign else ive tried like tkinter and the c++ suicide winapi

11:20 AWizzArd: rhickey: is there an idiom for (swap! my-atom (fn [_ x] x) new-value)?

11:21 rhickey: (doc reset!)

11:21 clojurebot: Sets the value of atom to newval without regard for the current value. Returns newval.; arglists ([atom newval])

11:21 AWizzArd: hellask: and about 30 minutes or so ago cemerick also mentioned that it is not trivial to have a text pane in which you want to change the color and font size of specific words/letters. All very evil.

11:21 rhickey: great

11:21 Chouser: AWizzArd: http://gist.github.com/60851

11:21 rsynnott: AWizzArd: do you still have to subclass the JTable or something?

11:22 * rsynnott hasn't used swing in about 10 years

11:22 drewr: jwinter: my JCIP reading has been slow

11:23 cemerick: AWizzArd: just to be clear, it's *easy* to set an arbitrary style over a range of text as a single operation -- however, in order to support interleaving document types, embedded images and other media, and support all of the usual interactions you'd like to have in such a document, you're in for a load of pain

11:24 Chouser: AWizzArd: line 62 of that gist sets the cell renderer so that each row's foreground color depends on a particular value for that row.

11:24 AWizzArd: Chouser: yes thanks. Around line 62 it starts. You have to provide your own renderer!

11:24 yes

11:24 Chouser: yes

11:24 AWizzArd: ;)

11:24 cemerick: using the UI toolkit for stuff like that is the wrong approach anyway, though the mere existence of javax.swing.document leads people to attempt it anyway. A useful web pane component should take care of all of that, as well as integration with your application's custom functionality.

11:24 Of course, I didn't know all these things when I wasted 6 months of my life on document model stuff back in 2001/2002. :-/

11:25 ayrnieu: ,(let [ag1 (agent nil) ag2 (agent 0)] (send ag1 #(do % (send ag2 inc) (await ag2) (println @ag2)))) ;; can't await in an agent

11:25 clojurebot: #<Agent@ad97f5: nil>

11:25 ayrnieu: ,(let [ag1 (agent nil) ag2 (agent 0)] (send ag1 #(do % (doto (future (send ag2 inc)) deref) (println @ag2)))) ;; can do :-)

11:25 clojurebot: java.lang.Exception: Unable to resolve symbol: future in this context

11:25 AWizzArd: I just hoped that the designers of Swing would offer one simple method for doing so typical stuff. They must have known that people typically want to center Windows, change colors of table cells, or do what cemerick just described.

11:26 One can of course abstract this stupidity away and write ones own Clojure functions, but the fact that his is needed is what seems suboptimal to me.

11:26 ayrnieu: ,(doto (agent nil) (send inc) (await) (-> agent-errors first (.printStackTrace))) ;; -- aside: this has a race condition. Sometimes it'll print the stacktrace.

11:26 clojurebot: Agent has errors

11:26 rsynnott: is clojurebot supposed to do that?

11:26 ,(+ 5 4)

11:26 clojurebot: 9

11:26 rsynnott: heh

11:27 AWizzArd: yes, it should eval most of our code

11:27 Chousuke: it's pretty easy to DoS though :/

11:27 cemerick: AWizzArd: fundamentally, one has to remember that Swing is always doing all of its own drawing -- so, anytime you want to diverge from what you can get right out the box, you're going to have to do your own drawing, too

11:27 AWizzArd: omg

11:28 I will ask Lau later if this is the same with qt

11:28 cemerick: The other tradeoff is to use SWT or QT, where there's a lot more that's provided in terms of widgets, but it's also a lot more difficult (last I experimented) to do something outside the box.

11:29 and you're also dragging along native libs in any other scenario, so it's a tricky balancing act depending on your requirements

11:30 AWizzArd: Personally I still prefer to offer a swing solution.

11:31 jbondeson: swing is great if you want to do web stuff, but if you're using it as a stand alone app it's seriously lacking.

11:31 cemerick: same here, if only because it keeps down the build and deployment complexity, not to mention cuts down significantly on the cognitive overhead of yet another framework/api to learn

11:31 Chouser: The only reason textjure uses swing is to reduce download/install requirements. I started it in Qt.

11:33 AWizzArd: makes sense (to have it in Swing)

11:33 jbondeson: what do you mean with Swing+Webstuff?

11:33 jbondeson: if you're going a web launch or something

11:33 AWizzArd: Oh, you mean Webstart?

11:35 hellask: when people do very flashy GUIs, what do they use? write their own GUI-lib?

11:36 jbondeson: usually native

11:37 hiredman: flashy GUIs, what do they use? write their own

11:37 GUI-lib?

11:37 er

11:37 sorry

11:42 Chouser: Qt's got a lot of flashiness.

11:44 AWizzArd: Is there an easier way than (into {} java-hash-map) to cast a java.util.HashMap into a clojure.lang.PersistentArrayMap? If I have an array of HashMaps and want to do (map to-clojure-hashmap array-of-java-hashmaps)

11:44 clojurebot: svn rev 1254; improved ref printing, patch from Chouser

11:46 Chousuke: AWizzArd: you can't cast them since the java hashmap is not a subclass of persistenthashmap

11:46 or whichever.

11:46 if you want the persistent behaviour, copying is your only option :/

11:46 AWizzArd: oki

11:47 Chousuke: fortunately copying references is relatively cheap :)

11:48 AWizzArd: clojurebot: namespace of partition-by?

11:48 clojurebot: No entiendo

11:48 AWizzArd: clojurebot: partition-by

11:48 clojurebot: Pardon?

11:48 jbondeson: Chouser: Qt does go down to native, and also I believe that you can test to see if your platform supports certain Qt features before use so you can go from flashy Win/OSX to non-flashy Handheld

11:48 Chousuke: ,`partition-by

11:48 clojurebot: clojure.core/partition-by

11:48 AWizzArd: tricky

11:49 jbondeson: its been a while since i last used Qt extensively, but that's my recolection.

11:49 Chouser: jbondeson: you're probably right. they work hard to support handhelds and get good rendering speeds on a variety of graphics hardware.

11:49 AWizzArd: Chousuke: hmm, my clojure.jar is 4 days old. Since when is partition-by in the core?

11:50 Chousuke: hmm

11:50 actually, that might not be correct.

11:50 .. yeah, it's not in core

11:50 hiredman: ugh

11:50 Chouser: (doc partition-by)

11:50 jbondeson: The amount of time they've spent on the non-GUI parts of their library in the last couple years is pretty crazy too.

11:51 AWizzArd: ,(doc partition-by)

11:51 clojurebot: java.lang.Exception: Unable to resolve var: partition-by in this context

11:51 AWizzArd: yup

11:51 hellask: should i name my inagesearch site to imagejure?

11:51 tihi

11:51 hiredman: my fix to read so it runs in the sandbox namespace may have been lost it git somewhere

11:51 AWizzArd: ,#'partition-by

11:51 clojurebot: java.lang.Exception: Unable to resolve var: partition-by in this context

11:51 Chousuke: hiredman: lost?

11:51 I can see it

11:51 AWizzArd: hellask: imajine

11:51 jbondeson: haha

11:51 hellask: lol

11:51 jbondeson: i thought we said no j's last week.

11:51 Chouser: ,(doc partition-by)

11:51 clojurebot: "([f coll]); Applies f to each value in coll, splitting it each time f returns a new value. Returns a lazy seq of lazy seqs."

11:52 Chousuke: hiredman: it's commit 0ede20b5563b54f11dcfe20fe6d3c2969c701c72 if that helps :p

11:52 or do you mean you've accidentally undone it? :)

11:52 jbondeson: ah yes, commit 0ede20b5563b54f11dcfe20fe6d3c2969c701c72, i remember it well.

11:52 AWizzArd: Chousuke: why does your doc do something different than mine? Did hiredman do some magic inbetween?

11:52 hiredman: ,`partition-by

11:52 clojurebot: clojure.contrib.seq-utils/partition-by

11:52 AWizzArd: thx

11:53 Chousuke: this is why lisp is fun

11:53 hiredman: clojurebot: weirdo

11:53 clojurebot: Gabh mo leithsc�al?

11:53 Chouser: jbondeson: we use Qt extensively at my job, and almost never use any of the GUI classes.

11:53 Chousuke: stuff changes while you're using the system and the user is left confused!

11:53 Chouser: hiredman: I ran 'use' in a private chat with clojurebot

11:53 hiredman: Chouser: yeah

11:54 Chouser: yeah

11:55 AWizzArd: so, partition-by can not be used if I have a vector of 200 hashmaps where each hashmap contains a k/v pair :type :some-type and where 6 different :some-types exist, and I just want 6 result lists, each containing data from the respective hashmaps, right?

11:55 Uhm, does that make sense?

11:56 partition-by creates a new result list as soon f returns a new val.. but it can't go back to previous vals.

11:57 Chouser: you want 'group-by'?

11:58 AWizzArd: ,(doc group-by)

11:58 clojurebot: "([f coll]); Returns a sorted map of the elements of coll keyed by the result of f on each element. The value at each key will be a vector of the corresponding elements, in the order they appeared in coll."

11:59 svn rev 1255; fixed `()

12:00 AWizzArd: Chouser: good idea, thx

12:04 rsynnott: the machine (clojurebot) speaks irish?!

12:06 cemerick: rhickey: regarding the code size limitation from before -- I think it'd be very helpful if the compiler (or reader?) could emit an exception as soon as a too-large literal is encountered

12:06 AWizzArd: rsynnott: yes, and german and french too

12:06 rhickey: cemerick: it's the sum of literals, + code, not any one, that matters

12:07 cemerick: rhickey: OK -- so then the compiler would be able to make a determination, perhaps after writing the classfile at least, perhaps?

12:08 it just seems that that kind of late failure (which will only hit when the classfile is loaded) should be eliminated if at all possible

12:08 * cemerick wonders how many times he can sneak 'perhaps' into a missive

12:09 cemerick: :-/

12:14 clojurebot: svn rev 1256; fixed Ratio to floating point conversion, patch from jbondeson

12:19 svn rev 1257; fixed Ratio->bigdec, patch from jbondeson

12:21 hiredman: a maelstorm of activity

12:21 jbondeson: rich is on a roll

12:22 hiredman: clojurebot: rhickey?

12:22 clojurebot: he works hard so you don't have to

12:23 jbondeson: now i have to find a couple more math bugs to keep him on his toes.

12:26 so now that printing a reference actually does the deref, and then the addition of the future feature, I take it that means that if you're not careful at the repl you'll get a blocked print

12:27 hiredman: oooh

12:28 ayrnieu: or uncareful with debugging prints.

12:29 clojurebot: svn rev 1258; clojure.main should not exit if there was an exception in an --init file and the user requested a repl, patch from arohner

12:48 Chouser: good point. future is the first thing where a deref can block.

12:50 jbondeson: i don't know if it's truly a problem, but it does have a couple interesting ramifications.

12:51 Chouser: by my count, 17 people (beside Rich) have gotten patches into Clojure. That's a really good sign.

12:52 rhickey: Chouser: yes, it's great - thanks all!

12:53 It's going to be needed in order to keep the fixes/complaints ratio high

12:53 Chouser: Up from zero one year ago.

12:54 rhickey: sadly the days are gone when I could keep fixes/complaints at 1 by myself

12:55 rsynnott: did the license ever change in the end?

12:55 * technomancy got his CA in but hasn't found anything to fix yet

12:55 technomancy: any suggestions? =)

12:56 Chousuke: what's the status of pretty-printing?

12:56 ayrnieu: anyway, future-call is so simple, a concerned person can just roll another

12:57 Chouser: technomancy: there's a whole list of issues -- take your pick.

12:58 http://code.google.com/p/clojure/issues/list

13:00 13 might be a good place to start. or 17 might be fun.

13:01 technomancy: I don't know much about how compilation works... so for 13 the point is you shouldn't be able to create symbols/keywords that contain unprintable characters? or what?

13:01 the description is a little terse

13:01 Chousuke: I poked at 13 some but gave up. I think it should be determined clearly first what actually constitutes a valid symbol

13:02 Chouser: technomancy: unreadable

13:02 technomancy: sounds like a good pre-requisite. =)

13:02 Chouser: oh sure; that makes sense

13:02 Chouser: ,(symbol "spaces in symbol?")

13:02 clojurebot: spaces in symbol?

13:02 Chouser: running that back through the reader will not give you what you put in

13:02 hiredman: hmmm

13:02 Chousuke: / is one interesting corner case too

13:02 Chouser: thus shouldn't be allowed in the first place.

13:02 Chousuke: ,/

13:02 clojurebot: #<core$_SLASH___3201 clojure.core$_SLASH___3201@12088db>

13:02 Chousuke: ,/foo

13:02 clojurebot: Eval-in-box threw an exception:Invalid token: /foo

13:03 Chousuke: I wonder if simething simple as trying to read what (symbol) outputs would be enough :/

13:05 ayrnieu: CL: '|symbol with spaces| (read-from-string "|symbol with spaces|") => |symbol with spaces|

13:05 jbondeson: doesn't reading a symbol potentially have effects?

13:05 Chouser: Chousuke: that would be correct, but I'm not sure if that would be efficient enough.

13:05 jbondeson: no

13:06 jbondeson: no potential to de-lazify (so calling MW for that word) anything?

13:06 ayrnieu: clojure.org already has a definition of what's valid in a symbol.

13:06 jbondeson - do you want dorun , doall ?

13:06 Chouser: not at read time. CL might do interning or something, but Clojure does not (at read time).

13:07 jbondeson: cool, just checking.

13:07 * Chouser wonders if it would be rude to refer to CL in the past tense.

13:07 jbondeson: haha

13:07 just make sure to do that in a c.l.lisp conversation

13:07 Chouser: I had to correct my statement above. No need to offend anyone.

13:08 WizardofWestmarc: only if Kenny's sure to read it <_<

13:08 ayrnieu: if you wanted to stick to present tense, you should've said "CL may do"

13:08 Chouser: "CL might do" is much more polite than "CL might have done"

13:10 danlarkin: ayrnieu: "CL may do" is future tense!

13:11 ayrnieu: jbondeson - what does "calling MW for that word" mean?

13:11 jbondeson: can't we all just agree that engineers suck as linguists?

13:11 ayrnieu: as in call merrian-webster, sorry

13:11 ayrnieu: no, we can't.

13:12 ah.

13:12 jbondeson: yes, but engineer-linquists are invariably bad engineers ;)

13:19 clojurebot: svn rev 1259; zip/remove does not return the correct loc, patch from cgrand fixed refer-clojure doc

13:24 jbondeson: I hereby dub today: "Clojure Defect Closeout Day", or alternatively "Rick Diffs His Heart Out Day"

13:25 gnuvince: ?

13:26 jbondeson: half dozen bugs closed out and it's not even 2 on the east coast!

13:28 hahah just saw "Rick" and not "Rich" sorry

13:29 clojurebot: svn rev 1260; add a warn-on-reflection option to clojure.lang.Compile, patch from cemerick

13:31 Chouser: the last such session was Jan 23 and 24th -- 7 contributed patches in 2 days.

13:35 Chousuke: It seems rich just goes through the issue list at random intervals and applies patches.

13:36 ayrnieu: huh, clj just blocked forever on a simple (defn broadcast (msg WRONG THIS SHOULD BE A VECTOR) ...)

13:38 Chouser: ayrnieu: ?

13:38 ayrnieu: I just played commenting games to see that it was holding up on that line.

13:38 Chouser: msg?

13:38 Chousuke: ayrnieu: you sure you didn't just forget a closing paren?

13:38 Chouser: did you forget a vector of formal args?

13:38 ayrnieu: Chouser - instead of throwing java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalArgumentException: Don't know how to create ISeq from: Symbol

13:38 Chousuke - yes, but even if it had been that, is that reasonable?

13:39 Chouser - instead of throwing that, it just hung.

13:39 Chousuke: well, the repl doesn't stop reading until it has a complete form.

13:39 jbondeson: might have been in a parse loop.

13:39 Chouser: oh, I see what your example means now

13:40 ayrnieu: Chousuke, this wasn't at the repl.

13:40 Chouser: because your msg function was blocking?

13:41 ayrnieu: there's no 'msg' function, and defn would've complained about the impropriety of not having [msg] before anything could evaluate (msg)

13:43 Chouser: I'm failing to reproduce the blocking behavior here.

13:44 jbondeson: how much code was around it?

13:52 ayrnieu: it's repeatable, but weirdly dependent on enough odd factors that I can't just paste the code

13:53 technomancy: Chouser: are the rules the same for what's allowed in a keyword vs a symbol?

13:53 jbondeson: sounds like the parser freaking out.

13:53 is the parser auto-generated? I've never looked at that part of clojure.

13:54 Chouser: jbondeson: no, it's hand-written Java

13:55 technomancy: good question.

13:56 Hun: parser generators are not really useful for parsing lisp (you need less code handcoding than for the parser)

13:56 doesn't really matter which one

13:58 ayrnieu: here, if you get the latest clojure and the latest clj-actors , you can 'make watcher' and see the hang

13:59 jbondeson: well, clojure is slightly less "regular" than something like CL due to special forms requiring square brackets rather than sexprs

13:59 ayrnieu: http://github.com/ayrnieu/clj-actors/tree/master ; if you comment out the unrelated forms before the (defn broadcast (msg) on line 15 of examples/watcher.clj , it doesn't hang

14:00 if you don't :use act.actors , it doesn't hang.

14:00 Hun: jbondeson: you have a lot more problems parsing CL due to reader macros, e.g. #()

14:04 jbondeson: Hun: true, user defined reader macros make that part of it harder.

14:04 Hun: the default ones are bad enough.

14:08 ayrnieu: I can defn- to make something private. Can I make something not exported by default, so that (:use mylib) alone won't bring it into the caller's namespace?

14:09 technomancy: ayrnieu: you mean like a regular def?

14:09 oh, never mind

14:10 danlarkin: ,`defvar-

14:10 clojurebot: sandbox/defvar-

14:10 danlarkin: :(

14:10 technomancy: you mean private-by-default-but-with-workarounds?

14:13 ayrnieu: at present you have a namespace that you can load and then ns/foo things, you can bring some of those things into your namespace, and you can bring all of those things into your namespace. I'd like a "bring useful non-polluting things into my namespace, and then still refer to ns/shortname"

14:14 danlarkin: well there's always :only

14:14 technomancy: but some kind of "only by default" so users wouldn't have to think about it would be nice

14:15 ayrnieu: that's the "bring some of those things into your namespace".

14:15 (ns foo) (defn x [] (println *ns*)) (ns user) (foo/x) ;; prints #<Namespace user>

14:15 so maybe a foo/import can do this.

14:23 Chouser: In error-kit I'm currently marking things private, but if I need to get to them (say from a macro) I use cgrand's idea of @#'error-kit/private-thing

14:25 jbondeson: Chouser: i wonder if that's an officially sanctioned work around, after cgrand said that i also used it for some things that i needed, but i'm worried it'll be changed to respect the privacy of the ns.

14:25 technomancy: what's the right way to do this?

14:25 (< (java.util.Date.) (java.util.Date.))

14:26 Chouser: (.before (java.util.Date.) (java.util.Date.))

14:26 I would think

14:26 technomancy: thanks... is there a way to make < DTRT?

14:32 danlarkin: ew, marking things as private and then using them with @#'foo/bar is evil!

14:32 technomancy: danlarkin: aka "Ruby-style private". =)

14:32 danlarkin: if you need to use it from a different namespace then it should be public, end of story

14:32 IMO anyway

14:33 Chouser: You might be able make clojure.lang.Numbers fall back to 'compare' when dealing with non-numbers.

14:33 done that way, I don't think it'd hurt performance for numbers.

14:33 danlarkin: even if the only way it "should" be used is via a macro?

14:34 jbondeson: it's a very common situation to have only "approved" access to a method

14:34 technomancy: Chouser: maybe I'm just stuck on duck typing, but it seems to me that < and > should be a little more capable.

14:34 danlarkin: Chouser: yeah that's when you name it _private-thing

14:34 hiredman: ugh

14:35 ayrnieu: denlarkin - so the end of story is that users of your library have to deal with this extra undocumented element after they :use your library ?

14:35 hiredman: what is this, python?

14:35 :P

14:35 danlarkin: :)

14:35 jbondeson: yeah, but then you have all these underscore methods polluting your namespace

14:35 Chouser: technomancy: sure, but there's a whole batch of people who will complain very loudly if you take away even a tiny bit of the primitive number performance.

14:35 kotarak: Isn't "private references from macros" on the todo list?

14:35 danlarkin: private or public! it's binary!

14:36 jbondeson: Chouser: that'd be math heads like me! don't screw with my primitive math performance ;)

14:36 Chouser: kotarak: not that I know of.

14:36 technomancy: jbondeson: but... but... < barfs with dates!

14:37 jbondeson: don't mess with numbers speed >=|

14:37 ayrnieu: (def farty-primitive-< <) (defmulti glorious-DTRT-< (fn [x & _] (class x)))

14:37 jbondeson: make your own that's slow!

14:38 * technomancy is a fan of the simple one doing the right thing, and there being a less-pretty one you can use if you need speed

14:38 ayrnieu: or you can just (defmulti < ...) and then clojure.core/<

14:38 jbondeson: it would be nice to have some sort of default speed/capability libraries that you could import.

14:38 Chouser: Numbers.java is 4371 lines

14:38 kotarak: Chouser: I thought it was. But the backpackit site is gone.

14:38 Anyway: would be nice to have.

14:39 jbondeson: It could default to DTRT, and then bit heads could get the "really-fast-<"

14:39 drewr: I've gotten so used to ns that I forget how to use require and use outside of it

14:39 what's wrong with (require 'com.notifymd.wm.core :as 'wm)?

14:40 hiredman: need a vector

14:40 drewr: ah, (require '[com.notifymd.wm.core :as wm])

14:40 I wasn't quoting it

14:40 kotarak: which you need inside ns, too, btw. ;)

14:41 jbondeson: the different syntaxes in and out of ns is slightly annoying.

14:41 drewr: kotarak: not the quote

14:41 kotarak: drewr: you quoted everything, but forget the vector.

14:41 drewr: kotarak: yes to the vector

14:42 technomancy: jbondeson: that's what I'm thinking; it'd be nice, but I don't think I'm ready to push for that at this point since there would be lots of opposition.

14:43 jbondeson: primitive comparison methods being actual methods would be nice as it would add extensibility

14:43 Chouser: you'd want the plain functions available still, but perhaps they could be pushed off to 'require*' and such

14:45 hmph. Methods in Numbers take args of type Number. For some reason I thought they were Object in some places.

14:45 ayrnieu: you can write (defmulti < ...), refer to clojure.core/<, offer it as clojure.contrib.flexi-prims

14:46 Chouser: http://github.com/gnuvince/clojure-greatest-least/blob/5d139382cf0a8b5b74fd222de180faaf4204f749/clojure/contrib/greatest_least.clj

14:47 ayrnieu: one day github will have terse DTRT URLs.

14:48 hiredman: say the word and clojurebot will start tinyurling everything again

14:48 Chouser: it only helps if nobody has to see the long one

14:49 for example if i were less lazy and tinyurl'ed it first.

14:49 kotarak: maybe a private msg to clojurebot, which tinyurls and then posts?

14:50 gnuvince: I don't see the point of tinyurlizing an URL that's already posted: just click on it

14:50 hiredman: I was mostly kidding out turning it back on

15:02 lisppaste8: ayrnieu pasted "multiple arities make me happy inside" at http://paste.lisp.org/display/75134

15:17 fanda: hello! i have question about namespaces... i am sure, it was discussed before, but why is "ns" better than "namespace"?

15:17 we have "require", "import", "use"

15:18 Chouser: fanda: you're asking for a longer name for the existing macro?

15:18 fanda: would be "namespace" better to clearly mark the beginning of one such?

15:19 Chouser: yes, to me it would make sense

15:19 Chouser: 'namespace' is currently a function that returns that part of a symbol or keyword

15:19 (doc namespace)

15:19 clojurebot: Returns the namespace String of a symbol or keyword, or nil if not present.; arglists ([x])

15:19 Chouser: ,(namespace 'foo/bar)

15:19 clojurebot: "foo"

15:19 fanda: oooh, I see

15:20 hm, what to do, what to do :-)

15:22 ok, then

15:24 so we got ns, in-ns, namespace, name

15:26 is there anybody, who oversees issues for clojure-contrib?

15:26 http://code.google.com/p/clojure-contrib/issues/list

15:27 new issues for tests haven't made it in

15:27 i would like to write more tests, but patches will soon cause merging issues

15:29 these patches influence only test_clojure, so they are not really breaking anything except tests itself

15:29 Chouser: fanda: the problem is there are several people, with vague responsibilities.

15:32 fanda: is there a chance for me to be resposible for test_clojure?

15:32 rhickey has my CA, i wrote him an email too

15:32 i believe he is the only one with the right to include me to developers, right?

15:32 Chouser: fanda: yes

15:33 fanda: i will write more patches, if you want me to

15:34 so you can see my Clojure style

15:35 kotarak: Slightly offtopic question for gorilla: are there any Windows Vim users around?

15:35 fanda: otherwise, I would be happy to take care of test_clojure

15:35 jbondeson: kotarak: we cull those kinds of people so they don't spread.

15:36 Chouser: I'm barely following the test_clojure code, so I don't feel I'm in a position to evaluate or apply patches there. I would hope Stuart Sierra or Stephen Gilardi would handle your patches for you.

15:37 fanda: or if Rich gives you write permissions, then you can do it yourself.

15:39 kotarak: jbondeson: That's a pity. You are missing some bright heads, then.

15:39 jbondeson: vim users, yeck ;)

15:39 forest_: is there someone using gentoo clojure ovrelay, is it sexy ?

15:40 kotarak: Well, vim has now omni completion with docstring and arglist preview for Vars and imported functions.

15:40 The problem is: it doesn't work on Windows. :/

15:40 fanda: Chouser: ok, I will contact Stuart Sierra or Stephen Gilardi, that should do it :-)

15:40 danlarkin: forest_: I use it

15:40 forest_: I would not recommend it

15:41 forest_: yes, that is what i was afraid of)

15:41 hiredman: clojurebot: emacs?

15:41 clojurebot: uggada buggada

15:41 hiredman: clojurebot: emacs?

15:41 clojurebot: uggada buggada

15:41 hiredman: hmmm

15:43 forest_: clojurebot: uggada buggada

15:43 clojurebot: excusez-moi

15:46 scottj: What are good reasons for the name reset! not replacing ref-set?

15:47 kotarak: scottj: what are good reasons for the name reset! to replace ref-set?

15:47 cooldude127: scottj: isn't reset misleading?

15:47 ref-set is a tad more clear

15:48 ayrnieu: (commute some-ref #(do %2) new-value)

15:48 jbondeson: ref-set and reset! do different things though.

15:48 reset! only works on atoms.

15:48 cooldude127: wait we already have something called reset?

15:49 jbondeson: yes

15:49 ,(doc reset!)

15:49 clojurebot: "([atom newval]); Sets the value of atom to newval without regard for the current value. Returns newval."

15:49 cooldude127: i haven't reeducated myself. i only remember when there were vars, refs, and agents

15:49 ,(doc ref-set!)

15:49 clojurebot: java.lang.Exception: Unable to resolve var: ref-set! in this context

15:49 jbondeson: no ~

15:49 cooldude127: ,(doc ref-set)

15:49 jbondeson: err !

15:49 clojurebot: "([ref val]); Must be called in a transaction. Sets the value of ref. Returns val."

15:50 cooldude127: wtf are atoms?

15:50 Chouser: cooldude127: http://clojure.org/atoms

15:50 ayrnieu: cooldude, now we have vars, refs, atoms, agents, and futures.

15:51 durka42: futures?

15:51 ayrnieu: and I think we don't have enough :-) Concurrency is hard.

15:51 jbondeson: just don't mess with oil futures!

15:51 ayrnieu: ,(doc future)

15:51 clojurebot: java.lang.Exception: Unable to resolve var: future in this context

15:51 jbondeson: just got added today

15:51 clojurebot isn't updated

15:51 cooldude127: oh god

15:51 scottj: reset! is for atoms, ref-set is for refs. superficially the difference seems to be one needs to be called in a transaction, the other doesn't.

15:52 cooldude127: scottj: sounds right

15:52 jbondeson: atoms and refs are different

15:52 ayrnieu: durka - (let [fut (future expr expr expr)] @fut (comment BLOCKING))

15:52 scottj: jbondeson: yeah, but you're reseting both of them aren't you?

15:52 ayrnieu: refs offer STM. atoms have simple spinlocks.

15:52 jbondeson: atoms are simplified refs

15:53 cooldude127: oh

15:53 technomancy: it seems strange to me that test_clojure is treated like any other contrib library

15:53 jbondeson: you want to have different syntax when they are doing different things.

15:53 that's why the bangs are there.

15:54 ayrnieu: technomancy - it'd be odd if you were doing TDD yourself. But if someone else wants to provide tests?

15:54 jbondeson: though slightly confusingly you have bangs (!) on some other functions as well...

15:55 kotarak: I would expect reset to re-set something to some predefined value....

15:56 hiredman: kotarak: it makes sense if you think of when you initially set the value

15:56 you don't use a function like you do with swap!

15:56 kotarak: Then I don't "re"set it.

15:56 forest_: ,(. javax.swing.JOptionPane (showMessageDialog nil "Hello World"))

15:56 clojurebot: java.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it.

15:56 kotarak: (I know: set! is already gone)

15:56 jbondeson: yes you do, you "set again" since it was already set once.

15:57 blippet: dudes what do you thnk of phowser or powser for an image search engine(phowser=photo browser)

15:57 ?

15:57 durka42: so a future is sort of like a one-time agent?

15:58 hiredman: hmmm

15:58 jbondeson: durka42: it also blocks if you attempt to deref before computation is completed

15:58 durka42: so @future has an implied await

15:58 technomancy: ayrnieu: it makes sense that it's part of contrib (if shipping clojure itself without tests in the first place can be said to make sense), but it seems odd that it lives under src/ and gets shipped out with every app that makes use of contrib.

15:58 durka42: whereas if you deref an agent before it finishes you'll get the old value?

15:58 jbondeson: correct.

15:59 agent, atom, and refs are all non-blocking.

15:59 futures are now blocking

15:59 durka42: can futures have watchers

16:00 ayrnieu: add-watcher doesn't mention it, but you can easily spawn off an agent to block on a future and then send a message.

16:00 danlarkin: let's say I want to create a list of the return values of a list of functions. except one of the functions returns a two-vector but I want to insert both of the items into my list separately, not the two-vector itself... anyone have a better way than looping through and checking the return type?

16:00 ayrnieu: add-watcher on futures would be odd, though, because futures only 'change' once.

16:00 jbondeson: ummm... no i don't thing so

16:00 there is a isDone method on the returned object though

16:01 ayrnieu: danlarkin - other than "don't do that", no.

16:01 jbondeson: I believe that's one of the reasons he removed "get" from IRef, and added a IDeref and "deref"

16:01 danlarkin: ayrnieu: but... but.. that's what I want :(

16:01 jbondeson: reevaluate what you want ;)

16:02 Chouser: if they all return vectors then you can just concat or mapcat

16:02 cooldude127: danlarkin: wrap your functions in another function that checks the return type

16:02 then do what Chouser said

16:02 ayrnieu: danlarkin - you could flatten the vector later on.

16:04 jbondeson: i wonder if there was a reason future-call is implemented with a proxy rather than a concrete object in clojure.lang

16:04 danlarkin: Chouser: yes, there we go, I suppose I could have them all return vectors, thanks :)

16:04 Chouser: proxy is more fun to write than .java

16:04 jbondeson: Chouser: hahaha true

16:04 Chouser: atom was just a proxy for a while too

16:05 hiredman: mmmmm

16:05 ayrnieu: and in addition, people complaining about future can look at the proxy and say "oh, I'll just do something like that."

16:12 blippet: how do I set an arrays values?

16:12 jbondeson: kubrick is splitting waaaay too often recently

16:12 blippet: (def a (make-array Integer 3))

16:12 how do I set a[0]?

16:13 jbondeson: ,(doc aset)

16:13 clojurebot: "([array idx val] [array idx idx2 & idxv]); Sets the value at the index/indices. Works on Java arrays of reference types. Returns val."

16:13 durka42: (doc into-array)

16:13 clojurebot: Returns an array with components set to the values in aseq. The array's component type is type if provided, or the type of the first value in aseq if present, or Object. All values in aseq must be compatible with the component type. Class objects for the primitive types can be obtained using, e.g., Integer/TYPE.; arglists ([aseq] [type aseq])

16:13 durka42: might also be useful

16:14 ayrnieu: ,(into-array Byte/TYPE (map byte [127 0 0 1]))

16:14 clojurebot: #<byte[] [B@1a99836>

16:14 ayrnieu: ,(seq (into-array Byte/TYPE (map byte [127 0 0 1])))

16:14 clojurebot: (127 0 0 1)

16:15 jbondeson: dealing with java arrays involves prefixing with 'a' quite a bit

16:42 cemerick: is ! being held over for potential future syntax? I actually have a fn or two I'd like to name !.

16:42 blippet: does anyone think podular is a good name for a podcastaggregator/recommender site?

16:43 jbondeson: cemerick: it seems to be used on any function that modifies a reference object outside a transaction

16:44 cemerick: jbondeson: I was actually talking only about ! itself -- which I just noticed isn't defined at all anymore. It was the old name for send-off, I think.

16:44 jbondeson: if things like twitter, and reddit are any indication, you don't need a good name. in fact a good name may be a deterrent.

16:44 ah

16:45 danlarkin: just two adjacent consonants

16:45 cooldude127: lol

16:45 technomancy: cooldude127: how's the date lib?

16:45 cooldude127: technomancy: i haven't been working on it lately

16:45 jbondeson: right, the less pronoucable, the better the name.

16:45 WizardofWestmarc: or just get drunk and start scribbling, then when you wake up the next morning see what looks the trendiest ;-)

16:46 jbondeson: gogwitter

16:46 cooldude127: technomancy: caught in school work. data structures are a bitch

16:46 cemerick: rhickey: just to make sure: are you planning on using ! for any future syntax?

16:46 technomancy: cooldude127: bleh; school is useless.

16:47 jbondeson: technomancy: come now, school's good for learning how to learn. which is good cause they're going to have to reteach you when you get a real job ;)

16:48 cooldude127: school is finally getting me back into actually coding tho

16:48 technomancy: well it's decent for learning stuff like literature and what have you I guess

16:49 cooldude127: anyway, I'm not working on the project that was going to use the date lib right now, but when I finish up with Mire I'm probably going to bug you about it

16:49 cooldude127: technomancy: sounds fine, let me know what kind of stuff you need most

16:51 blippet: twitter is good in my opinin

16:53 jbondeson: the only way twitter could be worse is if it was twittr. oh wait it was twittr

16:53 technomancy: ... says the guy with two adjacent consonants in its name

16:53 blippet: lol

16:53 cooldude127: lol

16:53 WizardofWestmarc: what ever happened to your secret weapon url jbondeson? :P

16:53 mofmog: if i can do something in java, i should be able to do the same in clojure correct? Say there was tutorial to make a java facebook app. If I knew decent amount of clojure, translating the java code to clojure would be relatviely painfree, albeit not idiomatic clojure

16:54 jbondeson: WizardofWestmarc: let it lapse, was never going to get it done. something tells me it will still be available if i get it again...

16:54 cooldude127: mofmog: i think for the most part, although if you're not doing idiomatic clojure, it probably wouldn't be all that fun

16:54 technomancy: fun or worthwhile

16:54 mofmog: cooldude: well true, but i just want to get a proof of concept up

16:55 jbondeson: yeah, you may want to take the time to actually attempt a functional implementation.

16:55 cooldude127: mofmog: yeah, the point i'm making is if you're writing it in the style of java, you might as well use java

16:55 mofmog: true true

16:55 but i just want to see if i have all the dependencies needed to accomplish the task

16:55 cooldude127: oh

16:56 blippet: mofmog: it should work since you can compile to class-files

16:56 mofmog: because i plan on getting a server with tomcat installed and i was wondering if that's enough

16:56 and the people who run it need to know that i need tomcat since it's university web hostin

16:57 and if there is java library X i can use X in clojure like anything else right? becuase the professor i'm doing this for, i told him that anything java can do you can do it in clojure

16:57 cooldude127: mofmog: yes you would probably be fine

16:57 mofmog: yeah, the whole point of using clojure is that scheme is taught here, so when i leave he can easily find a new replacement

16:57 well, not the whole point, but a significant point

16:58 and then, it could be pointed to as an example of, "hey, using SICP isn't impractical after all!"

17:38 hiredman: clojurebot: help is <reply>http://www.khanacademy.org/

17:38 clojurebot: Ik begrijp

17:39 durka42: clojurebot: help meee!11one

17:39 clojurebot: http://www.khanacademy.org/

17:40 jbondeson: khan acadamey sounds more like where you go to learn how to be a cheesy star trek villan

17:40 danlarkin: obligatory KHAAAAAAAANNNN!

17:40 WizardofWestmarc: I was expecting that when I clicked the link :(

17:40 * WizardofWestmarc is a sad clojure user in snow.

17:53 ayrnieu: OK, I don't like automatic derefs at the REPL.

17:53 jbondeson: hahaha

17:53 Chouser: ayrnieu: really?

17:53 ayrnieu: just because of futures, or something else?

17:53 ayrnieu: I haven't hit blocking futures yet, but I have self-referential agents.

17:54 so I get {:self #<Agent@430d2f: {:self #<Agent@430d2f: {:self #<Agent@430d2f: {:self #<Agent@430d2f: {:self #<Agent@430d2f: whereas before I just got the #<Agent ...>

17:54 Chouser: ah, sure.

17:55 well, for now it's easy to override, but I wonder what the best solution would be.

17:55 jbondeson: repl setting?

17:55 or a meta :fortheloveofgoddontderefme

17:55 Chouser: eh

17:56 ayrnieu: CL has variables to control printing at the REPL, circularity detection, etc. But here a depth limit on derefs would be OK.

17:56 Chouser: ayrnieu: (remove-method print-method clojure.lang.IDeref)

17:56 ayrnieu: but that's harder to do than to just have my library say "you don't want to print our agents"

17:56 right.

17:56 Chouser: there's already a variable for limiting depth

17:58 ayrnieu: ,(let [ag (agent {})] (send ag assoc :self ag) (await ag) ag)

17:58 clojurebot: Eval-in-box threw an exception:java.lang.reflect.InvocationTargetException

17:58 Chouser: ayrnieu: (set! *print-level* 6)

17:58 ayrnieu: aha, OK.

17:59 Chouser: but that doesn't strike me as a particularly nice solution for your situation.

17:59 are you sure you need the :self reference?

17:59 ayrnieu: Yes.

17:59 Chouser: every agent action gets *agent* bound to itself.

17:59 ayrnieu: OK, no :-)

17:59 Chouser: :-)

17:59 jbondeson: circular detection would probably get a bit messy in there.

17:59 forezt: can clojure help us to overcome world crisis ?

18:00 technomancy: the implementation of symbol calls intern with only one arg, but intern doesn't have a single-arg version. how does that work?

18:01 Chouser: technomancy: it's right there, line 43

18:01 hiredman: uh

18:01 yeah

18:01 * technomancy updates to latest

18:02 hiredman: wait

18:02 are we talking clojure side or java side

18:02 Chouser: http://code.google.com/p/clojure/source/browse/trunk/src/jvm/clojure/lang/Symbol.java#43

18:02 technomancy: clojure-side

18:02 hiredman: (. clojure.lang.Symbol (intern ns name))

18:03 line 340

18:03 technomancy: hiredman: what about line 339?

18:03 Chouser: line 339 calls the java method I just posted a link to.

18:04 technomancy: Chouser: so you can have a lisp function with the same name as a java function without any conflict?

18:05 I mean, as long as they have different arities?

18:05 hiredman: uh, there are no java functions, and . is a special form

18:06 Chouser: oh!

18:06 (. clojure.lang.Symbol (intern ns name)) is the same as (clojure.lang.Symbol/intern ns name)

18:06 walters: technomancy: AIUI each clojure function is in a separate java class

18:06 Chouser: it's the older/internal syntax

18:06 technomancy: Chouser: gotcha. I was taking (intern name) as a clojure function call

18:07 walters: (in the future the anonymous classloader will make that a lot nicer)

18:07 technomancy: that's ... pretty funky

18:07 Chouser: technomancy: yeah, I just realised that. :-)

18:07 technomancy: thanks

18:07 Chouser: as far as I know, rhickey isn't writing any new code with that style.

18:08 technomancy: right; if I update that I'll "modernize" it

18:08 Chouser: good. :-)

18:09 technomancy: Chouser: but enforcing symbol names sounds like it might be better as Java-side change?

18:10 durka42: *print-level* doesn't seem to prevent this... http://rafb.net/p/jAzQJx40.html

18:10 * technomancy should probably start with a lisp-side fix for now

18:10 durka42: (the output was large the JVM and lisppaste choked on it...)

18:11 jbondeson: owch

18:11 durka42: so large*

18:12 Chouser: durka42: ah, indeed. I tested it with a hash-map in-between each level. *sigh*

18:12 that'll teach Rich to take patches from me. :-P

18:12 durka42: i mean, i don't see why one would ever do what i did there

18:12 but i did break it :p

18:12 jbondeson: so sad Chouser, so sad...

18:13 so your next patch is cirular reference detection, right?

18:15 lisppaste8: ayrnieu pasted "@*this-node*" at http://paste.lisp.org/display/75151

18:16 ayrnieu annotated #75151 with "the explanation" at http://paste.lisp.org/display/75151#1

18:19 Chouser pasted "print deref counts toward *print-level* patch" at http://paste.lisp.org/display/75152

18:21 durka42: oh, *print-level* was pre-existing?

18:21 what else does it apply to?

18:21 ayrnieu: (repeat 1)

18:22 nah, not that.

18:22 durka42: :)

18:23 ayrnieu: ,(take 10 (iterate list 1))

18:23 clojurebot: (1 (1) ((1)) (((1))) ((((1)))) (((((1))))) ((((((1)))))) (((((((1))))))) ((((((((1)))))))) (((((((((1))))))))))

18:23 ayrnieu: ,(binding [*print-level* 2] (take 10 (iterate list 1)))

18:23 clojurebot: (1 (1) ((1)) (((1))) ((((1)))) (((((1))))) ((((((1)))))) (((((((1))))))) ((((((((1)))))))) (((((((((1))))))))))

18:23 durka42: ,*print-level*

18:23 clojurebot: nil

18:23 durka42: (doc *print-level*)

18:23 clojurebot: *print-level* controls how many levels deep the printer will print nested objects. If it is bound to logical false, there is no limit. Otherwise, it must be bound to an integer indicating the maximum level to print. Each argument to print is at level 0; if an argument is a collection, its items are at level 1; and so on. If an object is a collection and is at a level greater than or equal to the value bound to *print-leve

18:25 ayrnieu: ,(set! *print-level* 5)

18:25 clojurebot: java.lang.NoClassDefFoundError: clojure/lang/Compiler$AssignExpr

18:25 durka42: ,(binding [*print-level* 3] (print (take 10 (iterate list 1))))

18:25 clojurebot: (1 (1) ((1)) ((#)) ((#)) ((#)) ((#)) ((#)) ((#)) ((#)))

18:26 ayrnieu: ,(first (reverse (take 100 (iterate list 1)))))

18:26 clojurebot: (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((1)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))

18:27 ayrnieu: anyway, it should probably not print exceptions.

18:28 durka42: printing (first (agent-errors %)) wouldn't be terrible

18:29 ayrnieu: well, I need to see the object before I can decide to do something special with it.

18:30 ,(ref :a)

18:30 clojurebot: #<Ref@f9cbe5: :a>

18:30 ayrnieu: ,(let [ag1 (agent nil) ag2 (agent 0)] (send ag1 #(do % (doto (future (send ag2 inc)) deref) (println @ag2))))

18:30 clojurebot: java.lang.Exception: Unable to resolve symbol: future in this context

18:31 durka42: #<Agent@75a30f: nil>

18:31 user=> 1

18:31 but sometimes the 1 arrives before the nil

18:32 ayrnieu: oh, sorry, that was an example of awaiting -- agents can't await, but futures can.

18:33 hiredman: weird

18:34 ah

18:34 I want future-call

18:34 ayrnieu: ,(let [ag (agent nil)] (send ag inc) (Thread/sleep 1000) ag) ;; race condition if you try to await here.

18:34 clojurebot: Agent has errors

18:35 ayrnieu: ,(let [ag (agent nil)] (send ag inc) (Thread/sleep 1000) [1 2 ag])

18:35 aplmaus: in clojure, do we have a way of specifying java classes and interfaces so that we expose normal seeming functionality to programmers using java?

18:35 clojurebot: Agent has errors

18:36 ayrnieu: aplmaus - gen-class

18:37 hiredman: clojurebot: url?

18:37 clojurebot: It's greek to me.

18:37 hiredman: er

18:37 aplmaus: do the generated classes have a very different feel in java, or can it be made so that people using them don't even need to know they were made in clojure?

18:37 hiredman: lisppaste8: url?

18:37 lisppaste8: To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste.

18:40 hiredman pasted "I don't \get\ it" at http://paste.lisp.org/display/75155

18:40 jbondeson: aplmaus: i believe that gen-class will give you perfectly normal java classes (not a java expert), the only caveat would be how heavily you lean on the java lang data structures in your interface

18:41 i mean clojure lang data structures

18:41 not java, sorry

18:41 hiredman .deref not .get

18:42 hiredman: jbondeson: but the proxy has a get method

18:42 with no args

18:42 Raynes: There isn't a logical 'and' operator like && in Clojure is there? Man would that be useful.

18:42 jbondeson: worked for me with deref.

18:42 Chousuke: Raynes: ... and is not enough?

18:42 jbondeson: but you are right

18:42 Chousuke: ,(and true false)

18:42 clojurebot: false

18:42 Raynes: Oh!

18:43 I didn't know that existed.

18:43 hiredman: jbondeson: clojure futures are java Futures which is an interface with a few methods

18:43 Raynes: Chousuke: I haven't read the API yet.

18:43 hiredman: include a get method that takes a timeout

18:43 Chousuke: Raynes: there's or too

18:43 hiredman: which is what I am really interested in

18:43 Raynes: Chousuke: Thanks :D

18:44 jbondeson: hiredman: yeah, i see that now, i was just saying that .deref works as you'd expect

18:44 Chousuke: or has the useful property that it returns the first non-false value

18:44 hiredman: jbondeson: so does @

18:44 Chousuke: ,(or nil 1 (iterate inc 0))

18:44 clojurebot: 1

18:44 jbondeson: is there a reason you want .get ?

18:44 hiredman: but I want a get that times out

18:45 jbondeson: ahh

18:45 hiredman: right now I am using a proxy on FutureTask

18:45 which is a Future

18:45 and it is just weird that the proxy acts like that

18:47 jbondeson: hiredman: (.get a 30 java.util.concurrent.TimeUnit/MILLISECONDS)

18:47 using the time, timeunit version seems to work

18:47 hiredman: ugh

18:47 but the .get with no args still doesn't

18:47 which bugs me

18:48 jbondeson: that is a bit odd

18:48 durka42: is that a general proxy problem?

18:48 hiredman: dunno

18:48 I don't know what the problem is

18:49 it seems like it should just work

18:49 Chousuke: the proxy doesn't implement a no-argument version of .get?

18:49 no, it does

18:49 (get [] (.get fut))

18:50 hiredman: I am well aware

18:50 I have been staring at it

18:50 it is all there, but it does not appear to work

18:51 Chousuke: possibly a bug in proxy?

18:52 hiredman: I guess?

18:52 * hiredman is really too tired for this

18:54 durka42: when i try and define a proxy with methods overloaded by arity, it doesn't work at all

18:55 calling the no-arg version says wrong # of args

18:55 calling the one-arg version says no method found

18:55 Chousuke: hahha

18:55 I made it work

18:55 durka42: mm?

18:55 Chousuke: I switched the order of the get definitions in proxy...

18:55 jbondeson: hmmm

18:55 durka42: i was wondering if that was it

18:55 Chousuke: no-arg version first, no-arg version works

18:55 * jbondeson thinks everyone just tested that...

18:56 Chousuke: did not try if the two-arg version still works :/

18:56 jbondeson: you can't overload based on arity...

18:56 hiredman: erm

18:57 jbondeson: proxy blows on it

18:57 heh

18:57 now the two-arg version blows with a generic ClassCastException

18:58 wait

18:58 hiredman: anyway

18:58 jbondeson: that might be me

18:58 Chousuke: no wait, got confused: the version which comes *last* is effective.

18:58 jbondeson: yes

18:58 hiredman: futures just cut 3 lines of code from clojurebot

18:58 jbondeson: last-in wins

18:58 Chousuke: definitely a bug in proxy...

18:59 Someone file an issue, please. it's 02:00 here soon and I must go to sleep.

18:59 hiredman: clojurebot: bat signal is <reply>/summon Chouser

18:59 clojurebot: Ok.

19:00 hiredman: is the issue thing next? don't I need to go to mailing list first or something?

19:00 Chousuke: I will assign it to me in my head and do something

19:01 (e.g. assign it to someone else in the issue tracker)

19:06 jbondeson: damn, generate-proxy is certainly dense

19:12 figured it out

19:12 The proxy definition is wrong

19:12 you have to write it like any other variable arity function

19:13 durka42: ah!

19:13 so it is a bug in future-call, not in proxy

19:13 jbondeson: (get ([] ...) ([one two] ...))

19:13 correct

19:13 proxy should probably blow on that

19:13 durka42: clojurebot: bat signal is also <reply>/summon rhickey

19:13 clojurebot: c'est bon!

19:14 jbondeson: think i should drop that on the group?

19:14 durka42: yeah

19:14 or the issues page

19:14 it should be a simple fix to future-call

19:15 jbondeson: i'll throw it on the issues page.

19:15 lemme double check the patch first

19:18 durka42: i guess you can't implement a two-arg version of a method if the proxied class doesn't have one?

19:18 jbondeson: i believe so

19:18 generate-proxy loops through all the supers and generates potential methods

19:18 yup that worked

19:19 durka42: you have a CA to submit patches?

19:19 jbondeson: yes

19:24 clojurebot: svn rev 1261; fixed get overload in future-call

19:25 jbondeson: haha

19:25 guess i'll just cancel that.

19:25 durka42: nice timing

19:25 * rhickey saw the bat signal

19:34 jbondeson: i wonder if proxy shouldn't throw an error on that.

19:37 rhickey: would you accept a patch that would generate some sort of parser error when you try to have multiple methods of the same name?

19:37 danlarkin: jbondeson: it's a dynamic language! :)

19:38 jbondeson: but it's technically not correct.

19:38 currently proxy is just taking the second method defined.

19:38 it's not DTRT

19:39 rhickey: jbondeson: sure

19:42 jbondeson: rhickey: is there a more specific exception i should use, or would a straight Exception with a good description ok?

19:42 rhickey: jbondeson: IllegalArgumentException

19:44 jbondeson: rhickey: will do, thanks

19:44 Chouser: rhickey: should I re-open the old issue for the IDeref print recursion, or open a new one? or you do you care?

19:45 ayrnieu: ,(let [ag (agent nil)] (send ag inc) (Thread/sleep 1000) [1 2 ag])

19:45 clojurebot: Agent has errors

19:45 rhickey: Chouser: new, thanks

20:01 icey: is there anyone here who can speak to the relative stability of 'weld', or the lack thereof?

20:02 or, more plainly; am I asking for heartache if I start using it for a live site?

20:07 Chouser: ,(let [m1 (java.util.HashMap.) m2 (java.util.HashMap. {:m1 m1})] (.put m1 :m m2) m1)

20:07 clojurebot: Eval-in-box threw an exception:java.lang.reflect.InvocationTargetException

20:07 Chouser: ,(let [m1 (java.util.HashMap.) m2 (java.util.HashMap. {:m1 m1})] (.put m1 :m m2) (prn m1))

20:07 clojurebot: java.lang.StackOverflowError

20:08 hiredman: well

20:08 I guess that is taken care of

20:09 clojurebot: svn rev 1262; added per-defmulti hierarchies, patch from mb

20:14 * danlarkin cheers!

20:14 clojurebot: svn rev 1263; ~@x outside of syntax-quote yields: (unquote-splicing x), patch from mb

22:28 Azmodan: I was wondering if there was a roadmap for Clojure 1.0, I couldn't find one on the net.

22:28 Chouser: Azmodan: not that I know of.

22:29 It seems to me that Rich has specifically resisted any firm list of features for 1.0

22:29 Azmodan: Any idea what reaching 1.0 means?

22:29 Chouser: He has suggested that the first release after Nov 2009 would be called 2.0, so perhaps we can assume 1.0 will be out before then.

22:30 hiredman: huh

22:31 Chouser: I think 1.0 will mean he's ready to fork a stable branch and port bug fixes to both branches. Anything more than that, I can't really say.

22:32 dreish: I would think it would mean no more breaking changes like regex syntax.

22:32 But that's probably too firm.

22:33 Azmodan: It's not *too* firm if 2.0 is less than a year after :)

22:33 Chouser: sure, after 1.0 is released I would expect breaking changes would only happen in the dev branch.

22:33 dreish: Though that's only meaningful if there are two actively-maintained branches.

22:33 As you described above.

22:38 Chouser: the plan, I think, is for the major version number to indicate which year since Clojure's announcement.

22:38 so 1.x for stable versions released between Nov 2008 and Nov 2009, 2.x until Nov 2010, etc.

22:39 dreish: Interesting theory.

22:39 Chouser: minor versions would just count up throughout the year

22:39 dreish: He could go the �ber-Lisp route and number the versions like this:

22:40 ,(dorun (map #(println %) (take 5 (iterate #(list '() (list %)) '()))))

22:40 clojurebot: () (() (())) (() ((() (())))) (() ((() ((() (())))))) (() ((() ((() ((() (()))))))))

22:40 dreish: A la http://en.wikipedia.org/wiki/Set-theoretic_definition_of_natural_numbers

22:41 ayrnieu: ,(first (reverse (take 20 (iterate list '()))))

22:41 clojurebot: (((((((((((((((((((())))))))))))))))))))

22:42 hiredman: why not just call last?

22:42 Chouser: ,(nth (iterate list ()) 20)

22:42 clojurebot: ((((((((((((((((((((()))))))))))))))))))))

22:42 Chouser: no need to quote ()

22:43 dreish: That never seems right.

Logging service provided by n01se.net