General

Profile

tom-lord (Tom Lord)

  • Login: tom-lord
  • Email: lord.thom@gmail.com
  • Registered on: 02/07/2015
  • Last sign in: 09/10/2020

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 0 3 3

Activity

09/10/2020

10:24 AM Ruby Feature #16150: Add a way to request a frozen string from to_s
matz (Yukihiro Matsumoto) wrote in #note-68:
> I admit `Symbol#name` that returns a frozen string from a symbol. This can be a building block of the proposal.
> ...
For what it's worth, I agree with the above suggestion to try making a...
tom-lord (Tom Lord)

11/12/2017

04:09 PM Ruby Bug #14101: Unreliable handling of groups nested within absent/absence operator of regex
Here's a slightly more minimal reproduction example:
~~~ ruby
"abb".match /(?~(a)c)/
#=> ArgumentError: negative string size (or size too big)
~~~
My best guess is that the regexp engine is caught in an unexpected state, where t...
tom-lord (Tom Lord)
03:55 PM Ruby Bug #14101 (Closed): Unreliable handling of groups nested within absent/absence operator of regex
The new absent/absence regex operator, added to Onigmo and bundled into ruby since v2.4.1, supports nested groupings such as:
~~~ruby
"abb".match /(?~(a|b)b)/
=> #<MatchData "a" 1:"a">
~~~
However, under some scenarios (I haven...
tom-lord (Tom Lord)

09/01/2017

08:30 AM Ruby Feature #13581: Syntax sugar for method reference
Consider the following:
~~~ ruby
def get_method(sym, object = Object)
object.send(:method, sym)
end
~~~
This allows us to write code like:
~~~ ruby
[1, 4, 9].map &get_method(:sqrt, Math)
~~~
So as an idea, how abo...
tom-lord (Tom Lord)

02/24/2015

10:03 AM Ruby Bug #10891: /[[:punct:]]/ POSIX group broken (with string literals?)
On further investigation, this is a known issue in Onigmo (Ruby 2.x's regexp parser).
However, it was apparently "fixed" way back in 2006: https://github.com/k-takata/Onigmo/blob/d0b3173893b9499a4e53ae1da16ba76c06d85571/HISTORY#L584-5...
tom-lord (Tom Lord)

02/23/2015

03:53 PM Ruby Bug #10891: /[[:punct:]]/ POSIX group broken (with string literals?)
Nobuyoshi Nakada wrote:
> It occurs with UTF-8 encoding only.
Ahhhhh, of course - *that's* what the difference between `60.chr` and `"<"` is!
Like you said, the issue only affects UTF-8 encodings:
#<Encoding:UTF-8>, #<Encod...
tom-lord (Tom Lord)
12:29 PM Ruby Bug #10891 (Closed): /[[:punct:]]/ POSIX group broken (with string literals?)
The regular expression: `/[[:punct:]]/` should match the following characters:
! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~
However, it only works for these characters:
! " # % & ' ( ) * , - . / : ; ? ...
tom-lord (Tom Lord)

02/07/2015

11:43 PM Ruby Misc #10836 (Closed): Add Documentation to Regexp
Documented non-subexp option toggling
Regexp option toggling can be done in two forms:
/(?imx:subexpr)/ - this was already mentioned in docs
/before(?imx)after/ - there was no mention of this.
This section of the documentation ...
tom-lord (Tom Lord)

Also available in: Atom