From 146c9247eddf2b601a7e9e71c472912f5a7faf61 Mon Sep 17 00:00:00 2001 From: Teddy Date: Fri, 9 Aug 2013 19:34:13 +0800 Subject: str_to_lower should only apply to Symbols --- robust_test.scm | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'robust_test.scm') diff --git a/robust_test.scm b/robust_test.scm index 0e989b8..7b7bfd4 100644 --- a/robust_test.scm +++ b/robust_test.scm @@ -172,3 +172,49 @@ t src (eval src) (eval '(g 0)) + +(define f (lambda (x) (+ x x))) ;; test comments +((lambda (x y) (f 3)) 1 2) ;; first-class procedure +; this is a single line comment +; another line +(define f (lambda (x) (lambda (y) (+ x y)))) + +(f 1) ; # + +((f 1) 2) ; 3 + +(define g (lambda (x) (define y 2) (+ x y))) +(g 3) + +((lambda () (display 2) (display 1) (+ 1 2))) +(define g (lambda (x) (if (= x 5) 0 ((lambda () (display x) (g (+ x 1))))))) +(g 0) + +(define g (lambda (x) + (if (= x 5) + 0 + ((lambda () + (display x) + (g (+ x 1))))))) +(g 0) + +(define square (lambda (x) (* x x))) + +(square 2) + +(define (f x y) + ((lambda (a b) + (+ (* x (square a)) + (* y b) + (* a b))) + (+ 1 (* x y )) + (- 1 y))) + +(f 1 2) + +((lambda (x + y) (+ x y)) 4 / 2) ; a classic trick + +(if #t 1 ()) +(if #f 1 ()) ; Error +; "Test double quotes in comments" +(display " Test double quotes outside the comments ; ;; ; ; ") -- cgit v1.2.3