[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting all symbols in a Scheme file as a list

From: Christina O'Donnell
Subject: Getting all symbols in a Scheme file as a list
Date: Sun, 4 Feb 2024 19:50:54 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0


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'
<> 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

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]