Next: , Previous: , Up: Programming in Scheme   [Contents][Index]

4.4 Using Guile Interactively

When you start up Guile by typing just guile, without a -c argument or the name of a script to execute, you get an interactive interpreter where you can enter Scheme expressions, and Guile will evaluate them and print the results for you. Here are some simple examples.

[email protected](guile-user)> (+ 3 4 5)
$1 = 12
[email protected](guile-user)> (display "Hello world!\n")
Hello world!
[email protected](guile-user)> (values 'a 'b)
$2 = a
$3 = b

This mode of use is called a REPL, which is short for “Read-Eval-Print Loop”, because the Guile interpreter first reads the expression that you have typed, then evaluates it, and then prints the result.

The prompt shows you what language and module you are in. In this case, the current language is scheme, and the current module is (guile-user). See Other Languages, for more information on Guile’s support for languages other than Scheme.