get rid of failed mccarthy shortcut evaluation

This commit is contained in:
Irmen de Jong
2022-06-27 21:44:52 +02:00
parent af98d01053
commit 06184bdcb1
4 changed files with 3 additions and 148 deletions

View File

@@ -489,9 +489,8 @@ logical: ``not`` ``and`` ``or`` ``xor``
.. note::
Unlike most other programming languages, there is no short-cirquit or McCarthy-evaluation
for the ``and`` and ``or`` operators at this time. This means that prog8 currently always evaluates
all operands from these logical expressions, even when one of them already determines the outcome.
This may be changed in a future language version.
for the logical ``and`` and ``or`` operators. This means that prog8 currently always evaluates
all operands from these logical expressions, even when one of them already determines the outcome!
range creation: ``to``
Creates a range of values from the LHS value to the RHS value, inclusive.

View File

@@ -3,10 +3,6 @@ TODO
For next release
^^^^^^^^^^^^^^^^
- add McCarthy evaluation to shortcircuit and/or expressions. Both conditional expressions and assignments!
StatementReorder.after(assignment).
TODO: boolean expressions.
- add unit tests for all 4 mcarthy shortcut cases.
- can we optimize redundant calls to boolean() away? imageviewer.prg got larger because of them
- add some more optimizations in vmPeepholeOptimizer
- vm Instruction needs to know what the read-registers/memory are, and what the write-register/memory is.