Yehuda Katz wrote:
> The idea is to make selectors like optional versions of Python 
> imports. Example:
>
> # merb/core_ext/string.rb
>
> namespace Merb
>   class String
>     def to_s
>       super + "Awesome"
>     end
>   end
> end
>
> # merb/application.rb
>
> use Merb::String
>
> class Foo
>   def bar(str)
>     str.to_s
>   end
> end
Hi,

I have read the full thread now, and have some concrete questions about 
the proposal. I'm not opposed to the proposal, but these are things I'd 
really like to understand before agreeing to it.
If any of this has been answered, or if I misunderstood something, I 
apologize in advance:

- How would this interact with send?
- How would it interact with other introspection facilities? Kernel#method ?
     Basically, what is the runtime behavior of all metaprogramming and 
introspection features here...
- Do I understand correctly that this is supposed to be a lexical 
effect, and not a dynamic one?
   ... in that case I have no idea how it's supposed to work at parse 
time. Basically, if you use modules as possible namespaces, there is no 
way the parser can know which methods are supposed to be possibly 
selector-based. And even so, you don't actually know in the above 
example that "str" is a String, so how do you know that Merb::String 
should be applied to that variable at parse time? The thread has said 
it's a lexical effect, but all the examples I see have confused lexical 
and dynamic effects, and parse time with runtime.

Once again, the third point could relate to me misunderstanding things 
here. But if not, I'm not sure how this is supposed to work.

Cheers

-- 
 Ola Bini (http://olabini.com) 
 Ioke creator (http://ioke.org)
 JRuby Core Developer (http://jruby.org)
 Developer, ThoughtWorks Studios (http://studios.thoughtworks.com)
 Practical JRuby on Rails (http://apress.com/book/view/9781590598818)

 "Yields falsehood when quined" yields falsehood when quined.