(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 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)
// Create and return a lisp string for the Javascript string STRING.
function make_lisp_string (string){
var array = string.split("");
- array.type = 'character'
+ array.stringp = 1;
return array;
}
}
function lisp_to_js (x) {
- if (typeof x == 'object' && 'length' in x && x.type == 'character')
+ if (typeof x == 'object' && 'length' in x && x.stringp == 1)
return xstring(x);
else if (typeof x == 'function'){
// Trampoline calling the Lisp function