# Error in defining the function

**URL:** <https://discourse.julialang.org/t/error-in-defining-the-function/58540>\
**Category:** New to Julia\
**Created:** [April 4, 2021, 12:20am UTC](https://discourse.julialang.org/t/error-in-defining-the-function/58540 "2021-04-04T00:20:27Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![bertulli](https://avatars.discourse-cdn.com/v4/letter/b/ecc23a/32.png) [@bertulli](https://discourse.julialang.org/u/bertulli)\
**Post date:** [March 11, 2026, 12:57pm UTC](https://discourse.julialang.org/t/error-in-defining-the-function/58540/3 "2026-03-11T12:57:29Z")

</div>

For completeness, checking out [this other answer](https://discourse.julialang.org/t/why-can-i-not-add-methods-to-a-function-with-a-value/40819/4) you can redefine methods of global functions if you use the fully qualified name, i.e. prepending the name of the module:

```julia-auto
julia> f = 1
1

julia> f(x) = x
ERROR: cannot define function f; it already has a value
Stacktrace:
 [1] top-level scope
   @ REPL[233]:1

julia> Main.f(x) = x
# no prob!

```

---

_[View the full topic](https://discourse.julialang.org/t/error-in-defining-the-function/58540)._
