From 442eb1ca005911816e5dfe1dde495fbb573286bf Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Sun, 18 Nov 2007 19:10:03 -0500 Subject: [PATCH] * Kind of fixes bug 163219: Better error message for expand. --- scheme/psyntax.expander.ss | 11 ++++++++++- scheme/todo-r6rs.ss | 17 ++++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/scheme/psyntax.expander.ss b/scheme/psyntax.expander.ss index a6edbef..d4c1460 100644 --- a/scheme/psyntax.expander.ss +++ b/scheme/psyntax.expander.ss @@ -2369,7 +2369,16 @@ (stx-error e "identifier out of context")) ((syntax) (stx-error e "reference to pattern variable outside a syntax form")) ((define define-syntax module import library) - (stx-error e "invalid expression")) + (stx-error e + (string-append + (case type + ((define) "a definition") + ((define-syntax) "a define-syntax") + ((module) "a module definition") + ((library) "a library definition") + ((import) "an import declaration") + (else "a non-expression")) + " was found where an expression was expected"))) (else ;(error 'chi-expr "invalid type " type (strip e '())) (stx-error e "invalid expression")))))) diff --git a/scheme/todo-r6rs.ss b/scheme/todo-r6rs.ss index 18d99d6..9cf07a8 100755 --- a/scheme/todo-r6rs.ss +++ b/scheme/todo-r6rs.ss @@ -917,11 +917,18 @@ (library-info (car x)))) library-names) (printf "Status Codes:\n") - (for-each - (lambda (x) - (printf " ~a ~a (~s ids)\n" (car x) (cadr x) - (count-status (car x)))) - status-names)] + (let* ([s* (map + (lambda (x) + (count-status (car x))) + status-names)] + [all (apply + s*)]) + (for-each + (lambda (x s) + (printf " ~a ~a (~s ids == ~s%)\n" + (car x) (cadr x) + s + (/ (round (* (/ s all) 10000)) 100.0))) + status-names s*))] [else (let-values ([(s* l*) (split