From 99514b5a5f79348d9c619cce2bed562ce9082d4f Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Fri, 24 May 2013 02:43:02 +0100 Subject: [PATCH] Change internal format of strings --- src/compiler.lisp | 4 ++-- src/prelude.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler.lisp b/src/compiler.lisp index ad61676..c4b8f66 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -1447,7 +1447,7 @@ (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())")) @@ -1469,7 +1469,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) diff --git a/src/prelude.js b/src/prelude.js index 6f5feea..433462b 100644 --- a/src/prelude.js +++ b/src/prelude.js @@ -55,7 +55,7 @@ function QIList(){ // 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; } @@ -69,7 +69,7 @@ function Symbol(name, package_name){ } 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 -- 1.7.10.4