[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
use-cases promote thinking of limited application
From: |
L A Walsh |
Subject: |
use-cases promote thinking of limited application |
Date: |
Sun, 22 Aug 2021 18:52:29 -0700 |
User-agent: |
Thunderbird 2.0.0.24 (Windows/20100228) |
On 2021/08/19 02:15, Ilkka Virta wrote:
$ declare -A A=([foo bar]="123 456" [adsf]="456 789")
$ printf "<%s>\n" "${A[@]@K}"
<adsf "456 789" "foo bar" "123 456" >
Interesting. I wonder, what's the intended use-case for this?
---
Does it matter?: Organizing data.
In this case, the data may be organized by pairs.
If you have a list of data:
(name sally age 38 name joe age 39 name jill age 14 name jane age 13),
one can infer several possible ways to interpret the data. Some ways
seem very likely, while others are less clear.
One could assert a pair or duple relation, but one could infer
several other N-tuples with variable sizes of 'N', most likely even.
It's not hard to see quadruples, but it could be that N=8, 16, or
a more complex variation.
To iterate (over the data), one could place all the meaning
in how the 'for' statement is listed. One could also supply meaning in
how the data is listed.
It's not likely one would have variably-sized tuples but one could. Though,
ideally, one would have names embedded in the "structure" to help in
interpretation, like:
("type" item) where item may be one "thing", or a [list of things], or
an {association of things} or (another data structure). Even "type" could
be multiple types of things.
If you wanted pairs, you could specify that when you enumerate with
varying degrees of flexibility, like:
for (k, v) in LIST .. pull 2 members from list at a time
or
for ((a b) (c d)) in LIST... etc. One could imagine extending such
syntax to provide a variety of data relations -
(PID (path filename) (user group) ...) etc. If you want to ask for
use-cases, don't expect to come up with a complete list any time soon.
Anyway, in my experience, asking 'why' or for 'use-cases' seems more often
a way to rule out or determine relative importance, but is almost always
an inaccurate way to do so. Just because someone wants it for purpose
'X', doesn't mean it won't be valuable in 100 other ways.
Think of lightning: it may seem of limited use, but if thought of as
a form of electricity, it might be realized to be more useful than anyone
previously imagined.
- Re: feature request array expansion of keys values pairs and for k v loop, (continued)
- 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, 2021/08/19
- 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 <=
- 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