loki icon indicating copy to clipboard operation
loki copied to clipboard

Procedure / Subroutine / Function refactoring

Open mlange05 opened this issue 1 year ago • 0 comments

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.

mlange05 avatar Nov 27 '23 04:11 mlange05