bug-bash
[Top][All Lists]
Advanced

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

Re: array subscripts act differently for integers(ie. let)


From: Chet Ramey
Subject: Re: array subscripts act differently for integers(ie. let)
Date: Sat, 21 Feb 2015 12:24:22 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

On 2/20/15 3:52 PM, Dan Douglas wrote:

> IMO bash is exactly correct. I don't know how this could be "fixed" in
> a way that would satisfy people without changing something very
> fundamental. If you disable the initial expansion to `(())', then
> `(($x))' wouldn't work (because arithmetic evaluation doesn't itself
> evaluate parameter expansions). However if you disabled evaluating
> parameter expansions during variable resolution (for array indexes)
> then you would be stuck with exactly the above ksh problem.

Yeah, exactly.  I could potentially avoid the double-expansion issue
by adding flags and other conditional beahvior, but I'm afraid it
would be fragile and inconsistent.  The backwards compatibility issue
would come up either way.

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



reply via email to

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