projects
/
jscl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move string-length to non-primitive
[jscl.git]
/
src
/
compiler.lisp
diff --git
a/src/compiler.lisp
b/src/compiler.lisp
index
ad61676
..
5dd0084
100644
(file)
--- a/
src/compiler.lisp
+++ b/
src/compiler.lisp
@@
-1431,12
+1431,6
@@
"var x = " x ";" *newline*
"return (typeof(" x ") == \"string\") && x.length == 1;")))
"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()"))
(define-builtin char-upcase (x)
(code x ".toUpperCase()"))
@@
-1447,14
+1441,11
@@
(js!bool
(js!selfcall
"var x = " x ";" *newline*
(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-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*
(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*
(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)
"return r;" *newline*))
(define-raw-builtin funcall (func &rest args)