[fpc-devel] When will the next version of FPC be released?

Sven Barth pascaldragon at googlemail.com
Sat Jun 1 13:59:13 CEST 2019


Michael Van Canneyt <michael at freepascal.org> schrieb am Sa., 1. Juni 2019,
12:00:

>
>
> On Fri, 31 May 2019, Ryan Joseph wrote:
>
> >
> >
> >> On May 30, 2019, at 4:18 PM, Ryan Joseph <ryan at thealchemistguild.com>
> wrote:
> >>
> >> I didn’t realize generic functions were in the trunk. I’m not sure I
> got this implemented properly so it requires some code review but can we
> try to include “implicitfunctionspecialization” mode switch in the next
> release along the with actual feature?
> https://bugs.freepascal.org/view.php?id=35261
> >>
> >
> > { got blocked again, attempting to resend }
> >
> > I didn’t realize generic functions were in the trunk. I’m not sure I got
> this implemented properly so it requires some code review but can we try to
> include “implicitfunctionspecialization” mode switch in the next release
> along the with actual feature?
> https://bugs.freepascal.org/view.php?id=35261
> >
> > Specifically, for some time now I wanted to make a “ClearMem" function
> that doesn’t require passing the type but the insanely verbose syntax of
> generic functions makes it even longer. Honestly the syntax is so intrusive
> in ObjFPC mode that I would avoid using it all together.
> >
> > What we have now:
> >
> > var
> > pt: TPoint;
> > begin
> >       FillChar(pt, sizeof(TPoint), 0);
> >
> > Specialization with generics:
> >
> >       specialize ClearMem<TPoint>(pt);
> >
> > With implicit specialization:
> >
> > ClearMem(pt); // :)
>
> I don't think this syntax is a good idea.
>

It's required for Delphi compatibility.


> What with overloads ?
>
> Procedure MyProc<T>(a:T);
> Procedure MyProc(a : TObject);
>
> How do I know which one will be called ?
>

The compiler calls the more specific one. I'd need to cross check with
Delphi, but here I'd assume that it would be the TObject one as no
specialization is required then.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190601/2f35eb95/attachment.html>


More information about the fpc-devel mailing list