[#73707] [Ruby trunk Misc#12004] Code of Conduct — hanmac@...
Issue #12004 has been updated by Hans Mackowiak.
3 messages
2016/02/05
[#73730] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/07
[#73746] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/09
[#73919] [Ruby trunk Feature#11262] Make more objects behave like "Functions" — Ruby-Lang@...
Issue #11262 has been updated by J旦rg W Mittag.
3 messages
2016/02/22
[#74019] [Ruby trunk Bug#12103][Rejected] ruby process hangs while executing regular expression. — duerst@...
Issue #12103 has been updated by Martin D端rst.
3 messages
2016/02/27
[ruby-core:73834] [Ruby trunk Bug#11991][Assigned] `Symbol#match` returns the match position, unlike `String#match` and `Regexp#match`
From:
naruse@...
Date:
2016-02-16 09:25:16 UTC
List:
ruby-core #73834
Issue #11991 has been updated by Yui NARUSE.
Status changed from Open to Assigned
Assignee set to Nobuyoshi Nakada
Considered a bug but for compatibility this shouldn't be backported.
2.4 will introduce incompatibility.
----------------------------------------
Bug #11991: `Symbol#match` returns the match position, unlike `String#match` and `Regexp#match`
https://bugs.ruby-lang.org/issues/11991#change-57010
* Author: Tsuyoshi Sawada
* Status: Assigned
* Priority: Normal
* Assignee: Nobuyoshi Nakada
* ruby -v:
* Backport: 2.0.0: WONTFIX, 2.1: WONTFIX, 2.2: WONTFIX, 2.3: WONTFIX
----------------------------------------
`String#match` and `Regexp#match` return a `MatchData` when match succeeds:
~~~RUBY
"".match(//) # => #<MatchData "">
//.match("") # => #<MatchData "">
//.match(:"") # => #<MatchData "">
~~~
But `Symbol#match` returns the match position (like `String#=~`):
~~~RUBY
:"".match(//) # => 0
~~~
Thus, `Symbol#match` behaves differently from `String#match` and `Regexp#match`. This is the documented behavior, but it may be a bug (together with the documentation).
On the other hand, if it is not a bug, what is the rationale?
--
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>