There appears to be a bug (or at least unexpected behavior) concerning
typed variable assignment where the type is defined in a file
accessible via FPATH.
If a type is defined in a file with the same name as the type, and the
directory containing the file is added to FPATH, then an instance of
the type can be created and then used in an assignment command;
however, an error is issued if the creation & assignment are attempted
in a single command:
========================================
$ echo ${.sh.version}
Version AJM 93u+ 2012-08-01
$ cat my_t_dir/My_t
typeset -T My_t=(integer i j)
$ cat test1.ksh
. my_t_dir/My_t
My_t a=(i=1 j=2)
print ${a.i} ${a.j}
$ ksh93 test1.ksh
1 2
$ cat test2.ksh
My_t a
a=(i=1 j=2)
print ${a.i} ${a.j}
$ FPATH=my_t_dir ksh93 test2.ksh
1 2
$ cat test3.ksh
My_t a=(i=1 j=2)
print ${a.i} ${a.j}
$ FPATH=my_t_dir ksh93 test3.ksh
test3.ksh: syntax error at line 1: `(' unexpected
========================================
--
Nathan Weeks
IT Specialist
USDA-ARS Corn Insects and Crop Genetics Research Unit
http://weeks.public.iastate.edu/
_______________________________________________
ast-users mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-users