zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: triviality regarding $# counts
Date: Sun, 14 Apr 2024 10:22:02 -0700	[thread overview]
Message-ID: <f3df793e-33b5-4398-a35e-01d998f7961c@eastlink.ca> (raw)
In-Reply-To: <CAH+w=7ZZG=RjDSf48wDQsxx7t6VwavfEXfRfUy3tQjEFOjPAkw@mail.gmail.com>

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



On 2024-04-14 08:51, Bart Schaefer wrote:
> On Sun, Apr 14, 2024 at 6:24 AM Ray Andrews<rayandrews@eastlink.ca>  wrote:
> 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
Absolutely.  It is subjective therefore a design decision, not anything 
like right or wrong.  I think the 'no negative options' rule is more 
objective tho.  Still, even recognizing the rule, there will be 
exceptions and maybe this is one of them.
> 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).
That might be enough to close the case.  When I think of my data arrays 
it doesn't occur to me that 'ls' is going to receive it's arguments 
using the same rules.  Yeah, I've run into that -- piping array contents 
to 'ls' and having it barf at a blank.  So even as a theoretical 
discussion, what I'm suggesting would have to be unique to personal 
data, not arguments sent to ls ... but that might not be possible so ... 
I loose.  Or ... the speculative: 'no empty elements' flag would have to 
be applied to all utilities.  Anyway it's just philosophy.

But this morning's mixup is cured.  print might take "  \n  " and give 
me a new line but as far as "  ${(f)....}  " ... is concerned they are 
not the same thing and "  '\n'  " will not be removed but "   $'\n'   " 
will be removed.  I get it.  And in an assignment, it's spaces that 
delimit elements. Hard spaces will be inside ticks or $'' .

Thanks for everyone's patience.

[-- Attachment #2: Type: text/html, Size: 2786 bytes --]

  reply	other threads:[~2024-04-14 17:22 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-11  0:56 Ray Andrews
2024-04-12  4:55 ` Lawrence Velázquez
2024-04-12 14:48   ` Ray Andrews
2024-04-12 19:09     ` Bart Schaefer
2024-04-13  1:13       ` Ray Andrews
2024-04-13  1:33         ` Mark J. Reed
2024-04-13  2:28           ` Ray Andrews
2024-04-13  3:25             ` Lawrence Velázquez
2024-04-13 14:37               ` Ray Andrews
2024-04-13 15:14                 ` Ray Andrews
2024-04-13 17:19                   ` Mark J. Reed
2024-04-13 17:27                     ` Mark J. Reed
2024-04-13 18:08                       ` Ray Andrews
2024-04-13 19:45                         ` Bart Schaefer
2024-04-13 20:36                           ` Ray Andrews
2024-04-13 21:01                             ` Bart Schaefer
2024-04-14  0:28                               ` Ray Andrews
2024-04-14  0:30                               ` Lawrence Velázquez
2024-04-14  3:26                                 ` Ray Andrews
2024-04-14  3:49                                   ` Lawrence Velázquez
2024-04-14  4:57                                     ` Bart Schaefer
2024-04-14 13:24                                       ` Ray Andrews
2024-04-14 13:35                                         ` Roman Perepelitsa
2024-04-14 14:06                                           ` Ray Andrews
2024-04-14 14:15                                             ` Roman Perepelitsa
2024-04-14 14:53                                               ` Ray Andrews
2024-04-14 15:11                                                 ` Mark J. Reed
2024-04-14 16:23                                                   ` Ray Andrews
2024-04-14 14:06                                         ` Mark J. Reed
2024-04-14 14:47                                           ` Ray Andrews
2024-04-14 14:59                                             ` Mark J. Reed
2024-04-14 15:51                                         ` Bart Schaefer
2024-04-14 17:22                                           ` Ray Andrews [this message]
2024-04-14 17:42                                             ` Mark J. Reed
2024-04-14 18:24                                               ` Bart Schaefer
2024-04-14 22:00                                               ` Ray Andrews
2024-04-13 20:11                         ` Mark J. Reed
2024-04-13 20:53                   ` Bart Schaefer
2024-04-14  0:19                     ` Ray Andrews
2024-04-13  1:35         ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f3df793e-33b5-4398-a35e-01d998f7961c@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).