General

Profile

esad (Esad Hajdarevic)

  • Login: esad
  • Registered on: 04/22/2024
  • Last sign in: 12/25/2025

Issues

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

Activity

12/25/2025

10:46 PM Ruby Bug #21805 (Open): Wrong "key not found" in NoMatchingPatternKeyError when destructuring Data
Consider
```
Foo = Data.define(:x)
Foo.new(1) => {x:, z:}
```
It raises `#<data Foo x=1>: key not found: :x (NoMatchingPatternKeyError)`
Clearly the message is misleading, as it is key :z that is missing.
esad (Esad Hajdarevic)

09/15/2024

05:42 PM Ruby Feature #20742 (Open): Trying to assign to a variable in statement modifier should emit a warning
There is an example in Control Expressions documentation:
```
p a if a = 0.zero? # raises NameError “undefined local variable or method ‘a’”.
```
However, if we had already defined `a` there would be no exception raised. If one u...
esad (Esad Hajdarevic)

09/04/2024

09:04 PM Ruby Feature #16378: Support leading arguments together with ...
Is there a reason why this doesn't work with keyword arguments too?
For example:
```
def foo(bar:, ...)
other(...)
end
```
results in syntax error
esad (Esad Hajdarevic)

09/03/2024

12:12 PM Ruby Feature #20712: module should return newly defined module
Ok I was too quick on this one. module keyword returns last expression in the block, so just ending module declaration with self works:
```
using(module Foo
refine ...
self
end)
```
so this request can be closed
esad (Esad Hajdarevic)
12:04 PM Ruby Feature #20712 (Closed): module should return newly defined module
Currently module keyword returns nil after defining a new module:
```
x = module Foo
end
# x is nil
```
It would be more consistent with `Module.new` if module keyword returned the newly defined module. Then we could do:
```...
esad (Esad Hajdarevic)

07/10/2024

10:16 AM Ruby Bug #20623 (Closed): Unexpected behavior of blocks in Enumerator::Lazy#zip
I've stumbled upon unexpected behaviour of lazy enumerators. My example:
```
[1].cycle.lazy.zip([2].cycle.lazy).map do |x|
puts x.inspect
end.take(5).force
puts "---"
[1].cycle.lazy.zip([2].cycle.lazy).take(5).force.map do |x|
...
esad (Esad Hajdarevic)

04/26/2024

12:27 PM Ruby Bug #20459 (Closed): Ractor.select() deadlock?
When I run this script
```
echo = Ractor.new { Ractor.receive }
Thread.new { puts Ractor.select(echo).inspect }
sleep 0.1
echo.send "test"
```
the script never terminates. If I change thread body to
```
Thread.new { puts...
esad (Esad Hajdarevic)
10:07 AM Ruby Feature #20444: Kernel#loop: returning the "result" value of StopIteration doesn't work when raised directly
nobu (Nobuyoshi Nakada) wrote in #note-9:
> That example does not need `Ractor`.
Yes, you are right, it actually doesn't need Thread either, and is simply about calling a block in a loop and how to break the loop from the called bloc...
esad (Esad Hajdarevic)

04/24/2024

11:00 AM Ruby Feature #20444: Kernel#loop: returning the "result" value of StopIteration doesn't work when raised directly
ufuk (Ufuk Kayserilioglu) wrote in #note-7:
> @esad If you just want to return a result from the `loop`, you can use `break <value>` to do that:
> ...
Calling break from a block passed to a ractor will raise an exception. I think some sa...
esad (Esad Hajdarevic)
09:07 AM Ruby Feature #20444: Kernel#loop: returning the "result" value of StopIteration doesn't work when raised directly
nobu (Nobuyoshi Nakada) wrote in #note-3:
> I'm curious what your use case is.
> ...
I think my use case is a bit of an edge case - I am passing a block into a Ractor where it runs in a loop. This way I can control exit from the loop, ...
esad (Esad Hajdarevic)

Also available in: Atom