On 2010-09-30 19:39, Michael Van Canneyt wrote:
If you want to move the *global variables* (as in: unit scope)
CExportLib,ExportLib to globals, you must add export to the globals unit.
Not only do I think they should be moved to globals.pas, I also think
they should be fields/properties/methods of, say, TFCPGlobalSettings class.
Which, in turn, should be used in the compiler object as a field/property.
Doing that does not increase complexity.
Just the opposite: the code becomes more decipherable and hence more robust.
BTW, removing all these
var
CExportLib : array[tsystem] of TExportLibClass;
ExportLib : TExportLib;
procedure RegisterExport(t: tsystem; c: TExportLibClass);
procedure InitExport;
procedure DoneExport;
from export.pas, also enables us to remove 'globals' from the 'uses' of
export.pas --which means less convolution to me.
What I would like to know is why seem to think this is a bad idea?
Further, I think the NoGlobals brach is a very good starting point
before moving on to multiple front-ends etc.
Cheers,
Adem
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel