lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sun, Dec 19, 2010 at 11:02 AM, Geoff Leyland
<geoff_leyland@fastmail.fm> wrote:
> I'm guessing that Range(1,3) returns a "vanilla" table, and that R(1,3) returns some other object (a table, of course, but with a metatable).

Yes, exactly right.

>  When would you want to use a real table where you couldn't use the object returned by R?  I guess I'm asking why you need Range at all?

Apart from the fact that Range() has its uses (in APL it has its very
own Greek letter, iota) part of me likes array indexing.  But it is a
red herring in this context, because the List class is meant to mirror
the Python equivalent, so slicing is the primary need.

But then why not use an explicit method, and we don't have to guess?
I'm realizing that I have become too fond of short notational
shortcuts, and that this puts an extra cognitive burden on code
readers.

So you see I'm starting to talk myself out of this idea ;)

steve d.