# Must the return value of a function be printed on the last line of the REPL? (when called without a \`;\`)

**URL:** https://discourse.julialang.org/t/must-the-return-value-of-a-function-be-printed-on-the-last-line-of-the-repl-when-called-without-a/108867
**Category:** General Usage
**Tags:** question, repl
**Created:** [January 16, 2024, 12:54pm UTC](https://discourse.julialang.org/t/must-the-return-value-of-a-function-be-printed-on-the-last-line-of-the-repl-when-called-without-a/108867 "2024-01-16T12:54:25Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)
#### Post date: [January 17, 2024, 4:04am UTC](https://discourse.julialang.org/t/must-the-return-value-of-a-function-be-printed-on-the-last-line-of-the-repl-when-called-without-a/108867/8 "2024-01-17T04:04:06Z")

</div>

I found what I really want to realize has been asked in another previous post by myself:

> [@How to let a function return some numerical values and a graph simutaneously?](https://discourse.julialang.org/t/how-to-let-a-function-return-some-numerical-values-and-a-graph-simutaneously/103101):
>
> For example: using UnicodePlots function func(n) r = randn(n) s = sum(r) hist = histogram(r, nbins=10, closed=:left) r, s, hist end If I call this function in the REPL, it returns: julia\> func(10) ([1.5369990699727945, -0.7353913882824294, -0.8568141947726255, 1.145149668937184, 0.3340140471550356, 1.2364301576354533, 1.8932925331172032, 0.05768487009000112, -0.2116877502737839, 0.4638080551886433], 4.863485068767476, ┌ ┐…

In general, I just want a function to output the calculation procedure and then give some conclusive statements (such as displaying the result as a graph), but also the user can easily obtain the result of the function (such as through the most conventional assignment statement).

In fact, I seem to have used some Julia functions (such as some functions for machine learning or optimization) that do have similar effects. 🤔

---

_[View the full topic](https://discourse.julialang.org/t/must-the-return-value-of-a-function-be-printed-on-the-last-line-of-the-repl-when-called-without-a/108867)._
