[plt-scheme] introspection
Thanks for the response.
On 10/23/07, Carl Eastlund <cce at ccs.neu.edu> wrote:
> Some things, like procedure arity, are stored at runtime and available
> by specific procedures, but many are not. The "calling protocol" of a
> function may (or may not) be stored as a contract, but those are not
> inspectable in any meaningful way at runtime; Help Desk is your best
> bet for documentation.
>
> If you want to get at the source of a function, first try the dropdown
> at the top-left of your emacs window, the one labeled (define ...).
> It opens up a list of defined names in your file, and jumps to the one
> you select. For functions outside your current file, try using the
> Check Syntax button. It lets you right-click on identifiers and
> select "Jump to Definition", opening other files if needed. It's not
> quite a runtime feature, but it does help.
Okay, but if I am not working in Dr. Scheme, I guess the question is
how is Dr. Scheme accessing this information. Does it have a whole
parsing system set up to find the referenced functions, following
require statements etc.?
The reason I am wondering is that the interpreter is already doing
this work, so it does not seem like such a good idea to be reinventing
the wheel, as I will probably do it badly, unless of course that is
what Dr. Scheme has been doing, so there is really no choice.
>
> These are just comments. We do not currently associate them with
> identifiers in any programmatic way. The new documentation tool
> Scribble automatically associates documentation with functions; it
> doesn't look quite like this, but once it's in widespread use it'll be
> a step closer to what you're looking for.
So scribble is a sort of schemedoc in the javadoc sense of the word?
Interesting.
> I hope this helps!
Thanks it does, unfortunately not with much in the way of good news.
Btw. I was just curious if anyone knows why docstrings were never a
part of scheme, as they are so very useful?
Rohan