From 928c6f695253c9f03ff440d18338efb8eea9b2f0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Fri, 24 May 2013 02:49:49 +0100 Subject: [PATCH] Move string-length to non-primitive --- src/compiler.lisp | 3 --- src/string.lisp | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) 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)) -- 1.7.10.4