Open c3d opened 1 month ago
I think you're right and this should clearly generalize to logical expression as well: 'express1 logical_operator express2' for instance 'AA+BB<CC'. To implement this, 2 possibles scenarios: S1 : invoke →Num (or ASN) two times in a row with the expression values as a first result and the logical value after the second time. OR an interesting possibility S2: A first call shows a tagged result of the form 'AA+BB<CC'ˍ?:True and the second call to →Num (or ASN) would simply remove the tag from any object of the form 'express'ˍ?:Log_Val to finally leave on the stack the logical value alone. (May be, if →Num and ASN are distinct operation, ASN would give directly the logical value). Remark about S2: it may seem strange to use the notation ˍ? as if it was a unit but wouldn't it possible to consider some kind of a logical unit because if express1 and express2 are themselves logical expression (e.g. A>B, C=3) then for instance 'A>B AND C=3'ˍ? would act as an alternate logical operation with a definitive answer. Is it an interesting suggestion ? I wonder ...
When evaluating an equation like
'A*A+B*B=C*C'
with→Num
, we get aTrue
orFalse
result. Would it be preferable to see the left and right results?