[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
Re: [PATCH 5.005_63] Open-ended slices: (a..z)[23..]
> On Tue, 25 Jan 2000 15:24:19 +0900, scozens@pwj.co.jp wrote:
> >> print @a[1..-2]; # second through third-last
> >
> >I had something like this working before, but MJD pointed out
> >x..y where x>y already has a meaning - it's defined in perlop
> >to return an empty list.
>
> Considering these are slice-context sensitive magic for the range
> operator, that doesn't seem like a big deal to me, because a
> conventional range like (1..-2) would still be the empty list,
> and people are unlikely to be relying on something as useless as
> generating an empty list with an invalid range.
I didn't mention it on speculation. I mentioned it because I have
relied on it.
Simon sais the same thing, and I don't think it is as unlikely as
either of you seem to think.
Other times this has come up, I've noticed that there seem to be two
sorts of people involved in the debate. For some people, it is an
abnormal discontinuity that ($x..$y) yields the empty list when $y<$x.
For others, it seems perfectly normal.
The first group of people cannot imagine that anyone would ever
actually make use of such an abnormal discontinuity. The second group
finds it perfectly normal.
- References to:
-
Gurusamy Sarathy <gsar@ActiveState.com>
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]