Yaroslav Kavenchuk <kavenchuk@...> writes:
> Convert simple-string to simple-base-string is simple.
> How convert simple-base-string to simple-string?
>
> CL-USER> (type-of (coerce "asdf" 'simple-base-string))
> (SIMPLE-BASE-STRING 4)
> CL-USER> (type-of (coerce (coerce "asdf" 'simple-base-string)
> 'simple-string))
> (SIMPLE-BASE-STRING 4)
>
> How is faster?
I presume you want
(coerce <simple-base-string> '(simple-array character (*)))
and the reason your second form doesn't do what you expect is that
simple-string is not the same as (simple-array character (*)); in fact
simple-string is the same type as
(or (simple-array character (*)) simple-base-string (simple-array nil (*)))
and so COERCE doesn't do anything, as its first argument is already
typep its second.
Cheers,
Christophe
|