From: Pete Elmore Date: 2005-01-14T08:10:21+09:00 Subject: Re: Seeing a definition -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Austin Ziegler wrote: | Not without some parsing of the text involved as it's being handled or | parsing the definition. The Ruby interpreter discards the text | definition of the method as soon as it's compiled. So does Forth (sorry to be referring to such an obscure language, but it's the only one I know of that has this useful feature). For example, I define 'fnext' as below, : fnext ( fib[n] fib[n+1] -- fib[n+1] fib[n+2] ) ~ swap ~ over ~ + ; Then I type 'see fnext' to see the definition: see fnext : fnext ~ swap over + ; The formatting and the comment are gone, so it looks like it's just converting from its own internal representation to something printable. How are definitions represented internally? What files should I look at to see this? Is a patch implementing such a feature likely to be accepted? Does this seem useful to anyone besides me? IMHO, this would be a great help for debugging ("puts doesn't work because this module is re-defining it!") as well as learning about the language and built-in features. Not to mention its effect on the size of quines. :p Pete -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) Comment: Using GnuPG with Debian - http://enigmail.mozdev.org iD8DBQFB5wB4v24lB609Ih8RArxBAJ4x7vdkzhUGsv1B7tnDNy32Q1PH8QCguQpm bkddUdqKqoWHuaAhXGmAyZM= =tLJA -----END PGP SIGNATURE-----