###
Exact integers and fractions

Kawa has the usual syntax for decimal integers.
Addition, subtraction, and mutliplication
are written using the usual `+`

,
`-`

, and `*`

,
but these are all prefix functions that take a variable number of arguments:

(+ 1 2 3) ⇒ 6
(- 10 3 4) ⇒ (- (- 10 3) 4) ⇒ 3
(* 2 -6) ⇒ -12

Kawa has arbitrary-precision integers.

Let us implement the factorial function.
Type in the following (we'll look at the syntax shortly):

#|kawa:1|# (define (factorial x)
#|(---:2|# (if (< x 1) 1
#|(---:3|# (* x (factorial (- x 1)))))

(The prompt changes to indicate a continuation line.)
This binds the name `factorial`

to new function, with formal parameter `x`

.
This new function is immediately compiled to Java bytecodes,
and later a JIT compiler may compile it to native code.

A few tests:

#|kawa:4|# (list (factorial 3) (factorial 4))
(6 24)
#|kawa:5|# (factorial 30)
265252859812191058636308480000000