Re: [GD-General] RE: Preprocessors
Brought to you by:
vexxed72
|
From: Patrick M D. <pa...@wa...> - 2001-12-28 03:19:48
|
On Thu, 27 Dec 2001, Brian Hook wrote:
> > Or simply that they intend for you to use existing
> > preprocessors.
>
> Fair enough, but then you have source code that won't recompile between
> different build systems because of a different choice of preprocessors.
> Imagine the hell we'd be in today if, for example, things like #if,
> #define, #error, etc. were not standardized in the C language.
Users who want to use the code either use the same preprocessor or must
use the output of the preprocessor. We have the C preprocessor already,
and can take advantage of reusing it. Most systems should already have
one available.
A lot could be done for standardizing and improving build environments.
GNU make has done some very good work for Makefiles, but they are still
fairly difficult to learn and maintain.
> In addition, for interpreted languages it may not be feasible to run a
> preprocessor every time you want to load up and run some script.
Ah yes - I don't tend to give the interpreted world too much thought.
> Anyway, my point wasn't necessarily that this is insurmountable, since
> it obviously is not, it's just that in my experience language designers
> get really defensive about this topic. There's this weird unwillingness
> to admit that commenting out large blocks of code is actually useful.
Hmm.. I'll agree with you about the defensive regarding preprocessors but
commenting out large blocks of code is lexical issue right?
> Typically someone will tell you to use:
>
> if ( 0 ) { put dead code here };
>
> Unfortunately that dead code still needs to compile, so it doesn't help
> when you have some weird parsing error and you're trying to find it.
> For languages like Eiffel and Lua, which lack comment blocks, trying to
> hunt down some parse error can be irritating. Java at least still
> retains /* */, although you can't nest them.
So these languages have a relatively broken support for comments as you
need them. Many languages do support nesting comments, especially more
recent ones.
> Of course, I'm sure some Emacs geek will suggest writing some custom
> elisp that prepends each line in a selection with the appropriate line
> comment, be it '--', '//', ';', or '#'.
>
> Hell, for all I know Emacs already has a M-x comment-region-with-#
> command =)
Absolutely, M-x comment-region will work great. It works based on the
current language mode so you don't have to worry about the different
characters to use. :)
Patrick
|