On Nov 6, 7:05 pm, CuppoJava <[EMAIL PROTECTED]> wrote:
> I'm doing some heavy numerical matrix crunching and would like to
> write it in as elegant a way as possible without sacrificing any
> speed.
Can you define "matrix crunching" more precisely?
mfh
--~--~-~--~~~-
On Nov 6, 11:58 am, Konrad Hinsen <[EMAIL PROTECTED]> wrote:
> On 05.11.2008, at 17:16, Mark H. wrote:
> For the immediate future, yes. But with changing computer
> architectures, the existing algorithms and routines may lose much of
> their interest in the future.
Haha, yes, we're working on
Thanks everyone.
I've read all the replies, and I might understand something.
(Though it seems that discussion goes to beyond my current
understanding in the middle of this discussion threads)
To explore further, I become another owner of 'Programming
Clojure' :-)
For my second question, I'll ke
I was wondering what's the recommended approach to performance code in
Clojure.
I'm doing some heavy numerical matrix crunching and would like to
write it in as elegant a way as possible without sacrificing any
speed.
Is native arrays, and unchecked-arithmetic operations the way to go?
Thanks f
Carlos,
I went down a similar road once before, using a Ruby DSL to generate
the XML for Spring DI. This approach may offer the quickest initial
return, but it hits a ceiling very quickly. You end up having two APIs
with a totally unnecessary XML layer in between. Worse, the XML layer
spe
Stephen,
You are absolutely right, and I hope to have all your syntax
suggestions implemented tomorrow.
By way of background: When I started, it seemed there were three
obvious avenues to pursue:
(1) write a Clojure DSL that generates the Ant XML
(2) write a Clojure DSL that sticks close to
> So you'd need a runtime instanceof test for Class, and use the
> fastpath if true, reflection if not.
>
> Perf could be harder to pin down, as adding an import could cause
> previously fast code to get slow.
Actually, I was thinking of performing the inference based on *all*
classes on the clas
On Nov 6, 4:31 pm, Daniel Spiewak <[EMAIL PROTECTED]> wrote:
> I've been perusing Stu Halloway's beta of "Programming Clojure" and I
> came across the following example:
>
> (defn describe-class [c]
> {:name (.getName c)
>:final (java.lang.reflect.Modifier/isFinal (.getModifiers c))})
>
>
I've been perusing Stu Halloway's beta of "Programming Clojure" and I
came across the following example:
(defn describe-class [c]
{:name (.getName c)
:final (java.lang.reflect.Modifier/isFinal (.getModifiers c))})
As demonstrated by the *warn-on-reflection* flag, Clojure is unable to
determ
On Thu, Nov 06, 2008 at 01:48:43PM -0500, Stuart Halloway wrote:
>
> Hi all,
>
> I am playing around with using Clojure to control Ant, something along
> the lines of Groovy's Gant. I don't know how far I will take this--
> right now it is serving as a code example for the book.
>
> Two ques
On Nov 6, 7:48 pm, Stuart Halloway <[EMAIL PROTECTED]> wrote:
> I am playing around with using Clojure to control Ant, something along
> the lines of Groovy's Gant. []
I know next to nothing about ant, and what kind of control will lancet
provide, but the proposed syntax reminds me of what
After I posted this, I realized that it was a little silly to talk
about a Lisp editor mode without auto-indentation. It has been
added! The main caveat is it doesn't seem to handle multiple
unindents with the correctness I would like. For example:
(defn say-hi [n]
(println
(str "Hello,
On Nov 6, 1:20 pm, "Brian Doyle" <[EMAIL PROTECTED]> wrote:
> Does anyone know of any Clojure maven integration?
> What I'd like to see is something that will modify Clojure's
> classpath updated based upon a given pom.xml file.
> Thanks.
There's this:
http://www.bitbucket.org/achimpassen/cloj
On 05.11.2008, at 17:16, Mark H. wrote:
> and replace copies with destructive writes. I haven't seen a purely
> functional formulation of LU factorization but it could be done
> without too much trouble. Of course there's no reason to go through
> that effort because people spend so much time o
On Thu, Nov 6, 2008 at 11:48 AM, Stuart Halloway
<[EMAIL PROTECTED]>wrote:
>
> Hi all,
>
> I am playing around with using Clojure to control Ant, something along
> the lines of Groovy's Gant. I don't know how far I will take this--
> right now it is serving as a code example for the book.
>
> Two
Update:
I used gen-and-save-class to see what it is complaining about. It is
failing due to the following fields:
public static final clojure.lang.Var printStackTrace-void__var;
public static final clojure.lang.Var printStackTrace-PrintWriter__var;
public static final clojure.lang.Va
Does anyone know of any Clojure maven integration?
What I'd like to see is something that will modify Clojure's
classpath updated based upon a given pom.xml file.
Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Hi all,
I am playing around with using Clojure to control Ant, something along
the lines of Groovy's Gant. I don't know how far I will take this--
right now it is serving as a code example for the book.
Two questions:
(1) Anybody interested in seeing lancet carried forward into a real
proj
Hi,
I am getting the following error trying to extend java.lang.Exception
in the latest revision of Clojure:
user=>(defmacro defexception [name]
`(try
(gen-and-load-class (quote ~name) :extends Exception)
(catch java.lang.LinkageError le#
(. le# (printStackTrace)
user=> (
Daniel wrote
> Mostly for amusement, I created a jEdit mode for Clojure a while
> back. I don't get a chance to play with Clojure all that much, so it
> hasn't been heavily tested ("go-to" *is* a Clojure "keyword",
> right?). ;-) It's primarily based upon the Vim mode in terms of what
> keywor
>
> Now *I'm* confused. It's your code that's printing "#=(sorted-map ..."
> for me, without any call to "prefer-method" required.
>
> --Chouser
Well, you're not the only one confused. I thought the "#=(sorted-
map ..." came from boot.clj somehow, but I now realize my local REPL
pulled in user.c
I can reproduce what you did in a fresh local REPL (SVN 1075), but my
server (also at SVN 1075) doesn't do this. I'm trying to find out how
this can be. Any idea where I can find the code that generates the
"#=(sorted-map ..." printing? I've looked but can't find it in
boot.clj.
Thanks for your h
On Thu, Nov 6, 2008 at 10:01 AM, MikeM <[EMAIL PROTECTED]> wrote:
>
> I can reproduce what you did in a fresh local REPL (SVN 1075), but my
> server (also at SVN 1075) doesn't do this. I'm trying to find out how
> this can be. Any idea where I can find the code that generates the
> "#=(sorted-map
I really appreciate your answer... and exciting 'Clojure', Rich. :)
--~--~-~--~~~---~--~~
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 t
Thanks hoeck and mb for your detailed explanation! Now I can
understand your points. :) It's so exciting to read 'Programming
Clojure', and I'm really happy that 'a lisp book' is printed from 'The
Pragmatic Programmers', which is my favorite book publisher.
--~--~-~--~~~---
On Nov 6, 7:50 am, mb <[EMAIL PROTECTED]> wrote:
> Hi,
>
> On 6 Nov., 13:30, Chanwoo Yoo <[EMAIL PROTECTED]> wrote:
>
> > > Is {:a 1} not a hash-map? It seems that there is some inconsistency...
>
> Clojure holds promises about the interface and the performance
> characteristics of the provided
On Thu, Nov 6, 2008 at 7:53 AM, MikeM <[EMAIL PROTECTED]> wrote:
>
> But when I try to prefer this:
>
> (prefer-method print-method clojure.lang.PersistentTreeMap
> clojure.lang.IPersistentMap)
You don't need this, because PersistentTreeMap is already a more
specific type than IPersistentMap --
On Thu, Nov 6, 2008 at 7:05 AM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> I was checking IFn.java first but couldn't see the Comparator
> interface being listed there which made me writing my initial post.
This is a more convenient and reliable way to check inheritance:
(ancestors (class
On Nov 6, 2008, at 7:05 AM, [EMAIL PROTECTED] wrote:
>
> On Nov 6, 12:43 pm, Rich Hickey <[EMAIL PROTECTED]> wrote:
>> On Nov 6, 5:23 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
>> wrote:
>>
>>> To answer my own question - AFn.java implements
>>> java.util.Comparator.
>>
>> That is documented
I would like to print sorted maps readably (otherwise my sorted maps
when printed and read back get turned into the default map), so I
tried this:
(defmethod print-method clojure.lang.PersistentTreeMap [o,
#^java.io.Writer w]
(let [eprint (fn eprint [e sep?] (do (print-method (key e) w)
Hi,
On 6 Nov., 13:30, Chanwoo Yoo <[EMAIL PROTECTED]> wrote:
> > Is {:a 1} not a hash-map? It seems that there is some inconsistency...
Clojure holds promises about the interface and the performance
characteristics of the provided functions. In general Clojure is
a lot about abstract interfaces.
On Nov 6, 8:27 am, "Michael Wood" <[EMAIL PROTECTED]> wrote:
> On Thu, Nov 6, 2008 at 8:25 AM, Chanwoo Yoo <[EMAIL PROTECTED]> wrote:
>
> > Hi all. In Stuart's book - Programming Clojure, there is a multi
> > method like following:
>
> > (defmulti blank? class)
> > (defmethod blank? String [s] (
Aha, I'm sorry for my laziness and spamming. {:a 1} is not a hash-map.
I guess there is some reason of performance about this... Anyway, as
mac pointed out, dispatching based on types will be inappropriate to
clojure data structures. Thank you mac for the thread link~
user> (class {:a 1})
#=cloju
Thanks~ "clojure.lang.PersistentHashMap" works~ :) But I feel
something is strange.. See next code, especially arrowed line.
user> clojure.lang.PersistentHashMap
#=clojure.lang.PersistentHashMap
user> (= (class {:a 1 :b 2}) clojure.lang.PersistentHashMap)
true
user> (= (class {}) clojure.lang.Per
On Nov 6, 12:43 pm, Rich Hickey <[EMAIL PROTECTED]> wrote:
> On Nov 6, 5:23 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>
> > To answer my own question - AFn.java implements java.util.Comparator.
>
> That is documented here:
>
> http://clojure.org/special_forms
"IFns implement the Java C
On Nov 5, 5:53 pm, Matthias Benkard <[EMAIL PROTECTED]> wrote:
> On Nov 5, 3:33 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > Are you sure? You're not modifying the clojure source, so you're not
> > creating a derivative work. I would think you can create a GPL
> > licensed library in that case.
On Nov 6, 5:23 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> To answer my own question - AFn.java implements java.util.Comparator.
>
That is documented here:
http://clojure.org/special_forms
Rich
--~--~-~--~~~---~--~~
You received this message because yo
To answer my own question - AFn.java implements java.util.Comparator.
On Nov 6, 10:18 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> The doc of "sort" states that you need to implement
> java.util.Comparator in order to use custom sorting. Why then does
> this not cause any error?
>
> user=
The doc of "sort" states that you need to implement
java.util.Comparator in order to use custom sorting. Why then does
this not cause any error?
user=> (defn my-comp [x y] (cond (< x y) 1 (= x y) 0 :else -1))
#=(var user/my-comp)
user=> (sort [5 3 1 2])
(1 2 3 5)
user=> (sort my-comp [5 3 1 2])
(
On Nov 6, 9:19 am, Chouser <[EMAIL PROTECTED]> wrote:
> On Wed, Nov 5, 2008 at 12:10 AM, Chouser <[EMAIL PROTECTED]> wrote:
> > The attached patch allows:
>
> > user=> (point 42 11)
> > {:x 42, :y 11}
>
Seems like a very nice enhancement to me. It would make
the code more terse.
Parth
> The
40 matches
Mail list logo