On Sat, Sep 26, 2020 at 12:50 AM Stefano Borini <stefano.borini@gmail.com> wrote:
Other use cases are certainly allowed, but to me, something like

a[1, 2, unit="meters"]
a[1, 2, unit="meters"] = 3
makes me feel uncomfortable, although I might learn to accept it.
Then why isn't the unit close to 3, as in

a[1,2] = 3 * meters

I think this is a very natural looking use case, and is not as well addressed by putting the multiplier outside the indexing.  Imagine you have two arrays that store lengths, but not necessarily in the same units.  Whatever the underlying representation, we would be able to ask, e.g.:

 a[1, 2, unit="furlongs"] == b[1, 2, unit="furlongs"]

Sure, `a` might store its data as AUs and `b` might store its data as Plank lengths.  But the comparison like that would still work.  More importantly, a user wouldn't have to KNOW the underlying representation if she knew there was a "unit" term.

Even though there obviously *is* some computation in converting the units, it still feels like it's within the concept of "lookup" into an array (or other data structure).
 
del a[1, 2, unit="meters"] # and this one?

I presume in this case that the 'unit' parameter would just be ignored, but the operation would still succeed.  Obviously, that's up to the class, but that feels like a natural use case.  I'm deleting the thing at index (1, 2), but for deletion, the idea of conversion from "native units" to the specified units is merely irrelevant (but doesn't make the intent unclear either).

--
The dead increasingly dominate and strangle both the living and the
not-yet born.  Vampiric capital and undead corporate persons abuse
the lives and control the thoughts of homo faber. Ideas, once born,
become abortifacients against new conceptions.