Re: XRM 53: Add meta-if at Expression level.

"SIGOURE" == SIGOURE Benoit <sigoure.benoit@lrde.epita.fr> writes:
I don't think you need these two:
+ EvalIf: + |[ d ? e1 : e2 ]| -> |[ e1 ]| + where <not(compare(real-eq))>(d, 0) + + EvalIf: + |[ d ? e1 : e2 ]| -> |[ e2 ]| + where <compare(real-eq)>(d, 0) +
Since
+ LitToBool: + |[ d ]| -> |[ false ]| + where <compare(real-eq)>(d, 0) + + LitToBool: + |[ d ]| -> |[ true ]| + where <not(compare(real-eq))>(d, 0)
and
?MetaIf(condition, then-part, else-part) ///*DEBUG*/; say(!" @@@ eval-meta-if: starting:") ///*DEBUG*/; printf(|" condition = ", condition) - ; where(<prism-desugar> condition => condition-value) + ; where(<prism-desugar> condition + ; try(LitToBool) => condition-value) ///*DEBUG*/; printf(|" condition-value = ", condition-value) ; if !condition-value => True() then <eval-meta-code> then-part

On 2006-06-12, Akim Demaille <akim@lrde.epita.fr> wrote:
"SIGOURE" == SIGOURE Benoit <sigoure.benoit@lrde.epita.fr> writes:
I don't think you need these two:
+ EvalIf: + |[ d ? e1 : e2 ]| -> |[ e1 ]| + where <not(compare(real-eq))>(d, 0) + + EvalIf: + |[ d ? e1 : e2 ]| -> |[ e2 ]| + where <compare(real-eq)>(d, 0) +
Since
+ LitToBool: + |[ d ]| -> |[ false ]| + where <compare(real-eq)>(d, 0) + + LitToBool: + |[ d ]| -> |[ true ]| + where <not(compare(real-eq))>(d, 0)
and
?MetaIf(condition, then-part, else-part) ///*DEBUG*/; say(!" @@@ eval-meta-if: starting:") ///*DEBUG*/; printf(|" condition = ", condition) - ; where(<prism-desugar> condition => condition-value) + ; where(<prism-desugar> condition + ; try(LitToBool) => condition-value) ///*DEBUG*/; printf(|" condition-value = ", condition-value) ; if !condition-value => True() then <eval-meta-code> then-part
Good point. Thanks! -- SIGOURE Benoit aka Tsuna _____ /EPITA\ Promo 2008.CSI Rock & tRoll
participants (2)
-
Akim Demaille
-
Tsuna