You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Conceptually, our use of the class Subroutine is broken, as it merely differentiates between Function and Subroutine by a single flag attribute. The correct representation would be to have an abstract Procedure type that is a specialisation to ProgramUnit, but cannot actually be instantiated. From there, both Subroutine and Function should inherit the basic methods/properties of dealing with "Callable" program unit objects, where Function specialises all properties and methods that deal with return types and return type names.
Note, that this incorrect representation was originally done out of convenience, but has been allowed to spread quite widely through the entire code and test case. Any refactoring to this intent will subsequently by very invasive, so care needs to be taken.
The text was updated successfully, but these errors were encountered:
Conceptually, our use of the class
Subroutine
is broken, as it merely differentiates betweenFunction
andSubroutine
by a single flag attribute. The correct representation would be to have an abstractProcedure
type that is a specialisation toProgramUnit
, but cannot actually be instantiated. From there, bothSubroutine
andFunction
should inherit the basic methods/properties of dealing with "Callable" program unit objects, whereFunction
specialises all properties and methods that deal with return types and return type names.Note, that this incorrect representation was originally done out of convenience, but has been allowed to spread quite widely through the entire code and test case. Any refactoring to this intent will subsequently by very invasive, so care needs to be taken.
The text was updated successfully, but these errors were encountered: