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

Re: triviality regarding $# counts



On Sun, Apr 14, 2024 at 6:24 AM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> I know it's far too late to fret this stuff, still it's interesting to contemplate these design level issues.  P.F. did the right thing not splitting by default but he should have left the empties in by default too, IMHO.
> [...]
> the 'doctrine of least surprise' should prevail.

The trouble with that "doctrine" is that what is surprising is
subjective and context-dependent both in usage and in time.  When
these decisions were made, the largest number of zsh adoptees would
have been more surprised by having empty elements kept than removed.
Mysteriously receiving error messages like

ls: : No such file or directory

would have been the surprising thing.  Further, many commands neither
understand nor do anything useful with empty string arguments, and zsh
was intended first to be an interactive command shell and only second
a programming language (just a better one than BSD csh).




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