README 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. Overview and Usage
  2. ------------------
  3. This directory contains Scheme programs, some useful in maintaining Guile.
  4. On "make install", these programs are copied to PKGDATADIR/VERSION/scripts.
  5. You can use guile-tools to invoke a program from the shell, or alternatively,
  6. load its file as a Guile Scheme module, and use its exported procedure(s)
  7. from Scheme code. Typically for any PROGRAM:
  8. (use-modules (scripts PROGRAM))
  9. (PROGRAM ARG1 ARG2 ...)
  10. For programs that write to stdout, you might try, instead:
  11. (use-modules (scripts PROGRAM))
  12. (with-output-to-string (lambda () (PROGRAM ARG1 ARG2 ...)))
  13. Note that all args must be strings.
  14. To see PROGRAM's commentary, which may or may not be helpful:
  15. (help (scripts PROGRAM))
  16. If you want to try the programs before installing Guile, you will probably
  17. need to set environment variable GUILE_LOAD_PATH to be the parent directory.
  18. This can be done in Bourne-compatible shells like so:
  19. GUILE_LOAD_PATH=`(cd .. ; pwd)`
  20. export GUILE_LOAD_PATH
  21. [FIXME: Can someone supply the csh-compatible equivalent?]
  22. How to Contribute
  23. -----------------
  24. See template file PROGRAM for a quick start.
  25. Programs must follow the "guile-tools" convention, documented here:
  26. - The module name must be "(scripts PROGRAM)". A procedure named PROGRAM w/
  27. signature "(PROGRAM . args)" must be exported. Basically, use some variant
  28. of the form:
  29. (define-module (scripts PROGRAM)
  30. :export (PROGRAM))
  31. Feel free to export other definitions useful in the module context.
  32. - There must be the alias:
  33. (define main PROGRAM)
  34. However, `main' must NOT be exported.
  35. Following these conventions allows the program file to be used as module
  36. (scripts PROGRAM) in addition to being invoked by guile-tools. Please also
  37. include a helpful Commentary section w/ some usage info.
  38. [README ends here]