[fpc-pascal] Default properties first draft
ryan at thealchemistguild.com
Fri Oct 19 17:29:43 CEST 2018
I finally finished what I think is first draft of default properties. Since it already took me so much time to just get the basics of the compiler figured out I thought I’d post this commit from GitHub and ask if I did anything seriously wrong or stupid. There are multiple ways I could approach this problem but I may have not achieved it a proper way considering the architecture of the compiler, which I admittedly don’t understand well.
How should I present for consideration at this stage? If anyone on the compiler team can look at the commit to tell me anything that would be helpful, or let me know if you need this in some other form that you could actually compile (I understand the compiler uses svn but I only know git). I have some demos of the basics mostly working but I have questions/problems I wasn’t able to solve on my own.
Here’s an example test in case people forgot what this was about.
generic TAuto<T> = record
property obj: T read m_object; default;
class operator Initialize(var a: TAuto);
class operator Finalize(var a: TAuto);
TObjectAuto = specialize TAuto<TObject>;
TStringList = specialize TFPGList<String>;
TStringListAuto = specialize TAuto<TStringList>;
class operator TAuto.Initialize(var a: TAuto);
a.m_object := T.Create;
class operator TAuto.Finalize(var a: TAuto);
for str in list do
for i := 0 to list.count - 1 do
More information about the fpc-pascal