Next: , Up: Using the Guile Module System


2.3.5.1 Using Modules

Guile comes with a lot of useful modules, for example for string processing or command line parsing. Additionally, there exist many Guile modules written by other Guile hackers, but which have to be installed manually.

Here is a sample interactive session that shows how to use the (ice-9 popen) module which provides the means for communicating with other processes over pipes together with the (ice-9 rdelim) module that provides the function read-line.

     $ guile
     guile> (use-modules (ice-9 popen))
     guile> (use-modules (ice-9 rdelim))
     guile> (define p (open-input-pipe "ls -l"))
     guile> (read-line p)
     "total 30"
     guile> (read-line p)
     "drwxr-sr-x    2 mgrabmue mgrabmue     1024 Mar 29 19:57 CVS"