aboutsummaryrefslogtreecommitdiff
path: root/lib/rites/rite_ef/lectionary_ef.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rites/rite_ef/lectionary_ef.ml')
-rw-r--r--lib/rites/rite_ef/lectionary_ef.ml25
1 files changed, 19 insertions, 6 deletions
diff --git a/lib/rites/rite_ef/lectionary_ef.ml b/lib/rites/rite_ef/lectionary_ef.ml
index 02c3c64..37ec1d8 100644
--- a/lib/rites/rite_ef/lectionary_ef.ml
+++ b/lib/rites/rite_ef/lectionary_ef.ml
@@ -49,12 +49,25 @@ let readings ~lectionary ~observed ~temporal ~date ~temporal_at =
records the ferial-Mass selection rule itself as unconfirmed
against the primary source.
- Termination: guarded on weekday. A Sunday reaching this branch
- would compute [days_since_sunday Sun = 0] and look up ITSELF,
- looping forever -- every other step in the chain consults data
- (a lectionary lookup), this is the only one that consults
- another date, so this guard is the whole chain's termination
- argument, not merely a special case.
+ Guarded on weekday, but NOT because a Sunday reaching this
+ branch would loop (fix round 1, coordinator review: the
+ original comment here claimed exactly that, and it was wrong).
+ [readings] is not recursive -- step 3's fallback is one flat
+ [Lectionary.find], never a re-entrant call into [readings] --
+ so without the guard, [days_since_sunday Sun = 0] would just
+ repeat the SAME [Lectionary.find] step 2 already ran and
+ already got [None] from (same pure inputs, same date), and
+ return [] once, normally. The chain as a whole terminates
+ because every step either consults data (a lookup) or, here,
+ a strictly EARLIER date via [temporal_at] -- no step ever calls
+ back into [readings] itself, so there is no recursion anywhere
+ in this function for a cycle to form in the first place. The
+ real reason for the guard is simpler: a Sunday has no
+ PRECEDING Sunday to resume -- consulting itself would be
+ meaningless (it would re-ask the question step 2 just
+ answered), not dangerous, so the guard exists to make that
+ intent explicit rather than to prevent a runaway loop that was
+ never actually possible.
The preceding Sunday's TEMPORAL slug, never its observed one:
the rubric is the preceding Sunday's Mass even in a year when a