--- scheme9-2009.05.07.orig/.gitignore +++ scheme9-2009.05.07/.gitignore @@ -0,0 +1,13 @@ +*.o +/debian/*.debhelper +/debian/*.log +/debian/*.substvars +/debian/files +/debian/scheme9 +/s9 +/s9.1 +/s9.image +/s9e +/s9e.image +/s9e.scm +s9e.1 --- scheme9-2009.05.07.orig/s9.1.in +++ scheme9-2009.05.07/s9.1.in @@ -0,0 +1,528 @@ +.\" S9(1) Manual Page +.\" By Nils M Holm, 2007, 2008, 2009 +.TH s9 1 2009-02-24 Debian Scheme 9 From Empty Space +.ll 70 +.lt 70 +.ds N "pi +.de HD \" Header +'sp 1v +.tl 'S9(1)'Scheme 9 from Empty Space'S9(1)' +'sp 2v +.. +.de FO \" Footer +'sp 3v +.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 \" subheader macro +.ne 5 +.sp +.in 0i +.nf +\fB\\$1\fP +.fi +.in 1i +.. +.de ST \" start a table +.in 1i +.nf +.. +.de ET \" end a table +.fi +.in 0 +.. +.wh 0 HD \" traps for header +.wh -5 FO \" and footer +.nh \" disable hyphenation +.sp +.SH NAME +.B "s9 +- Scheme Interpreter +.SH USAGE +.B "s9 [-h?] [-gnqv] [-m size[m]] [-f program] [-d image] [-i] +.SH "DESCRIPTION +.B "Scheme 9 from Empty Space +is an interpreter for a broad subset of +R4RS Scheme. The +.B s9 +command starts the interpreter. +.SH "OPTIONS +.B "-h or -? +.in +4 +Display a brief summary of options. +.in -4 +.B "-d file +.in +4 +Dump heap image to +.I file +and exit. +.in -4 +.B "-f program +.in +4 +Run +.I program +and exit (may be repeated, implies -q). +.in -4 +.B "-g +.in +4 +Print GC summaries (\fB-gg\fP = more verbose). +.in -4 +.B "-i +.in +4 +Enter interactive mode (after +.BR -f ). +.in -4 +.B "-n +.in +4 +Do not load +.I $HOME/.s9fes/rc +file, if any. +.in -4 +.B "-m N[m] +.in +4 +Set memory limit to +.I N +kilo (or mega) nodes. +.in -4 +.B "-q +.in +4 +Be quiet: skip banners and prompts, exit on errors. +.in -4 +.B -v +.in +4 +Display version and exit. +.in -4 +.B -- +.in +4 +Arguments following +.B -- +are not interpreted by S9fES. +.in -4 +.SH "ONLINE HELP +When the interpreter is running and the default heap image is loaded, +just type +.sp +\fB(help)\fP +.sp +to invoke the online help system. When using a custom heap image that +does not contain the online help system, you will have to +run the following command first: +.sp +\fB(load-from-library "help.scm")\fP +.SH "TECHNICAL DETAILS +S9fES is a tree-walking interpreter using deep binding and hashed +environments. It employs a constant-space mark and sweep garbage +collector with in-situ string and vector pool compaction. Memory +pools grow on demand. +.br +The interpreter uses bignum integer arithmetics exclusively. +It provides both low-level macros (see +.B MACROS +below) and \fBdefine-syntax\fP/\fBsyntax-rules\fP. +.SH "ADDITIONS +These S9fES procedures are not in R4RS: +.sp +.ne 3 +.B "(delete-file string) ==> unspecific +.in +4 +Delete the file specifed in the +.I string +argument. If the file does not exist +or cannot be deleted, report an error. +.in -4 +.br +.ne 3 +.B "(expand-quasiquote form) ==> expanded-form +.in +4 +If +.I form +is a quasiquoted expression, rewrite it as an equivalent expression +that does not use quasiquotation. +.in -4 +.br +.ne 3 +.B "(expand-macro form) ==> expanded-form +.in +4 +If +.I form +applies a macro, return the expanded form, else return the form. +.in -4 +.br +.ne 3 +.B "(file-exists? string) ==> boolean +.in +4 +Return +.B "#t +if the file specifed in the +.I string +argument exists and otherwise \fB#f\fP. +.in -4 +.br +.ne 4 +.B "(fold-left proc base list ...) ==> form +.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 +.br +.ne 4 +.B "(fold-right proc base list ...) ==> form +.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 +.br +.B "(gensym) ==> symbol +.br +.B "(gensym string) ==> symbol +.in +4 +Return a fresh symbol. When a +.I string +argument is given, use it as prefix for the fresh symbol. +.in -4 +.br +.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 +.br +.ne 2 +.B "(locate-file string) ==> string | #f +.in +4 +Search for the file +.I string +in each directory of +.B S9FES_LIBRARY_PATH +in sequence. +When the file can be located, return its full path, else +return \fB#f\fP. +.in -4 +.br +.ne 2 +.B "(print form ...) ==> unspecific +.in +4 +Write multiple +.IR form s +separated by spaces. +.in -4 +.br +.ne 2 +.B "(set-input-port! input-port) ==> unspecific +.in +4 +Destructively set the current input port. +.in -4 +.br +.ne 2 +.B "(set-output-port! output-port) ==> unspecific +.in +4 +Destructively set the current output port. +.in -4 +.br +.ne 2 +.B "(stats form) ==> normal form +.in +4 +Evaluate the given +.I form +and return its normal form. In addition, print the number +of reduction steps, nodes allocated, and garbage collections +performed during evaluation. Note that +.I form +must be quoted. +.in -4 +.br +.ne 2 +.B "(symbols) ==> list +.in +4 +Return a list of all defined symbols. +.in -4 +.br +.ne 3 +.B "(trace symbol ...) ==> list | #t +.br +.B "(trace #t) ==> list | #t +.in +4 +Trace the procedure or syntax bound to the given +.IR symbols . +When +.B #t +is passed to +.BR trace , +trace +.I all +procedures and syntax (\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 +.br +.ne 3 +.B "(void) ==> unspecific +.in +4 +Return an unspecific value. +.in -4 +.br +.ne 3 +.B "(wrong string form) ==> bottom +.in +4 +Print an error message of the form +.I "error: string: form +and terminate program execution. +.I Form +may be omitted. +.in -4 +.sp +Redefinition of these procedures is safe except for +.BR expand-quasiquote +and +.BR wrong . +.SH "VARIABLES +These variables are pre-defined 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 S9fES 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-macro (when p . c) + `(if ,p (begin ,@c))) +(expand-macro '(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-macro +form introduces a new macro: +.sp +.ne 3 +.B "(define-macro name procedure) ==> unspecific +.br +.B "(define-macro (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-macro (d x) (and (pair? x) (d (cdr x)))) ; wrong" +.sp +The following version +.I does +work, though: +.sp +.B "(define-macro (d x) (and (pair? x) `(d ,(cdr x)))) ; OK" +.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 memory limit of zero disables the memory limit 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 +Control: +.BR call-with-current-continuation . +.br +I/O: +.BR char-ready? . +.br +Transcripts: +.BR transcript-off , +.BR transcript-on . +.br +Numeric tower: rational, float, complex numbers. +.br +Numeric syntax and procedures: +.BR #e , +.BR #i , +.BR / , +.BR acos , +.BR angle , +.BR asin , +.BR atan , +.BR ceiling , +.BR complex? , +.BR cos , +.BR denominator , +.BR exact->inexact , +.BR exact? , +.BR exp , +.BR floor , +.BR imag-part , +.BR inexact->exact , +.BR inexact? , +.BR log , +.BR magnitude , +.BR make-polar , +.BR make-rectangular , +.BR numerator , +.BR rational , +.BR rationalize , +.BR real-part , +.BR real? , +.BR round , +.BR sin , +.BR sqrt, +.BR tan , +.BR truncate . +.SH "BUGS +Nested quasiquotation is currently unsupported. +.SH "FILES +.ne 2 +.B $HOME/.s9fes/rc +.in +4 +If present, this file is +.BR load ed +when the interpreter starts up. +.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 search by the +.B locate-file +procedure. +.br +Default: +.I \&.:~/.s9fes:@LIBDIR@:@DATADIR@:@LIBDIR@/contrib +.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 +.SH "REFERENCES +.ne 3 +.B "http://www-swiss.ai.mit.edu/~jaffer/r4rs_toc.html +.in +4 +The Revised^4 Report on the Algorithmic Language Scheme. +.in -4 +.sp +.ne 3 +.B "http://www.lulu.com/content/1010408 +.in +4 +Scheme 9 from Empty Space -- A Guide to Implementing Scheme in C. +.in -4 +.SH AUTHOR +Nils M Holm < nmh at t3x.org > --- scheme9-2009.05.07.orig/Makefile +++ scheme9-2009.05.07/Makefile @@ -2,7 +2,7 @@ # Nils M Holm, 2007,2008,2009 # Change at least this line: -PREFIX= /u +#PREFIX= /u VERSION= 20090507 @@ -12,11 +12,19 @@ # Override default compiler and flags #CC= gcc -#CFLAGS= -g -Wall -ansi -pedantic -O +CFLAGS= -g -Wall -ansi -pedantic -O -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=$(bindir) +LIBDIR=$(libdir)/s9fes +DATADIR=$(datadir)/s9fes +MANDIR=$(mandir)/man1 # BITS_PER_WORD_64 use 64-bit bignum arithmetics # NO_SIGNALS disable POSIX signal handlers @@ -25,15 +33,15 @@ # DEFAULT_LIBRARY_PATH default search path for LOCATE-FILE DEFS= -Dunix \ - -DDEFAULT_LIBRARY_PATH="\".:~/s9fes:$(LIBDIR):$(LIBDIR)/contrib\"" + -DDEFAULT_LIBRARY_PATH="\".:~/s9fes:$(LIBDIR):$(DATADIR):$(LIBDIR)/contrib\"" EXTINI= unix_init() EXTOBJ= unix.o EXTDEF= -DIMAGEFILE="\"s9e.image\"" -DLIBRARY="\"s9e.scm\"" -all: s9 s9.image s9.1.gz # all-s9e +all: s9 s9.image s9.1 all-s9e -all-s9e: s9e s9e.image s9e.1.gz +all-s9e: s9e s9e.image s9e.1 s9: s9.c s9.h $(CC) $(CFLAGS) $(DEFS) -o $@ s9.c @@ -42,27 +50,29 @@ rm -f $@ && env S9FES_LIBRARY_PATH=.:lib ./s9 -n $(EXTRA_STUFF) -d $@ s9e: s9e.o $(EXTOBJ) - $(CC) $(CFLAGS) -o $@ s9e.o $(EXTOBJ) + $(CC) $(CFLAGS) -o $@ $^ s9e.scm: s9.scm ln -s s9.scm $@ +s9e.o: s9.h s9e.o: s9.c $(CC) $(CFLAGS) $(DEFS) -I . -DEXTENSIONS="$(EXTINI)" $(EXTDEF) \ - -o $@ -c s9.c + -o $@ -c $< unix.o: ext/unix.c - $(CC) $(CFLAGS) -I . -o unix.o -c ext/unix.c + $(CC) $(CFLAGS) $(DEFS) -I . -c $< s9e.image: s9e s9e.scm ext/system.scm rm -f $@ && env S9FES_LIBRARY_PATH=.:lib \ ./s9e -n -f ext/system.scm $(EXTRA_STUFF) -d $@ -s9.1.gz: s9.1 - sed -e "s,@LIBDIR@,$(LIBDIR)," <$? |gzip -9 >$@ +%.1: %.1.in + sed -e "s,@LIBDIR@,$(LIBDIR)," < $< \ + | sed -e "s,@DATADIR@,$(DATADIR)," > $@ -s9e.1.gz: s9e.1 - sed -e "s,@LIBDIR@,$(LIBDIR)," <$? |gzip -9 >$@ +%.gz: % + gzip -9 <$< >$@ lint: gcc -g -Wall -ansi -pedantic s9.c && rm a.out @@ -75,28 +85,31 @@ # old version of install(1) may need -c #C=-c -install: s9 s9.scm s9.image s9.1.gz - install -d -m 0755 $(BINDIR) - install -d -m 0755 $(LIBDIR) - install -d -m 0755 $(LIBDIR)/contrib - install -d -m 0755 $(LIBDIR)/help - install -d -m 0755 $(MANDIR) - install $C -m 0755 s9 $(BINDIR) - strip $(BINDIR)/s9 - install $C -m 0644 s9.scm $(LIBDIR) - install $C -m 0644 s9.image $(LIBDIR) - install $C -m 0644 lib/* $(LIBDIR) - install $C -m 0644 contrib/* $(LIBDIR)/contrib - install $C -m 0644 s9.1.gz $(MANDIR) - install $C -m 0644 help/* $(LIBDIR)/help - -install-s9e: install s9e s9e.scm s9e.image s9e.1.gz - install $C -m 0755 s9e $(BINDIR) - strip $(BINDIR)/s9e - install $C -m 0644 s9e.scm $(LIBDIR)/s9e.scm - install $C -m 0644 s9e.image $(LIBDIR) - install $C -m 0644 ext/*.scm $(LIBDIR) - install $C -m 0644 s9e.1.gz $(MANDIR) + +install: install-s9 install-s9e + +install-s9: s9 s9.scm s9.image s9.1 + install -d -m 0755 $(DESTDIR)$(BINDIR) + install -d -m 0755 $(DESTDIR)$(LIBDIR) + install -d -m 0755 $(DESTDIR)$(DATADIR) + install -d -m 0755 $(DESTDIR)$(DATADIR)/help + install -d -m 0755 $(DESTDIR)$(LIBDIR)/contrib + install $C -m 0755 s9 $(DESTDIR)$(BINDIR)/ + install $C -m 0644 s9.scm $(DESTDIR)$(DATADIR)/ + install $C -m 0644 s9.image $(DESTDIR)$(LIBDIR)/ + install $C -m 0644 lib/* $(DESTDIR)$(DATADIR)/ + install $C -m 0644 contrib/* $(DESTDIR)$(LIBDIR)/contrib/ + install $C -m 0644 help/* $(DESTDIR)$(DATADIR)/help/ + +install-s9e: install-s9 s9e s9e.scm s9e.image + install -d -m 0755 $(DESTDIR)$(BINDIR) + install -d -m 0755 $(DESTDIR)$(LIBDIR) + install -d -m 0755 $(DESTDIR)$(DATADIR) + install -d -m 0755 $(DESTDIR)$(DATADIR)/help + install $C -m 0755 s9e $(DESTDIR)$(BINDIR)/ + install $C -m 0644 s9e.scm $(DESTDIR)$(DATADIR)/ + install $C -m 0644 s9e.image $(DESTDIR)$(LIBDIR)/ + install $C -m 0644 ext/*.scm $(DESTDIR)$(DATADIR)/ deinstall: rm $(LIBDIR)/contrib/* && rmdir $(LIBDIR)/contrib @@ -109,6 +122,7 @@ -rmdir $(MANDIR) clean: + rm -f s9.1 s9e.1 rm -f s9 s9e s9e.scm s9.image s9e.image s9.1.gz s9e.1.gz s9.1.txt \ *.o *.core core s9.9.tgz s9fes-$(VERSION).tar.gz __tmp[12]__ \ __testfile__ rpp CHANGES.html LICENSE.html README.html \ --- scheme9-2009.05.07.orig/s9e.1.in +++ scheme9-2009.05.07/s9e.1.in @@ -0,0 +1,845 @@ +.\" S9E(1) Manual Page +.\" Nils M Holm, 2007, 2008 +.TH s9e 1 2009-02-24 Debian Scheme 9 From Empty Space + unix extensions +.ll 70 +.lt 70 +.ds N "pi +.de HD \" Header +'sp 1v +.tl 'S9E(1)'Scheme 9 from Empty Space'S9E(1)' +'sp 2v +.. +.de FO \" Footer +'sp 3v +.tl 'S9E Interpreter'Page %'S9E(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 \" subheader macro +.ne 5 +.sp +.in 0i +.nf +\fB\\$1\fP +.fi +.in 1i +.. +.de ST \" start a table +.in 1i +.nf +.. +.de ET \" end a table +.fi +.in 0 +.. +.wh 0 HD \" traps for header +.wh -5 FO \" and footer +.nh \" disable hyphenation +.sp +.SH NAME +.B "s9e +- Extended Scheme Interpreter +.SH USAGE +.B "s9e [-h?] [-gnqv] [-m size[m]] [-f program] [-d image] [-i] +.B " [-- argument ...] +.SH "DESCRIPTION +.B "Scheme 9 from Empty Space +is an interpreter for a broad subset of +R4RS Scheme. The +.B s9e +command starts the extended interpreter. The extended interpreter +defines some functions that are not defined in the Scheme Reports, +but may prove useful in ``real-world'' programming. +.SH "EXTENDED PRIMITIVE FUNCTIONS +.sp +.B "Do not use these primitives directly. Use the user-level procedures +.B "outlined in the next section instead. +.sp +Procedures typically indicate failure by returning +.BR #f . +Procedures that would not otherwise return a more meaningful value +return +.B #t +in case of success. When a procedure fails, the resulting Unix error +number can be retrieved by calling +.B unix:errno +(or +.BR errno ). +.sp +.ne 3 +.B "(unix:chdir string) ==> boolean +.in +4 +Change the current working directory to +.IR string . +.in -4 +.br +.ne 3 +.B "(unix:chmod string integer) ==> boolean +.in +4 +Change the access bits of the file +.I string +to the mode +.IR integer . +.in -4 +.br +.ne 3 +.B "(unix:chown string integer1 integer2) ==> boolean +.in +4 +Change the ownership for the file +.I string +to user ID +.I integer1 +and the group ID +.IR integer2 . +.in -4 +.br +.ne 3 +.B "(unix:command-line) ==> list of string +.in +4 +Return the command line arguments passed to +.B s9e +.I after +the "--" argument. +.in -4 +.br +.ne 3 +.B "(unix:errno) ==> integer +.in +4 +Return the Unix error code set by the most recently failed +call to a +.B unix +extension procedure. +.in -4 +.br +.ne 3 +.B "(unix:exit integer) ==> undefined +.in +4 +Terminate the +.B s9e +process and return +.I integer +as an exit code to the calling process. +.in -4 +.br +.ne 3 +.B "(unix:flush output-port) ==> boolean +.in +4 +Flush the given output port. +.in -4 +.br +.ne 3 +.B "(unix:getcwd) ==> string +.in +4 +Return the current working directory. +.in -4 +.br +.ne 3 +.B "(unix:getenv string) ==> string +.in +4 +Return the value of the environment variable +.IR string . +If the variable is undefined, return +.BR #f . +.in -4 +.br +.ne 3 +.B "(unix:getgid) ==> integer +.in +4 +Return the group ID of the +.B s9e +process. +.in -4 +.br +.ne 3 +.B "(unix:getgrnam string) ==> alist +.in +4 +Return the group record for the group name +.IR string . +The returned association list has the following members: +.nf +.ft C +((name . string) ; group name + (gid . integer)) ; group ID +.ft P +.fi +.in -4 +.br +.ne 3 +.B "(unix:getgrgid integer) ==> alist +.in +4 +Return the group record for the group ID +.IR integer . +See +.B unix:getgrnam +for the structure of the return value. +.in -4 +.br +.ne 3 +.B "(unix:getpwent) ==> list +.in +4 +Return a list of all users of the system. +.in -4 +.br +.ne 3 +.B "(unix:getpwnam string) ==> alist +.in +4 +Return the password record for the user name +.IR string . +The returned association list has the following members: +.nf +.ft C +((name . string) ; user name + (uid . integer) ; user ID + (gid . integer) ; group ID + (gecos . string) ; real name + (home . string) ; home directory + (shell . string)) ; default shell +.ft P +.fi +.in -4 +.br +.ne 3 +.B "(unix:getpwuid integer) ==> alist +.in +4 +Return the password record for the user ID +.IR integer . +See +.B unix:getpwnam +for the structure of the return value. +.in -4 +.br +.ne 3 +.B "(unix:getuid) ==> integer +.in +4 +Return the user ID of the +.B s9e +process. +.in -4 +.br +.ne 3 +.B "(unix:link string1 string2) ==> boolean +.in +4 +Create a (hard) link +.I string2 +that refers to the same file as +.IR string1 . +.in -4 +.br +.ne 3 +.B "(unix:lock string) ==> boolean +.in +4 +Create a lock file named ``\fIstring\fP.lock''. +If the file already exists when the function is called, return +.BR #f , +else return +.BR #t . +.B Unix:lock +uses +.I mkdir() +to create the lock file, which is atomic on virtually all systems. +.in -4 +.br +.ne 3 +.B "(unix:mkdir string integer) ==> boolean +.in +4 +Create directory +.I string +with mode +.IR integer . +.in -4 +.br +.ne 3 +.B "(unix:readdir string) ==> string +.in +4 +Return a list of all file names contained in the directory +.IR string . +When the given directory does not exist, return +.BR #f . +.in -4 +.br +.ne 3 +.B "(unix:readlink string) ==> string +.in +4 +Return the destination of the symbolic link +.IR string . +.in -4 +.br +.ne 3 +.B "(unix:rmdir string) ==> boolean +.in +4 +Remove directory +.IR string . +.in -4 +.br +.ne 3 +.B "(unix:spawn string) ==> (input-port output-port) +.in +4 +Spawn an inferior process running the command +.IR string . +Return a list of two file descriptors where the first one +can be used to read the output of the command and the second +one to send input to the command. The command will be +executed using +.br +\fCexecl("/bin/sh", "/bin/sh", "-c", \fP\fIstring\fP\fC, NULL);\fP +.in -4 +.br +.ne 3 +.B "(unix:stat string) ==> alist +.in +4 +Return the file status of the file +.IR string . +The returned association list has the following members: +.nf +.br +((name . string) ; file name + (size . integer) ; size in bytes + (uid . integer) ; UID of owner + (gid . integer) ; GID of owner + (mode . integer) ; access bits + (ctime . integer) ; inode change time + (atime . integer) ; access time + (mtime . integer) ; modification time + (dev . integer) ; device ID of containing device + (ino . integer) ; inode number + (nlink . integer)) ; number of (hard) links +.in -4 +.fi +.br +.ne 3 +.B "(unix:symlink string1 string2) ==> boolean +.in +4 +Create a symbolic link +.I string2 +that points to the path +.IR string1 . +.in -4 +.br +.ne 3 +.B "(unix:system string) ==> boolean +.in +4 +Run the command +.I string +and return its exit status (\fB#t\fP for success and +.B #f +for failure). +.in -4 +.br +.ne 3 +.B "(unix:time) ==> integer +.in +4 +Returns the number of seconds since the Unix epoch. +.in -4 +.br +.ne 3 +.B "(unix:unlink string) ==> boolean +.in +4 +Remove the file name +.IR string . +.in -4 +.br +.ne 3 +.B "(unix:unlock string) ==> unspecific +.in +4 +Remove the file ``\fIstring\fP.lock''. If the files does not +exist, do nothing. +.in -4 +.br +.ne 3 +.B "(unix:utimes string) ==> boolean +.in +4 +Set the access and modification time of the file +.I string +to the current time. +.in -4 +.br +.ne 6 +.SH "USER-LEVEL FUNCTIONS +.sp +Use these instead of the above primitives. +.sp +.ne 3 +.B "(chdir string) ==> boolean +.in +4 +See +.BR unix:chdir . +.in -4 +.sp +.ne 3 +.B "(chmod string1 integer|string2) ==> boolean +.in +4 +Change the mode of the file +.I string1 +to +.I integer +or +.I string2. +When an integer mode is specified, use its numeric value. A +string mode must either represent an octal mode or have the +format +.sp +.I "user+bits +or +.I "user-bits +.sp +where +.I user +is any combination of the letters +.I "ugo +(denoting +.IR user , +.IR group , +and +.IR others ), +and +.I bits +is any combinations of the letters +.I "rwx +(denoting +.IR read , +.IR write , +and +.IR execute +permission, respectively). The letter +.I a +may be used to abbreviate +.IR ugo . +For example, +.sp +\fB(chmod "a+rw" "file")\fP +.sp +will add read and write permission to +\fIfile\fP. Using a minus sign instead of a plus sign will remove +the given permissions. +.in -4 +.sp +.ne 3 +.B "(chown string integer1|string1|#f integer2|string2|#f) +.br +.B "==> boolean +.in +4 +Change the owning user of the file +.I string +to +.I string1 +or +.I integer1 +and the owning group of the file to +.I string2 +or +.IR integer2 . +Numeric values will be interpreted as user IDs and strings will +be interpreted as user names. Replacing either the user or the +group part with +.B "#f +will leave that part unchanged. For instance, +.sp +\fB(chown #f "wheel" "file")\fP +.sp +will change the group of \fIfile\fP to \fIwheel\fP, but leave +its user unchanged. +.in -4 +.sp +.ne 3 +.B "(command-line) ==> list of string +.in +4 +See +.BR unix:command-line . +.in -4 +.sp +.ne 3 +.B "(errno) ==> integer +.in +4 +See +.BR unix:errno . +.in -4 +.sp +.ne 3 +.B "(exit integer) ==> +.in +4 +See +.BR unix:exit . +However, the argument of +.B exit +is optional and a return value of 0 is the default. +.in -4 +.sp +.ne 3 +.B "(flush output-port) ==> boolean +.in +4 +See +.BR unix:flush . +.in -4 +.sp +.ne 3 +.B "(format-time string time-list) ==> string | #f +.in +4 +Format a time specification as returned by +.B unix-time->time +according to the description in +.IR string . +This a poor man's Common LISP +.BR format -style +procedure intended for making time lists more readable. It +returns +.B #f +if +.I time-list +is not a proper time list or +.I string +is erroneous (i.e.: contains a wrong format descriptor). +.sp +The following format descriptors are supported: +.nf +~w day of week (Mon, Tue, ...) +~y year +~:m number of month +~@m month name (Jan, Feb, ...) +~h hour +~m minute +~s second +~~ literal ~ +.fi +.sp +When a single digit appears between a +.I ~ +and the rest of a format descriptor, this digit will be interpreted +as a length and the resulting string will be padded to this length +with zeros. +.sp +Example: +.nf +(format-time "~w ~4y-~@m-~2d ~2h:~2m:~2s" + '(1 2009 3 9 8 53 20)) + ==> "Tue 2009-Apr-09 08:53:20" +.fi +.in -4 +.sp +.ne 3 +.B "(getcwd) ==> string +.in +4 +See +.BR unix:getcwd . +.in -4 +.sp +.ne 3 +.B "(getenv string) ==> string +.in +4 +See +.BR unix:getenv . +.in -4 +.sp +.ne 3 +.B "(getgid) ==> integer +.in +4 +See +.BR unix:getgid . +.in -4 +.sp +.ne 3 +.B "(getgrnam string) ==> alist +.in +4 +See +.BR unix:getgrnam. +.in -4 +.sp +.ne 3 +.B "(getgrgid integer) ==> alist +.in +4 +See +.BR unix:getgrgid. +.in -4 +.sp +.ne 3 +.B "(getpwent) ==> list +.in +4 +See +.BR unix:getpwent . +.in -4 +.sp +.ne 3 +.B "(getpwnam string) ==> alist +.in +4 +See +.BR unix:getpwnam. +.in -4 +.sp +.ne 3 +.B "(getpwuid integer) ==> alist +.in +4 +See +.BR unix:getpwuid. +.in -4 +.sp +.ne 3 +.B "(getuid) ==> integer +.in +4 +See +.BR unix:getuid. +.in -4 +.sp +.ne 2 +.B "(group-name string|integer) ==> string +.in +4 +Return the group name for the group \fPstring\fP or the group ID \fBinteger\fP. +(Yes, getting a group name for a group name is an identity operation.) +.in -4 +.sp +.ne 3 +.B "(group-gid string|integer) ==> string +.in +4 +Return the group ID for the group \fPstring\fP or the group ID \fBinteger\fP. +(Yes, getting a group ID for a group ID is an identity operation.) +.in -4 +.sp +.ne 3 +.B "(link string1 string2) ==> boolean +.in +4 +See +.BR unix:link. +.in -4 +.sp +.ne 3 +.B "(lock string) ==> boolean +.in +4 +See +.BR unix:lock. +.in -4 +.sp +.ne 3 +.B "(mkdir string integer) ==> boolean +.in +4 +See +.BR unix:mkdir. +.in -4 +.sp +.ne 3 +.B "(readdir string) ==> list +.in +4 +See +.BR unix:readdir. +.in -4 +.sp +.ne 3 +.B "(readlink string) ==> string +.in +4 +See +.BR unix:readlink. +.in -4 +.sp +.ne 3 +.B "(rmdir string) ==> boolean +.in +4 +See +.BR unix:rmdir. +.in -4 +.sp +.ne 3 +.B "(spawn string) ==> (input-port output-port) +.in +4 +See +.BR unix:spawn. +.in -4 +.sp +.ne 3 +.B "(stat string) ==> alist +.in +4 +See +.BR unix:stat. +.in -4 +.sp +.ne 3 +.B "(stat-name string) ==> string +.in +4 +Return the file name of the file \fPstring\fP. +.in -4 +.sp +.ne 3 +.B "(stat-size string) ==> integer +.in +4 +Return the size of the file \fPstring\fP. +.in -4 +.sp +.ne 3 +.B "(stat-uid string) ==> integer +.in +4 +Return the UID of the owner of the file \fPstring\fP. +.in -4 +.sp +.ne 3 +.B "(stat-gid string) ==> integer +.in +4 +Return the GID of the owning group of the file \fPstring\fP. +.in -4 +.sp +.ne 3 +.B "(stat-mode string) ==> integer +.in +4 +Return the permission bits of the file \fPstring\fP. +.in -4 +.sp +.ne 3 +.B "(stat-ctime string) ==> integer +.in +4 +Return the inode change time of the file \fPstring\fP. +.in -4 +.sp +.ne 3 +.B "(stat-atime string) ==> integer +.in +4 +Return the access time of the file \fPstring\fP. +.in -4 +.sp +.ne 3 +.B "(stat-mtime string) ==> integer +.in +4 +Return the modification time of the file \fPstring\fP. +.in -4 +.sp +.ne 3 +.B "(stat-dev string) ==> integer +.in +4 +Return the device ID of the device on which the file \fPstring\fP resides. +.in -4 +.sp +.ne 3 +.B "(stat-ino string) ==> integer +.in +4 +Return the inode number of the file \fPstring\fP. +.in -4 +.sp +.ne 3 +.B "(stat-nlink string) ==> integer +.in +4 +Return the link count of the file \fPstring\fP. +.in -4 +.sp +.ne 3 +.B "(symlink string1 string2) ==> boolean +.in +4 +See +.BR unix:symlink. +.in -4 +.sp +.ne 3 +.B "(system string) ==> boolean +.in +4 +See +.BR unix:system. +.in -4 +.sp +.ne 3 +.B "(time) ==> integer +.in +4 +See +.BR unix:time . +.in -4 +.sp +.ne 3 +.B "(time->unix-time time-list) ==> integer | #f +.in +4 +Convert a time list as described in +.B unix-time->time +to the number of seconds since the Unix epoch. Return +.B #f +if +.I time-list +is not a proper time list. +.in -4 +.sp +.ne 3 +.B "(unix-time->time integer) ==> time-list +.in +4 +Convert the number of seconds since the Unix epoch given as the +.I integer +argument to a more useful representation: +.sp +.nf +(weekday ; 0..6 where 0 = Monday + year ; 1970..2038 + month ; 1..12 + day ; 1..31, depends on month + hour ; 0..23 + minute ; 0..60 + second) ; 0..60 +.fi +.in -4 +.sp +.ne 3 +.B "(unlink string) ==> boolean +.in +4 +See +.BR unix:unlink. +.in -4 +.sp +.ne 3 +.B "(unlock string) ==> unspecific +.in +4 +See +.BR unix:unlock. +.in -4 +.sp +.ne 3 +.B "(user-name integer|string) ==> string +.in +4 +Return the user name for the user \fPstring\fP or the user ID \fBinteger\fP. +(Yes, getting a user name for a user name is an identity operation.) +.in -4 +.sp +.ne 3 +.B "(user-uid integer|string) ==> integer +.in +4 +Return the user ID for the user \fPstring\fP or the user ID \fBinteger\fP. +(Yes, getting a user ID for a user ID is an identity operation.) +.in -4 +.sp +.ne 3 +.B "(user-gid integer|string) ==> integer +.in +4 +Return the group ID for the user \fPstring\fP or the user ID \fBinteger\fP. +.in -4 +.sp +.ne 3 +.B "(user-gecos integer|string) ==> string +.in +4 +Return the GECOS information (full name) for the user \fPstring\fP or +the user ID \fBinteger\fP. +.in -4 +.sp +.ne 3 +.B "(user-home integer|string) ==> string +.in +4 +Return the home directory for the user \fPstring\fP or the user ID +\fBinteger\fP. +.in -4 +.sp +.ne 3 +.B "(user-shell integer|string) ==> string +.in +4 +Return the login shell for the user \fPstring\fP or the user ID \fBinteger\fP. +.in -4 +.sp +.ne 3 +.B "(utimes string) ==> boolean +.in +4 +See +.BR unix:utimes. +.in -4 +.SH "SEE ALSO +s9(1) +.SH AUTHOR +Nils M Holm --- scheme9-2009.05.07.orig/debian/rules +++ scheme9-2009.05.07/debian/rules @@ -0,0 +1,14 @@ +#!/usr/bin/make -f + +# binary-arch binary-indep binary install build clean: +%: + dh $@ + +override_dh_auto_configure: + echo Calling ./configure unnecessary as ./Makefile already patched for debian. + +override_dh_auto_build: + dh_auto_build -- prefix=/usr + +override_dh_auto_install: + dh_auto_install -- prefix=/usr --- scheme9-2009.05.07.orig/debian/copyright +++ scheme9-2009.05.07/debian/copyright @@ -0,0 +1,42 @@ +This package was debianized by Barak A. Pearlmutter on +Mon, 23 Feb 2009 09:28:11 +0000. + +It was downloaded from http://t3x.org/s9fes/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'. --- scheme9-2009.05.07.orig/debian/scheme9.docs +++ scheme9-2009.05.07/debian/scheme9.docs @@ -0,0 +1 @@ +README --- scheme9-2009.05.07.orig/debian/control +++ scheme9-2009.05.07/debian/control @@ -0,0 +1,22 @@ +Source: scheme9 +Section: lisp +Priority: extra +Maintainer: Barak A. Pearlmutter +Build-Depends: debhelper (> 7.2.5) +Standards-Version: 3.8.1 +Homepage: http://t3x.org/s9fes/ +Vcs-Git: git://git.debian.org/git/collab-maint/scheme9.git +Vcs-Browser: http://git.debian.org/?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. --- scheme9-2009.05.07.orig/debian/scheme9.menu +++ scheme9-2009.05.07/debian/scheme9.menu @@ -0,0 +1,4 @@ +?package(scheme9):needs="text" section="Applications/Programming"\ + title="scheme9" command="/usr/bin/s9" +?package(scheme9):needs="text" section="Applications/Programming"\ + title="scheme9 extended" command="/usr/bin/s9e" --- scheme9-2009.05.07.orig/debian/changelog +++ scheme9-2009.05.07/debian/changelog @@ -0,0 +1,76 @@ +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 --- scheme9-2009.05.07.orig/debian/compat +++ scheme9-2009.05.07/debian/compat @@ -0,0 +1 @@ +7 --- scheme9-2009.05.07.orig/debian/scheme9.manpages +++ scheme9-2009.05.07/debian/scheme9.manpages @@ -0,0 +1,2 @@ +s9.1 +s9e.1 --- scheme9-2009.05.07.orig/debian/watch +++ scheme9-2009.05.07/debian/watch @@ -0,0 +1,3 @@ +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