Next: , Previous: , Up: Tutorial   [Contents]


2.8 Scheme code

The prompt is a Scheme interpreter and can execute arbitrary code. The only difference is that the outer expression should not be enclosed in parenthesis. For example,

(Checking) :> begin (display (+ 1 2)) (display "\n")
3
(Checking) :>

Leas provides a useful function p for displaying expressions and then adding a newline like the above,

(Checking) :> p (+ 1 2)
3
(Checking) :>

In interactive functions, the prompt for the various arguments allows Scheme expressions as well. For example, you can enter the value of a transaction as (- 15.29 13.99) or (* 0.08 123) (for calculating a tax, for example).