zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@sunsite.dk
Subject: Re: path and += troubles
Date: Sun, 27 Nov 2005 13:34:26 +0000	[thread overview]
Message-ID: <200511271334.jARDYWrO004473@pwslaptop.csr.com> (raw)
In-Reply-To: Your message of "Sat, 26 Nov 2005 21:13:00 GMT." <1051126211300.ZM1008@candle.brasslantern.com>

Bart Schaefer wrote:
> Exactly ... the problem is this:
> 
> schaefer<508> echo $1+=($2)
> zsh: no match
> schaefer<509> $1+=($2)
> schaefer<510> 
> 
> Where's my "no match" error in the second case?

(I'll abandon the other patch since that's not what you're worried
about.)

I'm having a hard time coming up with a combination of options and
arguments that does this.

% zsh -f           
% echo $1+=($2)
zsh: no matches found: +=()
% $1+=($2)
zsh: no matches found: +=()
% fn1() { echo $1+=($2); }
% fn1
fn1: no matches found: +=()
% fn2() { $1+=($2); }     
% fn2
fn2: no matches found: +=()
% fn2 path /usr/bin
fn2: missing end of name

(the last is supposed to look like what Steven was trying to do.)

But didn't you say the problem was with NULLGLOB?  Surely you'd expect
the presence of something looking like glob qualifiers (as long as
they're valid, and a lot of strings are valid global qualifiers) to make
the command turn out to be a boojum?

% setopt nullglob
% foo(.)
% $1+=(.)
% $1+=($2)
%

What am I missing?

One oddity is that +=($2) *does* give a "not an indentifier" error,
which is almost redundant with the current way of parsing assignments.
I think that's because the lexical analyser finds that "=" is not at the
start, so searches for an assignment.  Then it finds an empty identifier
and skips over the "+".  This means that it successfully meets the
condition for an ENVSTRING (we got to the "=" without finding an invalid
character).  Later, the actual assignment rejects this with contumely.
This is a small inconsistency.

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page still at http://www.pwstephenson.fsnet.co.uk/


  reply	other threads:[~2005-11-27 13:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1051126170046.ZM773@candle.brasslantern.com>
2005-11-26 18:40 ` Peter Stephenson
2005-11-26 21:13   ` Bart Schaefer
2005-11-27 13:34     ` Peter Stephenson [this message]
2005-11-27 18:40       ` Bart Schaefer
2005-11-27 20:39         ` Peter Stephenson
2005-11-28  1:15           ` 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=200511271334.jARDYWrO004473@pwslaptop.csr.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@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).