Re: need help on `pprint/write` code with better readability

2016-10-23 Thread jiyinyiyong
What does miser-width mean since you set it to 60? On Mon, Oct 24, 2016 at 3:08 AM Alex Miller wrote: > Try something like this: > > (require '[clojure.pprint :as pprint]) > (defn print-code [o] > (binding [pprint/*print-right-margin* 100 >

Re: Slides for my talk at EuroClojure 2016

2016-10-23 Thread Dragan Djuric
Cool. Do you use any well-known textbook? It would be best if we could test some well-designed hierarchical model in Anglican? I prefer the book Doing Bayesian Data Analysis, since it has some decently serious models there, yet is self-contained and approachable for users. I also have

Re: Slides for my talk at EuroClojure 2016

2016-10-23 Thread Boris V. Schmid
Not hierarchical, but continuous variables. It is our first foray into bayesian inference, so we keep things somewhat simple. Can't give an exact comparison, but to run a model simulating a single city (rats and fleas and human populations, no spatial component) is in the order of minutes for

conditional support for spec in libraries

2016-10-23 Thread Max Penet
Another way is to provide the specs as a separate (or "sub") project. You then dont have to care about clojure versions, potential aot issues etc. I do this in https://github.com/mpenet/alia The same approach is taken with all features that could be considerrd opinionated and relying on

Re: need help on `pprint/write` code with better readability

2016-10-23 Thread Alex Miller
Try something like this: (require '[clojure.pprint :as pprint]) (defn print-code [o] (binding [pprint/*print-right-margin* 100 pprint/*print-miser-width* 60] (pprint/with-pprint-dispatch pprint/code-dispatch (pprint/pprint o Or one of the "pretty printer" libraries

Re: conditional support for spec in libraries

2016-10-23 Thread Alex Miller
We do not plan to add a :spec feature expression (also, feature expressions are not actually a thing - the final version of reader conditionals only supports platform tags). On Sunday, October 23, 2016 at 10:49:33 AM UTC-5, Cal Loomis wrote: > > The only discussion I’ve seen about providing

Re: Slides for my talk at EuroClojure 2016

2016-10-23 Thread Dragan Djuric
Are those hierarchical models? I also suppose the variables are continuous? What are typical running times for your analysis with Anglican, and what with PyMC? On Sunday, October 23, 2016 at 8:17:16 PM UTC+2, Boris V. Schmid wrote: > > I am using Anglican for estimating parameters of

Re: Slides for my talk at EuroClojure 2016

2016-10-23 Thread Boris V. Schmid
I am using Anglican for estimating parameters of epidemiological models, generally in the shape of limited (mortality) data, and less than a dozen parameters that need to be simultaneously estimated. Works fine for that. A good example of that type of problem is here:

Re: conditional support for spec in libraries

2016-10-23 Thread Lei
graphql-clj library tries to support both Clojure 1.9 and 1.8. The way it does: Library use Clojure 1.9 as dependency. For project uses Clojure 1.8 and depends on graphql-clj, it has a few options: 1. Don't use the namespace with clojure.spec or 2. Add

Re: Slides for my talk at EuroClojure 2016

2016-10-23 Thread Dragan Djuric
Thanks. I know about Anglican, but it is not even in the same category, other than being Bayesian. Anglican also has MCMC, but, looking at the implementation, it seems it is useful only on smaller problems with straightforward and low-dimensional basic distributions, or discrete

conditional support for spec in libraries

2016-10-23 Thread Charles Loomis
The only discussion I’ve seen about providing conditional support for spec in libraries is in the old thread started by Sean Corfield for the JDBC library: https://groups.google.com/d/msg/clojure-dev/4VAlKZxiN94/tNQo_4yABAAJ Is the technique described there, the recommended best practice? Or

Re: Slides for my talk at EuroClojure 2016

2016-10-23 Thread Boris V. Schmid
Thanks Dragan. Interesting slides, and interesting section on Bayadera. Incanter, as far as I know indeed doesn't support MCMC, but there is a fairly large project based on clojure that does a lot of bayesian inference. Just in case you haven't run into it:

Re: Java like static typing for Clojure?

2016-10-23 Thread Timothy Baldridge
>> but I might end up needing users with e.g. genuine Norwegian addresses. I think that's an interesting point, and it's a problem I've encountered several times myself. However I think it can be solved several ways. 1) If your validation function "norwegian-addr?" is a simple predicate, then

need help on `pprint/write` code with better readability

2016-10-23 Thread Jiyin Yiyong
I'm using `write` function to generate code very heavily. But small part of the code are hard to read. So I digged into the options and increased `right-margin` to make it a little better. Here's the changes: https://github.com/Cirru/sepal.clj/commit/e65e2d3cac8a5c5537716acd12cc475712ab6f66

Re: Java like static typing for Clojure?

2016-10-23 Thread Erik Assum
Colin, I think the points you bring up here are very interesting, and reflect ideas that I have not yet been able to formulate. I certainly would think there is enough "stuff" in here for a talk, and also some ideas into how to grnerative test "bread and butter" code, as can I, and if so,