Sorry for the original subject line being wrong--my attempt to post on
the right thread went very awry :)

Some comments in-line:

> This is a proposal to add __file__ and __line__ methods to Method and
> Proc objects.  Issues are:
>
>  * the method names.  I don't think proposed names that are
>    surrounded by underscores are appropriate.

Perhaps #definition_file/ #definition_line or
#declaration_file/#declaration_line?

>  * non-Ruby defined methods/procs.  the patch raises TypeError, but
>    is it really appropriate?  Should they return nil for such cases?

Nil is probably better, since it already returns nil in some cases.

>  * use-case.  the proposal comes with use-case sourceref.rb, but any
>    other use case?

For me I'll use it to lookup where methods are defined so that I can
<gulp> hate to admit it--re-parse the methods [using racc or what
not], see if they can be optimized, combine them with sub methods, add
pseudo named parameter wrappers, that type of thing.

On second thought I'm wondering if the following would be more useful:
Method#iseq
Proc#iseq

and then add the file/line methods to iseq itself:
RubyVM::InstructionSequence#declaration_file
RubyVM::InstructionSequence#declaration_line

So looking up a method's declaration line would be like
klass.instance_method(:name).iseq.declaration_file

Then that would give us access to the iseq as well as to the file/line
positions.  That would be even better for me [since I would then have
access to the iseq for proc's as well as method's--there seems to
currently be no way to disassemble procs, that I know of, so this
would also conveniently overcome this difficulty as well].
I'd be happy to submit a modified patch.
Thanks!
-=R