From hjstein at gmail.com Mon May 18 01:54:57 2015 From: hjstein at gmail.com (Harvey Stein) Date: Sun, 17 May 2015 21:54:57 -0400 Subject: Generic arithmetic and declarations Message-ID: Consider the following function: (defun afunction (a) (declare (type (simple-array double-float (*)) a)) a) It compiles fine in cl-user, but if I'm in antik-user, I get: ; in: DEFUN AFUNCTION ; (TYPE (SIMPLE-ARRAY DOUBLE-FLOAT (ANTIK:*)) ANTIK:A) ; ; caught ERROR: ; bad dimension in array type: * ; ; compilation unit finished ; caught 1 ERROR condition So, the antik definition of * breaks declarations that use *. Any way to fix this? Thanks, Harvey -- Harvey J. Stein hjstein at gmail.com http://www.linkedin.com/in/harveyjstein Selected papers and presentations available at: http://ssrn.com/author=732372 -------------- next part -------------- An HTML attachment was scrubbed... URL: From lhealy at common-lisp.net Mon May 18 02:49:35 2015 From: lhealy at common-lisp.net (Liam Healy) Date: Sun, 17 May 2015 22:49:35 -0400 Subject: Generic arithmetic and declarations In-Reply-To: References: Message-ID: On May 17, 2015 9:55 PM, "Harvey Stein" wrote: > > Consider the following function: > > (defun afunction (a) > (declare (type (simple-array double-float (*)) a)) > a) > > It compiles fine in cl-user, but if I'm in antik-user, I get: > > > ; in: DEFUN AFUNCTION > ; (TYPE (SIMPLE-ARRAY DOUBLE-FLOAT (ANTIK:*)) ANTIK:A) > ; > ; caught ERROR: > ; bad dimension in array type: * > ; > ; compilation unit finished > ; caught 1 ERROR condition > > So, the antik definition of * breaks declarations that use *. > > Any way to fix this? > You have several options. Antik shadows '* (along with other mathematical symbols) and an unfortunate side effect is that it affects other uses of the symbol '* in cl. So, you can just use cl:* (i.e., put the explicit prefix in). That should always work. There is a symbol macro that defines 'antik:@ to cl:*, so using @ should work. I'm not sure if there's a way to unshadow a symbol, but you can do something like (setf antik::*antik-user-shadow-symbols* (remove '#:* antik::*antik-user-shadow-symbols*)) and then make a new package using antik:make-user-package, which will have all the use-package and shadowed symbols except *. If you do this, be careful to use antik:* everywhere you mean Antik's multiply, otherwise it will assume cl:*. Liam > Thanks, > Harvey > > > > -- > Harvey J. Stein > hjstein at gmail.com > http://www.linkedin.com/in/harveyjstein > Selected papers and presentations available at: http://ssrn.com/author=732372 -------------- next part -------------- An HTML attachment was scrubbed... URL: