Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-20 Thread Nikolay Nikolov via fpc-pascal
On 10/21/24 5:37 AM, Hairy Pixels via fpc-pascal wrote: then isn’t Pascal’s requirement to predeclare uninitialized variables the worst possible design? In C you can at least declare a variable with its assignment in one step but with Pascal by design you can always read uninitialized memory

Re: [fpc-pascal] How do I pass a call back Class and its method to an external library *.so file writting in C++

2024-10-20 Thread Sven Barth via fpc-pascal
Dennis via fpc-pascal schrieb am Mo., 21. Okt. 2024, 05:09: > > >> I am expected to create and pass an instance of such class >> ApiProxyWrapperReply in my calling program >> via a function >> void SPAPI_RegisterApiProxyWrapperReply(ApiProxyWrapperReply* >> apiProxyWrapperReply); >> >> and the

Re: [fpc-pascal] How do I pass a call back Class and its method to an external library *.so file writting in C++

2024-10-20 Thread Dennis via fpc-pascal
I am expected to create and pass an instance of such class ApiProxyWrapperReply in my calling program   via a function void SPAPI_RegisterApiProxyWrapperReply(ApiProxyWrapperReply* apiProxyWrapperReply); and the external library will then call the various methods of

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-20 Thread Hairy Pixels via fpc-pascal
On Oct 21, 2024 at 7:54:22 AM, Bernd Oppolzer via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > 3. Standard Pascal has only pointers, which point to the heap and are > created by the NEW procedure. > I am the maintainer of another Pascal dialect (Stanford Pascal) - and, > like many other

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-20 Thread Bernd Oppolzer via fpc-pascal
No shitstorm from my part :-) I am working with Pascal, C and other programming languages (PL/1 for example) for more than 40 years now, and I am thinking sometimes about what makes programming languages secure or insecure - or: what are the common reasons for runtime errors? Some observation

Re: [fpc-pascal] question on docs

2024-10-20 Thread ppadilcdx--- via fpc-pascal
Ah, Ok thanks! > On Oct 20, 2024, at 3:32 PM, Martin Frb via fpc-pascal > wrote: > > The compare function is declared right inside the class > > { TFPGList } > > generic TFPGList = class(TFPSList) > private > type > TCompareFunc = function(const Item1, Item2: T): Integer; > >

[fpc-pascal] docs

2024-10-20 Thread ppadilcdx--- via fpc-pascal
Apropos the new users discussion, i think the state of the docs is really important, new users can be discouraged by lack of documentation or up-to-date docs. I just recently retired so not a new young user, but relatily new to fpc. So, I’m willing to help update the docs, correct typos, etc, i

Re: [fpc-pascal] question on docs

2024-10-20 Thread Martin Frb via fpc-pascal
The compare function is declared right inside the class   { TFPGList }   generic TFPGList = class(TFPSList)   private     type   TCompareFunc = function(const Item1, Item2: T): Integer; "T" is from the generic, so if you specialized with string, then T is string. It is a function, not a

Re: [fpc-pascal] question on docs

2024-10-20 Thread ppadilcdx--- via fpc-pascal
Just tried to compile a short program with that definition of compare: TCompareFunc, and that is the wrong type for TFPGList in my program (yes there is a better class for strings but I just wanted a quick example program to compile). FPC error message says it wants: function(const ShortString;c

Re: [fpc-pascal] question on docs

2024-10-20 Thread Peter B via fpc-pascal
On 20/10/2024 22:17, ppadilcdx--- via fpc-pascal wrote: I’m a little confused by some references in the docs. Hopefully I can explain it clearly. Looking at TFPGList in fgl. The Sort method refers to a TCompareFunc (it does not link to its definition). TFPGList says it’s methods are the same a

[fpc-pascal] question on docs

2024-10-20 Thread ppadilcdx--- via fpc-pascal
I’m a little confused by some references in the docs. Hopefully I can explain it clearly. Looking at TFPGList in fgl. The Sort method refers to a TCompareFunc (it does not link to its definition). TFPGList says it’s methods are the same as TFPSList or classes.TFPList. So looking in these two ot

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-20 Thread greim--- via fpc-pascal
Regarding Memory Management Its possible to write a Pascal program w/o any pointer, but it may be not elegant and interfaces to some C-like GUI structures, as used in all common OSs, are impossible. But, I am using Borland Pascal (sic!) and also FreePascal (no Lazarus) for small embedded s