[fpc-pascal] Generic type conflicts
Ben Grasset
operator97 at gmail.com
Thu Nov 7 01:33:33 CET 2019
On Wed, Nov 6, 2019 at 12:44 PM Sven Barth via fpc-pascal <
fpc-pascal at lists.freepascal.org> wrote:
> Pascal has a strong type safety, thus something like the if-expression
> won't be used/allowed to weaken that.
>
> If that means that some things can't be implemented in generics the "easy"
> way, then so be it.
>
I agree that Pascal has strong type safety.
IMO conditional branching based on compile-time constant evaluation, that
cannot fail, does not do anything resembling weakening it, however.
It strengthens it, and has no downsides, because it's verified by the
compiler.
Encouraging typecasting (which cares only about the sizes of the types
involved, nothing else) at the programmer level is far more error-prone in
a variety of ways.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20191106/73e872ef/attachment.html>
More information about the fpc-pascal
mailing list