From: Pierre Mai
Subject: coerce, subtypep and (float-)type-specifiers
Date: 
Message-ID: <m3hg1p1bcp.fsf@torus.cs.tu-berlin.de>
Hi!

After rereading the (hopefully) relevant passages of CLHS, and trying
out several implementations, I'm somewhat at a loss, for explaining
these variations in behaviour:

USER(1): (coerce 0 'double-float)
0.0d0
USER(2): (coerce 0 '(double-float))
Error: Can't coerce 0 to type (DOUBLE-FLOAT).
  [condition type: SIMPLE-ERROR]
[1] USER(3): :pop
USER(3): (coerce 0 '(double-float * *))
Error: Can't coerce 0 to type (DOUBLE-FLOAT * *).
  [condition type: SIMPLE-ERROR]
[1] USER(4): :pop
USER(4): (subtypep 'double-float '(double-float))
T
T
USER(5): (subtypep '(double-float) 'double-float)
T
T

This is in the ACL 5.0 Beta for RH Linux 4.0, but ACL 4.3 for Linux
and CLISP from Dec-1997 concur, whereas in CMUCL 18a+ on Linux I get:

* (coerce 0 'double-float)

0.0d0
* (coerce 0 '(double-float))

0.0d0
* (coerce 0 '(double-float * *))

0.0d0
* (subtypep 'double-float '(double-float))

T
T
* (subtypep '(double-float) 'double-float)

T
T

Which, I must confess, is more or less what I (naively?) expected, and 
after rereading CLHS I can't find any reason why the behaviour of
the other implementations should be conforming.  But probably I'm not
aware of all the issues involved, so I'm hoping that someone can
shed any more light on this...

Regs, Pierre.

-- 
Pierre Mai <····@cs.tu-berlin.de>	http://home.pages.de/~trillian/
  "Such is life." -- Fiona in "Four Weddings and a Funeral" (UK/1994)

From: Scott L. Burson
Subject: Re: coerce, subtypep and (float-)type-specifiers
Date: 
Message-ID: <358D7B9D.6201DD56@zeta-sqoft.com>
Barry Margolin wrote:
> 
> IIRC, when I used Allegro CL (1987-1994), they didn't have single floats on
> Suns, except for specialized arrays of single floats.

YRIC :-)  ACL has had single-floats at least since version 3.0 (I have a
copy of `lisp.h' from 3.0 that proves this).  No short-floats, though.

-- Scott

				  * * * * *

To use the email address, remove all occurrences of the letter "q".
From: Paul Dietz
Subject: Re: coerce, subtypep and (float-)type-specifiers
Date: 
Message-ID: <358DB3A1.1555B220@interaccess.com>
Kent M Pitman wrote:
> 
> Pierre, you're right--the behavior of COERCE and SUBTYPEP in LispWorks
> 3.2.1 (and in LW 3.2.2.1, which I have on my machine) is broken.

SUBTYPEP seems to be hard to implement.  It's been more or
less broken on every lisp implementation I've tried.  A common
problem seems to be to implement some builtin symbolic type
using type constructors like AND, NOT, etc., then fail to
compute SUBTYPEP properly between that type and some other
builtin type.

	Paul
From: Pekka P. Pirinen
Subject: Re: coerce, subtypep and (float-)type-specifiers
Date: 
Message-ID: <ixpvfx5pyn.fsf@gaspode.cam.harlequin.co.uk>
Paul Dietz <·····@interaccess.com> writes:
> SUBTYPEP seems to be hard to implement.  It's been more or
> less broken on every lisp implementation I've tried.

There's a lot of detail, and it's not easy to implement efficiently,
but mostly it's just understandable laziness -- people don't use it
much, because the standard doesn't require it do much anything.
LispWorks 4 has a correct and complete implementation, though.
Sorted out COERCE, too.
-- 
Pekka P. Pirinen
Harlequin Limited, Cambridge, UK