From d63676b79430cac0b54bf50de5564a533866f9e2 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Thu, 12 Feb 2009 13:46:00 -0500 Subject: typo correction --- ps01_grep/ps01_bnewbold.txt | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'ps01_grep/ps01_bnewbold.txt') diff --git a/ps01_grep/ps01_bnewbold.txt b/ps01_grep/ps01_bnewbold.txt index 52979e7..8968157 100644 --- a/ps01_grep/ps01_bnewbold.txt +++ b/ps01_grep/ps01_bnewbold.txt @@ -174,7 +174,7 @@ c) (not, uh, fully tested...) (let ((choose-grep (lambda (x) (cond ((string? x) x) - ((list? x) (car x)))))) + ((list? x) ((car x))))))) (apply string-append (map choose-grep exprs)))) (r-grep:seq "a" "b" '("grep" "egrep")) @@ -184,7 +184,7 @@ c) (not, uh, fully tested...) (let ((choose-egrep (lambda (x) (cond ((string? x) x) - ((list? x) (cadr x)))))) + ((list? x) ((cadr x))))))) (apply string-append (map choose-egrep exprs)))) #| test: @@ -340,6 +340,20 @@ c) (not, uh, fully tested...) (r:grep-like "grep" '("-E") ((cadr expr)) filename) (r:grep-like "egrep" '() ((cadr expr)) filename))) +#| final tests: +(r:seq (r:repeat 2 3 (r:quote "cat")) (r:+ (r:quote "dog"))) +;Value: (#[compound-procedure 18] #[compound-procedure 19]) +((car (r:seq (r:repeat 2 3 (r:quote "cat")) (r:+ (r:quote "dog"))))) +;Value: "\\(cat\\)\\{2,3\\}\\(dog\\)\\{1,\\}" +((cadr (r:seq (r:repeat 2 3 (r:quote "cat")) (r:+ (r:quote "dog"))))) +;Value: "(cat){2,3}(dog){1,}" + (pp (r:grep (r:seq (r:repeat 2 3 (r:quote "cat")) (r:+ (r:quote "dog"))) "tests.txt")) +; ("[10]. catcatdogdog" "[12]. catcatcatdogdogdog") +(pp (r:egrep (r:seq (r:repeat 2 3 (r:quote "cat")) (r:+ (r:quote "dog"))) + "tests.txt")) +; ("[10]. catcatdogdog" "[12]. catcatcatdogdogdog") + +|# -- cgit v1.2.3