[ale] Why define one function inside another (bash, awk)?

leam hall leamhall at gmail.com
Wed May 24 12:10:21 EDT 2017


So a usage issue? No significant performance degradation if the calling
script is already sourcing other files?

I'm looking at multiple scripts each at 30+ pages of code and trying to
figure out how to explain why smaller and less complex can be better.

And explain it without cussing...

Leam


On Wed, May 24, 2017 at 11:29 AM, James Sumners <james.sumners at gmail.com>
wrote:

> Scope. While Bash doesn't have any concept of a closure, it is sometimes
> helpful to know that the internally defined function is meant to only be
> used locally within that parent function.
>
> On Wed, May 24, 2017 at 11:22 AM, leam hall <leamhall at gmail.com> wrote:
>
>> I see people do this and I'm not sure why. Is there any technical
>> advantage to defining a function inside another, assuming it could be
>> defined outside and used inside?
>>
>> Thanks!
>>
>> Leam
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20170524/66fc416e/attachment.html>


More information about the Ale mailing list