From: Vincent A. <vi...@ar...> - 2004-12-20 19:03:48
Attachments:
coerce-complex-float.diff
|
Hi, In SBCL 0.8.17.28: * (coerce #c(1 2) '(complex float)) debugger invoked on a SIMPLE-TYPE-ERROR in thread 15242: Argument REALPART is not a REAL: #C(1 2) The attached patch solves this. Vincent. |
From: Raymond T. <ray...@er...> - 2004-12-20 19:21:24
|
>>>>> "Vincent" == Vincent Arkesteijn <vi...@ar...> writes: Vincent> Hi, Vincent> In SBCL 0.8.17.28: Vincent> * (coerce #c(1 2) '(complex float)) Vincent> debugger invoked on a SIMPLE-TYPE-ERROR in thread 15242: Vincent> Argument REALPART is not a REAL: #C(1 2) Vincent> The attached patch solves this. Vincent> Vincent. Vincent> Index: src/code/coerce.lisp Vincent> =================================================================== Vincent> RCS file: /cvsroot/sbcl/sbcl/src/code/coerce.lisp,v Vincent> retrieving revision 1.16 Vincent> diff -u -u -r1.16 coerce.lisp Vincent> --- src/code/coerce.lisp 20 Oct 2003 13:31:07 -0000 1.16 Vincent> +++ src/code/coerce.lisp 20 Dec 2004 17:30:55 -0000 Vincent> @@ -179,6 +179,9 @@ Vincent> ((csubtypep type (specifier-type '(complex long-float))) Vincent> (complex (%long-float (realpart object)) Vincent> (%long-float (imagpart object)))) Vincent> + ((csubtypep type (specifier-type '(complex float))) Vincent> + (complex (%single-float (realpart object)) Vincent> + (%single-float (imagpart object)))) Don't you want float instead of %single-float? %single-float will convert a double-float to single-float, and that is probably not right if we have (coerce #c(1d0 2d0) (complex float)). Ray |
From: Vincent A. <vi...@ar...> - 2004-12-20 19:36:02
|
On Mon, Dec 20, 2004 at 02:21:16PM -0500, Raymond Toy wrote: > >>>>> "Vincent" == Vincent Arkesteijn <vi...@ar...> writes: > Vincent> + ((csubtypep type (specifier-type '(complex float))) > Vincent> + (complex (%single-float (realpart object)) > Vincent> + (%single-float (imagpart object)))) > > Don't you want float instead of %single-float? %single-float will > convert a double-float to single-float, and that is probably not right > if we have (coerce #c(1d0 2d0) (complex float)). In both 0.8.17.28 without this patch and in CVS HEAD with it: * (coerce #c(1d0 2d0) '(complex float)) #C(1.0d0 2.0d0) This is due to one of the first cond clauses in COERCE: ((%typep object output-type-spec) object) Vincent. |
From: Raymond T. <ray...@er...> - 2004-12-20 19:41:49
|
>>>>> "Vincent" == Vincent Arkesteijn <vi...@ar...> writes: Vincent> On Mon, Dec 20, 2004 at 02:21:16PM -0500, Raymond Toy wrote: >> >>>>> "Vincent" == Vincent Arkesteijn <vi...@ar...> writes: Vincent> + ((csubtypep type (specifier-type '(complex float))) Vincent> + (complex (%single-float (realpart object)) Vincent> + (%single-float (imagpart object)))) >> >> Don't you want float instead of %single-float? %single-float will >> convert a double-float to single-float, and that is probably not right >> if we have (coerce #c(1d0 2d0) (complex float)). Vincent> In both 0.8.17.28 without this patch and in CVS HEAD with it: Vincent> * (coerce #c(1d0 2d0) '(complex float)) Vincent> #C(1.0d0 2.0d0) Vincent> This is due to one of the first cond clauses in COERCE: Vincent> ((%typep object output-type-spec) Vincent> object) Oops. You're right; I missed that clause. Ray |
From: Christophe R. <cs...@ca...> - 2005-01-01 21:02:44
|
Vincent Arkesteijn <vi...@ar...> writes: > In SBCL 0.8.17.28: > * (coerce #c(1 2) '(complex float)) > > debugger invoked on a SIMPLE-TYPE-ERROR in thread 15242: > Argument REALPART is not a REAL: #C(1 2) > > The attached patch solves this. Thank you. I've merged this in sbcl-0.8.18.9. Cheers, Christophe |
From: Paolo A. <am...@mc...> - 2005-01-01 21:33:40
|
Christophe Rhodes <cs...@ca...> writes: > X-Spam-Score: -2.6 (--) > X-Spam-Report: Spam detection software, running on the system "sc8-sf-spam2.sourceforge.net", has > identified this incoming email as possible spam. The original message > has been attached to this so you can view it (if it isn't spam) or label > similar future email. If you have any questions, see > the administrator of that system for details. > Content preview: Vincent Arkesteijn <vi...@ar...> writes: > > In SBCL 0.8.17.28: > * (coerce #c(1 2) '(complex float)) > > debugger > invoked on a SIMPLE-TYPE-ERROR in thread 15242: > Argument REALPART is > not a REAL: #C(1 2) > > The attached patch solves this. [...] > Content analysis details: (-2.6 points, 5.0 required) > pts rule name description > ---- ---------------------- -------------------------------------------------- > -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% > [score: 0.0000] > 0.0 AWL AWL: From: address is in the auto white-list It looks like Sourceforge is tagging some of your messages as spam. Ironically, my own spam filter, based on `mailfilter', in turn identifies the Sourceforge header fields as spam, because the maximum line length of fields in the message header is longer than the default of 998 characters. Paolo -- Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film |