From: "Guy N. Hurst" Date: 2001-06-28T22:25:03+09:00 Subject: [ruby-talk:17006] Re: Introspection and 'where's the source'? jweirich@one.net wrote: > > >>>>> "Johann" == Johann Hibschman writes: > > Johann> Is there any way that you can find the source code of a > Johann> ruby method or class by introspecting it? In Python, I > Johann> believe, functions carry around information about the > Johann> source file and line position at which they were defined. > Johann> Is there a similar feature in Ruby? > > Actually, I would like to see this too. So would I, but I see another side to it: while using irb, it happens that there is no single file containing all the modifications I have typed, so it seems to me that some kind of buffer needs to be implemented to store all the code that ruby reads/parses before that code gets 'merged' into the running interpreter. This can be done in such a way to also allow for special built-in 'help' strings/documentation :-) And, since it would slow things down, it could perhaps be made switchable, like the 'debug' switch. Just call it the 'source' switch or something. Guy N. Hurst -- HurstLinks Web Development http://www.hurstlinks.com/ Norfolk, VA 23510 (757)623-9688 FAX 623-0433 PHP/MySQL - Ruby/Perl - HTML/Javascript