I’m seeing feature this in other languages and it’s pretty useful. Has anyone ever considered this for Pascal?
Instead of declaring a method in the class (or other function) it’s written inline from the callers scope and inherits from that scope. The only advantage is readability since everything appears in one line and it’s cleaner since you don’t pollute the class with methods are only used in a single location and never called directly.
fadeAction := TAction.ActionWithDuration(self, 2.0);
... // scoped in the calling class so "self" is available