3 ms·
Ask HN: How do you explore a Lisp/Scheme?
Most of the programming I have done is in Python. One of my favorite features in Python is that
>>> help(X)
gives useful information for just about any object X. This is great for exploring modules, learning about the methods and member variables of classes, and finding out what functions do; it's an important "bottom-up" tool for exploring the language. In Python, I can often think, "I need something similar to, but not quite the same as, X; X is defined in module M; so let's do help(M) to see if M has the function I want." Often, I can tell at a glance over the docstrings that the function I need is there.
This is complemented by the quality of documentation for the Python standard library, which provides an excellent "top-down" reference. Between these two features, I usually have no trouble finding just the function I need when I need it.
In my efforts to learn Lisp, particularly various Scheme implementations, I often find myself thinking: "I know there's already a library function to do this; now how do I find it?" I find it more difficult to browse modules, particularly in the "bottom-up" way I'm used to from Python. I find this somewhat surprising, given Lisp's reputation as a language for doing bottom-up, exploratory programming.
How do Lisp hackers explore their language, particularly when they're starting to learn a new implementation? Is there some Lisp equivalent of help() that I'm not aware of? I can't believe that the answer is just: "Read R?RS. Read the HyperSpec. Read the code." Am I missing something?
- dman 16y agoFor lisp theres apropos, describe and documentation. Also slime comes with slime inspector which is pretty nice. If youre using lispworks or franz they have fancy inspectors too. If youre doing scheme then racket (formerly plt scheme) comes with the best documentation system Ive ever seen in a programming environment.
- rwl 16y agoThat's helpful, thanks! Though often, the problem I have is that I don't know the name of the function I'm looking for, so things like apropos, describe, and documentation aren't going to be much help unless I can apply them to packages/modules. I have so far spent the most time learning Racket. Their documentation is great, but I do wish that I could explore the library more from the REPL, rather than escaping to a browser. Do you know of any way in Racket to do something like (e.g.): (require racket/vector) (help racket/vector) where the latter form would print a quick summary of what's exported by the racket/vector module?