Re: with-redefs does not work for macros

2016-10-31 Thread Tiago Espinha
It's definitely good to mention. It's also what I ended up doing but didn't mention it in my answer :) On Tue, Nov 1, 2016 at 1:15 AM +0100, "Beau Fabry" mailto:imf...@gmail.com>> wrote: Not an answer to your question, but I usually just redefine clojure.tools.logging/log* instead for tests.

Re: with-redefs does not work for macros

2016-10-31 Thread Beau Fabry
Not an answer to your question, but I usually just redefine clojure.tools.logging/log* instead for tests. On Monday, April 27, 2015 at 9:34:14 AM UTC-7, 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 ha

Re: Deriving a protocol from a protocol...

2016-10-31 Thread Alex Miller
You can of course have one concrete instance implement many protocols. Another clever thing you can do is to extend a protocol to Object, then inside the Object extension check if the instance satisfies? another protocol and if so, extend its type at runtime to the original protocol. Rich sugge

[ANN] data.avl 0.0.17 – tree balance bugfix, more generative tests

2016-10-31 Thread Michał Marczyk
Hi, I am pleased to announce the 0.0.17 release of data.avl, a Clojure Contrib library providing highly performant drop-in replacements for Clojure(Script)'s built-in sorted maps and sets that support O(log n) nth, rank-of, first-class submaps/subsets (like subseq, but preserving collection type;

Re: Deriving a protocol from a protocol...

2016-10-31 Thread John Szakmeister
On Mon, Oct 31, 2016 at 5:57 PM, Alex Miller wrote: > You can create instances that implement multiple Java interfaces using > `reify` or by declaring them inline of a `defrecord` or a `deftype`. (See > http://clojure.org/reference/datatypes for more.) Thank you Alex. I should have been more cle

Re: Deriving a protocol from a protocol...

2016-10-31 Thread Alex Miller
You can create instances that implement multiple Java interfaces using `reify` or by declaring them inline of a `defrecord` or a `deftype`. (See http://clojure.org/reference/datatypes for more.) Clojure does *not* encourage or support concrete inheritance (other than of the limited degree provi

Java 9 AOT Compilation

2016-10-31 Thread Alan Moore
FYI: I just ran across this and thought it would interest this group: http://openjdk.java.net/jeps/295 Initially only some of the base java stuff will be compiled but it looks like it will be extended further. Hopefully this might help improve startup time for those using OpenJDK. Alan -- Yo

Deriving a protocol from a protocol...

2016-10-31 Thread John Szakmeister
I'm looking at using Clojure in an application where we make fine-grained use of interfaces that help describe the capabilities of an object. We need to take several interfaces and bring them together, not necessarily in an implementation, but to help define what the overall interface for the obje

Re: Can clojure.spec be used to identify/pinpoint broken invariants on dynamic data?

2016-10-31 Thread Alex Miller
Getting a bit more concrete, I think this would be a better approach to the variable name spec: (defmacro make-name-spec [var-names] `(s/and :lang-name ~var-names)) which can be called in the process of verifying the ast to dynamically create a static spec, which can then be used for valid

Re: Can clojure.spec be used to identify/pinpoint broken invariants on dynamic data?

2016-10-31 Thread Alex Miller
On Monday, October 31, 2016 at 10:41:36 AM UTC-5, Yannick Scherer wrote: > > imho, you're asking spec to do more than it should here - it's not a magic >> wand to wave at all validation problems. >> > > That's good to know. Note that, in regard to the problem stated above, > clojure.spec does n

Re: Can clojure.spec be used to identify/pinpoint broken invariants on dynamic data?

2016-10-31 Thread Yannick Scherer
> > imho, you're asking spec to do more than it should here - it's not a magic > wand to wave at all validation problems. > That's good to know. Note that, in regard to the problem stated above, clojure.spec does not fail its validation responsibilities – it can perfectly tell me that my data h

Re: Can clojure.spec be used to identify/pinpoint broken invariants on dynamic data?

2016-10-31 Thread Alex Miller
imho, you're asking spec to do more than it should here - it's not a magic wand to wave at all validation problems. -- 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

Re: comp and partial vs ->>

2016-10-31 Thread JHacks
On Sunday, October 30, 2016 at 10:50:08 PM UTC-4, Mikera wrote: > > > I actually prefer the following style to both of the above: > > (defn camel->keyword* > [s] > (let [words (str/split s #"(?<=[a-z])(?=[A-Z])") >lc-words (map str/lower-case words) >

freeing deftemplate memory after using clojure.tools.namespace.repl/refresh

2016-10-31 Thread Calvin Irwan
Hi, all My project is using a lot of enlive deftemplates and the file generated is quite big. Whenever I refresh my project it seems going slower and slower and out of memory at the end and I found the culprit to be those deftemplates. My question is, how can I free the old deftemplates memor