README 985 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. -*- outline -*-
  2. * Overview
  3. This directory includes an example program for extending Guile with a
  4. new (and even useful) data type.
  5. * Build Instructions
  6. To build the example, simply type
  7. make box
  8. in this directory.
  9. The resulting `box' program is a Guile interpreter which has one
  10. additional data type called `box'.
  11. * The Box Data Type
  12. A box is simply an object for storing one other object in. It can be
  13. used for passing parameters by reference, for example. You simply
  14. store an object into a box, pass it to another procedure which can
  15. store a new object into it and thus return a value via the box.
  16. ** Usage
  17. Box objects are created with `make-box', set with `box-set!' and
  18. examined with `box-ref'. See the following example session for usage
  19. details:
  20. ** Example Session
  21. $ ./box
  22. guile> (define b (make-box))
  23. guile> b
  24. #<box #f>
  25. guile> (box-set! b '(list of values))
  26. guile> b
  27. #<box (list of values)>
  28. guile> (box-ref b)
  29. (list of values)
  30. guile> (quit)
  31. $