debian/0000775000000000000000000000000012266202611007166 5ustar debian/compat0000664000000000000000000000000212266176645010405 0ustar 9 debian/copyright0000664000000000000000000000300312266176645011136 0ustar This package was debianized by Barak A. Pearlmutter on Mon, 23 Feb 2009 09:28:11 +0000. It was downloaded from http://www.t3x.org/files/s9fes.tgz Upstream Author: Nils M Holm Copyright: Copyright (C) 2007, 2008, 2009, Nils M Holm License: Scheme 9 from Empty Space -- A Comprehensible Scheme Interpreter By Nils M Holm 2007,2008,2009 Don't worry, be happy. Frankly, life's too short to deal with legal stuff, so * do whatever you want with my code; * if the code doesn't work, don't blame me. Disclaimer: THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The Debian packaging is (C) 2009, Barak A. Pearlmutter and is dual licensed under the above license and the GPL, see `/usr/share/common-licenses/GPL'. debian/rules0000775000000000000000000000065612266176645010276 0ustar #!/usr/bin/make -f %: dh $@ --parallel mflags=prefix=/usr mandir=/usr/share/man override_dh_auto_build: dh_auto_build -- $(mflags) all override_dh_auto_install: dh_auto_install -- $(mflags) install-all echo "Rename binaries to avoid namespace pollution and collisions" cd debian/scheme9/usr/bin && \ for f in advgen c2html cols dupes edoc htmlify scm2html scmpp soccat; do \ mv --verbose $$f s9$$f || true; \ done debian/scheme9.docs0000664000000000000000000000000712266176645011413 0ustar README debian/scheme9.menu0000664000000000000000000000015312266176645011431 0ustar ?package(scheme9):needs="text" section="Applications/Programming"\ title="scheme9" command="/usr/bin/s9" debian/source/0000775000000000000000000000000012266176645010507 5ustar debian/source/format0000664000000000000000000000001412266176645011715 0ustar 3.0 (quilt) debian/source/patch-header0000664000000000000000000000027512266176645012763 0ustar The patch to the s9 man page is trivial, but involves renaming a file, which quilt does not handle very well. For this reason the patch is kept as a git commit, rather than a quilt patch. debian/watch0000664000000000000000000000073112266176645010241 0ustar version=3 http://t3x.org/s9fes/s9fes-(\d\d\d\d)(\d\d)(\d\d)\.tar\.gz http://t3x.org/s9fes/s9fes-(\d\d\d\d)(\d\d)(\d\d)(.+)\.tar\.gz ## This runs the check for the current version. # eval $(tail -5 debian/watch | sed 's/^#//' | sed 's/\\$//') ## This checks for the current version. # wget --quiet -O- http://www.t3x.org/s9fes/s9fes.tgz \ # | tar -zxf - --to-stdout s9/s9.c \ # | egrep '^ *[#]define +VERSION' \ # | sed 's/^ *[#]define *VERSION *//' \ # | tr -d '"' debian/patches/0000775000000000000000000000000012266202635010623 5ustar debian/patches/0001-recombobulate-Makefile.patch0000664000000000000000000000363312266202611016557 0ustar From: "Barak A. Pearlmutter" Date: Wed, 27 Jul 2011 20:46:53 +0100 Subject: recombobulate Makefile --- Makefile | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 698929c..18a4a94 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ # Placed in the Public Domain. # Change at least this line: -PREFIX= /u +PREFIX=$(prefix) # Override default compiler and flags CC= gcc @@ -55,14 +55,21 @@ DEFS= $(OSDEF) \ -DCURSES_RESET # Where to install the stuff -BINDIR= $(PREFIX)/bin -LIBDIR= $(PREFIX)/share/s9fes -MANDIR= $(PREFIX)/man/man1 +prefix=/usr/local +exec_prefix=$(prefix) +bindir=$(exec_prefix)/bin +datadir=$(prefix)/share +libdir=$(exec_prefix)/lib +mandir=$(prefix)/man + +BINDIR=$(DESTDIR)$(bindir) +LIBDIR=$(DESTDIR)$(libdir) +MANDIR=$(DESTDIR)$(mandir)/man1 # Set up environment to be used during the build process BUILD_ENV= env S9FES_LIBRARY_PATH=.:lib:ext:contrib -default: s9 s9.image s9.1.gz s9.1.txt lib/syntax-rules.scm \ +default: s9 s9.image s9.1 lib/syntax-rules.scm \ lib/matcher.scm all: default s9e @@ -79,8 +86,14 @@ s9.o: s9.c s9-real.c s9.h s9.image: s9 s9.scm s9-real.scm ext/unix.scm ext/curses.scm config.scm $(BUILD_ENV) ./s9 -i - -n $(EXTRA_SCM) -l config.scm -d s9.image -s9.1.gz: s9.1 - sed -e "s,@LIBDIR@,$(LIBDIR)," s9.1.gz +%.1: %.1.in + sed \ + -e "s,@LIBDIR@,$(LIBDIR),g" \ + -e "s,@DATADIR@,$(DATADIR),g" \ + < $@.in > $@ + +%.gz: % + gzip -9 < $* > $@ unix.o: ext/unix.c s9.h $(CC) $(CFLAGS) $(DEFS) -I . -o unix.o -c ext/unix.c @@ -129,7 +142,7 @@ install-s9: s9 s9.scm s9.image s9.1.gz install -d -m 0755 $(LIBDIR)/help install -d -m 0755 $(MANDIR) install $C -m 0755 s9 $(BINDIR) - strip $(BINDIR)/s9 + echo skip strip $(BINDIR)/s9 install $C -m 0644 s9.scm $(LIBDIR) install $C -m 0644 s9.image $(LIBDIR) install $C -m 0644 lib/* $(LIBDIR) debian/patches/0002-use-CFLAGS.patch0000664000000000000000000000162612266202611013753 0ustar From: "Barak A. Pearlmutter" Date: Thu, 12 Jul 2012 11:56:45 +0100 Subject: use CFLAGS Don't specify -O2 and -g (on by default) so they can be overwritten by builder, e.g., dpkg-buildflags. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 18a4a94..c225941 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ PREFIX=$(prefix) # Override default compiler and flags CC= gcc -CFLAGS= -g -Wall -ansi -pedantic -O2 +CFLAGS+= -Wall -ansi -pedantic # You may try one of the following, if you get "wrong interpreter" errors #LDFLAGS+= -Wl,-no_pie @@ -77,7 +77,7 @@ all: default s9e s9e: s9e-core.image s9: s9.o s9.h $(EXTRA_OBJS) - $(CC) -o s9 $(LDFLAGS) s9.o $(EXTRA_OBJS) $(EXTRA_LIBS) + $(CC) $(CFLAGS) -o s9 $(LDFLAGS) s9.o $(EXTRA_OBJS) $(EXTRA_LIBS) s9.o: s9.c s9-real.c s9.h $(CC) -o s9.o $(CFLAGS) $(DEFS) -c s9.c debian/patches/0003-use-CPPFLAGS.patch0000664000000000000000000000114312266202611014206 0ustar From: "Barak A. Pearlmutter" Date: Thu, 12 Jul 2012 12:06:08 +0100 Subject: use CPPFLAGS Need CPPFLAGS during compilation to call hardened routines during hardened build. See lintian tag hardening-no-fortify-functions. --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index c225941..f3c0937 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,7 @@ EXTRA_SCM+= -l s9-real.scm # # (requires the Curses extension) DEFS= $(OSDEF) \ + $(CPPFLAGS) \ -DDEFAULT_LIBRARY_PATH="\".:~/s9fes:$(LIBDIR)\"" \ -DEXTENSIONS="$(EXTRA_INIT)" \ -DREALNUM \ debian/patches/0004-parallel-install.patch0000664000000000000000000000235512266202611015464 0ustar From: "Barak A. Pearlmutter" Date: Thu, 12 Jul 2012 12:10:44 +0100 Subject: parallel install Allow parallelism during "make install" by ensuring that each installation stanza creates any directories it targets. This might result in multiple creation; that is okay. --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index f3c0937..de1f746 100644 --- a/Makefile +++ b/Makefile @@ -155,6 +155,7 @@ install-s9: s9 s9.scm s9.image s9.1.gz (cd $(LIBDIR) && ./make-help-links && rm make-help-links) install-util: + install -d -m 0755 $(BINDIR) sed -e "s|^#! /usr/local|#! $(PREFIX)|" \ $(BINDIR)/s9help sed -e "s|^#! /usr/local|#! $(PREFIX)|" \ @@ -169,6 +170,8 @@ install-util: $(BINDIR)/scmpp install-s9e: s9e-core.image + install -d -m 0755 $(BINDIR) + install -d -m 0755 $(LIBDIR) ln -fs $(BINDIR)/s9 $(BINDIR)/s9e-core install $C -m 0644 s9e-core.image $(LIBDIR) sed -e "s|^#! /usr/local|#! $(PREFIX)|" \ @@ -176,6 +179,7 @@ install-s9e: s9e-core.image -chmod +x $(BINDIR)/s9e install-progs: + install -d -m 0755 $(BINDIR) sed -e "s|^#! /usr/local|#! $(PREFIX)|" \ $(BINDIR)/advgen sed -e "s|^#! /usr/local|#! $(PREFIX)|" \ debian/patches/0005-maxpathlen-for-hurd.patch0000664000000000000000000000102612266202611016104 0ustar From: "Barak A. Pearlmutter" Date: Wed, 27 Jul 2011 20:45:24 +0100 Subject: maxpathlen for hurd --- s9.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/s9.h b/s9.h index 7e585b2..ee00685 100644 --- a/s9.h +++ b/s9.h @@ -80,6 +80,11 @@ #endif #endif +#ifndef MAXPATHLEN + /* MAXPATHLEN not defined on Hurd, as it is "bogus." */ + #define MAXPATHLEN 4096 +#endif + /* * Tell later MSC compilers to let us use the standard CLIB API. * Blake McBride < b l a k e at m c b r i d e . n a m e > debian/patches/0006-search-path-in-test-script.patch0000664000000000000000000000103112266202611017276 0ustar From: "Barak A. Pearlmutter" Date: Wed, 27 Jul 2011 20:46:16 +0100 Subject: search path in test script --- util/libtest.sh | 2 ++ 1 file changed, 2 insertions(+) mode change 100644 => 100755 util/libtest.sh diff --git a/util/libtest.sh b/util/libtest.sh old mode 100644 new mode 100755 index f923084..5e27690 --- a/util/libtest.sh +++ b/util/libtest.sh @@ -70,4 +70,6 @@ trap ' exit 1 ' 1 2 3 15 +# Use BUILD_ENV from Makefile here +env S9FES_LIBRARY_PATH=.:lib:ext:contrib \ ./s9 -i test -nf $testfile debian/patches/0007-bin-symlink.patch0000664000000000000000000000140312266202611014454 0ustar From: "Barak A. Pearlmutter" Date: Tue, 25 Dec 2012 00:27:23 +0100 Subject: bin symlink Simplify installed symlink from bin/s9e-core to s9e by removing absolute prefix, which is wrong when DESTDIR is turned on, and problematic if the target bin directory is moved. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index de1f746..3cb0df0 100644 --- a/Makefile +++ b/Makefile @@ -172,7 +172,7 @@ install-util: install-s9e: s9e-core.image install -d -m 0755 $(BINDIR) install -d -m 0755 $(LIBDIR) - ln -fs $(BINDIR)/s9 $(BINDIR)/s9e-core + ln -fs s9 $(BINDIR)/s9e-core install $C -m 0644 s9e-core.image $(LIBDIR) sed -e "s|^#! /usr/local|#! $(PREFIX)|" \ $(BINDIR)/s9e debian/patches/0008-fread-checks.patch0000664000000000000000000000232412266202611014543 0ustar From: "Barak A. Pearlmutter" Date: Fri, 17 Jan 2014 10:18:26 +0000 Subject: fread checks --- s9.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/s9.c b/s9.c index d6dba36..ecdd556 100644 --- a/s9.c +++ b/s9.c @@ -4842,7 +4842,9 @@ int load_image(char *p) { f = fopen(p, "rb"); if (f == NULL) return -1; - fread(&m, sizeof(m), 1, f); + if (fread(&m, sizeof(m), 1, f) != 1) { + return -1; + } if (memcmp(m.id, "S9", 2)) { error("error in image file (magic match failed)", name); ok = 0; @@ -4870,8 +4872,12 @@ int load_image(char *p) { ok = 0; } memset(Tag, 0, Cons_pool_size); - fread(&image_nodes, sizeof(int), 1, f); - fread(&image_vcells, sizeof(int), 1, f); + if (fread(&image_nodes, sizeof(int), 1, f) != 1) { + return -1; + } + if (fread(&image_vcells, sizeof(int), 1, f) != 1) { + return -1; + } while (image_nodes > Cons_pool_size) { if ( Memory_limit_kn && Cons_pool_size + Cons_segment_size > Memory_limit_kn @@ -4895,7 +4901,9 @@ int load_image(char *p) { v = Image_vars; i = 0; while (v[i]) { - fread(v[i], sizeof(cell), 1, f); + if (fread(v[i], sizeof(cell), 1, f) != 1) { + return -1; + } i++; } if ( ok && debian/patches/series0000664000000000000000000000035712266202635012045 0ustar 0001-recombobulate-Makefile.patch 0002-use-CFLAGS.patch 0003-use-CPPFLAGS.patch 0004-parallel-install.patch 0005-maxpathlen-for-hurd.patch 0006-search-path-in-test-script.patch 0007-bin-symlink.patch 0008-fread-checks.patch debian-changes debian/patches/debian-changes0000644000000000000000000004113312266202635013376 0ustar The patch to the s9 man page is trivial, but involves renaming a file, which quilt does not handle very well. For this reason the patch is kept as a git commit, rather than a quilt patch. --- /dev/null +++ scheme9-2013.11.26/s9.1.in @@ -0,0 +1,771 @@ +.\" S9(1) Manual Page +.\" By Nils M Holm, 2007-2012 +.ll 70 +.lt 70 +.de HD \" header +'sp 1v +.tl 'S9(1)'Scheme 9 from Empty Space'S9(1)' +'sp 2v +.. +.de FO \" footer +'sp 2v +.tl 'S9 Interpreter'Page %'S9(1)' +'bp +.. +.de B +\fB\\$1\fP +.. +.de BR +\fB\\$1\fP\\$2 +.. +.de IR +\fI\\$1\fP\\$2 +.. +.de RB +\\$1\fB\\$2\\fP +.. +.de I +\fI\\$1\fP +.. +.de SH \" subheading +.ne 5 +.sp +.in 0i +.nf +\fB\\$1\fP +.fi +.in 1i +.. +.wh 0 HD \" traps for header +.wh -4 FO \" and footer +.nh +.sp +.SH NAME +.B "s9 +- Scheme Interpreter +.SH USAGE +.B "s9 [\-h?] [\-i name] [\-gnqv] [\-m size[m]] [\-f prog [args]] +.B " [\-l prog] [\-t count] [\-d image] [\-\- [args]] +.SH "DESCRIPTION +.B "Scheme 9 from Empty Space +is an interpreter for R4RS Scheme with some additional procedures +for accessing typical Unix system calls and Unix and Curses library +functions (if compiled-in). The +.B s9 +command starts the interpreter. +.SH "OPTIONS +.B "\-h or \-? +.in +4 +Display a brief summary of options. +.in -4 +.B "\-i name +.in +4 +Load alternative image file `\fIname\fP.image'. When no image file +can be found, try to load `\fIname\fP.scm'. The file will be searched +in the entire +.I S9FES_LIBRARY_PATH +(see below). When this option is used, it +.B must +be the first one of the s9 command. +.br +When `\-' is specified as \fIname\fP, no heap image will be loaded, +and the core library will be read from the source file `s9.scm'. +.in -4 +.B "\-d file +.in +4 +Dump heap image to +.I file +and exit. +.in -4 +.B "\-f program [arguments] +.in +4 +Run +.I program +and exit (implies \-q). When there are any +.IR arguments , +they are passed to the +.IR program , +where they can be extracted using the +.B command\-line +procedure. +.in -4 +.B "\-g +.in +4 +Print GC summaries (\fB\-gg\fP = more verbose). +.in -4 +.B "\-n +.in +4 +Do not load +.I $HOME/.s9fes/rc +file, if any. +.in -4 +.B "\-l program +.in +4 +Load +.I program +before entering the REPL or processing +.BR \-f +(may be repeated). +.in -4 +.B "\-m N[m] +.in +4 +Set memory limit to +.I N +kilo (or mega) nodes (\fB\-m 0\fP +means no limit; use with care!). +.in -4 +.B "\-q +.in +4 +Be quiet: skip banners and prompts, exit on errors. +.in -4 +.B "\-t count +.in +4 +Display +.I count +procedures at most in call traces. +.in -4 +.B \-v +.in +4 +Display version and exit. +.in -4 +.B "\-\- [argument ...] +.in +4 +Arguments following +.B \-\- +are not interpreted by S9fES, but passed to the +.B command\-line +procedure instead (requires the +.B unix +extension). +.in -4 +.SH "ONLINE HELP +When the interpreter is running and the default heap image is loaded, +just type \fB(help)\fP or \fB,h\fP to invoke the online help system. +When the online help system is not loaded, you will have to run the +following command first: +.sp +\fB(load\-from\-library "help.scm")\fP +.SH "META COMMANDS +In order to facilitate the invocation of frequently-used top-level +procedures, +.B s9 +provides the following "meta commands" (they work only when entered +directly at the +.B s9 +prompt): +.sp +.in +4 +.nf +\fB,a text\fP = (apropos "text") +\fB,h text\fP = (help "text") +\fB,l file\fP = (load\-from\-library "file") +\fB,q \fP = (sys:exit) +.fi +.in -4 +.sp +The arguments of \fB,a\fP and \fB,h\fP are optional. +.SH "ADDITIONS +S9fES supports nestable block comments of the form +.sp +.in +4 +.nf +\fB#|\fP \fIcomment ...\fP \fB|#\fP. +.fi +.in -4 +.sp +Square brackets may be used in the places of parentheses: +.sp +.in +4 +.nf +\fB(cond [(foo) (bar)])\fP. +.fi +.in -4 +.sp +The same type of bracket must be used on both ends of a list. +.sp +These S9fES procedures are not in R4RS: +.sp +.ne 3 +.B "(argv integer) ==> string | #f +.in +4 +Retrieve the value of the given command line argument. Return +\fB#f\fP, if there are less than \fIinteger\fP+1 arguments. +Arguments start at 0. +.in -4 +.sp +.ne 3 +.B "(bit\-op integer1 integer2 integer3 ...) ==> integer | #f +.in +4 +Implement a variety of bitwise operations. See the +.B bit\-op +help page for details. +.in -4 +.sp +.ne 3 +.B "(delete\-file string) ==> unspecific +.in +4 +Delete the file specified in the +.I string +argument. If the file does not exist +or cannot be deleted, report an error. +.in -4 +.sp +.ne 3 +.B "(dump\-image string) ==> unspecific +.in +4 +Write a heap image to the file given in the +.I string +argument. If the file already exists, report +an error. +.in -4 +.sp +.ne 3 +.B "(environ string) ==> string | #f +.in +4 +Retrieve the value of the given environment variable. Return +\fB#f\fP, if the variable is undefined. +.in -4 +.sp +.ne 3 +.B "(error string) ==> undefined +.br +.B "(error string object) ==> undefined +.in +4 +Print an error message of the form +.I "error: string: object +and terminate program execution. +.in -4 +.sp +.ne 3 +.B "(exponent real) ==> integer +.in +4 +Extract the exponent part from a real number. +.in -4 +.sp +.ne 3 +.B "(file\-exists? string) ==> boolean +.in +4 +Return +.B "#t +if the file specified in the +.I string +argument exists and otherwise \fB#f\fP. +.in -4 +.sp +.ne 4 +.B "(fold\-left proc base list ...) ==> object +.in +4 +Combine the elements of the +.IR list s +using +.IR proc . +Combine elements left-associatively. +.I Base +is the leftmost element. +.in -4 +.sp +.ne 4 +.B "(fold\-right proc base list ...) ==> object +.in +4 +Combine the elements of the +.IR list s +using +.IR proc . +Combine elements right-associatively. +.I Base +is the rightmost element. +.in -4 +.sp +.B "(gensym) ==> symbol +.br +.B "(gensym symbol) ==> symbol +.br +.B "(gensym string) ==> symbol +.in +4 +Return a fresh symbol. When a +.I string +or +.I symbol +argument is given, use it as prefix for the fresh symbol. +.in -4 +.sp +.ne 2 +.B "(load\-from\-library string) ==> unspecific +.in +4 +Attempt to +.B load +the file +.I string +from each directory of +.IR S9FES_LIBRARY_PATH . +.in -4 +.sp +.ne 2 +.B "(locate\-file string) ==> string | #f +.in +4 +Search for the file +.I string +in each directory of +.I S9FES_LIBRARY_PATH +in sequence. +When the file can be located, return its full path, else +return \fB#f\fP. +.in -4 +.sp +.ne 3 +.B "(macro\-expand object) ==> object +.br +.B "(macro\-expand\-1 object) ==> object +.in +4 +If +.I object +is a list resembling a macro application, return the expanded form, +else return the object. +.B Macro\-expand\-1 +expands macros only once while +.B macro\-expand +expands them recursively. +.in -4 +.sp +.ne 3 +.B "(mantissa real) ==> integer +.in +4 +Extract the mantissa part from a real number. +.in -4 +.sp +.ne 2 +.B "(print object ...) ==> unspecific +.in +4 +Write multiple +.IR object s +separated by spaces. +.in -4 +.sp +.ne 2 +.B "(require\-extension name ...) ==> unspecific +.in +4 +Require the named extensions to be compiled-in. Signal an error +if not all of the required extensions are present. +.in -4 +.sp +.ne 2 +.B "(reverse! list) ==> list +.in +4 +Reverse +.I list +destructively and return the reverse list. +.in -4 +.sp +.ne 2 +.B "(set\-input\-port! input\-port) ==> unspecific +.in +4 +Destructively set the current input port. +.in -4 +.sp +.ne 2 +.B "(set\-output\-port! output\-port) ==> unspecific +.in +4 +Destructively set the current output port. +.in -4 +.sp +.ne 2 +.B "(stats form) ==> form +.in +4 +Evaluate the given +.I form +and return a list containing its normal form plus a summary +of the resources used to compute that normal form: +.in +4 +.sp +.nf +- reduction steps +- conses allocated +- total nodes allocated +- garbage collections +.fi +.in -4 +.sp +Each resource count will be returned as a group of integers +representing ones, thousands, millions, etc. Note that +.I form +must be quoted or it will be evaluated before passing it to +.BR stats . +.in -4 +.sp +.ne 2 +.B "(symbols) ==> list +.in +4 +Return a list of all defined symbols. +.in -4 +.sp +.ne 3 +.B "(system string) ==> number +.in +4 +Run the given shell command and return its exit code. +.in -4 +.sp +.ne 3 +.B "(trace symbol ...) ==> list | #t +.br +.B "(trace #t) ==> list | #t +.in +4 +Trace the procedure or syntax object bound to the given +.IR symbol s. +When +.B #t +is passed to +.BR trace , +trace +.I all +procedures and syntax objects (\fIexpect lots of output!\fP). When no +arguments are passed to it, disable tracing. +.B Trace +returns the symbols that were being traced before its invocation. +.in -4 +.sp +.ne 3 +.B "(vector\-append vector ...) ==> vector +.in +4 +Return a fresh vector containing the concatenation of the given +vectors. +.in -4 +.sp +.ne 3 +.B "(vector\-copy vector) ==> vector +.br +.B "(vector\-copy vector integer) ==> vector +.br +.B "(vector\-copy vector integer1 integer2) ==> vector +.br +.B "(vector\-copy vector integer1 integer2 object) ==> vector +.in +4 +Return a copy of the given vector. When +.I integer1 +is specified, skip the given number of elements. When +.I integer2 +is also specified, copy elements from +.I integer1 +up to, but not including, +.IR integer2 . +When +.I integer2 +exceeds the size of the original vector, add unspecific slots to the +copy. When an +.I object +argument is given, fill extra slots with that argument. +.in -4 +.sp +.ne 3 +.B "(void) ==> unspecific +.in +4 +Return an unspecific value. +.in -4 +.sp +Refer to the help pages for descriptions of the Scheme 9 extension +procedures. +.SH "SPECIAL VARIABLES +These variables are predefined in the dynamic top-level scope of the +interpreter. +.sp +.ne 2 +.B "** (form) +.in +4 +The normal form of the expression most recently evaluated at the +top level. +.in -4 +.ne 2 +.B "*extensions* (list of symbols) +.in +4 +Compiled-in extensions. +.in -4 +.ne 2 +.B "*library\-path* (string) +.in +4 +A verbatim copy of the +.I S9FES_LIBRARY_PATH +environment variable (see below). +.in -4 +.ne 2 +.B "*loading* (boolean) +.in +4 +Set to +.B #t +when \fBload\fPing a file, else \fB#f\fP. +.in -4 +.SH "MACROS +A macro is a procedure that is applied to its unevaluated arguments. +The macro application is replaced with the value returned by the procedure. +This happens before the expression containing the macro application is +evaluated, so a macro +.I rewrites +its own application: +.sp +.ne 2 +.nf +(define\-syntax (when p . c) + `(if ,p (begin ,@c))) +(macro\-expand '(when (= 1 1) (display "true") (newline) #t)) + ==> (if (= 1 1) + (begin (display "true") + (newline) + #t)) +(when (= 1 1) 1 2 3) ==> 3 +.fi +.sp +The +.B define\-syntax +form introduces a new macro: +.sp +.ne 3 +.B "(define\-syntax name procedure) ==> unspecific +.br +.B "(define\-syntax (name args ...) body) ==> unspecific +.sp +Both of these forms introduce the keyword +.I name +and bind it to a procedure. The first form requires the +second argument to be a procedure. Like in +.B define +forms the second variant implies a procedure definition. +.sp +Macros may contain applications of macros that were defined earlier. +Macros may not recurse directly, but they may implement recursion +internally using +.B letrec +or by rewriting their own applications. The following macro, +for example, does +.I not +work, because +.I d +is undefined in the body of +.IR d : +.sp +.B "(define\-syntax (d x) (and (pair? x) (d (cdr x)))) ; wrong" +.sp +The following version +.I does +work, though: +.sp +.B "(define\-syntax (d x) (and (pair? x) `(d ,(cdr x)))) ; OK" +.sp +The body of +.B define\-syntax +may be a +.B syntax\-rules +transformer, as described in R4RS, if the +.B syntax\-rules +extension has been loaded. +.SH "TECHNICAL DETAILS +S9fES is a tree-walking interpreter using deep binding and hashed +environments. It employs an extremely reliable[1] constant-space mark +and sweep garbage collector with in-situ string and vector pool +compaction. Memory pools grow on demand. The interpreter uses +arbitrary-precision integer arithmetics and (optional) decimal-based +real number arithmetics. +.SH "INTERPRETER START-UP +When the +.B s9 +interpreter is started, the following steps will be performed in this +order: +.sp +Load library. +.in +4 +The interpreter searches its library path (either built-in or specified +in the +.I S9FES_LIBRARY_PATH +environment variable) +for a heap image file or the library source code. The heap image file +is the name of the interpreter with a +.I .image +suffix appended. An alternative name can be specified with the +.B \-i +option (see +.BR OPTIONS ). +The default library source code is named +.IR s9.scm . +The first directory containing either a heap image or the library +source code is used. When the directory contains both an image and +the library sources, the image is loaded. +.in -4 +.sp +Initialize extensions. +.in +4 +Any extensions compiled into the interpreter are initialized by calling +the nullary procedure +.B ext:ext +(where +.B ext +is the name of the extension). The procedures are optional. The first +`extension' being initialized is +.B S9 +itself, so when a procedure named +.B s9:s9 +exists, it will be called at this point. +.in -4 +.sp +Evaluate command line options. +.in +4 +When a +.I "\-l file +option is found, the program contained in the given file will be +.BR load ed. +When a +.I "\-f file args +option is found, the program contained in the file will be run and then +S9 will exit. +.I Args +will be passed to the program. +.in -4 +.sp +Load rc file. +.in +4 +If an `rc file' (\fI$HOME/.s9fes/rc\fP) exists, it will be loaded +at this point as if its name was passed to the +.B load +procedure. (Unless the +.I \-n +option was specified.) +.in -4 +.sp +.ne 2 +Enter REPL. +.in +4 +Interactive mode is only entered, when no +.I \-f +option was specified. +.in -4 +.SH "ALLOCATION STRATEGY +The S9fES memory pool grows exponentially until the memory limit +its reached. When the limit is reached, the current computation +is aborted. A memory limit can be specified using the +.B \-m +command line option. The limit is specified in units of 1024 +nodes (or in units of 1024*1024 nodes by appending an +.B m +suffix). +.br +Note that computations may abort +.I before +the limit is reached due to the way the pool grows. Use the +.B \-g +command line option to experiment with pool sizes. +.br +Specifying a limit of zero disables the memory limit completely +and the interpreter will allocate as much memory as it can get. +This option should be used with care. +.SH "LIMITATIONS +These parts of R4RS are not implemented: +.sp +I/O: +.B char\-ready? +(this is in the +.B sys\-unix +extension). +.br +Transcripts: +.BR transcript\-off , +.BR transcript\-on . +.br +Rational and complex numbers and related procedures. +.SH "BUGS +You may not quasiquote +.B quasiquote +unless in +.BR unquote +(e.g.: +.B ``x +does not work, but +.B `,`x +does). +.br +.B Syntax\-rules +is not fully hygienic. +.br +Multiple +.BR call/cc 's +in the arguments of the same +.B lambda +(or derived binding syntax, such as +.BR let ) +will break the evaluator. +.SH "FILES +.ne 2 +.B $HOME/.s9fes/rc +.in +4 +If present, this file is +.BR load ed +when the interpreter starts in interactive mode. +.in -4 +.ne 2 +.B @DATADIR@ +.in +4 +The S9fES procedure library (source code). +.in -4 +.ne 2 +.B @LIBDIR@/contrib +.in +4 +Contributions to the procedure library (source code). +.in -4 +.ne 2 +.B @LIBDIR@/s9.image +.in +4 +The interpreter heap image. +.in -4 +.ne 2 +.B *.scm +.in +4 +Scheme source code. +.in -4 +.SH "ENVIRONMENT +.B S9FES_LIBRARY_PATH +.in +4 +A colon-separated list of directories which will be searched for +the s9 library when the interpreter is launched. The same directories +will be searched by the +.B locate\-file +procedure. +.br +Default: +.I \&.:~/.s9fes\%:\%@LIBDIR@\%:\%@DATADIR@\% +.in -4 +.SH "SIGNALS +These work only if POSIX signal handling was enabled at compile time. +.sp +.ne 3 +.B "SIGINT +.in +4 +Abort input or terminate program execution. +.in -4 +.ne 3 +.B "SIGQUIT +.in +4 +Terminate the interpreter process (emergency exit). +.in -4 +.B "SIGTERM +.in +4 +Silently terminate the interpreter process. +.in -4 +.SH "FOOTNOTES +.B [1] +See +.I comp.lang.scheme +Usenet message +.in +4 +.I " +.br +(Thu, 27 Aug 2009 13:27:42 \-0400) and its follow-ups. +.in -4 +.SH "REFERENCES +.ne 3 +The Revised^4 Report on the Algorithmic Language Scheme. +.in +4 +.B "http://www\-swiss.ai.mit.edu/~jaffer/r4rs_toc.html +.in -4 +.sp +.ne 3 +Scheme 9 from Empty Space -- A Guide to Implementing Scheme in C. +.in +4 +.B "Available at Lulu.com, see http://www.t3x.org +.in -4 +.SH AUTHOR +Nils M Holm debian/control0000664000000000000000000000202412266202611010567 0ustar Source: scheme9 Section: lisp Priority: extra Maintainer: Barak A. Pearlmutter Build-Depends: debhelper (>= 9), libncurses5-dev | libncurses-dev | ncurses-dev, libx11-dev Standards-Version: 3.9.5 Homepage: http://t3x.org/ Vcs-Git: git://anonscm.debian.org/collab-maint/scheme9.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/scheme9.git Package: scheme9 Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: Scheme 9 from Empty Space R4RS Scheme interpreter Scheme 9 from Empty Space is an interpreter for a broad subset of R4RS Scheme, and runs in many popular environments, including Linux, *BSD, the unmentionable horror, and Plan 9. The S9fES code strives to be simple and comprehensible. It is particularly interesting to people who want to (a) try Scheme without having to jump through too many hoops (S9fES is very portable); or (b) study the implementation of Scheme (in a language other than Scheme). A free online textbook describing the system is also available. debian/changelog0000664000000000000000000002711412266202611011045 0ustar scheme9 (2013.11.26-1) unstable; urgency=medium * New Upstream Version * debian/control: - Bump standards version (no changes required) - Update debian repo urls * Update quilt patches - forward-port patches (tiny change to comment in context of diff) - gbp-pq import/export - add patch for fread status -- Barak A. Pearlmutter Fri, 17 Jan 2014 10:26:40 +0000 scheme9 (2013.01.09-2) unstable; urgency=low * Add s9 prefix to names of generically named binaries: - /usr/bin/advgen to /usr/bin/s9advgen - /usr/bin/c2html to /usr/bin/s9c2html (closes: #697901) - /usr/bin/cols to /usr/bin/s9cols - /usr/bin/dupes to /usr/bin/s9dupes - /usr/bin/edoc to /usr/bin/s9edoc - /usr/bin/htmlify to /usr/bin/s9htmlify - /usr/bin/scm2html to /usr/bin/s9scm2html - /usr/bin/scmpp to /usr/bin/s9scmpp - /usr/bin/soccat to /usr/bin/s9soccat -- Barak A. Pearlmutter Tue, 15 Jan 2013 09:06:11 +0000 scheme9 (2013.01.09-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Mon, 14 Jan 2013 15:05:02 +0000 scheme9 (2012.12.17-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Mon, 24 Dec 2012 09:56:02 +0000 scheme9 (2012.11.30-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Mon, 03 Dec 2012 15:59:35 +0000 scheme9 (2012.11.01-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Mon, 05 Nov 2012 14:05:18 +0000 scheme9 (2012.07.10-2) unstable; urgency=low * quilt patch for Makefile to not disregard passed CFLAGS, as needed for, e.g., hardened builds (closes: #681488) -- Barak A. Pearlmutter Fri, 13 Jul 2012 19:56:24 +0100 scheme9 (2012.07.10-1) unstable; urgency=low * New Upstream Version * bump standards version (debian/control) * dh 9 (debian/compat, debian/control) * update quilt patches * patch for library used in hardened build -- Barak A. Pearlmutter Thu, 12 Jul 2012 12:00:13 +0100 scheme9 (2010.11.13-2) unstable; urgency=low * curses! foiled again. (closes: #635869) -- Barak A. Pearlmutter Fri, 29 Jul 2011 13:46:35 +0100 scheme9 (2010.11.13-1) unstable; urgency=low * bump standards version (debian/control) * dh --parallel (debian/rules) * dh 8 (debian/compat, debian/control) * new upstream version * tiny man page tweaks * quilt patches: - migrate some modifications (all but s9(1) man page) - parallel safe tweaks to Makefile - test script search path and parallelisation - silence minor GCC warning -- Barak A. Pearlmutter Thu, 28 Jul 2011 15:23:07 +0100 scheme9 (2009.09.06-3) unstable; urgency=low * bump deb standards * Switch to dpkg-source 3.0 (quilt) format -- Barak A. Pearlmutter Thu, 25 Mar 2010 18:56:41 +0000 scheme9 (2009.09.06-2) unstable; urgency=low * Default definition for MAXPATHLEN (needed by Hurd port) * Tweak two tiny typos -- Barak A. Pearlmutter Wed, 20 Jan 2010 18:16:13 +0100 scheme9 (2009.09.06-1) unstable; urgency=low * New Upstream Version * rev deb std -- Barak A. Pearlmutter Tue, 08 Sep 2009 14:02:52 -0400 scheme9 (2009.08.14-2) unstable; urgency=low * Deal w/ missing -Dunix for arch powerpc -- Barak A. Pearlmutter Mon, 24 Aug 2009 19:32:46 +0200 scheme9 (2009.08.14-1) unstable; urgency=low * New Upstream Version * fix missing -Dunix in Makefile for sc.o -- Barak A. Pearlmutter Tue, 18 Aug 2009 08:52:45 +0200 scheme9 (2009.08.11-2) unstable; urgency=low * s9sc, graphical system now included, needs X11 to build (closes: #541720) -- Barak A. Pearlmutter Sun, 16 Aug 2009 08:41:20 +0200 scheme9 (2009.08.11-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Fri, 14 Aug 2009 20:18:29 +0200 scheme9 (2009.07.25-1) unstable; urgency=low * New Upstream Version * fix fatal s9sc typo in new upstream Makefile * squash some compiler warnings in building s9sc -- Barak A. Pearlmutter Sat, 25 Jul 2009 17:14:28 +0200 scheme9 (2009.07.08-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Wed, 08 Jul 2009 20:35:40 +0100 scheme9 (2009.07.05-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Sun, 05 Jul 2009 09:47:06 +0200 scheme9 (2009.07.04-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Sat, 04 Jul 2009 11:37:29 +0200 scheme9 (2009.07.01-1) unstable; urgency=low * rev deb std * fix minor Makefile bug in processing manpage .in files * quash s9(1) warning via aggressive soft hyphenation of default search path * distinguish unicode hyphen and ascii dash in man pages * New Upstream Version * upstream patch -- Barak A. Pearlmutter Wed, 01 Jul 2009 21:15:40 +0200 scheme9 (2009.06.26-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Sat, 27 Jun 2009 21:50:12 +0100 scheme9 (2009.06.25-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Thu, 25 Jun 2009 18:11:11 +0200 scheme9 (2009.06.15-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Mon, 15 Jun 2009 15:58:45 +0100 scheme9 (2009.06.08-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Mon, 08 Jun 2009 15:44:54 +0100 scheme9 (2009.06.07-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Sun, 07 Jun 2009 14:12:53 +0100 scheme9 (2009.06.06-1) unstable; urgency=low * New Upstream Version * work around s2 = 0.0 reader bug, add test case for this * missing prototype for forward ref of bignum_abs() in s9.c * merge upstream patch for s2 reader bug -- Barak A. Pearlmutter Sun, 07 Jun 2009 08:34:33 +0100 scheme9 (2009.06.05-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Fri, 05 Jun 2009 13:15:04 +0100 scheme9 (2009.06.04-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Thu, 04 Jun 2009 13:51:28 +0100 scheme9 (2009.06.03-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Wed, 03 Jun 2009 15:23:39 +0100 scheme9 (2009.06.02-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Tue, 02 Jun 2009 13:34:35 +0100 scheme9 (2009.06.01-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Mon, 01 Jun 2009 15:17:00 +0100 scheme9 (2009.05.31-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Sun, 31 May 2009 09:49:32 +0100 scheme9 (2009.05.28-2) unstable; urgency=low * Enable compiler warnings and optimization * Flush unused variable x in print_real() * Be consistent about 2nd arg to make_real, for 64-bit machines (closes: #530864) -- Barak A. Pearlmutter Thu, 28 May 2009 14:44:50 +0100 scheme9 (2009.05.28-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Thu, 28 May 2009 10:16:51 +0100 scheme9 (2009.05.26-1) unstable; urgency=low * New Upstream Version * Avoid gratuitous differences with upstream Makefile -- Barak A. Pearlmutter Tue, 26 May 2009 15:16:20 +0100 scheme9 (2009.05.23-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Sat, 23 May 2009 19:38:30 +0100 scheme9 (2009.05.22-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Fri, 22 May 2009 15:38:03 +0100 scheme9 (2009.05.20-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Wed, 20 May 2009 11:25:29 +0100 scheme9 (2009.05.17-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Sun, 17 May 2009 10:24:33 +0100 scheme9 (2009.05.16-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Sat, 16 May 2009 16:30:47 +0100 scheme9 (2009.05.14-1) unstable; urgency=low * New Upstream Version * Makefile portability and correctness tweaks -- Barak A. Pearlmutter Thu, 14 May 2009 10:20:23 +0100 scheme9 (2009.05.13-2) unstable; urgency=low * Use portable automatic variables in Makefile where possible * Modify target s9e.scm in Makefile -- Barak A. Pearlmutter Wed, 13 May 2009 12:38:11 +0100 scheme9 (2009.05.13-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Wed, 13 May 2009 10:23:20 +0100 scheme9 (2009.05.12-1) unstable; urgency=low * New Upstream Version * modularize cpp defs in Makefile allowing -Dunix on unix.c, for powerpc -- Barak A. Pearlmutter Tue, 12 May 2009 11:58:52 +0100 scheme9 (2009.05.11-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Mon, 11 May 2009 12:20:00 +0100 scheme9 (2009.05.10-1) unstable; urgency=low * New Upstream Version * reorder default library search path -- Barak A. Pearlmutter Mon, 11 May 2009 08:51:11 +0100 scheme9 (2009.05.09-1) unstable; urgency=low * New Upstream Version -- Barak A. Pearlmutter Sun, 10 May 2009 15:51:23 +0100 scheme9 (2009.05.07-1) unstable; urgency=low * New Upstream Version * more comprehensive debian/watch -- Barak A. Pearlmutter Thu, 07 May 2009 13:24:50 +0100 scheme9 (2009.05.06-1) unstable; urgency=low * New upstream version * tweaks for Debian powerpc -- Barak A. Pearlmutter Wed, 06 May 2009 15:41:50 +0100 scheme9 (2009.05.05-1) unstable; urgency=low * add debian/watch file for uscan, with version mangling * New upstream version -- Barak A. Pearlmutter Tue, 05 May 2009 22:13:35 +0100 scheme9 (2009.05.03-3) unstable; urgency=low * fix "cannot locate read-line.scm" with Makefile lib path (closes: #526946) -- Barak A. Pearlmutter Mon, 04 May 2009 19:29:43 +0100 scheme9 (2009.05.03-2) unstable; urgency=low * remove debian-specific ./configure patch; hotwire debian/rules instead -- Barak A. Pearlmutter Mon, 04 May 2009 17:48:42 +0100 scheme9 (2009.05.03-1) unstable; urgency=low * New upstream version -- Barak A. Pearlmutter Mon, 04 May 2009 11:34:27 +0100 scheme9 (2009.04.10-2) unstable; urgency=low * Use flashy new dh override_xxx mechanism in debian/rules -- Barak A. Pearlmutter Wed, 15 Apr 2009 12:09:39 +0100 scheme9 (2009.04.10-1) unstable; urgency=low * New upstream version -- Barak A. Pearlmutter Wed, 15 Apr 2009 11:42:07 +0100 scheme9 (2009.03.30-1) unstable; urgency=low * New upstream version (includes upstream changelog) * rev deb std * section: lisp -- Barak A. Pearlmutter Fri, 03 Apr 2009 10:13:48 +0100 scheme9 (2009.03.22-1) unstable; urgency=low * New upstream version -- Barak A. Pearlmutter Tue, 24 Mar 2009 21:38:50 +0000 scheme9 (2009.02.25-1) unstable; urgency=low * New upstream version -- Barak A. Pearlmutter Thu, 26 Feb 2009 22:18:07 +0000 scheme9 (2009.02.09-1) unstable; urgency=low * Initial release (Closes: #516898) -- Barak A. Pearlmutter Mon, 23 Feb 2009 09:28:11 +0000