JuliaStats/Distributions.jl — pull request #312 by lindahua (2014-11-17 09:41:59+00:00)
Title: Unify the specification of distribution supports

This PR introduces a new macro ``distr_support``, which works for almost all univariate distributions that specify the support of the distribution. For example,

```julia
@distr_support Normal -Inf Inf
@distr_support Uniform d.a d.b
@distr_support Geometric 0 Inf
```

This macro can be used for various cases, no matter whether the support is bounded or not, or whether the support can be determined at the class-level or at the instance-level.

This macro will generate the following methods:
- ``insupport``
- ``support``, which returns a ``UnitRange`` instance for bounded discrete distribution or ``RealInterval`` for continuous distribution
- ``maximum``
- ``minimum``
- ``islowerbounded``
- ``isupperbounded``
- ``isbounded``

So that one need not to rewrite these boilerplates when implementing a new distribution.

This macro has been successfully applied to all univariate distributions provided in the package.