On Wed, Mar 21, 2012 at 01:38, David Korn <[email protected]> wrote:

> cc:  [email protected]
> Subject: Re: Re: [ast-users] [ksh93] `alias not found' for `arr=( a b )'
> --------
>
> > My suggestions:
> >
> > 1. Compound var assignment in the `v=( )' format must be explicitly
> > declared with `typeset -C'
> I can't require this because of backwards compatibility.  I do
> recommend it.
>

What about adding a new `set -o' option? When it's enabled, ksh would work
in a more natural and intuitive way (like Perl's `use strict'). The option
should be disabled (or be configurable at build time) by default so it
would not break old scripts.


> > 2. Var attributes like `-a', `-A' and `-C' cannot be changed unless it's
> > unset first. (With Bash when you try to convert a `-a' array to a `-A'
> > array it'll give the error message: `cannot convert indexed to
> associative
> > array'.)
> I modified the shell to disallow changing an associative array to an
> indexed array.  The other direction is legal and meaningful.
> The -A and -a attributes can be applied with -C to produce arrays
> of compound variables.
> > 3. Var attributes cannot be changed unless the old values can be migrated
> > to the new attributes in a natural and intuitive way
> I agree.
> > 4. Var attributes like `-A' cannot be unset by `typeset +A' since that
> > makes no sense. (What do we expect it to do when we `typeset +A' an
> > associative array?)
> This already the case
> $ typeset +A z
> ksh: typeset: cannot unset attribute C or A or a
>
>
> David Korn
> [email protected]
>
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to