core: Add string-length.
* src/strings.c (string_length): New function. * mes/module/mes/scm.mes (string-length): Remove.
This commit is contained in:
parent
819b32e61c
commit
6af0b49f09
|
@ -194,9 +194,6 @@
|
|||
(define (make-string n . fill)
|
||||
(list->string (apply make-list n fill)))
|
||||
|
||||
(define (string-length s)
|
||||
(length (string->list s)))
|
||||
|
||||
(define (string-ref s k)
|
||||
(list-ref (string->list s) k))
|
||||
|
||||
|
|
|
@ -260,3 +260,10 @@ string_append (SCM x) ///((arity . n))
|
|||
}
|
||||
return make_string (buf, size);
|
||||
}
|
||||
|
||||
SCM
|
||||
string_length (SCM string)
|
||||
{
|
||||
assert (TYPE (string) == TSTRING);
|
||||
return MAKE_NUMBER (LENGTH (string));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue