From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@sunsite.dk
Subject: Re: Completion function for bitkeeper?
Date: Fri, 14 Nov 2003 17:14:17 +0000 [thread overview]
Message-ID: <1031114171417.ZM2439@candle.brasslantern.com> (raw)
In-Reply-To: <19332.1068826982@csr.com>
[This should move to zsh-workers?]
On Nov 14, 4:23pm, Peter Stephenson wrote:
} Subject: Re: Completion function for bitkeeper?
}
} Bart Schaefer wrote:
} > Word splitting is vastly different in the two cases. It happens within
} > the words of $action in the second case, but does not in the first case.
That's a bit incoherent, let me try again.
Consider what happens when there are command separators in the values of
$action. Suppose e.g. that
action=( \{ foo '&&' bar \} )
} while _next_label "$subc" expl "$descr"; do
} eval "$action[2,-2]" && ret=0
} done
In the above case we execute the equivalent of
foo && bar && ret=0
However, if instead
action=( ' ' foo '&&' bar )
} eval "action=( $action )"
} while _next_label "$subc" expl "$descr"; do
} "$action[@]" && ret=0
} done
In this second case it's a syntax error. I suppose it could be argued
that the second case is unnecessary because it's only a shorthand for
the first case with only one command in the braces.
Also in the second case the eval has been factored out of the loop
because we're always interested in the entire value of "$action" and
it's fractionally more efficient to do the "eval" once only.
However, on third thought, it could be argued that the second case has
a bug. Consider
action=( " foo ) && bar=( oops" )
next prev parent reply other threads:[~2003-11-14 17:14 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-23 16:00 Steve Borho
2003-05-23 16:01 ` Danek Duvall
2003-11-06 15:32 ` Danek Duvall
2003-11-07 19:17 ` Oliver Kiddle
2003-11-10 18:20 ` Danek Duvall
2003-11-11 8:22 ` Oliver Kiddle
2003-11-11 10:42 ` Peter Stephenson
2003-11-11 15:21 ` Oliver Kiddle
2003-11-11 15:24 ` Peter Stephenson
2003-11-11 16:13 ` Oliver Kiddle
2003-11-11 16:23 ` Peter Stephenson
2003-11-11 16:44 ` Oliver Kiddle
2003-11-11 16:23 ` Danek Duvall
2003-11-11 19:06 ` Oliver Kiddle
2003-11-11 21:28 ` Danek Duvall
2003-11-14 8:04 ` Oliver Kiddle
2003-11-14 10:47 ` Peter Stephenson
2003-11-14 13:09 ` Oliver Kiddle
2003-11-14 16:12 ` Bart Schaefer
2003-11-14 16:23 ` Peter Stephenson
2003-11-14 17:14 ` Bart Schaefer [this message]
2003-11-14 17:01 ` Oliver Kiddle
2003-11-14 15:46 ` Danek Duvall
2003-11-14 21:24 ` Danek Duvall
2003-11-17 15:47 ` Oliver Kiddle
2003-11-17 17:51 ` Danek Duvall
2003-11-19 10:23 ` Oliver Kiddle
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=1031114171417.ZM2439@candle.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-users@sunsite.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).