From 280f4d52062d33f883bf17d8c963a89d5307b8fa Mon Sep 17 00:00:00 2001 From: mk Date: Mon, 16 Aug 2010 00:32:45 +0100 Subject: [PATCH] overriding name in def-generator introduced bogous names into *macro-generated-functions* --- vol-convert.lisp | 9 ++++++--- vol-macro-macros.lisp | 4 ++-- vol-operators.lisp | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/vol-convert.lisp b/vol-convert.lisp index 3a159b2..2f8f6c1 100644 --- a/vol-convert.lisp +++ b/vol-convert.lisp @@ -9,7 +9,8 @@ ;; type and coerce. coerce seemed to be quite slow last time i ;; tried. thats why i prefer the multiplication for most conversions. -(def-generator (convert (rank type out_type func short_func)) +(def-generator (convert (rank type out_type func short_func) + :override-name t) (let ((long-out-type (get-long-type out_type)) ;; override the name that is constructed by def-generator (name (format-symbol "convert-~a-~a/~a-~a" @@ -136,7 +137,8 @@ ;; intermediate real array (either double or float depending on the ;; input type) and then normalized into the result. float results are ;; in 0..1 and ub8 results in 0..255. -(def-generator (normalize-complex (rank type out_type func short_func)) +(def-generator (normalize-complex (rank type out_type func short_func) + :override-name t) (let ((long-out-type (get-long-type out_type)) ;; override the name that is constructed by def-generator (name (format-symbol "normalize-~a-~a/~a-~a" @@ -197,7 +199,8 @@ :initial-contents '(#C(1s0 .2s0) #C(2s0 1s0) #C(3s0 0s0)))) ;; normalize real arrays, name like: normalize-2-sf/ub8 -(def-generator (normalize (rank type out_type)) +(def-generator (normalize (rank type out_type) + :override-name t) (let ((long-out-type (get-long-type out_type)) ;; override the name that is constructed by def-generator (name (format-symbol "normalize-~a-~a/~a" diff --git a/vol-macro-macros.lisp b/vol-macro-macros.lisp index a5906eb..0f356e6 100644 --- a/vol-macro-macros.lisp +++ b/vol-macro-macros.lisp @@ -53,7 +53,7 @@ ;; when a new macro is needed to generate a lot of functions (and ;; maybe one dispatch function) it should be called def-...-functions. -(defmacro def-generator ((name spec) &body body) +(defmacro def-generator ((name spec &key override-name) &body body) (let ((macro-name (format-symbol "def-~a~{-~a~}" name spec)) (function-fmt (let ((result (format nil "~a" name))) (dotimes (i (length spec)) @@ -63,7 +63,7 @@ (let ((name (format-symbol ,function-fmt ,@spec)) ,(when (member 'type spec) `(long-type (get-long-type type)))) - (store-new-function name) + ,(unless override-name `(store-new-function name)) ,@body)))) #+nil diff --git a/vol-operators.lisp b/vol-operators.lisp index 8f70af2..83a99f6 100644 --- a/vol-operators.lisp +++ b/vol-operators.lisp @@ -8,7 +8,7 @@ ;; in all dimensions. In the latter case a vec-i has to be supplied in ;; B-START to define the relative position of B inside A. -(def-generator (point-wise (op rank type)) +(def-generator (point-wise (op rank type) :override-name t) (let ((name (format-symbol ".~a-~a-~a" op rank type))) (store-new-function name) `(defun ,name (a b &optional (b-start (make-vec-i))) -- 2.11.4.GIT