EasyConfig.jl
EasyConfig.Config
— TypeConfig(; kw...)
Config(::AbstractDict)
A wrapper around an OrderedDict{Symbol, Any}
with the special properties:
You can get/set items via
getproperty
/setproperty!
:c = Config() c.one = 1 c.one == 1
Properties that don't exist will be created on the fly:
c = Config() c.one.two.three = "neat!"
EasyConfig.@config
— Macro@config expr
Create a Config
with a NamedTuple-like or block syntax. The following examples create equivalent Config
s:
@config (x.one=1, x.two=2, z=3)
@config x.one=1 x.two=2 z=3
@config begin
x.one = 1
x.two = 2
z = 3
end
let
c = Config()
c.x.one = 1
c.x.two = 2
c.z = 3
end