Date:        Wed, 9 Jan 2019 17:35:10 +0000
    From:        Stephane Chazelas <stephane.chaze...@gmail.com>
    Message-ID:  <20190109173510.xn4hdeqphbffb...@chaz.gmail.com>

  | I'd rather POSIX forbade applications to use "while", "until",
  | "do", "select", "time", etc in alias names, or leave it
  | unspecified whether aliases for those are expanded.

A lot of what you say I think, which I believe to be mostly correct,
comes down to the issue of for whom the standard is intended.

As long as it is expected that the audience is script writers, then
the doc should tell them what they can expect will work, and
what will not (or may not) so that portable applications can be
created.   I think the current wording does that, as shells do actuall
allow aliases to be created for keywords (in all shells for the ones
that are also English words - or similar, like fi etc, and in some shells
even for the others (! { ...).

I don't think we are in a position to forbid anything, even if we wanted,
but I assume you mean "would result in unspecified behaviour" if
an application makes an alias for a keyword - I'd have no real problem
with that.

  |  but more about not requiring limitations of the original implementation 
when
  | they're not justified.

If that were the objective, then the audience of the standard would need
to be the shell implementors, rather than the script writers.   And in that
case I assume the objective would be to allow exactly what you wanted
to forbid just above (though in your message, the two quoted occurred in
the alternate sequence) and instead allow the shell to expand aliases that
are keywords, everywhere.   I'd have no problem with that either.

As long as we're not explicitly covering both audiences (with different
text for each when required) we cannot really do both however.  Many
(most, perhaps even all) shells do not allow an alias to replace an
actual keyword (as distinct to a word with the same spelling used elsewhere)
so we cannot suggest that it even might be OK.   Nor can we tell the
shells not to expand words that would be keywords when used elsewhere
as currently users have the ability to do that, and we cannot break
existing conforming applications.

So, rock, meet the hard place...

kre

ps: the one incorrect (but irrelevant for your points) part of your message
was the "alias 'while=until'" ... since "until" is a keyword, that's not an 
alias that expands to what could be a simple command, and any use of
it  (in any context) would be unspecified.   However you made no us
e anywhere of that :"until", it could have just as easily been "foo", so
this is an insignificant issue.


Reply via email to