2008/9/8 Yukihiro Matsumoto <matz / ruby-lang.org>: > Hi, > > In message "Re: [ruby-core:18490] Re: [ANN] Ruby 1.9.1 feature freeze" > on Mon, 8 Sep 2008 18:05:05 +0900, Nobuyoshi Nakada <nobu / ruby-lang.org> writes: > > |At Sun, 7 Sep 2008 04:53:43 +0900, > |Yukihiro Matsumoto wrote in [ruby-core:18471]: > |> This is a proposal to add __file__ and __line__ methods to Method and > |> Proc objects. > > |I propose a new method, #location than those two new methods. > > I like the idea. How others think? Good! I'd like to suggest a name alternative though #defined_at IMHO #location is very general and #defined_at better expresses what's being returned (at least from what I gathered should be the semantics of this method). Usage would be def foo(&b) file, line = b.defined_at $stderr.printf "calling block which was defined at %s:%d\n", file, line b.call end Kind regards robert -- use.inject do |as, often| as.you_can - without end