Re: LZW compression

2009-03-30 Thread Adrian Cuthbertson
There's apache commons; http://commons.apache.org/compress/ and Java also has a built-in zip/gzip library - see java.util.zip in the Java docs. Adrian. On Mon, Mar 30, 2009 at 10:19 PM, Sean wrote: > > Hi, > Does anyone know of a good compression library in java or clojure?  A > quick google di

Shell script

2009-03-30 Thread youngblood.carl
Hey Ya'll, If you're ever wondering where something is defined, I put together this shell script tonight. Just save it, chmod it to be executable, and run ./foo.sh text-to-search-for #!/bin/sh find . -name "*.jar" | xargs -tn1 -I "%" sh -c 'jar tf "%" | grep .clj | xargs -tn1 unzip -p "%" | grep

Re: Possible Solution for Left-Right Precedence and More when using Multimethods? (was re: oo)

2009-03-30 Thread mikel
On Mar 28, 6:30 pm, David Nolen wrote: > Having thought a little about multiple inheritance when implementing Spinoza > I also ran into this problem. However at the time I wasn't hindered by > multifn dispatch as much as the fact that parents cannot be ordered (because > calling parents on a ta

Re: Clojure + Terracotta Update

2009-03-30 Thread Rich Hickey
On Mar 30, 5:12 pm, Paul Stadig wrote: > I have gotten to the point in my Clojure + Terracotta experiment, where I > believe all of the features of Clojure are functional (Refs, Atoms, > transactions, etc.). I do not have a way to extensively test the Clojure > functionality, but I have run the

Re: Please suggest a way to learn just enough Java for Clojure

2009-03-30 Thread Timothy Pratley
There are a couple listed in: http://en.wikibooks.org/wiki/Clojure_Programming/Further_Reading#Java However seeing your goal is 'just enough Java' I would recommend not reading anything. There are tonnes of examples on the web such that you can always get a good hit if you google what-I-want-to-

Re: Please suggest a way to learn just enough Java for Clojure

2009-03-30 Thread Dan Beauchesne
I'm curious about this as well. In terms of writing simple UI gadgets, it's overwhelming to refer to the Java docs when I don't have any background in Java. There's a few examples floating around out there, but if I try and reference them to write in clojure using different components it doesn'

Re: Please suggest a way to learn just enough Java for Clojure

2009-03-30 Thread revoltingdevelopment
> > Core Java Volumes I & II, by Horstman and Cornell. > +1 I'm using those books to learn Java right now. They are suitable as a tutorial and as a reference, and they include useful extracts from Java doc. I'm making my way through from the start, but also using them as a reference while conve

Clojure + Terracotta Update

2009-03-30 Thread Paul Stadig
I have gotten to the point in my Clojure + Terracotta experiment, where I believe all of the features of Clojure are functional (Refs, Atoms, transactions, etc.). I do not have a way to extensively test the Clojure functionality, but I have run the clojure.contrib.test-clojure test suites successfu

Re: Please suggest a way to learn just enough Java for Clojure

2009-03-30 Thread Sean
There is a pair of java books I cut my teeth on, an I would recommend them to anyone. Core Java Volumes I & II, by Horstman and Cornell. Amazing reference, two of the best technical books I've ever read. Cover usage, gives code examples, and a tremendous amount of history & theory (for their aud

Re: Please suggest a way to learn just enough Java for Clojure

2009-03-30 Thread David Nolen
There's a few posts on the mailing list suggesting some good starting points. You can get far in Clojure without resorting to Java but it definitely helps to know some if you really want to advance your knowledge of Clojure's inner workings as well as get it to interoperate with Java libraries. O

Re: Set bug?

2009-03-30 Thread Rich Hickey
On Mar 30, 2:54 pm, Mark Engelberg wrote: > On Mon, Mar 30, 2009 at 10:45 AM, Mark Engelberg > > wrote: > > I don't know whether this fix would be worth the performance penalty, > > though, but it's what would "feel right" to me. > > If it's not practical to always reduce integers when used as

Re: Set bug?

2009-03-30 Thread Rich Hickey
On Mar 30, 1:45 pm, Mark Engelberg wrote: > My own opinions: > I don't expect 1 to equal 1.0 (because I think of inexact numbers as > fundamentally different from exact numbers). I think of 1.0 as a > "number that's so close to 1 that we can't tell the difference, but it > still might not be 1

Please suggest a way to learn just enough Java for Clojure

2009-03-30 Thread Santanu
Hi Everybody, (Sorry if this post appears twice, but the first post seems to have vanished) I have recently downloaded Clojure and am learning it. As of now, I feel that to do anything substantial with Clojure, I have to be able to know how to access the Java libraries from within Clojure. But

Please suggest a way to learn just enough Java for Clojure

2009-03-30 Thread Santanu
Hi Everybody, I have recently downloaded Clojure and am learning it. As of now, I feel that to do anything substantial with Clojure, I have to be able to know how to access the Java libraries from within Clojure. But the problem is, I don't know Java. I know C, some Scheme, little bit Haskell,

Re: slightly off-topic: JDK 7 performance boost

2009-03-30 Thread liebke
That's great news for me, I'm doing lots of matrix manipulation/decomp (using the Colt library), but I wonder how long until jdk 7 is available on the mac. On Mar 30, 1:13 pm, Stuart Sierra wrote: > Thought some might be > interested:http://lingpipe-blog.com/2009/03/30/jdk-7-twice-as-fast-as-jd

LZW compression

2009-03-30 Thread Sean
Hi, Does anyone know of a good compression library in java or clojure? A quick google didn't reveal much useful. I need an LZW filter for an app I'm working on. Sean --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Setting up Clojure on OS X

2009-03-30 Thread Meikel Brandmeyer
Hi, Am 30.03.2009 um 21:24 schrieb Greg Harman: Aquamacs is probably your editor of choice on OSX; then follow standard emacs/slime instructions as per the other links... Or MacVim with VimClojure setup... Sincerely Meikel smime.p7s Description: S/MIME cryptographic signature

Re: Clojure Users Group - Denmark

2009-03-30 Thread Krukow
On Mar 30, 3:40 pm, Christian Vest Hansen wrote: > Great. Now we are at least 3 danes who know Clojure - I have a feeling > that there is at least one other guy out there :) We have to start somewhere ;-) Perhaps I'll arrange a 'geek night' at my company to talk about the language - that might

Re: Setting up Clojure on OS X

2009-03-30 Thread Greg Harman
Aquamacs is probably your editor of choice on OSX; then follow standard emacs/slime instructions as per the other links... On Mar 30, 8:59 am, Sean wrote: > Mark, > This is a great writeup on installing clojure.  As an OSX nerd, my > main problem is getting an editor up and running.  Maybe you c

Re: Set bug?

2009-03-30 Thread Mark Engelberg
On Mon, Mar 30, 2009 at 10:45 AM, Mark Engelberg wrote: > I don't know whether this fix would be worth the performance penalty, > though, but it's what would "feel right" to me. > If it's not practical to always reduce integers when used as keys, then I think it would be useful for a variation o

Gen-class, extending a parameterized type

2009-03-30 Thread Greg Harman
I need to extend an abstract Java class with a generic type, ala: public abstract class Foo {} I tried the syntax (gen-class :name fooImpl :extends com.x.Foo) and get java.lang.ClassNotFoundException: com.x.Foo Without the I'd get: a RuntimeException complaining that I'm extending the raw typ

Re: Set bug?

2009-03-30 Thread Mark Engelberg
My own opinions: I don't expect 1 to equal 1.0 (because I think of inexact numbers as fundamentally different from exact numbers). I think of 1.0 as a "number that's so close to 1 that we can't tell the difference, but it still might not be 1". I do expect 1 to equal 1/1, and I expect a long 1 to

slightly off-topic: JDK 7 performance boost

2009-03-30 Thread Stuart Sierra
Thought some might be interested: http://lingpipe-blog.com/2009/03/30/jdk-7-twice-as-fast-as-jdk-6-for-arrays-and-arithmetic/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, sen

Re: inconsistency with ref & get

2009-03-30 Thread Allen Rohner
> I disagree. When you understand what's happening (Refs implement IFn > by dispatching, just like Vars), you see that it has nothing to do > with obtaining the value of a ref without deref, and get can't work > since it doesn't take a ref. > Thanks for the explanation. Since get can't work beca

Re: Clojure, Android and Emacs on Ubuntu tutorials

2009-03-30 Thread triddell
Android on Eclipse is fairly well documented. I didn't find much information on using emacs (which I've learned since getting into clojure) with Android so I thought this might be helpful. Ubuntu is the only main OS I use at the moment and I don't have time to document others. The same concepts

Re: Clojure, Android and Emacs on Ubuntu tutorials

2009-03-30 Thread Emeka
What about expanding to other boxes? I would like to learn Android, but I don't use Emacs/Ubuntu. Emeka --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@go

Clojure, Android and Emacs on Ubuntu tutorials

2009-03-30 Thread triddell
For those interested, I've documented the process of beginning clojure- based Android projects using emacs. Android with Emacs on Ubuntu : http://riddell.us/tutorial/android/android.html Clojure and Android with Emacs on Ubuntu : http://riddell.us/tutorial/clojure_android/clojure_android.html T

Re: new in contrib.test-is: fixtures

2009-03-30 Thread Stuart Sierra
On Mar 29, 3:05 pm, "John D. Hume" wrote: > This is a cool functional way of defining these, but I think I'd > prefer to just call the fixture function from the tests needing common > setup because of the standard problems with shared setup in unit > tests. (In brief, the test doesn't stand on it

Re: Setting up Clojure on OS X

2009-03-30 Thread Telman Yusupov
I have similar series posts, hopefully they might be useful to you: http://yusupov.com/blog/2009/basic-clojure-setup-part-1/ - Basic environment/Java setup somewhat tailored towards OS X http://yusupov.com/blog/2009/basic-clojure-setup-part-2/ - Setting up Emacs/Slime http://yusupov.com/blog/2

Re: file io

2009-03-30 Thread Stuart Sierra
On Mar 26, 1:34 pm, Victor Rodriguez wrote: > (defmacro with-out-as >   [f & body] >   `(with-open [w# (writer ~f)] >      (binding [*out* w#] >       �...@body))) I've added something very similar to this to clojure.contrib.duck- streams. -Stuart Sierra --~--~-~--~~~---

Re: Set bug?

2009-03-30 Thread Konrad Hinsen
On Mar 30, 2009, at 14:51, Rich Hickey wrote: > Well, the community simply has to get together on what they want here, > variously: > > - Clojure sets and maps should implement java.util.Set and Map Not something I care much about, though I understand those who do. > - Clojure Numbers are the s

Re: Clojure Users Group - Denmark

2009-03-30 Thread Christian Vest Hansen
On Mon, Mar 30, 2009 at 3:13 PM, Krukow wrote: > > Hello everyone, > > I am thinking about setting up a Danish Clojure Users' Group (dcug) > based in Aarhus, but with the goal to be country-wide, possibly with > city local groups (e.g., dcugAarhus, dcugCopenhagen). I am setting up > a website wit

Clojure Users Group - Denmark

2009-03-30 Thread Krukow
Hello everyone, I am thinking about setting up a Danish Clojure Users' Group (dcug) based in Aarhus, but with the goal to be country-wide, possibly with city local groups (e.g., dcugAarhus, dcugCopenhagen). I am setting up a website with an associated blog for news/updates: http://www.clojure.dk

Re: Setting up Clojure on OS X

2009-03-30 Thread Sean
Mark, This is a great writeup on installing clojure. As an OSX nerd, my main problem is getting an editor up and running. Maybe you could add a section on setting up an editor? I know the wiki was a good place to start. On Mar 30, 7:02 am, Mark Reid wrote: > Hi, > > I've just written a blog p

Re: inconsistency with ref & get

2009-03-30 Thread Rich Hickey
On Sun, Mar 29, 2009 at 11:33 PM, Allen Rohner wrote: > > I noticed an inconsistency with refs and get: > > (def ref-map (ref {:a 1, :b 2})) > > (ref-map :a) > => 1 > > (get ref-map :a) > => nil > > Now I haven't seen any documentation that getting the value of a ref > without a @/deref is suppor

Re: Set bug?

2009-03-30 Thread Rich Hickey
On Mon, Mar 30, 2009 at 8:21 AM, Konrad Hinsen wrote: > > On Mar 30, 2009, at 12:36, Mark Engelberg wrote: > >> I'm aware that a and 123 have different types, but I was under the >> impression that the hash set implementation was supposed to just rely >> on hash codes and equality. Why does the

Re: Does anyone have a simple example of making a JPopupMenu in Clojure?

2009-03-30 Thread Rayne
Used code for implementing the menu bar and the context menu in my notepad-like text editor so I would say that an AbstractListener would probably be overkill in this particular case. While not as consice as it would be with an AbstractListener I feel it's easier to read in my program. Thanks a lo

Re: Set bug?

2009-03-30 Thread Konrad Hinsen
On Mar 30, 2009, at 12:36, Mark Engelberg wrote: > I'm aware that a and 123 have different types, but I was under the > impression that the hash set implementation was supposed to just rely > on hash codes and equality. Why does the type come into play, and is > this really the desired behavior?

Re: Status of Eclipse plug-in and OSGi compatibility

2009-03-30 Thread Laurent PETIT
Hi, As one of the core developers of an Eclipse plug-in for clojure (clojuredev : http://code.google.com/p/clojure-dev/ ), I will try answering your questions, in the less possible biaised way ;-) : 2009/3/30 Frank Gerhardt > > Hi *, > > I just came back from EclipseCON 2009. There was a short

Re: Does anyone have a simple example of making a JPopupMenu in Clojure?

2009-03-30 Thread Timothy Pratley
Hi Rayne, As I see it there are three reasons why using AbstractAction is nice: [a] they can be (re)used for buttons/toolbars/menus (including icon and tooltip). [b] they can be disabled/enabled in one place. [c] global key bindings http://groups.google.com/group/clojure/web/global-hotkey.clj T

Setting up Clojure on OS X

2009-03-30 Thread Mark Reid
Hi, I've just written a blog post describing how I set up Clojure on my Mac: http://mark.reid.name/sap/setting-up-clojure.html My main aims were to make it easy to configure the classpath for various projects while still having a single Clojure command I can run from anywhere to open a inte

Re: Book erratum (was: Clojure + Java compilation and IntelliJ IDEA plugin)

2009-03-30 Thread Ilya Sergey
Hello, Stuart. I've checked examples from book by that address. All of them work fine for me. Moreover, suddenly it turned out, that compilation using IntelliJ IDEA works fine as well.So, sorry for disturbance and thanks for your help. With best regards, Ilya 2009/3/26 Stuart Halloway > > Ilya

Set bug?

2009-03-30 Thread Mark Engelberg
(def a (BigInteger. "123")) (= a 123); this prints true (= (hash a) (hash 123)) ; this also prints true So how come (count #{a 123}) prints 2 ? I'm aware that a and 123 have different types, but I was under the impression that the hash set implementation was supposed to just rely on hash co

Re: Suggest patch to math.clj - integer-length

2009-03-30 Thread Konrad Hinsen
On Mar 30, 2009, at 11:57, Mark Engelberg wrote: > This brings up an interesting question. Does Java guarantee that on > all architectures and all future versions that Integers will be 32-bit > and Longs will be 64-bit? > > I think the answer is yes, that this is part of the specification, but >

Re: Suggest patch to math.clj - integer-length

2009-03-30 Thread Mark Engelberg
This brings up an interesting question. Does Java guarantee that on all architectures and all future versions that Integers will be 32-bit and Longs will be 64-bit? I think the answer is yes, that this is part of the specification, but I'm not certain. --~--~-~--~~~-

Re: Quick slime/emacs questions

2009-03-30 Thread Mark Engelberg
I have CUA mode enabled, and it does most of those remappings, but not the C-s for save. I know searching is common, which is why I plan to remap C-f to search. Don't need existing binding for C-f since the arrow keys work just fine for moving around. I don't mind the normal Emacs bindings, exc

Re: oo

2009-03-30 Thread Konrad Hinsen
On Mar 30, 2009, at 0:16, mikel wrote: > Sure, that's right. Maybe constructing such a value in the first place > is an error. I'd say so. If it were up to me to provide a fix for the situation you describe, I'd fix proxy to make it impossible to create an object that doesn't implement the i

Re: Clojure and swank on Android?

2009-03-30 Thread Remco van 't Veer
Dalvik (the VM android uses) only runs AOT compiled Clojure code. Swank needs to be able to compile Clojure code at runtime. This is not (yet) possible on Dalvik because it uses incompatible bytecode; compiled classes need to be translated to DEX files before being deployed on android. I doubt r

Re: Does anyone have a simple example of making a JPopupMenu in Clojure?

2009-03-30 Thread Rayne
Thank you so much! :D You're a life savor. Might I ask a question though. Is there a specific reason for using AbstractListener in place of ActionListener besides making things much more concise? I tend to use ActionListener and make menu items more explicit. It's just a personal preference but i

Re: Does anyone have a simple example of making a JPopupMenu in Clojure?

2009-03-30 Thread Timothy Pratley
I made you one: http://groups.google.com/group/clojure/web/popupmenu.clj On Mar 30, 1:01 pm, Rayne wrote: > I'm one of the ones who /didn't/ come from Java to Clojure. I can only > get myself so far looking at Java examples. I need to make a context > menu that will pop up when I right click in