<div dir="auto"><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">Ryan Joseph <<a href="mailto:ryan@thealchemistguild.com">ryan@thealchemistguild.com</a>> schrieb am So., 14. Apr. 2019, 00:17:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
> On Apr 13, 2019, at 6:01 PM, Sven Barth via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank" rel="noreferrer">fpc-pascal@lists.freepascal.org</a>> wrote:<br>
> <br>
> Well, there is Oxygene's concept of Class Contracts (see<br>
> <a href="https://docs.elementscompiler.com/Concepts/ClassContracts/" rel="noreferrer noreferrer" target="_blank">https://docs.elementscompiler.com/Concepts/ClassContracts/</a> ), so if<br>
> anything in that direction would be done I'd be inclined towards their<br>
> syntax (and I've played with the idea to implement this in FPC for quite<br>
> some time already).<br>
<br>
That’s an interesting idea. It’s certainly common that you test for these conditions at the top of the function and have bail out conditions so it makes sense to pull it out into syntax. But it has to rely on exceptions and all that overhead? That’s not so great if so.</blockquote></div><div dir="auto"><br></div><div dir="auto">Your idea requires exceptions as well. The compiler is not capable checking whether valid entries are passed in at compile time except for simple, constant cases, so runtime checks are needed and the only way to abort something is by exceptions. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div class="gmail_quote" dir="auto"></div><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div>