Having
set x {{{a b} {c d}}}
I would like to read "a". Is there a cleaner way than:
lindex [lindex [lindex $x 0] 0] 0
Having
set x {{{a b} {c d}}}
I would like to read "a". Is there a cleaner way than:
lindex [lindex [lindex $x 0] 0] 0
The lindex command supports two other ways of doing that access:
Multiple keys:
lindex $x 0 0 0
Compound keys:
lindex $x {0 0 0}
You can't mix the two in the same call; compound keys only work if they're the sole index argument. Just to keep a little bit of comprehensibility, both for people using the command and people implementing it.
The lset command supports the same indexing schemes.