Add a function annotation for scoping in unit tests

2016-03-23 Thread sundbry
Hi everyone, What are your opinions on adding a special metadata to functions to provide it in scope for tests? This would be a nice language feature to have: For example, (ns banana) (defn- ^:+test phone [] "ring ring ring") (ns banana-test ...) (deftest ring-ring [] ; We can call the

Language-agnostic schema definition for Transit?

2016-03-23 Thread Paul Lam
Is there something like JSON Schema http://json-schema.org/examples.html specifically for Transit? Perhaps with a validator tool too. -- 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 t

Re: Add a function annotation for scoping in unit tests

2016-03-23 Thread Alex Miller
Private functions (really vars marked private holding a function) can always be accessed via the var #' syntax: (ns banana-test ...) (deftest ring-ring [] (is (sting? (#'banana/phone))) This is the way private functions are typically tested. On Wednesday, March 23, 2016 at 6:53:12 AM UT

Re: Add a function annotation for scoping in unit tests

2016-03-23 Thread Alex Miller
I guess the other important detail there is that when you invoke a var holding a function, it invokes the function. On Wednesday, March 23, 2016 at 7:01:41 AM UTC-5, Alex Miller wrote: > > Private functions (really vars marked private holding a function) can > always be accessed via the var #' s

Re: Add a function annotation for scoping in unit tests

2016-03-23 Thread sundbry
Thanks Alex, that's very helpful. -- Ryan On Wednesday, March 23, 2016 at 5:02:43 AM UTC-7, Alex Miller wrote: > > I guess the other important detail there is that when you invoke a var > holding a function, it invokes the function. > > On Wednesday, March 23, 2016 at 7:01:41 AM UTC-5, Alex Mill

clojure.math.combinatorics/combinations throws exception on n=1

2016-03-23 Thread Matthias Grabmair
I am just using the math combinatorics library and spent some time debugging until I found out that combinations does not accept n=1. Is this intentional? *=> (clojure.math.combinatorics/combinations #{1 2 3 4} 1)* *UnsupportedOperationException nth not supported on this type: Persistent

Re: clojure.math.combinatorics/combinations throws exception on n=1

2016-03-23 Thread Mark Engelberg
The input should be a sequence not a set, so call seq on the input before passing it to this function. Sorry if that was unclear from the docs. (For some inputs, it is more forgiving, but when you call combinations with n=1, it calls distinct on the set, and clojure.core's implementation of disti

Re: clojure.math.combinatorics/combinations throws exception on n=1

2016-03-23 Thread Matthias Grabmair
Thanks, this helps! Generally, is there any reason why combinations should not work on sets? I may have tunnel vision here as they are everywhere in the systems I build. On Wednesday, March 23, 2016 at 7:54:05 PM UTC-4, puzzler wrote: > > The input should be a sequence not a set, so call seq

Re: clojure.math.combinatorics/combinations throws exception on n=1

2016-03-23 Thread Mark Engelberg
On Wed, Mar 23, 2016 at 7:05 PM, Matthias Grabmair < matthias.grabm...@gmail.com> wrote: > > Thanks, this helps! > > Generally, is there any reason why combinations should not work on sets? I > may have tunnel vision here as they are everywhere in the systems I build. > > A lot of the functions pr

Re: Interest in a Full Featured Clojure Blog Engine

2016-03-23 Thread Nate B
// , What ended up happening with this? My company and I could really use a full featured blogging engine in Clojure. https://groups.google.com/forum/#!topic/clojure/rCmPYa0Vw-4 On Thursday, July 18, 2013 at 7:24:06 AM UTC-7, frye wrote: > > Hello, > > I'm thinking of how to build a composa