fix: Always compute cells without clocked expressions using current values (#91)
Prior to this change, when a cell was clocked, it was always computed with prior values of referred-to cells. This had the effect, for example, of making cells defined only with a base expression as a total of a column, for example, to be out-of-date in that they would take on the value of the total of the prior values of the column, not the total of new current values of the column. This behavior was very counterintuitive. With this change, updates of cells that have no clocked expression are delayed until after clocked expressions have been recomputed based on prior values and their cells' current values have been updated. Then the computations of those base-only cells use all of the new current values, leaving the spreadsheet in a (maximally) self-consistent state. Resolves #90. Co-authored-by: Glen Whitney <glen@studioinfinity.org> Reviewed-on: #91
This commit is contained in:
parent
da48b4c4f8
commit
7b794f90b9
5 changed files with 222 additions and 39 deletions
16
NEWS
16
NEWS
|
@ -6,6 +6,13 @@ The changes compared to 2.3.0 are:
|
|||
o Added examples updating the life simulation to illustrate the color and
|
||||
computed style features.
|
||||
o You can compute the styles for cells, with an additional expression per cell.
|
||||
o Computation of current values for cells without clocked expressions now
|
||||
always depends on contemporaneous current values rather than prior values,
|
||||
even when the sheet is clocked. This means, for example, an entry whose base
|
||||
value is the sum of a column and which has no will always resolve to the
|
||||
current sum of that column, even if the column contains clocked values.
|
||||
(This is a breaking change in that prior to this modification, such a cell
|
||||
when clocked would contain the sum of the prior values in that column.)
|
||||
o New token types: style and bool.
|
||||
o Comparison operators return bool rather than int (Note this can be a breaking
|
||||
change; you may need to wrap comparisons in int() if you are using the result
|
||||
|
@ -21,8 +28,13 @@ o Addition of hexact float format, which allows for exact round trips to ASCII
|
|||
o New token type: funcall (which basically amounts to an expression). This
|
||||
allows parsed rather than unparsed expressions to be stored in cells, and
|
||||
allows macros which receive their arguments unevaluated.
|
||||
o sum(), min(), and max() can now operate over their list of arguments as well
|
||||
as over a block.
|
||||
o New region/accumulator operation count() that counts truthy cells (rather
|
||||
that just nonempty cells as n() does) added.
|
||||
o All region/accumulator operations including sum(), min(), and max() can
|
||||
now operate over their list of arguments as well as over a block.
|
||||
o All region/accumulator operations can take an optional expression when
|
||||
operating over a block that generates the values to be accumulated (rather
|
||||
than just taking the values directly from the block).
|
||||
o Added floor(), ceil(), trunc(), and round() functions for finding integers
|
||||
associated with doubles, eliminating (note possible breaking change) the
|
||||
int conversion with two rounding directions.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue