Re:Szl, a Tcl-inspired embeddable language
by jstimpfle on Saturday October 08, 2016 @08:04PM
(#12669287)
What's more horrible about it is that the simpler sh constructs are somehow not respected in bash culture.
In sh, each function has a local array, and you use that array with "$@". And typically you can get along with only that array. Not so bad.
my_b() {
somefunc foo "$@" bar
}
I think it mainly has to do with the fact that bash has no references and garbage collection. When you create an array like [1, 2, [a, b]] in Python/Ruby/Perl, you are introducing the concept of references, as well introducing hte potential for reference cycles.
In contrast, an array in bash is just a value, and it took me awhile to figure out how to even copy it. None of these work:
This works: In other words, it takes 11 characters to properly copy an array! This syntax is horrible.