projects
/
jscl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5e830cf
)
Migrate CHARACTERP
author
David Vázquez
<davazp@gmail.com>
Thu, 27 Jun 2013 00:49:33 +0000
(
02:49
+0200)
committer
David Vázquez
<davazp@gmail.com>
Thu, 27 Jun 2013 00:55:25 +0000
(
02:55
+0200)
src/compiler.lisp
patch
|
blob
|
history
diff --git
a/src/compiler.lisp
b/src/compiler.lisp
index
98d90c1
..
a903fbd
100644
(file)
--- a/
src/compiler.lisp
+++ b/
src/compiler.lisp
@@
-1174,9
+1174,11
@@
(define-builtin characterp (x)
(js!bool
- (js!selfcall
- "var x = " x ";"
- "return (typeof(" x ") == \"string\") && (x.length == 1 || x.length == 2);")))
+ (js!selfcall*
+ `(var (x ,x))
+ `(return (and (== (typeof x) "string")
+ (or (== (get x "length") 1)
+ (== (get x "length") 2)))))))
(define-builtin char-upcase (x)
`(call |safe_char_upcase| ,x))