Why can't an interface have class methods?
Why can't an interface have class methods?
How cool would it be to do:
type
ISlice = interface
class function New(Arr: TArray; Start, Slide, Size: integer): ISlice;
var
IntSlice = ISlice;
begin
IntSlice:= ISlice.New(Arr, 1,2,10);
end;
No need to know about implementing classes, unless you want a special flavor of ISlice.
Of course this does not just relate to construtor like class functions, but any sort of class method.
How cool would it be to do:
type
ISlice
class function New(Arr: TArray
var
IntSlice = ISlice
begin
IntSlice:= ISlice
end;
No need to know about implementing classes, unless you want a special flavor of ISlice.
Of course this does not just relate to construtor like class functions, but any sort of class method.
Comments
Post a Comment