Sujet : Re: Array get element with default (no error if not exist)
De : ralfixx (at) *nospam* gmx.de (Ralf Fassel)
Groupes : comp.lang.tclDate : 16. Aug 2024, 15:54:01
Autres entêtes
Message-ID : <ygajzggzfg6.fsf@akutech.de>
References : 1 2
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
* Emiliano <
emil.g@example.invalid>
| On Fri, 16 Aug 2024 07:10:30 +0000
| RodionGork <
rodiongork@github.com> wrote:
| > Also why [array exists ...] command does not exist (while [dict exists
| > ..] does)? Perhaps there is something about no good syntax for it due
| > to how arrays are implemented?
>
| The [array exists] command is there since ... forever
>
| % array exists foo
| 1
| % array exists nosucharray
| 0
Obviouosly in this context the OP meant "array exists" with respect to a
specific key, i.e.
array exists arrayname key
=> return true if arrayname is an array and the key exists in that array.
R'