# \#multidispatch

**URL:** https://discourse.julialang.org/tag/multidispatch/674.md?match_all_tags=true&page=1&tags%5B%5D=multidispatch

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 2

---

## [Shouldn't this throw an error?](https://discourse.julialang.org/t/shouldnt-this-throw-an-error/68898)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 2\
**Last updated:** [September 29, 2021, 11:13am UTC](https://discourse.julialang.org/t/shouldnt-this-throw-an-error/68898 "2021-09-29T11:13:34Z")

</div>

I have inadvertently made this mistake: F(x, f::F) where F = f(x) julia\> F(0.5, sin) ERROR: MethodError: no method matching F(::Float64, ::typeof(sin)) Shouldn’t the first line throw and error or are there cases where…

---

## [(Not) Giving up on dispatch](https://discourse.julialang.org/t/not-giving-up-on-dispatch/66797)

<div class="topic-metadata">

**Author:** [@Bardo](https://discourse.julialang.org/u/Bardo)\
**Replies:** 23\
**Last updated:** [August 30, 2021, 12:05pm UTC](https://discourse.julialang.org/t/not-giving-up-on-dispatch/66797 "2021-08-30T12:05:47Z")

</div>

In another post, I got the comment …the code you’ve posted here was not one of the recommended ways of doing … Reason is, I could not reasonably put all conditions into regular dispatch (functions with the same name …

---

## [Omitting type parameters on dispatch: accepted or implementation detail?](https://discourse.julialang.org/t/omitting-type-parameters-on-dispatch-accepted-or-implementation-detail/65552)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 2\
**Last updated:** [July 30, 2021, 2:31pm UTC](https://discourse.julialang.org/t/omitting-type-parameters-on-dispatch-accepted-or-implementation-detail/65552 "2021-07-30T14:31:30Z")

</div>

I am unsure if omitting additional type parameters on dispatch is an accepted and stable language behavior, or if it should be avoided, meaning doing things like this: julia\> using StaticArrays julia\> f(x::SVector{3}) …

---

## [For Julia programmers who also work with Rust: When you write in Rust, do you miss Julia's multiple dispatch, or are there features of Rust that make up for that loss?](https://discourse.julialang.org/t/for-julia-programmers-who-also-work-with-rust-when-you-write-in-rust-do-you-miss-julias-multiple-dispatch-or-are-there-features-of-rust-that-make-up-for-that-loss/61959)

<div class="topic-metadata">

**Author:** [@anon71627001](https://discourse.julialang.org/u/anon71627001)\
**Replies:** 4\
**Last updated:** [May 28, 2021, 6:28am UTC](https://discourse.julialang.org/t/for-julia-programmers-who-also-work-with-rust-when-you-write-in-rust-do-you-miss-julias-multiple-dispatch-or-are-there-features-of-rust-that-make-up-for-that-loss/61959 "2021-05-28T06:28:58Z")

</div>

Sorry if this is too off-topic, I’ll delete it if so.

---

## [Revisiting Rock, Paper, Scissors](https://discourse.julialang.org/t/revisiting-rock-paper-scissors/60347)

<div class="topic-metadata">

**Author:** [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Replies:** 5\
**Last updated:** [May 1, 2021, 12:22am UTC](https://discourse.julialang.org/t/revisiting-rock-paper-scissors/60347 "2021-05-01T00:22:31Z")

</div>

In 2017 @giordano (with 2019 @Mason update) wrote about implementing Rock, Paper, Scissors. Using v1.7 or v1.6, can we do this any better (more: elegantly, performantly, type-stable, gamelike)? Are there new (or better…

---

## [Unitful dispatch](https://discourse.julialang.org/t/unitful-dispatch/49480)

<div class="topic-metadata">

**Author:** [@KajWiik](https://discourse.julialang.org/u/KajWiik)\
**Replies:** 13\
**Last updated:** [November 3, 2020, 11:41am UTC](https://discourse.julialang.org/t/unitful-dispatch/49480 "2020-11-03T11:41:50Z")

</div>

Why this works: julia\> function hz(x::typeof(1.0u"Hz")) 2x end hz (generic function with 1 method) and this does not work: julia\> typeof(1.0u"Hz") Quantity{Float64,𝐓^-1,Unitful.FreeUnits{(Hz,),𝐓^-1,nothi…

---

## [Multiple dispatch on StructArrays](https://discourse.julialang.org/t/multiple-dispatch-on-structarrays/43810)

<div class="topic-metadata">

**Author:** [@ozmaden](https://discourse.julialang.org/u/ozmaden)\
**Replies:** 7\
**Last updated:** [July 28, 2020, 7:15pm UTC](https://discourse.julialang.org/t/multiple-dispatch-on-structarrays/43810 "2020-07-28T19:15:21Z")

</div>

Hi everyone. I am working with the StructArrays.jl package and trying to program a function to react differently for different types of arrays inside of a StructArray. Specifically I want to differentiate between Array …

---

## [Is multiple dispatch the same as function overloading?](https://discourse.julialang.org/t/is-multiple-dispatch-the-same-as-function-overloading/4145)

<div class="topic-metadata">

**Author:** [@Varun\_Varghese](https://discourse.julialang.org/u/Varun_Varghese)\
**Replies:** 19\
**Last updated:** [May 25, 2020, 9:04pm UTC](https://discourse.julialang.org/t/is-multiple-dispatch-the-same-as-function-overloading/4145 "2020-05-25T21:04:33Z")

</div>

Isn’t multiple dispatch the same as function overloading?

---

## [Trying to understand optimization via multiple dispatch and type stability](https://discourse.julialang.org/t/trying-to-understand-optimization-via-multiple-dispatch-and-type-stability/31991)

<div class="topic-metadata">

**Author:** [@Benny](https://discourse.julialang.org/u/Benny)\
**Replies:** 5\
**Last updated:** [December 8, 2019, 5:28am UTC](https://discourse.julialang.org/t/trying-to-understand-optimization-via-multiple-dispatch-and-type-stability/31991 "2019-12-08T05:28:16Z")

</div>

(Word of warning, I’m not well-versed in programming in general and have only used Python for simple tasks, so it would be helpful for me if even simple concepts are explained with some detail.) I’m interested in trying…

---

## [Classes in Julia](https://discourse.julialang.org/t/classes-in-julia/24521)

<div class="topic-metadata">

**Author:** [@kirui](https://discourse.julialang.org/u/kirui)\
**Replies:** 12\
**Last updated:** [May 23, 2019, 5:23pm UTC](https://discourse.julialang.org/t/classes-in-julia/24521 "2019-05-23T17:23:09Z")

</div>

How do we create classes in Julia that involves the init part in Python?

[Previous page](https://discourse.julialang.org/tag/multidispatch/674.md?match_all_tags=true&tags%5B%5D=multidispatch)
