;; You should have received a copy of the GNU General Public License
;; along with JSCL. If not, see <http://www.gnu.org/licenses/>.
+(/debug "loading array.lisp!")
+
(defun upgraded-array-element-type (typespec &optional environment)
(declare (ignore environment))
(if (eq typespec 'character)
(error "~S is not an array." array))
(storage-vector-set array index value))
+(define-setf-expander aref (array index)
+ (let ((g!array (gensym))
+ (g!index (gensym))
+ (g!value (gensym)))
+ (values (list g!array g!index)
+ (list array index)
+ (list g!value)
+ `(aset ,g!array ,g!index ,g!value)
+ `(aref ,g!array ,g!index))))
+
;;; Vectors
(defun vectorp (x)
(and (arrayp x) (null (cdr (array-dimensions x)))))
+(defun vector (&rest objects)
+ (list-to-vector objects))
+
;;; FIXME: should take optional min-extension.
;;; FIXME: should use fill-pointer instead of the absolute end of array
(defun vector-push-extend (new vector)