From: Christina O'Donnell <cdo@mutix.org>
To: guile-user@gnu.org
Cc: help-guix@gnu.org
Subject: Getting all symbols in a Scheme file as a list
Date: Sun, 4 Feb 2024 19:50:54 +0000 [thread overview]
Message-ID: <03f7199a-daf2-e070-8156-6837d7e20e32@mutix.org> (raw)
Hi,
I'm trying to write a Guile script to trace symbol definition and reference
between modules in a large Guile repo (GNU/Guix), for the purposes of large
scale refactoring.
I'm wondering how I could programmatically get all the values in a
Scheme file
as an S-expression. From the manual, I know that the REPL has meta keyword
',binding' and ',apropos'
<https://www.gnu.org/software/guile/manual/guile.html#index-apropos>
which let
you search and list all bindings in accessible to a module. These are
exactly
what I need only, since they're meta-commands, they don't produce Scheme
expressions.
Does anyone have any pointers? Should I go down the route of,
(open-input-pipe (string-append "guile -l" file "-c ,binding"))
? Seems a little bit baroque to me, I'd expect a simpler way of doing
it. Any
libraries anyone knows of?
Kind regards,
- Christina
next reply other threads:[~2024-02-04 19:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-04 19:50 Christina O'Donnell [this message]
2024-02-04 21:03 ` Getting all symbols in a Scheme file as a list M
2024-02-05 13:04 ` Christina O'Donnell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=03f7199a-daf2-e070-8156-6837d7e20e32@mutix.org \
--to=cdo@mutix.org \
--cc=guile-user@gnu.org \
--cc=help-guix@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).