[racket] Exploratory programming?

From: richard.lawrence at berkeley.edu (richard.lawrence at berkeley.edu)
Date: Wed Dec 1 19:54:23 EST 2010

Hi Eli,

> BTW, if you tried just that, then note that you can also an identifier
> to jump directly to its definition:
>   (help lambda)
> This uses the *syntactic* information from the system, for example:
>   (define kons cons)
>   (help kons)
> won't work because `kons' is a new identifier, but OTOH it can work on
> syntaxes too, as the above `lambda', and it can also work with renamed
> identifiers:
>   (require (rename-in racket [cons kons]))
>   (help kons)
> and it can distinguish different bindings for the same names:
>   (require (only-in r5rs cons))
>   (help cons)

Ah, I see.  That's very helpful, thanks.

> But in case you're asking about the general description of where `f'
> is defined, that information is there, and DrRacket has several
> features that can be used -- for example, try the check syntax button,
> then hover around the definitions window.  My interactive hack has a
> simpler version that might be more python-like in what you get:
>   -> ,describe define
>   `define' is a bound identifier,
>     defined in "racket/private/kw.rkt" as `new-define'
>     required through "racket/init.rkt"

Again, very helpful.

> Yeah, as I mentioned above, `help' works at the syntactic level, so it
> can't provide help on values.
> ...
> For something similar to that, see Doug Williams's `describe' package:

Also very useful.  I will certainly have a look.

Thanks, Eli, for such a comprehensive explanation!  This really does clear
a lot of things up for me.


Posted on the users mailing list.