[fpc-devel] Re: (class) helper questions

Florian Klämpfl florian at freepascal.org
Sun Mar 13 16:40:17 CET 2011


Am 13.03.2011 11:26, schrieb Sven Barth:
> I'd like to know how I should proceed
> regarding these (and possible also the first two, as they might take
> their time as well ^^ ).

Implement things as those were fixed.

> As I don't think it's a good idea to put the handling in TSymtableStack
> itself I basically have the following solutions left:
> * add events that are triggered on push/pop to TSymtableStack
> * make push/pop virtual methods and subclass TSymtableStack
> 
> In the first case I might need to introduce a "factory function" that
> creates an TSymtableStack and sets up the two events. In the second case
> we need to agree that all symtablestacks (maybe except the stacks for
> macros) must now be created as the new subclass.
> 
> Hmm... rereading what I wrote above I personally would go for the second
> solution.

I'am not a big fan of eventing in the compiler: event based designs are
fine for libraries, but for the compiler typically not needed.



More information about the fpc-devel mailing list