MenTaLguY wrote:
> In Ruby's core library, yes.  It's possible to implement new methods 
> with similar behavior (which is occasionally useful), but that isn't the 
> norm.
> 
> -mental

How can i do that?

I was thinking.. If I want to "bind" self to yield context, with 0 
params, i can use a solution like this one:

>def create( name, &block )
>  person = Person.new( name )
>  person.instance_eval( &block )
>  p person
>end

person.instance_eval( &block ) # some kind of yield(self) inside 
instance_eval

but what if i want yield with params, and still have self like 
instance_eval?

Example:
class A
  def some_method(&block)
    yield(:arg1, :arg2)
  end
end
a = A.new
# wanted: self "equals" to a
a.some_method { |arg1, arg2| p self }

Vasco A. Silva

-- 
Posted via http://www.ruby-forum.com/.