From: Chris Hanson Date: Wed, 21 Mar 2001 19:25:42 +0000 (+0000) Subject: Change many references of SYMBOL->STRING to use SYMBOL-NAME instead. X-Git-Tag: 20090517-FFI~2876 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=2c6735acc9bd448c885c8d4b3e1ade560254c8db;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/edwin/abbrev.scm b/v7/src/edwin/abbrev.scm index 0d4239728..dcd6a0a5c 100644 --- a/v7/src/edwin/abbrev.scm +++ b/v7/src/edwin/abbrev.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: abbrev.scm,v 1.5 2000/07/28 15:15:29 cph Exp $ +;;; $Id: abbrev.scm,v 1.6 2001/03/21 19:25:10 cph Exp $ ;;; -;;; Copyright (c) 2000 Massachusetts Institute of Technology +;;; Copyright (c) 2000-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 @@ -16,7 +16,8 @@ ;;; ;;; 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. ;;;; Abbrev Mode @@ -78,7 +79,7 @@ (let ((abbrev (string-downcase (cond ((string? abbrev) abbrev) - ((symbol? abbrev) (symbol->string abbrev)) + ((symbol? abbrev) (symbol-name abbrev)) (else (error:wrong-type-argument abbrev "string" 'ABBREV-EXPANSION)))))) @@ -472,7 +473,7 @@ Mark is set after the inserted text." (lambda (name) (let ((table (get-named-abbrev-table name))) (insert-string "(" mark) - (insert-string (symbol->string name) mark) + (insert-string (symbol-name name) mark) (insert-string ")\n\n" mark) (hash-table/for-each table (lambda (abbrev entry) diff --git a/v7/src/edwin/autold.scm b/v7/src/edwin/autold.scm index 6b77f7c43..32c7d9947 100644 --- a/v7/src/edwin/autold.scm +++ b/v7/src/edwin/autold.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;;$Id: autold.scm,v 1.56 2000/04/30 22:16:58 cph Exp $ +;;;$Id: autold.scm,v 1.57 2001/03/21 19:25:13 cph Exp $ ;;; -;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology +;;; Copyright (c) 1986, 1989-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 @@ -16,7 +16,8 @@ ;;; ;;; 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. ;;;; Autoloads for Edwin @@ -158,7 +159,7 @@ Second arg is prefix arg when called interactively." (list (prompt-for-alist-value "Load library" (map (lambda (library) - (cons (symbol->string (car library)) + (cons (symbol-name (car library)) (car library))) known-libraries)) (command-argument))) diff --git a/v7/src/edwin/comman.scm b/v7/src/edwin/comman.scm index 4bdea0a3a..6933f8f89 100644 --- a/v7/src/edwin/comman.scm +++ b/v7/src/edwin/comman.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: comman.scm,v 1.84 2000/06/15 00:43:40 cph Exp $ +$Id: comman.scm,v 1.85 2001/03/21 19:25:16 cph Exp $ -Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology +Copyright (c) 1986, 1989-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. |# ;;;; Commands and Variables @@ -38,14 +39,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (let ((desc (command-%description command))) (if (description? desc) desc - (let ((new - (->doc-string (symbol->string (command-name command)) desc))) + (let ((new (->doc-string (symbol-name (command-name command)) desc))) (if new (set-command-%description! command new)) new)))) (define (command-name-string command) - (editor-name/internal->external (symbol->string (command-name command)))) + (editor-name/internal->external (symbol-name (command-name command)))) (define (editor-name/internal->external string) string) @@ -54,7 +54,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. string) (define (make-command name description specification procedure) - (let* ((sname (symbol->string name)) + (let* ((sname (symbol-name name)) (command (or (string-table-get editor-commands sname) (let ((command (%make-command))) @@ -71,7 +71,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (define (name->command name #!optional if-undefined) (let ((name (canonicalize-name name))) - (or (string-table-get editor-commands (symbol->string name)) + (or (string-table-get editor-commands (symbol-name name)) (case (if (default-object? if-undefined) 'INTERN if-undefined) ((#F) #f) ((ERROR) (error "Undefined command:" name)) @@ -117,8 +117,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (let ((desc (variable-%description variable))) (if (description? desc) desc - (let ((new - (->doc-string (symbol->string (variable-name variable)) desc))) + (let ((new (->doc-string (symbol-name (variable-name variable)) desc))) (if new (set-variable-%description! variable new)) new)))) @@ -129,10 +128,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. set-variable-value-validity-test!) (define (variable-name-string variable) - (editor-name/internal->external (symbol->string (variable-name variable)))) + (editor-name/internal->external (symbol-name (variable-name variable)))) (define (make-variable name description value buffer-local?) - (let* ((sname (symbol->string name)) + (let* ((sname (symbol-name name)) (variable (or (string-table-get editor-variables sname) (let ((variable (%make-variable))) @@ -177,7 +176,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (define (name->variable name #!optional if-undefined) (let ((name (canonicalize-name name))) - (or (string-table-get editor-variables (symbol->string name)) + (or (string-table-get editor-variables (symbol-name name)) (case (if (default-object? if-undefined) 'INTERN if-undefined) ((#F) #f) ((ERROR) (error "Undefined variable:" name)) diff --git a/v7/src/edwin/comtab.scm b/v7/src/edwin/comtab.scm index ea9b7b695..e2fbe3062 100644 --- a/v7/src/edwin/comtab.scm +++ b/v7/src/edwin/comtab.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: comtab.scm,v 1.71 2001/01/06 05:45:42 cph Exp $ +;;; $Id: comtab.scm,v 1.72 2001/03/21 19:25:19 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-2001 Massachusetts Institute of Technology ;;; @@ -16,7 +16,8 @@ ;;; ;;; 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. ;;;; Command Tables @@ -120,7 +121,7 @@ (define (mode-name? object) (and (symbol? object) - (string-table-get editor-modes (symbol->string object)))) + (string-table-get editor-modes (symbol-name object)))) (define (list-of-comtabs? object) (and (not (null? object)) diff --git a/v7/src/edwin/debug.scm b/v7/src/edwin/debug.scm index b26603062..c8662ee13 100644 --- a/v7/src/edwin/debug.scm +++ b/v7/src/edwin/debug.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: debug.scm,v 1.55 2000/12/01 06:18:32 cph Exp $ +;;; $Id: debug.scm,v 1.56 2001/03/21 19:25:22 cph Exp $ ;;; -;;; Copyright (c) 1992-2000 Massachusetts Institute of Technology +;;; Copyright (c) 1992-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 @@ -16,7 +16,8 @@ ;;; ;;; 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. ;;;; Browser-style Debug and Where ;;; Package: (edwin debugger) @@ -1651,13 +1652,7 @@ once it has been renamed, it will not be deleted automatically.") #t))))))) (else (write-string " BINDINGS:" port) - (finish - (if package - (sort names - (lambda (x y) - (stringstring x) - (symbol->string y)))) - names))))) + (finish (if package (sort names symbolstring x) - (symbol->string y)))))) + (names4 (sort names3 symbolstring name)) + (let ((sname (symbol-name name)) (major? (if major? #t #f)) (super-comtabs (if super-mode (mode-comtabs super-mode) '()))) (let ((mode (string-table-get editor-modes sname)) @@ -75,7 +76,7 @@ (define (name->mode object #!optional if-undefined) (let ((name (canonicalize-name object))) - (let ((sname (symbol->string name))) + (let ((sname (symbol-name name))) (or (string-table-get editor-modes sname) (case (if (default-object? if-undefined) 'INTERN if-undefined) ((#F) #f) @@ -107,7 +108,7 @@ (let ((desc (mode-%description mode))) (if (description? desc) desc - (let ((new (->doc-string (symbol->string (mode-name mode)) desc))) + (let ((new (->doc-string (symbol-name (mode-name mode)) desc))) (if new (set-mode-%description! mode new)) new)))) diff --git a/v7/src/edwin/modlin.scm b/v7/src/edwin/modlin.scm index 3ae62a673..5737fce63 100644 --- a/v7/src/edwin/modlin.scm +++ b/v7/src/edwin/modlin.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: modlin.scm,v 1.22 2000/03/23 03:19:14 cph Exp $ +;;; $Id: modlin.scm,v 1.23 2001/03/21 19:25:27 cph Exp $ ;;; -;;; Copyright (c) 1989-2000 Massachusetts Institute of Technology +;;; Copyright (c) 1989-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 @@ -16,7 +16,8 @@ ;;; ;;; 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. ;;;; Modeline Format ;;; package: (edwin mode-line-format) @@ -270,7 +271,7 @@ If #F, the normal method is used." ((#\s) (let ((process (get-buffer-process buffer))) (if process - (symbol->string (process-status process)) + (symbol-name (process-status process)) "no process"))) ((#\p) (let ((group (buffer-group buffer))) diff --git a/v7/src/edwin/process.scm b/v7/src/edwin/process.scm index 523d02c9e..16a701629 100644 --- a/v7/src/edwin/process.scm +++ b/v7/src/edwin/process.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: process.scm,v 1.58 2000/10/26 02:28:19 cph Exp $ +;;; $Id: process.scm,v 1.59 2001/03/21 19:25:30 cph Exp $ ;;; -;;; Copyright (c) 1991-2000 Massachusetts Institute of Technology +;;; Copyright (c) 1991-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 @@ -16,7 +16,8 @@ ;;; ;;; 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. ;;;; Subprocess Support ;; package: (edwin process) @@ -522,7 +523,7 @@ after the listing is made.)" (let ((process (car processes))) (write-line (or (process-name process) "") (let ((status (process-status process))) - (let ((name (symbol->string status))) + (let ((name (symbol-name status))) (if (or (eq? 'EXIT status) (eq? 'SIGNAL status)) (let ((reason (process-exit-reason process))) diff --git a/v7/src/edwin/rmail.scm b/v7/src/edwin/rmail.scm index 186850795..560926d9d 100644 --- a/v7/src/edwin/rmail.scm +++ b/v7/src/edwin/rmail.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: rmail.scm,v 1.71 2000/06/08 17:58:26 cph Exp $ +;;; $Id: rmail.scm,v 1.72 2001/03/21 19:25:34 cph Exp $ ;;; -;;; Copyright (c) 1991-2000 Massachusetts Institute of Technology +;;; Copyright (c) 1991-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 @@ -16,7 +16,8 @@ ;;; ;;; 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. ;;;; RMAIL Mail Reader @@ -927,7 +928,7 @@ and reverse search is specified by a negative numeric arg." (number->string (msg-memo/number (msg-memo/last memo))) (append-map! (lambda (label) (list "," label)) - (append! (map symbol->string (msg-memo/attributes memo)) + (append! (map symbol-name (msg-memo/attributes memo)) (parse-labels (msg-memo/start memo)))))))) ;;;; Message deletion @@ -1761,7 +1762,7 @@ Completion is performed over known labels when reading." rmail-last-label (alist->string-table (map list - (append! (map symbol->string attributes) + (append! (map symbol-name attributes) (buffer-keywords (current-buffer))))) 'REQUIRE-MATCH? require-match?))) (set! rmail-last-label label) @@ -1819,7 +1820,7 @@ Completion is performed over known labels when reading." (update-mode-line! (mark-buffer start)))))))) (define (attribute->string attribute) - (string-append " " (string-downcase (symbol->string attribute)) ",")) + (string-append " " (string-downcase (symbol-name attribute)) ",")) (define (label->attribute label) (let ((s (intern-soft label))) diff --git a/v7/src/edwin/schmod.scm b/v7/src/edwin/schmod.scm index 3f3a1ac43..4d2617095 100644 --- a/v7/src/edwin/schmod.scm +++ b/v7/src/edwin/schmod.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: schmod.scm,v 1.48 2001/03/15 21:14:58 cph Exp $ +;;; $Id: schmod.scm,v 1.49 2001/03/21 19:25:37 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-2001 Massachusetts Institute of Technology ;;; @@ -309,13 +309,13 @@ Otherwise, it is shown in the echo area." (cond ((pair? argl) (insert-char #\space point) (insert-string (if (symbol? (car argl)) - (symbol->string (car argl)) + (symbol-name (car argl)) (write-to-string (car argl))) point) (loop (cdr argl))) ((symbol? argl) (insert-string " . " point) - (insert-string (symbol->string argl) point))))) + (insert-string (symbol-name argl) point))))) (fluid-let ((*unparse-uninterned-symbols-by-name?* #t)) (message argl)))) (editor-error "Expression does not evaluate to a procedure: " diff --git a/v7/src/edwin/sendmail.scm b/v7/src/edwin/sendmail.scm index 47189bee8..24bbb57c1 100644 --- a/v7/src/edwin/sendmail.scm +++ b/v7/src/edwin/sendmail.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: sendmail.scm,v 1.74 2001/03/16 21:54:27 cph Exp $ +;;; $Id: sendmail.scm,v 1.75 2001/03/21 19:25:40 cph Exp $ ;;; ;;; Copyright (c) 1991-2001 Massachusetts Institute of Technology ;;; @@ -1166,9 +1166,9 @@ the user from the mailer." (subtype (mime-attachment-subtype attachment))) (write-message-header-field "Content-Type" - (string-append (symbol->string type) + (string-append (symbol-name type) "/" - (symbol->string subtype) + (symbol-name subtype) (mime-parameters->string (mime-attachment-parameters attachment))) port) @@ -1288,14 +1288,14 @@ the user from the mailer." (decorated-string-append "; " "" "" (map (lambda (parameter) - (string-append (symbol->string (car parameter)) + (string-append (symbol-name (car parameter)) "=\"" (cadr parameter) "\"")) parameters))) (define (mime-disposition->string disposition) - (string-append (symbol->string (car disposition)) + (string-append (symbol-name (car disposition)) (mime-parameters->string (cdr disposition)))) (define (guarantee-mime-compliant-headers h-start h-end) @@ -1411,9 +1411,9 @@ You can add and delete attachments from that buffer." (let ((start (mark-right-inserting-copy mark)) (type (mime-attachment-type attachment)) (subtype (mime-attachment-subtype attachment))) - (insert-string-pad-right (string-append (symbol->string type) + (insert-string-pad-right (string-append (symbol-name type) "/" - (symbol->string subtype)) + (symbol-name subtype)) 30 #\space mark) (if (not (and (eq? type 'MESSAGE) (eq? subtype 'RFC822))) (begin diff --git a/v7/src/edwin/xterm.scm b/v7/src/edwin/xterm.scm index 462ad655a..6d7f5cce3 100644 --- a/v7/src/edwin/xterm.scm +++ b/v7/src/edwin/xterm.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: xterm.scm,v 1.65 2000/12/01 06:16:53 cph Exp $ +;;; $Id: xterm.scm,v 1.66 2001/03/21 19:25:42 cph Exp $ ;;; -;;; Copyright (c) 1989-2000 Massachusetts Institute of Technology +;;; Copyright (c) 1989-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 @@ -16,7 +16,8 @@ ;;; ;;; 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. ;;;; X Terminal ;;; Package: (edwin x-screen) @@ -829,7 +830,7 @@ (or (hash-table/get table name #f) (let ((atom (x-intern-atom display - (string-upcase (symbol->string name)) + (string-upcase (symbol-name name)) soft?))) (if (not (= atom 0)) (hash-table/put! table name atom))