zsh-workers
 help / color / mirror / code / Atom feed
* Any comment on users/15442 ?
@ 2010-10-06  1:50 Bart Schaefer
  2010-10-07 20:24 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Bart Schaefer @ 2010-10-06  1:50 UTC (permalink / raw)
  To: zsh-workers

I wrote:
> } host# IFS=
> } host# set - "a b" "c   d" e$'\0'f 'gxh'
> } host# setopt sh_wordsplit
> } host# print -l $*
> } a bc   defgxh
> 
> This might in fact be a bug.  Fix (?) below; everyone but PWS can stop
> reading when their eyes begin to glaze over [...]


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Any comment on users/15442 ?
  2010-10-06  1:50 Any comment on users/15442 ? Bart Schaefer
@ 2010-10-07 20:24 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2010-10-07 20:24 UTC (permalink / raw)
  To: zsh-workers

/* Er, yeah. */

> } host# IFS=
> } host# set - "a b" "c   d" e$'\0'f 'gxh'
> } host# setopt sh_wordsplit
> } host# print -l $*
> } a bc   defgxh
> 
> This might in fact be a bug.  Fix (?) below; everyone but PWS can stop
> reading when their eyes begin to glaze over, as this is zsh-workers
> material.  I took the approach of basing this on emulation mode rather
> than on the SH_WORD_SPLIT option, to minimize zsh-mode disruption, but
> that can easily be adjusted.

I think the option would be better.  I'm not very keen on things that
can only be adjusted by changing the entire emulation.  Anything
beginning "SH_" means "do this like sh, you are now leaving the world of
zsh", in my book [it's still selling], so the usual guarantees that we
won't change the behaviour are superseded by sh compatibility.  That
also makes it easier to test.

> The following implements the ksh-equivalent behavior by initializing the
> state of the (@) flag based upon the value of $IFS when we are in sh/ksh
> emulation mode, and then by requiring later joining to pay attention.
> However, it also has the side-effect of changing the behavior of ${=...}
> in a related way.

I doubt that's a problem.  I think they should split in the same way.
We're now in sh-land using a zsh-specific feature with an unusual
setting for IFS.  It probably just needs to follow sh behaviour.

> There no longer is a chunk marked "YUK" that I can find so I'm not sure
> what either of these refers to.

I think this went when Wayne fixed up word splitting so it worked
properly on strings that occur inside braced parameter substitutions.
Look at the 4.2 branch if you want to see what it looked like before.
Hence many of the comments may be out of date.  It also may have made
isarr operate differently.

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-07 20:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-06  1:50 Any comment on users/15442 ? Bart Schaefer
2010-10-07 20:24 ` Peter Stephenson

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).