Tea (programming language)


Tea is a scripting language for the Java environment invented by Jorge Nunes in 1997. It combines the features of Java, Scheme and Tcl .

Features

Tea is a functional programming language that integrates functions as objects .

Examples

A square function:

Define square ( x ) { * $ x $ x }
echo [ square 4 ]

A list :

Define list ( 1 2 3 "four" "five" )

A circle object:

Class Circle (
 _rayon
 _centre_x
 _centre_y
)
Method Circle Surface () {
 * 3.1416 $ _rayon $ _rayon
}
Method Circle constructor ( r x y ) {
 set! _rayon $ r
 set! _centre_x $ x
 Set! _centre_y $ y
}
Define c1 [ new Circle 7 0 0 ]
define c2 [ new circle 10 1 1 ]
Echo "Area c1:" [ $ c1 Surface ]