"var x = " x ";" *newline*
"return typeof(x) == 'object' && 'length' in x && x.stringp == 1;")))
-(define-builtin string-upcase (x)
- (code "make_lisp_string(xstring(" x ").toUpperCase())"))
-
(define-raw-builtin funcall (func &rest args)
(js!selfcall
"var f = " (ls-compile func) ";" *newline*
(defun concat (&rest strs)
(!reduce #'concat-two strs ""))
+
+
+(defun string-upcase (string)
+ (let ((new (make-string (length string))))
+ (dotimes (i (length string) new)
+ (aset new i (char-upcase (char string i))))))
+
+(defun string-downcase (string)
+ (let ((new (make-string (length string))))
+ (dotimes (i (length string) new)
+ (aset new i (char-downcase (char string i))))))