David Korn informs:
> cc: [EMAIL PROTECTED]
> Subject: Re: [ast-users] How to determine if a type has already been defined?
> --------
>
>
> > How can one see the defined types? Other languages have a defined
> > function which allows one to test if a symbol has been defined.
> >
> >
>
> ${.sh.type} expands to the list of define types.
>
> Also ${.sh.type.name:+defined}
> will output defined if the type named name is defined.
>
> You can also use [EMAIL PROTECTED] to get the *name if the type name
> is defined. If name was derived from another type, then the parent
> type name followed by a . will preceded name.
>
> For example,
> typeset -P Pt2d_t=(
> float x=1 y=2
> )
> typeset -P Pt3d_t=(
> Pt2d_t _
> z=3
> )
> The [EMAIL PROTECTED] will give Pt2d_t.Pt3d_t
Thanks for the info. Alas it doesn't seem to work for me:
$ ksh
$ echo $KSH_VERSION
Version M 93t 2008-09-26
$ typeset -P Pt2d_t=( float x=1 y=2 )
ksh: typeset: -P: unknown option
Usage: typeset [-bflmnprstuxACHS] [-a[type]] [-i[base]] [-E[n]] [-F[n]] [-L[n]]
[-R[n]] [-X[n]] [-h string] [-T tname] [-Z[n]] [name[=value]...]
Or:[name[=value]...]
typeset[name[=value]...]
[[name[=value]...]
options[name[=value]...]
] -f [name...]
$ typeset -C Pt2d_t=( float x=1 y=2 )
$ echo ${.sh.type}
$ echo ${.sh.type.name:+defined}
$
= = = =
I'm using Version M 93t 2008-09-26 because of the Memory fault in
kshdb mentioned before. However I've looked at RELEASE and see no
mention of -P for typeset.
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users