lua-users home
lua-l archive

Re: Slicing ideas

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


On Mon, Apr 02, 2012 at 12:00:10PM +0200, steve donovan wrote:
> On Mon, Apr 2, 2012 at 11:47 AM, Rob Kendrick <rjek@rjek.com> wrote:
> > foo = t[1, 2, 3] -> __slice(t, 1, 2, 3)
> 
> Just to check the intended meaning; t[1,2,3] gives you {t[1],t[2],t[3]} ?
No. There is no intended meaning. One could write a __slice function
that did this, though.
> Pythonic slices use ranges, rather than explicit sequences, so the
> term 'slice' might be a bit confusing.
> 
> (And there's others who would think that t[i,j] is 2D array access)
Nothing stopping people making __slice do that, either.
B.

AltStyle によって変換されたページ (->オリジナル) /