General

Profile

UlyssesZhan (Ulysses Zhan)

  • Login: UlyssesZhan
  • Email: ulysseszhan@pm.me
  • Registered on: 08/16/2019
  • Last sign in: 10/26/2026

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 1 7 8

Activity

10/26/2026

06:39 PM Ruby Feature #22474: Kernel#using (or BasicObject#using)
alanwu (Alan Wu) wrote in #note-2:
> Seems to be already addressed by #22097.
I see. My quick issue search did not dig it up. I would say `using R; something` is much easier than `-> { something }.refined(R).()`, and we can have both...
UlyssesZhan (Ulysses Zhan)
05:26 PM Ruby Feature #22474 (Feedback): Kernel#using (or BasicObject#using)
Currently there is `Module#using`. The scope where `using` is effective is the lexical scope of the module eval block (blocks for `module` keyword, `Module::new`, `module_eval`, and `module_exec`). However, since any block is a lexical s... UlyssesZhan (Ulysses Zhan)
01:48 AM Ruby Feature #22473 (Open): Object#preextend, Module#preextend_object, and Module#preextended
Basically `preextend` is equivalent to `singleton_class.prepend`. Since we already have `extend` (basically equivalent to `singleton_class.include`), why not have `preextend`?
Related: #6452 #8041
UlyssesZhan (Ulysses Zhan)

10/25/2026

02:16 AM Ruby Feature #17016: Enumerable#accumulate
Personally I have stumbled upon use cases of this method for at least three times. I finally found this feature request. I forgot what I wanted to do the previous times, but the last time I wanted this feature is when I wanted to generat... UlyssesZhan (Ulysses Zhan)

07/19/2023

06:43 AM Ruby Feature #19775 (Closed): Use the callback `main::const_added`
In #17881, it was accepted that `Module#const_added` is called when there is a new constant added to the namespace of the module.
Since `main` can also serve as a namespace, it should also be able to use this callback.
```ruby
def c...
UlyssesZhan (Ulysses Zhan)

02/12/2021

09:27 AM Ruby Bug #17623 (Closed): irb starts with some local variables already defined
``` ruby
irb(main):001:0> a = 1
=> 1
irb(main):002:0> def f = a
=> :f
irb(main):003:0> f
=> "D:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/irb-1.3.0/exe/irb"
```
I have not idea what it means.
The codes just work fine outside irb.
May...
UlyssesZhan (Ulysses Zhan)

04/21/2020

10:37 AM Ruby Bug #16797: Array#flatten not checking `respond_to? :to_ary`
nobu (Nobuyoshi Nakada) wrote in #note-1:
> Read the error message.
> ...
Read what I wrote:
> It should check whether an object responds to to_ary before trying to convert it into an array.
I know it used `to_ary` method and got a...
UlyssesZhan (Ulysses Zhan)

04/17/2020

10:04 AM Ruby Bug #16797 (Rejected): Array#flatten not checking `respond_to? :to_ary`
```ruby
def (a = Object.new).method_missing(...)
Object.new
end
[a].flatten # TypeError
```
It should check whether an object responds to `to_ary` before trying to convert it into an array.
UlyssesZhan (Ulysses Zhan)
08:23 AM Ruby Feature #16796 (Rejected): Assigning local variables when using `case when regexp`
I want to use
```ruby
case "str"
when /s(?<mid>.)r/
p mid
end
```
instead of
```ruby
case
when /s(?<mid>.)r/ =~ "str"
p mid
end
```
I also do not like using `$1`.
This feature is extremely useful when there are a lot...
UlyssesZhan (Ulysses Zhan)

02/09/2020

07:59 AM Ruby Bug #16617 (Closed): I can have instance methods bound to objects which are not their owner
Usually, an UnboundMethod can only be bound to objects of its owner. However, sometimes the limitations can be circumvented. See the following example:
```ruby
class A
def foo
self.class
end
end
class B
end
module R
Bar = ...
UlyssesZhan (Ulysses Zhan)

Also available in: Atom