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.
_______________________________________________
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