Naming Conventions for Functions that Modify State

2009-02-11 Thread Kevin Albrecht
In Scheme, the common scheme used to name functions with side effects is to append an exclamation mark to the function name. Obviously, the types of ways in which Clojure abstracts state modifications are more complicated and complete than Scheme, so maybe a function naming scheme for Clojure fun

Re: Git : I'm lazy

2009-02-11 Thread Jeffrey Straszheim
Thanks. (BTW, the other day some friends made fun of me because I didn't yet use git.) On Wed, Feb 11, 2009 at 11:07 PM, Stephen C. Gilardi wrote: > > On Feb 11, 2009, at 10:57 PM, Jeffrey Straszheim wrote: > > I know I should look this up on the web, but I'm really busy these days. I > do inte

Re: Git : I'm lazy

2009-02-11 Thread Stephen C. Gilardi
On Feb 11, 2009, at 10:57 PM, Jeffrey Straszheim wrote: I know I should look this up on the web, but I'm really busy these days. I do intend to learn git someday, but I'm doing fine with Subversion for my own work. However, a lot of you are distributing your libs in git. So, can you gi

Git : I'm lazy

2009-02-11 Thread Jeffrey Straszheim
I know I should look this up on the web, but I'm really busy these days. I do intend to learn git someday, but I'm doing fine with Subversion for my own work. However, a lot of you are distributing your libs in git. So, can you give me a quick pointer on how to do two things: 1. Check out someo

Re: Creating a new thread-local binding when the thread already exists.

2009-02-11 Thread Jeffrey Straszheim
I just took a quick look at the java.awt.EventQueue class where the dispatch thread is managed, and I could see no obvious place you could hook in your own calling code, which you'd need to wrap it with a (binding ...) form. If you really want to hack the system, look at the code in core.clj for b

Re: Got a Clojure library?

2009-02-11 Thread Jeffrey Straszheim
I'd love to add Clojure-Datalog. I'm still working on it, but it now implements complete Datalog rules, including stratified negation and boolean filters. It can now be used for basic tasks, although the interface is rough. Name: Clojure-Datalog http://code.google.com/p/clojure-datalog/ Jeffrey

Re: Creating a new thread-local binding when the thread already exists.

2009-02-11 Thread Chas Emerick
def doesn't create a thread-local binding, it creates a var within a particular namespace -- the binding form is what established the thread-local binding. So, when used on the AWT/Swing thread, (binding [*my_environment* (new_environment)] ...) will execute the body of the binding form

Re: Suggestion: test-is should print *all* frames of exceptions caught while testing

2009-02-11 Thread Tom Faulhaber
Point taken. The time when it the exception trace becomes annoying is when you're doing TDD and you start with lots of broken tests. The other time is pretty much any Clojure stack trace when you're developing. In most cases, the bug is in your own code but your own code only represents a tiny p

Creating a new thread-local binding when the thread already exists.

2009-02-11 Thread CuppoJava
Hi, I just wrote a library that creates an un-initialized global variable, and requires the user to create his own thread-local binding in order to run it. eg. (def *my_environment*) ... and the user would use it like so: (binding [*my_environment* (new_environment)] (start_engine_thread)) An

Re: Random elements

2009-02-11 Thread Phil Hagelberg
Jason Wolfe writes: > OK, fine. Any objections to "shuffle" and "rand-elt", to parallel "rand-int"? I think that the bike shed should definitely be red. =) -Phil (http://en.wikipedia.org/wiki/Color_of_the_bikeshed) --~--~-~--~~~---~--~~ You received this mes

Re: Dejcartes

2009-02-11 Thread Jason Wolfe
Very cool, I like it a lot so far! Thanks, Mark. -Jason On Jan 19, 7:02 pm, Mark Fredrickson wrote: > Hello friends, > > I would like to announce a super-pre-alpha release of Dejcartes, a   > Clojure wrapper around the JFreeChart charting library. From the readme: > > Dejcartes is a Clojure in

Re: Random elements

2009-02-11 Thread Jason Wolfe
OK, fine. Any objections to "shuffle" and "rand-elt", to parallel "rand-int"? On Feb 11, 2009, at 3:42 PM, Jeffrey Straszheim wrote: > "shuffle" seems perfectly fine. We *know* you aren't modifying it > in place, after all. > > Is there any reason we can't name random-element something lik

Anonymous classloading in JDK 6u14

2009-02-11 Thread pmf
Hi, I have just read about the upcoming JDK 6u14 [1], which mentions that one of the features is support for loading anonymous classes [2]. Is this being considered for Clojure? I couldn't really extract from the article whether this is backwards-compatible or how much overhead it is to maintain

Re: is mod correct?

2009-02-11 Thread Timothy Pratley
> Patch welcome, if you've all come to a conclusion. Attached to original issue http://code.google.com/p/clojure/issues/detail?id=23 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this g

Re: Random elements

2009-02-11 Thread Jeffrey Straszheim
"shuffle" seems perfectly fine. We *know* you aren't modifying it in place, after all. Is there any reason we can't name random-element something like random-elem ? I think that is a fine compromise. On Wed, Feb 11, 2009 at 6:37 PM, Jeff Valk wrote: > > - Original Message - > From: Ph

Re: Random elements

2009-02-11 Thread Jeff Valk
- Original Message - From: Phil Hagelberg Sent: Wednesday 11 February 2009 13:16 > > Jason Wolfe writes: > > >> Would you consider changing the names of these 2 functions ? > >> > >> random-permutation -> shuffle > >> random-element -> one-of > >> > >> Shorter names are a trademark of

Re: how not to deref @ again?

2009-02-11 Thread wubbie
thanks Meikel, I'll have a look. Cheers, sun On Feb 11, 6:09 pm, Meikel Brandmeyer wrote: > Hi, > > Am 11.02.2009 um 23:59 schrieb wubbie: > > > In some post Rich recommended: > >   (let [z (ref 0)] > >   (defn add2 [] (dosync (alter z #(inc %) > > Just a sidenote: You don't need #(inc %).

Re: contrib sql - with-query-results macro

2009-02-11 Thread Stephen C. Gilardi
On Feb 8, 2009, at 5:18 PM, Mark Volkmann wrote: The second argument to the with-query-results macro needs to be a vector containing a query string and optional values to be inserted into the query if it is parameterized. Would it be difficult to change this so in the case that the query is not

Re: how not to deref @ again?

2009-02-11 Thread Meikel Brandmeyer
Hi, Am 11.02.2009 um 23:59 schrieb wubbie: In some post Rich recommended: (let [z (ref 0)] (defn add2 [] (dosync (alter z #(inc %) Just a sidenote: You don't need #(inc %). inc alone is perfectly sufficient. (let [z (ref 0)] (defn add2 [] (dosync (alter z inc Then Is

how not to deref @ again?

2009-02-11 Thread wubbie
Hi, In some post Rich recommended: (let [z (ref 0)] (defn add2 [] (dosync (alter z #(inc %) instead of (let [z (ref 0)] (defn add2 [] (dosync (refset z (inc @z) ; !!! deref @z again Then Is there any way not to deref again for this? It's from ants.clj (alter oldp assoc :phe

Re: Random elements

2009-02-11 Thread Phlex
Jason Wolfe wrote: > You're right, they should probably live in seq_utils.clj instead. > I'll post an issue to move them. > > If anyone has strong feelings about names, now would be a good time to > air them. My inclination is to leave the names as they are now; while > "shuffle" is the na

Re: JTable howto

2009-02-11 Thread Meikel Brandmeyer
Hi, Am 11.02.2009 um 23:08 schrieb what-a-guy: How would I code the following in clojure? JTable table = new JTable(new MyTableModel()) { ... //Implement table header tool tips. protected JTableHeader createDefaultTableHeader() { return new JTableHeader(columnModel) {

Re: Random elements

2009-02-11 Thread Jason Wolfe
You're right, they should probably live in seq_utils.clj instead. I'll post an issue to move them. If anyone has strong feelings about names, now would be a good time to air them. My inclination is to leave the names as they are now; while "shuffle" is the name for the Java "random-permut

Re: error running example

2009-02-11 Thread Harrison Maseko
OK. Let me try that. On Feb 11, 11:09 pm, Shawn Hoover wrote: > On Wed, Feb 11, 2009 at 3:10 PM, Harrison Maseko wrote: > > > Hi everyone, > > I just downloaded Clojure Box today and tried to run the example found > > athttp://clojure.org/jvm_hostedand I get the error below. What is > > the pro

JTable howto

2009-02-11 Thread what-a-guy
How would I code the following in clojure? JTable table = new JTable(new MyTableModel()) { ... //Implement table header tool tips. protected JTableHeader createDefaultTableHeader() { return new JTableHeader(columnModel) { public String getToolTipText(MouseEvent e)

Re: Random elements

2009-02-11 Thread bOR_
I was a bit surprised that random-permutation is in lazy-seqs.. there doesn't seem to be much lazy about it, right? It is just java's shuffle. On Feb 11, 8:16 pm, Phil Hagelberg wrote: > Jason Wolfe writes: > >> Would you consider changing the names of these 2 functions ? > > >> random-permutat

Re: is mod correct?

2009-02-11 Thread Rich Hickey
On Feb 10, 11:18 pm, Mark Engelberg wrote: > I was the source of this error, and I agree that the behavior is an > error. I missed the case of a negative divisor and a 0 remainder > among my test cases for the mod function. > > Thanks for noticing and fixing the problem. > > Although Chouser's

Re: Dejcartes

2009-02-11 Thread bOR_
Just started using it. I had some trouble understanding the whole java classpath and jar concept, but I'm now happily producing graphs. Will start using it tomorrow for some population data, and expand it as I need :). On Jan 21, 12:35 am, "Tom Ayerst" wrote: > Mark, > > Thanks for doing this, I

Re: error running example

2009-02-11 Thread Shawn Hoover
On Wed, Feb 11, 2009 at 3:10 PM, Harrison Maseko wrote: > > Hi everyone, > I just downloaded Clojure Box today and tried to run the example found > at http://clojure.org/jvm_hosted and I get the error below. What is > the problem? > Harrison > > java.lang.Exception: Unable to resolve symbol: setL

error running example

2009-02-11 Thread Harrison Maseko
Hi everyone, I just downloaded Clojure Box today and tried to run the example found at http://clojure.org/jvm_hosted and I get the error below. What is the problem? Harrison java.lang.Exception: Unable to resolve symbol: setLayout in this context (NO_SOURCE_FILE:17) [Thrown class clojure.lang.C

Re: Using ensure in dosync - IllegalStateException: No transaction running

2009-02-11 Thread Rich Hickey
On Feb 11, 10:55 am, Jeffrey Straszheim wrote: > So, ensure can make you rollback if the value is not current when you > commit. Can it make other transactions rollback if you've ensured a ref, > and commit before them? > No. That's what I meant to imply by (b). ensure has no effect on other

Re: Junit and Clojure and the new gen-class

2009-02-11 Thread BerlinBrown
On Feb 11, 12:58 pm, Stuart Halloway wrote: > Hi Berlin, > > Your testDog needs a 'this' argument: > > (defn -testDog [this] > (println "Dog called on " this)) > > I played with generating JUnit classes when I started writing the > book, and unless you have a specific need I would recommend u

Re: A Clojure documentation browser

2009-02-11 Thread rzeze...@gmail.com
Nice work! Two things related to 'strcat'. 1) This is already implemented as clojure.core/str (and is more efficient than concat'ing) 2) This function is never called :) I have some idea's related to the presentation, but I don't have time to iterate them right now. -Ryan On Feb 11, 8:29 am,

Re: Stumped - Java hangs when using Swing in Slime

2009-02-11 Thread sroll...@gmail.com
On Feb 5, 1:52 am, David wrote: > I've got the same problem assrolls24and CuppoJava on Windows XP, > using Emacs 23 > and versions of Clojure, Slime and Swank fetched today. > > Also, when starting Slime, it opens a connection to *inferior-lisp*, > but keeps polling > for Swank until I hit return

Questions about the Enlive template library

2009-02-11 Thread Tom Hickey
Hi Christophe, I am trying out Enlive and had some questions regarding it's feature set and your future plans in terms of functionality. 1) Component Templates I was wondering if you had any plans to support component templates? I.e., templates that represent just a portion of a page (via an htm

Re: Random elements

2009-02-11 Thread Phil Hagelberg
Jason Wolfe writes: >> Would you consider changing the names of these 2 functions ? >> >> random-permutation -> shuffle >> random-element -> one-of >> >> Shorter names are a trademark of clojure. >> "one-of" was taken straight from paip =) > > I'd be OK with shuffle, I guess, but I don't know if

Re: Random elements

2009-02-11 Thread Jason Wolfe
> Would you consider changing the names of these 2 functions ? > > random-permutation -> shuffle > random-element -> one-of > > Shorter names are a trademark of clojure. > "one-of" was taken straight from paip =) I'd be OK with shuffle, I guess, but I don't know if one-of is descriptive enough

Re: Junit and Clojure and the new gen-class

2009-02-11 Thread Stuart Halloway
Hi Berlin, Your testDog needs a 'this' argument: (defn -testDog [this] (println "Dog called on " this)) I played with generating JUnit classes when I started writing the book, and unless you have a specific need I would recommend using something like test-is for Clojure testing. Cheers,

Re: Junit and Clojure and the new gen-class

2009-02-11 Thread BerlinBrown
On Feb 11, 12:39 pm, BerlinBrown wrote: > On Feb 11, 12:21 pm, Stuart Sierra > wrote: > > > On Feb 11, 11:46 am, BerlinBrown wrote: > > > > (defn -init [] ()) > > > > (defn -testDog [] > > > (println "Dog")) > > > There's your problem: Java methods always need an extra first > > argument, t

Re: Junit and Clojure and the new gen-class

2009-02-11 Thread BerlinBrown
On Feb 11, 12:21 pm, Stuart Sierra wrote: > On Feb 11, 11:46 am, BerlinBrown wrote: > > > (defn -init [] ()) > > > (defn -testDog [] > > (println "Dog")) > > There's your problem: Java methods always need an extra first > argument, the object on which the method was called. It's like the >

Re: Junit and Clojure and the new gen-class

2009-02-11 Thread Stuart Sierra
On Feb 11, 11:46 am, BerlinBrown wrote: > (defn -init [] ()) > > (defn -testDog [] >   (println "Dog")) There's your problem: Java methods always need an extra first argument, the object on which the method was called. It's like the "this" keyword in Java. -Stuart Sierra --~--~-~--~---

Re: Junit and Clojure and the new gen-class

2009-02-11 Thread BerlinBrown
On Feb 11, 11:56 am, ".Bill Smith" wrote: > Is it fair to say you really want to use Junit rather than the test > framework in clojure-contrib? I can think of reasons why you might > want to use Junit but I don't want to put words in your mouth. > > Bill "I am trying to use Junit to generate

Re: A pipe macro for left-to-right coll streams

2009-02-11 Thread Perry Trolard
+1 for something like (let->). I don't imagine myself being confused by the reserved symbol being bound to different values in each successive form, or, in any case, would gladly trade that possibility for the advantage of being able to place the special symbol anywhere in the forms. Somewhat al

Re: Junit and Clojure and the new gen-class

2009-02-11 Thread .Bill Smith
Is it fair to say you really want to use Junit rather than the test framework in clojure-contrib? I can think of reasons why you might want to use Junit but I don't want to put words in your mouth. Bill --~--~-~--~~~---~--~~ You received this message because you

Junit and Clojure and the new gen-class

2009-02-11 Thread BerlinBrown
I asked this on IRC yesterday. I think Chouser had a good suggestion but I forgot what it was. I am trying to use Junit to generate tests with Clojure. May not be the best to use junit but I was going to try anyway. main.clj: (compile 'test.OctaneTestGen) (ns test.OctaneTestGen (:gen-cla

Re: Using ensure in dosync - IllegalStateException: No transaction running

2009-02-11 Thread Jeffrey Straszheim
So, ensure can make you rollback if the value is not current when you commit. Can it make other transactions rollback if you've ensured a ref, and commit before them? On Wed, Feb 11, 2009 at 7:52 AM, Rich Hickey wrote: > > > > On Feb 10, 10:26 pm, Jeffrey Straszheim > wrote: > > Since we're on

Re: How to port a mixin to clojure

2009-02-11 Thread David Nolen
There are quite a few ways to do what you're describing (and no particular prescribed way). You want to look at multimethods and tag hierarchies. http://clojure.org/multimethods Tags can have multiple parents. I'm working on a project called Spinoza (search the mailing list for that and CLJOS) w

Re: Random elements

2009-02-11 Thread Jeffrey Straszheim
I can see arguments either way. Certainly for the core library, short names are a plus. We don't want to litter our code with (get-first-element-of-seq x), but for less common routines from the libraries, the longer names may help readability a lot. On Wed, Feb 11, 2009 at 6:46 AM, Phlex wrote:

Re: Atn: Konrad Hinsen -- suggested change to letfn in contrib

2009-02-11 Thread Jeffrey Straszheim
Awesome! Thanks. On Wed, Feb 11, 2009 at 4:01 AM, Konrad Hinsen wrote: > > On 10.02.2009, at 19:18, Jeffrey Straszheim wrote: > > > I suggested the following changed to letfn: > > > > http://code.google.com/p/clojure-contrib/issues/detail?id=26 > > > > and have been informed that you manage th

Re: The wiki

2009-02-11 Thread Michael Wood
On Wed, Feb 11, 2009 at 10:46 AM, Jesse Aldridge wrote: > > I notice the front page of the wiki has had some changes awaiting > review: > http://en.wikibooks.org/wiki/Clojure_Programming > > Apparently they've been waiting for almost a month now? > > I also noticed this comment on the discussion

Re: My SLIME installation diary

2009-02-11 Thread bOR_
Spotted an error in clojure-mode.el. Swank-clojure-extra-classpaths needs to be changed from this to the following, in order for people to be able to use contrib. (setq swank-clojure-jar-path (concat clojure-src-root "/clojure/ clojure.jar") swank-clojure-extra-classpaths (list

Re: is mod correct?

2009-02-11 Thread Vincent Foley
According to the GHC documentation [1]: rem :: a -> a -> a integer remainder, satisfying (x `quot` y)*y + (x `rem` y) == x mod :: a -> a -> a integer modulus, satisfying (x `div` y)*y + (x `mod` y) == x div truncates toward negative infinity while quot (which is in Clojure) truncates toward 0.

Re: A Clojure documentation browser

2009-02-11 Thread Craig Andera
As I mentioned previously, I'm going to see if I can get time this week to set it up to go through clojure.contrib.prxml. If I don't run into any issues, that will remove the dependency on the javax stuff I'm importing. It will have the additional benefit of cutting the code in half. I'll update h

Re: A Clojure documentation browser

2009-02-11 Thread Craig Andera
> I like it a lot. I think it would be very cool if such an HTML file covering > clojure-rooted and clojure-contrib-rooted namespaces were to become an > output of building clojure-contrib. I like that idea a lot. > Please consider whether or not you'd like to send in a Contributor Agreement > t

Re: Clojure + Slick - "stylistic" questions

2009-02-11 Thread phtrivier
So a FAQ it was, and not an old one with that ;) Thanks a lot ! On 10 fév, 23:38, Timothy Pratley wrote: > Hi PH, > > >   "Returns a map of the elements of col to the evaluation of function > > (zipmap keys (map fun > keys))http://groups.google.com/group/clojure/browse_thread/thread/8fe99ca56..

Re: patch to improve startup time on low end hardware

2009-02-11 Thread Rich Hickey
On Feb 11, 4:36 am, "Remco van 't Veer" wrote: > On Tue, Feb 10, 2009 at 1:57 PM, Remco van 't Veer wrote: > > > > > On Tue, Feb 10, 2009 at 1:33 PM, Rich Hickey wrote: > >> On Feb 10, 3:47 am, "Remco van 't Veer" wrote: > >>> Hi Rich, > > >>> I've been working on getting clojure in a more u

Re: Issue request: RT.load's "don't load if already loaded" mechanism breaks ":reload-all"

2009-02-11 Thread Stephen C. Gilardi
On Feb 6, 2009, at 8:45 AM, Laurent PETIT wrote: Hello, Does it also mean that the following use case will work with *reload- all* : - x.y.z is a lib that is made of two files : x/y/z.clj, and x/y/ z1.clj , and z.clj loads z1.clj - x.y.z is compiled - z1.clj is modified - x.y.z is compile

Re: A Clojure documentation browser

2009-02-11 Thread Konrad Hinsen
On Feb 11, 2009, at 13:07, Christian Vest Hansen wrote: >> I suppose I need to add javax.xml to my classpath, but where do I get >> it from? I searched a bit and it looks like this is in the standard >> Java distribution, but in which jar file? > > It was added in Java 6. Could you perchance be r

Re: improved gview - And questions about debugging

2009-02-11 Thread Timothy Pratley
On Jan 29, 10:36 am, kyle smith wrote: > I have improved on chouser'sgviewcode (http://blog.n01se.net/? > p=30).  It can now expand java.awt.Container objects. Just for kicks I've expanded to handle Exceptions http://groups.google.com/group/clojure/web/gview.clj user=> (gview/gview *e) Of cour

Re: My SLIME installation diary

2009-02-11 Thread bOR_
> > Success! Thank you. Success lasted till I tried to restart emacs. Here is where I am stuck again: 1. It can't find M-x slime clojure-slime-config doesn't seem to be an option either to manually run with M-x clojure The solution seems to be to take the functions in clojure-slime-config and pu

Re: Using ensure in dosync - IllegalStateException: No transaction running

2009-02-11 Thread Rich Hickey
On Feb 10, 10:26 pm, Jeffrey Straszheim wrote: > Since we're on the subject, what exactly does ensure *do* that simply > reading the ref does not? And then, how does it differ from writing. > If you merely read a ref in a transaction that won't prevent another transaction from changing it. (Y

Re: Getting a result from a swing JDialog

2009-02-11 Thread Phlex
Tim Martin wrote: > Hi all, > ... > The JDialog contructor takes a parameter that will tell it to be a modal window. (ns cara.gui.dialog-test (:import [javax.swing JDialog JTextField JButton AbstractAction])) (defn- create-and-show [data-ref] (let [dialog (new JDialog (@data-ref :owner)

Re: Logical And

2009-02-11 Thread Onorio Catenacci
On Feb 10, 10:46 pm, Rayne wrote: > I literally asked this same question yesterday in #Clojure. The answer > is and > > user/ (doc and) > - > clojure.core/and > ([] [x] [x & rest]) > Macro >   Evaluates exprs one at a time, from left to right. If a form >   returns logical

Re: A Clojure documentation browser

2009-02-11 Thread Christian Vest Hansen
On Wed, Feb 11, 2009 at 11:58 AM, Konrad Hinsen wrote: > > On Feb 10, 2009, at 18:02, Craig Andera wrote: > >> One of the challenges with learning any new platform is learning the >> libraries. As a way to improve both that an my knowledge of Clojure >> itself, I whipped together doc-browse, a Cl

Re: Random elements

2009-02-11 Thread Phlex
Jason Wolfe wrote: > Not yet, but perhaps soon. Code is here: > > http://code.google.com/p/clojure-contrib/issues/detail?id=8 > > -Jason > Would you consider changing the names of these 2 functions ? random-permutation -> shuffle random-element -> one-of Shorter names are a trademark of c

Re: is mod correct?

2009-02-11 Thread David Sletten
On Feb 10, 2009, at 4:15 PM, Chouser wrote: > > > (defn mod42 > "Modulus of num and div. Truncates toward negative infinity." > [num div] > (if-not (and (integer? num) (integer? div)) >(throw (IllegalArgumentException. "mod requires two integers")) >(let [m (rem num div)] > (if (o

Re: Suggestion: test-is should print *all* frames of exceptions caught while testing

2009-02-11 Thread Chas Emerick
Thanks for the pointer Different strokes for different folks, I guess. Any time I've had a tool try to be smart with what error information is being provided, I end up discovering that an important tidbit was being elided (usually for some hours while tracking down a bug). Exceptions

Re: How to port a mixin to clojure

2009-02-11 Thread Chas Emerick
I'm not sure I would call that a mixin -- really, all that's going on is Python is allowing you to call any function, anywhere. In a language like Scala that does have what I'd consider "real" mixins (traits over there), then on_key_down would become a function available in TableWidget's

Re: A Clojure documentation browser

2009-02-11 Thread Konrad Hinsen
On Feb 10, 2009, at 18:02, Craig Andera wrote: > One of the challenges with learning any new platform is learning the > libraries. As a way to improve both that an my knowledge of Clojure > itself, I whipped together doc-browse, a Clojure library that will > spit out an HTML page that contains do

Re: sorted-set-by?

2009-02-11 Thread Timothy Pratley
Added a patch as issue 76 http://code.google.com/p/clojure/issues/detail?id=76 user=> (sorted-set-by #(> (:hat %1) (:hat %2)) {:hat 2} {:hat 3} {:hat 1}) #{{:hat 3} {:hat 2} {:hat 1}} > Yes, this is just an API gap. Issue/patch welcome. --~--~-~--~~~---~--~~ You

Re: My SLIME installation diary

2009-02-11 Thread bOR_
>> (push "/home/boris/.emacs.d" load-path) >This is actually already on the load-path by default; no need to add it. Standard load-path on ubuntu didn't include ~/.emacs.d for me. Not sure why not. load-path is a variable defined in `C source code'. Its value is ("/etc/emacs-snapshot" "/etc/emac

Re: A short guide on how to use NetBeans to create GUI and then use this GUI from clojure available

2009-02-11 Thread AlamedaMike
Tim, Thanks much. Very useful and surprisingly simple. Mike --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this gro

Re: A short guide on how to use NetBeans to create GUI and then use this GUI from clojure available

2009-02-11 Thread Timothy Pratley
On Feb 6, 10:36 pm, Emeka wrote: > You could even embed a REPL into your > application with a socket > I am interested, could you make a rough patch for me to draw some > inspiration from There is a handy server_socket.clj in clojure-contrib which makes it relatively trivial to set up: http://

Re: patch to improve startup time on low end hardware

2009-02-11 Thread Remco van 't Veer
On Tue, Feb 10, 2009 at 1:57 PM, Remco van 't Veer wrote: > On Tue, Feb 10, 2009 at 1:33 PM, Rich Hickey wrote: >> On Feb 10, 3:47 am, "Remco van 't Veer" wrote: >>> Hi Rich, >>> >>> I've been working on getting clojure in a more usable state for android >>> [1]. One of the challenges was to s

Re: Atn: Konrad Hinsen -- suggested change to letfn in contrib

2009-02-11 Thread Konrad Hinsen
On 10.02.2009, at 19:18, Jeffrey Straszheim wrote: > I suggested the following changed to letfn: > > http://code.google.com/p/clojure-contrib/issues/detail?id=26 > > and have been informed that you manage this code. Does this change > look good to you? Fine! It's applied and committed. Than

How to port a mixin to clojure

2009-02-11 Thread Jesse Aldridge
I'm trying to re-implement some python stuff in clojure. Here's how it works: I have a class called ArrowKeySelection. I use this class as a mixin with various gui classes. The class adds some abstract logic for handling keys - the arrow keys move a selector around a matrix and the enter key

The wiki

2009-02-11 Thread Jesse Aldridge
I notice the front page of the wiki has had some changes awaiting review: http://en.wikibooks.org/wiki/Clojure_Programming Apparently they've been waiting for almost a month now? I also noticed this comment on the discussion page: "The approved revision mechanism is killing this wiki. I'm avoid

Re: Calling static methods without reflection?

2009-02-11 Thread Tom Ayerst
Hi James, You can acheive the same thing with type hints: (defn abs [#^Double x] (Math/abs x)) Cheers Tom 2009/2/11 Jason Wolfe > > Never mind, silly me. Of course, the identity of the method is not > the issue, it's the type of the argument. > > user> (defn abs [x] (let [x (double x)]