From: Chris Hanson Date: Wed, 16 Aug 1989 01:06:14 +0000 (+0000) Subject: For #@ -- if the object referred to is SCode, quote it so that X-Git-Tag: 20090517-FFI~11821 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=954a51d5af5a65845879c38f69a22b24c32a96ea;p=mit-scheme.git For #@ -- if the object referred to is SCode, quote it so that evaluating the result of the parse produces the object. --- diff --git a/v7/src/runtime/parse.scm b/v7/src/runtime/parse.scm index 2681ffe50..a380567fa 100644 --- a/v7/src/runtime/parse.scm +++ b/v7/src/runtime/parse.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/parse.scm,v 14.7 1989/04/18 16:29:45 cph Rel $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/parse.scm,v 14.8 1989/08/16 01:06:14 cph Exp $ Copyright (c) 1988, 1989 Massachusetts Institute of Technology @@ -482,10 +482,18 @@ MIT in each case. |# (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 + (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)) + ;; This may seem a little random, because #@N doesn't just + ;; return an object. However, the motivation for this piece of + ;; syntax is convenience -- and 99.99% of the time the result of + ;; this syntax will be evaluated, and the user will expect the + ;; result of the evaluation to be the object she was referring + ;; to. If the quotation isn't there, the user just gets + ;; confused. + (if (scode-constant? object) + object + (make-quotation object))))) \ No newline at end of file