aset and shorts, aset vs aset-int

2011-05-29 Thread bOR_
Is there something obvious I am missing when aset in clojure 1.3-alpha8 won't work for shorts. aset-shorts does work, but way slower than I'd expect. There is also an order of magnitude difference in speed between aset ^ints and aset-int. I've looked at the source of amap (which was the first t

Re: Matrix operation (a la numpy)

2011-05-29 Thread bOR_
Incanter does. Works fine, but I'm not sure how fast it is. -- 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 fir

:gen-class possibly missing a compile time check when extending abstract classes that implement interfaces

2011-05-29 Thread ckirkendall
I ran into this when creating a log4j appender in Clojure. I extended the AppenderSkeleton, an abstract class. This abstract class implements Appender. Appender defines two methods that don't appear in the AbstractSkeleton (requiresLayout & close). I was able to compile the Clojure class, withou

Re: fs and with-tempdir

2011-05-29 Thread Miki
> Cool, I'll clean up the code and submit it along with tests and docs. While > Im about it i may as well write the equivalent macro for tempfile. > Thanks! -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cloju

Re: fs and with-tempdir

2011-05-29 Thread David Jagoe
On 29 May 2011 16:40, Miki wrote: > >> Cool, I'll clean up the code and submit it along with tests and docs. >> While Im about it i may as well write the equivalent macro for tempfile. I've submitted a bit bucket pull request with the changes. Never used bit bucket before so not sure what the pro

Re: aset and shorts, aset vs aset-int

2011-05-29 Thread David Nolen
On Sun, May 29, 2011 at 9:17 AM, bOR_ wrote: > Is there something obvious I am missing when aset in clojure 1.3-alpha8 > won't work for shorts. aset-shorts does work, but way slower than I'd > expect. There is also an order of magnitude difference in speed between aset > ^ints and aset-int. > > I

Re: :gen-class possibly missing a compile time check when extending abstract classes that implement interfaces

2011-05-29 Thread Sean Corfield
I also ran into this recently - doing the exact same thing (a log4j appender). I was a bit surprised and I wonder if Clojure is effectively generating abstract classes rather than concrete classes? (Do we have no way to specify the difference? Is that only an artifact of the Java compiler, not the

Re: Writing conditions on geometric coordinates

2011-05-29 Thread Andreas Liljeqvist
Not sure if I understand your problem. Is it the verbosity of extracting coordinates? (rect-one :x1) Or is the problem with increasing the dimensionality? Anyhow I would define the types as following: (def point [1 2 3]) (def rect [point point]) (defn point-in-rect? [p [[r1 r2]]] (every? tru

Re: aset and shorts, aset vs aset-int

2011-05-29 Thread bOR_
Thanks for the help, appreciated! It helped me figuring out where exactly things go haywire. This works: user> (let [^ints as (make-array Integer/TYPE 10)] (aset as 0 (+ (aget as 1) (aget as 2

Re: aset and shorts, aset vs aset-int

2011-05-29 Thread David Nolen
On Sun, May 29, 2011 at 4:35 PM, bOR_ wrote: > Thanks for the help, appreciated! It helped me figuring out where exactly > things go haywire. > > This works: > user> (let [^ints as (make-array Integer/TYPE 10)] (aset as 0 (+ (aget as > 1) (aget as 2 > > 0 > > and this breaks > > user> (let [^

Re: aset and shorts, aset vs aset-int

2011-05-29 Thread Ken Wesson
On Sun, May 29, 2011 at 1:39 PM, David Nolen wrote: > Vectors of primitives are more efficient, [1] > but there's work to be done for them to approach Java > arrays in perf. [2] Aren't your statements [1] and [2] contradictory? Did you mean "more idiomatic" perhaps in [1], or "more functional"

Re: aset and shorts, aset vs aset-int

2011-05-29 Thread Jonathan Fischer Friberg
I think he meant that vectors of primitives are more efficient than normal vectors. Jonathan On Sun, May 29, 2011 at 11:26 PM, Ken Wesson wrote: > On Sun, May 29, 2011 at 1:39 PM, David Nolen > wrote: > > Vectors of primitives are more efficient, > > [1] > > > but there's work to be done for t

Re: aset and shorts, aset vs aset-int

2011-05-29 Thread Alan Malloy
More efficient than vectors of non-primitives, one imagines. Or, more efficient than primitive vectors before 1.3 (I'm not sure if primitive vectors exist in 1.2). On May 29, 2:26 pm, Ken Wesson wrote: > On Sun, May 29, 2011 at 1:39 PM, David Nolen wrote: > > Vectors of primitives are more effic

Odd "error" using CCW.

2011-05-29 Thread Ken Wesson
I get the following in "problems" in CCW when opening a particular Clojure project: Unable to resolve symbol: => in this context sandbox.clj /sandbox/src line 1 Clojure Compilation Problem The line in question is just this: (ns sandbox) Error, my left nostril. Of course, perhaps CCW

Idiomatic use of records vs. maps

2011-05-29 Thread James Reeves
The documentation on records seems to indicate that they be used in place of structs, but is there any advantage to using a record if no protocols are assigned to it? For example, I've defined a TcpServer record as part of a library I'm developing: (defrecord TcpServer [port host

Re: Idiomatic use of records vs. maps

2011-05-29 Thread Ken Wesson
On Sun, May 29, 2011 at 8:56 PM, James Reeves wrote: > The documentation on records seems to indicate that they be used in > place of structs, but is there any advantage to using a record if no > protocols are assigned to it? Access to a record's in-definition members should be faster than access

Writing Android Apps in Clojure

2011-05-29 Thread Brian Rowe
Hi, I've seen that one of the biggest speed bumps on the path to delivering an Android application written in Clojure is app startup time. Has anyone tried writing the application's initial activity in pure java and delegating the loading of clojure to a service? Perhaps the service could send a

Re: Radically simplified Emacs and SLIME setup

2011-05-29 Thread Mark Engelberg
I need more details about how to install the current version of clojure-mode. When I do alt-x package-install and type clojure-mode I get a bunch of messages that it is compiling clojure-mode 1.7.1. The website said to install clojure-mode via marmalade, but it's not at all clear to me what marma

Dependencies with native components

2011-05-29 Thread Phil Hagelberg
I started a thread on the Leiningen mailing list about improving support for dependencies with native components, but I realized I should have put it on the main Clojure list instead for a wider audience: http://groups.google.com/group/leiningen/browse_thread/thread/11e225cdea343176 If you mainta

Re: difference between Composite Form & Special Form

2011-05-29 Thread iamcreasy
> Sort of. You can create a macro with defmacro, which like a special > form controls the evaluation of its arguments instead of the arguments > being evaluated first and the function only getting the results. > Things like -> and defn are macros: That means, the difference of composite form and s

Re: difference between Composite Form & Special Form

2011-05-29 Thread iamcreasy
> Sort of. You can create a macro with defmacro, which like a special > form controls the evaluation of its arguments instead of the arguments > being evaluated first and the function only getting the results. > Things like -> and defn are macros: That means, the difference of composite form and s

Re: Radically simplified Emacs and SLIME setup

2011-05-29 Thread László Török
Heh, yeah that marmelade was a funny one, I spent a few hours figuring what goes where. I suggest you download emacs-starter-kit from Phil's github repo, that has the necessary configuration for marmelade too. Then proceed with installing clojure-mode. Las sent from my mobile device On May

Re: Radically simplified Emacs and SLIME setup

2011-05-29 Thread Mark Engelberg
On Sun, May 29, 2011 at 10:06 PM, László Török wrote: > Heh, yeah that marmelade was a funny one, I spent a few hours figuring what > goes where. > > I suggest you download emacs-starter-kit from Phil's github repo, that has > the necessary configuration for marmelade too. > > Then proceed wit

Re: Radically simplified Emacs and SLIME setup

2011-05-29 Thread László Török
Then you might wanna double check whether you have the latest version (of emacs-starter-kit), as it worked for me with a week old snapshot. (Im on Mac, running Aquamacs). 2011/5/30 Mark Engelberg > On Sun, May 29, 2011 at 10:06 PM, László Török wrote: > > Heh, yeah that marmelade was a funny on

Aw: Odd "error" using CCW.

2011-05-29 Thread Meikel Brandmeyer
Hi, you might want to ask this on the counterclockwise mailing list: https://groups.google.com/forum/#!forum/clojuredev-devel That help Laurent to keep track of such issues. Sincerely Meikel -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post