[prev in list] [next in list] [prev in thread] [next in thread]
List: ast-users
Subject: [ast-users] Type variables with required sub-variables
From: Nathan Weeks <weeks () iastate ! edu>
Date: 2013-12-29 17:49:44
Message-ID: CAHSgV3F_rHMi5WgZ=Wtg40=gkx_STkejt=y0Dh-2SbFYN-u3ug () mail ! gmail ! com
[Download RAW message or body]
The ksh man page states:
"When defining a type, if the value of a sub-variable is not set and the -r
attribute is specified, it causes the sub-variable to be a required
sub-variable. Whenever an instance of a type is created, all required
sub-variables must be specified. These sub-variables become readonly in each
instance."
How does one set the required sub-variables when creating an instance of a
type? I have tried the following:
========================================
$ echo ${.sh.version}
Version AIJM 93v- 2013-10-08
$ typeset -T My_t=(readonly x)
$ My_t foo=(x=5)
./ksh: foo.x: is read only
$ typeset -T My2_t=(typeset -r x)
$ My2_t bar=(x=1)
./ksh: bar.x: is read only
========================================
--
Nathan Weeks
IT Specialist
USDA-ARS Corn Insects and Crop Genetics Research Unit
http://weeks.public.iastate.edu/
_______________________________________________
ast-users mailing list
ast-users@lists.research.att.com
http://lists.research.att.com/mailman/listinfo/ast-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic