-
Notifications
You must be signed in to change notification settings - Fork 53
Description
datetime and timedelta contructor function currently do not implement and validation of input arguments to the contructor. For example, the datetime contructor needs to validate the following:
- Is year > 0?
- Is 0 < month < 13?
- Is 0 < day < 32?
- etc.
and raise an exception if any of the above tests fail. Similarly for timedelta constructor.
Currently, these constructors are implemented as pure elemental functions which allows the user to instantiate an array of datetimes or timedeltas in a familiar Fortran array syntax. Once the above validations and raising exceptions are implemented, these functions cannot be pure (nor elemental) anymore, because only an impure procedure can write to standard output and stop the program. Consequently, this will require implementing a separate version of constructors that will accept arrays as actual arguments, and which will be used for overloading the contructor.