[fpc-pascal] FPC's generics
Florian Klaempfl
florian at freepascal.org
Wed Jun 13 14:05:20 CEST 2007
Bisma Jayadi schrieb:
>> I think it is useful, because it allows future language extensions to
>> also use the <> syntax without conflicting with generics (e.g., the
>> Objective Pascal draft syntax also makes use of angle brackets for a
>> couple of things).
>
> Then my second syntax proposal might overcome possible conflict with
> future or other <> symbol implementation, since it uses no <> symbol at
> all, and IMO more pascalish (less cryptic). :-D
>
> In short, my second syntax proposal is:
Where is the name of the type parameters given? Well and we used < ... >
because a lot of programmers recognize it as generic/template definition.
>
> - generic definition syntax (type section):
> {type_name} = generic {type_definition} of {generic_holder} ;
>
> - generic implementation syntax (var section):
> {var_name} : specialize {generic_type} for {implemented_type} ;
> or if it's defined in type section:
> {type_name} = specialize {generic_type} for {implemented_type} ;
>
> -Bee-
>
> has Bee.ography at:
> http://beeography.wordpress.com
>
> _______________________________________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
More information about the fpc-pascal
mailing list