[movitz-cvs] CVS update: movitz/losp/muerte/arrays.lisp
Frode Vatvedt Fjeld
ffjeld at common-lisp.net
Sun Aug 14 11:35:53 UTC 2005
Update of /project/movitz/cvsroot/movitz/losp/muerte
In directory common-lisp.net:/tmp/cvs-serv22106
Modified Files:
arrays.lisp
Log Message:
Fixed array-dimensions, added array-rank.
Date: Sun Aug 14 13:35:52 2005
Author: ffjeld
Index: movitz/losp/muerte/arrays.lisp
diff -u movitz/losp/muerte/arrays.lisp:1.53 movitz/losp/muerte/arrays.lisp:1.54
--- movitz/losp/muerte/arrays.lisp:1.53 Sat Jun 11 02:01:56 2005
+++ movitz/losp/muerte/arrays.lisp Sun Aug 14 13:35:52 2005
@@ -10,7 +10,7 @@
;;;; Author: Frode Vatvedt Fjeld <frodef at acm.org>
;;;; Created at: Sun Feb 11 23:14:04 2001
;;;;
-;;;; $Id: arrays.lisp,v 1.53 2005/06/11 00:01:56 ffjeld Exp $
+;;;; $Id: arrays.lisp,v 1.54 2005/08/14 11:35:52 ffjeld Exp $
;;;;
;;;;------------------------------------------------------------------
@@ -134,8 +134,17 @@
(memref array (movitz-type-slot-offset 'movitz-basic-vector 'num-elements)))))
(defun array-dimensions (array)
+ (let (r)
+ (dotimes (d (array-rank array))
+ (push (array-dimension array d) r))
+ (nreverse r)))
+
+(defun array-rank (array)
(etypecase array
- (vector 1)))
+ (indirect-vector
+ 1)
+ ((simple-array * 1)
+ 1)))
(defun shrink-vector (vector new-size)
(check-type vector vector)
More information about the Movitz-cvs
mailing list