Checkout my package: https://github.com/mauro3/Parameters.jl. Maybe of
use.

On Wed, 2016-11-16 at 13:18, FANG Colin <colinf...@gmail.com> wrote:
> Say, I have a few constants
>
> const VTYPE_BINARY = 'B'
> const VTYPE_INTEGER = 'I'
> const VTYPE_CONTINUOUS = 'C'
>
> What's a good way to have a namespace on it?
>
> So that I can use Vtype.BINARY, Vtype.INTEGER, Vtype.CONTINUOUS
>
> Should I put those in a separator module? or create a type and get an
> instance of it?
>
> module Vtype
>     const ....
> end
>
> immutable Vtype
>     BINARY::Char
>     INTEGER::Char
>     CONTINUOUS::Char
> end
>
> const vtype = Vtype('B','I','C')?

Reply via email to