[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: @K transformation
From: |
Koichi Murase |
Subject: |
Re: @K transformation |
Date: |
Thu, 19 Aug 2021 19:59:12 +0900 |
2021年8月19日(木) 19:37 Léa Gris <lea.gris@noiraude.net>:
> Current implementation of @K is pretty-much useless for the dialog use-case:
>
> > #!/usr/bin/env bash
> >
> > declare -A assoc=(
> > [P]=piano
> > [TB]='foldable table'
> > ['CH AIR']=chair
> > )
> >
> > options=("${assoc[@]@K}")
I this particular case, you can instead write
declare -a "options=(${assoc[@]@K})"
though I agree that the behavior of zsh's ${(kv)assoc} (i.e.,
expanding to separate words) is more useful. It's too late to change
the behavior of @K so maybe the new behavior can be assigned to @k if
it is worth implementing in Bash.
--
Koichi
- feature request array expansion of keys values pairs and for k v loop, Léa Gris, 2021/08/18
- Re: feature request array expansion of keys values pairs and for k v loop, Koichi Murase, 2021/08/18
- @K transformation, Ilkka Virta, 2021/08/19
- Re: @K transformation, Koichi Murase, 2021/08/19
- Re: @K transformation, Léa Gris, 2021/08/19
- Re: @K transformation,
Koichi Murase <=
- Re: @K transformation, Chet Ramey, 2021/08/20
- Re: @K transformation, Léa Gris, 2021/08/20
- Re: @K transformation, Lawrence Velázquez, 2021/08/20
- Re: @K transformation, Greg Wooledge, 2021/08/20
- Re: @K transformation, Léa Gris, 2021/08/20
- use-cases promote thinking of limited application, L A Walsh, 2021/08/22
- Re: use-cases promote thinking of limited application, Koichi Murase, 2021/08/22
- Re: use-cases promote thinking of limited application, L A Walsh, 2021/08/23
- Re: use-cases promote thinking of limited application, Koichi Murase, 2021/08/23