# World Age Problem Explanation

**URL:** https://discourse.julialang.org/t/world-age-problem-explanation/9714
**Category:** General Usage
**Tags:** world\_age
**Created:** [March 14, 2018, 12:33pm UTC](https://discourse.julialang.org/t/world-age-problem-explanation/9714 "2018-03-14T12:33:07Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [March 15, 2018, 11:29am UTC](https://discourse.julialang.org/t/world-age-problem-explanation/9714/4 "2018-03-15T11:29:03Z")

</div>

The reason for worlds is because of optimizations. If functions can be defined (and redefined) at arbitrary points (and instantly take effect), then that would limit the possible optimizations that can be made. Therefore, new functions are only made visible to the system (become usable) after hitting toplevel. If you try to call a new function before this, then you get a world error.

In some cases (like if you are writing a REPL), you do actually want to call your newly defined function without hitting toplevel. This can be done by using `Base.invokelatest(f, args...)` but it will of course prevent certain optimizations in the scope where `f` is called (it can pretty much not be reasoned about at all, so no inlining or inference).

---

_[View the full topic](https://discourse.julialang.org/t/world-age-problem-explanation/9714)._
