-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Description
The purpose of the ternary operator is to enable straight-line instruction sequences, such as the following:
const INC = 0x01
const DEC = 0x03
fn apply(inst u8, arg1 u32) -> (res u33) {
var isInc, isDec u1
;;
isInc = (inst == INC) ? 1 : 0
isDec = (inst == DEC) ? 1 : 0
;;
res = (isInc * (arg1+1)) + (isDec*(arg1-1))
return
}
One of the challenges is how to split this operation, but this could be left for a later date.
Metadata
Metadata
Assignees
Labels
No labels