From f9eed671331a813aaad3006da20135ce1be5cead Mon Sep 17 00:00:00 2001 From: Joe Marshall Date: Thu, 26 Jan 2012 17:01:58 -0800 Subject: [PATCH] Unparse assignments, definitions, and lambdas with their respective names. --- src/runtime/unpars.scm | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/runtime/unpars.scm b/src/runtime/unpars.scm index 7c6bf1d56..2188c5eed 100644 --- a/src/runtime/unpars.scm +++ b/src/runtime/unpars.scm @@ -75,15 +75,18 @@ USA. (let ((table (make-unparser-table unparse/default))) (for-each (lambda (entry) (unparser-table/set-entry! table (car entry) (cadr entry))) - `((BIGNUM ,unparse/number) + `((ASSIGNMENT ,unparse/assignment) + (BIGNUM ,unparse/number) (CHARACTER ,unparse/character) (COMPILED-ENTRY ,unparse/compiled-entry) (COMPLEX ,unparse/number) (CONSTANT ,unparse/constant) + (DEFINITION ,unparse/definition) (ENTITY ,unparse/entity) (EXTENDED-PROCEDURE ,unparse/compound-procedure) (FLONUM ,unparse/flonum) (INTERNED-SYMBOL ,unparse/interned-symbol) + (LAMBDA ,unparse/lambda) (LIST ,unparse/pair) (NEGATIVE-FIXNUM ,unparse/number) (FALSE ,unparse/false) @@ -671,6 +674,21 @@ USA. ;;;; Miscellaneous +(define (unparse/assignment assignment) + (*unparse-with-brackets 'ASSIGNMENT assignment + (lambda () + (*unparse-object (assignment-name assignment))))) + +(define (unparse/definition definition) + (*unparse-with-brackets 'DEFINITION definition + (lambda () + (*unparse-object (definition-name definition))))) + +(define (unparse/lambda lambda-object) + (*unparse-with-brackets 'LAMBDA lambda-object + (lambda () + (*unparse-object (lambda-name lambda-object))))) + (define (unparse/variable variable) (*unparse-with-brackets 'VARIABLE variable (lambda () -- 2.25.1