I wonder whether it would be possible to extend this concept to get more powerful features, inspired by spreadsheets (and programming languages maybe). Sometimes you need more than a sum or an average, but writing out the formulas in full, repeatedly, seems like a lot of cognitive overhead.
I see in this thread that Emacs org-mode has something like it, but I'm not convinced that stuff like
#+TBLFM: @2$4=vmean($2..$3)
matches the humane, readable, Markdown-esque approach that I'd want to use.
Clever solution - technically. For trips with my friends we use a "money-pot" system where everyone pays a fixed amount into a pot before the trip and everything we do or buy together is paid out of this pot. After the trip the calculation is much easier - refund = (remaining amount / persons) ;-)
The program needn't be a shell script invoking awk--you can use a "shebang" line to make the entire thing an awk file. This will help if you use an editor which understands awk syntax (for highlighting etc.). Of course in 1981 you probably didn't have such luxuries, but today we can just remove the "exec awk", the outer quotes and $1, and put this as the first line:
I wonder whether it would be possible to extend this concept to get more powerful features, inspired by spreadsheets (and programming languages maybe). Sometimes you need more than a sum or an average, but writing out the formulas in full, repeatedly, seems like a lot of cognitive overhead.
I see in this thread that Emacs org-mode has something like it, but I'm not convinced that stuff like
matches the humane, readable, Markdown-esque approach that I'd want to use.