[lazarus] About compatibility???

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Mar 7 17:55:48 EST 2002

On Thu, 7 Mar 2002 22:16:38 +0100 (CET)
<Michael.VanCanneyt at wisa.be> wrote:

> On Fri, 8 Mar 2002, Matjaz Mihelic wrote:
> > I know this is a bit selfish since I've got no Delphi and Kylix appz to
> > maintain (used C, FPC, XML...), but I wonder how others think about that
> > kind of approach.

I want Delphi compatibility to easily upgrade Delphi code to FPC not to create hybrids.
Can u give a more detailed example of your aproach?

> > The second question one is more lazarus IDE connected: Does anybody
> > except me misses some kind of preprocessor in pascal. If borland hasn't
> > included one that should not be the rule for pascal not allowing that
> > option.
> I don't think we will add a preprocessor to the compiler; macroitis is a
> serious disease of C and should be kept as far from the language as
> possible, however I see no reason why an editor could not pipe each file
> through a preprocessor before feeding it to the compiler. What is more, in
> an IDE, the preprocessor could be specified - making it a more powerful tool
> than integrating the preprocessor in the compiler. On top, it should not
> be hard to add.

I totally agree, that Preprocessing is a serious disease of C and should be kept as far as possible. There are far more drawbacks than goodies.
But preprocessing in the normal sense is also pain for an IDE with code completion features. Delphis code insight is neither able to work with include files, nor compiler directives. The codetools already support include files and there is slight support for "dead" code, left out by compiler directives. But they have to do a lot of bookkeeping. FPC Macros will eventually be supported, you can think of them as small include files. 
Now think about automatically adding code, deleting code, replacing code and moving code. Code completion features works on the preprocessed code but it alters the sources itself. So it has to consider both sides of the metal at once. Macros will add a layer between it.
And do not just think about the code insight features. The codetools will become much better. ;)
But I'm sure, we can add functions to the IDE to get some "preprocessing" features without the big drawbacks. Best of both worlds.


More information about the Lazarus mailing list