Generic enumerators

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Generic enumerators

Honza-5
Sample code for someone in need of generic containers with generic
enumerators (no biz/ads there):

http://freepascal-bits.blogspot.com/2010/05/sampler-generic-enumerators-for-generic.html
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Generic enumerators

Anthony Walter-3
Is the keyword "generic" really needed here:

type generic TEnumerator<TValue, TIterator> = class

- should be -

type TEnumerator<TValue, TIterator> = class

It looks completely unnecessary and I've never seen a situation in pascal where anything but an identifier follows the keyword type. Whomever came up with the idea was probably more interested in making the feature easy to implement in the compiler rather than more natural for pascal programmers.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Generic enumerators

Florian Klämpfl
Anthony Walter schrieb:
> Is the keyword "generic" really needed here:

Yes, I explained it multiple times to you alreay.

>
> type generic TEnumerator<TValue, TIterator> = class
>
> - should be -
>
> type TEnumerator<TValue, TIterator> = class
>
> It looks completely unnecessary and I've never seen a situation in
> pascal where anything but an identifier follows the keyword type.
> Whomever came up with the idea was probably more interested in making
> the feature easy to implement in the compiler rather than more natural
> for pascal programmers.

Compared to you, the person who did it, did at least anything. You did
nothing so far.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Generic enumerators

Henry Vermaak
In reply to this post by Anthony Walter-3
On 10 May 2010 13:27, Anthony Walter <[hidden email]> wrote:

> Is the keyword "generic" really needed here:
>
> type generic TEnumerator<TValue, TIterator> = class
>
> - should be -
>
> type TEnumerator<TValue, TIterator> = class
>
> It looks completely unnecessary and I've never seen a situation in pascal
> where anything but an identifier follows the keyword type. Whomever came up
> with the idea was probably more interested in making the feature easy to
> implement in the compiler rather than more natural for pascal programmers.

I believe you have raised this already?  I'm sure the fpc team will
welcome your patches.

Henry
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal