errata/288: 4.1.14, replication operator and function calls

From: Brad Pierce (Brad.Pierce@synopsys.com)
Date: Sun Feb 23 2003 - 14:11:36 PST

  • Next message: Shalom Bresticker: "Re: enhancement/287: `compatibility - backward compatibility compiler directives"

    Precedence: bulk

    >Number: 288
    >Category: errata
    >Originator: "Brad Pierce" <Brad.Pierce@synopsys.com>
    >Environment:
    >Description:

    According to 4.1.14, "If the replication operator is used
    on a function call operand, the function need not be
    evaluated multiple times. ... This is another form of
    expression evaluation short-circuiting."

    Section 4.1.4 describes short-circuiting as "if the final
    result of an expression can be determined early, the entire
    expression need not be evaluated".

    If the return value of the function can depend on side-effects
    such as some local state information, then it may not be
    true that the final result of { f(x) , f(x) , f(x) , f(x) }
    can be determined early.

    Why not require that a function call in a multiple concatenation
    be evaluated exactly once?

    The situation is analagous to the C-language "A[f(i)] += 5", which
    is not just syntactic sugar for "A[f(i)] = A[f(i)] + 5".

    -- Brad



    This archive was generated by hypermail 2.1.4 : Sun Feb 23 2003 - 14:20:53 PST and
    sponsored by Boyd Technology, Inc.