Please enhance the PURGE MODE message from this:

    #!P: Next line may have expired, but contains non-constant expression
    #!P: or a relative SCANFROM clause

to this more helpful explanation:

    #!P: Next line may have expired, but contains a variable, or
    #!P: a non-constant expression, or a relative SCANFROM clause

I had no idea that PURGE MODE couldn't handle a constant variable assignment, 
and the message and the man page didn't suggest this limitation either.

In fact, delete the whole "may have expired" bit, since PURGE MODE has no idea:

    #!P: Next line ignored because the date contains a variable,
    #!P: a non-constant expression, or a relative SCANFROM clause

The man page would benefit from having some or all of your explanation below 
added to it under "PURGE MODE", especially the information in the first 
paragraph:

  However, in Purge Mode, Remind analyzes the file one line at a time.
  It does not do any sort of data flow analysis to see what was assigned
  earlier to a variable.  So when it sees a variable in an expression, it
  takes no chances and assumes that the value it holds could potentially
  depend on today's date.

On Mon, May 19, 2025 at 10:21:46AM -0400, Dianne Skoll wrote:
> On Mon, 19 May 2025 03:11:13 -0400
> "Ian! D. Allen" <[email protected]> wrote:
> 
> > If this is me misunderstanding something, please post your
> > explanation to the whole Remind list so we all learn from my
> > ignorance.
> 
> > Please explain what is non-constant about SET d "May  9 2025" ?
> 
> > $ cat test
> > REM May 9 2025 MSG FOO
> 
> > SET d "May  9 2025"
> > REM [d] MSG FOO
> 
> > $ remind -j test
> > $ cat test.purged
> > #!P: Expired: REM May 9 2025 MSG FOO
> 
> > SET d "May  9 2025"
> > #!P: Next line may have expired, but contains non-constant expression
> > #!P: or a relative SCANFROM clause
> > REM [d] MSG FOO
> 
> Nothing is non-constant about: SET d "May 9 2025"
> 
> However, in Purge Mode, Remind analyzes the file one line at a time.  It
> does not do any sort of data flow analysis to see what was assigned
> earlier to a variable.  So when it sees a variable in an expression,
> it takes no chances and assumes that the value it holds could
> potentially depend on today's date.
> 
> While you and I can easily see that d won't depend on today's date,
> Remind can't.
> 
> We could make Remind do extra book-keeping... suppose whenever we assign
> a variable, we also keep track of whether it's being assigned a
> constant. That still won't work:
> 
>      IF today() == 2025-05-19
>          SET d "1 January 1990"
>      ELSE
>          SET d "1 January 2045"
>      ENDIF
>      REM [d] MSG Hi
> 
> If we ran Remind in Purge Mode on 2025-05-19, it might incorrectly
> expore the REM command.  So we'd also need to check if an assignment
> happens in a branch of code whose reachability depends on today's date.
> 
> Then we have edge-cases like this:
> 
>     IF today() > (today() - 2)
>        ...
> 
> A human can clearly see that the result of the IF expression is always
> true, but Remind can't do that sort of analysis and therefore will
> incorrectly assume that the body of the IF might not be executed
> depending on the date.
> 
> So: I decided to forget about all the edge-cases and have Remind avoid
> purging a reminder if there's any chance at all of the expression
> depending on today's date.  As per the man page:
> 
>     Determining which reminders have expired is extremely tricky.
>     Remind does its best, but you should always compare the .purged
>     file to the original file and hand-merge the changes back in.
> 
>     In situations where Remind cannot reliably determine that
>     something was expired, you may see the following comments inserted
>     before the problematic line:
> 
> So unfortunately, Purge Mode is imperfect and may need some human
> assistance.
> 
> Regards,
> 
> Dianne.

-- 
| Ian! D. Allen, BA-Psych, MMath-CompSci  [email protected] Ottawa CANADA
| Home: www.idallen.com  Contact Improvisation Dance: www.contactimprov.ca
| Former college professor of Free/Libre GNU+Linux @ teaching.idallen.com
| Improve democracy www.fairvote.ca and defend digital freedom www.eff.org
_______________________________________________
Remind-fans mailing list
[email protected]
https://dianne.skoll.ca/mailman/listinfo/remind-fans
Remind is at https://dianne.skoll.ca/projects/remind/

Reply via email to