zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: [bug] shwordsplit not working on $@ when $# > 1
Date: Wed, 10 Aug 2016 10:28:36 -0700	[thread overview]
Message-ID: <160810102836.ZM15324@torch.brasslantern.com> (raw)
In-Reply-To: <20160809094013.01f0f5f8@pwslap01u.europe.root.pri>

On Aug 9,  9:40am, Peter Stephenson wrote:
}
} On Mon, 08 Aug 2016 18:21:24 -0700
} Bart Schaefer <schaefer@brasslantern.com> wrote:
} > I *think* we can untangle this as follows, but then again I thought
} > I had untangled in in workers/29313, too.  This relies on the idea
} > that if we already have an array when nojoin, then we're not going
} > to split it again, which seems dubious somehow if there is explicit
} > use of the (s:-:) flag.
} 
} That was my first worry, looking at the change, but simple examples of
} this still work, so I can't see an obvious case where this isn't better
} than before.

It's better than before in that the two specific shwordsplit issues are
addressed.  However, I'm not sure that either of these cases is correct:

torch% x=(a:b "c d" ef)
torch% print -l ${(s.:.)x}
a
b c d ef
torch% print -l ${(@s.:.)x}
a:b
c d
ef

The first one agrees with zsh-3.0.8, so I guess it's no more wrong than
it ever was.  The second one used to work exactly like the first one,
and is the one that worries me the most.  I can fix that by testing
(nojoin % 2) instead of (!nojoin) but that seems like piling a hack on
top of a hack.

Then there's this weird edge case, where an empty $IFS acts like you
have specified the (@) flag when shwordsplit is set:

torch% IFS=
torch% setopt shwordsplit
torch% print -l ${(s.:.)x}
a:b
c d
ef


  reply	other threads:[~2016-08-10 22:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-08 11:16 Stephane Chazelas
2016-08-08 17:28 ` Bart Schaefer
2016-08-08 18:02   ` Jérémie Roquet
2016-08-08 18:27 ` Peter Stephenson
2016-08-09  1:21   ` Bart Schaefer
2016-08-09  8:40     ` Peter Stephenson
2016-08-10 17:28       ` Bart Schaefer [this message]
2016-08-11 10:05         ` Peter Stephenson
2016-08-11 17:28           ` Bart Schaefer
2016-08-12  7:50             ` Bart Schaefer
2016-08-10 12:56     ` Peter Stephenson
2016-08-11  0:39       ` 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=160810102836.ZM15324@torch.brasslantern.com \
    --to=schaefer@brasslantern.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).