4 ms·
You could take it a step further and specify the domain and range of your functions. The division operator for example take any real number except 0 – Zero is a
by swagasaurus-rex 4y ago
You could take it a step further and specify the domain and range of your functions. The division operator for example take any real number except 0 – Zero is a special undefined case specifically for division.
Although string types seems intractible, you could easily specify things like [a-zA-Z0-9], or character sets/UTF ranges for limiting inputs to certain languages. All list types (strings, arrays) could specify length as a limit.
Programmers would naturally want flexibility with domain enforcement, so could just write a (turing complete) function to which returns the domain of the function in question!