[fpc-pascal] a proposal about "with" syntax

Sven Barth pascaldragon at googlemail.com
Sun Mar 17 10:59:42 CET 2013


On 17.03.2013 06:00, Flávio Etrusco wrote:
> On Sun, Mar 17, 2013 at 12:16 AM, Daniel Gaspary <dgaspary at gmail.com> wrote:
>> On Sun, Mar 17, 2013 at 12:07 AM, 印場 乃亜 <shiruba at galapagossoftware.com> wrote:
>>> On 2013/03/17, at 11:37, Flávio Etrusco <flavio.etrusco at gmail.com> wrote:
>>>> Daniel, I find this hack as ingenious as atrocious ;-)
>>>> But thinking about it a bit, when FPC gets generic methods you can
>>>> make this kind of workable!
>>
>> I was thinking about this, not specifically generic methods, but some
>> new generic resource.
>
> Indeed. What I was thinking would actually need generic functions,
> bounded generics and generics with type-erasure ;-)
> So you'd write, say:
>>>>>
>    type generic TAlias1<T: TObject> = class(TObject)
>      function Alias1: T;
>    end;
>

This already works.

>   function<T: TObject> Alias1(Source: T): TAlias1<T>;

I don't really get what you want to express with that...

Regards,
Sven



More information about the fpc-pascal mailing list