[fpc-devel] case is

Hairy Pixels genericptr at gmail.com
Thu Mar 24 02:14:33 CET 2022



> On Mar 23, 2022, at 10:35 PM, Mattias Gaertner via fpc-devel <fpc-devel at lists.freepascal.org> wrote:
> 
> Forget Java. The point is, that its "case" can be more than mere
> syntactic sugar. It could give a nice speed up and the compiler warns
> about unreachable statements.


Search for "Case statement for class introspection” and you see can the little discussion we had about a potential speed up and why it wasn’t viable so for now it’s just using a if-else statement with A.ClassType = B.ClassType comparisons. It’s just syntactic sugar at this point but it was trivial to implement and I think it’s much nicer to work with so for me that’s a total win.

Regards,
	Ryan Joseph

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20220324/d91215df/attachment.htm>


More information about the fpc-devel mailing list