Skip to content

Commit

Permalink
add docs for creating a symbol from an enum instance (JuliaLang#44342)
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC authored and LilithHafner committed Mar 8, 2022
1 parent 0eb8555 commit c322403
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions base/Enums.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ To list all the instances of an enum use `instances`, e.g.
julia> instances(Fruit)
(apple, orange, kiwi)
```
It is possible to construct a symbol from an enum instance:
```jldoctest fruitenum
julia> Symbol(apple)
:apple
```
"""
macro enum(T::Union{Symbol,Expr}, syms...)
if isempty(syms)
Expand Down

0 comments on commit c322403

Please sign in to comment.