From rosssd at gmail.com Tue Jul 17 16:46:26 2007
From: rosssd at gmail.com (Sean)
Date: Tue, 17 Jul 2007 17:46:26 +0100
Subject: [cl-store-devel] Incompatibility with Allegro CL 8.1
In-Reply-To: <87bqgmqq16.fsf@localhost>
References: <87646zfd3b.fsf@localhost> <1179217919.7940.0.camel@deepthought>
<87bqgmqq16.fsf@localhost>
Message-ID: <1184690786.8079.44.camel@deepthought>
Hi Pawel,
I'm busy merging in these changes into cl-store (sorry it's taken
so long) and was wondering what the actual error was when
loading the old code.
The problem I've run into is that in ACL 8.0
#.EXCL::*NAN-SINGLE* is not eql to the result
of (/ (expt most-positive-single-float 3)
(expt most-positive-single-float 3))
which is causing 2 of the tests to fail.
If
(eql #.EXCL::*NAN-SINGLE*
(/ (expt most-positive-single-float 3)
(expt most-positive-single-float 3)))
returns true in ACL 8.1 then i'll conditionalize the 'magic' float
numbers for pre ACL 8.1 and ACL 8.1
Cheers,
Sean.
On Tue, 2007-05-15 at 13:34 +0200, Pawel Turnau wrote:
> > On Fri, 2007-05-11 at 20:07 +0200, iso at wemba.edu.pl wrote:
> >> cl-store_0.7.2 cannot be compiled with Allegro CL 8.1 (currently
> >> beta). I have contacted Franz Inc. and was told that the file
> >> acl/custom.lisp needs to be changed.
> >
> > Thanks for the patch, I'll take a look at it some time later today.
>
> You may be interested to see the whole message from Duane Rettig from
> Franz Inc. (I enclose it below). I replied that #-allegro is probably
> unnecessary, since the file is only meant for ACL consumption anyway.
>
> By the way, I changed cl-store as they recommended and I have been
> using it for the last couple of days. I haven't noticed any problems.
>
> Pawel
>
>
> ================================================================
> >> Evaluating (expt most-positive-single-float 2) with ACL8.1b produces an error.
>
> It is clear that your intention in evaluating this form is to
> explicitly generate infinities. Unfortunately, the value that used to
> be returned from this form was not mathematically correct - since the
> value of most-positive-single-float is 3.4028235e+38 or approximately
> 3.402 x 10^38, and taking the square of that is approximately
> 1.158 x 10^77, and not infinity. But since this value cannot be
> represented as a single float, it is an error to ask for it. We used
> to respond to this error by simply returning an infinity, but to
> signal error is a better thing than to provide a wrong answer.
>
> Now, to your problem at hand:
>
> >> I am using the CL-STORE package:
> >>
> >> =========
> >> README for Package CL-STORE.
> >> Author: Sean Ross
> >> Homepage: http://www.common-lisp.net/project/cl-store/
> >> Version: 0.6
> >> =========
> >>
> >> I cannot compile it with ACL 8.1 Beta, because the file
> >> acl/custom.lisp contains the following lines:
> >>
> >> (defvar +single-positive-infinity+ (expt most-positive-single-float 2))
> >> (defvar +single-negative-infinity+ (expt most-negative-single-float 3))
> >> (defvar +single-nan+ (/ +single-negative-infinity+ +single-negative-infinity+))
> >>
> >> (defvar +double-positive-infinity+ (expt most-positive-double-float 2))
> >> (defvar +double-negative-infinity+ (expt most-negative-double-float 3))
> >> (defvar +double-nan+ (/ +double-negative-infinity+ +double-negative-infinity+))
> >>
> >> (setf *special-floats*
> >> (list (cons +double-positive-infinity+ +positive-double-infinity-code+)
> >> (cons +single-positive-infinity+ +positive-infinity-code+)
> >> (cons +single-negative-infinity+ +negative-infinity-code+)
> >> (cons +double-negative-infinity+ +negative-double-infinity-code+)
> >> (cons +single-nan+ +float-nan-code+)
> >> (cons +double-nan+ +float-double-nan-code+)))
>
> Apparently, at least most lisps return an infinity for each of these
> erroneous expt calls, but I susopect that that won't be true for very
> long. I suggest that you duplicate the 6 defvars and wrap them into
> the follwing pair of progns:
>
> #-allegro
> (progn
> (defvar +single-positive-infinity+ (expt most-positive-single-float 2))
> (defvar +single-negative-infinity+ (expt most-negative-single-float 3))
> (defvar +single-nan+ (/ +single-negative-infinity+ +single-negative-infinity+))
>
> (defvar +double-positive-infinity+ (expt most-positive-double-float 2))
> (defvar +double-negative-infinity+ (expt most-negative-double-float 3))
> (defvar +double-nan+ (/ +double-negative-infinity+ +double-negative-infinity+)))
>
> #+allegro
> (progn
> (defvar +single-positive-infinity+ excl::*infinity-single*)
> (defvar +single-negative-infinity+ excl::*negative-infinity-single*)
> (defvar +single-nan+ excl::*nan-single*)
>
> (defvar +double-positive-infinity+ excl::*infinity-double*)
> (defvar +double-negative-infinity+ excl::*negative-infinity-double*)
> (defvar +double-nan+ excl::*nan-double*))
>
> These symbols are unexported, and thus undocumented and unsupported,
> but they have never changed, and their meaning should be obvious. I
> will file an rfe to consider exporting them. Meanwhile, you might
> want to communicate with Sean Ross, the developer of the project, and
> let him know what is happening. It would be premature to make the
> change permanent, especially if we come up with a way to provide
> infinities and nans through supported means, but the above technique
> should at least work for now, and is likely to remain compatible with
> any change we make in the future.
>
> Let me know if you have trouble with this technique.
>
> Duane Rettig duane at franz.com Franz Inc. http://www.franz.com/
> 555 12th St., Suite 1450 http://www.555citycenter.com/
> Oakland, Ca. 94607 Phone: (510) 452-2000; Fax: (510) 452-0182
>
> ================================================================
--
...Please don't assume Lisp is only useful for Animation and Graphics,
AI, Bioinformatics, B2B and E-Commerce, Data Mining, EDA/Semiconductor
applications, Expert Systems, Finance, Intelligent Agents, Knowledge
Management, Mechanical CAD, Modeling and Simulation, Natural Language,
Optimization, Research, Risk Analysis, Scheduling, Telecom, and Web
Authoring just because these are the only things they happened to list.
Kent Pitman.