libtool-patches
[Top][All Lists]
Advanced

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

Re: function-local variables in ltmain


From: Ralf Wildenhues
Subject: Re: function-local variables in ltmain
Date: Sun, 14 Aug 2005 08:54:44 +0200
User-agent: Mutt/1.5.9i

Hi Albert,

* Albert Chin wrote on Sat, Aug 13, 2005 at 09:56:43PM CEST:
> On Sat, Aug 13, 2005 at 10:40:01AM +0200, Ralf Wildenhues wrote:
> > Gary once mentioned a plan to emulate local variables in m4sh.

> > 2) This looks somewhat ugly in the output, but to a certain extent, it
> > is possible to emulate local variables with m4sh: see below.
> 
> Way ugly.

Yep.

> Just seems to make libtool harder to maintain.

I don't know.

> What's the point anyway? To keep function-specific variables from
> being clobbered? Was this so much of a problem before libtool had
> functions and everything was global? Seems like a solution looking for
> a problem.

Well, I would like to modularize it more.  I am pretty sure it can be
made shorter and easier to understand that way.  (See func_execute_cmds
or func_source for example). For this, all-global variables are a
problem to some extent.

Just look at two examples: func_extract_archives uses variables named
my_*.  This is not safe: both its caller and any functions it may call
itself may overwrite these accidentally.  func_extract_an_archive OTOH
uses safe names f_ex_an_ar_*, but is ugly to the point of being
unreadable.

I do _not_ want to eliminate use of globals.  All I want is an easier
method for ensuring this than regular grepping of the whole script.
I'm certainly not determined to use this particular idea.

Cheers,
Ralf




reply via email to

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