[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Multiple indexing (was: 'in' keyword today)
- From: steve donovan <steve.j.donovan@...>
- Date: Thu, 10 Apr 2014 09:38:13 +0200
On Thu, Apr 10, 2014 at 9:27 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> No, it means just what I said at the beginning. Term-by-term indexing.
> Vararg maps to variable return list. In effect a fallback metamethod
> if you have failed to provide one yourself.
Ah, I should read more carefully, and sorry to use the F-word so late
in the programming century. But the numerical guys will tend to read
it as multiple-indexing.
It's a little awkward with string keys : t["one","two"], but not awful.
Given f() that returns multiple values, is t[f()] intended to access
all those values? Because then we have the classic
propagation-of-multiple-values problem that gave you such grief with
string.gsub.
I think I'd need to see more elaborate code snippets to decide if this
is useful, or just cute...