Skip to content
This repository
Browse code

more improvements to xarray interface, not done yet, though.

Signed-off-by: AJ Rossini <blindglobe@gmail.com>
  • Loading branch information...
commit 0ae7a85dda4a5cf6bdb391dfe8891e9f40399130 1 parent 9dc6a2f
Tony Rossini authored September 19, 2009

Showing 1 changed file with 25 additions and 29 deletions. Show diff stats Hide diff stats

  1. 54  src/xarray-lispmatrix.lisp
54  src/xarray-lispmatrix.lisp
... ...
@@ -1,13 +1,13 @@
1 1
 ;;; -*- mode: lisp -*-
2 2
 
3  
-;;; Time-stamp: <2009-06-26 08:13:36 tony>
  3
+;;; Time-stamp: <2009-09-19 23:27:09 tony>
4 4
 ;;; Creation:   <2009-06-26 07:57:23 tony>
5 5
 ;;; File:       xarray-lispmatrix.lisp
6 6
 ;;; Author:     AJ Rossini <blindglobe@gmail.com>
7 7
 ;;; Copyright:  (c)2009--, AJ Rossini.  BSD, LLGPL, or GPLv2, depending
8 8
 ;;;             on how it arrives.  
9  
-;;; Purpose:    Integration with xarray for a common array-like
10  
-;;;             indexing approach.
  9
+;;; Purpose:    Integration with xarray to provide a common CLOS-based
  10
+;;;             array-like indexing approach.
11 11
 
12 12
 ;;; What is this talk of 'release'? Klingons do not make software
13 13
 ;;; 'releases'.  Our software 'escapes', leaving a bloody trail of
@@ -16,41 +16,37 @@
16 16
 ;;; This organization and structure is new to the 21st Century
17 17
 ;;; version..   Think, "21st Century Schizoid Man".
18 18
 
19  
-
20 19
 (in-package :lisp-matrix)
21 20
 
22  
-;; need to condition on the existence of and accessibility of xarray,
  21
+;; might need to condition on the existence of and accessibility of xarray,
23 22
 ;; something like:
24  
-
25  
-(when (find-package 'xarray)
26  
-
  23
+#|
  24
+ (when (find-package 'xarray)
27 25
 
28 26
   (defmethod xtype ((object matrix-like)))
  27
+  .... )
  28
+|#
29 29
 
30  
-  (defmethod xrank ((object matrix-like)))
31  
-
32  
-  (defmethod xdims ((object matrix-like)))
33  
-
34  
-  ;; (defmethod xdims*) can just use the default method.
35  
-
36  
-  (defmethod xdim ((object matrix-like)))
37  
-
38  
-  (defmethod xsize ((object matrix-like)))
39  
-
40  
-  (defmethod xref-writable-p ((object matrix-like) &rest subscripts))
41  
-
42  
-  (defmethod xref ((object matrix-like) &rest subscripts))
43  
-
44  
-  (defmethod (setf xref) (value (object matrix-like) &rest subscripts))
45  
-
46  
-  ;; there is a default method that should suffice, but perhaps some
  30
+(defmethod xtype ((object matrix-like))
  31
+  (warning "Not implemented for matrix-like"))
  32
+
  33
+(defmethod xrank ((object matrix-like)))
  34
+(defmethod xdims ((object matrix-like)))
  35
+;; (defmethod xdims*) can just use the default method.
  36
+(defmethod xdim ((object matrix-like)))
  37
+(defmethod xsize ((object matrix-like)))
  38
+(defmethod xref-writable-p ((object matrix-like) &rest subscripts)
  39
+  "Always true for matrix-like derived classes at this point (right?)"
  40
+  t)
  41
+(defmethod xref ((object matrix-like) &rest subscripts))
  42
+(defmethod (setf xref) (value (object matrix-like) &rest subscripts))
  43
+;; there is a default method that should suffice, but perhaps some
47 44
   ;; direct tricks could make this more efficient?  Worth a look
48 45
   ;; LATER. 
49  
-#|
50 46
   (defmethod xsetf ((destination matrix-like)
51 47
 		    (source matrix-like)
52 48
 		    &key map-function))
53  
-|#
  49
+  ;; (defmethod take) ; default should work for now.
  50
+
  51
+
54 52
 
55  
-  ;;   (defmethod take) ; default should work for now.
56  
-  )

0 notes on commit 0ae7a85

Please sign in to comment.
Something went wrong with that request. Please try again.