# DigitSet still useful?

**URL:** <https://discourse.julialang.org/t/digitset-still-useful/38901>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [May 6, 2020, 5:27pm UTC](https://discourse.julialang.org/t/digitset-still-useful/38901 "2020-05-06T17:27:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rougem](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rougem/32/14635_2.png) [@Rougem](https://discourse.julialang.org/u/Rougem)\
**Post date:** [May 6, 2020, 5:27pm UTC](https://discourse.julialang.org/t/digitset-still-useful/38901/1 "2020-05-06T17:27:21Z")

</div>

Hi All,  
As a newbie, here comes my second question. StepIn the youtube video by [Stefan Karpinski (Keynote): Julia for Data Analysis and Beyond](https://www.youtube.com/embed/DRKKAFYM9yo?list=TLPQMDUwNTIwMjCiAWrPzFZyVw). He shows the use of **DigitSet** but when I searched for it in help it states that it does not exist. Am I missing something? The video is from 2018 so it might have been changed. If so what do we use now?

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![xzackli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xzackli/32/38301_2.png) [@xzackli](https://discourse.julialang.org/u/xzackli)\
**Post date:** [May 6, 2020, 5:43pm UTC](https://discourse.julialang.org/t/digitset-still-useful/38901/2 "2020-05-06T17:43:10Z")

</div>

It looks like the DigitSet struct is a custom type defined within the example Stefan is presenting. It’s not intrinsic to Julia – to solve problems with Julia, you often create a custom type to describe your data. The syntax has changed since 2018 though, now to create an immutable struct you would write

```julia
struct DigitSet
    d::Int16
end
```

---

<div class="post-metadata">

**Author:** ![Rougem](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rougem/32/14635_2.png) [@Rougem](https://discourse.julialang.org/u/Rougem)\
**Post date:** [May 6, 2020, 5:44pm UTC](https://discourse.julialang.org/t/digitset-still-useful/38901/3 "2020-05-06T17:44:13Z")

</div>

Thank you! This explains the error I get.

---

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [May 6, 2020, 5:44pm UTC](https://discourse.julialang.org/t/digitset-still-useful/38901/4 "2020-05-06T17:44:32Z")

</div>

That video is quite old, but the `DigitSet` that’s coded up there is just a toy example of how easy it is to add optimized data representations and behaviors. As a slightly more concrete (and fun) example, check out [Cards.jl](https://github.com/StefanKarpinski/Cards.jl/).
