From: David Vázquez Date: Fri, 24 May 2013 01:49:49 +0000 (+0100) Subject: Move string-length to non-primitive X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=928c6f695253c9f03ff440d18338efb8eea9b2f0;hp=6a3ddef2e4da9a444c4b22b41d9df71ca451aadd;p=jscl.git Move string-length to non-primitive --- diff --git a/src/compiler.lisp b/src/compiler.lisp index 09d5c0a..5dd0084 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -1446,9 +1446,6 @@ (define-builtin string-upcase (x) (code "make_lisp_string(xstring(" x ").toUpperCase())")) -(define-builtin string-length (x) - (code x ".length")) - (define-raw-builtin slice (vector a &optional b) (js!selfcall "var vector = " (ls-compile vector) ";" *newline* diff --git a/src/string.lisp b/src/string.lisp index 574c8b7..1bb322b 100644 --- a/src/string.lisp +++ b/src/string.lisp @@ -16,6 +16,9 @@ (defun stringp (s) (stringp s)) +(defun string-length (string) + (storage-vector-size string)) + (defun make-string (n &key initial-element) (make-array n :element-type 'character :initial-element initial-element))