summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-09 21:35:50 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-09 21:35:50 +0100
commitf2bf4b2cda05fe8c32ee74ce3b5cce743d81de61 (patch)
tree81250c2797eac0a594a393f361287c6fb0fd4688 /bin
parent512fa06fec02b7dc8ce11684313f7a0ab56bef6b (diff)
downloadgeiser-chez-f2bf4b2cda05fe8c32ee74ce3b5cce743d81de61.tar.gz
geiser-chez-f2bf4b2cda05fe8c32ee74ce3b5cce743d81de61.tar.bz2
Racket: remote REPLs
Diffstat (limited to 'bin')
-rw-r--r--bin/Makefile.am15
-rwxr-xr-xbin/geiser-racket.sh19
2 files changed, 34 insertions, 0 deletions
diff --git a/bin/Makefile.am b/bin/Makefile.am
new file mode 100644
index 0000000..9f6ee2b
--- /dev/null
+++ b/bin/Makefile.am
@@ -0,0 +1,15 @@
+EXTRA_DIST = geiser-racket.sh
+dist_bin_SCRIPTS = geiser-racket
+noinst_SCRIPTS = geiser-racket-noinst
+
+CLEANFILES = $(dist_bin_SCRIPTS) $(noinst_SCRIPTS)
+
+geiser-racket: $(srcdir)/geiser-racket.sh
+ @sed -e "s|top=\".*\"|top=$(datarootdir)/geiser|" \
+ $(srcdir)/geiser-racket.sh >$@
+ @chmod +x $@
+
+geiser-racket-noinst: $(srcdir)/geiser-racket.sh
+ @sed -e "s|top=\".*\"|top=$(abs_top_srcdir)/scheme|" \
+ $(srcdir)/geiser-racket.sh >$@
+ @chmod +x $@
diff --git a/bin/geiser-racket.sh b/bin/geiser-racket.sh
new file mode 100755
index 0000000..4f16383
--- /dev/null
+++ b/bin/geiser-racket.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+#|
+top="$(dirname $0)/../scheme"
+exec racket -i -S "$top/racket" -l errortrace -cu "$0" ${1+"$@"}
+|#
+
+#lang racket/base
+
+(require (lib "cmdline.rkt"))
+
+(define port (make-parameter 1969))
+
+(command-line
+ "run-racket.sh" (current-command-line-arguments)
+ (once-each
+ (("-p" "--port") p "Geiser server port" (port (string->number p)))))
+
+(and ((dynamic-require 'geiser/server 'start-geiser) (port))
+ (printf "Geiser server running at port ~a~%" (port)))