< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事
N :次の記事(自分と同じ返事先を持つ)
|<:スレッドの先頭
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
On 10/16/07, David Flanagan <david / davidflanagan.com> wrote:
> Rick DeNatale wrote:
> >> If that is too radical a change, I suggest that Range.first be extended
> >> to accept an integer argument. And in that case, it should delegate to
> >> Enumerable.first. That is, even if (1..0).first continues to return 1,
> >> (1..0).first(1) should correctly return [].
> >
> > +1/2 on this one, I guess. Note that this won't work for all ranges,
> > for example:
> >
> > (1.5..10.7).first(2)
> >
> > Since float ranges aren't enumerable.
> >
>
> But it will work in the sense that it will be consistent with the each
> method. Now that first is a method of Enumerable, anyone calling it on
> an Enumerable object like a Range is going to expect it to be based on
> each. If each raises an exception (as it does for float ranges) then
> first will raise an exception.
Correct, it was more of an observation than an objection.
--
Rick DeNatale
My blog on Ruby
http://talklikeaduck.denhaven2.com/