[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sh portability questions

From: Ralf Wildenhues
Subject: Re: sh portability questions
Date: Wed, 28 Sep 2005 09:25:43 +0200
User-agent: Mutt/1.5.11

Just a couple of random thoughts:

* Paul Eggert wrote on Wed, Sep 28, 2005 at 12:36:06AM CEST:
> Andreas Schwab <address@hidden> writes:
> > Paul Eggert <address@hidden> writes:
> >
> >> Assuming you don't need recursion, here's a thought.

I believe this is a decent assumption for the functionality both
Autoconf and Libtool provide now.

> >> Use "local", but
> >> stick to the convention that all variable names are unique.  On
> >> systems that don't support "local", define a function named "local"
> >> that warns if any of its arguments is a variable whose value is set;
> >
> > That would also (spuriously) warn if you call a function with local
> > variables a second time, unless you explicitly unset the local variables
> > before returning.

> I guess the best we can do is define a function "local" that does nothing.

We had the idea of emulating local variables (in the non-recursive
setting) with m4:
but it was admittedly seen as rather ugly-to-read for the end-user.
(Begs the question how nice to read Autoconf output is now.. ;-)

You can probably even have m4 (or a combination of m4 and testsuite
shell scripts) check that your function call tree doesn't have any
circles, and produce the output topologically sorted, just as the
AC_REQUIRE machinery does now.  Probably way overkill.

Ralf, who ducks and runs now

reply via email to

[Prev in Thread] Current Thread [Next in Thread]