> I see that the connection nbetween the variable and the callback function is > dependent on the order of the commands; absent an "alarm var N" command, > > $ function bogus.alarm > More? { > More? date > More? } > ksh93: bogus.alarm: invalid discipline function > > But in another order different from the original example: > > alarm -r junk +2 > function junk.alarm > { > date > } > alarm -r junk +1 >
Yes, this is correct. Yes, the legal disciplines depend on the type of the variable. All variables can have get,set, and unset disciplines. When types are added to ksh93 (hopefully during 2008), each type can add disciplines that are associated with the type and have default callbacks. Until a variable is defined its type is unknown so you can't define discipline functions for it. David Korn dgk at research.att.com