zsh-workers
 help / color / mirror / code / Atom feed
* x=(foo ; bar) array assignments with embedded semicolons
@ 2015-11-17 22:16 Daniel Shahaf
  2015-11-17 23:55 ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Shahaf @ 2015-11-17 22:16 UTC (permalink / raw)
  To: zsh-workers

% x=(foo ; bar)
% print $#x $x
2 foo bar

Eric reproduced that with various versions going as far back as 3.0.8.


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

* Re: x=(foo ; bar) array assignments with embedded semicolons
  2015-11-17 22:16 x=(foo ; bar) array assignments with embedded semicolons Daniel Shahaf
@ 2015-11-17 23:55 ` Bart Schaefer
  2015-11-18 10:20   ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2015-11-17 23:55 UTC (permalink / raw)
  To: Daniel Shahaf; +Cc: Zsh hackers list

[-- Attachment #1: Type: text/plain, Size: 128 bytes --]

That's actually a feature, it's the same as writing

x=(foo
bar)

Yes, I'm being somewhat facetious, but that's why it happens.

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

* Re: x=(foo ; bar) array assignments with embedded semicolons
  2015-11-17 23:55 ` Bart Schaefer
@ 2015-11-18 10:20   ` Peter Stephenson
  2015-11-18 15:47     ` Bart Schaefer
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 2015-11-18 10:20 UTC (permalink / raw)
  To: Bart Schaefer, Zsh hackers list

On Tue, 17 Nov 2015 15:55:10 -0800
Bart Schaefer <schaefer@brasslantern.com> wrote:
> That's actually a feature, it's the same as writing
> 
> x=(foo
> bar)
> 
> Yes, I'm being somewhat facetious, but that's why it happens.

I don't think it's facetious at all.  Unquoted ";" is a separator,
whether in an array or not.  The only other thing I can think of it
could reasonably do is an error because you haven't completed the array
before the end of the command, but that doesn't seem very useful.

pws


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

* Re: x=(foo ; bar) array assignments with embedded semicolons
  2015-11-18 10:20   ` Peter Stephenson
@ 2015-11-18 15:47     ` Bart Schaefer
  2015-11-19  5:47       ` Eric Cook
  0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2015-11-18 15:47 UTC (permalink / raw)
  To: Zsh hackers list

On Nov 18, 10:20am, Peter Stephenson wrote:
}
} I don't think it's facetious at all.  Unquoted ";" is a separator,
} whether in an array or not.

Nevertheless it is a syntax error in e.g. bash to use ";" there.


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

* Re: x=(foo ; bar) array assignments with embedded semicolons
  2015-11-18 15:47     ` Bart Schaefer
@ 2015-11-19  5:47       ` Eric Cook
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Cook @ 2015-11-19  5:47 UTC (permalink / raw)
  To: zsh-workers

On 11/18/2015 10:47 AM, Bart Schaefer wrote:
> On Nov 18, 10:20am, Peter Stephenson wrote:
> }
> } I don't think it's facetious at all.  Unquoted ";" is a separator,
> } whether in an array or not.
> 
> Nevertheless it is a syntax error in e.g. bash to use ";" there.
> 
And that is what i assumed zsh would do. Since the only syntactical mention of ;
in the man pages i saw was as a list terminator; leaving the incomplete array definition.

Since it is intentional, could it be added to the man pages?


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

end of thread, other threads:[~2015-11-19  6:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-17 22:16 x=(foo ; bar) array assignments with embedded semicolons Daniel Shahaf
2015-11-17 23:55 ` Bart Schaefer
2015-11-18 10:20   ` Peter Stephenson
2015-11-18 15:47     ` Bart Schaefer
2015-11-19  5:47       ` Eric Cook

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