(in-package :user)

(defun hello ()
  (write-string "Hello, World!")
)


;;;;;;;;;;;;;;;;;;;;;;;;;    Infix,  examples


(+  2 3)

(* 5 6)

(> 5 1)

(> 1 5)



;;;;;;;;;;;;;;;;;;;;;;;;;    Basic datatypes

(- 10 9)

(concatenate 'string "abc" "xyz")

'hello


;;;;;;;;;;;;;;;;;;;;;;;;;    Variables


(setq a 5)

(+ a 6)

(setq b (+ a 7))


;;;;;;;;;;;;;;;;;;;;;;;;;    Lists

(setq x (list 2 4 6 8))

(length x)

(first x)

(second x)

(last x)

(subseq x 0 3)

(append x '(10))

(append x nil)

(listp x)

(listp 5)

(member 4 x)

(member 3 x)


;;;;;;;;;;;;;;;;;;;;;;;;;    More complex function


(defun add (x)
  (let ((y 3) (z 6))
    (if (< x 100)
	(+ x y)
      (+ x z) )
    ) )

(add 10)

(add 110)



;;;;;;;;;;;;;;;;;;;;;;;;;    Loop

(setq f (loop
         for i from 1 to 10
         collect i))

(loop 
 for i in f
 collect (+ i 5))



;;;;;;;;;;;;;;;;;;;;;;;;;    Debugger



