diff --git a/src/Builtins.jl b/src/Builtins.jl index 5344f538..61a7b900 100644 --- a/src/Builtins.jl +++ b/src/Builtins.jl @@ -598,6 +598,14 @@ begin f(0.5) ``` + + If a generator is given, it is automatically turned into a vector: + + ```julia + @bind f Select(i for i in 1:10) + # is equivalent to + @bind f Select([i for i in 1:10]) + ``` """ struct Select options::AbstractVector{Pair} @@ -609,6 +617,8 @@ begin Select(options::AbstractVector{<:Pair}; default=missing) = Select(options, default) + Select(options::Base.Generator; default=missing) = Select([options...]; default) + function Base.show(io::IO, m::MIME"text/html", select::Select)