Closed anton-trunov closed 9 months ago
Can we create some Tact smart contract example's that will present all changes?
sure, here you go:
contract Sample {
init() { }
// - octal and binary literals
// - underscores in numerals
// - augmented assignment operators (here only +=)
// - conditional expression, a.k.a. ternary operator
get fun foobar(a: Int): Int {
let res: Int = 0;
res +=
(a == 1) ? 4_2
: (a == 2) ? 0x2_B
: (a == 3) ? 0o5_4
: 0b101_101;
return res;
}
}
Added to v1.0.16
The dev version of Tact supports conditional expressions now:
true ? 42 : 0
. The relevant PR is here: https://github.com/tact-lang/tact/pull/97.