Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: is a key of pointed key set ? (where is the + )



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 06 November 2006 11:04, Marc Chantreux wrote:
> Hi all,
>
> See this code:
>
> pnt=h
> typeset -A h
> h=( k1 value )
>
> so :
>
> echo ${${(P)pnt}[k1]}
> prints value
>
> but how to know if the key itself is set ?

{pts/0}% typeset -A h
{pts/0}% h=(k v)
{pts/0}% print -- ${(k)h[k]+set}
set
{pts/0}% print -- ${(k)h[k1]-unset}
unset

- -andrey
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFTvA9R6LMutpd94wRAlZNAJwLesklZ5N2tuHvm/tKfvw2wtgqUgCfYBkm
Z33cKWv8KRvmBY0ZQ7FBbWE=
=5lhJ
-----END PGP SIGNATURE-----



Messages sorted by: Reverse Date, Date, Thread, Author