>>>>> Ruslan Shevchenko writes:
| I generally favour "dnl" over "#", because "#" is not a comment
| delimiter in m4.
It is, it definitely *is*. In m4 there is a difference between
comments and text you get rid of which. Comments are introduced with
`#':
~ace % m4 nostromo Err 1
# define ifelse m4exit
# define ifelse m4exit
m4exit
~ace % nostromo 15:18
Most comments are to be kept in configure, but comments about M4
constructs. Experience demonstrates that people are dnling out
comments about shell constructs. Better keep useless comments about
M4 than losing comments about sh.
| 1 # @synopsis RSSH_CHECK_SUNPRO_C([ACTION-IF-YES],[ACTION-IF-NOT])
| 2 #
| 3 # Check whether we are using SUN workshop C compiler.
| 4 # The corresponding cache values is rssh_cv_check_sunpro_c, which is
| 5 # set to "yes" or "no" respectively.
| 6 #
| 7 # @author Ruslan Shevchenko <[EMAIL PROTECTED]>
| 8 # @version $Id$
| 9 #
| 10 AC_DEFUN([RSSH_CHECK_SUNPRO_C],
| 11 [AC_CACHE_CHECK([whether using Sun Worckshop C compiler],
| 12 [rssh_cv_check_sunpro_c],
| 13 [AC_LANG_SAVE
| 14 AC_LANG_C
| 15 AC_TRY_COMPILE([],
| 16 [#ifndef __SUNPRO_C
| 17 # include "error: this is not Sun Workshop."
| 18 #endif
| 19 ],
| 20 rssh_cv_check_sunpro_c=yes,
| 21 rssh_cv_check_sunpro_c=no)
| 22 AC_LANG_RESTORE])
| 23 if test ${rssh_cv_check_sunpro_c} = yes
| 24 then
| 25 $2
| 26 else
| 27 $3
| 28 fi
| 29 ])# RSSH_CHECK_SUNPRO_C
|
| Lines 1 to 9 are fine. But then we have lines 16, 17 and 18, where the
| "#" is used in the context of a C program and does _not_ introduce
| comments.
I'm sorry, but your argument makes no sense to me. I suppose it also
means I should not use the pattern /* in sh because it might be a C
comment? Or the converse?
| In line 29 it is a comment again, but who knows how the
| shell will treat the line that is generated by this construct -- some
| shells may require a blank before the "#", some will not.
We know. The whole Autoconf is like this, and it rocks.
In addition, this comment is not issued in the final configure.
| Hence I vote against endorsing "#" delimiters; I think that so far
| autoconf users had no problems grasping the concept of "dnl".
Ohh yes, they have: they are getting rid of comments we should make
there way into configure, as if you were systematically stripping all
your objects.
Also, because it is spelled as a macro, `dnl' is much more likely to
shot in your foot than # does.
| Every
| programmer who knows more than one language is used to every language
| using something different anyway. :-)
I think you miss the point: `#' is officially introducing a comment in
M4. We are not playing with fire.
There is just no reason to use something more complex and less usual
than `#' just for the pleasure to demonstrate you know another
language. Our eyes are used to understand what that `#' means. There
is no need for an additional complexity.
Just open acgeneral 2.13 and 2.50 in Emacs, you'll see what I mean.