# Multiple dispatch by String alias

**URL:** https://discourse.julialang.org/t/multiple-dispatch-by-string-alias/43400
**Category:** New to Julia
**Tags:** question, strings, type, dispatch
**Created:** [July 20, 2020, 7:57pm UTC](https://discourse.julialang.org/t/multiple-dispatch-by-string-alias/43400 "2020-07-20T19:57:07Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![AndiMD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andimd/32/6531_2.png) [@AndiMD](https://discourse.julialang.org/u/AndiMD)
#### Post date: [July 20, 2020, 10:33pm UTC](https://discourse.julialang.org/t/multiple-dispatch-by-string-alias/43400/5 "2020-07-20T22:33:11Z")

</div>

Possibly useful macro:

> [@Composition and inheritance: the Julian way](https://discourse.julialang.org/t/composition-and-inheritance-the-julian-way/11231/3):
>
> I’ve found the @forward macro from Lazy.jl quite useful for this purpose: [https://github.com/MikeInnes/Lazy.jl/blob/76dab7d30863e8375fc96b2444fdb2ead369bf4c/src/macros.jl#L248-L271](https://github.com/MikeInnes/Lazy.jl/blob/76dab7d30863e8375fc96b2444fdb2ead369bf4c/src/macros.jl#L248-L271) Essentially, you can define: struct Person name::String end name(p::Person) = person.name struct Citizen person::Person nationality::String end @forward Citizen.person name which will automatically make name(c::Citizen) = name(c.person)

---

_[View the full topic](https://discourse.julialang.org/t/multiple-dispatch-by-string-alias/43400)._
