Hi JPatrick,
On Mon, Apr 27, 2015 at 11:50 PM, JPatrick Davenport
wrote:
> Hello,
> So just to get it out: I do not want to evaluate the JavaScript, simply
> preserve it.
>
> I'm working on an ArangoDB driver. Part of the wonder that is ArangoDB is
> its ability to support transactions. This is
Complex numbers are tricky because:
- They need to be fast in order to be useful for numerical computing. The
"obvious" implementations that you might create with boxed values,
vectors/maps, multimethods and protocols are likely to be unacceptable for
many use cases
- You still want to be able t
I have a simplified scenario here: https://github.com/scizo/unmap-failure
The problem is I am using ns-unmap to prevent a WARNING from being printed
when shadowing java.lang.Long in a namespace.
When this code is aot compiled, the namespace var referenced by 'Long is
being created before the ns-
Hello,
So just to get it out: I do not want to evaluate the JavaScript, simply
preserve it.
I'm working on an ArangoDB driver. Part of the wonder that is ArangoDB is
its ability to support transactions. This is done using JSON. Part of the
REST object for a transaction is what I want to do in t
I think it's unlikely that Clojure would add a complex number type.
However, it might be possible to open up the system enough that new types
could be created and integrated by others. I think this discussion and
implementation from clojure-dev (about unsigned numbers) is pertinent:
https://gro
Just cheerleading: I, for one, would love for Clojure to have complex number
support, however it can be arranged (built-in or through a library).
I sometimes do quantum computing work and this issue has prevented progress on
a couple of projects. I haven't tried to solve the problem myself, and
The second beta of "Clojure Applied" is now available. This version adds
Chapter 8 (Clojure Testing) as well as a foreword by Russ Olsen, and fixes
for many of the reported errata.
https://pragprog.com/book/vmclojeco/clojure-applied
If you've already bought the book, you should get an email to
On Monday, April 27, 2015 at 12:34:14 PM UTC-4, Vebjorn Ljosa wrote:
>
> In one of my tests, I was trying to mock something
> (`clojure.tools.logging/warn`) that happened to be a macro. It had me
> puzzled for a while until I discovered that `with-redefs` resets the value
> of the vars after the
People frequently make their own modified versions of Clojure without
having their changes made part of the core Clojure distribution. That is
why I said "depending upon your goals". If your goal is to try it out and
learn from it, and you don't care whether it becomes part of the standard
Clojur
As far as I know, Java Math does not have a complex number type. Some
implementations of a complex number exist (such as Apache Commons Math),
but they create a Complex class that implements Serializeable and a Commons
specific interface.
Modifying clojure.core itself is a bit daunting, and l
This is what I suspected. Of course, this is not just for abs, but really
for any mathematical operation. Sqrt, Trig operations etc.
I will study the Ratio type more closely, but note that something like
(Math/abs (/ 22 7)) does not work.
On Monday, April 27, 2015 at 12:45:32 PM UTC-4, Gary V
I fleshed out some of this a bit more in a blog post with perf numbers in
case anyone's interested:
http://insideclojure.org/2015/04/27/poly-perf/
On Saturday, April 25, 2015 at 9:39:06 PM UTC-5, Alex Miller wrote:
>
> On Saturday, April 25, 2015 at 9:33:18 AM UTC-5, Timur wrote:
>>
>> Hi every
As far as I understand, your example with Math/abs would need to be part of
Java.
You cannot extend the arithmetic operators in Java, and you will not be
able to extend static Java methods like Math/abs.
What you may be able to do is make your custom type play nice with Clojure
operators, like Cl
Unless the Java Math library handles complex types already, I don't know of
any way to extend it in a way that would let you get the answer you want
from (Math/abs my-complex-number) in Clojure.
If you want code that gives the correct answers, a library using vectors or
maps for complex numbers ca
In one of my tests, I was trying to mock something
(`clojure.tools.logging/warn`) that happened to be a macro. It had me
puzzled for a while until I discovered that `with-redefs` resets the value
of the vars after the body is executed, but does not reset the flag that
says that the var is a mac
Alex Miller writes:
> Sounds like you might have been running into the absence of multimethod
> caching for the default case (http://dev.clojure.org/jira/browse/CLJ-1429),
> which has been fixed in 1.7.
No, I don't think; my default case was and is "throw an exception".
> Just on a side n
I have been thinking along the lines of mikera and Maik - and it seems like
there is no further progress here? I would like to take a crack at creating
a complex number type, but implemented as a library to Clojure. I am not
sure where to start, and if anyone here has suggestions, I'd be happy t
Sounds like you might have been running into the absence of multimethod
caching for the default case (http://dev.clojure.org/jira/browse/CLJ-1429),
which has been fixed in 1.7.
Just on a side note, that repo does not change the default lein :jvm-opts,
which are bad for benchmarking. I recommen
I think that the answer is, it depends, and, there might be some
surprises in store.
In my own use, I found multimethods collapse in performance as a result
of changes to the interface hierarchy in the library I was using (my
tests cases went from 45s to over 4mins).
I circumvented this by fiddl
You're right. I didn't check it enough. I did check out the source (and
btw, was very impressed with the result) but it looks like the function
call ended up doing nothing. I just put in a side effect and I got the
following results:
"[a :one], (multi-test), 100 runs, 2933 msecs"
"[a :one],
A quick glance at your benchmarking setup, it's not clear that you are
benchmarking what you think you are benchmarking, and jsperf is not a
suitable benchmarking harness (irrespective of it's popularity).
Benchmarking is hard, benchmarking JavaScript is harder, and benchmarking
JavaScript that wen
Looks like they're pretty slow compared to a simple case:
http://jsperf.com/cljs-multimethods
https://github.com/rauhs/cljs-perf
On Saturday, April 25, 2015 at 10:33:18 AM UTC-4, Timur wrote:
>
> Hi everyone,
>
> There are situations where I want to dispatch functions using based on
> their ce
22 matches
Mail list logo