disable once-only choices after the first time

This commit is contained in:
2020-10-04 22:53:41 -06:00
parent 430cdf5091
commit 1a26240503
2 changed files with 8 additions and 6 deletions

View File

@@ -49,10 +49,16 @@
(lambda (cc)
(*handle-choices* choice-texts cc))))
(defun choice-available (choice)
(and
(or
(not (choice-once-only choice))
(= 0 (choice-chosen-count choice)))
(eval (choice-condition choice))))
(defun choice-point (choice-ids on-gather)
(let (choices // not to be confused with the global list
(map choice-ids (bind nth *choices*))
// TODO filter by conditions and chosen counts
(filter (map choice-ids (bind nth *choices*)) choice-available)
choice-outputs
(map choices choice-output)
choice-texts

View File

@@ -16,10 +16,6 @@
(pop! divert-calls)
(push! divert-calls 'final-divert)
(zip divert-calls (map targets symbol-name))))))))
//(print targets)))
//`(funcall ,(read-symbol "" stream)))
// TODO don't just funcall, check the scope tree of divert targets (split by .)
// TODO diverts should quit when finished unless another -> starts a tunnel or tunnels back
(def-reader-macro "==" (start stream)
(let (knot-name