[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] Why bash does not recoganize array type smartly?
From: |
Greg Wooledge |
Subject: |
Re: [Help-bash] Why bash does not recoganize array type smartly? |
Date: |
Wed, 16 Mar 2016 08:24:22 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Wed, Mar 16, 2016 at 01:12:18AM +0000, Dan Douglas wrote:
> On Tue, Mar 15, 2016 at 8:54 PM, Stephane Chazelas
> > zsh's syntax to define an associative array as a whole is a lot
> > saner:
> >
> > typeset -A a
> > a=(
> > key1 value1
> > key2 value2
> > )
> > [...]
> > Note that since 5.1, zsh supports
> >
> > typeset -A a=(k1 v1 k2 v2)
>
> Oh I see. That's kind of nice but unintuitive.
It's 100% intuitive coming from Tcl, which uses almost exactly the same
syntax for (associative) array definitions.
$ tclsh /dev/stdin <<'EOF'
> array set a {k1 v1 k2 v2}
> puts $a(k2)
> EOF
v2
The list of key/value pairs can be split across lines however you want.
E.g.:
array set a {
k1 v1
k2 v2
}
If Stephane can introduce zsh and C#, then Tcl seems fair game.
- [Help-bash] Why bash does not recoganize array type smartly?, Peng Yu, 2016/03/09
- Re: [Help-bash] Why bash does not recoganize array type smartly?, Chris F.A. Johnson, 2016/03/10
- Re: [Help-bash] Why bash does not recoganize array type smartly?, Chet Ramey, 2016/03/10
- Re: [Help-bash] Why bash does not recoganize array type smartly?, Dan Douglas, 2016/03/15
- Re: [Help-bash] Why bash does not recoganize array type smartly?, Stephane Chazelas, 2016/03/16
- Re: [Help-bash] Why bash does not recoganize array type smartly?, Dan Douglas, 2016/03/16
- Re: [Help-bash] Why bash does not recoganize array type smartly?, Chet Ramey, 2016/03/16
- Re: [Help-bash] Why bash does not recoganize array type smartly?, Dan Douglas, 2016/03/16
- Re: [Help-bash] Why bash does not recoganize array type smartly?, Stephane Chazelas, 2016/03/16
- Re: [Help-bash] Why bash does not recoganize array type smartly?, Dan Douglas, 2016/03/16
- Re: [Help-bash] Why bash does not recoganize array type smartly?, Greg Wooledge, 2016/03/16