emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jude DaShiell <jdashiel@panix.com>
To: Tim Visher <tim.visher@gmail.com>, Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: how to document/comment a complex org table formula
Date: Mon, 5 Jul 2021 11:20:24 -0400	[thread overview]
Message-ID: <alpine.NEB.2.23.451.2107051116350.26254@panix1.panix.com> (raw)
In-Reply-To: <CAHa53uwcWesXHjpECqyqD9wLsX+2SpN3C3hNL7JtupR-zvwBTg@mail.gmail.com>

Why not use functional narrative form to document complex formulas?
formula name:
formula function:
formula uses:
formula returns:
usually one line of text for each of those.  I know, this comes from
structured programming where no block of actual code is supposed to go
above 50 lines and that for many people cramps their styles.  It makes
maintenance a little easier though.


On Mon, 5 Jul 2021, Tim Visher wrote:

> On Mon, Jul 5, 2021 at 10:14 AM Eric S Fraga <e.fraga@ucl.ac.uk> wrote:
>
> > Sorry; I cannot help you directly.
> >
> > My rule of thumb is that if formulas are getting too complex to
> > understand/recall clearly, it's time to use a proper programming
> > language instead.  The nice thing about org is you can have tables as
> > inputs to and outputs of src blocks...
> >
> > My papers often have awk source blocks that process tables to generate
> > statistics for some (numerical) experiments.
> >
> > Spreadsheets, org tables being an example of such, are brilliant tools
> > for simple calculations but are pretty much "write only programming
> > languages".
> >
>
> I had never heard of using an org table as input into a source block.
> That's really interesting.
>
> The OP also poses an interesting idea that I have occasionally wanted. I
> have generally accomplished this by simply including the documentation
> above or below the table. In other words just having human text around it
> that says 'This =formula= bit is because of X'.
>
> But the idea of a multiline TBLFM syntax seems to be already be almost
> supported. I was mildly shocked to find that this mostly works
>
> ```
> |---+---|
> | a | 1 |
> | b | 3 |
> |---+---|
> |   | 4 |
> #+TBLFM: @2$2=@-1*3
> #+TBLFM: @3$2=vsum(@I..II)
> ```
>
> Note that I don't need the usual `::` separation between formulas. Where it
> breaks down is that I can't seem to reevaluate the whole table's formula by
> whacking `C-u C-c C-c` anymore and, obviously, there's no syntax for adding
> comments. Also I doubt that I'd be able to use any of org's keys for
> editing formulas. I wonder how hard it would be to extend org's
> understanding of the TBLFM to allow for this kind of syntax.
>
> Once you had it then adding a comment character to it should be very simple.
>
> --
>
> In Christ,
>
> Timmy V.
>
> https://blog.twonegatives.com
> http://five.sentenc.es
>


  reply	other threads:[~2021-07-05 15:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-04 19:14 Uwe Brauer
2021-07-05 14:13 ` Eric S Fraga
2021-07-05 14:45   ` Uwe Brauer
2021-07-05 14:55   ` Tim Visher
2021-07-05 15:20     ` Jude DaShiell [this message]
2021-07-05 17:10       ` Uwe Brauer
2021-07-05 17:24         ` Jude DaShiell
2021-07-05 15:39     ` Eric S Fraga
2021-07-05 17:08     ` Uwe Brauer
2021-07-05 17:12 ` Karl Voit
2021-07-05 19:35   ` Uwe Brauer
2021-07-05  5:31 CHARPENTIER Emmanuel via General discussions about Org-mode.
2021-07-05  6:29 ` Uwe Brauer
2021-07-08 20:19   ` Nick Dokos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.NEB.2.23.451.2107051116350.26254@panix1.panix.com \
    --to=jdashiel@panix.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tim.visher@gmail.com \
    --subject='Re: how to document/comment a complex org table formula' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).