From: Per Bothner <[EMAIL PROTECTED]>
   Date: 08 May 2000 06:53:13 -0700

   I do not see 4.3BSD as a reason to not use functions in shell scripts.

I can see good arguments on both sides of this question.  A similar
question is whether an application should work with K&R C.

It used to be that there was no dispute.  Applications had to work
with the traditional Bourne shell, and with K&R C.  Conversely, at
some future time there will be little dispute that we needn't support
those old platforms.  But now, we're in a transition period, where
it's reasonable for some "liberal" applications to not bother to work
with these old platforms, and other "conservative" applications to
keep working.

autoconf generates shell scripts that other applications use, so it
should be conservative in this area -- otherwise, other conservative
GNU applications can't use autoconf.  Another argument for autoconf
avoiding shell functions is that autoconf uses m4 as an extension
language, so it can obtain many of the benefits of shell functions by
using m4 instead.

GCC is different.  I agree with Per Bothner that nowadays GCC build
scripts can use shell functions if it seems advisable.  The decision
to use shell functions shouldn't be made lightly: GCC should try to
support traditional Bourne shells if possible, particularly if someone
volunteers to maintain this support.  But if it's an undue maintenance
burden to support these old shells then I think it's reasonable to
drop it.

Reply via email to