3 ms·
Hmm, so cell formulas, custom formula implementations, and presumably named cell ranges, all use the same language, a concatenative language? And all are writt
by mncharity 6y ago
Hmm, so cell formulas, custom formula implementations, and presumably named cell ranges, all use the same language, a concatenative language? And all are written in cells rather than (the latter two) as auxiliary data?
I wonder, for formulas, if word stack effects are known or inferred, might the language simply be syntactic sugar? So `A:| 3 | 5 | negate | plus |` desugars as `| 3 | 5 | =negate(A2) | =plus(A1,A3) |`. Because the stack effects of negate and plus are known to be x-x and xx-x respectively. Factor is an example of a concatenative language with explicit stack effects. It does sacrifice allowing variadic words.
Might a range of code cells serve as a code block? In a concatenative language, evaluating a word simply pushes its definition on the stack. So if `A:| 1 | + |` and `B:| 2 push(A1:A2) |` then B1 would expand as `2 1 +`. So perhaps named ranges and custom formula definition are then overlapping concepts?
Meta: I find it curious that this post, variously submitted a day ago, and again at 1/2 and 1/4 day ago, were all at 1 or 2 points with no comments, and then this, the first submitted, surged to popularity. I'm glad it "caught".
- dang 6y ago(on that last bit: we put it in the second-chance pool, described at https://news.ycombinator.com/item?id=11662380 https://news.ycombinator.com/item?id=11662380, so it got an automatic placement on the front page. When we do that, we usually pick the earliest submission, modulo some technical limitations that kick in after a few days.)