Are local classes going to be allowed? |
|
Hi,
I just innocently included a class in function I was writing and was told off by the compiler when I went to run it:
{code}
function CalcCsvDelimiter(lines: TStrings): char;
type
TDelimData = class
delim: char;
counts: TArray;
variance: double;
end;
var
delims: TObjectList;
...
{code}
Local classes are possible in Apple's new language Swift. i can see that Delphi's split syntax, which generally I like, makes it harder to have a convenient way to add methods to a local class. In this case it was pure data, and I wanted the convenience of a generic TObjectList.
But surely there is a way to add this control of scope to Delphi. Has Embarcadero thought about this?
Regards
Mark
|