[#78949] [Ruby trunk Feature#13095] [PATCH] io.c (rb_f_syscall): remove deprecation notice — kosaki.motohiro@...
Issue #13095 has been updated by Motohiro KOSAKI.
3 messages
2017/01/03
[#78997] [Ruby trunk Bug#13110] Byte-based operations for String — shugo@...
SXNzdWUgIzEzMTEwIGhhcyBiZWVuIHVwZGF0ZWQgYnkgU2h1Z28gTWFlZGEuCgoKTGV0IG1lIHNo
3 messages
2017/01/06
[#79228] Re: [ruby-cvs:64576] naruse:r57410 (trunk): Prevent GC by volatile [Bug #13150] — Eric Wong <normalperson@...>
naruse@ruby-lang.org wrote:
5 messages
2017/01/23
[#79511] Re: [ruby-cvs:64576] naruse:r57410 (trunk): Prevent GC by volatile [Bug #13150]
— Eric Wong <normalperson@...>
2017/02/13
Eric Wong <normalperson@yhbt.net> wrote:
[#79518] Re: [ruby-cvs:64576] naruse:r57410 (trunk): Prevent GC by volatile [Bug #13150]
— Nobuyoshi Nakada <nobu@...>
2017/02/13
On 2017/02/13 10:04, Eric Wong wrote:
[#79298] [Ruby trunk Bug#13085][Assigned] io.c io_fwrite creates garbage — nobu@...
Issue #13085 has been updated by Nobuyoshi Nakada.
3 messages
2017/01/29
[#79337] Re: [ruby-changes:45397] normal:r57469 (trunk): io.c: recycle garbage on write — SASADA Koichi <ko1@...>
Eric:
4 messages
2017/01/31
[#79352] Re: [ruby-changes:45397] normal:r57469 (trunk): io.c: recycle garbage on write
— Eric Wong <normalperson@...>
2017/01/31
SASADA Koichi <ko1@atdot.net> wrote:
[ruby-core:79301] [Ruby trunk Feature#9116] String#rsplit missing
From:
sto.mar@...
Date:
2017-01-29 18:26:32 UTC
List:
ruby-core #79301
Issue #9116 has been updated by Marcus Stollsteimer.
I'd like to revive the discussion about String#rsplit.
Here one use case I stumbled upon recently: splitting the digest off the end of a cookie (taken from Rack::Session::Cookie, see https://github.com/rack/rack/blob/master/lib/rack/session/cookie.rb#L139):
~~~
session_data = "session--data--digest"
digest, session_data = session_data.reverse.split("--", 2)
digest.reverse! if digest
session_data.reverse! if session_data
session_data # => "session--data"
digest # => "digest"
~~~
Note that each substring needs to be reversed back (for higher limits this would probably be done using #map), which seems inefficient and unhandy.
With rsplit this would become:
~~~
session_data = "session--data--digest"
session_data, digest = session_data.rsplit("--", 2)
~~~
----------------------------------------
Feature #9116: String#rsplit missing
https://bugs.ruby-lang.org/issues/9116#change-62714
* Author: Ramkumar Ramachandra
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
There's nothing corresponding to Python's rsplit(). A quick glance at rb_str_split_m() tells me that it should be pretty trivial to implement. Is there any specific reason it hasn't already been done?
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>