Type BASE-STRING and STRING were defined as equivalent even with Unicode.

This commit is contained in:
jgarcia 2006-11-12 12:58:47 +00:00
parent fe77606f7c
commit bdcbb2a19f
3 changed files with 30 additions and 11 deletions

View file

@ -129,6 +129,8 @@ ECL 1.0:
- TYPE-OF did not recognized EXTENDED-CHARs.
- Type BASE-STRING and STRING were defined as equivalent.
* Other visible changes:
- EXT:PROCESS-COMMAND-ARGS now allows for a default rule.
@ -170,6 +172,9 @@ ECL 1.0:
- The slot accessors for structures with type VECTOR or LIST now rely on
the standard function ELT, instead of si:list-nth and si:rplaca-nthcdr.
- TYPE-OF returns expanded types for arrays. For instance,
(ARRAY CHARACTER (12)) instead of (STRING 12).
- C functions which disappear: si_set_compiled_function_name(),
si_extended_string_concatenate(), assert_type_string(),
assert_type_character(), assert_type_symbol(), make_symbol(),

View file

@ -363,29 +363,29 @@ cl_type_of(cl_object x)
if (x->string.adjustable ||
x->string.hasfillp ||
!Null(CAR(x->string.displaced)))
t = @'string';
t = @'array';
else
t = @'simple-string';
t = cl_list(2, t, MAKE_FIXNUM(x->string.dim));
t = @'simple-array';
t = cl_list(3, t, @'character', cl_list(1, MAKE_FIXNUM(x->string.dim)));
break;
#endif
case t_base_string:
if (x->base_string.adjustable ||
x->base_string.hasfillp ||
!Null(CAR(x->base_string.displaced)))
t = @'base-string';
t = @'array';
else
t = @'simple-base-string';
t = cl_list(2, t, MAKE_FIXNUM(x->base_string.dim));
t = @'simple-array';
t = cl_list(3, t, @'base-char', cl_list(1, MAKE_FIXNUM(x->base_string.dim)));
break;
case t_bitvector:
if (x->vector.adjustable ||
x->vector.hasfillp ||
!Null(CAR(x->vector.displaced)))
t = @'bit-vector';
t = @'array';
else
t = @'simple-bit-vector';
t = cl_list(2, t, MAKE_FIXNUM(x->vector.dim));
t = @'simple-array';
t = cl_list(3, t, @'bit', cl_list(1, MAKE_FIXNUM(x->vector.dim)));
break;
#ifndef CLOS
case t_structure:

View file

@ -152,7 +152,13 @@ may be adjustable. Other vectors are called simple-vectors."
characters with double quotes. Some strings may be displaced to another
string, may have a fill-pointer, or may be adjustable. Other strings are
called simple-strings."
(if size `(array character (,size)) '(array character (*))))
#-unicode
(if size `(array character (,size)) '(array character (*)))
#+unicode
(if size
`(or (array base-char (,size))
(array character (,size)))
'(or (array base-char (*)) (array character (*)))))
(deftype base-string (&optional size)
(if size `(array base-char (,size)) '(array base-char (*))))
@ -167,7 +173,15 @@ fill-pointer, and is not adjustable."
(deftype simple-string (&optional size)
"A simple-string is a string that is not displaced to another array, has no
fill-pointer, and is not adjustable."
(if size `(simple-array character (,size)) '(simple-array character (*))))
#-unicode
(if size
`(simple-array character (,size))
'(simple-array character (*)))
#+unicode
(if size
`(or (simple-array base-char (,size))
(simple-array character (,size)))
'(or (simple-array base-char (*)) (simple-array character (*)))))
(deftype simple-base-string (&optional size)
(if size `(simple-array base-char (,size)) '(simple-array base-char (*))))