Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: why not promote the plague ? (brace|rc|alternative|modern) syntax



On Fri, Dec 13, 2024 at 3:58 PM Marc Chantreux <mc@xxxxxxxxxx> wrote:
>
> On Fri, Dec 13, 2024 at 07:13:20AM +0900, Bart Schaefer wrote:
> > I think those remarks apply mostly to script programming.  E.g., I use
> > shortloops all the time when at an interactive prompt, up until it becomes
> > complicated enough with pipelines etc. that I need to force the interpretation.
>
> I don't setopt shortloops. AFAIR it's different from alternative syntax
> (and didn't work well for me). can you confirm ?

It looks like there's some confusion in this thread about alternate syntax:
for a (foo bar baz) { echo $a }
vs short_loops syntax:
for a in foo bar baz; echo $a

But for what it's worth, short_loops is unfortunately set by default.
If you don't want to use it, I recommend sticking a setopt
noshortloops in your .zshrc to catch more typos.

-- 
Mikael Magnusson




Messages sorted by: Reverse Date, Date, Thread, Author