Discoverability in Guile (namespaces, ide hints, intuition?)

Hi @jdr!

First, a similar thread that may be helpful: How do I find what module to import for a given binding?

Leaving extensions like Geiser aside, you can use Guile’s built-in “meta commands” to query the state of the running system. At the REPL, you could ,apropos foo (or ,a foo for short) to get information about all bindings in the current environment matching foo. This will tell you the name of the module that exported that symbol, notably. To retrieve docstrings, use ,describe foo.

Geiser provides additional features that will do docstring lookup, show the signature of the procedure at the current point, jump to symbol definition (if it’s Scheme and not C), etc. Geiser is a must-have for Guile development, imo.

All else fails, I just grep the project for the symbol and typically find it, else it’s in some dependency or Guile itself. Scheme’s hygienic naming makes it easy to grep for things when you need to.

Hope this helps!

3 Likes