diff options
Diffstat (limited to 'examples/modules')
-rw-r--r-- | examples/modules/.cvsignore | 2 | ||||
-rw-r--r-- | examples/modules/Makefile.am | 25 | ||||
-rw-r--r-- | examples/modules/README | 32 | ||||
-rwxr-xr-x | examples/modules/check.test | 27 | ||||
-rw-r--r-- | examples/modules/main | 52 | ||||
-rw-r--r-- | examples/modules/module-0.scm | 24 | ||||
-rw-r--r-- | examples/modules/module-1.scm | 24 | ||||
-rw-r--r-- | examples/modules/module-2.scm | 28 |
8 files changed, 0 insertions, 214 deletions
diff --git a/examples/modules/.cvsignore b/examples/modules/.cvsignore deleted file mode 100644 index 282522db0..000000000 --- a/examples/modules/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/examples/modules/Makefile.am b/examples/modules/Makefile.am deleted file mode 100644 index a6a9e0e03..000000000 --- a/examples/modules/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -## Process this file with Automake to create Makefile.in -## -## Copyright (C) 2001 Free Software Foundation, Inc. -## -## This file is part of GUILE. -## -## GUILE is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as -## published by the Free Software Foundation; either version 2, or -## (at your option) any later version. -## -## GUILE is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public -## License along with GUILE; see the file COPYING. If not, write -## to the Free Software Foundation, Inc., 59 Temple Place, Suite -## 330, Boston, MA 02111-1307 USA - -EXTRA_DIST = README module-0.scm module-1.scm module-2.scm main check.test - -installcheck: - srcdir=$(srcdir) GUILE_LOAD_PATH=$(top_srcdir):$(srcdir) $(srcdir)/check.test diff --git a/examples/modules/README b/examples/modules/README deleted file mode 100644 index ddad881cc..000000000 --- a/examples/modules/README +++ /dev/null @@ -1,32 +0,0 @@ - -*- outline -*- - -* Overview - -This directory includes examples which show how to write and use Guile -modules in Scheme programs. - -The descriptions below assume that you have a working copy of Guile -installed and available with the standard installation prefix -`/usr/local'. - - -* Included Examples - - -** main - - The main program, which uses the modules described below to perform - some actions. Module usage and selective importing as well as - renaming is demonstrated here.n - - $ ./main - - or - - guile -s main - -** module-0.scm, module-1.scm, module-2.scm - - Two modules which export several procedure, some of which have the - same names (so that renaming/selection is required for proper - importing). diff --git a/examples/modules/check.test b/examples/modules/check.test deleted file mode 100755 index f7a789b69..000000000 --- a/examples/modules/check.test +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -# must be run from this directory -guile=${GUILE-../../libguile/guile} - -if test "X$srcdir" = X; then - srcdir=. -fi - -set -e - -# -# ./main test -# -$guile -s $srcdir/main > TMP -cat <<EOF | diff -u - TMP -module-0 foo -module-0 bar -module-1 foo -module-1 bar -module-2 braz -module-2 braz -module-2 foo -EOF -rm -f TMP - -# check.test ends here diff --git a/examples/modules/main b/examples/modules/main deleted file mode 100644 index e4cc71dc7..000000000 --- a/examples/modules/main +++ /dev/null @@ -1,52 +0,0 @@ -#! /usr/local/bin/guile -s -!# -;;; examples/modules/main -- Module system demo. - -;;; Commentary: - -;;; The main demo program for the modules subdirectory. -;;; -;;; This program shows how all the new fancy module import features -;;; are to be used. - -;;; Author: Martin Grabmueller -;;; Date: 2001-05-29 - -;;; Code: - -(define-module (main) - ;; The module 0 is imported completely. - ;; - :use-module (module-0) - - ;; Module 1 is imported completely, too, but the procedure names are - ;; prefixed with the module name. - ;; - :use-module ((module-1) :renamer (symbol-prefix-proc 'module-1:)) - - ;; From module 2, only the procedure `braz' is imported, so that the - ;; procedures `foo' and `bar' also exported by that module don't - ;; clash with the definitions of module 0. - ;; - :use-module ((module-2) :select (braz)) - - ;; Import the bindings from module 2 again, now renaming them by - ;; explicitly mentioning the original and new names. - ;; - :use-module ((module-2) :select ((braz . m-2:braz) (foo . m-2:foo)))) - -;; -;; Now call the various imported procedures. -;; - -(foo) -(bar) -(module-1:foo) -(module-1:bar) -(braz) -(m-2:braz) -(m-2:foo) - -;; Local variables: -;; mode: scheme -;; End: diff --git a/examples/modules/module-0.scm b/examples/modules/module-0.scm deleted file mode 100644 index a5a001b64..000000000 --- a/examples/modules/module-0.scm +++ /dev/null @@ -1,24 +0,0 @@ -;;; examples/modules/module-0.scm -- Module system demo. - -;;; Commentary: - -;;; Module 0 of the module demo program. - -;;; Author: Martin Grabmueller -;;; Date: 2001-05-29 - -;;; Code: - -(define-module (module-0)) - -(export foo bar) - -(define (foo) - (display "module-0 foo") - (newline)) - -(define (bar) - (display "module-0 bar") - (newline)) - -;;; End of file. diff --git a/examples/modules/module-1.scm b/examples/modules/module-1.scm deleted file mode 100644 index 6a7bb43e0..000000000 --- a/examples/modules/module-1.scm +++ /dev/null @@ -1,24 +0,0 @@ -;;; examples/modules/module-1.scm -- Module system demo. - -;;; Commentary: - -;;; Module 1 of the module demo program. - -;;; Author: Martin Grabmueller -;;; Date: 2001-05-29 - -;;; Code: - -(define-module (module-1)) - -(export foo bar) - -(define (foo) - (display "module-1 foo") - (newline)) - -(define (bar) - (display "module-1 bar") - (newline)) - -;;; End of file. diff --git a/examples/modules/module-2.scm b/examples/modules/module-2.scm deleted file mode 100644 index 3147b2cab..000000000 --- a/examples/modules/module-2.scm +++ /dev/null @@ -1,28 +0,0 @@ -;;; examples/modules/module-2.scm -- Module system demo. - -;;; Commentary: - -;;; Module 2 of the module demo program. - -;;; Author: Martin Grabmueller -;;; Date: 2001-05-29 - -;;; Code: - -(define-module (module-2)) - -(export foo bar braz) - -(define (foo) - (display "module-2 foo") - (newline)) - -(define (bar) - (display "module-2 bar") - (newline)) - -(define (braz) - (display "module-2 braz") - (newline)) - -;;; End of file. |