aboutsummaryrefslogtreecommitdiffstats
path: root/test/simple.scm
diff options
context:
space:
mode:
Diffstat (limited to 'test/simple.scm')
-rw-r--r--test/simple.scm48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/simple.scm b/test/simple.scm
new file mode 100644
index 0000000..41babb5
--- /dev/null
+++ b/test/simple.scm
@@ -0,0 +1,48 @@
+
+; This comment should be skipped
+
+(begin
+ (display #t)
+ (newline))
+
+; anonymous lambda
+(define add1 (lambda (x) (+ 1 x)))
+(display (eq? (add1 4) 5))
+(newline)
+
+; named/defined lambda, spread over multiple lines
+(define
+ add1
+ (lambda
+ (x)
+ (+ 1 x)))
+(display (eq? (add1 4) 5))
+(newline)
+
+; this checks that cond is a special form
+(define fact (lambda (n) (if (<= n 1) 1 (* n (fact (- n 1))))))
+(display (eq? 479001600 (fact 12)))
+(newline)
+
+(display (eq? (add1 (car (cons 4 (cons 0 ())))) 5))
+(newline)
+
+(car (car (quote (lambda (x) (+ 1 x)))))
+
+(define dummy-var 5)
+(set! dummy-var 6)
+(display (eq? dummy-var 6))
+(newline)
+
+(display (string? "short string with spaces"))
+(newline)
+
+(display (pair? (cons 1 (cons 2 ()))))
+(newline)
+
+(display (symbol? 'lambda))
+(newline)
+
+(display (procedure? add1))
+(newline)
+