From: Chris Hanson Date: Tue, 16 Dec 1986 06:25:33 +0000 (+0000) Subject: Add new operation to extract the set of undefined names. X-Git-Tag: 20090517-FFI~13811 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=2dce671bcd659d52e749f5961ff431664cd8d99c;p=mit-scheme.git Add new operation to extract the set of undefined names. --- diff --git a/v7/src/compiler/back/symtab.scm b/v7/src/compiler/back/symtab.scm index f7a8a8414..357e612bc 100644 --- a/v7/src/compiler/back/symtab.scm +++ b/v7/src/compiler/back/symtab.scm @@ -37,6 +37,8 @@ ;;;; Symbol Tables +;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/back/symtab.scm,v 1.37 1986/12/16 06:25:33 cph Exp $ + (declare (usual-integrations)) (define (make-symbol-table) @@ -52,7 +54,7 @@ (let ((entry (assq key (cdr table)))) (if entry (cdr entry) - (let ((nothing (vector #!FALSE '()))) + (let ((nothing (vector #F '()))) (set-cdr! table (cons (cons key nothing) (cdr table))) nothing)))) @@ -61,7 +63,13 @@ (or (and entry (vector-ref (cdr entry) 0)) (error "SYMBOL-TABLE-VALUE: Undefined key" key)))) -(define (binding-value binding) +(define (symbol-table-undefined-names table) + (let loop ((entries (cdr table))) + (cond ((null? entries) '()) + ((binding-value (cdr (car entries))) (loop (cdr entries))) + (else (cons (car (car entries)) (loop (cdr entries))))))) + +(define-integrable (binding-value binding) (vector-ref binding 0)) (define (set-binding-value! binding value)