bug-bash
[Top][All Lists]
Advanced

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

Re: Patch for autoload.v3 to allow export of function


From: Chet Ramey
Subject: Re: Patch for autoload.v3 to allow export of function
Date: Sun, 2 Jul 2017 12:50:28 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.1.1

On 7/1/17 5:50 PM, Matthew Persico wrote:
> Greetings!
> 
> I have finally gotten around to working on autoload again to ensure that
> there are no issues. But I have a question about the _AUTOLOADS array,
> which is used to track what has been autoloaded and is the source of
> information for the -p command.
> 
> The code executes a linear scan of the array _AUTOLOADS each time it has to
> find and element for removal or to make sure it is not about to add a
> duplicate entry. This is hardly very efficient. Would it be OK to convert
> that to an associative array (hash to us Perlers) indexed on function name?
> 
> I ask before submitting the patch because I am worried about backward
> compatibility; I do not know when hashes were added to bash nor do I know
> what the policy is about how far back compatibility has to be maintained.

Go ahead and submit the patch; if backwards compatibility is an issue, just
name it `autoload.v4'.  Associative arrays have been in bash since
bash-4.0, which was released in 2009, so including an updated version with
future bash distributions should not limit its usefulness.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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