General

Profile

trans (Thomas Sawyer)

  • Login: trans
  • Registered on: 09/07/2008
  • Last sign in: 11/08/2026

Issues

open closed Total
Assigned issues 0 1 1
Reported issues 22 91 113

Activity

11/08/2026

09:13 PM Ruby Feature #22513: Allow Kernel#extend and Module#prepend to take a block
Pull request with the patch and tests: https://github.com/ruby/ruby/pull/19774
It has one commit for `Kernel#extend` and one for `Module#prepend`.
trans (Thomas Sawyer)
04:26 PM Ruby Feature #22513 (Open): Allow Kernel#extend and Module#prepend to take a block
# Abstract
Let `Kernel#extend` and `Module#prepend` take a block. The block is
evaluated in a new anonymous module, as `Module.new` evaluates its block,
and the receiver is extended with, or prepended with, that module.
```ruby
...
trans (Thomas Sawyer)
09:12 PM Ruby Feature #22514: Add an optional depth argument to Module#descendants
Pull request with the patch, tests and specs: https://github.com/ruby/ruby/pull/19777 trans (Thomas Sawyer)
08:15 PM Ruby Feature #22514 (Open): Add an optional depth argument to Module#descendants
# Abstract
Let `Module#descendants` take an optional depth, and return only the
descendants that many steps from the receiver or fewer.
```ruby
module A; end
module B; include A; end
class C; include B; end
class D < C; end
...
trans (Thomas Sawyer)

10/11/2016

06:36 PM Ruby Feature #9704: Refinements as files instead of modules
Shugo Maeda wrote:
> Monkey-patching style has another problem that super cannot be supported in monkey patching.
> ...
That last line just clicked with me, and I see old problem. This only works at one level. How would one write a ref...
trans (Thomas Sawyer)
06:15 PM Ruby Feature #12775: Random subset of array
This definition of `#sample` seems a bit limited. I know it aligns with the statical definition but it is very easy do another way: `shuffle.take(n)`. Also, the interface is a little odd because it can return an element or an Array. Mayb... trans (Thomas Sawyer)

08/03/2016

04:54 AM Ruby Feature #9704: Refinements as files instead of modules
Has any more thought been given to this? I had a recent request to have Ruby Facets to work as refinements, but I hesitate b/c it literally means creating a second copy of every extension method.
trans (Thomas Sawyer)
04:07 AM Ruby Feature #12374: SingletonClass
So...
~~~
Object..singleton_class.instance_of?(SingletonClass) #=> true
~~~
trans (Thomas Sawyer)
03:55 AM Ruby Feature #12637: Unified and consistent method naming for safe and dangerous methods
It would more interesting if there were a way to declare an object mutable or not, then when immutable destructive methods would not be available. trans (Thomas Sawyer)

05/09/2016

03:23 PM Ruby Feature #12360 (Rejected): More useful return values from bang methods
It would be nice if bang methods returned results that where of some additional use. Presently most just return the effected receiver.
For example, currently Array#reject! works as follows:
a = [1,2,3,4]
a.reject!{ |x| x %...
trans (Thomas Sawyer)

Also available in: Atom