My understanding is that Range#begin and Range#end's features are just subsets of Range#first and Range#last, respectively. And since they are slightly confusing with the keywords begin and end, I propose to either:
Let Range#begin and Range#end be aliases of Range#first and Range#last, respectively, or
Let Range#begin and Range#end be obsolete after a migration path of waning against their use and recommending the use of Range#first and Range#last instead.
I have no particular pro or con opinion towards this proposal per se; however within
the two suggestions made, I think having these as aliases would be better than
obsolete them. People could then decide to use either variant if they would like
to whereas with the second suggestion they may have to forego the use of
begin/end as method names. Note that I understand the intent behind the
deprecation thought, but I think it would still be better for ruby folks to decide
on their own what they would prefer. Not everyone is necessarily confused,
although I understand that it may be confusing for some.
(But again, I do not have any particular strong pro or con opinion as such. I actually
think that I may not have used #first or #last on Range so far in my own code
altogether; neither #begin or #end).
I understand that "your problem" is confusion between a keyword "begin" and "Range#begin". First, I have never been confused by the fact. Then,
Let Range#begin and Range#end be aliases of Range#first and Range#last, respectively, or
This does not solve your problem at all.
Let Range#begin and Range#end be obsolete after a migration path of waning against their use and recommending the use of Range#first and Range#last instead.
Your problem looks too weak to me to deprecate an existing feature.
Off-topic: Could you please make the title informative? "Range#begin and Range#end" doesn't tell me what is a problem or proposal. I never say this to a newbie, but you have already opened hundreds of tickets.
@sawa Please tell us how can we get both the end-value of the exclude-end range and the last element of the sequence generated by the range if your proposal were accepted?
I understand that "your problem" is confusion between a keyword "begin" and "Range#begin". First, I have never been confused by the fact. Then,
Actually, that was a minor point (I, myself, have not been confused that much. Although I do not like the way it looks to have begin and end used as methods).
By proposing:
Let Range#begin and Range#end be aliases of Range#first and Range#last, respectively, or
My real intent was that, I don't see any reason for Range#begin and Range#end to be separate methods from Range#first and Range#last. If people are indeed going to use Range#begin and Range#end, then letting them take an optional argument (just like Range#first and Range#last) would make it simple for everyone.