From e461f4374fc3597cca4244079343a15c5e4ed4ba Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Sun, 25 Nov 2007 16:23:39 -0500 Subject: [PATCH] Made #!eof invalid in #!r6rs mode. --- scheme/ikarus.hash-tables.ss | 35 ++++++++++++++++++----------------- scheme/ikarus.reader.ss | 2 ++ scheme/last-revision | 2 +- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/scheme/ikarus.hash-tables.ss b/scheme/ikarus.hash-tables.ss index b8b3590..18ae537 100644 --- a/scheme/ikarus.hash-tables.ss +++ b/scheme/ikarus.hash-tables.ss @@ -116,23 +116,6 @@ (void)))))))) - (define unlink! - (lambda (h b) - (let ([vec (hasht-vec h)] - [next ($tcbucket-next b)]) - ;;; first remove it from its old place - (let ([idx - (if (fixnum? next) - next - (get-bucket-index next))]) - (let ([fst ($vector-ref vec idx)]) - (cond - [(eq? fst b) - ($vector-set! vec idx next)] - [else - (replace! fst b next)]))) - ;;; set next to be #f, denoting, not in table - ($set-tcbucket-next! b #f)))) (define (get-bucket h x) (let ([pv (pointer-value x)] @@ -153,10 +136,28 @@ (and (get-bucket h x) #t)) (define (del-hash h x) + (define unlink! + (lambda (h b) + (let ([vec (hasht-vec h)] + [next ($tcbucket-next b)]) + ;;; first remove it from its old place + (let ([idx + (if (fixnum? next) + next + (get-bucket-index next))]) + (let ([fst ($vector-ref vec idx)]) + (cond + [(eq? fst b) + ($vector-set! vec idx next)] + [else + (replace! fst b next)]))) + ;;; set next to be #f, denoting, not in table + ($set-tcbucket-next! b #f)))) (cond [(get-bucket h x) => (lambda (b) (unlink! h b) + ;;; don't forget the count. (set-hasht-count! h (- (hasht-count h) 1)))])) (define put-hash! diff --git a/scheme/ikarus.reader.ss b/scheme/ikarus.reader.ss index 70764d6..ba09c0e 100644 --- a/scheme/ikarus.reader.ss +++ b/scheme/ikarus.reader.ss @@ -357,6 +357,8 @@ (error 'tokenize "invalid eof near #!")) (case e [(#\e) + (when (eq? (port-mode p) 'r6rs-mode) + (error 'tokenize "invalid syntax: #!e")) (read-char* p '(#\e) "of" "eof sequence" #f #f) (cons 'datum (eof-object))] [(#\r) diff --git a/scheme/last-revision b/scheme/last-revision index 3ff08f7..6f2c5fa 100644 --- a/scheme/last-revision +++ b/scheme/last-revision @@ -1 +1 @@ -1128 +1129