General

Profile

nepalez (Andrew Kozin)

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 0 3 3

Activity

07/02/2015

01:05 PM Ruby Feature #11325 (Rejected): Block is passed to initializer implicitly even when I asked not to.
This works as expected:
~~~ruby
class Foo
attr_reader :block
def initialize(&block)
@block = block
end
end
foo = Foo.new { :foo }
foo.block.nil?
# => false
~~~
But then I'm trying to stop passing a block to ...
nepalez (Andrew Kozin)

06/23/2015

12:00 PM Ruby Bug #11294: Possible bug in Object.const_get
Thank you, Nobuyoshi, for your answering. Now I see the reason.
When I told that `Foo::Bar::Qux` is "closest" to `Foo::Baz` I meant that in a namespace:
~~~ruby
module Foo
module Baz
p Bar::Qux
end
end
# => Foo::Bar::...
nepalez (Andrew Kozin)

06/22/2015

09:23 PM Ruby Bug #11294 (Rejected): Possible bug in Object.const_get
~~~ruby
module Foo; end
module Foo::Baz; end
module Bar; end
module Bar::Qux; end
Object.const_get "Foo::Baz::Bar::Qux"
# => Bar::Qux
~~~
Why on earth it is found at all?
It seems pretty weird to me.
The real problem aris...
nepalez (Andrew Kozin)

06/19/2015

05:49 AM Ruby Bug #11283: Block assigned implicitly
Not, in my examples (from the initial post) it does not do that, but something different. Namely, it doesn't assigning a **new** proc (that would be OK)
Instead, the interpreter looks around in search **what else** it could use when I...
nepalez (Andrew Kozin)

06/18/2015

10:45 PM Ruby Bug #11283: Block assigned implicitly
I'd expect Ruby to do any of two options:
* Either provide a method with empty proc (`Proc.new`)
* Or call `SyntaxError` as a strict way to ask for the programmer's intention
I think any of these options could follow POLA better t...
nepalez (Andrew Kozin)
07:31 PM Ruby Bug #11283: Block assigned implicitly
This feature buzzes and wiggles aerials like a bug.
I cannot see why is it needed for your example. It is pretty explicit and has no hidden calls. Both the `yield` and `Proc.new` are used intentionally, while in my examples they weren...
nepalez (Andrew Kozin)
03:36 PM Ruby Bug #11283 (Closed): Block assigned implicitly
That is how it works:
module Test
def self.build(&block)
klass = Class.new(Object)
klass.__send__(:define_method, :foo)
klass.__send__(:define_method, :bar)
klass
end
end
...
nepalez (Andrew Kozin)

Also available in: Atom