> On Jan 16, 2022, at 8:18 PM, Ryan Joseph <generic...@gmail.com> wrote:
> 
> https://gitlab.com/genericptr/free-pascal/-/commits/case_label_classref

I just realized too late that the way I implemented this may be not the best 
idea. If the class type had an ordinal representation then you could use a 
normal case statement instead of making a big if-else block and doing equality 
comparisons for each type. That would be faster right?

Assuming the memory address of the type worked you could do something like this 
behind the scenes:

  case PtrUInt(o.ClassType) of
    4500656856: writeln('TObject');
  end;

If so, I would have to rethink this then and come back to it later.

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to