Description
I want to perform some dry-run calculations with dirty custom functions.
Sometimes i don't know the value that will be in real run, but i know that this value will be.
I cant use nil
or any another value, because it can change the attitude of an expression.
For example foo ?? download(bar)
, when foo is nil will force to download bar
while it is not what's desired if foo is definitely known to be not nil
My proposal is to add type UNKNOWN and UNKNOWN_NOT_NIL, which will during computation propogate it's unknoness. These values can be used as any other type. At the same time, calling dirty custom functions can check if the value is UNKNOWN and perform accordingly.
Predefined functions, while being pure, can just return UNKNOWN as there result. Important to calculate UNKNOWN <-> UNKNOWN_NOT_NIL conversions properly.
This change is fully backward compatible, because not giving any UNKNOWN value to env will just work as is.