On Thu, Aug 31, 2017 at 9:23 AM, DJ Mills <address@hidden> wrote:
> Use case for "$*" (or similarly "${a[*]}"):
>
> join() {
> local IFS=$1
> shift
> printf '%s\n' "$*"
> }
>
> arr=(foo bar baz)
> join '+' "address@hidden"
>
> With a change in IFS, the construct becomes rather useful
>
Yes that's true, those semantics can't be expressed with
joined="address@hidden".
I guess I add an operation like "ifsjoin" to my restricted set of rules.
(Part of the reason I'm thinking about these rules is as a style guide; the
other reason is to enable automatic and correct OSH to Oil translation,
e.g. http://www.oilshell.org/blog/2017/02/05.html . As mentioned Oil has
more Python-like arrays, where the type is carried along with the value and
not the variable/location.)
thanks,
Andy