General

Profile

cvss (Kirill Vechera)

  • Login: cvss
  • Email: cv-c@jetware.io
  • Registered on: 05/21/2015
  • Last sign in: 08/09/2024

Issues

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

Activity

01/05/2022

02:51 PM Ruby Feature #18460 (Rejected): implicit self for .() syntax without rvalue
We have a nice `.()` shorthand for calling Proc
```ruby
m = 1.method(:+)
m.(2) # 3
```
But while we can use this shorthand in a Proc's context with the explicit self, we cannot use it with the implicit self:
```ruby
m.instance...
cvss (Kirill Vechera)

01/01/2022

12:30 PM Ruby Feature #12901: Anonymous functions without scope lookup overhead
One more reason for having an isolated kind of Proc is using it with an implicit block argument - for `define_method` or for some other metaprogramming. For example, `yield` in this code is incorrect due to the scope capturing problem:
...
cvss (Kirill Vechera)

12/06/2021

05:38 PM Ruby Bug #18390: Enumerator::Lazy#find returns invalid value
I just found that playground runs Opal, not MRI. Sorry for incorrect addressee, please close the issue. cvss (Kirill Vechera)
05:35 PM Ruby Bug #18390: Enumerator::Lazy#find returns invalid value
I'm not sure about build parameters, I found this bug at the ruby playground https://try.ruby-lang.org/ I'm attaching a screenshot. cvss (Kirill Vechera)
12:57 PM Ruby Bug #18390 (Third Party's Issue): Enumerator::Lazy#find returns invalid value
There is a regression bug in `#find`
```ruby
# RUBY_VERSION 3.0.2
[1, 2, 3, 4].lazy.find(&:even?) # => nil (ERROR!), expected 2
[1, 2, 3, 4].find(&:even?).find(&:even?) # => 2
# RUBY_VERSION 2.4.1
[1, 2, 3, 4].lazy.find(&:even?) # ...
cvss (Kirill Vechera)

12/04/2021

08:48 PM Ruby Feature #17881: Add a Module#const_added callback
Alternative solution can be implemented with two hooks for "opening" and "closing" class/module definition i.e. `Module::on_open`. One can get the existing list of constants, methods, class variables etc on the opening, and calculate dif... cvss (Kirill Vechera)

12/03/2021

03:40 PM Ruby Feature #18181: Introduce Enumerable#min_with_value, max_with_value, and minmax_with_value
There's also a frequent similar problem with `#find` when you need to find the first matched value instead of entry. But since it involves two semantically different code parts, it a bit more complex and cannot be implemented nicely with... cvss (Kirill Vechera)
02:44 PM Ruby Feature #18384: Pattern Match Object
> it leads to a proverbial rabbit hole
Probably, instead of a separate Patter Match class it would be enough to make a cosy shorthand creating a Proc that encloses a pattern matching code. That way, we avoid right now the need of the in...
cvss (Kirill Vechera)

12/02/2021

02:00 PM Ruby Feature #12125: Proposal: Shorthand operator for Object#method
One more use case - method composition, for example from #18369:
``` ruby
collection.detect(&:first_name>>"Dorian".:==)
```
cvss (Kirill Vechera)
01:52 PM Ruby Feature #18369: users.detect(:name, "Dorian") as shorthand for users.detect { |user| user.name == "Dorian" }
It's a good occasion to use the composition of Proc/Method objects:
``` ruby
collection.detect(&:first_name.to_proc>>"Dorian".method(:==))
```
If we had a shorthand operator for Object#method (#12125), it would look nicer:
``` ruby
co...
cvss (Kirill Vechera)

Also available in: Atom