# Behavior of Base.maximum

**URL:** <https://discourse.julialang.org/t/behavior-of-base-maximum/30961>\
**Category:** New to Julia\
**Created:** [November 11, 2019, 4:00pm UTC](https://discourse.julialang.org/t/behavior-of-base-maximum/30961 "2019-11-11T16:00:30Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![robsmith11](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/robsmith11/32/29641_2.png) [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Post date:** [November 11, 2019, 4:28pm UTC](https://discourse.julialang.org/t/behavior-of-base-maximum/30961/5 "2019-11-11T16:28:25Z")

</div>

As @ExpandingMan said, a solution is to use anonymous functions. See here and the linked issue for more details:

> [@Local function redefinition: feature or bug?](https://discourse.julialang.org/t/local-function-redefinition-feature-or-bug/10158):
>
> For the followed function, t() will output 12 in Julia0.4 and output 22 since Julia0.5. Is that a feature or bug? Anyway, it looks strange to output 22 and cause a hard bug after I upgrade my some old Julia code from 0.4 to 0.6. function t() f()=1 print(f()) f()=2 print(f()) end

---

_[View the full topic](https://discourse.julialang.org/t/behavior-of-base-maximum/30961)._
