Re: [fpc-devel] [Suggestion] Enumeration range-check intrinsic

2019-07-05 Thread Tony via fpc-devel
On Fri, 5 Jul 2019 00:40:15 +0100
"J. Gareth Moreton"  wrote:

> You could consider this an ultimatum, but I know it will be pointless
> to do that because you'll just ignore me.  So I'm pleading, Jonas...
> there needs to be a way to check if an enumeration contains an
> invalid value to avoid diving into the realm of undefined behaviour.
> Just because you wouldn't use it doesn't mean we won't.

I am only a hobbyist, so take this for what it's worth.  I am very
puzzled by Gareth's insistence on this issue.  It seems to me that, if
there is a chance that a value read from some external source might
have a value outside the range of an enum, then enum is not the right
data type for that operation.  Use an appropriate integer type
instead.

Tony



___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] Some thoughts on multi-line string support, and a possible syntax that I think is perfectly clean and Pascal-ish.

2019-07-05 Thread Tony via fpc-devel
On Thu, 4 Jul 2019 12:00:07 +0200
Marco van de Voort  wrote:
 
> In conclusion:  it is a solution in search of a problem, with bad 
> behaviour in errorhandling (when unbalanced the compiler errors on 
> perfectly fine code in the wrong place after whatever ' closes the 
> unbalanced ) on top of it.
> 
> This is why the feature goes against the grain of Pascal IMHO.

Well said Marco!  I have been reading this mailing list for some time
and have been disturbed recently-ish by how often suggestions come up
for "my pet feature from another language" or "a cool idea I just
had" (I am probably doing an injustice to some of the suggestions, but
often they feel deeply un-Pascal-ish - I can't define it but I know it
when I see it).  In these circumstances, a healthy scepticism and
conservatism among the development team is a good thing.

Tony
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel