This PR simplifies @agent and @role and introduces @with_def, which will convert any struct with defaults (ABC::Int = 0) to an interpretable syntax with defaults in a default arg and kwargs constructor.
The core difference between @with_def and @kwdef is, that @kwdef will introduce a keyword parameter for every field in the default constructor, while @with_def only uses keyword arguments if a default value has been given.
@with_def struct ABC
has_default::Bool = false
no_default::Bool
end
This PR simplifies
@agent
and@role
and introduces@with_def
, which will convert any struct with defaults (ABC::Int = 0) to an interpretable syntax with defaults in a default arg and kwargs constructor.The core difference between
@with_def
and@kwdef
is, that@kwdef
will introduce a keyword parameter for every field in the default constructor, while@with_def
only uses keyword arguments if a default value has been given.will create the constructor