Op Sat, 14 May 2011, schreef Joerg Schuelke:

Am Sat, 14 May 2011 12:14:52 +0200
schrieb Florian Klämpfl <flor...@freepascal.org>:

Because a lot of code in the compiler is very old (remember, it was
started in 1993 using TP) and writestr for enums is new compare with
this time span. Nobody rewrote the code yet.

And it should not been rewritten this way, because this would force the
use of RTTI information inside the compiler , which is needless.

It's not needless, it's usefull :)

This code:

  type colour=(red,green,blue);

  begin
    writeln(red);
    writeln(green);
    writeln(blue);
  end;

... will cause 52 bytes of RTTI data to be inserted in your executable. Any do-it-yourself solution will consume more space. Therefore the RTTI not only helps to keep the source code compact and therefore readable, it would also help to keep the compiler exe compact.

So use of RTTI information inside the compiler is most welcome :)

Daniël
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to