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

Re: The big kre zsh bug report



    Date:        Fri, 21 Dec 2018 12:37:08 -0800
    From:        Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
    Message-ID:  <CAH+w=7ajDgcRHg6A+LXSCExq6k3sexx7aeM8U-XErV_QcbbZMg@xxxxxxxxxxxxxx>

  | (For some reason gmail put your reply in spam, I only found it by accident.)

Google (in general) tends to not like munnari, as I don't believe that
ip6.arpa or in-addr.arpa have any remaining relevance, and refuse to
bother populating tje relevant zones (though whoever it is who runs the
v4 network I have access to a piece of, has the in-addr.arpa version
filled in).   If you had an @gmail.com address there's a 50-50 chance the
mail would simply have been bounced.

[-h]
  | > Yes, I know what it means.
  |
  | Obviously you do, but I didn't until it was mentioned here, so I
  | assume the rest of the zsh-workers audience might not either.

There are times I forget that some of these messages are going to a list.,
particularly when it is one I am not on.


  | OK, that's understandable.  Any situation in which given (just for
  | example) var='[a-z]' we interpret $var as a character class, we ought
  | to also when given var='\z' treat $var as a literal z.

Unless it is "$var" in which case the quotes should quote everything
in the value.    This stuff is all just ugly.

  | None of the discussion of $var interpolation of '\z' in pattern
  | context has any relationship to the discussion about treatment of bad
  | patterns.

Agreed, those are two different issues.   Though, once again, there
are no bad patterns in sh, the definition doesn't allow for that possibility.
A '[' only introduces a "one-of-a-set" if there is a closing unquoted ]
(which is not a terminator of one of the internal newly invented i18n objects)
(and not immediately after the [, ignoring any intervening ! (or ^)).
otherwise the '[' is just a '['.

Inside a [ ] when one is found, a [: only introduces a character class
if followed by a legitimate name (as in correct syntax), and :] (if the
name is invalid, or the : is quoted, then that ] would end the []
Even something as seemingly stupid as [b-a] is not invalid.

  | It's just so you can run native sh scripts.

OK, if that is all you need.

  | The --emulation option is just a way to talk zsh into behaving as if
  | $0 were changed.  --emulate csh is even farther from accurate.

I'm not sure why you'd bother with the latter,  while the csh UI was good,
the way it was developed meant its syntax was horrid, why anyone would
ever write anything in csh has always baffled me - a typical csh script tends
to be about twice as long as the same thing written in sh (and that's basic
sh, as it was in 1980, with no functions, arith,  ...)

  | I don't recall exactly but it's probably more like double that (2^32
  | pointers to things representing unset elements,

Yes, I was assuming that a truly unset element (one never mentioned
anywhere at all) would just be a null pointer (what else would that mean?)
- but I knew I could be off by a bit (an array element might be more than
just a pointer to its data).

But I also don't really believe that arrays are needed in sh - they tend
to be wanted by people who want to write sh as if it were C (or whatever
else similar) - rather than its own language type.   Without those and with
the positional params being more akinn to special params than variables,
their implementation gets much simpler than it would be otherwise.  Our
positional prams are an (internal, C) array of pointers to strings.   That's
all that is needed (well, plus an int type to hold $#).

kre



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