From: Nikodemus Siivola Date: Sun, 28 Apr 2013 13:40:52 +0000 (+0300) Subject: add not-entirely-correct VECTOR-PUSH-EXTEND X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=8809acf5541ef49238d27c8e8c630ba3ba6e069f;p=jscl.git add not-entirely-correct VECTOR-PUSH-EXTEND Conflicts: src/toplevel.lisp --- diff --git a/src/compiler.lisp b/src/compiler.lisp index 28918e3..cfe7020 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -1536,6 +1536,14 @@ (indent "r.push(" (ls-compile nil) ");" *newline*) "return r;" *newline*)) +;;; FIXME: should take optional min-extension. +;;; FIXME: should use fill-pointer instead of the absolute end of array +(define-builtin vector-push-extend (new vector) + (js!selfcall + "var v = " vector ";" *newline* + "v.push(" new ");" *newline* + "return v;")) + (define-builtin arrayp (x) (js!bool (js!selfcall diff --git a/src/toplevel.lisp b/src/toplevel.lisp index 81315e1..33e4a82 100644 --- a/src/toplevel.lisp +++ b/src/toplevel.lisp @@ -74,7 +74,7 @@ setq sixth some string string-upcase string= stringp subseq subst symbol-function symbol-name symbol-package symbol-plist symbol-value symbolp t tagbody tailp tenth third throw tree-equal - truncate unless unwind-protect values values-list variable warn when + truncate unless unwind-protect values values-list variable vector-push-extend warn when write-line write-string zerop)) (setq *package* *user-package*)