From 3b1d76c5bc0117f48e386bbf007321cde90bce5f Mon Sep 17 00:00:00 2001 From: Ken Harris Date: Fri, 14 Jun 2013 09:50:40 -0700 Subject: [PATCH] VECTOR function --- src/array.lisp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/array.lisp b/src/array.lisp index 150c70d..b66d87c 100644 --- a/src/array.lisp +++ b/src/array.lisp @@ -79,6 +79,14 @@ (defun vectorp (x) (and (arrayp x) (null (cdr (array-dimensions x))))) +(defun vector (&rest objects) + (let* ((length (length objects)) + (array (make-array length :element-type t)) + (i 0)) + (dolist (element objects array) ;; poor-man's :initial-contents + (aset array i element) + (incf i)))) + ;;; FIXME: should take optional min-extension. ;;; FIXME: should use fill-pointer instead of the absolute end of array (defun vector-push-extend (new vector) -- 1.7.10.4