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

Re: Inconsistencies in "-quoting and @-splitting, could someone elaborate?



On Sun, 28 Oct 2018 at 22:13, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Sun, Oct 28, 2018 at 4:54 AM Sebastian Gniazdowski
> <sgniazdowski@xxxxxxxxx> wrote:
> >
> > @ is refered to as "@  -- double-quoted splitting of scalars" in
> > completion.
>
> Well, that's incorrect, Oliver should not have put it that way.  @ has
> nothing to do with splitting of scalars; it would more correctly say
> "prevent double-quoted joining of arrays".  (In general you should
...
> > So one can obtain always-array behavior with @.
>
> Also wrong, which is why the (A) flag was extended to mean "treat
> single-element arrays as arrays instead of as scalars".  The

Ok, with those clear pointers a new whole-picture can be constructed:
- @ - keep array form
- A - apply array form

> > I understand it as: for quoted expression, regenerate
> > array-form by doing splitting.
>
> No, it regenerates nothing.  It just preserves the array form that
> already existed.  If there was no array form in the first place, it
> has no effect.

I could see this clear fact from the execution times. @ doesn't cause
much slowdown. That said, people on IRC also directed to the
conclusion that @ is about splitting.

It is hard to create final-truth documents, I hope I will be able to
nicely rephrase it (ZNSHandbook).

-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org



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