> -----Original Message-----
> From: Chet Ramey [mailto:[email protected]]
> On 10/4/17 8:32 AM, Joerg Schilling wrote:
> 
> >> The portion about "local variables" in the quoted text means that the
> >> presence of the `typeset' command doesn't make a variable local:
> >> there are no local variables in ksh93 posix functions at all.
> >
> > The problem with ksh93 is that it does not allow to create variables
> > with local scope inside POSIX/Bourne functions while ksh88 allows to
> > make a variable "local" by using the "local builtin" that really is a
> > builtin alias to
> This is exactly what I said, though Korn doesn't consider it a "problem"
> at all, since Posix has no local variables.

Perhaps I haven't understood the full import, but ksh92 has an additional
function syntax (function name { body; }), where "function" is a keyword,
that provides local variables declared with typeset.

"The New Kornshell" states


Because of deficiencies in the POSIX shell standard, there are two
types of functions.  POSIX functions [...] do not provide any scoping [...]
This makes it hard to write functions that don't have side effects.


So it seems ksh92's implementation of POSIX functions is for standards 
conformance,
and the new syntax was introduced to avoid breaking that conformance.

Reply via email to