[racket] Exploratory programming?

From: richard.lawrence at berkeley.edu (richard.lawrence at berkeley.edu)
Date: Wed Dec 1 14:37:08 EST 2010

[Apologies if this gets mis-threaded; I'm switching between Gmane and the
mailing list address.]

> On Dec 1, 2010, at 1:20 AM, Eli Barzilay wrote:
>
>>>
>>> Examples: comparing Python's help function to Racket's as a tool for
>>> introspecting objects at the REPL
>>> [...]
>>>> (define (f x y)
>>>    (+ x y))
>>>> (help f)
>>> Not found in any library's documentation: f
>>
>> This is because you didn't document it.

Yes, right.  This was perhaps not the best illustration.  I don't think it
would be terribly useful to read documentation (per se) about functions
defined at the REPL.  I meant to illustrate that calling help on a
procedure object in Python gives you a certain amount of information
(regardless of whether the author has documented it or not), including the
module it is defined in and its required and optional arguments.  Is there
a way to get this kind of information in Racket at the REPL, regardless of
whether or not the author has been scrupulous in documenting her work?

> I wonder whether help could display contracts if the module use
> provide/contract to export f.

This is exactly the kind of thing I would find useful.  Or perhaps I
should say: it is the kind of thing I have found useful in the past.  The
spirit of my original question was meant to be: given that I found this
useful in the past, what's the right way of translating that experience to
programming in Racket?  Should I be looking for a way to do similar things
in Racket, or should I be revising the way I think about and use the
documentation system?  It seems like the answer is, "both."

Best,
Richard





Posted on the users mailing list.