Remove aresize
authorDavid Vázquez <davazp@gmail.com>
Fri, 24 May 2013 01:05:17 +0000 (02:05 +0100)
committerDavid Vázquez <davazp@gmail.com>
Fri, 24 May 2013 01:05:17 +0000 (02:05 +0100)
src/compiler.lisp
src/print.lisp

index a41a85e..8bc6c63 100644 (file)
     "var x = " array ";" *newline*
     "return x.indexOf(v);" *newline*))
 
-(define-builtin aresize (array new-size)
-  (js!selfcall
-    "var x = " array ";" *newline*
-    "var n = " new-size ";" *newline*
-    "return x.length = n;" *newline*))
-
-
-
 (define-builtin get-internal-real-time ()
   "(new Date()).getTime()")
 
index cb4a442..749faf8 100644 (file)
 (defvar *print-escape* t)
 (defvar *print-circle* nil)
 
+;;; FIXME: Please, rewrite this in a more organized way.
 (defun write-to-string (form &optional known-objects object-ids)
   (when (and (not known-objects) *print-circle*)
     ;; To support *print-circle* some objects must be tracked for
                        (progn
                          (when (= n sz)
                            (setf sz (* 2 sz))
-                           (aresize known-objects sz)
-                           (aresize object-ids sz))
+                           ;; KLUDGE: storage vectors are an internal
+                           ;; object which the printer should not know
+                           ;; about. Use standard vector with fill
+                           ;; pointers instead.
+                           (resize-storage-vector known-objects sz)
+                           (resize-storage-vector object-ids sz))
                          (aset known-objects (1- (incf n)) x)
                          t)
                        (unless (aref object-ids i)