tour eevo
Hello World
Display hello world on the screen
; good programmers comment their code
println "Hello World"
Numbers
; numbers can be integers, decimals, or fractions
def x 12
def y 6
x + y ;=> 18
y - x ;=> -6
y / x ;=> 1/2
def z (x * (y - 3)) ;=> 36
z - 5.0 ;=> 31.0
z * 1/3 ;=> 12
Integers
5
1234
; scientific notation for integers
4e3 ;=> 4000
Decimals
0.3
3.14
.13
Fractions
1/3 ;=> 1/3
6/4 ;=> 3/2
4/2 ;=> 2
Booleans
True
False ;=> Nil
Nil
Variables
def x 4 ; integers
def pi-approx 3.14 ; decimals
def pi-better 22/7 ; ratios
def hello_world "hello world" ; strings
def func 'sum ; symbols
def active? True ; boolean
def a Nil ; nil, empty
def ages [23 47 12 59] ; lists
def prices [7.50 8 3.25 ... 10] ; improper lists
def people { bob: 23 alice: 47 } ; records
Source File
;;;; tour eevo
;;; Hello World
;; Display hello world on the screen
; good programmers comment their code
println "Hello World"
;;; Numbers
; numbers can be integers, decimals, or fractions
def x 12
def y 6
x + y ;=> 18
y - x ;=> -6
y / x ;=> 1/2
def z (x * (y - 3)) ;=> 36
z - 5.0 ;=> 31.0
z * 1/3 ;=> 12
;;; Integers
5
1234
; scientific notation for integers
4e3 ;=> 4000
;;; Decimals
0.3
3.14
.13
;;; Fractions
1/3 ;=> 1/3
6/4 ;=> 3/2
4/2 ;=> 2
;;; Booleans
True
False ;=> Nil
Nil
;;; Variables
def x 4 ; integers
def pi-approx 3.14 ; decimals
def pi-better 22/7 ; ratios
def hello_world "hello world" ; strings
def func 'sum ; symbols
def active? True ; boolean
def a Nil ; nil, empty
def ages [23 47 12 59] ; lists
def prices [7.50 8 3.25 ... 10] ; improper lists
def people { bob: 23 alice: 47 } ; records