Re: [r6rs-discuss] What is meant by the entire tower of subtypes?

2014-04-22 Thread Michael Sperber

John Cowan co...@mercury.ccil.org writes:

 The R7RS-large committee is trying to sort out what R6RS Section 3.4
 means by its first two sentences:

 Implementations of Scheme must support number objects for
 the entire tower of subtypes given in section 3.1. Moreover,
 implementations must support exact integer objects and exact
 rational number objects of practically unlimited size and
 precision, and to implement certain procedures (listed in 11.7.1)
 so they always return exact results when given exact arguments.

 Does this mean that implementations may arbitrarily restrict the ranges
 of non-real numbers?  All the procedures mentioned in 11.7.1 are closed
 over the real numbers (except for division by zero), so they cannot
 force the existence of non-real numbers.

As far as I can see, the paragraph does not say anything about non-real
numbers.  Also, I don't know what you mean by arbitrarily.  An
implementation is certainly free to restrict the ranges of non-real
numbers, however.  For example, complex numbers with flonum parts were
(intended to be) within what the report says.

 3.4 explicitly says Implementations may support only a limited range
 of inexact number objects of any type, subject to the requirements of
 this section.  That would seem to bless having exact (or some exact)
 but not inexact non-real numbers.

Could you parenthesize this?  I assume you mean bless having (exact (or
some exact) but not inexact non-real numbers).  Since R6RS explicitly
describes a tower, every inexact real is also a complex number, so I
think the answer is no.

-- 
Regards,
Mike

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] What is meant by the entire tower of subtypes?

2014-04-22 Thread John Cowan
Michael Sperber scripsit:

 As far as I can see, the paragraph does not say anything about
 non-real numbers.

Not specifically, no.  But presumably they are included in the requirement
to provide a tower; that is, a system that provides only real numbers
(and raises an exception of type implementation-restriction when asked
to compute any non-real number) is not conformant.

 Also, I don't know what you mean by arbitrarily.

For example, would an implementation that can represent only a single
non-real number, such as +i, be technically conformant?

 An implementation is certainly free to restrict the ranges of non-real
 numbers, however.  For example, complex numbers with flonum parts were
 (intended to be) within what the report says.

Is an implementation that has no way to represent an exact non-real
number conformant?

 Could you parenthesize this?  I assume you mean bless having (exact
 (or some exact) but not inexact non-real numbers).

That is what I meant, yes.

 Since R6RS explicitly describes a tower, every inexact real is also a
 complex number, so I think the answer is no.

If an implementation may restrict the range of inexact numbers, it seems
to me that technically it may restrict the range to no inexact numbers
whatsoever.  Is that conformant?  If not, is it technically conformant
to have just one inexact number, say 0.0?

I ask these questions not because I think such hypothetical semi-broken
implementations matter, but to help determine how (if at all) R7RS-large
should tighten the requirements on implementations.  There is currently
consensus to require bignums and ratios, as R6RS does, but no consensus on
what to require about exact and inexact non-real numbers.  In particular,
there are committee members who want to do what R6RS does, but that
requires being able to determine what R6RS actually does require.

-- 
John Cowan  http://www.ccil.org/~cowanco...@ccil.org
They do not preach that their God will rouse them
A little before the nuts work loose.
They do not teach that His Pity allows them
to drop their job when they damn-well choose.
--Rudyard Kipling, The Sons of Martha

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] What is meant by the entire tower of subtypes?

2014-04-22 Thread Michael Sperber

John Cowan co...@mercury.ccil.org writes:

 If an implementation may restrict the range of inexact numbers, it seems
 to me that technically it may restrict the range to no inexact numbers
 whatsoever.
 Is that conformant?  If not, is it technically conformant to have just
 one inexact number, say 0.0?

I think it's conformant to have just one inexact number.  However, I'm
not sure it can be 0.0.  Henry Ceijtin at one time concluded that in
R5RS, that inexact number would have to be negative because of the
connection of exact integers with array indices, but I don't recall the
inexact argument.

I didn't consciously change anything in R6RS that might make it
different from R5RS.  However, I did try to do something about the whole
broken concept of inexact numbers:

 Egner, Richard Kelsey, Michael Sperber: Cleaning up the Tower: Numbers
 in Scheme, In The 2004 Scheme Workshop, Snowbird, Utah, October 2004.

 http://www.deinprogramm.de/sperber/papers/numerical-tower.pdf

Albeit, to no avail.

-- 
Regards,
Mike

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


Re: [r6rs-discuss] What is meant by the entire tower of subtypes?

2014-04-22 Thread John Cowan
Michael Sperber scripsit:

 I don't recall the inexact argument.

:-)

 I didn't consciously change anything in R6RS that might make it
 different from R5RS.

Except to require arbitrarily large exact rationals (and a fortiori
integers, though integers are particularly mentioned).

 However, I did try to do something about the whole broken concept of
 inexact numbers:

I read that paper some years back.  I'll re-review it now.

 Albeit, to no avail.

Nothing is ever quite useless, for the stone which the builders rejected
may become the cornerstone.  (Psalm 118 verse 22)

-- 
John Cowan  http://www.ccil.org/~cowanco...@ccil.org
Is not a patron, my Lord [Chesterfield], one who looks with unconcern
on a man struggling for life in the water, and when he has reached ground
encumbers him with help?--Samuel Johnson

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss


[r6rs-discuss] What is meant by the entire tower of subtypes?

2014-04-21 Thread John Cowan
The R7RS-large committee is trying to sort out what R6RS Section 3.4
means by its first two sentences:

Implementations of Scheme must support number objects for
the entire tower of subtypes given in section 3.1. Moreover,
implementations must support exact integer objects and exact
rational number objects of practically unlimited size and
precision, and to implement certain procedures (listed in 11.7.1)
so they always return exact results when given exact arguments.

Does this mean that implementations may arbitrarily restrict the ranges
of non-real numbers?  All the procedures mentioned in 11.7.1 are closed
over the real numbers (except for division by zero), so they cannot
force the existence of non-real numbers.

3.4 explicitly says Implementations may support only a limited range
of inexact number objects of any type, subject to the requirements of
this section.  That would seem to bless having exact (or some exact)
but not inexact non-real numbers.

Of the implementations that aim at R6RS conformance, all but Guile support
effectively unlimited exact and IEEE-limited inexact complex numbers;
Guile supports only the latter.  By what I understand, people who need
to use complex numbers typically care much more about inexact numbers
than exact ones.  In particular, Fortran, C++, and NumPy support only
the inexact kind.

I'd appreciate authoritative, or even non-authoritative but convincing,
explanations of what R6RS means to imply here.

-- 
John Cowan  http://www.ccil.org/~cowanco...@ccil.org
Statistics don't help a great deal in making important decisions.
Most people have more than the average number of feet, but I'm not about
to start a company selling shoes in threes. --Ross Gardler

___
r6rs-discuss mailing list
r6rs-discuss@lists.r6rs.org
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss