[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


re:  . . .the character proposal ... would require MAKE-STRING to take an
    :element-type keyword.

I don't see that this is absolutely necessary, since a default type could 
certainly be satisfactory for MAKE-STRING; you could use MAKE-ARRAY for
creating non-default types and features.  In the current situation, 
:element-type STRING-CHAR is what defines a string.

However, if we are to extend MAKE-STRING, what's the point of doing so 
unless it becomes capable of accepting all the same keyword arguments 
as MAKE-ARRAY?  It's only a shorthand for defaulting :element-type.
That's the point of the sample code [which was not intended to be run 
so please forgive the typos and neglect of the "suppliedp" question on 
initial element/contents.]  One can accommodate varieties of strings by 
overriding the default for an :element-type argument.  

  (defun make-string (size &key (element-type   'string-char)
                                initial-element initial-contents
                                adjustable  	fill-pointer 
                                displaced-to    displaced-index-offset)
    (check-type size integer)
    (make-array size :element-type           element-type
                     :initial-element        initial-element
                     :initial-contents       initial-contents
                     :adjustable             adjustable 
                     :fill-pointer           fill-pointer
                     :displaced-to           displaced-to
                     :displaced-index-offset displaced-index-offset))

-- JonL --