From: "Bart Schaefer" <schaefer@brasslantern.com>
To: zsh-workers@sunsite.auc.dk
Subject: How does one describe $argv ?
Date: Fri, 5 Feb 1999 23:17:56 -0800 [thread overview]
Message-ID: <990205231756.ZM27407@candle.brasslantern.com> (raw)
In-Reply-To: <990205202722.ZM26495@candle.brasslantern.com>
On Feb 5, 8:27pm, I wrote:
}
} binlink () {
} argv=($^~==*(*))
} ln -s "$PWD/$^@" /usr/local/bin
} }
On Feb 4, 10:23pm, I wrote:
}
} @@ -40,7 +40,8 @@
} (Parameters are dynamically scoped.) The tt(typeset) builtin, and its
} alternative forms tt(declare), tt(integer), tt(local) and tt(readonly)
} (but not tt(export)), can be used to declare a parameter as being local
} -to the innermost scope.
} +to the innermost scope. Note that em(special) parameters cannot be made
} +local.
What's wrong with this picture?
In some sense, $argv is always local:
----------
zsh% set a b c
zsh% f() { echo $argv }
zsh% f
zsh% f x y z
x y z
zsh% echo $argv
a b c
----------
In some other sense, $argv is always global:
----------
zsh% set a b c
zsh% f() { unset argv }
zsh% f
zsh% echo $argv
zsh% echo $*
a b c
----------
I find that last bit especially puzzling; $argv is not set but $* is? And
once you get into this state, "set" gets funny on you:
----------
zsh% set d e f
zsh% echo $*
d e f
zsh% echo $argv
zsh% argv=($*)
zsh% echo $argv
d e f
zsh% set a b c
zsh% echo $argv
a b c
----------
Somehow, I don't think the "Parameters Set By The Shell" entry for `argv'
even begins to be adequate to its task:
`argv' <S> <Z>
Same as `*'.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
next parent reply other threads:[~1999-02-06 7:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <199902042236.PAA11357@ipecac.Central.Sun.COM>
[not found] ` <19990204182743.A19812@astaroth.nit.gwu.edu>
[not found] ` <990204165600.ZM19580@candle.brasslantern.com>
[not found] ` <19990204232219.B20361@astaroth.nit.gwu.edu>
[not found] ` <990204210755.ZM20448@candle.brasslantern.com>
[not found] ` <19990205184853.A24198@astaroth.nit.gwu.edu>
[not found] ` <990205202722.ZM26495@candle.brasslantern.com>
1999-02-06 7:17 ` Bart Schaefer [this message]
1999-02-06 19:53 ` PATCH: 3.1.5-pws-7: " 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=990205231756.ZM27407@candle.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@sunsite.auc.dk \
/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).