Re: slicing multidimensional vectors (vectors of vectors of vectors ...)

2010-01-10 Thread Konrad Hinsen

On 09.01.2010, at 21:22, Rock wrote:


I'm working on implementing a solution for extracting slices of
multidimensional vectors, in the sense of vectors of vectors. I'm
taking the recursive route.


I have some code for working with nested vectors here:


http://code.google.com/p/clj-multiarray/source/browse/src/clj_multiarray/nested_vectors.clj

It's work in progress, but it may give you some ideas.


Anyway, I'm trying to follow the MATLAB path. For instance, suppose
this is a 5x5 matrix:

(def a [[2 3 5 7 11] [13 17 19 23 29] [31 37 41 43 47] [53 59  61
67   71]  [73   79   83   89   97]])

This:

(submvec a [[0 2 4] [0 2 4]])

would yield:

[[2 5 11] [13 19 29] [31 41 47] [53 61 71] [73 83 97]] (actually a
sequence)

In other words, [0 2 4] is to be interpreted as [START STRIDE END].
STRIDE should be optional.


That's my "sample" function:

(defn nv-sample
  [x dim start end step]
  (assert (vector? x))
  (if (zero? dim)
(vec (take-nth step (subvec x start end)))
(vec (map #(nv-sample % (dec dim) start end step) x

Just call it once for each dimension (0 and 1).

Konrad.

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: How do I extend an existing function to take different number of params?

2010-01-10 Thread Amit Rathore
Here's some (simpler?) code that will work for adding arity to
existing functions - http://gist.github.com/273401

It doesn't handle adding variable-arity (ie multiple arity using &) to
existing functions, but can add specific arity to existing varibale-
arity functions
It also doesn't handle adding more than one arity at a time, but you
can call it multiple times with different arity to get the same
effect. See example below -

An example to add arity -

user> (extend-fn keyword [ns name suffix]
(keyword ns (str name "-" suffix)))

user> (extend-fn keyword [ns prefix name suffix]
(keyword ns (str prefix "-" name "-" suffix)))

Here's the example usage -

user> (keyword nil "hello")
:hello

user> (keyword nil "hello" "more")
:hello-more

user> (keyword nil "oh" "hello" "more")
:oh-hello-more

Again, like Tom said, dunno why you'd need to do this...

On Jan 9, 10:45 pm, Tom Faulhaber  wrote:
> Actually this is possible. (seehttp://xkcd.com/386/)
>
> See the macro add-arity which I've put up here:http://gist.github.com/273349
>
> This allows you to do things like:
>
> user> (add-arity keyword [ns name suffix] (keyword ns (str name "-"
> suffix)))
> #
>
> user> (keyword nil "hello" "more")
> :hello-more
>
> The code I put up will handle (I think) all sorts of variations of arg
> counts: you can use add-arity just like defn and it will grab any
> specified arglists (including arglists with &) and proxy the others
> back to the original function. It doesn't do anything with metadata,
> though. Also, you can override a given arity on the original function,
> but you can't then call the original version at that arity.
>
> Whether this is a good idea or not is a completely different
> question :-)
>
> Tom
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: slicing multidimensional vectors (vectors of vectors of vectors ...)

2010-01-10 Thread Rock
Great Konrad! Thank you. My code is similar to yours. I think I will
put what you've just shown me to good use. There are a few good points
I hadn't thought about. I'm so happy that  you are working on this as
well. I think Clojure has immense potential for scientific and
mathematical computing, but this aspect has been somewhat neglected
until now for some reason. Let's hope for a big change in this respect
as soon as possible.

Rock

On Jan 10, 10:01 am, Konrad Hinsen  wrote:
> On 09.01.2010, at 21:22, Rock wrote:
>
> > I'm working on implementing a solution for extracting slices of
> > multidimensional vectors, in the sense of vectors of vectors. I'm
> > taking the recursive route.
>
> I have some code for working with nested vectors here:
>
>        
> http://code.google.com/p/clj-multiarray/source/browse/src/clj_multiar...
>
> It's work in progress, but it may give you some ideas.
>
>
>
>
>
> > Anyway, I'm trying to follow the MATLAB path. For instance, suppose
> > this is a 5x5 matrix:
>
> > (def a [[2 3 5 7 11] [13 17 19 23 29] [31 37 41 43 47] [53 59  61
> > 67   71]  [73   79   83   89   97]])
>
> > This:
>
> > (submvec a [[0 2 4] [0 2 4]])
>
> > would yield:
>
> > [[2 5 11] [13 19 29] [31 41 47] [53 61 71] [73 83 97]] (actually a
> > sequence)
>
> > In other words, [0 2 4] is to be interpreted as [START STRIDE END].
> > STRIDE should be optional.
>
> That's my "sample" function:
>
> (defn nv-sample
>    [x dim start end step]
>    (assert (vector? x))
>    (if (zero? dim)
>      (vec (take-nth step (subvec x start end)))
>      (vec (map #(nv-sample % (dec dim) start end step) x
>
> Just call it once for each dimension (0 and 1).
>
> Konrad.
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: slicing multidimensional vectors (vectors of vectors of vectors ...)

2010-01-10 Thread Konrad Hinsen

On 10.01.2010, at 10:35, Rock wrote:


I hadn't thought about. I'm so happy that  you are working on this as
well. I think Clojure has immense potential for scientific and
mathematical computing, but this aspect has been somewhat neglected
until now for some reason. Let's hope for a big change in this respect
as soon as possible.


I agree! I believe that a good array library is essential for  
scientific applications, so that's what I started to work on. There  
are already a couple of array libraries in the Java world, but they  
all "suffer" from being designed for Java rather than for a dynamical  
language such as Clojure.


My project clj-multiarray is in fact quite ambitious: I want to design  
an array library not only for Clojure, but for other dynamic libraries  
on the JVM as well. I am thinking in particular of Jython, which still  
lacks an equivalent of the NumPy library for C-Python. My goal thus is  
to have both a nice Clojure interface and a Java-level interface on  
which other JVM languages can build. And I also want to facilitate  
interfacing with the existing Java array libraries, in particular for  
using I/O libraries (netCDF) and matrix-related code (linear algebra  
etc.) that already exists in the Java world.


All this to explain why this is a slowly progressing project and still  
likely to undergo important changes. It's definitely not ready for use  
yet, but I welcome comments on its design.


Konrad.
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: slicing multidimensional vectors (vectors of vectors of vectors ...)

2010-01-10 Thread Rock
An ambitious project indeed!

As for the Java libraries, have you had a look at JScience? From what
I've seen, it's not at all bad. However, I do believe that, as far as
Clojure is concerned, it should have its own scientific libraries and
infrastructure. So I'm really glad that you've started this project. I
hope I will be able to contribute and help in any possible way.

Thanks again.

On Jan 10, 12:15 pm, Konrad Hinsen  wrote:
> On 10.01.2010, at 10:35, Rock wrote:
>
> > I hadn't thought about. I'm so happy that  you are working on this as
> > well. I think Clojure has immense potential for scientific and
> > mathematical computing, but this aspect has been somewhat neglected
> > until now for some reason. Let's hope for a big change in this respect
> > as soon as possible.
>
> I agree! I believe that a good array library is essential for  
> scientific applications, so that's what I started to work on. There  
> are already a couple of array libraries in the Java world, but they  
> all "suffer" from being designed for Java rather than for a dynamical  
> language such as Clojure.
>
> My project clj-multiarray is in fact quite ambitious: I want to design  
> an array library not only for Clojure, but for other dynamic libraries  
> on the JVM as well. I am thinking in particular of Jython, which still  
> lacks an equivalent of the NumPy library for C-Python. My goal thus is  
> to have both a nice Clojure interface and a Java-level interface on  
> which other JVM languages can build. And I also want to facilitate  
> interfacing with the existing Java array libraries, in particular for  
> using I/O libraries (netCDF) and matrix-related code (linear algebra  
> etc.) that already exists in the Java world.
>
> All this to explain why this is a slowly progressing project and still  
> likely to undergo important changes. It's definitely not ready for use  
> yet, but I welcome comments on its design.
>
> Konrad.
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: C interop lib (JNA wrapper)

2010-01-10 Thread xster


On Jan 8, 8:08 am, mac  wrote:
> Hello all.
> I've started work on a clojure library for interoperating with C. It's
> always been a pain to do in Java but recentlyJNA(java native access)
> has taken away most of that pain.


This is great. I think it'll be very valuable to call out to a bunch
of useful C library functions. Can this approach also provide a bridge
to Objective-C?

I'm very interested in using Cocoa to design GUIs for the Mac.  I'd
really like to be able to have all the business logic encapsulated in
clojure though. Would this approach be able to glue together Cocoa NIB
files and Objective-C code to clojure?
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

newbie swank clojure emacs

2010-01-10 Thread brian


Hi,

I'm trying to follow the directions at:

http://riddell.us/tutorial/slime_swank/slime_swank.html

I'm doing this under cygwin.

I think I did everything correctly, but it seems not to find the 
clojure.jar file although I have it and the clojure-contrib.jar in my 
home directory as configured in the my .emacs file. I am using emacs 23.

I also have the clojure jar's  in my classpath.

this is my .emacs :

;; clojure-mode
(add-to-list 'load-path "~/.emacs.d/elpa/clojure-mode-1.6")
(require 'clojure-mode)

;; swank-clojure
(add-to-list 'load-path "~/opt/swank-clojure/src/emacs")
(add-to-list 'load-path "~/.emacs.d/elpa/swank-clojure-1.1.0")

(setq swank-clojure-jar-path "~/clojure.jar"
 swank-clojure-extra-classpaths (list
 "~/opt/swank-clojure/src/main/clojure"
 "~/clojure-contrib.jar"))

(require 'swank-clojure-autoload)

;; slime
(eval-after-load "slime"
 '(progn (slime-setup '(slime-repl

(add-to-list 'load-path "~/opt/slime")
(require 'slime)
(slime-setup)





this is the error when I call slime





(require 'swank.swank)

(swank.swank/ignore-protocol-version "2010-01-06")

(do (.. java.net.InetAddress getLocalHost getHostAddress) 
nil)(swank.swank/start-server 
"/cygdrive/c/DOCUME~1/brian/LOCALS~1/Temp/slime.2848" :encoding 
"iso-latin-1-unix")


java.lang.NoClassDefFoundError: clojure/main
Caused by: java.lang.ClassNotFoundException: clojure.main
   at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: clojure.main.  Program will exit.
Exception in thread "main"
Process inferior-lisp exited abnormally with code 1

Thanks
Brian


-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: newbie swank clojure emacs

2010-01-10 Thread Eric Lavigne
Since you are using Windows, you may find Clojure Box easier to install.

http://clojure.bighugh.com/

I followed the riddell.us/.../slime_swank.html tutorial yesterday, and
can confirm that it works well for Ubuntu.


On Sun, Jan 10, 2010 at 5:58 AM, brian  wrote:
>
> Hi,
>
> I'm trying to follow the directions at:
>
> http://riddell.us/tutorial/slime_swank/slime_swank.html
>
> I'm doing this under cygwin.
>
> I think I did everything correctly, but it seems not to find the clojure.jar
> file although I have it and the clojure-contrib.jar in my home directory as
> configured in the my .emacs file. I am using emacs 23.
> I also have the clojure jar's  in my classpath.
>
> this is my .emacs :
>
> ;; clojure-mode
> (add-to-list 'load-path "~/.emacs.d/elpa/clojure-mode-1.6")
> (require 'clojure-mode)
>
> ;; swank-clojure
> (add-to-list 'load-path "~/opt/swank-clojure/src/emacs")
> (add-to-list 'load-path "~/.emacs.d/elpa/swank-clojure-1.1.0")
>
> (setq swank-clojure-jar-path "~/clojure.jar"
>     swank-clojure-extra-classpaths (list
>                     "~/opt/swank-clojure/src/main/clojure"
>                     "~/clojure-contrib.jar"))
>
> (require 'swank-clojure-autoload)
>
> ;; slime
> (eval-after-load "slime"
>  '(progn (slime-setup '(slime-repl
>
> (add-to-list 'load-path "~/opt/slime")
> (require 'slime)
> (slime-setup)
>
>
>
>
>
> this is the error when I call slime
>
>
>
>
>
> (require 'swank.swank)
>
> (swank.swank/ignore-protocol-version "2010-01-06")
>
> (do (.. java.net.InetAddress getLocalHost getHostAddress)
> nil)(swank.swank/start-server
> "/cygdrive/c/DOCUME~1/brian/LOCALS~1/Temp/slime.2848" :encoding
> "iso-latin-1-unix")
>
> java.lang.NoClassDefFoundError: clojure/main
> Caused by: java.lang.ClassNotFoundException: clojure.main
>   at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>   at java.security.AccessController.doPrivileged(Native Method)
>   at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>   at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>   at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
> Could not find the main class: clojure.main.  Program will exit.
> Exception in thread "main"
> Process inferior-lisp exited abnormally with code 1
>
> Thanks
> Brian
>
>
>
> --
> 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
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: newbie swank clojure emacs

2010-01-10 Thread Rob Wolfe
brian  writes:

> Hi,
>
> I'm trying to follow the directions at:
>
> http://riddell.us/tutorial/slime_swank/slime_swank.html
>
> I'm doing this under cygwin.
>
> I think I did everything correctly, but it seems not to find the
> clojure.jar file although I have it and the clojure-contrib.jar in my
> home directory as configured in the my .emacs file. I am using emacs
> 23.
> I also have the clojure jar's  in my classpath.
>
> this is my .emacs :
>
> ;; clojure-mode
> (add-to-list 'load-path "~/.emacs.d/elpa/clojure-mode-1.6")
> (require 'clojure-mode)
>
> ;; swank-clojure
> (add-to-list 'load-path "~/opt/swank-clojure/src/emacs")
> (add-to-list 'load-path "~/.emacs.d/elpa/swank-clojure-1.1.0")
>
> (setq swank-clojure-jar-path "~/clojure.jar"
>  swank-clojure-extra-classpaths (list
>  "~/opt/swank-clojure/src/main/clojure"
>  "~/clojure-contrib.jar"))
>
> (require 'swank-clojure-autoload)
>
> ;; slime
> (eval-after-load "slime"
>  '(progn (slime-setup '(slime-repl
>
> (add-to-list 'load-path "~/opt/slime")
> (require 'slime)
> (slime-setup)
>
>
>
>
>
> this is the error when I call slime
>
>
>
>
>
> (require 'swank.swank)
>
> (swank.swank/ignore-protocol-version "2010-01-06")
>
> (do (.. java.net.InetAddress getLocalHost getHostAddress)
> nil)(swank.swank/start-server
> "/cygdrive/c/DOCUME~1/brian/LOCALS~1/Temp/slime.2848" :encoding
> "iso-latin-1-unix")
>
> java.lang.NoClassDefFoundError: clojure/main
> Caused by: java.lang.ClassNotFoundException: clojure.main
>at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>at java.security.AccessController.doPrivileged(Native Method)
>at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
> Could not find the main class: clojure.main.  Program will exit.
> Exception in thread "main"
> Process inferior-lisp exited abnormally with code 1
>
> Thanks
> Brian

I'm not sure, but the problem might be in resolving "~".
IIRC for cygwin it means "/cygdrive/c/DOCUME~1/user",
but for swank-clojure it means "c:/DOCUME~1/user".
Try to use the absolute path for clojure.jar.

HTH,
Rob

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Refs, UUID and DB persistence

2010-01-10 Thread Dragan Djuric
I've just found in another discussion thar Rich mentioned that "As
mentioned by Phil, the refs are still correct. The UUID is some
unfinished work on ref persistence (of the db kind). Don't look
behind
the curtain :) "
Can somebody who is involved tell a bit more:
1. Is there a work in progress to provide a transparent DB persistence
of refs
2. Is there any resource (messages, short drafts, docs) where I can
find more about that?
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: newbie swank clojure emacs

2010-01-10 Thread Phil Hagelberg
brian  writes:

> I'm trying to follow the directions at:
>
> http://riddell.us/tutorial/slime_swank/slime_swank.html

The directions on that site are rather out of date. Try following the
ones from the swank-clojure readme; they should cover you. I will
contact the author of the tutorial to ask him to update it.

-Phil
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Ref history

2010-01-10 Thread Dragan Djuric
I am aware that there are functions for seeing history count, min
count etc.
Why is the actual history hidden?
For example, if there is a ref:
(def a (ref 1))
(dosync (alter a 2))
(dosync (alter a 3))
(ref-history-ocunt a)
=>2
a
=>3

Why this is not allowed?:
(ref-history a)
=> (2 1)

If I am right, Ref implementation stores that information in tvals
field which is package protected, and no methods are provided for
accessing it. Of course, I could implement a subclass of Ref or access
it reflectively in java and then write history function, but why it is
not in the clojure core?
Is this on purpose (and what is the reason), or it's just that nobody
thought that would be useful?

Of course, I am talking about the read-only access to the history.
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Trouble with running in jline editor. (newbie question)

2010-01-10 Thread piscesboy
I placed clojure.jar, jline.jar and jline-0.9.94.jar all in the same
directory. I started the default clojure editor using:

java -cp clojure.jar clojure.main, and recieved the standard

user=>

prompt. However, when using:

java -cp jline-0.9.94.jar:clojure.jar jline.ConsoleRunner clojure.main

I get:

Exception in thread "main" java.lang.ClassNotFoundException:
clojure.main
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:244)
at java.lang.ClassLoader.loadClass(ClassLoader.java:315)
at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at jline.ConsoleRunner.main(ConsoleRunner.java:69)

Am I using the wrong syntax?


-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Has anyone got the Enclojure NetBeans plugin working with clojure 1.1?

2010-01-10 Thread nwalex
Since I couldn't get Enclojure working I decided to man up and dive
into the world of Emacs. After a bit of a struggle I got a working
development environment set up, incorporating Emacs, NetBeans, and
Maven. See 
http://www.maybetechnology.com/2010/01/configuring-my-development-environment.html
for more info.

On Jan 9, 8:13 pm, nwalex  wrote:
> I've tried to add a new platform, but the repl fails to start. Then I
> tried to build the latest version of Enclojure using clojure 1.1, but
> couldn't get that working either. Has anyone else been able to get it
> working with clojure 1.1?
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Ref history

2010-01-10 Thread ataggart


On Jan 10, 9:21 am, Dragan Djuric  wrote:
> I am aware that there are functions for seeing history count, min
> count etc.
> Why is the actual history hidden?
> For example, if there is a ref:
> (def a (ref 1))
> (dosync (alter a 2))
> (dosync (alter a 3))
> (ref-history-ocunt a)
> =>2
> a
> =>3
>

Yeah, we'd just need to call:

(set! *enable-memory-leaks* true)

;)
> Why this is not allowed?:
> (ref-history a)
> => (2 1)
>
> If I am right, Ref implementation stores that information in tvals
> field which is package protected, and no methods are provided for
> accessing it. Of course, I could implement a subclass of Ref or access
> it reflectively in java and then write history function, but why it is
> not in the clojure core?
> Is this on purpose (and what is the reason), or it's just that nobody
> thought that would be useful?
>
> Of course, I am talking about the read-only access to the history.
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Ref history

2010-01-10 Thread Krukow


On Jan 10, 6:21 pm, Dragan Djuric  wrote:
> Is this on purpose (and what is the reason), or it's just that nobody
> thought that would be useful?
>
> Of course, I am talking about the read-only access to the history.
[snip...]

To minimize memory consumption, refs only keep history if it is needed
by "pending" transactions, although you can force keeping history
with :min-history, see (doc ref).

If you want to store some history you can do it manually by attaching
a watcher:

user> (def a (ref 1))
#'user/a
user> (def a-hist (atom []))
#'user/a-hist
user> (add-watch a :a-watch (fn [key aref old nw] (swap! a-hist conj
old)))
#
user> (dosync (alter a inc))
2
user> (dosync (alter a inc))
3
user> @a-hist
[1 2]
user> @a
3
user>

/Karl
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: slicing multidimensional vectors (vectors of vectors of vectors ...)

2010-01-10 Thread Konrad Hinsen

On 10.01.2010, at 13:55, Rock wrote:


As for the Java libraries, have you had a look at JScience? From what
I've seen, it's not at all bad.


It's an interesting library, but it lives clearly in the Java universe  
of strict typing. Moreover, it doesn't really have arrays, just  
vectors and matrices. Those are very well thought out and implemented,  
but it's still a more limited approach than providing general N- 
dimensional arrays.


A problem with all Java libraries is their orientation towards static  
typing. In Clojure (like in Python), it is natural to have nested data  
structures, and in particular nested vectors (in Python nested lists)  
as a conceptual representation of multidimensional arrays. This  
implies that array indexing operations can return either another array  
or an element, meaning that the return type must be Object. This can  
be done in Java but it is not a natural approach. Therefore the Java  
libraries typically have separate operations for accessing elements  
and for extracting subarrays, which makes many algorithms  
unnecessarily cumbersome.


Konrad.

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: parallel vs serial iteration in a "for" loop

2010-01-10 Thread Sean Devlin
Conrad,
What's your use case that requires for and not map?  I haven't seen
something like this yet, and you've got my curious.

Sean

On Jan 8, 4:41 pm, Conrad  wrote:
> Thanks again Sean/Chouser- Sounds like there isn't any easy way to do
> in-step iteration using the "for" construct, as I suspected- This is
> of course easily remedied for writing a convenience function for "(map
> vec ...)"
>
> (As I mentioned in the top post, I am aware the simple example I gave
> can be written more elegantly without the "for" construct.)
>
> On Jan 8, 2:07 pm, Sean Devlin  wrote:
>
>
>
> > Oh, right.  I saw "paralell" and the brain hit autopilot.
>
> > And I think you CAN improve on your fn a little bit.  This should do
> > the trick
>
> > (map + (range 1 5) (range 11 15))
>
> > The mapping fn itself will be applied to as many arguments as you have
> > collections.  Since + is variadic, it will do the job nicely.
>
> > Sean
>
> > On Jan 8, 11:56 am, Chouser  wrote:
>
> > > On Fri, Jan 8, 2010 at 11:34 AM, Sean Devlin  
> > > wrote:
> > > > Take a look at pmap
>
> > > I don't think that's the kind of "parallel" being asked about.
>
> > > > On Jan 8, 11:13 am, Conrad  wrote:
> > > >> Looping variables in a clojure "for" loop are iterated in a serial,
> > > >> cartesian fashion:
>
> > > >> > (for [a (range 5) b (range 10 15)]
>
> > > >>        (+ a b))
> > > >> (10 11 12 13 14 11 12 13 14 15 12 13 14 15 16 13 14 15 16 17 14 15 16
> > > >> 17 18)
>
> > > >> I was wondering if there's a standard idiom for looping in parallel
> > > >> fashion- Doesn't look like it's supported by the "for" macro directly.
> > > >> The best code I can come up with to do this is:
>
> > > >> > (for [[a b] (map vector (range 5) (range 10 15))]
>
> > > >>        (+ a b))
> > > >> (10 12 14 16 18)
>
> > > >> Is there a more elegant way to do this?
>
> > > Probably not. 'map' is the primary way to walk multiple seqs in
> > > step.  'zipmap' does this too, though only for building
> > > a hash-map.  Of course you can always use recur as well.
>
> > > --Chouser
> > > --
> > > -- I funded Clojure 2010, did you?
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: C interop lib (JNA wrapper)

2010-01-10 Thread mac
> This is great. I think it'll be very valuable to call out to a bunch
> of useful C library functions.

Thank you

> Can this approach also provide a bridge
> to Objective-C?
>
> I'm very interested in using Cocoa to design GUIs for the Mac.  I'd
> really like to be able to have all the business logic encapsulated in
> clojure though. Would this approach be able to glue together Cocoa NIB
> files and Objective-C code to clojure?

I'm not very familiar with what compiled Objective-C code looks like.
But I do know of this project:
https://rococoa.dev.java.net/
And it seems to be using JNA as it's backend so I guess it's possible.
It's probably a matter of decoding Obj-C's name mangling scheme.
It would probably be easier to just wrap rococoa though.
I haven't planned on supporting more languages than C but maybe if I
manage to make my code generic enough (it's currently very messy)
parts of it could be used for other language wrappers via JNA.
But I want to finish at least version 1.0 of clj-native before I even
think of something like that ;)

By the way, clj-native now has support for callbacks so that C code
can call into clojure!
I made a little example here:
http://github.com/bagucode/clj-native/tree/master/src/examples/

I didn't upload the binary for the C lib since that's very platform
specific.
If you are on a mac just do something like
gcc -c c_lib.c
ld -dylib -o libc_lib.dylib c_lib.o
and don't forget to System/setProperty java.library.path or
jna.library.path to include the dir where libc_lib.dylib is.
(for some reason the system properties must be set before the very
first attempt to load a native lib, they will not be re-read if you
change them and try again)



-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: clj-peg v0.6 released

2010-01-10 Thread Richard Lyman
On Fri, Jan 8, 2010 at 11:07 AM, Paul Mooser  wrote:

> At some point, hopefully someone will write an open-source parsing
> library with liberal licensing terms for clojure.
>

Would you mind elaborating on your definitions for the terms "open-source"
and "liberal licensing"?

I'm not sure I like the current licensing scheme for clj-peg and I've spent
quite a bit of time thinking about how I should approach this project's
license in particular. I have two very different perspectives about this
issue.

On the one hand, if I were a user and not the developer I doubt I'd use this
library because I really don't like paying for software. I also would be a
bit wary of the 'except for commercial use' part in the license.

On the other hand, I've put a significant amount of time and energy into
this as a product. Money isn't what it used to be and I'm reluctant to lose
the potential extra income that a dual license might provide.

There is value in augmenting whatever reputation I have by providing the
code for free, but reputation alone doesn't pay the bills.

So... that's why I'm wondering if you would mind helping me understand your
point-of-view.

-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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Trouble with running in jline editor. (newbie question)

2010-01-10 Thread Mark Rathwell
your syntax looks fine.  are you running on unix or windows?  what java
version?  what clojure version?

On Sun, Jan 10, 2010 at 11:54 AM, piscesboy  wrote:

> I placed clojure.jar, jline.jar and jline-0.9.94.jar all in the same
> directory. I started the default clojure editor using:
>
> java -cp clojure.jar clojure.main, and recieved the standard
>
> user=>
>
> prompt. However, when using:
>
> java -cp jline-0.9.94.jar:clojure.jar jline.ConsoleRunner clojure.main
>
> I get:
>
> Exception in thread "main" java.lang.ClassNotFoundException:
> clojure.main
>at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>at java.security.AccessController.doPrivileged(Native Method)
>at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:244)
>at java.lang.ClassLoader.loadClass(ClassLoader.java:315)
>at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
>at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)
>at java.lang.Class.forName0(Native Method)
>at java.lang.Class.forName(Class.java:169)
>at jline.ConsoleRunner.main(ConsoleRunner.java:69)
>
> Am I using the wrong syntax?
>
>
>
> --
> 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
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Has anyone got the Enclojure NetBeans plugin working with clojure 1.1?

2010-01-10 Thread Marmaduke
I did a fresh install of Netbeans, added the enclojure plugin, and
then added the clojure 1.1 jar, and it worked just fine.

I have, however, switched back to Emacs because Netbeans is too slow
on my computer.

On Jan 10, 6:45 pm, nwalex  wrote:
> Since I couldn't get Enclojure working I decided to man up and dive
> into the world of Emacs. After a bit of a struggle I got a working
> development environment set up, incorporating Emacs, NetBeans, and
> Maven. 
> Seehttp://www.maybetechnology.com/2010/01/configuring-my-development-env...
> for more info.
>
> On Jan 9, 8:13 pm, nwalex  wrote:
>
> > I've tried to add a new platform, but the repl fails to start. Then I
> > tried to build the latest version of Enclojure using clojure 1.1, but
> > couldn't get that working either. Has anyone else been able to get it
> > working with clojure 1.1?
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Trouble with running in jline editor. (newbie question)

2010-01-10 Thread Chris Jenkins
Quick question: what operating system are you using?

I would expect your command line to work fine on any *NIX platform. On
Windows, you would  need to replace the colon : with a semi colon ;

2010/1/10 piscesboy 

> I placed clojure.jar, jline.jar and jline-0.9.94.jar all in the same
> directory. I started the default clojure editor using:
>
> java -cp clojure.jar clojure.main, and recieved the standard
>
> user=>
>
> prompt. However, when using:
>
> java -cp jline-0.9.94.jar:clojure.jar jline.ConsoleRunner clojure.main
>
> I get:
>
> Exception in thread "main" java.lang.ClassNotFoundException:
> clojure.main
>at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>at java.security.AccessController.doPrivileged(Native Method)
>at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:244)
>at java.lang.ClassLoader.loadClass(ClassLoader.java:315)
>at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
>at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)
>at java.lang.Class.forName0(Native Method)
>at java.lang.Class.forName(Class.java:169)
>at jline.ConsoleRunner.main(ConsoleRunner.java:69)
>
> Am I using the wrong syntax?
>
>
>
> --
> 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
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: slicing multidimensional vectors (vectors of vectors of vectors ...)

2010-01-10 Thread extrackc
Have you looked into Incanter project?  I just found out about it
recently.  "Incanter is a Clojure-based, R-like platform for
statistical computing and graphics."  http://incanter.org/

In particular, maybe this is useful:
http://liebke.github.com/incanter/core-api.html#incanter.core/sel

Carson

On Jan 10, 11:23 am, Konrad Hinsen  wrote:
> On 10.01.2010, at 13:55, Rock wrote:
>
> > As for the Java libraries, have you had a look at JScience? From what
> > I've seen, it's not at all bad.
>
> It's an interesting library, but it lives clearly in the Java universe  
> of strict typing. Moreover, it doesn't really have arrays, just  
> vectors and matrices. Those are very well thought out and implemented,  
> but it's still a more limited approach than providing general N-
> dimensional arrays.
>
> A problem with all Java libraries is their orientation towards static  
> typing. In Clojure (like in Python), it is natural to have nested data  
> structures, and in particular nested vectors (in Python nested lists)  
> as a conceptual representation of multidimensional arrays. This  
> implies that array indexing operations can return either another array  
> or an element, meaning that the return type must be Object. This can  
> be done in Java but it is not a natural approach. Therefore the Java  
> libraries typically have separate operations for accessing elements  
> and for extracting subarrays, which makes many algorithms  
> unnecessarily cumbersome.
>
> Konrad.
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Strange problem when adding type to a var defined by a macro.

2010-01-10 Thread Nicolas Buduroi

> So I think the source of the exception is clear, but have you found a
> solution to your original problem? Maybe if you expand on that someone
> can describe a good technique.

I'm using clojure-contrib's ns-utils/ns-vars and find-namespaces/find-
namespaces-on-classpath to discover namespaces and look for typed vars
in them to be later evaled and used. Here's the main components that
are used:

 * defmytype: like the defbar example in the above post.
 * find-mytypes: a function that takes a set of namespaces or regex
expressions to search for namespaces and returns the symbols of each
instance of mytype found in them.
 * then the code may use these symbols to load one of them.

For now, I have only a partial implementation and it's not much more
useful than loading any given symbol in a try catch, but eventually I
think it could be useful to provide plugin-like capabilities without
much boilerplate. I've been working on a small project that use this
technique and will release it shortly, that will give you a better
idea.

Thanks

- budu
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Has anyone got the Enclojure NetBeans plugin working with clojure 1.1?

2010-01-10 Thread Eric Thorsen
I use several different builds (clojure platforms for the plugin) and do not
have any problems.
I'd be happy to get you past any issues if you want to give it another shot
in the future.

Eric



On Sun, Jan 10, 2010 at 2:55 PM, Marmaduke  wrote:

> I did a fresh install of Netbeans, added the enclojure plugin, and
> then added the clojure 1.1 jar, and it worked just fine.
>
> I have, however, switched back to Emacs because Netbeans is too slow
> on my computer.
>
> On Jan 10, 6:45 pm, nwalex  wrote:
> > Since I couldn't get Enclojure working I decided to man up and dive
> > into the world of Emacs. After a bit of a struggle I got a working
> > development environment set up, incorporating Emacs, NetBeans, and
> > Maven. Seehttp://
> www.maybetechnology.com/2010/01/configuring-my-development-env...
> > for more info.
> >
> > On Jan 9, 8:13 pm, nwalex  wrote:
> >
> > > I've tried to add a new platform, but the repl fails to start. Then I
> > > tried to build the latest version of Enclojure using clojure 1.1, but
> > > couldn't get that working either. Has anyone else been able to get it
> > > working with clojure 1.1?
>
> --
> 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
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: How do I extend an existing function to take different number of params?

2010-01-10 Thread Tom Faulhaber
Yup, this version would cover most cases in a simpler way. My goal
(for no particular reason except it entertained me) was to make
something that worked as much like defn as possible. Most of the
complexity is because of handling the possible combinations of arities
that we might see as a result: I need to "fill in the holes" with
proxies (though I could have wrapped with an if as well).

extend-fn is also a much better name.

I'm amused that you did the same thing I did before I realized it was
silly: "old-fn# (var-get (var ~name))" can just be "old-fn# ~name".
(It's like "use" and "utilize" one of my pet peeves in English.)

Tom



On Jan 10, 1:03 am, Amit Rathore  wrote:
> Here's some (simpler?) code that will work for adding arity to
> existing functions -http://gist.github.com/273401
>
> It doesn't handle adding variable-arity (ie multiple arity using &) to
> existing functions, but can add specific arity to existing varibale-
> arity functions
> It also doesn't handle adding more than one arity at a time, but you
> can call it multiple times with different arity to get the same
> effect. See example below -
>
> An example to add arity -
>
> user> (extend-fn keyword [ns name suffix]
>         (keyword ns (str name "-" suffix)))
>
> user> (extend-fn keyword [ns prefix name suffix]
>         (keyword ns (str prefix "-" name "-" suffix)))
>
> Here's the example usage -
>
> user> (keyword nil "hello")
> :hello
>
> user> (keyword nil "hello" "more")
> :hello-more
>
> user> (keyword nil "oh" "hello" "more")
> :oh-hello-more
>
> Again, like Tom said, dunno why you'd need to do this...
>
> On Jan 9, 10:45 pm, Tom Faulhaber  wrote:
>
> > Actually this is possible. (seehttp://xkcd.com/386/)
>
> > See the macro add-arity which I've put up here:http://gist.github.com/273349
>
> > This allows you to do things like:
>
> > user> (add-arity keyword [ns name suffix] (keyword ns (str name "-"
> > suffix)))
> > #
>
> > user> (keyword nil "hello" "more")
> > :hello-more
>
> > The code I put up will handle (I think) all sorts of variations of arg
> > counts: you can use add-arity just like defn and it will grab any
> > specified arglists (including arglists with &) and proxy the others
> > back to the original function. It doesn't do anything with metadata,
> > though. Also, you can override a given arity on the original function,
> > but you can't then call the original version at that arity.
>
> > Whether this is a good idea or not is a completely different
> > question :-)
>
> > Tom
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Trouble with running in jline editor. (newbie question)

2010-01-10 Thread piscesboy
java version "1.6.0_17"
clojure 1.1.0

Running on Mac OS X.

On Jan 10, 2:46 pm, Mark Rathwell  wrote:
> your syntax looks fine.  are you running on unix or windows?  what java
> version?  what clojure version?
>
> On Sun, Jan 10, 2010 at 11:54 AM, piscesboy  wrote:
> > I placed clojure.jar, jline.jar and jline-0.9.94.jar all in the same
> > directory. I started the default clojure editor using:
>
> > java -cp clojure.jar clojure.main, and recieved the standard
>
> > user=>
>
> > prompt. However, when using:
>
> > java -cp jline-0.9.94.jar:clojure.jar jline.ConsoleRunner clojure.main
>
> > I get:
>
> > Exception in thread "main" java.lang.ClassNotFoundException:
> > clojure.main
> >        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> >        at java.security.AccessController.doPrivileged(Native Method)
> >        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> >        at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:244)
> >        at java.lang.ClassLoader.loadClass(ClassLoader.java:315)
> >        at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
> >        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:398)
> >        at java.lang.Class.forName0(Native Method)
> >        at java.lang.Class.forName(Class.java:169)
> >        at jline.ConsoleRunner.main(ConsoleRunner.java:69)
>
> > Am I using the wrong syntax?
>
> > --
> > 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
> > Note that posts from new members are moderated - please be patient with
> > your first post.
> > To unsubscribe from this group, send email to
> > clojure+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/clojure?hl=en
-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: slicing multidimensional vectors (vectors of vectors of vectors ...)

2010-01-10 Thread Konrad Hinsen

On 10 Jan 2010, at 21:39, extrackc wrote:


Have you looked into Incanter project?  I just found out about it
recently.  "Incanter is a Clojure-based, R-like platform for
statistical computing and graphics."  http://incanter.org/


Incanter uses ParallelColt as its underlying matrix library. While  
this is a fine library for working with matrices, it is not a  
multidimensional array library. Colt arrays exist only in 1, 2, and 3  
dimensions and there are no generic (dimension-independent) operations  
on array structure.


As the huge success of Matlab has shown, a lot can be done with just  
matrices and vectors, but anyone who has used an array language (such  
as APL) or an equivalent library (such as Python's NumPy) will feel  
constrained by such an approach.


Konrad.

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en