wisp
 
(Arne Babenhauserheide)
2017-11-10: merge install fix stable v0.9.8

merge install fix

diff --git a/Makefile.am b/Makefile.am
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,16 +1,19 @@
 SUFFIXES = .w .scm .sh
 
-sitedir = $(GUILE_SITE)
-site_DATA = language/wisp.scm
+sitedir = $(datarootdir)/guile/$(GUILE_EFFECTIVE_VERSION)/site
+site_DATA = wisp.scm
 
-langdir = ${datarootdir}/guile/site/$(GUILE_EFFECTIVE_VERSION)/language/wisp
-lang_DATA = language/wisp/spec.scm language/wisp.scm
+langdir = $(datarootdir)/guile/$(GUILE_EFFECTIVE_VERSION)/site/language
+lang_DATA = language/wisp.scm
+
+langwispdir = $(datarootdir)/guile/$(GUILE_EFFECTIVE_VERSION)/site/language/wisp
+langwisp_DATA = language/wisp/spec.scm
 
 WISP = wisp-guile.w wisp-reader.w wisp-scheme.w
 
 EXTRA_DIST = $(WISP) bootstrap.sh bootstrap-reader.sh language examples tests wisp-repl-guile.sh testrunner.w wisp.py wisp.scm m4
 CLEANFILES = 1 2
-DISTCLEANFILES = $(lang_DATA) $(site_DATA)
+DISTCLEANFILES = $(site_DATA) $(lang_DATA) $(langwisp_DATA)
 # don't spout out lots of stuff at each distcheck. Disable for debugging.
 AM_DISTCHECK_CONFIGURE_FLAGS="--quiet"
 
@@ -18,7 +21,7 @@ ChangeLog :
 	hg log --style changelog > ChangeLog
 
 .INTERMEDIATE: .mydatastuff
-$(site_DATA) $(lang_DATA): .wispbootstrap
+$(lang_DATA) $(langwisp_DATA): .wispbootstrap
 .wispbootstrap : ${WISP} wisp.scm
 	@abs_top_srcdir@/bootstrap-reader.sh @abs_top_srcdir@ @abs_top_builddir@ @GUILE@ wisp.scm 2>&1 | sed "s/^;;;.*//" 2>&1 | grep . 1>&2 ; test ! $$? -eq 0 # it worked if grep does not find anything
 
@@ -47,10 +50,14 @@ install-siteDATA:
 	echo "Running 'make distcheck'; local installchecks disabled."
 install-langDATA:
 	echo "Running 'make distcheck'; local installchecks disabled."
+install-langwispDATA:
+	echo "Running 'make distcheck'; local installchecks disabled."
 uninstall-siteDATA:
 	echo "Running 'make distcheck'; local installchecks disabled."
 uninstall-langDATA:
 	echo "Running 'make distcheck'; local installchecks disabled."
+uninstall-langwispDATA:
+	echo "Running 'make distcheck'; local installchecks disabled."
 else !IS_MAKE_DISTCHECK
 endif !IS_MAKE_DISTCHECK
 
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -47,7 +47,7 @@ From a release:
 * Get a release from [bitbucket.org/ArneBab/wisp/downloads/](https://bitbucket.org/ArneBab/wisp/downloads/)
 * Unpack and build: `tar xf [release].tar.gz; cd [release]; ./configure; make`
 
-Install systemwide with `./configure --datarootdir=/usr/share && sudo make install`, then you can run `guile --language=wisp` anywhere. Install in your home folder with `./configure --prefix=$HOME/.local; make install`. Use `guile -c '(import (language wisp spec))'` to get rid of auto-compile errors.
+Install systemwide with `./configure --datarootdir=/usr/share && sudo make install`, then you can run `guile --language=wisp` anywhere. Install in your home folder with `./configure --datarootdir=$HOME/.local; make install`. Use `guile -c '(import (language wisp spec))'` to get rid of auto-compile errors.
 
 Run tests with `make check`. Distribute your own version with `make distcheck`.
 
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
 dnl run `autoreconf -i` to generate a configure script. 
 dnl Then run ./configure to generate a Makefile.
 dnl Finally run make to generate the project.
-AC_INIT([wisp], [0.9.7],
+AC_INIT([wisp], [0.9.8],
         [arne_bab@web.de])
 # Add macros in m4/ to ensure that wisp builds without having Guile in the aclocal path
 AC_CONFIG_MACRO_DIR([m4])
diff --git a/examples/advent-2016-day-7.w b/examples/advent-2016-day-7.w
--- a/examples/advent-2016-day-7.w
+++ b/examples/advent-2016-day-7.w
@@ -1,5 +1,6 @@
 #!/usr/bin/env sh
 # -*- wisp -*-
+guile -L $(dirname $(dirname $(realpath "$0"))) -c '(import (language wisp spec))'
 exec guile -L $(dirname $(dirname $(realpath "$0"))) --language=wisp -s "$0"
 ; !#
 
diff --git a/examples/argparse.w b/examples/argparse.w
--- a/examples/argparse.w
+++ b/examples/argparse.w
@@ -1,6 +1,6 @@
 #!/usr/bin/env sh
 # -*- wisp -*-
-guile -L $(dirname $(dirname $(realpath "$0"))) -c '(import (wisp-scheme) (language wisp spec))'
+guile -L $(dirname $(dirname $(realpath "$0"))) -c '(import (language wisp spec))'
 exec guile -L $(dirname $(dirname $(realpath "$0"))) --language=wisp -e '(@@ (examples argparse) main)' -s "$0" "$@"
 ; !#
 
diff --git a/examples/benchmark.w b/examples/benchmark.w
--- a/examples/benchmark.w
+++ b/examples/benchmark.w
@@ -1,5 +1,6 @@
 #!/usr/bin/env sh
 # -*- wisp -*-
+guile -L $(dirname $(dirname $(realpath "$0"))) -c '(import (language wisp spec))'
 exec guile -L $(dirname $(dirname $(realpath "$0"))) --language=wisp -e '(@@ (examples benchmark) main)' -l $(dirname $(realpath "$0"))/cholesky.w -l $(dirname $(realpath "$0"))/ensemble-estimation.w -s "$0" "$@"
 ; !#
 
diff --git a/examples/cartesian-sets.w b/examples/cartesian-sets.w
--- a/examples/cartesian-sets.w
+++ b/examples/cartesian-sets.w
@@ -1,5 +1,6 @@
 #!/usr/bin/env sh
 # -*- wisp -*-
+guile -L $(dirname $(dirname $(realpath "$0"))) -c '(import (language wisp spec))'
 exec guile -L $(dirname $(dirname $(realpath "$0"))) --language=wisp -e '(@@ (examples cartesian-sets) main)' -s "$0" "$@"
 ; !#
 ;; Implementation of the cartesian product over a list of lists, building on http://stackoverflow.com/a/20591545/7666
diff --git a/examples/cholesky.w b/examples/cholesky.w
--- a/examples/cholesky.w
+++ b/examples/cholesky.w
@@ -1,5 +1,6 @@
 #!/usr/bin/env sh
 # -*- wisp -*-
+guile -L $(dirname $(dirname $(realpath "$0"))) -c '(import (language wisp spec))'
 exec guile -L $(dirname $(dirname $(realpath "$0"))) --language=wisp -e '(@@ (examples cholesky) main)' -s "$0" "$@"
 ; !#
 
diff --git a/examples/cli.w b/examples/cli.w
--- a/examples/cli.w
+++ b/examples/cli.w
@@ -1,5 +1,6 @@
 #!/usr/bin/env sh
 # -*- wisp -*-
+guile -L $(dirname $(dirname $(realpath "$0"))) -c '(import (language wisp spec))'
 exec guile -L $(dirname $(dirname $(realpath "$0"))) --language=wisp -e '(@@ (examples cli) main)' -s "$0" "$@"
 ; !#
 
diff --git a/examples/closure.w b/examples/closure.w
--- a/examples/closure.w
+++ b/examples/closure.w
@@ -1,5 +1,6 @@
 #!/usr/bin/env sh
 # -*- wisp -*-
+guile -L $(dirname $(dirname $(realpath "$0"))) -c '(import (language wisp spec))'
 exec guile -L $(dirname $(dirname $(realpath "$0"))) --language=wisp -e '(@@ (examples closure) main)' -s "$0" "$@"
 ; !#
 
diff --git a/examples/coffee.w b/examples/coffee.w
new file mode 100755
--- /dev/null
+++ b/examples/coffee.w
@@ -0,0 +1,41 @@
+#!/usr/bin/env sh
+# -*- wisp -*-
+guile -L $(dirname $(dirname $(realpath "$0"))) -c '(import (language wisp spec))'
+exec guile -L $(dirname $(dirname $(realpath "$0"))) --language=wisp -s "$0" "$@"
+; !#
+
+;;; coffee --- pseudo-code for work with coffee, based on flawed java-code on a cup
+
+import : ice-9 q
+         ice-9 pretty-print
+
+define-syntax-rule : sip x
+  set! x #f
+define-syntax-rule : pop x
+  let : : y : car x
+    set! x : cdr x
+    . y
+
+define* : work schedule
+    let*
+      : pot : prepare 'coffee
+        cup : serve pot
+      let proceed : : task : pop schedule
+          sip cup
+          execute task
+          when : not : done? schedule
+              when : empty? cup
+                  when : empty? pot
+                      set! pot : prepare 'coffee
+                  set! cup : serve pot
+              proceed : pop schedule
+
+define prepare list
+define serve car
+define execute pretty-print
+define done? null?
+define : empty? x
+    equal? #f x
+define schedule : iota 5
+
+work schedule
diff --git a/examples/commandline-handling.w b/examples/commandline-handling.w
--- a/examples/commandline-handling.w
+++ b/examples/commandline-handling.w
@@ -1,6 +1,6 @@
 #!/usr/bin/env sh
 # -*- wisp -*-
-guile-2.0 -L $(dirname $(dirname $(realpath "$0"))) -c '(import (wisp-scheme) (language wisp spec))'
+guile-2.0 -L $(dirname $(dirname $(realpath "$0"))) -c '(import (language wisp spec))'
 exec guile-2.0 -L $(dirname $(dirname $(realpath "$0"))) --language=wisp -e '(examples commandline-handling)' -s "$0" "$@"
 ; !#
 
diff --git a/examples/comment-server.w b/examples/comment-server.w
--- a/examples/comment-server.w
+++ b/examples/comment-server.w
@@ -1,4 +1,6 @@
 #!./wisp-multiline.sh
+guile -L $(dirname $(dirname $(realpath "$0"))) -c '(import (language wisp spec))'
+
 ; !#
 
 use-modules 
diff --git a/examples/d20world.w b/examples/d20world.w
--- a/examples/d20world.w
+++ b/examples/d20world.w
@@ -1,5 +1,6 @@
 #!/usr/bin/env sh
 # -*- wisp -*-
+guile -L $(dirname $(dirname $(realpath "$0"))) -c '(import (language wisp spec))'
 exec guile -L $(dirname $(dirname $(realpath "$0"))) --language=wisp -e '(@@ (examples d20world) main)' -s "$0" "$@"
 ; !#
 
diff --git a/examples/d6.w b/examples/d6.w
--- a/examples/d6.w
+++ b/examples/d6.w
@@ -1,5 +1,6 @@
 #!/usr/bin/env sh
 # -*- wisp -*-
+guile -L $(dirname $(dirname $(realpath "$0"))) -c '(import (language wisp spec))'
 exec guile -L $(dirname $(dirname $(realpath "$0"))) --language=wisp -e '(@@ (examples d6) main)' -s "$0" "$@"
 ; !#
 
diff --git a/examples/duel.w b/examples/duel.w
--- a/examples/duel.w
+++ b/examples/duel.w
@@ -2,7 +2,7 @@
 # -*- wisp -*-
 D="$(dirname $(realpath "$0"))"
 W="$(dirname $(dirname $(realpath "$0")))"
-guile -L "$W" -c '(import (wisp-scheme) (language wisp spec))'
+guile -L "$W" -c '(import (language wisp spec))'
 exec guile -L "$W" --language=wisp -l "$D/enter-three-witches.w" -s "$0" "$@"
 ; !#
 
diff --git a/examples/ensemble-estimation.w b/examples/ensemble-estimation.w
--- a/examples/ensemble-estimation.w
+++ b/examples/ensemble-estimation.w
@@ -1,6 +1,6 @@
 #!/usr/bin/env sh
 # -*- wisp -*-
-guile -L $(dirname $(dirname $(realpath "$0"))) -c '(import (wisp-scheme) (language wisp spec))'
+guile -L $(dirname $(dirname $(realpath "$0"))) -c '(import (language wisp spec))'
 exec guile -L $(dirname $(dirname $(realpath "$0"))) --language=wisp -e '(@@ (examples ensemble-estimation) main)' -l $(dirname $(realpath "$0"))/cholesky.w -s "$0" "$@"
 ; !#
 
diff --git a/examples/enter-three-witches.w b/examples/enter-three-witches.w
--- a/examples/enter-three-witches.w
+++ b/examples/enter-three-witches.w
@@ -1,6 +1,6 @@
 #!/usr/bin/env sh
 # -*- wisp -*-
-guile -L $(dirname $(dirname $(realpath "$0"))) -c '(import (wisp-scheme) (language wisp spec))'
+guile -L $(dirname $(dirname $(realpath "$0"))) -c '(import (language wisp spec))'
 exec guile -L $(dirname $(dirname $(realpath "$0"))) --language=wisp -e '(@@ (examples enter-three-witches) main)' -s "$0" "$@"
 ; !#
 
diff --git a/examples/evaluate-r7rs-benchmark.w b/examples/evaluate-r7rs-benchmark.w
--- a/examples/evaluate-r7rs-benchmark.w
+++ b/examples/evaluate-r7rs-benchmark.w
@@ -1,5 +1,6 @@
 #!/bin/sh
 # -*- wisp -*-
+guile -L $(dirname $(dirname $(realpath "$0"))) -c '(import (language wisp spec))'
 exec guile -L ~/wisp --language=wisp -s $0 "$@"
 !#
 
diff --git a/examples/evolve.w b/examples/evolve.w
--- a/examples/evolve.w
+++ b/examples/evolve.w
@@ -1,5 +1,6 @@
 #!/usr/bin/env sh
 # -*- wisp -*-
+guile -L $(dirname $(dirname $(realpath "$0"))) -c '(import (language wisp spec))'
 exec guile -L $(dirname $(dirname $(realpath "$0"))) --language=wisp -e '(@@ (examples evolve) main)' -s "$0" "$@"
 ; !#
 
diff --git a/examples/factorial.w b/examples/factorial.w
--- a/examples/factorial.w
+++ b/examples/factorial.w
@@ -1,4 +1,5 @@
 #!/usr/bin/env sh
+guile -L $(dirname $(dirname $(realpath "$0"))) -c '(import (language wisp spec))'
 exec guile -L $(dirname $(dirname $(realpath "$0"))) --language=wisp -e '(@@ (examples factorial) main)' -s "$0" "$@"
 ; !#