X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler.lisp;h=5dd008450f4cee085234367a209f1b967d2b55cb;hb=928c6f695253c9f03ff440d18338efb8eea9b2f0;hp=ad61676e0a154db2df22a0e89ed3787ca56268fa;hpb=69f4ead4d3a5f853780816b07e4408abcbc21cfc;p=jscl.git diff --git a/src/compiler.lisp b/src/compiler.lisp index ad61676..5dd0084 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -1431,12 +1431,6 @@ "var x = " x ";" *newline* "return (typeof(" x ") == \"string\") && x.length == 1;"))) -(define-builtin char-to-string (x) - (js!selfcall - "var r = [" x "];" *newline* - "r.type = 'character';" - "return r")) - (define-builtin char-upcase (x) (code x ".toUpperCase()")) @@ -1447,14 +1441,11 @@ (js!bool (js!selfcall "var x = " x ";" *newline* - "return typeof(x) == 'object' && 'length' in x && x.type == 'character';"))) + "return typeof(x) == 'object' && 'length' in x && x.stringp == 1;"))) (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* @@ -1469,7 +1460,7 @@ (define-builtin concat-two (string1 string2) (js!selfcall "var r = " string1 ".concat(" string2 ");" *newline* - "r.type = 'character';" + "r.stringp = 1;" "return r;" *newline*)) (define-raw-builtin funcall (func &rest args)