Re: using libraries

2008-10-14 Thread Paul Drummond
Of course. Hmmm. And I thought I knew this stuff! :) I think I was getting all confused because I was playing with ns and it doesn't require quoting (because it's a macro). It makes sense now - thanks. Regarding the use of require, am I right in thinking that ns is for library modules and req

is clojure known to work on any phones with javame?

2008-10-14 Thread Kevin Downey
I am in the market for a phone and it would be so cool to have clojure on it. Has anyone tried this yet? -- The Mafia way is that we pursue larger goals under the guise of personal relationships. Fisheye --~--~-~--~~~---~--~~ You received this message because

Re: Making a living on Clojure

2008-10-14 Thread Josh Daghlian
I'm one of about a dozen developers on a 250 kloc Java codebase that has a DSL of sorts in it: boolean predicate trees representing targeting for ad campaigns. I write, among other things, tree- rewriting compilers that turn those trees into SQL where clauses, scheduling buckets, floating point nu

Re: Preliminary AOT support and swank-clojure startup times

2008-10-14 Thread Randall R Schulz
On Tuesday 14 October 2008 16:35, Matthew D. Swank wrote: > On Oct 14, 4:48 pm, Randall R Schulz <[EMAIL PROTECTED]> wrote: > > On Tuesday 14 October 2008 14:17, Matthew D. Swank wrote: > > > ... > > > > > > Startup time of swank-clojure rev. 1064: 6 s. > > > Startup time of swank-clojure rev. 106

Re: Preliminary AOT support and swank-clojure startup times

2008-10-14 Thread Matthew D. Swank
On Oct 14, 4:48 pm, Randall R Schulz <[EMAIL PROTECTED]> wrote: > On Tuesday 14 October 2008 14:17, Matthew D. Swank wrote: > > > Just a data-point: > > OS: Windows-XP > > CPU: Pentium-IV 2.8 Ghz > > Mem: 504 MB > > > JDK:1.6u10rc > > > Startup time of swank-clojure rev. 1064: 6 s. > > Startup t

Re: Refs and ensure

2008-10-14 Thread jim
Thanks for the response, Rich. I really wanted to eliminate the possibility that the user of my library would accidentally overlook a ref that needed to be invariant during a transaction. That solution felt hackish, which is why I asked. At this point, I'll shift the burden to the programmer to

Re: Making a living on Clojure

2008-10-14 Thread mb
Hi, On 14 Okt., 22:13, Fogus <[EMAIL PROTECTED]> wrote: > I am attempting to work Clojure (at least partially) into my job, > but in doing so I wonder how many of you here use it at your own > jobs as opposed to relegating it to hobby. I'm using Clojure at my job, but mainly to make my life easi

Re: GUIs in Clojure

2008-10-14 Thread V.Quixote
It sounds like all we really need is a single clojure thread which handles all access to Swing/AWT/Whatever. Since an additional complaint is that Swing is too imperative, it sounds like both problems could easily be solved at once. I'd personally like for the declarations to be done using Clojure

Re: Preliminary AOT support and swank-clojure startup times

2008-10-14 Thread Randall R Schulz
On Tuesday 14 October 2008 14:17, Matthew D. Swank wrote: > Just a data-point: > OS: Windows-XP > CPU: Pentium-IV 2.8 Ghz > Mem: 504 MB > > JDK:1.6u10rc > > Startup time of swank-clojure rev. 1064: 6 s. > Startup time of swank-clojure rev. 1068: 120 s! You managed to slow it down by a factor of 2

Re: using libraries

2008-10-14 Thread Stephen C. Gilardi
On Oct 14, 2008, at 5:24 PM, Paul Drummond wrote: > I want to use the zip-filter library so at the REPL I tried this: > > (require 'clojure.contrib.zip-filter :as zf) > > which failed with: > > java.lang.Exception: Unable to resolve symbol: zf in this context The zf needs a quote as well as 'clo

Re: Clojure Eclipse plugin progress (clojure-dev)

2008-10-14 Thread Casey Marshall
Well, there's also gen-class... I'm still getting to know clojure... On Oct 14, 1:35 pm, Casey Marshall <[EMAIL PROTECTED]> wrote: > Writing Eclipse plugins in Clojure is very interesting is a long term > goal.  In order to pull that off, I would need to extend/implement > Eclipse platform class

using libraries

2008-10-14 Thread Paul Drummond
Hi all, After a short break from hacking in Clojure I am back and eager to try out all the new features but I am having trouble getting familiar with the new lib/namespace feature. I want to use the zip-filter library so at the REPL I tried this: (require 'clojure.contrib.zip-filter :as zf) wh

Preliminary AOT support and swank-clojure startup times

2008-10-14 Thread Matthew D. Swank
Just a data-point: OS: Windows-XP CPU: Pentium-IV 2.8 Ghz Mem: 504 MB JDK:1.6u10rc Startup time of swank-clojure rev. 1064: 6 s. Startup time of swank-clojure rev. 1068: 120 s! When I get home, I can see if the difference is as dramatic in Linux x68_64 and OS-X PPC32. --~--~-~--~~--

Re: packaging App (cross-platform) without scripts, only jar

2008-10-14 Thread [EMAIL PROTECTED]
On Oct 14, 10:04 am, Asbjørn Bjørnstad <[EMAIL PROTECTED]> wrote: > [..snip..] > So it is not possible to put the clj files into the jar so that no > unzipping > is neccessary? I tried, but my java/jar knowledge is basically zero. > -- >  -asbjxrn it is definitely possible. To make a jar that

Re: packaging App (cross-platform) without scripts, only jar

2008-10-14 Thread R. P. Dillon
On Oct 14, 10:04 am, Asbjørn Bjørnstad <[EMAIL PROTECTED]> wrote: > On Oct 2, 10:23 pm, Pascal <[EMAIL PROTECTED]> wrote: > > > > > Hi all, > > > for Michael Beauregard, > > > > Is there a reason why setting the "Main-Class" field in the jar's manifest > > > doesn't work. > > > It work, and since

Re: Making a living on Clojure

2008-10-14 Thread Luc Prefontaine
Hi, Presently writing the logic of an application message bus product using Clojure, mainly because: a) lack of time to writer 1000xlines of Java code. b) need to reuse some existing java code & Spring stuff. c) heavy need for parallelism. d) heavy need for fast releases to improve the product, d

Re: emacs-cvs and swank-clojure under os-x 10.4

2008-10-14 Thread Stephen C. Gilardi
On Oct 14, 2008, at 3:49 PM, Matthew D. Swank wrote: > Anyone using clojure on a mac? I am. I specify which clojure slime should run using "Swank Clojure Binary" (in customize). In my shell script, I specify my classpath using a "-cp $DIRS" command line argument and also specify a place to

Making a living on Clojure

2008-10-14 Thread Fogus
I am attempting to work Clojure (at least partially) into my job, but in doing so I wonder how many of you here use it at your own jobs as opposed to relegating it to hobby. -m --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Googl

Re: emacs-cvs and swank-clojure under os-x 10.4

2008-10-14 Thread Jeffrey Chu
Hi Matt, I don't have a Mac easily available, so unfortunately I can't run tests on my own. Could you tell me what you have set in: C-h v swank-clojure-extra-classpaths And also the output of evaluating: M-: (swank-clojure-cmd) Thanks, - Jeff On Oct 14, 12:49 pm, "Matthew D. Swank" <[EMAI

emacs-cvs and swank-clojure under os-x 10.4

2008-10-14 Thread Matthew D. Swank
swank-clojure seems to work fine; it just seems that java is ignoring 'swank-clojure-extra-classpaths. in slime: user> (require 'clojure.contrib.zip-filter) java.io.FileNotFoundException: Could not locate Clojure resource on classpath: clojure/contrib/zip_filter/zip_filter.clj (NO_SOURCE_FILE: 0

Re: "Invalid this class index..." exception

2008-10-14 Thread Paul Stadig
I have. I just had to add "/home/pstadig/gen" to swank-clojure-extra-classpaths. When I start emacs (from my Application menu) it starts in my home directory. If you started emacs in a different directory, then I guess you would just have to add "[THAT DIR]/gen" to the classpath. Paul On Tue, Oc

Re: "Invalid this class index..." exception

2008-10-14 Thread Matthew D. Swank
On Oct 14, 1:09 pm, Rich Hickey <[EMAIL PROTECTED]> wrote: > On Oct 14, 1:55 pm, "Paul Stadig" <[EMAIL PROTECTED]> wrote: > > > I'm getting the following error message when trying to load a 12MB clojure > > file that is basically just a big hashmap of fundamental types (i.e. > > strings, numbers

Re: Suggest changing update-in to accept additional args for "f"

2008-10-14 Thread Alexander Kjeldaas
I'm also not completely happy with the usefulness of update-in. However I don't see how this improves things a lot. (update-in m [:a :b] + 2) can be written as: (update-in m [:a :b] (partial + 2)) or (update-in m [:a :b] #(+ 2 %)) both of which are more readable and more self-documenting IMO.

Re: Clojure Eclipse plugin progress (clojure-dev)

2008-10-14 Thread Casey Marshall
Writing Eclipse plugins in Clojure is very interesting is a long term goal. In order to pull that off, I would need to extend/implement Eclipse platform classes and interfaces in Clojure, and export these classes in an Eclipse plugin, which is an OSGi bundle. Scala rewrote their Eclipse plugin i

Re: "Invalid this class index..." exception

2008-10-14 Thread Paul Stadig
Thanks, Rich. Reading made the difference. I was confused because I was able to load smaller data structure literal files, but it would choke on the 12MB file. That's why I thought there was something about the way the larger file was being loaded. I think I avoided using read because it needed a

Re: "Invalid this class index..." exception

2008-10-14 Thread Rich Hickey
On Oct 14, 1:55 pm, "Paul Stadig" <[EMAIL PROTECTED]> wrote: > I'm getting the following error message when trying to load a 12MB clojure > file that is basically just a big hashmap of fundamental types (i.e. > strings, numbers, keywords, etc.). > > java -cp > /home/pstadig/.emacs.d/clojure/targ

"Invalid this class index..." exception

2008-10-14 Thread Paul Stadig
I'm getting the following error message when trying to load a 12MB clojure file that is basically just a big hashmap of fundamental types (i.e. strings, numbers, keywords, etc.). java -cp /home/pstadig/.emacs.d/clojure/target/clojure-lang-1.0-SNAPSHOT.jar:./gen clojure.lang.Script db.clj Exception

Asking for Permission

2008-10-14 Thread [EMAIL PROTECTED]
hello,rich, i'm from china, i found content in your Clojure web is thoughtful and attractive, i wanna translate it to chinese, it will be helpful for learning Clojure by myself, also for other chinese interested in Clojure language and generic softwares design, but i can't find license of

Re: packaging App (cross-platform) without scripts, only jar

2008-10-14 Thread Asbjørn Bjørnstad
On Oct 2, 10:23 pm, Pascal <[EMAIL PROTECTED]> wrote: > Hi all, > > for Michael Beauregard, > > > Is there a reason why setting the "Main-Class" field in the jar's manifest > > doesn't work. > > It work, and since the manifest had to be edited to set the Class-Path > why not set correctly the Ma

Re: help a journalist: why Clojure?

2008-10-14 Thread Esther Schindler
Wow -- I didn't know about that one! I'd have included it for-sure if I had. There were a few that hit the editing room floor, including a keyboard shaped waffle iron. On Oct 14, 2008, at 7:51 AM, Michel Salim wrote: > On Mon, Oct 13, 2008 at 6:13 PM, estherschindler > <[EMAIL PROTECTED]> w

Re: Casting java arguments...

2008-10-14 Thread Luc Prefontaine
The SQL library in clojure-contrib already does this just for that sole purpose: (defmacro with-connection "Evaluates body in the context of a new connection to a database then closes it. db-spec is a map containing string values for these required keys: :classname the jdbc driver cl

Re: Nested Multimethods

2008-10-14 Thread mb
Hello, On 14 Okt., 16:58, Randall R Schulz <[EMAIL PROTECTED]> wrote: > I have heard it claimed (on one of the Scala lists, I think) > that patterns themselves are an anti-pattern... I think there are always patterns. They are just different. In Clojure there is maybe the "Driver Function" patte

Re: Nested Multimethods

2008-10-14 Thread CuppoJava
That's a very elegant solution Rich. I'm so obvious when someone tells you how to do it. Clojure amazes me more every day. All the painfully accumulated knowledge of Java design patterns are so trivial in Clojure. It doesn't even seem like there's any need for design "patterns" at all anymore cau

Re: Clojure Eclipse plugin progress (clojure-dev)

2008-10-14 Thread JumpingJupiter
> I humbly present my first steps toward an Clojure Eclipse plugin > (http://code.google.com/p/clojure-dev/). It seems your writing your plug-in in java. I don't know anything about Eclipse plug-ins; it should be possible (maybe not desirable) to write the plug-in in clojure right? what are your

Re: Nested Multimethods

2008-10-14 Thread Randall R Schulz
On Tuesday 14 October 2008 07:48, CuppoJava wrote: > That's a very elegant solution Rich. I'm so obvious when someone > tells you how to do it. > > Clojure amazes me more every day. All the painfully accumulated > knowledge of Java design patterns are so trivial in Clojure. It > doesn't even seem

Re: help a journalist: why Clojure?

2008-10-14 Thread Michel Salim
On Mon, Oct 13, 2008 at 6:13 PM, estherschindler <[EMAIL PROTECTED]> wrote: > 7 Cool, Weird and Useful Computer Keyboards > Not every computer keyboard or input device is a boring hunk of > plastic. We look at several ergonomic, wireless, high-tech and just > plain fun keyboards to brighten your da

Re: Clojure Eclipse plugin progress (clojure-dev)

2008-10-14 Thread Casey Marshall
Thanks Markus, I agree, awareness of sexps will be very important. Sounds like I have some research to do with clojure-mode. Casey On Oct 14, 8:27 am, mac <[EMAIL PROTECTED]> wrote: > I use eclipse daily at work so I'm pretty used to it, would be very > nice with a clojure plugin. > Are you tak

Re: Clojure Eclipse plugin progress (clojure-dev)

2008-10-14 Thread mac
I use eclipse daily at work so I'm pretty used to it, would be very nice with a clojure plugin. Are you taking feature requests? If you are, here is mine: I like a good IDE as much as anyone but so far I have been using emacs with Jeffrey Chu's clojure-mode (http://clojure.codestuffs.com/). Comin

Re: Clojure Eclipse plugin progress (clojure-dev)

2008-10-14 Thread Stefan Liebig
Great, this sounds really nice. I will have a look at it. I created a clojure library bundle from the clojure.jar and a second bundle that depends on the first. The seconds bundle activator calls two clojure functions for start and stop of the bundle passing the BundleContext to the clojure funct

Re: Nested Multimethods

2008-10-14 Thread Rich Hickey
On Mon, Oct 13, 2008 at 11:14 PM, Stuart Halloway <[EMAIL PROTECTED]> wrote: > > Hi Patrick, > > How about: > > (defmulti length (fn [x] > (if (= :stateMachine (:class x)) >(:state x) >(:class x > > (defmethod length :yardstick [x] 36)

Re: Nested Multimethods

2008-10-14 Thread Rich Hickey
On Oct 13, 11:01 pm, CuppoJava <[EMAIL PROTECTED]> wrote: > Is there anyway to do the following with the existing multi-method > facilities? > > There is a general multi-method length(object) that splits off to > different methods depending on the :class of the object. > > And then specifically

Re: Refs and ensure

2008-10-14 Thread Rich Hickey
On Oct 13, 9:51 pm, jim <[EMAIL PROTECTED]> wrote: > Rich, > > I've been working with refs tonight and I appreciate the validate-fn > addition. Makes my life a lot easier. > > From reading the docs, 'ensure' keeps a ref from changing inside a > dosync. But if accesses to refs are contained in fu

Clojure Eclipse plugin progress (clojure-dev)

2008-10-14 Thread Casey Marshall
Hi, I humbly present my first steps toward an Clojure Eclipse plugin (http://code.google.com/p/clojure-dev/). So far, here's where its at: * Clojure nature, project type and builder (which doesn't do much yet). * Added a Clojure REPL to the console. You can open it with the "New Console" button