Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Include language bindings? Draft Standard Text, V02.1



Dan Zuras gave the example:
    pp = ((((c0*xx + c1)*xx + c2)*xx + c3)*xx + c4)*xx + c5;
and pointed out:
    However, as we discussed at length in the stds-1788-er
    subgroup, the resulting interval would be unnecessarily wide
    unless one recognises that each instance of the interval
    variable 'xx' are the SAME variable.  That is, all of the
    instances co-vary rather than vary independently of one
    another.

Baker replied:
> My view in the past is that the reformulation is the responsibility of
> the programmer.  Although this greatly simplifies compiler writing, ...

The problem is that the language may have no means for the programmer
to do this reformulation -- at least not completely.

Perhaps what is needed is a language-specified way to signal that, in
a given context (expression, block, etc.), different mentions of the
same variable do stand for the same entity, literally.  Among other
things this would cause a C compiler to flag self-increment (x++) in
contexts where both "before" and "after" instances are referred to.

What we don't want is for a compiler to try to be "smart", and deduce
that two instances of a variable are the same entity in some contexts
but not others, with no clue to the programmer as to what these rules
are.

Michel.
---Sent: 2010-03-16 19:41:12 UTC