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

"SIGOURE" == SIGOURE Benoit <sigoure.benoit@lrde.epita.fr> writes:
https://svn.lrde.epita.fr/svn/xrm/trunk Index: ChangeLog from SIGOURE Benoit <sigoure.benoit@lrde.epita.fr>
Add meta-if at Expression level. So basically, it is now possible to have a meta-if statement everywhere we can find an Expression. /!\ NOTE: meta-if statements at Expression level are restricted to one single expressions in the then-part and else-part. eg: if some-condition then exp1 exp2 end is *invalid* at Expression level because neither the base language nor the extended language provide real statements/sequences of expressions.
Other improvements: PRISM-If statements (cond ? then-part : else-part) are now evaluated by prism-desugar when possible. It is also possible to reduce the condition of a meta-if statement down to a simple Int(_) or Double(_). If that Int(_) or Double(_) is zero, the condition will evaluate as False() otherwise True() [like in C]. NOTE: for Double(_) all tests are performed with a precision of 10^-7 in other words if 0.000000001 then ... else /*executed*/ end will be false.
This is nice!
participants (1)
-
Akim Demaille