Re: [fpc-pascal] Generic routines for both dynamic array and other collections

2021-02-21 Thread Sven Barth via fpc-pascal
James Richters schrieb am Mo., 22. Feb. 2021, 01:07: > I've been using a lot of dynamic arrays of records lately, Some are even > Dynamic Arrays of records that contain other records, for example: > Type >XYZ_Record = Record > X,Y,Z : Double >End; > >Call_Stack_Record = Record

Re: [fpc-pascal] Traits Proposal

2021-02-21 Thread Ryan Joseph via fpc-pascal
> On Feb 19, 2021, at 8:50 AM, Ryan Joseph wrote: > > I just realized another potential problem. If we use the "default" keyword > that means there could be multiple "defaults" unless we limit the property to > 1 per class, which would kind of defeat the purpose of the feature (like the > is

Re: [fpc-pascal] Generic routines for both dynamic array and other collections

2021-02-21 Thread Ryan Joseph via fpc-pascal
> On Feb 21, 2021, at 2:59 PM, Sven Barth wrote: > > You are supposed to use Length(X). There is no need for a "property". One > doesn't need to objectify each and everything! Yes but programmers tend to be neurotic and obsessive. :) I think many of us would appreciate a matching "Count" met

Re: [fpc-pascal] Generic routines for both dynamic array and other collections

2021-02-21 Thread James Richters via fpc-pascal
I've been using a lot of dynamic arrays of records lately, Some are even Dynamic Arrays of records that contain other records, for example: Type XYZ_Record = Record X,Y,Z : Double End; Call_Stack_Record = Record Location : LongInt; Offset : XYZ_Record; Rotation

Re: [fpc-pascal] Generic routines for both dynamic array and other collections

2021-02-21 Thread Sven Barth via fpc-pascal
Am 21.02.2021 um 15:59 schrieb Ryan Joseph via fpc-pascal: On Feb 20, 2021, at 7:52 PM, Виктор Матузенко via fpc-pascal wrote: And how do I write generic helper for all possible dynamic arrays? By hand sadly. The RTL has added type helpers for many types but I don't think they added these f

Re: [fpc-pascal] Generic routines for both dynamic array and other collections

2021-02-21 Thread Ryan Joseph via fpc-pascal
> On Feb 20, 2021, at 7:52 PM, Виктор Матузенко via fpc-pascal > wrote: > > And how do I write generic helper for all possible dynamic arrays? By hand sadly. The RTL has added type helpers for many types but I don't think they added these for dynamic arrays. I agree that dynamic arrays shoul