# How does REPL helpmode work?

**URL:** <https://discourse.julialang.org/t/how-does-repl-helpmode-work/28244>\
**Category:** Internals & Design\
**Created:** [August 31, 2019, 6:34pm UTC](https://discourse.julialang.org/t/how-does-repl-helpmode-work/28244 "2019-08-31T18:34:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tgf314](https://avatars.discourse-cdn.com/v4/letter/t/7c8e57/32.png) [@tgf314](https://discourse.julialang.org/u/tgf314)\
**Post date:** [August 31, 2019, 6:34pm UTC](https://discourse.julialang.org/t/how-does-repl-helpmode-work/28244/1 "2019-08-31T18:34:07Z")

</div>

If I type the following:

```julia
using REPL
REPL._helpmode( "push!" )

```

I get the following output:

`:(#= /home/flynn/projects/julia/julia-1.1/usr/share/julia/stdlib/v1.1/REPL/src/docview.jl:40 =# (REPL).@repl Base.TTY(RawFD(0x0000000d) open, 0 bytes waiting) push!)`

If I call eval on this expression I get the formatted documentation for the push! function.

Can someone explain how this magic happens ? I see nothing in the above expression that looks like it’s extracting the docs from push!

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [August 31, 2019, 6:50pm UTC](https://discourse.julialang.org/t/how-does-repl-helpmode-work/28244/2 "2019-08-31T18:50:28Z")

</div>

`_helpmode` returns an [expression](https://github.com/JuliaLang/julia/blob/8f575c5d5a7f575930eace90d261970801707a8d/stdlib/REPL/src/docview.jl#L40) that calls [`@repl`](https://github.com/JuliaLang/julia/blob/8f575c5d5a7f575930eace90d261970801707a8d/stdlib/REPL/src/docview.jl#L275), which in turn calls [`repl`](https://github.com/JuliaLang/julia/blob/8f575c5d5a7f575930eace90d261970801707a8d/stdlib/REPL/src/docview.jl#L281), which, in the end, searches for the docs of your input string.

To follow those dispatch fiestas you can either use a debugger or just `@which` every function.

---

<div class="post-metadata">

**Author:** ![miguelraz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/miguelraz/32/631_2.png) [@miguelraz](https://discourse.julialang.org/u/miguelraz)\
**Post date:** [August 31, 2019, 11:26pm UTC](https://discourse.julialang.org/t/how-does-repl-helpmode-work/28244/3 "2019-08-31T23:26:30Z")

</div>

“Dispatch fiestas” 🤣🤣🤣
