[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

*Subject*: **[OASIS Issue Tracker] Updated: (OFFICE-2470) 3.2 ExpressionCalculation is a mixure of observations, rules and possible suggestions -NEEDS-DISCUSSION**

*From*:**OASIS Issues Tracker <workgroup_mailer@lists.oasis-open.org>***To*: office@lists.oasis-open.org*Date*: Tue, 2 Nov 2010 18:44:25 -0400 (EDT)

[ http://tools.oasis-open.org/issues/browse/OFFICE-2470?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] David Wheeler updated OFFICE-2470: ----------------------------------- Proposal: NOTE: This is a revised proposal by David A. Wheeler, which attempts to merge the proposals by Eike, Wheeler, Patrick D., and others into a single clear result. Fix Section 3.3 item 1.2 has some syntax errors, where it uses =ABS(A1:C1) instead of =ABS([.A1:.C1]) and so on. Change entire section 3.2 Expression Calculation to: Expressions in OpenFormula *shall* be evaluated by application of the following rules: 1. If an expression consists of a constant Number (per section 5.3), a constant String (per section 5.4), a Reference (per section 5.8), or constant Error (per section 5.12), the value of that type is returned. 2. If an expression consists of one or more operations (per sections 5.5 and 5.9), apply the operators in order of precedence and associativity as defined by Table 1 in 5.5 (Operators). Precedence of operators may be altered by the use of "(" (LEFT PARENTHESES, U+0028) and ")" (RIGHT PARENTHESES, U+0029) to group operators. Evaluate the operator as described below. 3. If an expression consists of a function call (per section 5.6 and 5.7), evaluate the function as described below. 4. If an expression consists of a named expression (per section 5.11), the result of evaluating the named expression is returned. 5. If an expression consists of an QuotedLabel (per section 5.10), AutomaticIntersection (per section 5.10), or Array (per section 5.13), its value is returned per section 5. Operators and functions in OpenFormula are evaluated according to their definitions by applying the following rules: 1. The values of all argument expressions are computed. Exceptions to computation of all arguments are noted in a function's specification. Note: The practice of computing all argument expressions is known as "eager" evaluation. The IF function is an example of a function that does not require computation of all arguments. 2. If an argument expression evaluates to Error, calculation of the operator or function may short-circuit and return the Error if the function does not suppress error propagation as noted in the function's specification. 3. If an operator or function is passed a value of incorrect type, call the appropriate implicit conversion function to convert the value to the correct type. If conversion is not possible, generate an Error. 4. The function or operation is called with its argument expressions' results (per rule 1), and the result of the function or operation is the evaluation of the expression. Once evaluation has completed: 1. If the result is a Reference and a single non-reference value is needed, it is converted to the referenced value per the rules of section 3.3 (Non-Scalar Evaluation) item 1.2. 2. If the result is an Array, for the display area the rules of section 3.3 (Non-Scalar Evaluation) item 1.1 apply. was: NOTE: This is a revised proposal by David A. Wheeler, which attempts to merge the proposals by Eike, Wheeler, Patrick D., and others into a single clear result. Fix Section 3.3 item 1.2 has some syntax errors, where it uses =ABS(A1:C1) instead of =ABS([.A1:.C1]) and so on. Change entire section 3.2 Expression Calculation to: Expressions in OpenFormula *shall* be evaluated by application of the following rules: 1. If an expression consists of a constant Number (per section 5.3), a constant String (per section 5.4), a Reference (per section 5.8), or constant Error (per section 5.12), the value of that type is returned. 2. If an expression consists of one or more operations (per sections 5.5 and 5.9), apply the operators in order of precedence and associativity as defined by Table 1 in 5.5 (Operators). Precedence of operators may be altered by the use of "(" (LEFT PARENTHESES, U+0028) and ")" (RIGHT PARENTHESES, U+0029) to group operators. Evaluate the operator as described below. 3. If an expression consists of a function call (per section 5.6 and 5.7), evaluate the function as described below. 4. If an expression consists of a named expression (per section 5.11), the result of evaluating the named expression is returned. 5. If an expression consists of an QuotedLabel (per section 5.10), AutomaticIntersection (per section 5.10), or Array (per section 5.13), its value is returned per section 5. Operators and functions in OpenFormula are evaluated according to their definitions by applying the following rules: 1. The values of all argument expressions are computed. Exceptions to computation of all arguments are noted in a function's specification. Note: The practice of computing all argument expressions is known as "eager" evaluation. The IF function is an example of a function that does not require computation of all arguments. 2. If an argument expression evaluates to Error, calculation of the operator or function may short-circuit and return the Error if the function does not suppress error propagation as noted in the function's specification. 3. If an operator or function is passed a value of incorrect type, call the appropriate implicit conversion function to convert the value to the correct type. If conversion is not possible, generate an Error. 4. The function or operation is called with its argument expressions' results (per rule 1), and the result of the function or operation is the evaluation of the expression. Once evaluation has completed: 1. If the result is a Reference and a single non-reference value is needed, it is converted to the referenced value per the rules of section 3.3 (Non-Scalar Evaluation) item 1.2 apply. 2. If the result is an Array, for the display area the rules of section 3.3 (Non-Scalar Evaluation) item 1.1 apply. > 3.2 Expression Calculation is a mixure of observations, rules and possible suggestions - NEEDS-DISCUSSION > --------------------------------------------------------------------------------------------------------- > > Key: OFFICE-2470 > URL: http://tools.oasis-open.org/issues/browse/OFFICE-2470 > Project: OASIS Open Document Format for Office Applications (OpenDocument) TC > Issue Type: Bug > Components: OpenFormula > Affects Versions: ODF 1.2 CD 05 > Reporter: Patrick Durusau > Assignee: Eike Rathke > Fix For: ODF 1.2 CD 06 > > > 3.2 Expression Calculation is a mixture of observations, rules and possible suggestions. > For example, it starts by saying formulas are recalculated from "outside in," only to confess a few paragraphs later that is how it "appears to the end user." > There is one really glaring hole in my proposal, that also exists in the current language. > We describe the ordering of operators but as far as I can tell, we don't address the situation where there is a mixture of operators and functions. > Note that I changed #1 from constant number/string and added error. > As near as I can determine, the only possible outcomes of any expression are: > 1) a number > 2) a string > 3) an error > 4) a reference > So, application of these rules self-terminates when any of those conditions obtain. > Yes, that removes "constant number," "constant string" but those are defined elsewhere anyway. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://tools.oasis-open.org/issues/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]