On 11.02.2013 17:10, Andrea Pescetti wrote:
Andre Fischer wrote:
If the spec said that 2 is the only valid return value then we would
have to return 2.
But then, since we also read XLSX and the OOXML standard prescribes
that 0 ^ 0 should return an error, returning an error would be the
common ground here: of course we don't want to depend on the file
format, so choosing something where the standards agree makes sense.
(As Dennis noted, Excel returns an error indeed, but a different one
than what the OOXML specification prescribes... so this seems a
difficult question there too!).
Fair point.
We should change the ODF spec first instead. A spec that basically says
"whatever you want to return is fine" is of no value, as was proven in
this thread.
A specification may need to leave room for implementation-defined
behavior. Look at the C or C++ standard for example.
Do you know of any example where this is actually a good thing?
ODF is indeed not too strong (I didn't check all details, but I think
it might be possible to have Calc evaluate ="two"+"two" as "five" -or
"four" for that matter- and not break the ODF specification), but this
doesn't necessarily mean that the standard is flawed, only that it
admits implementations that differ on this detail.
It probably depends on who uses a spec. A user to find out what the
result of a certain operation should be. Or a developer implementing
the spec. For the later it might be good to have some freedom. A user
might prefer a spec that clearly states what the expected result for a
given set of arguments is. Especially when that result is not canonical
like 1+1=2.
-Andre