On Wed, Nov 28, 2012 at 6:56 AM, ольга крыжановская < [email protected]> wrote:
> Clark, what should typeset -a arr[0]=() archive? I was trying to create a two-dimension indexed array and initialize arr[0] to an empty array. As by default ksh would view `()' as a compound var, the only way I can think of to make `()' an indexed array is to use `typeset -a'. Or any other way to init arr[0] to an empty indexed array? > It is IMO an invalid > operation to try to make an array element another array. It would > require to use a compound variable as array element and then add that > array to that compound variable. > > IMO the shell must issue an error for such invalid operations. > > Olga > > On Fri, Nov 23, 2012 at 6:17 AM, Clark WANG <[email protected]> wrote: > > See following example: > > > > $ echo ${.sh.version} > > Version AJMP 93u+ 2012-08-01 > > $ typeset -a arr > > $ typeset -a arr[0]=() > > $ typeset -p arr > > typeset -a arr=(;) ) > > $ > > > > The final `typeset -p' output is invalid. > > > > _______________________________________________ > > ast-users mailing list > > [email protected] > > http://lists.research.att.com/mailman/listinfo/ast-users > > > > > > -- > , _ _ , > { \/`o;====- Olga Kryzhanovska -====;o`\/ } > .----'-/`-/ [email protected] \-`\-'----. > `'-..-| / http://twitter.com/fleyta \ |-..-'` > /\/\ Solaris/BSD//C/C++ programmer /\/\ > `--` `--` >
_______________________________________________ ast-users mailing list [email protected] http://lists.research.att.com/mailman/listinfo/ast-users
