diff options
author | Teddy <[email protected]> | 2013-08-09 19:34:13 +0800 |
---|---|---|
committer | Teddy <[email protected]> | 2013-08-09 19:34:13 +0800 |
commit | 146c9247eddf2b601a7e9e71c472912f5a7faf61 (patch) | |
tree | d891dfbb8bfb23145f1f887fdb5bec3747d6252e /robust_test.scm | |
parent | f5f03fddd700419905d58b75ad1d02c053c684bb (diff) |
str_to_lower should only apply to Symbols
Diffstat (limited to 'robust_test.scm')
-rw-r--r-- | robust_test.scm | 46 |
1 files changed, 46 insertions, 0 deletions
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) ; #<procedure> + +((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 ; ;; ; ; ") |