@@ -604,11 +604,13 @@ end
604604 @specset [option option=val ...] default_args... for v in (...) ... end
605605 @specset [option option=val ...] default_args... for v in (...), w in (...) ... end
606606
607- Construct a vector of [`StatsSpec`](@ref) with shared default values for arguments
607+ Construct a vector of [`StatsSpec`](@ref)s with shared default values for arguments
608608and then conduct the procedures by calling [`proceed`](@ref).
609+ The vector of [`StatsSpec`](@ref)s and a vector of result objects are returned,
610+ unless alternative behavior is specified with the `option`s.
609611
610612# Arguments
611- - `[option option=val ...]`: optional settings for @specset including keyword arguments for [`proceed`](@ref).
613+ - `[option option=val ...]`: optional settings for ` @specset` including keyword arguments for [`proceed`](@ref).
612614- `default_args...`: optional default values for arguments shared by all [`StatsSpec`](@ref)s.
613615- `code block`: a `begin/end` block or a `for` loop containing arguments for constructing [`StatsSpec`](@ref)s.
614616
@@ -634,7 +636,7 @@ For options that take a Boolean value,
634636specifying the name of the option is enough for setting the value to be true.
635637
636638The following options are available for altering the behavior of `@specset`:
637- - `noproceed::Bool=false`: do not call [`proceed`](@ref) and return the vector of [`StatsSpec`](@ref).
639+ - `noproceed::Bool=false`: do not call [`proceed`](@ref) and only return the vector of [`StatsSpec`](@ref).
638640- `verbose::Bool=false`: print the name of each step when it is called.
639641- `keep=nothing`: names (of type `Symbol`) of additional objects to be returned.
640642- `keepall::Bool=false`: return all objects generated by procedures along with arguments from the [`StatsSpec`](@ref)s.
@@ -683,6 +685,8 @@ macro specset(args...)
683685 for i in 1 : nspec
684686 sps[i] = StatsSpec ($ (esc (formatter))(merge ($ defaults, $ args_set[i])). .. )
685687 end
688+ # The same args_set will be reused if exectuted again without recalling the macro
689+ empty! ($ args_set)
686690 end
687691
688692 if noproceed
@@ -693,7 +697,7 @@ macro specset(args...)
693697 else
694698 return quote
695699 $ blk
696- proceed (sps; $ options... )
700+ sps, proceed (sps; $ options... )
697701 end
698702 end
699703end
0 commit comments