Next: , Up: Configuring Guile for Guile-CV   [Contents][Index]

2.1.1 Configuring Guile’s repl-print procedure

Guile’s repl-print procedure calls (write val), which is inadequate for images, even very small images2.

Unfortunately, Guile does not provide a simple way for its users to modify its repl-print procedure, so, for now, there is no other way but ’getting your hands dirty’ here :), but no big deal either, here are the steps.

The module we need to modify is (system repl common), so let’s first figure out where it is on your system3:

scheme@(guile-user)> (string-append (%package-data-dir) "/" (effective-version))
$2 = "/opt2/share/guile/2.2"

The above returned value is an example of course, just proceed with the value returned by your system. So, the file we need to edit, in our example, is here:


Edit the above file and:

  1. Add the following module to the list of imported modules:
    #:use-module (ice-9 pretty-print)
  2. Search for the repl-print definition and, at the end of the procedure definition, replace:
    (write val)


    (truncated-print val)

Save the file of course, and proceed with the seconf modification (next section).



Even for very small images, using write is inadequate, in a terminal, and will definitely kill your Emacs/Geiser session. Not to mention it will raise your electricity bill :) - till you succeed to delete its process, Emacs will use one core at more then 100%, desperately trying to display hundreds of thousands of floating point values, heating your laptop (if you have a laptop) up to the point you’ll be able to cook an egg on it, and get its fans crasy... You’ve been warned :).


You need write privileges to modify this module, contact your admin if you’re not in charge of the system you are working on.