[Remind-Fans] Getting reminders at random

Dianne Skoll dianne at skoll.ca
Mon Mar 30 08:48:50 EDT 2020


On 2020-03-30 01:19, Neal Fultz wrote:

> I've added a new function to remind to call the C RNG, to be
> reminded of things at a random date. I guess someone else asked
> about this in 2001?

Huh.  I confess I cannot see a use-case for this, and because of various
gotchas, I don't think I'll merge this in.  It's also practically impossible
to write portable regression tests for this because they depend on the details
of the C library's rand() function.

> REM  SATISFY [randint(7) == $Tw] MSG random day of week.%
> 2020/04/11 random day of week.

> I don't quite get why 4/11 would be chosen by SATISFY in the first
> run, wouldn't 4/4 be the next Saturday? Perhaps the expression is
> reevaluated and advancing the RNG, iterating past 4/4 and
> essentially doing rejection sampling with p=1/7?

That's one of the gotchas.  Run Remind with the "-dtx" flag to debug
trigger-date calculation and expression evaluation, and that will make
clear what's happening.

Regards,

Dianne.


More information about the Remind-fans mailing list