That is, is the "once-only" a property of the enclosing loop, to be reset when that loop is reentered, or a property of the condition itself, meaning that after it became true once, it will never be true in the life-time of the program?Good point. I wonder if we could make a parallel with the our/my distinction, such that a my once would reset each time the enclosing block is entered, but our once would not? Or perhaps some sort of reset operator, along with labels, to reset a once conditional.
Seems to be a lot of possible paths there. We should probably agree on the fundamental property first. I see a few choices:
1) a conditional, once true, never tested again
2) a block, once entered, never entered again (including testing for any attached condition).
3) a statement modifier, indicating the attached block will only be executed once.
And then further choices about whether it's resettable, and the reset mechanism. [I can imagine taking the language duality of "once" as eleven in spanish, and having it context or parameter sensitive. If it's true 1 time, it's pronounced "wuns", if it's reset, it's pronounced "on-say".]
Lots of potential. Still, is it useful? Is it practical? Or is it just cool?
Update: Clarified (2) to be more general than (1).
-QM
--
Quantum Mechanics: The dreams stuff is made of
In reply to Re^3: Doing "it" only once
by QM
in thread Doing "it" only once
by Limbic~Region
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |