From e45fec6778c1e483a73fb0f3652435f13b223f79 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 27 May 2026 21:47:19 -0500 Subject: refactor: take card-state in org-drill-determine-next-interval-simple8 Stage 5 of #147, closing the scheduler migration. simple8 now takes (state quality &optional delta-days) instead of seven positional args, binding the recall fields from the struct at the top so the algorithm body is unchanged. simple8 doesn't use ease, so the binding skips that slot. Both call-site branches collapse to (state quality [delta-days]), dropping the per-branch accessor unpacking. The testutil adapter test-scheduler--call-simple8 keeps the simple8 test calls a one-symbol rename per site. One direct simple8 call in tests/test-org-drill-prompt-and-format-helpers.el now uses the new struct API inline. With this stage landed, all three schedulers, the item-data round-trip, and every test caller go through the org-drill-card-state struct, finishing #147. --- tests/test-org-drill-prompt-and-format-helpers.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/test-org-drill-prompt-and-format-helpers.el') diff --git a/tests/test-org-drill-prompt-and-format-helpers.el b/tests/test-org-drill-prompt-and-format-helpers.el index 3bd3e5a..91e076c 100644 --- a/tests/test-org-drill-prompt-and-format-helpers.el +++ b/tests/test-org-drill-prompt-and-format-helpers.el @@ -105,7 +105,11 @@ next-interval is multiplied by a small dispersal factor (≠1.0 in general)." (cl-letf (((symbol-function 'org-drill-random-dispersal-factor) (lambda () 1.5))) (let* ((result (org-drill-determine-next-interval-simple8 - 4.0 1 5 0 5.0 1 0)) + (make-org-drill-card-state + :last-interval 4.0 :repetitions 1 + :failures 0 :meanq 5.0 :total-repeats 1) + 5 + 0)) (next (nth 0 result))) ;; With factor 1.5, the original next-interval was scaled up. (should (numberp next)) -- cgit v1.2.3