Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
--- /dev/null
+#!/usr/bin/env newlisp
+
+(println "Hello World!")
+
+(println '(println "Hello World!"))
+
+(println (eval (quote (println "Hello World!"))))
+
+(if true (println "Hello") (println "Goodbye"))
+
+(set 'hello "Hello")
+(set 'world " World!")
+
+(println hello world)
+
+(println hello)
+(println world)
+
+(println (eval 'z))
+
+(set 'y 'x)
+(set y 1)
+(println "x="x)
+(println "y="y)
+
+(setq y 1)
+(println "y="y)
+
+(define y 2)
+(println "y="y)
+
+(set 'x 1 'y 2)
+(println "x="x)
+(println "y="y)
+
+(setq x 3 y 4)
+(println "x="x)
+(println "y="y)
+
+(println '((x 1) (y 2)))
+
+(println (first '(x 1)))
+(println (last '(x 1)))
+
+(println (first '((x 1) (y 2))))
+
+(println "assoc:")
+(println (assoc 'x '((x 1) (y 2) (x 3))))
+(println "lookup:")
+(println (lookup 'x '((x 1) (y 2) (x 3))))
+
+(exit)
--- /dev/null
+#!/usr/bin/env newlisp
+
+(setq L '(1 2 3))
+(println (first L)) ; le premier élément
+(println (rest L)) ; la liste privée du premier élément
+(println (last L)) ; le dernier élément
+
+(println (rest '(1)))
+(println (rest '()))
+; return an error: empty list
+;(println (first '()))
+;(println (last '()))
+
+(define (list-length a-list)
+ (if a-list
+ (+ 1 (list-length (rest a-list)))
+ 0))
+
+(println (list-length L))
+
+(exit)