[lisplab-cvs] r10 - src

Jørn Inge Vestgården jivestgarden at common-lisp.net
Thu Mar 26 18:19:25 UTC 2009


Author: jivestgarden
Date: Thu Mar 26 18:19:24 2009
New Revision: 10

Log:
non-finished template code

Added:
   src/template.lisp

Added: src/template.lisp
==============================================================================
--- (empty file)
+++ src/template.lisp	Thu Mar 26 18:19:24 2009
@@ -0,0 +1,420 @@
+(in-package :lisplab)
+
+(defclass template ()
+  ((symbol 
+    :initarg :symbol 
+    :accessor template-symbol
+    :documentation "The variable")
+   ;; TODO some gensym symbol for dynamic symbol
+   #+nil (type 
+    :initarg :type 
+    :accessor template-type
+    :documentation "The actual run-time type")
+   ))
+
+(defclass template-blas-real (template)
+  ((store-symbol 
+    :initform  (gensym)
+    :accessor template-store-symbol
+    :documentation "Temp  variable store")
+   (rows-symbol 
+    :initform  (gensym)
+    :accessor template-rows-symbol
+    :documentation "Temp  variable store")
+   ))
+
+
+(defgeneric create-template (type symbol &rest rest ))
+
+(defgeneric apply-template (template code))
+  
+(defgeneric make-template-let*-forms (template))
+
+(defgeneric make-template-declare-forms (template))
+
+;;;; Blas real templates
+
+(defmethod create-template ((type (eql 'blas-real)) 
+			    symbol &rest rest)
+  (make-instance 'template-blas-real :symbol symbol))
+
+(defmethod make-template-declare-forms ((tl template-blas-real))
+  `((type type-blas-store ,(template-store-symbol tl) )
+    (type type-blas-idx ,(template-rows-symbol tl) )))
+
+(defmethod make-template-let*-forms ((tl template-blas-real ))
+  `((,(template-store-symbol tl) (store ,(template-symbol tl) ))
+    (,(template-rows-symbol tl) (rows ,(template-symbol tl)))))
+
+(defmethod apply-template ((


More information about the lisplab-cvs mailing list