Let's say we have a function like:
function math.clamp(x, min, max)
if (x < min)
x := min
else if (x > max)
x := max
end if
end function
We currently cannot inline this function in cases like these (or at all, really - cannot even assign such a function to a variable directly):
if math.clamp(x, 0, 100) = 50
What would need to happen is:
temp := math.clamp(x, 0, 100)
if temp = 50
There would have to be a proxy variable for every expression that is bool'd together. Probably makes sense to use an array instead.
if math.min(x, 0) # 0 and math.clamp(y, 0, 100) = 50
becomes:
temp[0] := math.min(x, 0)
temp[1] := math.clamp(y, 0, 100)
if temp[0] # 0 and temp[1] = 50
<code>
end if
Let's say we have a function like:
We currently cannot inline this function in cases like these (or at all, really - cannot even assign such a function to a variable directly):
What would need to happen is:
There would have to be a proxy variable for every expression that is bool'd together. Probably makes sense to use an array instead.
becomes: