From: Loren Segal Date: 2010-12-07T03:04:06+09:00 Subject: [ruby-core:33600] Re: [Ruby 1.9-Feature#4085][Open] Refinements and nested methods Hi, On 12/6/2010 7:13 AM, Charles Oliver Nutter wrote: > I suggest we drop the "pseudo" from "pseduolexical" in the Refinements > specification, and see where that takes us. Anything "pseudo" lexical > is dynamic scoping, which fails multiple performance, concurrency, and > obviousness tests for me. I would have to agree with Yehuda and Charlie on this. Refinements make far more sense and are far easier to deal with when they are purely lexical, both on a performance and a conceptual level. Although I'm not nearly as qualified as Charlie to comment on the technical / performance issues, it seems as though the entire point of refinements is to allow *scoped* "monkey patching", and this can only work if there is absolutely no scope leaking. Supporting inheritance gives way too much wiggle room to unintentionally leak your scope that it effectively limits how the feature can be used in real world situations. I'd say that focusing on a pure lexical scoping for now would make it far easier to get to a point where the implementation is "correct" and can be commented on by more people in the community. Then, *if* the performance / technical issues can be resolved, Yehuda's suggestion of supporting opt-in inheritance-scoping through a hash argument would still be on the table-- although a discussion should be had on whether inheritance support really worth implementing after people are able to test if a lexical-only implementation is sufficient. - Loren