From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6169 invoked by alias); 31 Oct 2012 15:02:03 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30772 Received: (qmail 7767 invoked from network); 31 Oct 2012 15:01:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at samsung.com does not designate permitted sender hosts) Date: Wed, 31 Oct 2012 15:01:40 +0000 From: Peter Stephenson To: Zsh Hackers' List Subject: Shift arguments Message-id: <20121031150140.32569722@pwslap01u.europe.root.pri> In-reply-to: <20121031142546.529e1709@pwslap01u.europe.root.pri> References: <20121031134007.GA9731@localhost.localdomain> <20121031142546.529e1709@pwslap01u.europe.root.pri> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-TM-AS-MML: No On Wed, 31 Oct 2012 14:25:46 +0000 Peter Stephenson wrote: > It looks like this is hitting some pathology in memory management to > do with the argument array (which is being shifted at that line). Looking at the code, I found a feature of shift I'm not sure I like: % integer foo=3 % set -- one two three four five six % shift foo % print $* four five six In other words, if the argument to shift is a parameter that isn't an array, it's used to give a mathematical value with which to shift the positional parameters. That seems confusing. pws