The Julia read-evaluate-print loop (REPL) is an interactive command line for trying expressions and seeing results immediately. Start it by typing `julia` in a terminal, then enter an expression and press Enter. It is useful for experimentation, testing, and debugging without first writing a program. section 2.1 section 1.8
$ julia
_
_ _ _(_)_ | Documentation: https:/ /docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.6.0 (2021-03-24)
_/ |\__'_|_|_|\__'_| | Official https:/ /julialang.org/ release
|__/ |
julia> 2 + 3
5
The terminal launches Julia; at the `julia>` prompt, `2 + 3` evaluates to `5`. section 2.1
The prompt works as a calculator for more than arithmetic: try `sqrt(9)`, `sin(pi/2)`, or a function you have defined. As calculations grow, store them in functions and call them again from the REPL. section 2.1 section 2.5.2
A few shortcuts make interactive work easier:
- Type the start of a function name and press Tab to complete it; press Tab twice to see possible matches. section 2.5.2
- Type `\pi` and press Tab to enter `π`. Similar completions help write other Greek letters and Unicode characters. section 2.2
- Use Ctrl-C to interrupt some stuck code and Ctrl-D to exit Julia. section 2.2
Check a variable interactively
Enter `y = 7`, then `y + 2`; the second expression prints `9`. Reassigning an ordinary variable is possible, but redefining a `const` produces a warning, so avoid relying on that behavior. section 2.2





