]> ocean-lang.org Git - ocean/commit
oceani: introduce 'test' and 'choose' operators
authorNeilBrown <neil@brown.name>
Sun, 5 Dec 2021 21:04:31 +0000 (08:04 +1100)
committerNeilBrown <neil@brown.name>
Wed, 8 Dec 2021 04:55:44 +0000 (15:55 +1100)
commitf34d3718d70bd38d10eeeb1bb42d0f3e2e6c978b
tree98f41633c5ddeda00133a7356e9e11a73e1aa334
parentef3bbba20f9e426125498f78fe3b1f4ea75de68a
oceani: introduce 'test' and 'choose' operators

If a type supports testing (only Boolean currently),
   ? expr
converts to Boolean, and
   expra ?? exprb

will return expra if it tests as true, and exprb otherwise.
exprb isn't computed if not needed.

Signed-off-by: NeilBrown <neil@brown.name>
csrc/oceani-tests.mdc
csrc/oceani.mdc