Generic invocation of typeMethods
Posted: Tue May 25, 2021 1:01 pm
Is there a way to call a static method using a class reference?
I want to grab a bunch of classes, store references, then pick one and invoke a type method on it. In essence this is something like cls : Class; begin cls := ClassA; …then much later… cls@methodName(); Of course this gives a syntax error because methodName is unknown on Class.
You might think sendTypeMsg would solve this but I seem to need to invoke it on an instance of a class, which defeats the purpose here.
Is there any way to do this?
I want to grab a bunch of classes, store references, then pick one and invoke a type method on it. In essence this is something like cls : Class; begin cls := ClassA; …then much later… cls@methodName(); Of course this gives a syntax error because methodName is unknown on Class.
You might think sendTypeMsg would solve this but I seem to need to invoke it on an instance of a class, which defeats the purpose here.
Is there any way to do this?