# Creating custom type of enumerations of symbols

**URL:** https://discourse.julialang.org/t/creating-custom-type-of-enumerations-of-symbols/18635
**Category:** New to Julia
**Tags:** structtypes
**Created:** [December 13, 2018, 5:05pm UTC](https://discourse.julialang.org/t/creating-custom-type-of-enumerations-of-symbols/18635 "2018-12-13T17:05:21Z")
**Posts on this page:** 2
**Page:** 2

<div class="post-metadata">

### Author: ![Mark\_Nahabedian](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mark_nahabedian/32/16562_2.png) [@Mark\_Nahabedian](https://discourse.julialang.org/u/Mark_Nahabedian)
#### Post date: [November 19, 2021, 8:38pm UTC](https://discourse.julialang.org/t/creating-custom-type-of-enumerations-of-symbols/18635/21 "2021-11-19T20:38:34Z")

</div>

I don’t think this has been suggestedin this thread.

When I wanted an enumerated type I used singleton types with a common supertype:

```julia
abstract type DrawingMode end
struct Outline <: DrawingMode end
struct Fill<: DrawingMode end

function circle(something, ::Fill)
    ...
end

circle(stuff, Fill())

```

---

<div class="post-metadata">

### Author: ![CameronBieganek](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cameronbieganek/32/6915_2.png) [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)
#### Post date: [November 20, 2021, 12:42am UTC](https://discourse.julialang.org/t/creating-custom-type-of-enumerations-of-symbols/18635/22 "2021-11-20T00:42:34Z")

</div>

Yes, that’s the canonical way of doing this. Too bad nobody suggested it when OP made their post in 2018. 🙂

[Previous page](https://discourse.julialang.org/t/creating-custom-type-of-enumerations-of-symbols/18635.md?page=1)
