>> On 5/5/19 12:15 PM, GoSim wrote:
>>> If the user wants to compile the code force the user to write code where
>>> the variable types are static.
>> But function
>> calls (and due to operator overloading, most non-trivial M-code
>> expressions) can generally return any type they want, and that type is
>> not determined until run time.
> Functions giving any type will affect the error messages when checking the
> static type code but assuming the types are static it still works
Ok, so now we are restricting the user in type reassignments. Regarding functions, must the return type be able to be declared at 'compile time'? Or is it simply sufficient to somehow determine that whatever type it is never changes?
Can anyone give examples of a common function that could return a number of different classes depending on how it's called, especially if that can't be determined trivially by just reading and not running the code? Would we have to make an exclusion list of all functions capable of returning multiple classes and have the compiler throw an error any time one of those functions appears in a loop if it's not trivial to tell what class will be returned each time?