A Venice REPL (Read-Eval-Print Loop), is an interactive programming environment that takes user inputs (lines of code), executes them, and returns the result to the user. This process allows for real-time feedback and is great for learning, testing code snippets, and debugging.
Install Venice and the REPL following the Getting started guide.
Open a terminal and run the REPL start script.
on MacOSX and Linux (e.g.: Venice installed to /Users/foo/venice
):
foo% /Users/foo/venice/repl.sh
on Windows (e.g.: Venice installed to C:\Users\foo\venice
):
foo> C:\Users\foo\venice\repl.bat
Type an expression like (+ 1 1)
followed by a <CR>
venice> (+ 1 1)
=> 2
venice>
The REPL supports multi-line editing:
venice> (defn sum [x y]
(+ x y))
venice> (sum 1 4)
=> 5
venice>
Type !
from the REPL to get the help. Browse through the history expressions
with the up/down arrows.
A history of the last three result values is kept by the REPL, accessible through
the Venice symbols *1
, *2
, *3
, **
.
If the REPL colors don't harmonize well with your terminal color schema
omit the '-colors' option or place a 'repl.json' config file with customized
ANSI escape code colors on the working dir. The REPL command !config
shows
a sample 'repl.json' that can be modified.
The documentation for a function can be printed from the REPL:
venice> (doc map)
venice> (doc +)
To learn more about the REPL see Advanced REPL