From: Chris Hanson Date: Wed, 21 Mar 2001 19:15:29 +0000 (+0000) Subject: Change many references of SYMBOL->STRING to use SYMBOL-NAME instead. X-Git-Tag: 20090517-FFI~2877 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=8aa779745a940abbcbf5a6882aae1f81b13c462d;p=mit-scheme.git Change many references of SYMBOL->STRING to use SYMBOL-NAME instead. These are all situations where copying the returned string is unnecessary and wasteful. --- diff --git a/v7/src/runtime/dbgutl.scm b/v7/src/runtime/dbgutl.scm index d2db37d25..eb8a8fdda 100644 --- a/v7/src/runtime/dbgutl.scm +++ b/v7/src/runtime/dbgutl.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: dbgutl.scm,v 14.18 2001/03/21 05:39:39 cph Exp $ +$Id: dbgutl.scm,v 14.19 2001/03/21 19:15:04 cph Exp $ Copyright (c) 1988-2001 Massachusetts Institute of Technology @@ -54,7 +54,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA (cond ((string? name) (write-string (string-upcase name))) ((interned-symbol? name) - (write-string (string-upcase (symbol->string name)) port)) + (write-string (string-upcase (symbol-name name)) port)) (else (write name port)))) diff --git a/v7/src/runtime/gensym.scm b/v7/src/runtime/gensym.scm index 71e6ec203..2902fd67b 100644 --- a/v7/src/runtime/gensym.scm +++ b/v7/src/runtime/gensym.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: gensym.scm,v 14.5 1999/01/02 06:11:34 cph Exp $ +$Id: gensym.scm,v 14.6 2001/03/21 19:15:07 cph Exp $ -Copyright (c) 1988-1999 Massachusetts Institute of Technology +Copyright (c) 1988-2001 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,7 +16,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. |# ;;;; Symbol Generation @@ -31,7 +32,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ((string? argument) argument) ((symbol? argument) - (symbol->string argument)) + (symbol-name argument)) ((exact-nonnegative-integer? argument) (set! name-counter argument) name-prefix) diff --git a/v7/src/runtime/infstr.scm b/v7/src/runtime/infstr.scm index 74b779303..199790570 100644 --- a/v7/src/runtime/infstr.scm +++ b/v7/src/runtime/infstr.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: infstr.scm,v 1.9 1999/01/02 06:06:43 cph Exp $ +$Id: infstr.scm,v 1.10 2001/03/21 19:15:10 cph Exp $ -Copyright (c) 1988-1999 Massachusetts Institute of Technology +Copyright (c) 1988-2001 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,7 +16,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. |# ;;;; Compiled Code Information: Structures @@ -156,7 +157,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. `(DEFINE-INTEGRABLE ,symbol ',((ucode-primitive string->symbol) (string-append "#[(runtime compiler-info)" - (string-downcase (symbol->string symbol)) + (string-downcase (symbol-name symbol)) "]"))))))) ;; Various names used in `layout' to identify things that wouldn't ;; otherwise have names. diff --git a/v7/src/runtime/infutl.scm b/v7/src/runtime/infutl.scm index 5a86640ea..da06e31d1 100644 --- a/v7/src/runtime/infutl.scm +++ b/v7/src/runtime/infutl.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: infutl.scm,v 1.63 2001/03/21 05:39:44 cph Exp $ +$Id: infutl.scm,v 1.64 2001/03/21 19:15:12 cph Exp $ Copyright (c) 1988-2001 Massachusetts Institute of Technology @@ -370,7 +370,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA (and procedure (let ((name (dbg-procedure/name procedure))) (or (special-form-procedure-name? name) - (symbol->string name)))))) + (symbol-name name)))))) (define load-debugging-info-on-demand? #f) @@ -378,7 +378,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA (define (special-form-procedure-name? name) (let ((association (assq name special-form-procedure-names))) (and association - (symbol->string (cdr association))))) + (symbol-name (cdr association))))) (define special-form-procedure-names) diff --git a/v7/src/runtime/pp.scm b/v7/src/runtime/pp.scm index b20965548..135fbe3ac 100644 --- a/v7/src/runtime/pp.scm +++ b/v7/src/runtime/pp.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: pp.scm,v 14.40 1999/12/22 20:29:26 cph Exp $ +$Id: pp.scm,v 14.41 2001/03/21 19:15:16 cph Exp $ -Copyright (c) 1988-1999 Massachusetts Institute of Technology +Copyright (c) 1988-2001 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,7 +16,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. |# ;;;; Pretty Printer @@ -1113,14 +1114,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;;; or the print-name of a symbol wasn't worth the speed that would ;;; be gained by keeping it around. -(define-integrable (%symbol->string symbol) - (system-pair-car symbol)) - (define-integrable (symbol-length symbol) - (string-length (%symbol->string symbol))) + (string-length (symbol-name symbol))) (define-integrable (*unparse-symbol symbol) - (*unparse-string (%symbol->string symbol))) + (*unparse-string (symbol-name symbol))) (define-structure (prefix-node (conc-name prefix-node-) diff --git a/v7/src/runtime/syntax.scm b/v7/src/runtime/syntax.scm index 00964fcdd..508229e94 100644 --- a/v7/src/runtime/syntax.scm +++ b/v7/src/runtime/syntax.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: syntax.scm,v 14.32 1999/10/23 02:46:46 cph Exp $ +$Id: syntax.scm,v 14.33 2001/03/21 19:15:18 cph Exp $ -Copyright (c) 1988-1999 Massachusetts Institute of Technology +Copyright (c) 1988-2001 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,7 +16,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. |# ;;;; SYNTAX: S-Expressions -> SCODE @@ -227,7 +228,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (cons (string-append "SYNTAX: " (if *current-keyword* - (string-append (symbol->string *current-keyword*) + (string-append (symbol-name *current-keyword*) ": " message) message)) diff --git a/v7/src/runtime/uerror.scm b/v7/src/runtime/uerror.scm index 298b63afe..b776caedb 100644 --- a/v7/src/runtime/uerror.scm +++ b/v7/src/runtime/uerror.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: uerror.scm,v 14.46 2001/03/08 18:43:07 cph Exp $ +$Id: uerror.scm,v 14.47 2001/03/21 19:15:22 cph Exp $ Copyright (c) 1988-2001 Massachusetts Institute of Technology @@ -16,7 +16,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. |# ;;;; Microcode Errors @@ -308,7 +309,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (and code ((ucode-primitive system-call-error-message 1) code))) (if (symbol? error-type) - (string-replace (symbol->string error-type) #\- #\space) + (string-replace (symbol-name error-type) #\- #\space) (string-append "error " (write-to-string error-type))))) (define (normalize-trap-code-name name) diff --git a/v7/src/runtime/unpars.scm b/v7/src/runtime/unpars.scm index dffd4fe7d..a2c2e760b 100644 --- a/v7/src/runtime/unpars.scm +++ b/v7/src/runtime/unpars.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: unpars.scm,v 14.46 1999/01/02 06:19:10 cph Exp $ +$Id: unpars.scm,v 14.47 2001/03/21 19:15:26 cph Exp $ -Copyright (c) 1988-1999 Massachusetts Institute of Technology +Copyright (c) 1988-2001 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,7 +16,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. |# ;;;; Unparser @@ -329,7 +330,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (*unparse-with-brackets 'UNINTERNED-SYMBOL symbol unparse-symbol)))) (define (unparse-symbol symbol) - (*unparse-string (symbol->string symbol))) + (*unparse-string (symbol-name symbol))) (define (unparse/character character) (if (or *slashify?* diff --git a/v7/src/runtime/unsyn.scm b/v7/src/runtime/unsyn.scm index 1f9d763e7..af838f5db 100644 --- a/v7/src/runtime/unsyn.scm +++ b/v7/src/runtime/unsyn.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: unsyn.scm,v 14.20 1999/01/02 06:19:10 cph Exp $ +$Id: unsyn.scm,v 14.21 2001/03/21 19:15:29 cph Exp $ -Copyright (c) 1988-1999 Massachusetts Institute of Technology +Copyright (c) 1988-2001 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,7 +16,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. |# ;;;; UNSYNTAX: SCode -> S-Expression @@ -106,7 +107,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (define (unsyntax-error keyword message . irritants) (apply error - (cons (string-append "UNSYNTAX: " (symbol->string keyword) ": " + (cons (string-append "UNSYNTAX: " (symbol-name keyword) ": " message) irritants)))