unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Getting all symbols in a Scheme file as a list
@ 2024-02-04 19:50 Christina O'Donnell
  2024-02-04 21:03 ` M
  2024-02-04 21:39 ` Matt Wette
  0 siblings, 2 replies; 4+ messages in thread
From: Christina O'Donnell @ 2024-02-04 19:50 UTC (permalink / raw)
  To: guile-user; +Cc: help-guix

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






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-02-05 13:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-04 19:50 Getting all symbols in a Scheme file as a list Christina O'Donnell
2024-02-04 21:03 ` M
2024-02-05 13:04   ` Christina O'Donnell
2024-02-04 21:39 ` Matt Wette

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).