commit
message
[TODO.md] documenting strategy for building out meta-functions
author
Ben Vogt <[email protected]>
date
2017-07-09 14:58:04
stats
1 file(s) changed,
16 insertions(+),
7 deletions(-)
files
TODO.md
1diff --git a/TODO.md b/TODO.md
2index c1460f9..fb09647 100644
3--- a/TODO.md
4+++ b/TODO.md
5@@ -28,9 +28,8 @@ For example `=#N/A` should force an error to be thrown inside the cell.
6
7
8 ### Meta-Formulas to write
9-In general, many of these formulas can be written by allowing the Sheet and Parser to return Cell objects in addition to primitive types.
10+Many of these formulas can be written by allowing the Sheet and Parser to return Cell objects in addition to primitive types. There are some memory issues with doing this. If a user calls something like `ISNA(A1:A99999)` we really only need the first cell. So we should return cell objects in some cases, but it would be easier in most cases to have context aware formulas, so if they need a cell, or a reference, we simply skip looking up a reference, and instead return a reference, or just a single cell. One way to do this would be to have formula functions, and then on the side have formula args. So before we lookup a large range of cells, we can check to see if it needs all of them, or if it just cares about the first one. So for `ISNA` we could look at `FormulaArgs.ISNA[0]` to get `Value` so we know that it needs only a single argument that is not an array, so if we call it with `ISNA(A1:A99999)`, it would really only lookup `A1`. This might be premature optimization however.
11
12-* ISREF - Should be handled at a Parser/Sheet level. If the Parser or Sheet is able to fetch a cell -- even if it's empty -- this function should return true.
13 * ERROR.TYPE - Fetch actual cell to check for error, which requires changes in Parser and Sheet. If the returned cell doesn't have an error, then it should throw NA.
14 * ISBLANK - Requires changes to Parser/Sheet. If we fetch a cell, and it is "blank", return true. Could be implemented by adding a field to cells indicating if they're blank. Right now empty cells are causing errors because they don't exist. We should allow users to fetch empty cells, they should just be considered blank, or undefined, or null.
15 * ISERR - Requires changes to Parser/Sheet to either wrap enclosed functions in try-catch, or fetch actual cell value, and check it's error field.
16@@ -39,20 +38,21 @@ In general, many of these formulas can be written by allowing the Sheet and Pars
17 * ISNA - Requires changes to Parser/Sheet for similar reasons to ISERR; check reference cell value or error field.
18 * TYPE - Requires changes to Parser/Sheet to allow for values or cells to be returned to the function. If it's a value, return the value type. If it's a cell, return the value or error inside it.
19 * CELL - Requires changes to Parser/Sheet so that the raw cell is returned to the function. The raw cell should contain all information necessary for returning specified info.
20-* IFERROR - Requires changes to Parser/Sheet for similar reasons to ISERR.
21-* ADDRESS - Requires changes to Parser/Sheet
22-* COLUMN - Requires changes to Parser/Sheet
23-* COLUMNS - Requires changes to Parser/Sheet
24-* HLOOKUP - Requires changes to Parser/Sheet
25-* INDEX - Requires changes to Parser/Sheet
26-* INDIRECT - Requires changes to Parser/Sheet
27-* LOOKUP - Requires changes to Parser/Sheet
28-* MATCH - Requires changes to Parser/Sheet
29-* OFFSET - Requires changes to Parser/Sheet
30-* ROW - Requires changes to Parser/Sheet
31-* ROWS - Requires changes to Parser/Sheet
32-* VLOOKUP - Requires changes to Parser/Sheet
33-* COUNTBLANK - Requires changes to to Parser/Sheet so when we iterate through a range to return an array, we call a special function that accumulates all values, black/null/undefined or otherwise.
34+* IFERROR - similar reasons to ISERR.
35+* ADDRESS
36+* COLUMN
37+* COLUMNS
38+* HLOOKUP
39+* INDEX
40+* INDIRECT
41+* LOOKUP
42+* MATCH
43+* OFFSET
44+* ROW
45+* ROWS
46+* VLOOKUP
47+* COUNTBLANK - Requires changes to to Parser/Sheet so when we iterate through a range to return an array, we call a special function that accumulates all values, blank/null/undefined or otherwise.
48+
49
50 ### Formulas to write
51 * SERIESSUM