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

James Sumners james.sumners at gmail.com
Wed May 24 11:29:08 EDT 2017


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
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
>


-- 
James Sumners
http://james.sumners.info/ (technical profile)
http://jrfom.com/ (personal site)
http://haplo.bandcamp.com/ (music)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20170524/4dfc6258/attachment.html>


More information about the Ale mailing list