[#82311] [Ruby trunk Bug#13794] Infinite loop of sched_yield — charlie@...
Issue #13794 has been reported by catphish (Charlie Smurthwaite).
4 messages
2017/08/09
[#82518] [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — mame@...
Issue #13618 has been updated by mame (Yusuke Endoh).
5 messages
2017/08/30
[#82552] Re: [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid
— Eric Wong <normalperson@...>
2017/08/31
[email protected] wrote:
[#82756] Re: [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid
— Eric Wrong <normalperson@...>
2017/09/12
Eric Wrong <[email protected]> wrote:
[ruby-core:82367] [Ruby trunk Feature#13780] String#each_grapheme
From:
nobu@...
Date:
2017-08-13 00:15:41 UTC
List:
ruby-core #82367
Issue #13780 has been updated by nobu (Nobuyoshi Nakada).
naruse (Yui NARUSE) wrote:
> ```diff
> + if (!unicode_p) {
> + return rb_str_enumerate_codepoints(str, wantarray);
> + }
Why codepoints?
----------------------------------------
Feature #13780: String#each_grapheme
https://bugs.ruby-lang.org/issues/13780#change-66164
* Author: rbjl (Jan Lelis)
* Status: Assigned
* Priority: Normal
* Assignee: naruse (Yui NARUSE)
* Target version: 2.5
----------------------------------------
Ruby's regex engine has support for graphemes via `\X`:
https://github.com/k-takata/Onigmo/blob/791140951eefcf17db4e762e789eb046ea8a114c/doc/RE#L117-L124
This is really useful when working with Unicode strings. However, code like `string.scan(/\X/)` is not so readable enough, which might lead people to use String#each_char, when they really should split by graphemes.
What I propose is two new methods:
- String#each_grapheme which returns an Enumerator of graphemes (in the same way like `\X`)
and
- String#graphemes which returns an Array of graphemes (in the same way like `\X`)
What do you think?
Resources
- Unicode速 Standard Annex #29: Unicode Text Segmentation: http://unicode.org/reports/tr29/
- Related issue: https://bugs.ruby-lang.org/issues/12831
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>