aboutsummaryrefslogtreecommitdiffstats
path: root/slib.sh
diff options
context:
space:
mode:
Diffstat (limited to 'slib.sh')
-rwxr-xr-xslib.sh34
1 files changed, 21 insertions, 13 deletions
diff --git a/slib.sh b/slib.sh
index 2401d14..fd0ef04 100755
--- a/slib.sh
+++ b/slib.sh
@@ -28,9 +28,9 @@ Usage: slib SCHEME
Usage: slib
- Initialize SLIB session using executable (MIT) 'scheme', 'scm',
- 'gsi', 'mzscheme', 'guile', 'slib48', 'larceny', 'scmlit', 'elk',
- 'sisc', or 'kawa'."
+ Initialize SLIB session using executable (MIT)'scheme', 'scm',
+ 'gsi', 'gosh', 'guile', 'slib48', 'larceny', 'scmlit', 'elk',
+ 'sisc', 'kawa', or 'mzscheme'."
case "$1" in
-v | --ver*) echo slib "$VERSION"; exit 0;;
@@ -41,18 +41,18 @@ case "$1" in
*) command="$1"
shift
esac
-# If more arguments are supplied, then err out.
-if [ ! -z "$1" ]; then
- echo "$usage"; exit 1
-fi
+## If more arguments are supplied, then err out.
+# if [ ! -z "$1" ]; then
+# echo "$usage"; exit 1
+# fi
if [ -z "$command" ]; then
if type scm>/dev/null 2>&1; then
command=scm; implementation=scm
elif type gsi>/dev/null 2>&1; then
command=gsi; implementation=gam
- elif type mzscheme>/dev/null 2>&1; then
- command=mzscheme; implementation=plt
+ elif type gosh>/dev/null 2>&1; then
+ command=gosh; implementation=gch
elif type guile>/dev/null 2>&1; then
command=guile; implementation=gui
elif type slib48>/dev/null 2>&1; then
@@ -67,12 +67,14 @@ if [ -z "$command" ]; then
command=sisc; implementation=ssc
elif type kawa>/dev/null 2>&1; then
command=kawa; implementation=kwa
+ elif type mzscheme>/dev/null 2>&1; then
+ command=mzscheme; implementation=plt
else
echo No Scheme implementation found.
exit 1
fi
# Gambit 4.0 doesn't allow input redirection; foils --version test.
-elif [ "$command" == "gsi" ]; then implementation=gam
+elif [ "$command" = "gsi" ]; then implementation=gam
elif type $command>/dev/null 2>&1; then
SPEW="`$command --version < /dev/null 2>&1`"
if echo ${SPEW} | grep 'Initialize load-path (colon-list of directories)'\
@@ -80,12 +82,13 @@ elif type $command>/dev/null 2>&1; then
elif echo ${SPEW} | grep 'MIT' >/dev/null 2>&1; then implementation=mit
elif echo ${SPEW} | grep 'UMB Scheme'>/dev/null 2>&1; then implementation=umb
elif echo ${SPEW} | grep 'scheme48' >/dev/null 2>&1; then implementation=s48
- elif echo ${SPEW} | grep 'MzScheme' >/dev/null 2>&1; then implementation=plt
elif echo ${SPEW} | grep 'larceny' >/dev/null 2>&1; then implementation=lar
elif echo ${SPEW} | grep 'Guile' >/dev/null 2>&1; then implementation=gui
+ elif echo ${SPEW} | grep 'gosh' >/dev/null 2>&1; then implementation=gch
elif echo ${SPEW} | grep 'SCM' >/dev/null 2>&1; then implementation=scm
elif echo ${SPEW} | grep 'SISC' >/dev/null 2>&1; then implementation=ssc
elif echo ${SPEW} | grep 'Kawa' >/dev/null 2>&1; then implementation=kwa
+ elif echo ${SPEW} | grep 'MzScheme' >/dev/null 2>&1; then implementation=plt
else implementation=
fi
else
@@ -124,10 +127,14 @@ case $implementation in
scm) exec $command -ip1 -l ${SCHEME_LIBRARY_PATH}scm.init "$@";;
elk) exec $command -i -l ${SCHEME_LIBRARY_PATH}elk.init "$@";;
gam) exec $command -:s ${SCHEME_LIBRARY_PATH}gambit.init - "$@";;
+ gch) exec $command -l ${SCHEME_LIBRARY_PATH}gosh.init "$@";;
ssc) exec $command -e "(load \"${SCHEME_LIBRARY_PATH}sisc.init\")" -- "$@";;
kwa) exec $command -f ${SCHEME_LIBRARY_PATH}kawa.init -- "$@";;
- plt) exec $command -f ${SCHEME_LIBRARY_PATH}mzscheme.init "$@";;
- gui) exec $command -l ${SCHEME_LIBRARY_PATH}guile.init "$@";;
+ gui) if [ -f ${SCHEME_LIBRARY_PATH}guile.use ]; then
+ exec $command -l ${SCHEME_LIBRARY_PATH}guile.init -l ${SCHEME_LIBRARY_PATH}guile.use "$@"
+ else
+ exec $command -l ${SCHEME_LIBRARY_PATH}guile.init "$@"
+ fi;;
lar) exec $command -- -e "(require 'srfi-96)" "$@";;
mit) exec $command -load ${SCHEME_LIBRARY_PATH}mitscheme.init "$@";;
s48) if [ -f "${S48_VICINITY}slib.image" ]; then
@@ -136,6 +143,7 @@ case $implementation in
echo "scheme48 found; in slib directory do: 'make slib48 && make install48'";
fi
exit 1;;
+ plt) exec $command -f ${SCHEME_LIBRARY_PATH}mzscheme.init "$@";;
umb) echo "umb-scheme vicinities are too wedged to run slib"; exit 1;;
*) exit 1;;
esac