Changeset 916


Ignore:
Timestamp:
Feb 16, 2005, 7:31:03 PM (17 years ago)
Author:
bryan
Message:

ccl::hash-pname loses when given a non-simple-string

find-all-symbols did no checking and didn't massage. added a
ccl::ensure-simple-string to both check and massage.

make-symbol checked that the arg was a 'simple-string using
#'require-type. replacing that with ccl::ensure-simple-string both
checks and massages.

ccl::pkg-arg (called by a bunch of symbol iterator macros) did check
that if the arg was a string, that it was a simple string. i rewrote
the initial if form as a cond that will call ccl::ensure-simple-string
if the arg is indeed a string.

also updated ccl::new-package-name.

Location:
trunk/ccl
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/level-0/l0-symbol.lisp

    r78 r916  
    165165(defun make-symbol (name)
    166166  (%gvector ppc32::subtag-symbol
    167                 (require-type name 'simple-string) ; pname
     167                (ensure-simple-string name) ; pname
    168168                (%unbound-marker)       ; value cell
    169169                %unbound-function%      ; function cell
  • trunk/ccl/level-0/nfasload.lisp

    r709 r916  
    205205
    206206(defun pkg-arg (thing &optional deleted-ok)
    207   (let* ((xthing (if (or (symbolp thing)
    208                          (typep thing 'character))
    209                    (string thing)
    210                    thing)))
     207  (let* ((xthing (cond ((or (symbolp thing) (typep thing 'character))
     208                        (string thing))
     209                       ((typep thing 'string)
     210                        (ensure-simple-string thing))
     211                       (t
     212                        thing))))
    211213    (let* ((typecode (typecode xthing)))
    212214        (declare (fixnum typecode))
  • trunk/ccl/level-1/l1-symhash.lisp

    r6 r916  
    126126(defun find-all-symbols (name)
    127127  (let* ((syms ())
    128          (pname (string name))
     128         (pname (ensure-simple-string (string name)))
    129129         (len (length pname)))
    130130    (with-package-list-read-lock
     
    197197(defun new-package-name (name &optional package)
    198198  (do* ((prompt "Enter package name to use instead of ~S ."))
    199        ((let* ((found (find-package (setq name (string name)))))
     199       ((let* ((found (find-package (setq name (ensure-simple-string (string name))))))
    200200          (or (not found)
    201201              (eq package found)))
Note: See TracChangeset for help on using the changeset viewer.