General

Profile

cichol (Renxiang Cai)

  • Login: cichol
  • Email: ruby@merely.ca
  • Registered on: 12/16/2015
  • Last sign in: 02/03/2025

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 0 2 2

Activity

06/14/2019

01:15 PM Ruby Feature #15799: pipeline operator
Hi,
I want to introduce a way to pipeline method calls in Ruby.
I imagined that the Ruby-styled pipelined calls should be like:
```ruby
1.pipe do
call 1 + _ # => after this line, _ becomes 2
call _ * 3 # => after this line,...
cichol (Renxiang Cai)

06/01/2017

01:14 PM Ruby Bug #13621 (Closed): String#split returns an array longer than given limit, when passing a regexp with groups
The String#split documentation(http://ruby-doc.org/core-2.4.1/String.html#method-i-split) described:
> If pattern is a Regexp, str is divided where the pattern matches. Whenever the pattern matches a zero-length string, str is split i...
cichol (Renxiang Cai)

12/16/2015

03:29 PM Ruby Bug #11826: After prepending a module, rewrite Hash#[] takes no effect for calls like Hash.new[:a]
~~~
module M
end
class Hash
prepend M
end
class Hash
def [](k)
p 3
end
def map
p 4
end
end
h = {a: 1}
h[:a] #=> return 1 and without print 3
h.send(:[], :a) #=> print 3
h.map # => print 4
~~~
...
cichol (Renxiang Cai)
02:18 PM Ruby Bug #11826 (Closed): After prepending a module, rewrite Hash#[] takes no effect for calls like Hash.new[:a]
~~~
module M
def self.prepended(clz)
clz.class_eval do
def [](k)
p 1
end
end
end
end
module N
def self.included(clz)
clz.class_eval do
def []=(k, v)
p 2
end
...
cichol (Renxiang Cai)

Also available in: Atom