in reply to Solved: splitting source file

Does David Golden's Toolset already handles this in a safer way than using source filters?

Replies are listed 'Best First'.
Re^2: Solved: splitting source file
by AriSoft (Sexton) on Feb 23, 2010 at 05:42 UTC
    Toolset maybe intented to be used at least some of this kind of situations. But what makes including not safe? I understand that trying to modify source by filtering is a hazardous operation but including a file does not modify the original source. It is just like a "symbol" which expands to something else. There seems to be practically no performance hit because the whole file is included in a single operation during the compilation phase without looping at all.
      But what makes including not safe?

      You end up compiling and running modified source code.

      I understand that trying to modify source by filtering is a hazardous operation but including a file does not modify the original source.

      Technically correct, but you're not running the original source code. You're running the modified source code. (If you weren't modifying the source code and running that, your code wouldn't work, because its sole purpose is to modify the source code you actually run.)

      I'm not telling you not to use this, but I am telling you that I believe David's solution already exists, is already tested, and uses a less fragile technique.