Doc strings for complex cases?

2017-11-05 Thread Tim
I'm seeing a need to assign a doc string per arity case for defn and also for each defmethod as opposed to storing it all in defmulti. Any solutions or plans for this? Tim -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

Re: Doc strings for complex cases?

2017-11-05 Thread Mark Nutter
That actually sounds like a kind of code smell to me. If your different arities/defmethods are doing such disparate things that you can't easily describe them in a single docstring, it's worth asking whether they need to be separate functions. On Sun, Nov 5, 2017 at 7:59 AM, Tim wrote: > I'm see

Re: Doc strings for complex cases?

2017-11-05 Thread Tim
I expected a code smell response, but I simply don't agree with that. I believe peoples approach to doc strings are as varied as people are. I tend to be specific and want to add more context (do not read 'more content') in my doc string(s) than others might, but at the same time it's not like t

Re: Doc strings for complex cases?

2017-11-05 Thread Stuart Halloway
Hi Tim, You suggested a great reason yourself: "peoples approach to doc strings are as varied as people are". To the extent that is true, someone would need to propose a design considerate of that variety of needs (and tradeoffs!). Without such planning, Clojure would evolve as a semi-random-walk

Re: What's up with IMeta?

2017-11-05 Thread Michał Marczyk
About realizing the head of lazy seqs in with-meta: On 5 November 2017 at 01:57, Didier wrote: > > That said, metadata and its relationship to an object is immutable - an >>> object with different metadata is a different object. One consequence of >>> this is that applying metadata to a lazy seq

Re: What's up with IMeta?

2017-11-05 Thread James Reeves
On 5 November 2017 at 21:32, Michał Marczyk wrote: > Now, if xs' head has not been realized, (with-meta xs {:foo 1}) can > conceivably operate in one of two ways: > > 1. it can copy over xs' thunk (the nullary function embedded in the lazy > seq object xs that is called – and expected to return a

[Violation] Parser was blocked due to document.write(

2017-11-05 Thread ajlotriet
Sorry - very basic... I am trying the Clojurescript quickstart guide, and have followed the instruction in detail. When trying to view the index.html in Chrome, I get this error in the console: "[Violation] Parser was blocked due to document.write(

Re: [Violation] Parser was blocked due to document.write(

2017-11-05 Thread Laurens Van Houtven
> On Nov 5, 2017, at 17:25, ajlotr...@gmail.com wrote: > > Sorry - very basic... I am trying the Clojurescript quickstart guide, and > have followed the instruction in detail. When trying to view the index.html > in Chrome, I get this error in the console: > > "[Violation] Parser was blocked

Define a spec for finite numbers

2017-11-05 Thread Melk Thor
Hi. I am trying to implement a spec for finite numbers, but I am getting ExceptionInfo Unable to construct gen. This is my approach: (ns myns (:require [clojure.spec.alpha :as spec] [clojure.spec.gen.alpha :as gen] [clojure.spec.test.alpha :as stest] [incan

Re: Define a spec for finite numbers

2017-11-05 Thread Alex Miller
Any time you're using gen, you will also need to include the (optional) library org.clojure/test.check "0.9.0". On Sunday, November 5, 2017 at 9:19:22 PM UTC-6, Melk Thor wrote: > > Hi. > I am trying to implement a spec for finite numbers, but I am getting > ExceptionInfo Unable to construct gen

Re: [Violation] Parser was blocked due to document.write(

2017-11-05 Thread Thomas Heller
This is only an issue in unoptimized code, ie. :none. Without optimizations all code is in separate files which are loaded in dependency order. The default debug loader will load them by appending a script tag to the document. This has pretty terrible performance characteristics but is OK durin