Scriptsheets

Matt Birkholz matt at birchwood-abbey.net
Thu Nov 2 14:40:17 MST 2017


On Thu, 2017-11-02 at 17:51 +0000, trent shipley wrote:
> Right, it's not scripting using a classic programming environment,
> like VBA, the BASIC that comes with LibreOffice, or  Python. 
> 
> The idea is that you extend the spreadsheet idiom to program the
> spreadsheet from a sheet or virtual workbook in the spreadsheet
> without leaving the spreadsheet to work in a classical imperative
> programming environment like VBA or Python.
> 
> 
>   |A               | B              | C              | 
> 1|PARAMETERS(B1,C1)|<put input here>|<put input here>| 
> 2|                 |                |                |
> 3|RETURN(B1*C1)    |                |                |
> FUNCTION SHEET("MY_FUNCTION")

That is very reminiscent of Emacs' Org-mode, which has plain text
spreadsheets like the above.  With a key stroke or three a "source code
block", a script written in any of a variety of languages, can be fed
such tables and the results captured in the document as text, table,
plot...

There is a cool org-mode document demonstrating genetic drift using R
plots and a little LaTeX for an equation.  Here it is rendered for the
web.

http://www.stats.ox.ac.uk/~davison/software/org-babel/drift.org.html

People use org-mode for everything from literate programming to
reproducible research to organizing their lives (calendars and task
lists).

http://orgmode.org/

> You have data, it's a spreadsheet.
> The moral equivalent of sequence is referencing another cell,
> including one that contains a function.
> You have selection with the IF() function.

You speak of morality and then call IF a function.  Blasphemer!

> With the addition of just two keywords, PARAMETERS and RETURN you
> have real functions.

What's a "key word"??

> You have looping with functions calling themselves (recursion), and
> possibly circular references.
> 
> My understanding is that's a complete programming paradigm.

Fun!  Can you do it with coconuts?



More information about the PLUG-discuss mailing list