[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Number syntax

One irritant in the Report that we have neglected to comment on until
now (sorry!) is the syntax of numbers.  We believe that Scheme numbers
are essentially equivalent to Common Lisp numbers except for the new
notion of exactness.  To the extent that that is so, it seems to be a
(shudder!) ``gratuitous difference'' from Common Lisp to have an
incompatible syntax.

The R^3RS doesn't make clear which subset of the syntax of numbers is
essential and what is optional.  As implementors of systems in which
Scheme and Common Lisp must co-exist, we're faced with two potential
compatibility issues: (1) going with an ``extended subset'' of the
Report's number syntax that is compatible with Common Lisp, or (2)
going with the full number syntax in the Report to be compatible with
all other Scheme implementations.

What we'd like to see is an essential syntax for numbers which is
compatible with Common Lisp's.  Additional features, including
exactness, would be optional extensions.  Even so, they should not
conflict with Common Lisp.  For example, the use of `#s' and the order
of <sign> and <prefix> are different in the two languages.

Our motivation, of course, is that we'd like programmers to feel free to
use either language and exchange files of data without irritating
obstacles being thrown in their path.  If we can't agree on a
consistent syntax for numbers, then we'll have to provide each language
with two readers and the user will have to know which one to use.

(There are other problems, of course, such as whether `:' is a
constituent of an identifier or associated with Common Lisp package
designations.  We may have to go with separate readers/modes anyway.)

Does anyone agree with us?  Is there time to make such a change before
R^3RS goes to press?

David Bartley,
Mark Meyer