# Cannot find overloaded method

**URL:** <https://discourse.julialang.org/t/cannot-find-overloaded-method/48633>\
**Category:** General Usage\
**Created:** [October 19, 2020, 2:36pm UTC](https://discourse.julialang.org/t/cannot-find-overloaded-method/48633 "2020-10-19T14:36:18Z")\
**Posts on this page:** 1\
**Showing post:** 20

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [October 19, 2020, 7:31pm UTC](https://discourse.julialang.org/t/cannot-find-overloaded-method/48633/20 "2020-10-19T19:31:55Z")

</div>

> [@Henrique\_Becker](#):
>
> The generalized one is the _simultaneous application_ , because both _one pass each_ and the _exhaustion for all_ may be defined in 1~5 lines using repeated application of the _simultaneous application_ , on the other hand, if _simultaneous application_ is needed and any of the others is implemented, then _simultaneous application_ has to be implemented basically from scratch, because the other two are not useful for defining it.

No, precisely the case when two replacements would apply (e.g. `replace("aabb", "aa" => "c", "aabb" => "d")`) is ambigous. There is no “simultaneous application” where both replacements are done at the same time. The order matters, and as such you have to choose. There is no quantum superposition of resulting states.

> [@Henrique\_Becker](#):
>
> I said nothing about throwing exceptions.

I was referring to [one of your comments in the thread you linked](https://discourse.julialang.org/t/perform-multiple-replacements-on-a-string-in-a-single-pass/43247/4).

> [@Henrique\_Becker](#):
>
> I have to agree the behaviour may not be obvious to everyone, because otherwise I would be assuming bad faith from you, but I also do not think anyone should just pass multiple replacements and do not query the documentation if they have some doubt about what could happen.

I’m certainly not arguing in “bad faith” here, I’ve just come to a different conclusion based on personal preference. No solution is arguably better than any other here, and as such it should be left to the user to decide how they want this to behave on Strings in their particular case. (As an aside, my personal preference would be that people wrap strings and define `replace` however they want on their own type. This would also help enforce the invariants that are often expected of things that look like strings but often aren’t, like e.g. filepaths are).

> [@Henrique\_Becker](#):
>
> I am almost sure other implementations of multiple replacements in other languages work simultaneously, I will need to check this another time.

Please do! I’d be interested as well, especially in their reasoning for choosing one implementation over another or how users responded to their implementation. 🙂

---

_[View the full topic](https://discourse.julialang.org/t/cannot-find-overloaded-method/48633)._
