Re: Annotations

2010-04-23 Thread Mark Derricutt
Looks nice from just looking at the gists - I have a small project where annotations support would actually come in handy as well so will definitely give this a try shortly. mark -- Pull me down under... On Sat, Apr 24, 2010 at 12:06 PM, Rich Hickey wrote: > It supports annotations for definte

Re: wget replacement code review

2010-04-23 Thread JonathanMeeks
It's not answering your idiomatic clojure question, but extract-url- filename will have problems because of this: user> (.getFile (URL. "http://www.foo.com/";)) "/" On Apr 21, 1:08 pm, Brent Millare wrote: > Technically I didn't write my own cause I just copied pasted it ;) > > For the purpose

Adding an option to clojure.main

2010-04-23 Thread Phil Hagelberg
So it seems like recently the only thing I use AOT for is producing -main functions that can be easily run from the command-line. I've found that an alternate to this is to use clojure.main -e, require the necessary namespace, and then call (apply -main *command-line-args*), but this is rather awkw

Re: Datatypes and Protocols update

2010-04-23 Thread Michał Marczyk
On 24 April 2010 05:48, Mark Engelberg wrote: > Ideally, I'd like to see a way to allow me to write a program using > (:name employee), and later, if I need to, customize the employee > datatype so that (:name employee) actually dispatches to some other > function.  Ditto with (assoc employee :nam

Re: Datatypes and Protocols update

2010-04-23 Thread Mark Engelberg
A few meandering observations: I like the latest change to include a this argument. It makes the number of arguments line up which is a good thing. I like the idea of defrecord for the common case, rather than having to request default implementations of various interfaces within deftype. Still

Re: ClojureCLR start-up time

2010-04-23 Thread dmiller
I haven't compiled under a release in a while. Recent changes to the build system may have messed it up. I'll check it out. David On Apr 23, 2:11 am, Joerthan Panest wrote: > Hello, > > I am considering ClojureCLR for embedding in an application, but it appears > as though it takes ~4secs to

Re: Annotations

2010-04-23 Thread Richard Newman
I've started adding some support for Java annotations, as of this commit: Fantastic! I'm just about to do some JAX-WS stuff (which requires annotations), so this is a welcome change. The syntax looks no worse than Java's, so no comment on that... -- You received this message because you are

Re: Annotations

2010-04-23 Thread Laurent PETIT
2010/4/24 Rich Hickey : > I've started adding some support for Java annotations, as of this > commit: > > http://github.com/richhickey/clojure/commit/fa899d22dceb531d9f5af833ac6af0d956e6bdc7 > > Example of use: > > http://gist.github.com/377213 > > It supports annotations for definterface/type/reco

Re: Cannot find juxt in clojure 1.1 (??)

2010-04-23 Thread Laurent PETIT
Hi, yes, you may use a project created with a (very) old version of ccw, thus initialized with a pre-release of 1.1. To upgrade, use the Project > Properties > Java Build Path > Libs for your project. Or else, in the contextual menu of the project, click the "enable/disable clojure support". Thi

Annotations

2010-04-23 Thread Rich Hickey
I've started adding some support for Java annotations, as of this commit: http://github.com/richhickey/clojure/commit/fa899d22dceb531d9f5af833ac6af0d956e6bdc7 Example of use: http://gist.github.com/377213 It supports annotations for definterface/type/record types (put in metadata on type name),

Re: Slides for short (45 minutes) presentation of clojure for java devs

2010-04-23 Thread Laurent PETIT
Thanks for the "food for thought". I'm concerned with the short introduction not being too much "goal oriented" (and more "tutorial oriented"), I'll continue think about it in "background mode". Cheers, -- Laurent 2010/4/23 cburroughs : > What I did when I needed to give a shorter talk was to b

Re: Try + finally question

2010-04-23 Thread ataggart
I wrote this, which seems to solve the problem being discussed: http://gist.github.com/377278 Thoughts? On Apr 23, 8:10 am, Armando Blancas wrote: > > Is there any easy workaround which doesn't involve defing a global > > conn. > > To do all in a single place you'll have to mimic the Java idi

Sponge: A Clojure App with a Swing Interface

2010-04-23 Thread Neill Alexander
Just in case anybody is interested I have written a tool to aid developing against a web-service. It sits between the Soap client and the Soap service and acts as a router (a bit like SoapTrace). You can use it to record Soap sessions then replay them. See http://github.com/NeillAlexander/spon

Re: emacs setup

2010-04-23 Thread Phil Hagelberg
On Fri, Apr 23, 2010 at 12:36 PM, catonano wrote: > I need some help in order to set up a decent setting as in the subject. > > I mean, there's elpa, leningen, apt-get, what am I supposed to do ? The Getting Started page on the wiki covers this pretty well: http://www.assembla.com/wiki/show/clo

emacs setup

2010-04-23 Thread catonano
Hello, I need some help in order to set up a decent setting as in the subject. I mean, there's elpa, leningen, apt-get, what am I supposed to do ? Thanks for any hint Cato -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

Re: Datatypes and Protocols update

2010-04-23 Thread Konrad Hinsen
On 23.04.2010, at 19:20, Rich Hickey wrote: > You can get that back easily by implementing ILookup/IKeywordLookup, as does > defrecord. I still have ideas about macro-like mixins for use in deftype, but > I concluded the mandatory use of such mixins to create record-like things was > too much u

Re: Datatypes and Protocols update

2010-04-23 Thread Konrad Hinsen
On 23.04.2010, at 17:49, ataggart wrote: > One problem with requiring the "other" object to be of the same type > is that it would break the current model, e.g.: > > user=> (= '(1 2 3) [1 2 3]) > true I'd want this only for defrecord, which is a more limited (but also more convenient) way to de

Re: Datatypes and Protocols update

2010-04-23 Thread Krukow
On Apr 22, 6:53 pm, Rich Hickey wrote: [snip..] > Feedback and errata welcome as always, > 1) Typo on http://clojure.org/protocols: Section "Basics" defprotocol will automatically generate a corresponding interface, with the same name as the protocol, i.e. given a protocol my.ns/ Protocol, an in

Re: Datatypes and Protocols update

2010-04-23 Thread Rich Hickey
On Apr 22, 2010, at 1:30 PM, Mark Engelberg wrote: I tried using deftype relatively recently, but realized it wouldn't work for my needs because serialization via *print-dup* wasn't yet implemented. I'd recommend including this with the 1.2 release (or is there a new recommended way to seriali

Re: Datatypes and Protocols update

2010-04-23 Thread Rich Hickey
On Apr 23, 2010, at 3:12 AM, Konrad Hinsen wrote: On 22 Apr 2010, at 21:15, Konrad Hinsen wrote: I have several former deftypes that are a perfect fit for the new defrecord, except that they need a specific comparison function. This is usually for excluding some fields from equality testin

Re: Datatypes and Protocols update

2010-04-23 Thread Rich Hickey
On Apr 22, 2010, at 3:15 PM, Konrad Hinsen wrote: On 22.04.2010, at 18:53, Rich Hickey wrote: Feedback and errata welcome as always, One feature in the deftype/defrecord split that I regret is that defrecord no longer allows the redefinition of equals and hashCode. Any attempt to overri

Re: problem installing clojure/Enclojure with Netbeans

2010-04-23 Thread Sophie
I had trouble with Enclojure 1.1.1 What worked for me: uninstall it and follow the Netbeans section at http://github.com/relevance/labrepl -- 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 N

Re: Datatypes and Protocols update

2010-04-23 Thread ataggart
One problem with requiring the "other" object to be of the same type is that it would break the current model, e.g.: user=> (= '(1 2 3) [1 2 3]) true I'm left to wonder if it the more correct implementation of the desired behavior is not to override the equals, but rather to implement Comparable.

Re: Try + finally question

2010-04-23 Thread Armando Blancas
> Is there any easy workaround which doesn't involve defing a global > conn. To do all in a single place you'll have to mimic the Java idiom. (let [conn (atom nil)] (try (reset! conn (API/getConnection ...) ... (catch ...) (finally (if @conn (API/closeConnection @conn) As it's

Re: Newbie: Finding performance bottlenecks

2010-04-23 Thread David Nolen
In your code you have: (defstruct body :id :type ; :projectile or :unit -> projectiles do not collide with other bodies; :current-position ; ref :current-cells ; ref :current-rotation ;atom :pixel-half-width :pixel-half-height :half-width :half-height :components) ; a map of (:co

Re: Slides for short (45 minutes) presentation of clojure for java devs

2010-04-23 Thread cburroughs
What I did when I needed to give a shorter talk was to base it on some of the well known presentations and just cut out a lot. I don't think Stuart's intro or Rich's "for Java people" talk assumes people are already enthusiastic about functional programming. [1] http://github.com/stuarthalloway/cl

Re: Cannot find juxt in clojure 1.1 (??)

2010-04-23 Thread Jarkko Oranen
>  *clojure-version* > {:interim true, :major 1, :minor 1, :incremental 0, :qualifier > "alpha"} > Looks like you have some old version of 1.1 prior to release. The release version of 1.1 shouldn't have the alpha qualifier. Try upgrading. -- You received this message because you are subscribe

Cannot find juxt in clojure 1.1 (??)

2010-04-23 Thread Base
Hi ALl I am using CounterClockwise for Eclipse and for some reason I keep getting the error: Unable to resolve var: juxt in this context (repl-1:34) This happens when I fire up the repl in the user NS or when I do: (ns testit (:require clojure.core)) What am I missing here? It has to be som

Re: Try + finally question

2010-04-23 Thread ka
Hi all, I've written my first macro: with-open-flexi! (defmacro with-open-flexi! " Just like with-open except it takes closing expression instead of assuming it to be .close Macro definition : (with-open-flexi! [] body) expands to - (do body) (with-open-flexi! [obj1 init

problem installing clojure/Enclojure with Netbeans

2010-04-23 Thread numa
I am completely new to Clojure. I decided to use Netbeans with Enclojure, but can't get it to work. I'm using Netbeans 6.8 on a Mac (Leopard). The Netbeans Plugin window Installed tab says that it is active (under User Installed Plugins it says Source: enclojure- plugin-2010-23-mar.nbm, Enclojure

ClojureCLR start-up time

2010-04-23 Thread Joerthan Panest
Hello, I am considering ClojureCLR for embedding in an application, but it appears as though it takes ~4secs to start up. Is this typical? Is there a way to speed up? I realize that this could be hidden by opening it in a background process and leaving it open but I can see where that is less than

CLR - Error following a tutorial and setting up project depending on ClojureCLR

2010-04-23 Thread Joerthan Panest
Hello, I have successfully built ClojureCLR and run the main REPL successfully. Now, I would like to set up a project that uses ClojureCLR. So, I followed the short tutorial at: http://www.genericerror.com/blog/2010/01/22/SimpleClojureCLRExample.aspx At the first call of RT.LoadScript(...) I am g

Re: Reading from file

2010-04-23 Thread Alan Dipert
On Thu, 2010-04-22 at 22:29 +0700, Per Vognsen wrote: > How about this? > > (use 'clojure.contrib.str-utils 'clojure.contrib.duck-streams) > > (defn parse [file] > (let [r (reader file)] > (map (fn [line] (map #(Integer/parseInt %) (.split line " "))) > (take (Integer/parseInt (

Re: CLR - Error following a tutorial and setting up project depending on ClojureCLR

2010-04-23 Thread Joerthan Panest
Simple fix, the new project was targeting .NET 4.0 Client. Switching to 3.5 solved the issues. On Thu, Apr 22, 2010 at 10:37 PM, Joerthan Panest wrote: > Hello, I have successfully built ClojureCLR and run the main REPL > successfully. > > Now, I would like to set up a project that uses ClojureC

Newbie: Finding performance bottlenecks

2010-04-23 Thread msappler
Hi this is my first clojure application: http://pastebin.com/Vv7xr6Uj (Code Criticism welcome!) I am porting my hack'and'slay game from java to clojure. It is using slick2d and rendering and moving bodies (rectangles) on a 2d collision map. - I created a computationally intensive situation with

Re: Datatypes and Protocols update

2010-04-23 Thread Konrad Hinsen
On 22 Apr 2010, at 21:15, Konrad Hinsen wrote: I have several former deftypes that are a perfect fit for the new defrecord, except that they need a specific comparison function. This is usually for excluding some fields from equality testing, or for requiring identity rather than equality f