From: Peter Stephenson <p.stephenson@samsung.com>
To: Zsh Hackers' List <zsh-workers@zsh.org>
Subject: Shift arguments
Date: Wed, 31 Oct 2012 15:01:40 +0000 [thread overview]
Message-ID: <20121031150140.32569722@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <20121031142546.529e1709@pwslap01u.europe.root.pri>
On Wed, 31 Oct 2012 14:25:46 +0000
Peter Stephenson <p.stephenson@samsung.com> 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
next parent reply other threads:[~2012-10-31 15:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20121031134007.GA9731@localhost.localdomain>
[not found] ` <20121031142546.529e1709@pwslap01u.europe.root.pri>
2012-10-31 15:01 ` Peter Stephenson [this message]
2012-10-31 16:33 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121031150140.32569722@pwslap01u.europe.root.pri \
--to=p.stephenson@samsung.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).