1 #! /usr/local/bin/guile -s
3 ;;; examples/modules/main -- Module system demo.
7 ;;; The main demo program for the modules subdirectory.
9 ;;; This program shows how all the new fancy module import features
12 ;;; Author: Martin Grabmueller
18 ;; The module 0 is imported completely.
20 :use-module (module-0)
22 ;; Module 1 is imported completely, too, but the procedure names are
23 ;; prefixed with the module name.
25 :use-module ((module-1) :renamer (symbol-prefix-proc 'module-1:))
27 ;; From module 2, only the procedure `braz' is imported, so that the
28 ;; procedures `foo' and `bar' also exported by that module don't
29 ;; clash with the definitions of module 0.
31 :use-module ((module-2) :select (braz))
33 ;; Import the bindings from module 2 again, now renaming them by
34 ;; explicitly mentioning the original and new names.
36 :use-module ((module-2) :select ((braz . m-2:braz) (foo . m-2:foo))))
39 ;; Now call the various imported procedures.