https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112015-01-06T15:24:08ZRuby Issue Tracking SystemRuby master - Feature #10701: Class:Array 2 New methodshttps://bugs.ruby-lang.org/issues/10701?journal_id=508142015-01-06T15:24:08ZHanmac (Hans Mackowiak)hanmac@gmx.de
<ul></ul><p>i think this functions might be interesting, but i would try to write them to that they are available in Enumerable too</p> Ruby master - Feature #10701: Class:Array 2 New methodshttps://bugs.ruby-lang.org/issues/10701?journal_id=508272015-01-07T09:57:00Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/50827/diff?detail_id=36556">diff</a>)</li></ul><p>An exception should be raised if the input is not found?</p> Ruby master - Feature #10701: Class:Array 2 New methodshttps://bugs.ruby-lang.org/issues/10701?journal_id=508542015-01-08T07:21:43ZHanmac (Hans Mackowiak)hanmac@gmx.de
<ul></ul><p>i also would like if there are block variants of them like that</p>
<p>data = 0..10<br>
data.prev_value {|o| o == 5} #=> 4<br>
data.next_value {|o| o == 5} #=> 6</p>
<p>and i would use prev_value and next value instead of prev and next because it collide with Enumerator#next</p>
<p>i tryed to simulate such functions with slice_before and chunk, it did work but it was not very resource saving ..</p>