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

Re: expression evaluation



David Hough 754R work <754r@xxxxxxxxxxx> wrote:

http://754r.ucbtest.org/drafts/archive/2006-10-04.pdf

Its present form in the unpublished BRC draft
is little changed from that, except those annexes are now labeled normative.

Let's start at the beginning and point out a FEW of the problems :-(

B.1

Paragraph 1 doesn't allow for languages with dynamic types, from LISP to
Perl and Python.  Even when a destination is a 'variable', the type is
taken from the expression.  It also doesn't allow for any language where
an expression may be evaluated in a context (e.g. Fortran or C array
indices), where there may be a target type or collection of target types
but no target variable.  And in Fortran, such a context is not a single
type.

I have posted before why the last paragraph is unacceptable; Fortran
essentially does not have the CONCEPT of a canonical execution order,
nor does C++ comes very close to that as far as initialisation and
destruction are concerned (which affects exception flagging).

B.2

The literal meaning of the source code in Fortran, C and C++ does not
include many aspects of the order of evaluation and whether certain
expressions are evaluated at all.  For example, if X is 0.0 and Y is
1.0e200, X*Y*Y*X need not be evaluated, and could simply be replaced
by zero, thus losing the overflow.

B.3

The first paragraph makes no sense in languages that don't have
Algol 68 / Genstat / C assignment expressions.

The last paragraph makes no sense for languages like Python.

C

"An implementation should provide a WidenTo method for each supported
non-storage format."  What on EARTH does that mean for a language that
does not have a C-like model of arithmetic, such as Fortran?

It doesn't even have a definition that can be reliably tied to C99 :-(


Regards,
Nick Maclaren,
University of Cambridge Computing Service,
New Museums Site, Pembroke Street, Cambridge CB2 3QH, England.
Email:  nmm1@xxxxxxxxx
Tel.:  +44 1223 334761    Fax:  +44 1223 334679

754 | revision | FAQ | references | list archive