On May 10, 2007, at 5:37 PM, Vasco Andrade e silva wrote:
> # 1)
> # output A
> A.class_eval { puts self }

One of the purposes of of #class_eval is to explicitly change
the binding of self within the block.  By calling #class_eval
you are asking that self be bound to A (for your example) while
the block is executing.  This is a behavior of class_eval and
not of blocks in general, which is why in:

[1].each { puts self }

self isn't bound to the array.

Gary Wright