Re: Lazy deserialization / reserialization, aatree release 0.3.0

2015-10-01 Thread William la Forge
Lets look at the upd function that is part of the map benchmark I posted above... (defn upd [m i] (let [m1 (assoc m i (- i)) bb (ByteBuffer/allocate (lazy-byte-length m1))] (lazy-write m1 bb) (.flip bb) (load-aamap bb))) And its invocation... (def lazy-m (reduce upd lazy

Re: Lazy deserialization / reserialization, aatree release 0.3.0

2015-10-01 Thread William la Forge
Lets look at the upd function that is part of the map benchmark I posted above... (defn upd [m i] (let [m1 (assoc m i (- i)) bb (ByteBuffer/allocate (lazy-byte-length m1))] (lazy-write m1 bb) (.flip bb) (load-aamap bb))) And its invocation... (def lazy-m (reduce upd lazy

Re: 'seq' performance for 'empty?' compared to 'count'. And where's !=?

2015-10-01 Thread Gary Trakhman
Count is going to be slow for seqs or cons's, but I think a generalized function could be implemented via protocol, falling back to seq. Things that extend https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Counted.java are going to have a fast 'count' method. On Thu, Oct 1, 2015

Re: 'seq' performance for 'empty?' compared to 'count'. And where's !=?

2015-10-01 Thread Nathan Davis
On Thursday, October 1, 2015 at 2:31:46 PM UTC-5, Dave Tenny wrote: > > So I understand that 'seq' is the idiomatic way to see if a > collection/sequence is empty. > > I'm not sure where you got this from. I personally use empty? to check whether a collection is empty. It is true that (not (emp

Re: Lazy deserialization / reserialization, aatree release 0.3.0

2015-10-01 Thread Nathan Davis
Thanks, that really helps clarify things. So is the new tree saved when it is created (i.e., when the old tree is "updated"), or do you have to "write it back" at some point? In other words, as a user of aatree, do I obtain a new tree and then tell aatree "Here is a new tree. Please (incremen

Re: Lazy deserialization / reserialization, aatree release 0.3.0

2015-10-01 Thread William la Forge
Sorry for my bad language. I've not written much about immutable structures before so old phraseology keeps coming in inappropriately. The structures are immutable. A change results in a new tree with only the nodes which are changed (and their parent nodes) replaced. But the key property here

Re: prettier stacktraces?

2015-10-01 Thread Howard Lewis Ship
Without the plugin, I typically added the call to io.aviso.repl/install-pretty-exceptions in my user.clj, or in some other early-loading namespace. On Mon, Jun 1, 2015 at 11:57 AM, John Gabriele wrote: > On Monday, June 1, 2015 at 2:31:46 PM UTC-4, nikolay.k...@gmail.com wrote: >> >> I think thi

Re: prettier stacktraces?

2015-10-01 Thread Howard Lewis Ship
io.aviso/pretty 0.1.19 also acts as a Leiningen plugin to accomplish this; there's a function (in the io.aviso.repl namespace) that replaces several Vars with new implementation based on io.aviso.exception/write-exception. On Mon, Jun 1, 2015 at 11:57 AM, John Gabriele wrote: > On Monday, June 1

Re: Lazy deserialization / reserialization, aatree release 0.3.0

2015-10-01 Thread Nathan Davis
On Thursday, October 1, 2015 at 2:58:15 PM UTC-5, William la Forge wrote: > > A value can have more than one form or implementation. For example, a > String and a char array may both represent the same value. Most objects, > for example, can be serialized. Changing the form of a value then is n

Re: 'seq' performance for 'empty?' compared to 'count'. And where's !=?

2015-10-01 Thread James Reeves
Benchmarking the JVM can be difficult, as it uses a JIT compiler. Your examples tally more or less with my own benchmarks, but for the most accurate results I'd recommend using Criterium and ensuring that the :jvm-opts map in your project file is empty:

Re: Lazy deserialization / reserialization, aatree release 0.3.0

2015-10-01 Thread William la Forge
A value can have more than one form or implementation. For example, a String and a char array may both represent the same value. Most objects, for example, can be serialized. Changing the form of a value then is not a change of value. This is the idea behind lazy deserialization / reserializa

'seq' performance for 'empty?' compared to 'count'. And where's !=?

2015-10-01 Thread Dave Tenny
So I understand that 'seq' is the idiomatic way to see if a collection/sequence is empty. Logically I'm looking for an O(1) predicate with which I can determine if a seq/collection is empty, and a well behaved one that is idempotent and side effect free (for general performance reasons). 'seq'

Re: Lazy deserialization / reserialization, aatree release 0.3.0

2015-10-01 Thread Nathan Davis
Hi Bill, This sounds interesting, but the descriptions here and on the project page are pretty high-level. Are there more details available? One question I have in particular is, what do you mean by "update"? From what I can tell, aatree provides an immutable/persistent data structure compat

Towards Greater Code Reuse

2015-10-01 Thread William la Forge
Code reuse is for me the holy grail of software. It is something we lost in large measure with the adoption of top-down development. And OO has only complicated the matter. For some time now I have advocated the use of factories and interfaces as a means of decoupling, but writing reusable co

Re: clojure 1.8 java.lang.VerifyError method: invokeStatic signature: Can only throw Throwable objects

2015-10-01 Thread Lars Rune Nøstdal
On Thursday, October 1, 2015 at 12:59:39 PM UTC+2, Nicola Mometto wrote: > > > http://dev.clojure.org/jira/browse/CLJ-1809 > Awesome; thank you. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegro

Re: clojure 1.8 java.lang.VerifyError method: invokeStatic signature: Can only throw Throwable objects

2015-10-01 Thread Nicola Mometto
http://dev.clojure.org/jira/browse/CLJ-1809 Lars Rune Nøstdal writes: > Hi, > Anyone playing around with 1.8 from Git? It has problems compiling this for > some reason: > > (defn blah [] > (let [a (atom nil) > b nil] > (try > (println "hi") > (catch Throwable e >

clojure 1.8 java.lang.VerifyError method: invokeStatic signature: Can only throw Throwable objects

2015-10-01 Thread Lars Rune Nøstdal
Hi, Anyone playing around with 1.8 from Git? It has problems compiling this for some reason: (defn blah [] (let [a (atom nil) b nil] (try (println "hi") (catch Throwable e (println e)) (finally (when (and (deref a) b) (println "huh"))

clojure.repl/doc - change request - print vs return-value

2015-10-01 Thread Terje Dahl
Would it be possible to "break out" the functionality of the function "doc" into a second function named i.e. "doc-fn" - much as has been done with dir vs dir-fn? doc prints to *out* just like dir does. But dir-fn allows me to parse the output and use it as I need. I would like the same for doc(

Re: Where do I find javadoc for clojure interfaces?

2015-10-01 Thread Phillip Lord
Probably because they are not documented. This is the source code for ISeq in total /** * A persistent, functional, sequence interface * * ISeqs are immutable values, i.e. neither first(), nor rest() changes * or invalidates the ISeq */ public interface ISeq extends IPersistentCollection {

Where do I find javadoc for clojure interfaces?

2015-10-01 Thread crocket
http://clojure.github.io/clojure/javadoc/ doesn't expost interfaces like clojure.lang.ISeq, so when I refer to such interfaces, I have to download clojure javadoc from maven. I'd like to refer to those interface on web browsers. Why are they not exposed on the web? -- You received this message