Add #@ to read back hashed objects.
authorGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Fri, 10 Feb 1989 22:13:50 +0000 (22:13 +0000)
committerGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Fri, 10 Feb 1989 22:13:50 +0000 (22:13 +0000)
v7/src/runtime/parse.scm

index a7f20699cef7e51addea20cba406a04d386cb5a7..37dd0b38f18adeb67a7b0cc7bf67aee3d343c5af 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/parse.scm,v 14.5 1988/10/15 17:19:10 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/parse.scm,v 14.6 1989/02/10 22:13:50 jinx Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -129,7 +129,8 @@ MIT in each case. |#
                ("#\\" ,parse-object/char-quote)
                (("#f" "#F") ,parse-object/false)
                (("#t" "#T") ,parse-object/true)
-               ("#!" ,parse-object/named-constant)))
+               ("#!" ,parse-object/named-constant)
+               ("#@" ,parse-object/unhash)))
     table))
 \f
 ;;;; Top Level
@@ -476,4 +477,15 @@ MIT in each case. |#
     (cdr (or (assq object-name named-objects)
             (parse-error "No object by this name" object-name)))))
 
-(define named-objects)
\ No newline at end of file
+(define named-objects)
+
+(define (parse-object/unhash)
+  (discard-char)
+  (let ((number (parse-object/dispatch)))
+    (if (not (integer? number))        (parse-error "Invalid unhash syntax" number)
+       (let ((object (object-unhash number)))
+         ;; This knows that 0 is the hash of #f.
+         (if (and (false? object) (not (zero? number)))
+             (parse-error "Invalid hash number" number)
+             ;; (list 'QUOTE object)
+             object)))))
\ No newline at end of file