summaryrefslogtreecommitdiffstats
path: root/scm.info
diff options
context:
space:
mode:
authorSteve Langasek <vorlon@debian.org>2004-12-07 23:23:48 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:28 -0800
commit37f2f5e0bb11a18deecf48c7ad6bcbf7bd932db2 (patch)
tree692caebb60ec5f80ce528a403b69351ca756d530 /scm.info
parente21d47d7813159bb71e0671df9b52ec0470c358d (diff)
parentc7d035ae1a729232579a0fe41ed5affa131d3623 (diff)
downloadscm-37f2f5e0bb11a18deecf48c7ad6bcbf7bd932db2.tar.gz
scm-37f2f5e0bb11a18deecf48c7ad6bcbf7bd932db2.zip
Import Debian changes 5d9-4.1debian/5d9-4.1
scm (5d9-4.1) unstable; urgency=high * Non-maintainer upload. * High-urgency upload for sarge-targetted RC bugfix. * Revert upstream "CAUTIOUS" define, which causes the scm build to fail its test suite on alpha (and, it appears, powerpc as well). Closes: #245810. scm (5d9-4) unstable; urgency=low * Apply patch from 144062 to fix hppa build (Closes: #144062) * Change scm.1 section from Jan 4 200 to 1. (lintian) scm (5d9-3) unstable; urgency=low * Properly clean up info files. * Make and install Xlibscm.info. scm (5d9-2) unstable; urgency=low * Fix path problem in slibcat. Hack at mklibcat.scm. (Closes: #241510) scm (5d9-1) unstable; urgency=low * New upstream release * Merge NMU sparc changes (Closes: #191171, #191356) * SHORT_INT is defined for ia64 upstream (Closes: #141928) * Scheme imps now grouped in info file (has been for a while) (Closes: #115452)
Diffstat (limited to 'scm.info')
-rw-r--r--scm.info2314
1 files changed, 1180 insertions, 1134 deletions
diff --git a/scm.info b/scm.info
index b0dbf1b..c7f80bd 100644
--- a/scm.info
+++ b/scm.info
@@ -1,4 +1,4 @@
-This is scm.info, produced by makeinfo version 4.0 from scm.texi.
+This is scm.info, produced by makeinfo version 4.0 from scm.texi. |
INFO-DIR-SECTION The Algorithmic Language Scheme
START-INFO-DIR-ENTRY
@@ -9,10 +9,10 @@ END-INFO-DIR-ENTRY
File: scm.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir)
This manual documents the SCM Scheme implementation. SCM version
-5d6 was released April 2002. The most recent information about SCM can |
-be found on SCM's "WWW" home page: |
+5d9 was released November 2003. The most recent information about SCM |
+can be found on SCM's "WWW" home page:
- <http://swissnet.ai.mit.edu/~jaffer/SCM.html>
+ <http://swissnet.ai.mit.edu/~jaffer/SCM>
Copyright (C) 1990-1999 Free Software Foundation
@@ -33,7 +33,7 @@ approved by the author.
* Menu:
* Overview::
-* Installing SCM::
+* Installing SCM:: How to
* Operational Features::
* The Language:: Reference.
* Packages:: Optional Capabilities.
@@ -112,7 +112,7 @@ File: scm.info, Node: SCM Authors, Next: Copying, Prev: SCM Features, Up: Ov
Authors
=======
-Aubrey Jaffer (jaffer @ alum.mit.edu) |
+Aubrey Jaffer (agj @ alum.mit.edu)
Most of SCM.
Radey Shouman
@@ -332,22 +332,21 @@ SLIB is not _neccessary_ to run SCM, I strongly suggest you obtain and
install it. Bug reports about running SCM without SLIB have very low
priority. SLIB is available from the same sites as SCM:
- * swissnet.ai.mit.edu:/pub/scm/slib2d4.tar.gz |
+ * swissnet.ai.mit.edu:/pub/scm/slib3a1.tar.gz |
- * ftp.gnu.org:/pub/gnu/jacal/slib2d4.tar.gz |
+ * ftp.gnu.org:/pub/gnu/jacal/slib3a1.tar.gz |
- * ftp.cs.indiana.edu:/pub/scheme-repository/imp/slib2d4.tar.gz |
+ * ftp.cs.indiana.edu:/pub/scheme-repository/imp/slib3a1.tar.gz |
-Unpack SLIB (`tar xzf slib2d4.tar.gz' or `unzip -ao slib2d4.zip') in an |
+Unpack SLIB (`tar xzf slib3a1.tar.gz' or `unzip -ao slib3a1.zip') in an |
appropriate directory for your system; both `tar' and `unzip' will
create the directory `slib'.
Then create a file `require.scm' in the SCM "implementation-vicinity"
-(this is the same directory as where the file `Init5d6.scm' is |
+(this is the same directory as where the file `Init5d9.scm' is |
installed). `require.scm' should have the contents:
(define (library-vicinity) "/usr/local/lib/slib/")
- (load (in-vicinity (library-vicinity) "require"))
where the pathname string `/usr/local/lib/slib/' is to be replaced by
the pathname into which you installed SLIB. Absolute pathnames are
@@ -359,7 +358,6 @@ implementation-vicinity, which is absolute:
(define library-vicinity
(let ((lv (string-append (implementation-vicinity) "../slib/")))
(lambda () lv)))
- (load (in-vicinity (library-vicinity) "require"))
Alternatively, you can set the (shell) environment variable
`SCHEME_LIBRARY_PATH' to the pathname of the SLIB directory (*note
@@ -413,33 +411,33 @@ script with the `arrays', `inexact', and `bignums' options as defaults.
bash$ ./build
-|
#! /bin/sh
- # unix (linux) script created by SLIB/batch |
- # ================ Write file with C defines |
+ # unix (linux) script created by SLIB/batch
+ # ================ Write file with C defines
rm -f scmflags.h
- echo '#define IMPLINIT "Init5d6.scm"'>>scmflags.h |
+ echo '#define IMPLINIT "Init5d9.scm"'>>scmflags.h |
echo '#define BIGNUMS'>>scmflags.h
echo '#define FLOATS'>>scmflags.h
echo '#define ARRAYS'>>scmflags.h
- # ================ Compile C source files |
+ # ================ Compile C source files
gcc -O2 -c continue.c scm.c scmmain.c findexec.c script.c time.c repl.c scl.c eval.c sys.c subr.c debug.c unif.c rope.c
- # ================ Link C object files |
+ # ================ Link C object files
gcc -rdynamic -o scm continue.o scm.o scmmain.o findexec.o script.o time.o repl.o scl.o eval.o sys.o subr.o debug.o unif.o rope.o -lm -lc
To cross compile for another platform, invoke build with the `-p' or
`--platform=' option. This will create a script for the platform named
in the `-p' or `--platform=' option.
- bash$ ./build -o scmlit -p darwin -F lit |
+ bash$ ./build -o scmlit -p darwin -F lit
-|
- #! /bin/sh |
- # unix (darwin) script created by SLIB/batch |
- # ================ Write file with C defines |
- rm -f scmflags.h |
- echo '#define IMPLINIT "Init5d6.scm"'>>scmflags.h |
- # ================ Compile C source files |
+ #! /bin/sh
+ # unix (darwin) script created by SLIB/batch
+ # ================ Write file with C defines
+ rm -f scmflags.h
+ echo '#define IMPLINIT "Init5d9.scm"'>>scmflags.h |
+ # ================ Compile C source files
cc -O3 -c continue.c scm.c scmmain.c findexec.c script.c time.c repl.c scl.c eval.c sys.c subr.c debug.c unif.c rope.c
- # ================ Link C object files |
- mv -f scmlit scmlit~ |
+ # ================ Link C object files
+ mv -f scmlit scmlit~
cc -o scmlit continue.o scm.o scmmain.o findexec.o script.o time.o repl.o scl.o eval.o sys.o subr.o debug.o unif.o rope.o

@@ -465,12 +463,11 @@ the SCM command line options.
name processor operating-system compiler |
#f processor-family operating-system #f |
symbol processor-family operating-system symbol |
- symbol atom symbol symbol |
+ symbol symbol symbol symbol |
================= ================= ================= ================= |
*unknown* *unknown* unix cc |
acorn-unixlib acorn *unknown* cc |
aix powerpc aix cc |
- alpha alpha osf1 cc |
alpha-elf alpha unix cc |
alpha-linux alpha linux gcc |
amiga-aztec m68000 amiga cc |
@@ -479,35 +476,65 @@ the SCM command line options.
amiga-sas m68000 amiga lc |
atari-st-gcc m68000 atari.st gcc |
atari-st-turbo-c m68000 atari.st tcc |
- borland-c 8086 ms-dos bcc |
- cygwin32 i386 unix gcc |
+ borland-c i8086 ms-dos bcc |
darwin powerpc unix cc |
djgpp i386 ms-dos gcc |
freebsd i386 unix cc |
gcc *unknown* unix gcc |
+ gnu-win32 i386 unix gcc |
highc i386 ms-dos hc386 |
hp-ux hp-risc hp-ux cc |
irix mips irix gcc |
linux i386 linux gcc |
linux-aout i386 linux gcc |
- microsoft-c 8086 ms-dos cl |
+ microsoft-c i8086 ms-dos cl |
microsoft-c-nt i386 ms-dos cl |
- microsoft-quick-c 8086 ms-dos qcl |
- ms-dos 8086 ms-dos cc |
+ microsoft-quick-c i8086 ms-dos qcl |
+ ms-dos i8086 ms-dos cc |
+ netbsd *unknown* unix gcc |
openbsd *unknown* unix gcc |
os/2-cset i386 os/2 icc |
os/2-emx i386 os/2 gcc |
+ osf1 alpha unix cc |
plan9-8 i386 plan9 8c |
sunos sparc sunos cc |
svr4 *unknown* unix cc |
svr4-gcc-sun-ld sparc sunos gcc |
- turbo-c 8086 ms-dos tcc |
+ turbo-c i8086 ms-dos tcc |
unicos cray unicos cc |
unix *unknown* unix cc |
vms vax vms cc |
vms-gcc vax vms gcc |
watcom-9.0 i386 ms-dos wcc386p |
+ - Build Option: -f PATHNAME
+ specifies that the build options contained in PATHNAME be spliced
+ into the argument list at this point. The use of option files can |
+ separate functional features from platform-specific ones. |
+ |
+ The `Makefile' calls out builds with the options in `.opt' files: |
+ |
+ `dlls.opt' |
+ Options for Makefile targets mydlls, myturtle, and x.so. |
+ |
+ `gdb.opt' |
+ Options for udgdbscm and gdbscm. |
+ |
+ `libscm.opt' |
+ Options for libscm.a. |
+ |
+ `pg.opt' |
+ Options for pgscm, which instruments C functions. |
+ |
+ `udscm4.opt' |
+ Options for targets udscm4 and myscm4 (scm). |
+ |
+ `udscm5.opt' |
+ Options for targets udscm5 and myscm5 (scm). |
+ |
+ The Makefile creates options files it depends on only if they do |
+ not already exist. |
+
- Build Option: -o FILENAME
- Build Option: --outname=FILENAME
specifies that the compilation should produce an executable or
@@ -539,7 +566,7 @@ the SCM command line options.
- Build Option: -s PATHNAME
- Build Option: --scheme-initial=PATHNAME
specifies that PATHNAME should be the default location of the SCM
- initialization file `Init5d6.scm'. SCM tries several likely |
+ initialization file `Init5d9.scm'. SCM tries several likely |
locations before resorting to PATHNAME (*note File-System
Habitat::). If not specified, the current directory (where build
is building) is used.
@@ -586,7 +613,7 @@ the SCM command line options.
* vms
- * amigaos (was amigados) |
+ * amigaos (was amigados)
* system
@@ -619,6 +646,9 @@ the SCM command line options.
"bignums"
Large precision integers.
+ "byte" |
+ Treating strings as byte-vectors. |
+ |
"careful-interrupt-masking"
Define this for extra checking of interrupt masking and some
simple checks for proper use of malloc and free. This is for
@@ -786,11 +816,11 @@ Suppose a C file "foo.c" has functions you wish to add to SCM. To
compile and link your file at compile time, use the `-c' and `-i'
options to build:
- bash$ build -c foo.c -i init_foo
+ bash$ ./build -c foo.c -i init_foo
-|
#! /bin/sh
rm -f scmflags.h
- echo '#define IMPLINIT "/home/jaffer/scm/Init5d6.scm"'>>scmflags.h |
+ echo '#define IMPLINIT "/home/jaffer/scm/Init5d9.scm"'>>scmflags.h |
echo '#define COMPILED_INITS init_foo();'>>scmflags.h
echo '#define BIGNUMS'>>scmflags.h
echo '#define FLOATS'>>scmflags.h
@@ -802,11 +832,11 @@ options to build:
To make a dynamically loadable object file use the `-t dll' option:
- bash$ build -t dll -c foo.c
+ bash$ ./build -t dll -c foo.c
-|
#! /bin/sh
rm -f scmflags.h
- echo '#define IMPLINIT "/home/jaffer/scm/Init5d6.scm"'>>scmflags.h |
+ echo '#define IMPLINIT "/home/jaffer/scm/Init5d9.scm"'>>scmflags.h |
echo '#define BIGNUMS'>>scmflags.h
echo '#define FLOATS'>>scmflags.h
echo '#define ARRAYS'>>scmflags.h
@@ -830,7 +860,7 @@ in the BSD family (a.out binary format) can usually be ported to "DLD".
The "dl" library (`#define SUN_DL' for SCM) was a proposed POSIX
standard and may be available on other machines with "COFF" binary
format. For notes about porting to MS-Windows and finishing the port
-to VMS *Note Finishing Dynamic Linking::.
+to VMS *Note VMS Dynamic Linking::.
"DLD" is a library package of C functions that performs "dynamic link
editing" on Linux, VAX (Ultrix), Sun 3 (SunOS 3.4 and 4.0),
@@ -962,9 +992,9 @@ lines or add a `#define FLAG' line to `scmfig.h' or the beginning of
__ZTC__ Zortech C
_AIX AIX operating system
- __APPLE__ Apple Darwin |
+ __APPLE__ Apple Darwin
AMIGA SAS/C 5.10 or Dice C on AMIGA
- __amigaos__ Gnu CC on AMIGA |
+ __amigaos__ Gnu CC on AMIGA
atarist ATARI-ST under Gnu CC
__FreeBSD__ FreeBSD
GNUDOS DJGPP (obsolete in version 1.08)
@@ -973,9 +1003,11 @@ lines or add a `#define FLAG' line to `scmfig.h' or the beginning of
linux Linux
macintosh Macintosh (THINK_C and __MWERKS__ define)
MCH_AMIGA Aztec_c 5.2a on AMIGA
- __MACH__ Apple Darwin |
+ __MACH__ Apple Darwin
MSDOS Microsoft C 5.10 and 6.00A
+ _MSDOS Microsoft CLARM and CLTHUMB compilers.
__MSDOS__ Turbo C, Borland C, and DJGPP
+ __NetBSD__ NetBSD
nosve Control Data NOS/VE
SVR2 System V Revision 2.
__SVR4 SunOS
@@ -990,16 +1022,22 @@ lines or add a `#define FLAG' line to `scmfig.h' or the beginning of
VAX11 VAX C compiler
_Windows Borland C 3.1 compiling for Windows
_WIN32 MS VisualC++ 4.2 and Cygwin (Win32 API)
+ _WIN32_WCE MS Windows CE
vms (and VMS) VAX-11 C under VMS.
__alpha DEC Alpha processor
__alpha__ DEC Alpha processor
hp9000s800 HP RISC processor
+ __ia64 GCC on IA64 |
+ __ia64__ GCC on IA64 |
+ _LONGLONG GCC on IA64 |
__i386__ DJGPP
i386 DJGPP
+ _M_ARM Microsoft CLARM compiler defines as 4 for ARM.
+ _M_ARMT Microsoft CLTHUMB compiler defines as 4 for Thumb.
MULTIMAX Encore computer
- ppc PowerPC |
- __ppc__ PowerPC |
+ ppc PowerPC
+ __ppc__ PowerPC
pyr Pyramid 9810 processor
__sgi__ Silicon Graphics Inc.
sparc SPARC processor
@@ -1072,17 +1110,17 @@ remove <FLAG> in scmfig.h and Do so and recompile files.
recompile scm.
add <FLAG> in scmfig.h and
recompile scm.
-ERROR: Init5d6.scm not found. Assign correct IMPLINIT in makefile |
+ERROR: Init5d9.scm not found. Assign correct IMPLINIT in makefile |
or scmfig.h.
Define environment variable
SCM_INIT_PATH to be the full
- pathname of Init5d6.scm. |
+ pathname of Init5d9.scm. |
WARNING: require.scm not found. Define environment variable
SCHEME_LIBRARY_PATH to be the full
pathname of the scheme library
[SLIB].
Change library-vicinity in
- Init5d6.scm to point to library or |
+ Init5d9.scm to point to library or |
remove.
Make sure the value of
(library-vicinity) has a trailing
@@ -1114,13 +1152,13 @@ of pi.
> (load "pi")
;loading "pi"
;done loading "pi.scm"
- ;Evaluation took 20 ms (0 in gc) 767 cells work, 233.B other |
+ ;Evaluation took 20 ms (0 in gc) 767 cells work, 233.B other
#<unspecified>
> (pi 100 5)
00003 14159 26535 89793 23846 26433 83279 50288 41971 69399
37510 58209 74944 59230 78164 06286 20899 86280 34825 34211
70679
- ;Evaluation took 550 ms (60 in gc) 36976 cells work, 1548.B other |
+ ;Evaluation took 550 ms (60 in gc) 36976 cells work, 1548.B other
#<unspecified>
Loading `bench.scm' will compute and display performance statistics of
@@ -1142,7 +1180,7 @@ Some symbol names print incorrectly. Change memory model option to C
than HEAP_SEG_SIZE).
ERROR: Rogue pointer in Heap. See above under machine crashes.
Newlines don't appear correctly in Check file mode (define OPEN_... in
-output files. `Init5d6.scm'). |
+output files. `Init5d9.scm'). |
Spaces or control characters appear Check character defines in
in symbol names. `scmfig.h'.
Negative numbers turn positive. Check SRS in `scmfig.h'.
@@ -1167,8 +1205,8 @@ Reporting Problems
Reported problems and solutions are grouped under Compiling, Linking,
Running, and Testing. If you don't find your problem listed there, you
-can send a bug report to `jaffer @ alum.mit.edu'. The bug report |
-should include: |
+can send a bug report to `agj @ alum.mit.edu'. The bug report should
+include:
1. The version of SCM (printed when SCM is invoked with no arguments).
@@ -1223,7 +1261,7 @@ variable SCM_INIT_PATH.
If SCM_INIT_PATH is not defined or if the file it names is not present,
`scm' tries to find the directory containing the executable file. If
it is able to locate the executable, `scm' looks for the initialization
-file (usually `Init5d6.scm') in platform-dependent directories relative |
+file (usually `Init5d9.scm') in platform-dependent directories relative |
to this directory. See *Note File-System Habitat:: for a blow-by-blow
description.
@@ -1232,19 +1270,19 @@ compile parameter IMPLINIT (defined in the makefile or `scmfig.h') is
tried.
Unless the option `-no-init-file' or `--no-init-file' occurs in the
-command line, `Init5d6.scm' checks to see if there is file |
+command line, `Init5d9.scm' checks to see if there is file |
`ScmInit.scm' in the path specified by the environment variable HOME
(or in the current directory if HOME is undefined). If it finds such a
file it is loaded.
-`Init5d6.scm' then looks for command input from one of three sources: |
+`Init5d9.scm' then looks for command input from one of three sources: |
From an option on the command line, from a file named on the command
line, or from standard input.
This explanation applies to SCMLIT or other builds of SCM.
Scheme-code files can also invoke SCM and its variants. *Note #!:
-Syntax Extensions.
+Lexical Conventions.

File: scm.info, Node: SCM Options, Next: Invocation Examples, Prev: Invoking SCM, Up: Operational Features
@@ -1254,8 +1292,8 @@ Options
The options are processed in the order specified on the command line.
- - Command Option: -a k |
- specifies that `scm' should allocate an initial heapsize of K |
+ - Command Option: -a k
+ specifies that `scm' should allocate an initial heapsize of K
kilobytes. This option, if present, must be the first on the
command line. If not specified, the default is `INIT_HEAP_SIZE'
in source file `setjump.h' which the distribution sets at
@@ -1273,10 +1311,10 @@ The options are processed in the order specified on the command line.
- Command Option: -r feature
requires FEATURE. This will load a file from [SLIB] if that
- FEATURE is not already provided. If FEATURE is 2, 2rs, r2rs, 3, |
- 3rs, r3rs, 4, 4rs, r4rs, 5, 5rs, or r5rs; `scm' will require the |
- features neccessary to support [R2RS], [R3RS], [R4RS], or [R5RS], |
- respectively. |
+ FEATURE is not already provided. If FEATURE is 2, 2rs, or r2rs; |
+ 3, 3rs, or r3rs; 4, 4rs, or r4rs; 5, 5rs, or r5rs; `scm' will |
+ require the features neccessary to support [R2RS]; [R3RS]; [R4RS]; |
+ or [R5RS], respectively. |
- Command Option: -h feature
provides FEATURE.
@@ -1284,11 +1322,11 @@ The options are processed in the order specified on the command line.
- Command Option: -l filename
- Command Option: -f filename
loads FILENAME. `Scm' will load the first (unoptioned) file named
- on the command line if no `-c', `-e', `-f', `-l', or `-s' option
+ on the command line if no `-c', `-e', `-f', `-l', or `-s' option
preceeds it.
- Command Option: -d filename
- Loads SLIB `databases' feature and opens FILENAME as a database. |
+ Loads SLIB `databases' feature and opens FILENAME as a database.
- Command Option: -e expression
- Command Option: -c expression
@@ -1349,12 +1387,14 @@ The options are processed in the order specified on the command line.
are errors.
- Command Option: -s
- specifies, by analogy with `sh', that further options are to be
- treated as program aguments.
+ specifies, by analogy with `sh', that `scm' should run
+ interactively and that further options are to be treated as program
+ aguments.
- Command Option: -
- Command Option: --
- specifies that there are no more options on the command line.
+ specifies that further options are to be treated as program
+ aguments.

File: scm.info, Node: Invocation Examples, Next: SCM Variables, Prev: SCM Options, Up: Operational Features
@@ -1396,13 +1436,13 @@ Environment Variables
- Environment Variable: SCM_INIT_PATH
is the pathname where `scm' will look for its initialization code.
- The default is the file `Init5d6.scm' in the source directory. |
+ The default is the file `Init5d9.scm' in the source directory. |
- Environment Variable: SCHEME_LIBRARY_PATH
is the [SLIB] Scheme library directory.
- Environment Variable: HOME
- is the directory where `Init5d6.scm' will look for the user |
+ is the directory where `Init5d9.scm' will look for the user |
initialization file `ScmInit.scm'.
- Environment Variable: EDITOR
@@ -1417,7 +1457,7 @@ Scheme Variables
during argument processing. This list is suitable for use as an
argument to [SLIB] `getopt'.
- - Variable: *syntax-rules* |
+ - Variable: *syntax-rules*
controls whether loading and interaction support syntax-rules
macros. Define this in `ScmInit.scm' or files specified on the
command line. This can be overridden by subsequent `-m' and `-u'
@@ -1452,14 +1492,19 @@ SCM Session
SCM can also tail-call another program. *Note execp:
I/O-Extensions.
- - Callback procedure: boot-tail dumped? |
- `boot-tail' is called by `scm_top_level' just before entering |
- interactive top-level. If `boot-tail' calls `quit', then |
- interactive top-level is not entered. |
- |
+ - Callback procedure: boot-tail dumped?
+ `boot-tail' is called by `scm_top_level' just before entering
+ interactive top-level. If `boot-tail' calls `quit', then
+ interactive top-level is not entered.
+
- Function: program-arguments
Returns a list of strings of the arguments scm was called with.
+ - Function: getlogin
+ Returns the (login) name of the user logged in on the controlling
+ terminal of the process, or #f if this information cannot be
+ determined.
+
For documentation of the procedures `getenv' and `system' *Note System
Interface: (slib)System Interface.
@@ -1483,14 +1528,11 @@ Editing Scheme Code
Gnu Emacs:
Editing of Scheme code is supported by emacs. Buffers holding
- files ending in .scm are automatically put into scheme-mode.
- EMACS for MS-DOS and MS-Windows systems is available (free) from:
-
- <http://simtel.coast.net/SimTel/gnu/demacs.html>
+ files ending in .scm are automatically put into scheme-mode. |
- If your Emacs can run a process in a buffer you can use the Emacs
- command `M-x run-scheme' with SCM. Otherwise, use the emacs
- command `M-x suspend-emacs'; or see "other systems" below.
+ If your Emacs can run a process in a buffer you can use the Emacs |
+ command `M-x run-scheme' with SCM. Otherwise, use the emacs |
+ command `M-x suspend-emacs'; or see "other systems" below. |
Epsilon (MS-DOS):
There is lisp (and scheme) mode available by use of the package
@@ -1716,13 +1758,13 @@ warnings and errors.
- Function: warn arg1 arg2 arg3 ...
Alias for *Note slib:warn: (slib)System. Outputs an error message
- containing the arguments. `warn' is defined in `Init5d6.scm'. |
+ containing the arguments. `warn' is defined in `Init5d9.scm'. |
- Function: error arg1 arg2 arg3 ...
Alias for *Note slib:error: (slib)System. Outputs an error
message containing the arguments, aborts evaluation of the current
form and resumes the top level read-eval-print loop. `Error' is
- defined in `Init5d6.scm'. |
+ defined in `Init5d9.scm'. |
If SCM is built with the `CAUTIOUS' flag, then when an error occurs, a
"stack trace" of certain pending calls are printed as part of the
@@ -1740,7 +1782,7 @@ with Lisp systems.
- Function: stack-trace
Prints information describing the stack of partially evaluated
expressions. `stack-trace' returns `#t' if any lines were printed
- and `#f' otherwise. See `Init5d6.scm' for an example of the use |
+ and `#f' otherwise. See `Init5d9.scm' for an example of the use |
of `stack-trace'.

@@ -1765,7 +1807,7 @@ a convenient aid to locating bugs and untested expressions.
* The names of identifiers which are not lexiallly bound but defined
at top-level have #@ prepended.
-For instance, `open-input-file' is defined as follows in `Init5d6.scm': |
+For instance, `open-input-file' is defined as follows in `Init5d9.scm': |
(define (open-input-file str)
(or (open-file str OPEN_READ)
@@ -1814,7 +1856,7 @@ Internal State
*INTERACTIVE* is controlled directly by the command-line options
`-b', `-i', and `-s' (*note Invoking SCM::). If none of these
options are specified, the rules to determine interactivity are
- more complicated; see `Init5d6.scm' for details. |
+ more complicated; see `Init5d9.scm' for details. |
- Function: abort
Resumes the top level Read-Eval-Print loop.
@@ -1844,19 +1886,19 @@ Internal State
a prompt is printed.
>= 2
- messages bracketing file loading are printed. |
+ messages bracketing file loading are printed.
>= 3
- the CPU time is printed after each top level form evaluated; |
- notifications of heap growth printed. |
+ the CPU time is printed after each top level form evaluated;
+ notifications of heap growth printed.
>= 4
- a garbage collection summary is printed after each top level |
- form evaluated; |
+ a garbage collection summary is printed after each top level
+ form evaluated;
>= 5
- a message for each GC (*note Garbage Collection::) is printed; |
- warnings issued for top-level symbols redefined. |
+ a message for each GC (*note Garbage Collection::) is printed;
+ warnings issued for top-level symbols redefined.
- Function: gc
Scans all of SCM objects and reclaims for further use those that
@@ -1868,7 +1910,7 @@ Internal State
#t)' also gives the hexadecimal heap segment and stack bounds.
- Constant: *scm-version*
- Contains the version string (e.g. `5d6') of SCM. |
+ Contains the version string (e.g. `5d9') of SCM. |
Executable path
---------------
@@ -1923,9 +1965,9 @@ file has (different) meanings to SCM and the operating system
When executing a shell-script, the operating system invokes
INTERPRETER with a single argument encapsulating the rest of the
- first line's contents (if if not just whitespace), the pathname of
- the Scheme Script file, and then any arguments which the
- shell-script was invoked with.
+ first line's contents (if not just whitespace), the pathname of the
+ Scheme Script file, and then any arguments which the shell-script
+ was invoked with.
Put one space character between `#!' and the first character of
INTERPRETER (`/'). The INTERPRETER name is followed by ` \'; SCM
@@ -1957,25 +1999,25 @@ The following Scheme-Script prints factorial of its argument:
#! /usr/local/bin/scm \ %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
- !#
- ; -*-scheme-*-
- (define (go-script)
- (cond ((not *script*))
- ((and (= 1 (- (length *argv*) *optind*))
- (string->number (list-ref *argv* *optind*)))
- => (lambda (n) (print (fact n))))
- (else
- (print *argv*)
- (display "\
- Usage: fact n
- Returns the factorial of N.
- http://swissnet.ai.mit.edu/~jaffer/SLIB.html
+ (define (fact.script args)
+ (cond ((and (= 1 (length args))
+ (string->number (car args)))
+ => (lambda (n) (print (fact n)) #t))
+ (else (fact.usage))))
+
+ (define (fact.usage)
+ (print *argv*)
+ (display "\
+ Usage: fact N
+ Returns the factorial of N.
"
- (current-error-port))
- (exit #f))))
+ (current-error-port))
+ #f)
(define (fact n) (if (< n 2) 1 (* n (fact (+ -1 n)))))
- (go-script)
+
+ (if *script* (exit (fact.script (list-tail *argv* *optind*))))
./fact 32
=>
@@ -1987,10 +2029,8 @@ usage information.
./fact 3 2
-|
("./fact" "3" "2")
- Usage: fact n
+ Usage: fact N
Returns the factorial of N.
-
- http://swissnet.ai.mit.edu/~jaffer/SLIB.html

File: scm.info, Node: MS-DOS Compatible Scripts, Next: Unix Shell Scripts, Prev: Unix Scheme Scripts, Up: Scripting
@@ -2000,7 +2040,8 @@ MS-DOS Compatible Scripts
It turns out that we can create scheme-scripts which run both under unix
and MS-DOS. To implement this, I have written the MS-DOS programs:
-`#!.bat' and `!#.exe'.
+`#!.bat' and `!#.exe', which are available from: |
+<http://swissnet.ai.mit.edu/ftpdir/scm/sharpbang.zip> |
With these two programs installed in a `PATH' directory, we have the
following syntax for <PROGRAM>.BAT files.
@@ -2022,9 +2063,9 @@ following syntax for <PROGRAM>.BAT files.
`#!' tries all directories named by environment variable `PATH'.
Once the INTERPRETER executable path is found, arguments are
- processed in the manner of scheme-shell, with the all the text
- after the `\' taken as part of the meta-argument. More precisely,
- `#!' calls INTERPRETER with any options on the second line of the
+ processed in the manner of scheme-shell, with all the text after |
+ the `\' taken as part of the meta-argument. More precisely, `#!' |
+ calls INTERPRETER with any options on the second line of the |
Scheme-Script up to `!#', the name of the Scheme-Script file, and
then any of at most 8 arguments given on the command line invoking
this Scheme-Script.
@@ -2070,25 +2111,24 @@ example.
#! /bin/sh
:;exec scm -e"(set! *script* \"$0\")" -l$0 $*
- (define (go-script)
- (cond ((not *script*))
- ((and (= 1 (- (length *argv*) *optind*))
- (string->number (list-ref *argv* *optind*)))
- => (lambda (n) (print (fact n))))
- (else
- (print *argv*)
- (display "\
- Usage: fact n
- Returns the factorial of N.
+ (define (fact.script args)
+ (cond ((and (= 1 (length args))
+ (string->number (car args)))
+ => (lambda (n) (print (fact n)) #t))
+ (else (fact.usage))))
- http://swissnet.ai.mit.edu/~jaffer/SLIB.html
+ (define (fact.usage)
+ (print *argv*)
+ (display "\
+ Usage: fact N
+ Returns the factorial of N.
"
- (current-error-port))
- (exit #f))))
+ (current-error-port))
+ #f)
(define (fact n) (if (< n 2) 1 (* n (fact (+ -1 n)))))
- (go-script)
+ (if *script* (exit (fact.script (list-tail *argv* *optind*))))
./fact 6
=> 720
@@ -2102,19 +2142,17 @@ The Language
* Menu:
* Standards Compliance:: Links to sections in [R5RS] and [SLIB]
-* Miscellaneous Procedures::
+* Storage:: Finalizers, GC-hook, vector-set-length!
* Time:: Both real time and processor time
* Interrupts:: and exceptions
* Process Synchronization:: Because interrupts are preemptive
* Files and Ports::
-* Line Numbers:: |
-* Soft Ports:: Emulate I/O devices
-* Syntax Extensions::
-* Low Level Syntactic Hooks::
-* Syntactic Hooks for Hygienic Macros::
+* Eval and Load:: and line-numbers
+* Lexical Conventions:: Also called read-syntax
+* Syntax:: Macros

-File: scm.info, Node: Standards Compliance, Next: Miscellaneous Procedures, Prev: The Language, Up: The Language
+File: scm.info, Node: Standards Compliance, Next: Storage, Prev: The Language, Up: The Language
Standards Compliance
====================
@@ -2234,52 +2272,10 @@ Optionals of [R5RS] not Supported by SCM
*Note Require: (slib)Require.

-File: scm.info, Node: Miscellaneous Procedures, Next: Time, Prev: Standards Compliance, Up: The Language
-
-Miscellaneous Procedures
-========================
-
- - Function: try-load filename
- If the string FILENAME names an existing file, the try-load
- procedure reads Scheme source code expressions and definitions
- from the file and evaluates them sequentially and returns `#t'.
- If not, try-load returns `#f'. The try-load procedure does not
- affect the values returned by `current-input-port' and
- `current-output-port'.
+File: scm.info, Node: Storage, Next: Time, Prev: Standards Compliance, Up: The Language
- - Variable: *load-pathname*
- Is set to the pathname given as argument to `load', `try-load',
- and `dyn:link' (*note Compiling And Linking: (hobbit)Compiling And |
- Linking.). `*load-pathname*' is used to compute the value of |
- *Note program-vicinity: (slib)Vicinity. |
-
- - Function: line-number
- Returns the current line number of the file currently being loaded.
-
- - Function: port-filename port
- Returns the filename PORT was opened with. If PORT is not open to
- a file the result is unspecified.
-
- - Function: port-line port
- - Function: port-column port
- If PORT is a tracked port, return the current line (column) number,
- otherwise return `#f'. Line and column numbers begin with 1. The
- column number applies to the next character to be read; if that
- character is a newline, then the column number will be one more
- than the length of the line.
-
- - Function: eval obj
- Alias for *Note eval: (slib)System.
-
- - Function: eval-string str
- Returns the result of reading an expression from STR and
- evaluating it. `eval-string' does not change `*load-pathname*' or
- `line-number'.
-
- - Function: load-string str
- Reads and evaluates all the expressions from STR. As with `load',
- the value returned is unspecified. `load-string' does not change
- `*load-pathname*' or `line-number'.
+Storage
+=======
- Function: vector-set-length! object length
Change the length of string, vector, bit-vector, or uniform-array
@@ -2296,22 +2292,45 @@ Miscellaneous Procedures
on this feature; `copy-tree' could get redefined.
- Function: acons obj1 obj2 obj3
- Returns (cons (cons obj1 obj2) obj3). The expression (set! a-list
- (acons key datum a-list)) adds a new association to a-list.
+ Returns (cons (cons obj1 obj2) obj3).
- - Function: terms
- This command displays the GNU General Public License.
+ (set! a-list (acons key datum a-list))
- - Function: list-file filename
- Displays the text contents of FILENAME.
+ Adds a new association to a-list.
- - Procedure: print arg1 ...
- `Print' writes all its arguments, separated by spaces. `Print'
- outputs a `newline' at the end and returns the value of the last
- argument.
+ - Callback procedure: gc-hook ...
+ Allows a Scheme procedure to be run shortly after each garbage
+ collection. This procedure will not be run recursively. If it
+ runs long enough to cause a garbage collection before returning a
+ warning will be printed.
+
+ To remove the gc-hook, `(set! gc-hook #f)'.
+
+ - Function: add-finalizer object finalizer
+ OBJECT may be any garbage collected object, that is, any object
+ other than an immediate integer, character, or special token such
+ as `#f' or `#t', *Note Immediates::. FINALIZER is a thunk, or
+ procedure taking no arguments.
+
+ FINALIZER will be invoked asynchronously exactly once some time
+ after OBJECT becomes eligible for garbage collection. A reference
+ to OBJECT in the environment of FINALIZER will not prevent
+ finalization, but will delay the reclamation of OBJECT at least
+ until the next garbage collection. A reference to OBJECT in some
+ other object's finalizer will necessarily prevent finalization
+ until both objects are eligible for garbage collection.
+
+ Finalizers are not run in any predictable order. All finalizers
+ will be run by the time the program ends.
+
+ This facility was based on the paper by Simon Peyton Jones, et al,
+ "Stretching the storage manager: weak pointers and stable names in
+ Haskell", Proc. 11th International Workshop on the Implementation
+ of Functional Languages, The Netherlands, September 7-10 1999,
+ Springer-Verlag LNCS.

-File: scm.info, Node: Time, Next: Interrupts, Prev: Miscellaneous Procedures, Up: The Language
+File: scm.info, Node: Time, Next: Interrupts, Prev: Storage, Up: The Language
Time
====
@@ -2417,70 +2436,40 @@ Interrupts
To unestablish a response for an error set the handler symbol to
`#f'. For instance, `(set! could-not-open #f)'.
- - Callback procedure: gc-hook ... |
- Allows a Scheme procedure to be run shortly after each garbage |
- collection. This procedure will not be run recursively. If it |
- runs long enough to cause a garbage collection before returning a |
- warning will be printed. |
- |
- - Function: add-finalizer object finalizer |
- OBJECT may be any garbage collected object, that is, any object |
- other than an immediate integer, character, or special token such |
- as `#f' or `#t', *Note Immediates::. FINALIZER is a thunk, or |
- procedure taking no arguments. |
- |
- FINALIZER will be invoked asynchronously exactly once some time |
- after OBJECT becomes eligible for garbage collection. A reference |
- to OBJECT in the environment of FINALIZER will not prevent |
- finalization, but will delay the reclamation of OBJECT at least |
- until the next garbage collection. A reference to OBJECT in some |
- other object's finalizer will necessarily prevent finalization |
- until both objects are eligible for garbage collection. |
- |
- Finalizers are not run in any predictable order. All finalizers |
- will be run by the time the program ends. |
- |
- This facility was based on the paper by Simon Peyton Jones, et al, |
- "Stretching the storage manager: weak pointers and stable names in |
- Haskell", Proc. 11th International Workshop on the Implementation |
- of Functional Languages, The Netherlands, September 7-10 1999, |
- Springer-Verlag LNCS. |
- |
- |

File: scm.info, Node: Process Synchronization, Next: Files and Ports, Prev: Interrupts, Up: The Language
Process Synchronization
=======================
-An "exchanger" is a procedure of one argument regulating mutually |
-exclusive access to a resource. When a exchanger is called, its current |
-content is returned, while being replaced by its argument in an atomic |
-operation. |
- |
- - Function: make-exchanger obj |
- Returns a new exchanger with the argument OBJ as its initial |
- content. |
- |
- (define queue (make-exchanger (list a))) |
- |
- A queue implemented as an exchanger holding a list can be |
- protected from reentrant execution thus: |
- |
- (define (pop queue) |
- (let ((lst #f)) |
- (dynamic-wind |
- (lambda () (set! lst (queue #f))) |
- (lambda () (and lst (not (null? lst)) |
- (let ((ret (car lst))) |
- (set! lst (cdr lst)) |
- ret))) |
- (lambda () (and lst (queue lst)))))) |
- |
- (pop queue) => a |
- |
- (pop queue) => #f |
- |
+An "exchanger" is a procedure of one argument regulating mutually
+exclusive access to a resource. When a exchanger is called, its current
+content is returned, while being replaced by its argument in an atomic
+operation.
+
+ - Function: make-exchanger obj
+ Returns a new exchanger with the argument OBJ as its initial
+ content.
+
+ (define queue (make-exchanger (list a)))
+
+ A queue implemented as an exchanger holding a list can be
+ protected from reentrant execution thus:
+
+ (define (pop queue)
+ (let ((lst #f))
+ (dynamic-wind
+ (lambda () (set! lst (queue #f)))
+ (lambda () (and lst (not (null? lst))
+ (let ((ret (car lst)))
+ (set! lst (cdr lst))
+ ret)))
+ (lambda () (and lst (queue lst))))))
+
+ (pop queue) => a
+
+ (pop queue) => #f
+
- Function: make-arbiter name
Returns an object of type arbiter and name NAME. Its state is
initially unlocked.
@@ -2494,14 +2483,27 @@ operation. |
Otherwise, returns `#f'.

-File: scm.info, Node: Files and Ports, Next: Line Numbers, Prev: Process Synchronization, Up: The Language
- |
+File: scm.info, Node: Files and Ports, Next: Eval and Load, Prev: Process Synchronization, Up: The Language
+
Files and Ports
===============
These procedures generalize and extend the standard capabilities in
*Note Ports: (r5rs)Ports.
+* Menu:
+
+* Opening and Closing::
+* Port Properties::
+* Port Redirection::
+* Soft Ports::
+
+
+File: scm.info, Node: Opening and Closing, Next: Port Properties, Prev: Files and Ports, Up: Files and Ports
+
+Opening and Closing
+-------------------
+
- Function: open-file string modes
- Function: try-open-file string modes
Returns a port capable of receiving or delivering characters as
@@ -2519,15 +2521,15 @@ These procedures generalize and extend the standard capabilities in
Contain modes strings specifying that a file is to be opened for
reading, writing, and both reading and writing respectively.
- Both input and output functions can be used with io-ports. An end |
- of file must be read or a file-set-position done on the port |
- between a read operation and a write operation or vice-versa. |
- |
+ Both input and output functions can be used with io-ports. An end
+ of file must be read or a file-set-position done on the port
+ between a read operation and a write operation or vice-versa.
+
- Function: _ionbf modestr
Returns a version of MODESTR which when `open-file' is called with
- it as the second argument will return an unbuffered port. An |
- input-port must be unbuffered in order for `char-ready?' and |
- `wait-for-input' to work correctly on it. The initial value of |
+ it as the second argument will return an unbuffered port. An
+ input-port must be unbuffered in order for `char-ready?' and
+ `wait-for-input' to work correctly on it. The initial value of
`(current-input-port)' is unbuffered if the platform supports it.
- Function: _tracked modestr
@@ -2536,49 +2538,58 @@ These procedures generalize and extend the standard capabilities in
port maintains current line and column numbers, which may be
queried with `port-line' and `port-column'.
- - Function: _exclusive modestr |
- Returns a version of MODESTR which when `open-file' is called with |
- it as the second argument will return a port only if the named file |
- does not already exist. This functionality is provided by calling |
- `try-create-file' *Note I/O-Extensions::, which is not available |
- for all platforms. |
- |
- - Function: port-closed? port |
- Returns #t if PORT is closed. |
- |
- - Function: port-type obj |
- If OBJ is not a port returns false, otherwise returns a symbol |
- describing the port type, for example string or pipe. |
- |
+ - Function: _exclusive modestr
+ Returns a version of MODESTR which when `open-file' is called with
+ it as the second argument will return a port only if the named file
+ does not already exist. This functionality is provided by calling
+ `try-create-file' *Note I/O-Extensions::, which is not available
+ for all platforms.
+
+ - Function: open-ports
+ Returns a list of all currently open ports, excluding string ports,
+ see *Note String Ports: (slib)String Ports. This may be useful
+ after a fork *Note Posix Extensions::, or for debugging. Bear in
+ mind that ports that would be closed by gc will be kept open by a
+ reference to this list.
+
- Function: close-port port
Closes PORT. The same as close-input-port and close-output-port.
- |
- - Function: current-error-port
- Returns the current port to which diagnostic output is directed.
- - Function: with-error-to-file string thunk
- THUNK must be a procedure of no arguments, and string must be a
- string naming a file. The file is opened for output, an output
- port connected to it is made the default value returned by
- current-error-port, and the THUNK is called with no arguments.
- When the thunk returns, the port is closed and the previous
- default is restored. With-error-to-file returns the value yielded
- by THUNK.
+
+File: scm.info, Node: Port Properties, Next: Port Redirection, Prev: Opening and Closing, Up: Files and Ports
- - Function: with-input-from-port port thunk
- - Function: with-output-to-port port thunk
- - Function: with-error-to-port port thunk
- These routines differ from with-input-from-file,
- with-output-to-file, and with-error-to-file in that the first
- argument is a port, rather than a string naming a file.
+Port Properties
+---------------
- - Function: call-with-outputs thunk proc
- Calls the THUNK procedure while the current-output-port and
- current-error-port are directed to string-ports. If THUNK
- returns, the PROC procedure is called with the output-string, the
- error-string, and the value returned by THUNK. If THUNK does not
- return a value (perhaps because of error), PROC is called with
- just the output-string and the error-string as arguments.
+ - Function: port-closed? port
+ Returns #t if PORT is closed.
+
+ - Function: port-type obj
+ If OBJ is not a port returns false, otherwise returns a symbol
+ describing the port type, for example string or pipe.
+
+ - Function: port-filename port
+ Returns the filename PORT was opened with. If PORT is not open to
+ a file the result is unspecified.
+
+ - Function: port-line port
+ - Function: port-column port
+ If PORT is a tracked port, return the current line (column) number,
+ otherwise return `#f'. Line and column numbers begin with 1. The
+ column number applies to the next character to be read; if that
+ character is a newline, then the column number will be one more
+ than the length of the line.
+
+ - Function: freshline port
+ Outputs a newline to optional argument PORT unless the current
+ output column number of PORT is known to be zero, ie output will
+ start at the beginning of a new line. PORT defaults to
+ `current-output-port'. If PORT is not a tracked port `freshline'
+ is equivalent to `newline'.
+
+ - Function: isatty? port
+ Returns `#t' if PORT is input or output to a serial non-file
+ device.
- procedure: char-ready?
- procedure: char-ready? port
@@ -2606,81 +2617,44 @@ These procedures generalize and extend the standard capabilities in
omitted, in which case they default to the list of the value
returned by `current-input-port'.
- - Function: isatty? port
- Returns `#t' if PORT is input or output to a serial non-file
- device.
+
+File: scm.info, Node: Port Redirection, Next: Soft Ports, Prev: Port Properties, Up: Files and Ports
- - Function: freshline port
- Outputs a newline to optional argument PORT unless the current
- output column number of PORT is known to be zero, ie output will
- start at the beginning of a new line. PORT defaults to
- `current-output-port'. If PORT is not a tracked port `freshline'
- is equivalent to `newline'.
+Port Redirection
+----------------
+
+ - Function: current-error-port
+ Returns the current port to which diagnostic output is directed.
+
+ - Function: with-error-to-file string thunk
+ THUNK must be a procedure of no arguments, and string must be a
+ string naming a file. The file is opened for output, an output
+ port connected to it is made the default value returned by
+ current-error-port, and the THUNK is called with no arguments.
+ When the thunk returns, the port is closed and the previous
+ default is restored. With-error-to-file returns the value yielded
+ by THUNK.
+
+ - Function: with-input-from-port port thunk
+ - Function: with-output-to-port port thunk
+ - Function: with-error-to-port port thunk
+ These routines differ from with-input-from-file,
+ with-output-to-file, and with-error-to-file in that the first
+ argument is a port, rather than a string naming a file.
+
+ - Function: call-with-outputs thunk proc
+ Calls the THUNK procedure while the current-output-port and
+ current-error-port are directed to string-ports. If THUNK
+ returns, the PROC procedure is called with the output-string, the
+ error-string, and the value returned by THUNK. If THUNK does not
+ return a value (perhaps because of error), PROC is called with
+ just the output-string and the error-string as arguments.
- - Function: open-ports |
- Returns a list of all currently open ports, excluding string ports, |
- see *Note String Ports: (slib)String Ports. This may be useful |
- after a fork *Note Posix Extensions::, or for debugging. Bear in |
- mind that ports that would be closed by gc will be kept open by a |
- reference to this list. |
- |
-
-File: scm.info, Node: Line Numbers, Next: Soft Ports, Prev: Files and Ports, Up: The Language
- |
-Line Numbers |
-============ |
- |
-Scheme code define by load may optionally contain line number |
-information. Currently this information is used only for reporting |
-expansion time errors, but in the future run-time error messages may |
-also include line number information. |
- |
- - Function: try-load pathname reader |
- This is the primitive for loading, PATHNAME is the name of a file |
- containing Scheme code, and optional argument READER is a function |
- of one argument, a port. READER should read and return Scheme |
- code as list structure. The default value is `read', which is |
- used if READER is not supplied or is false. |
- |
-Line number objects are disjoint from integers or other Scheme types. |
-When evaluated or loaded as Scheme code, an s-expression containing a |
-line-number in the car is equivalent to the cdr of the s-expression. A |
-pair consisting of a line-number in the car and a vector in the cdr is |
-equivalent to the vector. The meaning of s-expressions with |
-line-numbers in other positions is undefined. |
- |
- - Function: read-numbered port |
- Behaves like `read', except that every s-expression read will be |
- replaced with a cons of a line-number object and the sexp actually |
- read. This replacement is done only if PORT is a tracked port See |
- *Note Files and Ports::. |
- |
- - Function: integer->line-number int |
- Returns a line-number object with value INT. INT should be an |
- exact non-negative integer. |
- |
- - Function: line-number->integer linum |
- Returns the value of line-number object LINUM as an integer. |
- |
- - Function: line-number? obj |
- Returns true if and only if OBJ is a line-number object. |
- |
- - Variable: *load-reader* |
- - Variable: *slib-load-reader* |
- The value of `*load-reader*' should be a value acceptable as the |
- second argument to `try-load' (note that #f is acceptable). This |
- value will be used to read code during calls to `scm:load'. The |
- value of `*slib-load-reader*' will similarly be used during calls |
- to `slib:load' and `require'. |
- |
- In order to disable all line-numbering, it is sufficient to set! |
- `*load-reader*' and `*slib-load-reader*' to #f. |
- |

-File: scm.info, Node: Soft Ports, Next: Syntax Extensions, Prev: Line Numbers, Up: The Language
- |
+File: scm.info, Node: Soft Ports, Prev: Port Redirection, Up: Files and Ports
+
Soft Ports
-==========
+----------
A "soft-port" is a port based on a vector of procedures capable of
accepting or delivering characters. It allows emulation of I/O ports.
@@ -2710,9 +2684,9 @@ accepting or delivering characters. It allows emulation of I/O ports.
(r5rs)Input.) it indicates that the port has reached end-of-file.
For example:
- If it is necessary to explicitly close the port when it is garbage |
- collected, (*note add-finalizer: Interrupts.). |
- |
+ If it is necessary to explicitly close the port when it is garbage
+ collected, (*note add-finalizer: Interrupts.).
+
(define stdout (current-output-port))
(define p (make-soft-port
(vector
@@ -2726,10 +2700,194 @@ accepting or delivering characters. It allows emulation of I/O ports.
(write p p) => #<input-output-soft#\space45d10#\>

-File: scm.info, Node: Syntax Extensions, Next: Low Level Syntactic Hooks, Prev: Soft Ports, Up: The Language
+File: scm.info, Node: Eval and Load, Next: Lexical Conventions, Prev: Files and Ports, Up: The Language
+
+Eval and Load
+=============
+
+ - Function: try-load filename
+ If the string FILENAME names an existing file, the try-load
+ procedure reads Scheme source code expressions and definitions
+ from the file and evaluates them sequentially and returns `#t'.
+ If not, try-load returns `#f'. The try-load procedure does not
+ affect the values returned by `current-input-port' and
+ `current-output-port'.
+
+ - Variable: *load-pathname*
+ Is set to the pathname given as argument to `load', `try-load',
+ and `dyn:link' (*note Compiling And Linking: (hobbit)Compiling And
+ Linking.). `*load-pathname*' is used to compute the value of
+ *Note program-vicinity: (slib)Vicinity.
+
+ - Function: eval obj
+ Alias for *Note eval: (slib)System.
+
+ - Function: eval-string str
+ Returns the result of reading an expression from STR and
+ evaluating it. `eval-string' does not change `*load-pathname*' or
+ `line-number'.
+
+ - Function: load-string str
+ Reads and evaluates all the expressions from STR. As with `load',
+ the value returned is unspecified. `load-string' does not change
+ `*load-pathname*' or `line-number'.
+
+ - Function: line-number
+ Returns the current line number of the file currently being loaded.
+
+* Menu:
+
+* Line Numbers::
+
+
+File: scm.info, Node: Line Numbers, Prev: Eval and Load, Up: Eval and Load
+
+Line Numbers
+------------
+
+Scheme code defined by load may optionally contain line number
+information. Currently this information is used only for reporting
+expansion time errors, but in the future run-time error messages may
+also include line number information.
+
+ - Function: try-load pathname reader
+ This is the primitive for loading, PATHNAME is the name of a file
+ containing Scheme code, and optional argument READER is a function
+ of one argument, a port. READER should read and return Scheme
+ code as list structure. The default value is `read', which is
+ used if READER is not supplied or is false.
+
+Line number objects are disjoint from integers or other Scheme types.
+When evaluated or loaded as Scheme code, an s-expression containing a
+line-number in the car is equivalent to the cdr of the s-expression. A
+pair consisting of a line-number in the car and a vector in the cdr is
+equivalent to the vector. The meaning of s-expressions with
+line-numbers in other positions is undefined.
+
+ - Function: read-numbered port
+ Behaves like `read', except that |
+ |
+ bullet Load (read) sytnaxes are enabled. |
+ |
+ bullet every s-expression read will be replaced with a cons of |
+ a line-number object and the sexp actually read. This |
+ replacement is done only if PORT is a tracked port See *Note |
+ Files and Ports::. |
+ |
+
+ - Function: integer->line-number int
+ Returns a line-number object with value INT. INT should be an
+ exact non-negative integer.
+
+ - Function: line-number->integer linum
+ Returns the value of line-number object LINUM as an integer.
+
+ - Function: line-number? obj
+ Returns true if and only if OBJ is a line-number object.
+
+ - Function: read-for-load port |
+ Behaves like `read', except that load syntaxes are enabled. |
+ |
+ - Variable: *load-reader*
+ - Variable: *slib-load-reader*
+ The value of `*load-reader*' should be a value acceptable as the
+ second argument to `try-load' (note that #f is acceptable). This
+ value will be used to read code during calls to `scm:load'. The
+ value of `*slib-load-reader*' will similarly be used during calls
+ to `slib:load' and `require'.
+
+ In order to disable all line-numbering, it is sufficient to set!
+ `*load-reader*' and `*slib-load-reader*' to #f.
+
+
+File: scm.info, Node: Lexical Conventions, Next: Syntax, Prev: Eval and Load, Up: The Language
+
+Lexical Conventions
+===================
+
+* Menu:
+
+* Common-Lisp Read Syntax::
+* Load Syntax:: |
+* Documentation and Comments::
+* Modifying Read Syntax::
+
+
+File: scm.info, Node: Common-Lisp Read Syntax, Next: Load Syntax, Prev: Lexical Conventions, Up: Lexical Conventions
+ |
+Common-Lisp Read Syntax
+-----------------------
+
+ - Read syntax: #\token |
+ If TOKEN is a sequence of two or more digits, then this syntax is |
+ equivalent to `#.(integer->char (string->number token 8))'. |
+
+ If TOKEN is `C-', `c-', or `^' followed by a character, then this |
+ syntax is read as a control character. If TOKEN is `M-' or `m-' |
+ followed by a character, then a meta character is read. `c-' and |
+ `m-' prefixes may be combined. |
+
+ - Read syntax: #+ feature form
+ If feature is `provided?' (by `*features*') then FORM is read as a
+ scheme expression. If not, then FORM is treated as whitespace.
+
+ Feature is a boolean expression composed of symbols and `and',
+ `or', and `not' of boolean expressions.
+
+ For more information on `provided?' and `*features*', *Note
+ Require: (slib)Require.
-Syntax Extensions
-=================
+ - Read syntax: #- feature form
+ is equivalent to `#+(not feature) expression'.
+ |
+ - Read syntax: #| any thing |#
+ Is a balanced comment. Everything up to the matching `|#' is
+ ignored by the `read'. Nested `#|...|#' can occur inside ANY
+ THING.
+
+"Load sytax" is Read syntax enabled for `read' only when that `read' is |
+part of loading a file or string. This distinction was made so that |
+reading from a datafile would not be able to corrupt a scheme program |
+using `#.'. |
+
+ - Load syntax: #. expression |
+ Is read as the object resulting from the evaluation of EXPRESSION. |
+ This substitution occurs even inside quoted structure. |
+
+ In order to allow compiled code to work with `#.' it is good |
+ practice to define those symbols used inside of EXPRESSION with |
+ `#.(define ...)'. For example: |
+ |
+ #.(define foo 9) => #<unspecified> |
+ '(#.foo #.(+ foo foo)) => (9 18) |
+ |
+ - Load syntax: #' form |
+ is equivalent to FORM (for compatibility with common-lisp). |
+
+
+File: scm.info, Node: Load Syntax, Next: Documentation and Comments, Prev: Common-Lisp Read Syntax, Up: Lexical Conventions
+ |
+Load Syntax |
+----------- |
+ |
+"#!" is the unix mechanism for executing scripts. See *Note Unix
+Scheme Scripts:: for the full description of how this comment supports |
+scripting. |
+ |
+ - Load syntax: #?line |
+ - Load syntax: #?column |
+ Return integers for the current line and column being read during a |
+ load. |
+ |
+ - Load syntax: #?file |
+ Returns the string naming the file currently being loaded. This |
+ path is the string passed to `load', possibly with `.scm' appended. |
+ |
+
+File: scm.info, Node: Documentation and Comments, Next: Modifying Read Syntax, Prev: Load Syntax, Up: Lexical Conventions
+ |
+Documentation and Comments
+--------------------------
- procedure: procedure-documentation proc
Returns the documentation string of PROC if it exists, or `#f' if
@@ -2755,52 +2913,83 @@ Syntax Extensions
Returns the (appended) strings given as arguments to previous calls
`comment' and empties the current string collection.
- - Read syntax: #;text-till-end-of-line
+ - Load syntax: #;text-till-end-of-line |
Behaves as `(comment "TEXT-TILL-END-OF-LINE")'.
- - Read syntax: #. expression
- Is read as the object resulting from the evaluation of EXPRESSION.
- This substitution occurs even inside quoted structure.
+
+File: scm.info, Node: Modifying Read Syntax, Prev: Documentation and Comments, Up: Lexical Conventions
- In order to allow compiled code to work with `#.' it is good
- practice to define those symbols used inside of EXPRESSION with
- `#.(define ...)'. For example:
+Modifying Read Syntax
+---------------------
- #.(define foo 9) => #<unspecified>
- '(#.foo #.(+ foo foo)) => (9 18)
+ - Callback procedure: read:sharp c port
+ If a <#> followed by a character (for a non-standard syntax) is
+ encountered by `read', `read' will call the value of the symbol
+ `read:sharp' with arguments the character and the port being read
+ from. The value returned by this function will be the value of
+ `read' for this expression unless the function returns
+ `#<unspecified>' in which case the expression will be treated as
+ whitespace. `#<unspecified>' is the value returned by the
+ expression `(if #f #f)'.
- - Read syntax: #+ feature form
- If feature is `provided?' (by `*features*') then FORM is read as a
- scheme expression. If not, then FORM is treated as whitespace.
+ - Callback procedure: load:sharp c port |
+ Dispatches like `read:sharp', but only during `load's. The |
+ read-syntaxes handled by `load:sharp' are a superset of those |
+ handled by `read:sharp'. `load:sharp' calls `read:sharp' if none |
+ of its syntaxes match C. |
+ |
+ - Callback procedure: char:sharp token |
+ If the sequence <#\> followed by a non-standard character name is
+ encountered by `read', `read' will call the value of the symbol
+ `char:sharp' with the token (a string of length at least two) as |
+ argument. If the value returned is a character, then that will be |
+ the value of `read' for this expression, otherwise an error will |
+ be signaled. |
- Feature is a boolean expression composed of symbols and `and',
- `or', and `not' of boolean expressions.
+_Note:_ When adding new <#> syntaxes, have your code save the previous
+value of `load:sharp', `read:sharp', or `char:sharp' when defining it. |
+Call this saved value if an invocation's syntax is not recognized. |
+This will allow `#+', `#-', and *Note Uniform Array::s to still be |
+supported (as they dispatch from `read:sharp'). |
- For more information on `provided?' and `*features*', *Note
- Require: (slib)Require.
+
+File: scm.info, Node: Syntax, Prev: Lexical Conventions, Up: The Language
- - Read syntax: #- feature form
- is equivalent to `#+(not feature) expression'.
+Syntax
+======
- - Read syntax: #' form
- is equivalent to FORM (for compatibility with common-lisp).
+SCM provides a native implementation of "defmacro". *Note Defmacro:
+(slib)Defmacro.
- - Read syntax: #| any thing |#
- Is a balanced comment. Everything up to the matching `|#' is
- ignored by the `read'. Nested `#|...|#' can occur inside ANY
- THING.
+When built with `-F macro' build option (*note Build Options::) and
+`*syntax-rules*' is non-false, SCM also supports [R5RS] `syntax-rules'
+macros. *Note Macros: (r5rs)Macros.
+
+Other Scheme Syntax Extension Packages from SLIB can be employed through
+the use of `macro:eval' and `macro:load'; Or by using the SLIB
+read-eval-print-loop:
-A similar read syntax "#!" (exclamation rather than vertical bar) is
-supported for Posix shell-scripts (*note Scripting::).
+ (require 'repl)
+ (repl:top-level macro:eval)
- - Read syntax: #\token
- If TOKEN is a sequence of two or more digits, then this syntax is
- equivalent to `#.(integer->char (string->number token 8))'.
+With the appropriate catalog entries (*note Library Catalogs:
+(slib)Library Catalogs.), files using macro packages will automatically
+use the correct macro loader when `require'd.
- If TOKEN is `C-', `c-', or `^' followed by a character, then this
- syntax is read as a control character. If TOKEN is `M-' or `m-'
- followed by a character, then a meta character is read. `c-' and
- `m-' prefixes may be combined.
+* Menu:
+
+* Define and Set::
+* Defmacro::
+* Syntax-Rules::
+* Macro Primitives::
+* Environment Frames::
+* Syntactic Hooks for Hygienic Macros::
+
+
+File: scm.info, Node: Define and Set, Next: Defmacro, Prev: Syntax, Up: Syntax
+
+Define and Set
+--------------
- Special Form: defined? symbol
Equivalent to `#t' if SYMBOL is a syntactic keyword (such as `if')
@@ -2814,7 +3003,7 @@ supported for Posix shell-scripts (*note Scripting::).
INITIAL-VALUE as if the `defvar' form were instead the form
`(define identifier initial-value)' . If IDENTIFIER already has a
value, then INITIAL-VALUE is _not_ evaluated and IDENTIFIER's
- value is not changed. `defconst' is valid only when used at
+ value is not changed. `defvar' is valid only when used at |
top-level.
- Special Form: defconst identifier value
@@ -2840,9 +3029,9 @@ supported for Posix shell-scripts (*note Scripting::).
(set! (x y) (list 4 5)) => _unspecified_
(+ x y) => 9
- - Special Form: qase key clause1 clause2 ... |
- `qase' is an extension of standard Scheme `case': Each CLAUSE of a |
- `qase' statement must have as first element a list containing |
+ - Special Form: qase key clause1 clause2 ...
+ `qase' is an extension of standard Scheme `case': Each CLAUSE of a
+ `qase' statement must have as first element a list containing
elements which are:
* literal datums, or
@@ -2852,7 +3041,7 @@ supported for Posix shell-scripts (*note Scripting::).
* a comma followed by an at-sign (@) followed by the name of a
symbolic constant whose value is a list.
- A `qase' statement is equivalent to a `case' statement in which |
+ A `qase' statement is equivalent to a `case' statement in which
these symbolic constants preceded by commas have been replaced by
the values of the constants, and all symbolic constants preceded by
comma-at-signs have been replaced by the elements of the list
@@ -2861,27 +3050,32 @@ supported for Posix shell-scripts (*note Scripting::).
unquoted expressions must be "symbolic constants".
Symbolic constants are defined using `defconst', their values are
- substituted in the head of each `qase' clause during macro |
+ substituted in the head of each `qase' clause during macro
expansion. `defconst' constants should be defined before use.
- `qase' can be substituted for any correct use of `case'. |
+ `qase' can be substituted for any correct use of `case'.
(defconst unit '1)
(defconst semivowels '(w y))
- (qase (* 2 3) |
+ (qase (* 2 3)
((2 3 5 7) 'prime)
((,unit 4 6 8 9) 'composite)) ==> composite
- (qase (car '(c d)) |
+ (qase (car '(c d))
((a) 'a)
((b) 'b)) ==> _unspecified_
- (qase (car '(c d)) |
+ (qase (car '(c d))
((a e i o u) 'vowel)
((,@semivowels) 'semivowel)
(else 'consonant)) ==> consonant
+
+File: scm.info, Node: Defmacro, Next: Syntax-Rules, Prev: Define and Set, Up: Syntax
+
+Defmacro
+--------
-SCM also supports the following constructs from Common Lisp:
-`defmacro', `macroexpand', `macroexpand-1', and `gentemp'. *Note
-Defmacro: (slib)Defmacro.
+SCM supports the following constructs from Common Lisp: `defmacro',
+`macroexpand', `macroexpand-1', and `gentemp'. *Note Defmacro:
+(slib)Defmacro.
SCM `defmacro' is extended over that described for SLIB:
@@ -2907,13 +3101,19 @@ For example:
(let1 not legal syntax) error--> not "does not match" ((name value))
+
+File: scm.info, Node: Syntax-Rules, Next: Macro Primitives, Prev: Defmacro, Up: Syntax
+
+Syntax-Rules
+------------
+
SCM supports [R5RS] `syntax-rules' macros *Note Macros: (r5rs)Macros.
-The pattern language is extended by the syntax `(... <obj>)', which is |
-identical to `<obj>' except that ellipses in `<obj>' are treated as |
-ordinary identifiers in a template, or as literals in a pattern. In |
-particular, `(... ...)' quotes the ellipsis token `...' in a pattern or |
-template. |
+The pattern language is extended by the syntax `(... <obj>)', which is
+identical to `<obj>' except that ellipses in `<obj>' are treated as
+ordinary identifiers in a template, or as literals in a pattern. In
+particular, `(... ...)' quotes the ellipsis token `...' in a pattern or
+template.
For example:
(define-syntax check-tree
@@ -2956,34 +3156,10 @@ For example:
(set! eight 9) => ERROR

-File: scm.info, Node: Low Level Syntactic Hooks, Next: Syntactic Hooks for Hygienic Macros, Prev: Syntax Extensions, Up: The Language
-
-Low Level Syntactic Hooks
-=========================
+File: scm.info, Node: Macro Primitives, Next: Environment Frames, Prev: Syntax-Rules, Up: Syntax
- - Callback procedure: read:sharp c port
- If a <#> followed by a character (for a non-standard syntax) is
- encountered by `read', `read' will call the value of the symbol
- `read:sharp' with arguments the character and the port being read
- from. The value returned by this function will be the value of
- `read' for this expression unless the function returns
- `#<unspecified>' in which case the expression will be treated as
- whitespace. `#<unspecified>' is the value returned by the
- expression `(if #f #f)'.
-
- - Callback procedure: read:sharp-char token
- If the sequence <#\> followed by a non-standard character name is
- encountered by `read', `read' will call the value of the symbol
- `read:sharp-char' with the token (a string of length at least two)
- as argument. If the value returned is a character, then that will
- be the value of `read' for this expression, otherwise an error
- will be signaled.
-
-_Note:_ When adding new <#> syntaxes, have your code save the previous
-value of `read:sharp' or `read:sharp-char' when defining it. Call this
-saved value if an invocation's syntax is not recognized. This will
-allow `#+', `#-', `#!', and *Note Uniform Array::s to still be
-supported (as they use `read:sharp').
+Macro Primitives
+----------------
- Function: procedure->syntax proc
Returns a "macro" which, when a symbol defined to this value
@@ -3000,7 +3176,7 @@ supported (as they use `read:sharp').
`PROCEDURE->MEMOIZING-MACRO' replaces the form passed to PROC.
For example:
- (defsyntax trace |
+ (defsyntax trace
(procedure->macro
(lambda (x env) `(set! ,(cadr x) (tracef ,(cadr x) ',(cadr x))))))
@@ -3014,56 +3190,62 @@ supported (as they use `read:sharp').
identifier.
- - Special Form: defsyntax name expr |
- Defines NAME as a macro keyword bound to the result of evaluating |
- EXPR, which should be a macro. Using `define' for this purpose |
- may not result in NAME being interpreted as a macro keyword. |
- |
-An "environment" is a list of frames representing lexical bindings. |
-Only the names and scope of the bindings are included in environments |
-passed to macro expanders - run-time values are not included. |
- |
-There are several types of environment frames: |
+ - Special Form: defsyntax name expr
+ Defines NAME as a macro keyword bound to the result of evaluating
+ EXPR, which should be a macro. Using `define' for this purpose
+ may not result in NAME being interpreted as a macro keyword.
+
+
+File: scm.info, Node: Environment Frames, Next: Syntactic Hooks for Hygienic Macros, Prev: Macro Primitives, Up: Syntax
+
+Environment Frames
+------------------
+
+An "environment" is a list of frames representing lexical bindings.
+Only the names and scope of the bindings are included in environments
+passed to macro expanders - run-time values are not included.
+
+There are several types of environment frames:
`((lambda (variable1 ...) ...) value1 ...)'
`(let ((variable1 value1) (variable2 value2) ...) ...)'
`(letrec ((variable1 value1) ...) ...)'
result in a single enviroment frame:
- |
- (variable1 variable2 ...) |
+
+ (variable1 variable2 ...)
`(let ((variable1 value1)) ...)'
`(let* ((variable1 value1) ...) ...)'
result in an environment frame for each variable:
- |
- variable1 variable2 ... |
- |
-`(let-syntax ((key1 macro1) (key2 macro2)) ...)' |
-`(letrec-syntax ((key1 value1) (key2 value2)) ...)' |
- Lexically bound macros result in environment frames consisting of |
- a marker and an alist of keywords and macro objects: |
- |
- (<env-syntax-marker> (key1 . value1) (key2 . value2)) |
- Currently <env-syntax-marker> is the integer 6. |
- |
-`line numbers' |
- Line numbers (*note Line Numbers::) may be included in the |
- environment as frame entries to indicate the line number on which |
- a function is defined. They are ignored for variable lookup. |
- |
- #<line 8> |
- |
-`miscellaneous' |
- Debugging information is stored in environments in a plist format: |
- Any exact integer stored as an environment frame may be followed |
- by any value. The two frame entries are ignored when doing |
- variable lookup. Load file names, procedure names, and closure |
- documentation strings are stored in this format. |
- |
- <env-filename-marker> "foo.scm" <env-procedure-name-marker> foo ... |
- |
- Currently <env-filename-marker> is the integer 1 and |
- <env-procedure-name-marker> the integer 2. |
+
+ variable1 variable2 ...
+
+`(let-syntax ((key1 macro1) (key2 macro2)) ...)'
+`(letrec-syntax ((key1 value1) (key2 value2)) ...)'
+ Lexically bound macros result in environment frames consisting of
+ a marker and an alist of keywords and macro objects:
+
+ (<env-syntax-marker> (key1 . value1) (key2 . value2))
+ Currently <env-syntax-marker> is the integer 6.
+
+`line numbers'
+ Line numbers (*note Line Numbers::) may be included in the
+ environment as frame entries to indicate the line number on which
+ a function is defined. They are ignored for variable lookup.
+
+ #<line 8>
+
+`miscellaneous'
+ Debugging information is stored in environments in a plist format:
+ Any exact integer stored as an environment frame may be followed
+ by any value. The two frame entries are ignored when doing
+ variable lookup. Load file names, procedure names, and closure
+ documentation strings are stored in this format.
+
+ <env-filename-marker> "foo.scm" <env-procedure-name-marker> foo ...
+
+ Currently <env-filename-marker> is the integer 1 and
+ <env-procedure-name-marker> the integer 2.
- Special Form: @apply procedure argument-list
Returns the result of applying PROCEDURE to ARGUMENT-LIST.
@@ -3078,10 +3260,10 @@ There are several types of environment frames: |
bindings.

-File: scm.info, Node: Syntactic Hooks for Hygienic Macros, Prev: Low Level Syntactic Hooks, Up: The Language
+File: scm.info, Node: Syntactic Hooks for Hygienic Macros, Prev: Environment Frames, Up: Syntax
Syntactic Hooks for Hygienic Macros
-===================================
+-----------------------------------
SCM provides a synthetic identifier type for efficient implementation of
hygienic macros (for example, `syntax-rules' *note Macros:
@@ -3117,7 +3299,7 @@ will be repeatedly replaced by its parent, until a symbol is obtained.
Returns the symbol obtained by recursively extracting the parent of
ID, which must be an identifier.
-Use of synthetic identifiers
+Use of Synthetic Identifiers
----------------------------
`renamed-identifier' may be used as a replacement for `gentemp':
@@ -3156,10 +3338,10 @@ lexical scope of its environment.
There is another restriction imposed for implementation convenience:
Macros passing their lexical environments to `renamed-identifier' may
-be lexically bound only by the special forms `let-syntax' or |
-`letrec-syntax'. No error is signaled if this restriction is not met, |
+be lexically bound only by the special forms `let-syntax' or
+`letrec-syntax'. No error is signaled if this restriction is not met,
but synthetic identifier lookup will not work properly.
- |
+
In order to maintain referential transparency it is necessary to
determine whether two identifiers have the same denotation. With
synthetic identifiers it is not necessary that two identifiers be `eq?'
@@ -3238,15 +3420,15 @@ Packages
********
* Menu:
- |
+
* Dynamic Linking::
* Dump:: Create Fast-Booting Executables
* Numeric:: Numeric Language Extensions
* Arrays:: As in APL
-* Records:: Define new aggregate data types |
+* Records:: Define new aggregate data types
* I/O-Extensions:: i/o-extensions
* Posix Extensions:: posix
-* Unix Extensions:: non-posix unix |
+* Unix Extensions:: non-posix unix
* Regular Expression Pattern Matching:: regex
* Line Editing:: edit-line
* Curses:: Screen Control
@@ -3255,11 +3437,11 @@ Packages
* Menu:
* Xlib: (Xlibscm). X Window Graphics.
-* Hobbit: (hobbit). Scheme-to-C Compiler. |
+* Hobbit: (hobbit). Scheme-to-C Compiler.

File: scm.info, Node: Dynamic Linking, Next: Dump, Prev: Packages, Up: Packages
- |
+
Dynamic Linking
===============
@@ -3405,8 +3587,8 @@ There are constraints on which sessions are savable using `dump'
* Creates an executable program named NEWPATH which continues
the state of the current SCM session when invoked. The
optional argument THUNK, if provided, should be a procedure
- of no arguments; BOOT-TAIL will be set to this procedure, |
- causing it to be called in the restored executable. |
+ of no arguments; BOOT-TAIL will be set to this procedure,
+ causing it to be called in the restored executable.
If the optional argument is missing or a boolean, SCM's
standard command line processing will be called in the
@@ -3434,7 +3616,7 @@ The procedure `program-arguments' returns the command line arguments
for the curent invocation. More specifically, `program-arguments' for
the restored session are _not_ saved from the dumping session. Command
line processing is done on the value of the identifier `*argv*'.
- |
+
The following example shows how to create `rscm', which is like regular
scm, but which loads faster and has the `random' package alreadly
provided.
@@ -3531,73 +3713,39 @@ operations: (r5rs)Numerical operations.

File: scm.info, Node: Arrays, Next: Records, Prev: Numeric, Up: Packages
- |
+
Arrays
======
* Menu:
* Conventional Arrays::
-* Array Mapping:: array-for-each
* Uniform Array::
* Bit Vectors::
+* Array Mapping:: array-for-each

-File: scm.info, Node: Conventional Arrays, Next: Array Mapping, Prev: Arrays, Up: Arrays
+File: scm.info, Node: Conventional Arrays, Next: Uniform Array, Prev: Arrays, Up: Arrays
Conventional Arrays
-------------------
+The following syntax and procedures are SCM extensions to feature
+`array' in *Note Arrays: (slib)Arrays.
+
"Arrays" read and write as a `#' followed by the "rank" (number of
dimensions) followed by the character #\a or #\A and what appear as
lists (of lists) of elements. The lists must be nested to the depth of
the rank. For each depth, all lists must be the same length.
- (make-array 'ho 3 3) =>
- #2A((ho ho ho) (ho ho ho) (ho ho ho))
+ (create-array '#(ho) 4 3) => |
+ #2A((ho ho ho) (ho ho ho) (ho ho ho) (ho ho ho)) |
The rank may be elided, in which case it is read as one.
'#A(a b c) == '#(a b c)
-Unshared conventional (not uniform) 0-based arrays of rank 1 (dimension)
-are equivalent to (and can't be distinguished from) vectors.
- (make-array 'ho 3) => #(ho ho ho)
-
-When constructing an array, BOUND is either an inclusive range of
-indices expressed as a two element list, or an upper bound expressed as
-a single integer. So
- (make-array 'foo 3 3) == (make-array 'foo '(0 2) '(0 2))
-
- - Function: array? obj
- Returns `#t' if the OBJ is an array, and `#f' if not.
-
- - Function: make-array initial-value bound1 bound2 ...
- Creates and returns an array that has as many dimensions as there
- are BOUNDs and fills it with INITIAL-VALUE.
-
- - Function: array-ref array index1 index2 ...
- Returns the INDEX1, INDEX2, ...'th element of ARRAY.
-
- - Function: array-in-bounds? array index1 index2 ...
- Returns `#t' if its arguments would be acceptable to ARRAY-REF.
-
- - Function: array-set! array new-value index1 index2 ...
- Sets the INDEX1, INDEX2, ...'th element of ARRAY to NEW-VALUE.
- The value returned by `array-set!' is unspecified.
-
- - Function: make-shared-array array mapper bound1 bound2 ...
- `make-shared-array' can be used to create shared subarrays of other
- arrays. The MAPPER is a function that translates coordinates in
- the new array into coordinates in the old array. A MAPPER must be
- linear, and its range must stay within the bounds of the old
- array, but it can be otherwise arbitrary. A simple example:
- (define fred (make-array #f 8 8))
- (define freds-diagonal
- (make-shared-array fred (lambda (i) (list i i)) 8))
- (array-set! freds-diagonal 'foo 3)
- (array-ref fred 3 3) => foo
- (define freds-center
- (make-shared-array fred (lambda (i j) (list (+ 3 i) (+ 3 j))) 2 2))
- (array-ref freds-center 0 0) => foo
+Unshared, conventional (not uniform) 0-based arrays of rank 1 are
+equivalent to (and can't be distinguished from) scheme vectors.
+ (create-array '#(ho) 3) => #(ho ho ho)
- Function: transpose-array array dim0 dim1 ...
Returns an array sharing contents with ARRAY, but with dimensions
@@ -3638,110 +3786,24 @@ a single integer. So
(enclose-array '#3A(((a b c) (d e f)) ((1 2 3) (4 5 6))) 1 0) =>
#<enclosed-array #2A((a 1) (d 4)) #2A((b 2) (e 5)) #2A((c 3) (f 6))>
- - Function: array-shape array
- Returns a list of inclusive bounds of integers.
- (array-shape (make-array 'foo '(-1 3) 5)) => ((-1 3) (0 4))
-
- - Function: array-dimensions array
- `Array-dimensions' is similar to `array-shape' but replaces
- elements with a `0' minimum with one greater than the maximum. So:
- (array-dimensions (make-array 'foo '(-1 3) 5)) => ((-1 3) 5)
-
- - Function: array-rank obj
- Returns the number of dimensions of OBJ. If OBJ is not an array,
- `0' is returned.
-
- Function: array->list array
Returns a list consisting of all the elements, in order, of ARRAY.
In the case of a rank-0 array, returns the single element.
- - Function: array-copy! source destination
- Copies every element from vector or array SOURCE to the
- corresponding element of DESTINATION. DESTINATION must have the
- same rank as SOURCE, and be at least as large in each dimension.
- The order of copying is unspecified.
-
- - Function: serial-array-copy! source destination
- Same as `array-copy!' but guaranteed to copy in row-major order.
-
- - Function: array-fill! array fill
- Stores FILL in every element of ARRAY. The value returned is
- unspecified.
-
- - Function: array-equal? array0 array1 ...
- Returns `#t' iff all arguments are arrays with the same shape, the
- same type, and have corresponding elements which are either
- `equal?' or `array-equal?'. This function differs from `equal?'
- in that a one dimensional shared array may be ARRAY-EQUAL? but not
- EQUAL? to a vector or uniform vector.
-
- Function: array-contents array
- Function: array-contents array strict
If ARRAY may be "unrolled" into a one dimensional shared array
without changing their order (last subscript changing fastest),
then `array-contents' returns that shared array, otherwise it
- returns `#f'. All arrays made by MAKE-ARRAY and CREATE-ARRAY may |
- be unrolled, some arrays made by MAKE-SHARED-ARRAY may not be. |
+ returns `#f'. All arrays made by CREATE-ARRAY may be unrolled,
+ some arrays made by MAKE-SHARED-ARRAY may not be.
If the optional argument STRICT is provided, a shared array will
be returned only if its elements are stored internally contiguous
in memory.

-File: scm.info, Node: Array Mapping, Next: Uniform Array, Prev: Conventional Arrays, Up: Arrays
-
-Array Mapping
--------------
-
-`(require 'array-for-each)'
-
- - Function: array-map! array0 proc array1 ...
- If ARRAY1, ... are arrays, they must have the same number of
- dimensions as ARRAY0 and have a range for each index which
- includes the range for the corresponding index in ARRAY0. If they
- are scalars, that is, not arrays, vectors, or strings, then they
- will be converted internally to arrays of the appropriate shape.
- PROC is applied to each tuple of elements of ARRAY1 ... and the
- result is stored as the corresponding element in ARRAY0. The
- value returned is unspecified. The order of application is
- unspecified.
-
-
- - Function: serial-array-map! array0 proc array1 ...
- Same as ARRAY-MAP!, but guaranteed to apply PROC in row-major
- order.
-
- - Function: array-for-each proc array0 ...
- PROC is applied to each tuple of elements of ARRAY0 ... in
- row-major order. The value returned is unspecified.
-
- - Function: array-index-map! array proc
- applies PROC to the indices of each element of ARRAY in turn,
- storing the result in the corresponding element. The value
- returned and the order of application are unspecified.
-
- One can implement ARRAY-INDEXES as
- (define (array-indexes array)
- (let ((ra (apply make-array #f (array-shape array))))
- (array-index-map! ra (lambda x x))
- ra))
- Another example:
- (define (apl:index-generator n)
- (let ((v (make-vector n 1))) |
- (array-index-map! v (lambda (i) i))
- v))
-
- - Function: scalar->array scalar array prototype
- Returns a uniform array of the same shape as ARRAY, having only
- one shared element, which is `eqv?' to SCALAR. If the optional
- argument PROTOTYPE is supplied it will be used as the prototype
- for the returned array. Otherwise the returned array will be of
- the same type as `array' if that is possible, and a conventional
- array if it is not. This function is used internally by
- `array-map!' and friends to handle scalar arguments.
-
-
-File: scm.info, Node: Uniform Array, Next: Bit Vectors, Prev: Array Mapping, Up: Arrays
+File: scm.info, Node: Uniform Array, Next: Bit Vectors, Prev: Conventional Arrays, Up: Arrays
Uniform Array
-------------
@@ -3751,51 +3813,51 @@ same type. Uniform vectors occupy less storage than conventional
vectors. Uniform Array procedures also work on vectors,
uniform-vectors, bit-vectors, and strings.
-SLIB now supports uniform arrys. The primary array creation procedure |
-is `create-array', detailed in *Note Arrays: (slib)Arrays. |
+SLIB now supports uniform arrys. The primary array creation procedure
+is `create-array', detailed in *Note Arrays: (slib)Arrays.
Unshared uniform character 0-based arrays of rank 1 (dimension) are
equivalent to (and can't be distinguished from) strings.
- (create-array "" 3) => "$q2" |
+ (create-array "" 3) => "$q2"
Unshared uniform boolean 0-based arrays of rank 1 (dimension) are
equivalent to (and can't be distinguished from) *Note bit-vectors: Bit
Vectors.
- (create-array '#at() 3) => #*000 |
+ (create-array '#at() 3) => #*000
==
#At(#f #f #f) => #*000
==
#1At(#f #f #f) => #*000
-PROTOTYPE arguments in the following procedures are interpreted |
-according to the table: |
+PROTOTYPE arguments in the following procedures are interpreted
+according to the table:
- prototype type display prefix |
+ prototype type display prefix
- () conventional vector #a |
- +64i complex (double precision) #ac64 |
- 64.0 double (double precision) #ar64 |
- 32.0 float (single precision) #ar32 |
- 32 unsigned integer (32-bit) #au32 |
- -32 signed integer (32-bit) #as32 |
- -16 signed integer (16-bit) #as16 |
- #\a char (string) #a\ |
- #t boolean (bit-vector) #at |
- |
-Other uniform vectors are written in a form similar to that of general |
-arrays, except that one or more modifying characters are put between the |
-#\A character and the contents list. For example, `'#As32(3 5 9)' |
-returns a uniform vector of signed integers. |
+ () conventional vector #a
+ +64i complex (double precision) #ac64
+ 64.0 double (double precision) #ar64
+ 32.0 float (single precision) #ar32
+ 32 unsigned integer (32-bit) #au32
+ -32 signed integer (32-bit) #as32
+ -16 signed integer (16-bit) #as16
+ #\a char (string) #a\
+ #t boolean (bit-vector) #at
+
+Other uniform vectors are written in a form similar to that of general
+arrays, except that one or more modifying characters are put between the
+#\A character and the contents list. For example, `'#As32(3 5 9)'
+returns a uniform vector of signed integers.
- Function: array? obj prototype
Returns `#t' if the OBJ is an array of type corresponding to
PROTOTYPE, and `#f' if not.
- |
+
- Function: array-prototype array
Returns an object that would produce an array of the same type as
- ARRAY, if used as the PROTOTYPE for `list->uniform-array'. |
+ ARRAY, if used as the PROTOTYPE for `list->uniform-array'.
- - Function: list->uniform-array rank prot lst |
+ - Function: list->uniform-array rank prot lst
Returns a uniform array of the type indicated by prototype PROT
with elements the same as those of LST. Elements must be of the
appropriate type, no coercions are done.
@@ -3808,19 +3870,8 @@ returns a uniform vector of signed integers. |
If RANK is zero, LST, which need not be a list, is the single
element of the returned array.
- - Function: uniform-vector-fill! uve fill
- Stores FILL in every element of UVE. The value returned is
- unspecified.
- |
- - Function: dimensions->uniform-array dims prototype fill
- - Function: dimensions->uniform-array dims prototype |
- Creates and returns a uniform array or vector of type
- corresponding to PROTOTYPE with dimensions DIMS or length LENGTH.
- If the FILL argument is supplied, the returned array is filled with
- this value.
-
- Function: uniform-array-read! ura
- - Function: uniform-array-read! ura port |
+ - Function: uniform-array-read! ura port
Attempts to read all elements of URA, in lexicographic order, as
binary objects from PORT. If an end of file is encountered during
uniform-array-read! the objects up to that point only are put into
@@ -3832,7 +3883,7 @@ returns a uniform vector of signed integers. |
`(current-input-port)'.
- Function: uniform-array-write ura
- - Function: uniform-array-write ura port |
+ - Function: uniform-array-write ura port
Writes all elements of URA as binary objects to PORT. The number
of of objects actually written is returned. PORT may be omitted,
in which case it defaults to the value returned by
@@ -3860,7 +3911,7 @@ returns a uniform vector of signed integers. |
integer or if VAL is not boolean.

-File: scm.info, Node: Bit Vectors, Prev: Uniform Array, Up: Arrays
+File: scm.info, Node: Bit Vectors, Next: Array Mapping, Prev: Uniform Array, Up: Arrays
Bit Vectors
-----------
@@ -3901,30 +3952,90 @@ uniform-arrays.
BV is not modified.

-File: scm.info, Node: Records, Next: I/O-Extensions, Prev: Arrays, Up: Packages
- |
-Records |
-======= |
- |
-SCM provides user-definable datatypes with the same interface as SLIB, |
-see *Note Records: (slib)Records, with the following extension. |
- |
- - Function: record-printer-set! rtd printer |
- Causes records of type RTD to be printed in a user-specified |
- format. RTD must be a record type descriptor returned by |
- `make-record-type', PRINTER a procedure accepting three arguments: |
- the record to be printed, the port to print to, and a boolean |
- which is true if the record is being written on behalf of `write' |
- and false if for `display'. If PRINTER returns #f, the default |
- record printer will be called. |
- |
- A PRINTER value of #f means use the default printer. |
- |
- Only the default printer will be used when printing error messages. |
+File: scm.info, Node: Array Mapping, Prev: Bit Vectors, Up: Arrays
+
+Array Mapping
+-------------
+
+`(require 'array-for-each)'
+
+SCM has some extra functions in feature `array-for-each':
+
+ - Function: array-fill! array fill
+ Stores FILL in every element of ARRAY. The value returned is
+ unspecified.
+
+ - Function: serial-array-copy! source destination
+ Same as `array-copy!' but guaranteed to copy in row-major order.
+
+ - Function: array-equal? array0 array1 ...
+ Returns `#t' iff all arguments are arrays with the same shape, the
+ same type, and have corresponding elements which are either
+ `equal?' or `array-equal?'. This function differs from `equal?'
+ in that a one dimensional shared array may be ARRAY-EQUAL? but not
+ EQUAL? to a vector or uniform vector.
+
+ - Function: array-map! array0 proc array1 ...
+ If ARRAY1, ... are arrays, they must have the same number of
+ dimensions as ARRAY0 and have a range for each index which
+ includes the range for the corresponding index in ARRAY0. If they
+ are scalars, that is, not arrays, vectors, or strings, then they
+ will be converted internally to arrays of the appropriate shape.
+ PROC is applied to each tuple of elements of ARRAY1 ... and the
+ result is stored as the corresponding element in ARRAY0. The
+ value returned is unspecified. The order of application is
+ unspecified.
+
+ Handling non-array arguments is a SCM extension of *Note
+ array-map!: (slib)Array Mapping
+
+ - Function: serial-array-map! array0 proc array1 ...
+ Same as ARRAY-MAP!, but guaranteed to apply PROC in row-major
+ order.
+
+ - Function: array-map prototype proc array1 array2 ... |
+ ARRAY2, ... must have the same number of dimensions as ARRAY1 and |
+ have a range for each index which includes the range for the |
+ corresponding index in ARRAY1. PROC is applied to each tuple of |
+ elements of ARRAY1, ARRAY2, ... and the result is stored as the |
+ corresponding element in a new array of type PROTOTYPE. The new |
+ array is returned. The order of application is unspecified. |
|
+ - Function: scalar->array scalar array prototype
+ - Function: scalar->array scalar array
+ Returns a uniform array of the same shape as ARRAY, having only
+ one shared element, which is `eqv?' to SCALAR. If the optional
+ argument PROTOTYPE is supplied it will be used as the prototype
+ for the returned array. Otherwise the returned array will be of
+ the same type as `array' if that is possible, and a conventional
+ array if it is not. This function is used internally by
+ `array-map!' and friends to handle scalar arguments.
+
+
+File: scm.info, Node: Records, Next: I/O-Extensions, Prev: Arrays, Up: Packages
+
+Records
+=======
+
+SCM provides user-definable datatypes with the same interface as SLIB,
+see *Note Records: (slib)Records, with the following extension.
+
+ - Function: record-printer-set! rtd printer
+ Causes records of type RTD to be printed in a user-specified
+ format. RTD must be a record type descriptor returned by
+ `make-record-type', PRINTER a procedure accepting three arguments:
+ the record to be printed, the port to print to, and a boolean
+ which is true if the record is being written on behalf of `write'
+ and false if for `display'. If PRINTER returns #f, the default
+ record printer will be called.
+
+ A PRINTER value of #f means use the default printer.
+
+ Only the default printer will be used when printing error messages.
+

File: scm.info, Node: I/O-Extensions, Next: Posix Extensions, Prev: Records, Up: Packages
- |
+
I/O-Extensions
==============
@@ -3988,13 +4099,13 @@ I/O: (slib)Line I/O, and the following functions are defined:
`file-set-position' is unspecified. The result of
`file-set-position' is unspecified.
- - Function: try-create-file name modes perms |
- If the file with name NAME already exists, return `#f', otherwise |
+ - Function: try-create-file name modes perms
+ If the file with name NAME already exists, return `#f', otherwise
try to create and open the file like `try-open-file', *Note Files
- and Ports::. If the optional integer argument PERMS is provided, |
- it is used as the permissions of the new file (modified by the |
- current umask). |
- |
+ and Ports::. If the optional integer argument PERMS is provided,
+ it is used as the permissions of the new file (modified by the
+ current umask).
+
- Function: reopen-file filename modes port
Closes port PORT and reopens it with FILENAME and MODES.
`reopen-file' returns `#t' if successful, `#f' if not.
@@ -4027,11 +4138,11 @@ I/O: (slib)Line I/O, and the following functions are defined:
`closedir' returns a `#f'.
- Function: directory-for-each proc directory
- The LISTs must be lists, and PROC must be a procedure taking one
- argument. `Directory-For-Each' applies PROC to the (string) name
- of each file in DIRECTORY. The dynamic order in which PROC is
- applied to the elements of the LISTs is unspecified. The value
- returned by `directory-for-each' is unspecified.
+ PROC must be a procedure taking one argument.
+ `Directory-For-Each' applies PROC to the (string) name of each
+ file in DIRECTORY. The dynamic order in which PROC is applied to
+ the filenames is unspecified. The value returned by
+ `directory-for-each' is unspecified.
- Function: directory-for-each proc directory pred
Applies PROC only to those filenames for which the procedure PRED
@@ -4042,7 +4153,7 @@ I/O: (slib)Line I/O, and the following functions are defined:
MATCH)' would return a non-false value (*note Filenames:
(slib)Filenames.).
- (require 'directory-for-each)
+ (require 'directory)
(directory-for-each print "." "[A-Z]*.scm")
-|
"Init.scm"
@@ -4050,7 +4161,7 @@ I/O: (slib)Line I/O, and the following functions are defined:
"Link.scm"
"Macro.scm"
"Transcen.scm"
- "Init5d6.scm" |
+ "Init5d9.scm" |
- Function: mkdir path mode
The `mkdir' function creates a new, empty directory whose name is
@@ -4164,7 +4275,7 @@ I/O: (slib)Line I/O, and the following functions are defined:

File: scm.info, Node: Posix Extensions, Next: Unix Extensions, Prev: I/O-Extensions, Up: Packages
- |
+
Posix Extensions
================
@@ -4188,14 +4299,14 @@ functions are defined:
the standard input of the system command STRING. If a pipe cannot
be created `#f' is returned.
- - Function: broken-pipe port |
- If this function is defined at top level, it will be called when an |
- output pipe is closed from the other side (this is the condition |
- under which a SIGPIPE is sent). The already closed PORT will be |
- passed so that any necessary cleanup may be done. An error is not |
- signaled when output to a pipe fails in this way, but any further |
- output to the closed pipe will cause an error to be signaled. |
- |
+ - Function: broken-pipe port
+ If this function is defined at top level, it will be called when an
+ output pipe is closed from the other side (this is the condition
+ under which a SIGPIPE is sent). The already closed PORT will be
+ passed so that any necessary cleanup may be done. An error is not
+ signaled when output to a pipe fails in this way, but any further
+ output to the closed pipe will cause an error to be signaled.
+
- Function: close-port pipe
Closes the PIPE, rendering it incapable of delivering or accepting
characters. This routine has no effect if the pipe has already
@@ -4218,11 +4329,6 @@ Persona.
Returns the process ID of the parent of the current process. For
a process's own ID *Note getpid: I/O-Extensions.
- - Function: getlogin |
- Returns the (login) name of the user logged in on the controlling |
- terminal of the process, or #f if this information cannot be |
- determined. |
- |
- Function: getuid
Returns the real user ID of this process.
@@ -4435,14 +4541,14 @@ Persona.

File: scm.info, Node: Unix Extensions, Next: Regular Expression Pattern Matching, Prev: Posix Extensions, Up: Packages
- |
+
Unix Extensions
===============
If `'unix' is provided (by linking in `unix.o'), the following
functions are defined:
-These "privileged" and symbolic link functions are not in Posix: |
+These "privileged" and symbolic link functions are not in Posix:
- Function: symlink oldname newname
The `symlink' function makes a symbolic link to OLDNAME named
@@ -4468,7 +4574,7 @@ These "privileged" and symbolic link functions are not in Posix: |
- Function: acct filename
When called with the name of an exisitng file as argument,
- accounting is turned on, records for each terminating process are |
+ accounting is turned on, records for each terminating process are
appended to FILENAME as it terminates. An argument of `#f' causes
accounting to be turned off.
@@ -4489,7 +4595,7 @@ These "privileged" and symbolic link functions are not in Posix: |

File: scm.info, Node: Regular Expression Pattern Matching, Next: Line Editing, Prev: Unix Extensions, Up: Packages
- |
+
Regular Expression Pattern Matching
===================================
@@ -5021,15 +5127,15 @@ Sockets: (libc)Sockets.
* Menu:
-* Host Data::
+* Host and Other Inquiries::
* Internet Addresses and Socket Names::
* Socket::

-File: scm.info, Node: Host Data, Next: Internet Addresses and Socket Names, Prev: Sockets, Up: Sockets
+File: scm.info, Node: Host and Other Inquiries, Next: Internet Addresses and Socket Names, Prev: Sockets, Up: Sockets
-Host Data, Network, Protocol, and Service Inquiries
----------------------------------------------------
+Host and Other Inquiries
+------------------------
- Constant: af_inet
- Constant: af_unix
@@ -5119,7 +5225,7 @@ Host Data, Network, Protocol, and Service Inquiries
When called without an argument, the service table is closed.

-File: scm.info, Node: Internet Addresses and Socket Names, Next: Socket, Prev: Host Data, Up: Sockets
+File: scm.info, Node: Internet Addresses and Socket Names, Next: Socket, Prev: Host and Other Inquiries, Up: Sockets
Internet Addresses and Socket Names
-----------------------------------
@@ -5622,9 +5728,9 @@ memory allocated by `malloc'.
- Header: tc7_uvect
uniform vector of non-negative integers
- - Header: tc7_svect |
- uniform vector of short integers |
- |
+ - Header: tc7_svect
+ uniform vector of short integers
+
- Header: tc7_fvect
uniform vector of short inexact real numbers
@@ -5861,7 +5967,7 @@ Defining Smobs::). These are the initial smobs:
synchronization object. *Note Process Synchronization::.
- smob: tc16_macro
- macro expanding function. *Note Low Level Syntactic Hooks::.
+ macro expanding function. *Note Macro Primitives::.
- smob: tc16_array
multi-dimensional array. *Note Arrays::.
@@ -5908,7 +6014,7 @@ bvect .........long length....G0010101 ..........long *words...........
ivect .........long length....G0011101 ..........long *words...........
uvect .........long length....G0011111 ......unsigned long *words......
spare G0100101
-svect .........long length....G0100111 ........ short *words........... |
+svect .........long length....G0100111 ........ short *words...........
fvect .........long length....G0101101 .........float *words...........
dvect .........long length....G0101111 ........double *words...........
cvect .........long length....G0110101 ........double *words...........
@@ -5917,15 +6023,15 @@ contin .........long length....G0111101 .............*regs..............
specfun ................xxxxxxxxG1111111 ...........SCM name.............
cclo ..short length..xxxxxx10G1111111 ...........SCM **elts...........
PTOBs:
- port 0bwroxxxxxxxxG0110111 ..........FILE *stream..........
- socket ttttttt 00001xxxxxxxxG0110111 ..........FILE *stream..........
- inport uuuuuuuuuuU00011xxxxxxxxG0110111 ..........FILE *stream..........
-outport 0000000000000101xxxxxxxxG0110111 ..........FILE *stream..........
- ioport uuuuuuuuuuU00111xxxxxxxxG0110111 ..........FILE *stream..........
-fport 00 00000000G0110111 ..........FILE *stream..........
-pipe 00 00000001G0110111 ..........FILE *stream..........
-strport 00 00000010G0110111 ..........FILE *stream..........
-sfport 00 00000011G0110111 ..........FILE *stream..........
+ port int portnum.CwroxxxxxxxxG0110111 ..........FILE *stream.......... |
+ socket int portnum.C001xxxxxxxxG0110111 ..........FILE *stream.......... |
+ inport int portnum.C011xxxxxxxxG0110111 ..........FILE *stream.......... |
+outport int portnum.0101xxxxxxxxG0110111 ..........FILE *stream.......... |
+ ioport int portnum.C111xxxxxxxxG0110111 ..........FILE *stream.......... |
+fport int portnum.C 00000000G0110111 ..........FILE *stream.......... |
+pipe int portnum.C 00000001G0110111 ..........FILE *stream.......... |
+strport 00000000000.0 00000010G0110111 ..........FILE *stream.......... |
+sfport int portnum.C 00000011G0110111 ..........FILE *stream.......... |
SUBRs:
spare 010001x1
spare 010011x1
@@ -6215,7 +6321,7 @@ File: scm.info, Node: C Macros, Next: Changing Scm, Prev: Signals, Up: Opera
C Macros
--------
- - Macro: ASSERT cond arg pos subr
+ - Macro: ASRTER cond arg pos subr
signals an error if the expression (COND) is 0. ARG is the
offending object, SUBR is the string naming the subr, and POS
indicates the position or type of error. POS can be one of
@@ -6256,12 +6362,12 @@ C Macros
* a C string `(char *)'
- Error checking is not done by `ASSERT' if the flag `RECKLESS' is
+ Error checking is not done by `ASRTER' if the flag `RECKLESS' is
defined. An error condition can still be signaled in this case
with a call to `wta(arg, pos, subr)'.
- Macro: ASRTGO cond label
- `goto' LABEL if the expression (COND) is 0. Like `ASSERT',
+ `goto' LABEL if the expression (COND) is 0. Like `ASRTER',
`ASRTGO' does is not active if the flag `RECKLESS' is defined.

@@ -6289,11 +6395,18 @@ or put this assignment somewhere in your routine:
of the local `SCM' variable to _any_ procedure also protects it. The
procedure `scm_protect_temp' is provided for this purpose.
+ - Function: void scm_protect_temp (SCM *PTR)
+ Forces the SCM object PTR to be saved on the C-stack, where it
+ will be traced for GC.
+
Also, if you maintain a static pointer to some (non-immediate) `SCM'
object, you must either make your pointer be the value cell of a symbol
-(see `errobj' for an example) or make your pointer be one of the
-`sys_protects' (see `dynwinds' for an example). The former method is
-prefered since it does not require any changes to the SCM distribution.
+(see `errobj' for an example) or (permanently) add your pointer to
+`sys_protects' using:
+
+ - Function: SCM scm_gc_protect (SCM OBJ)
+ Permanently adds OBJ to a table of objects protected from garbage
+ collection. `scm_gc_protect' returns OBJ.
To add a C routine to scm:
@@ -6353,7 +6466,7 @@ To add a package of new procedures to scm (see `crs.c' for example):
7. put any scheme code which needs to be run as part of your package
into `Ifoo.scm'.
- 8. put an `if' into `Init5d6.scm' which loads `Ifoo.scm' if your |
+ 8. put an `if' into `Init5d9.scm' which loads `Ifoo.scm' if your |
package is included:
(if (defined? twiddle-bits!)
@@ -6385,7 +6498,7 @@ Special forms (new syntax) can be added to scm.
New syntax can now be added without recompiling SCM by the use of the
`procedure->syntax', `procedure->macro', `procedure->memoizing-macro',
-and `defmacro'. For details, *Note Syntax Extensions::.
+and `defmacro'. For details, *Note Syntax::.

File: scm.info, Node: Defining Subrs, Next: Defining Smobs, Prev: Changing Scm, Up: Operations
@@ -6494,10 +6607,10 @@ following lines need to be added to your code:
is the smob object. The second, of type `SCM', is the stream
on which to write the result. The third, of type int, is 1
if the object should be `write'n, 0 if it should be
- `display'ed, and 2 if it should be `write'n for an error |
- report. This function should return non-zero if it printed, |
- and zero otherwise (in which case a hexadecimal number will |
- be printed). |
+ `display'ed, and 2 if it should be `write'n for an error
+ report. This function should return non-zero if it printed,
+ and zero otherwise (in which case a hexadecimal number will
+ be printed).
`smob.equalp'
is 0 or a function of 2 `SCM' arguments. Both of these
@@ -6584,9 +6697,9 @@ following functions are provided for that purpose:
`must_malloc', `must_malloc_cell', `must_realloc', and
`must_realloc_cell' must be called with interrupts deferred *Note
-Signals::. `must_realloc' and `must_realloc_cell' must not be called |
-during initialization (non-zero errjmp_bad) - the initial allocations |
-must be large enough. |
+Signals::. `must_realloc' and `must_realloc_cell' must not be called
+during initialization (non-zero errjmp_bad) - the initial allocations
+must be large enough.
- Function: void must_free (char *PTR, sizet LEN)
`must_free' is used to free a block of memory allocated by the
@@ -6653,7 +6766,7 @@ SCM, then you can replace `scm_find_implpath'.
environment variable is defined, its value will be returned from
`scm_find_implpath'. Otherwise find_impl_file() is called with the
arguments EXECPATH, GENERIC_NAME (default "scm"), INIT_FILE_NAME
- (default "Init5d6_scm"), and the directory separator string |
+ (default "Init5d9_scm"), and the directory separator string |
DIRSEP. If find_impl_file() returns 0 and IMPLINIT is defined,
then a copy of the string IMPLINIT is returned.
@@ -6740,9 +6853,9 @@ Here is a minimal embedding program `libtest.c':
/* include patchlvl.h for SCM's INIT_FILE_NAME. */
#include "patchlvl.h"
- void init_user_scm()
+ void libtest_init_user_scm() |
{
- fputs("This is init_user_scm\n", stderr); fflush(stderr);
+ fputs("This is libtest_init_user_scm\n", stderr); fflush(stderr); |
sysintern("*the-string*", makfrom0str("hello world\n"));
}
@@ -6761,6 +6874,7 @@ Here is a minimal embedding program `libtest.c':
SCM retval;
char *implpath, *execpath;
+ init_user_scm = libtest_init_user_scm; |
execpath = dld_find_executable(argv[0]);
fprintf(stderr, "dld_find_executable(%s): %s\n", argv[0], execpath);
implpath = find_impl_file(execpath, "scm", INIT_FILE_NAME, dirsep);
@@ -6775,8 +6889,8 @@ Here is a minimal embedding program `libtest.c':
-|
dld_find_executable(./libtest): /home/jaffer/scm/libtest
- implpath: /home/jaffer/scm/Init5d6.scm |
- This is init_user_scm
+ implpath: /home/jaffer/scm/Init5d9.scm |
+ This is libtest_init_user_scm |
hello world

@@ -6791,7 +6905,7 @@ The source code for these routines are found in `rope.c'.
- Function: int scm_ldfile (char *FILE)
Loads the Scheme source file FILE. Returns 0 if successful, non-0
if not. This function is used to load SCM's initialization file
- `Init5d6.scm'. |
+ `Init5d9.scm'. |
- Function: int scm_ldprog (char *FILE)
Loads the Scheme source file `(in-vicinity (program-vicinity)
@@ -6849,21 +6963,23 @@ code. Most are defined in `rope.c'.
- Function: long num2long (SCM NUM, char *POS, char *S_CALLER)
- Function: unsigned long num2ulong (SCM NUM, char *POS, char
*S_CALLER)
+ - Function: short num2short (SCM NUM, char *POS, char *S_CALLER)
- Function: unsigned short num2ushort (SCM NUM, char *POS, char
*S_CALLER)
- Function: unsigned char num2uchar (SCM NUM, char *POS, char
*S_CALLER)
+ - Function: double num2dbl (SCM NUM, char *POS, char *S_CALLER)
These functions are used to check and convert `SCM' arguments to
the named C type. The first argument NUM is checked to see it it
is within the range of the destination type. If so, the converted
- number is returned. If not, the `ASSERT' macro calls `wta' with
+ number is returned. If not, the `ASRTER' macro calls `wta' with
NUM and strings POS and S_CALLER. For a listing of useful
predefined POS macros, *Note C Macros::.
- _Note:_ Inexact numbers are accepted only by `num2long' and
- `num2ulong' (for when `SCM' is compiled without bignums). To
- convert inexact numbers to exact numbers, *Note inexact->exact:
- (r5rs)Numerical operations.
+ _Note:_ Inexact numbers are accepted only by `num2dbl',
+ `num2long', and `num2ulong' (for when `SCM' is compiled without
+ bignums). To convert inexact numbers to exact numbers, *Note
+ inexact->exact: (r5rs)Numerical operations.
- Function: unsigned long scm_addr (SCM ARGS, char *S_NAME)
Returns a pointer (cast to an `unsigned long') to the storage
@@ -6874,10 +6990,16 @@ code. Most are defined in `rope.c'.
`scm_addr' is useful for performing C operations on strings or
other uniform arrays (*note Uniform Array::).
- _Note:_ While you use a pointer returned from `scm_addr' you must
- keep a pointer to the associated `SCM' object in a stack allocated
- variable or GC-protected location in order to assure that SCM does
- not reuse that storage before you are done with it.
+ - Function: unsigned long scm_base_addr(SCM RA, char *S_NAME)
+ Returns a pointer (cast to an `unsigned long') to the beginning of
+ storage of array RA. Note that if RA is a shared-array, the
+ strorage accessed this way may be much larger than RA.
+
+ _Note:_ While you use a pointer returned from `scm_addr' or
+ `scm_base_addr' you must keep a pointer to the associated `SCM'
+ object in a stack allocated variable or GC-protected location in
+ order to assure that SCM does not reuse that storage before you
+ are done with it. *Note scm_gc_protect: Changing Scm.
- Function: SCM makfrom0str (char *SRC)
- Function: SCM makfromstr (char *SRC, sizet LEN)
@@ -7203,7 +7325,7 @@ File: scm.info, Node: Executable Pathname, Next: Script Support, Prev: File-S
Executable Pathname
-------------------
-For purposes of finding `Init5d6.scm', dumping an executable, and |
+For purposes of finding `Init5d9.scm', dumping an executable, and |
dynamic linking, a SCM session needs the pathname of its executable
image.
@@ -7316,22 +7438,20 @@ Improvements To Make
gets set which tells the interpreter to instead always look
up the values of the associated symbols.
+ * Scott Schwartz <schwartz@galapagos.cse.psu.edu> suggests: One way
+ to tidy up the dynamic loading stuff would be to grab the code
+ from perl5.
+
* Menu:
-* Finishing Dynamic Linking::
+* VMS Dynamic Linking:: Finishing the job. |

-File: scm.info, Node: Finishing Dynamic Linking, Prev: Improvements To Make, Up: Improvements To Make
-
-Finishing Dynamic Linking
--------------------------
-
-Scott Schwartz <schwartz@galapagos.cse.psu.edu> suggests: One way to
-tidy up the dynamic loading stuff would be to grab the code from perl5.
-
-VMS
-...
+File: scm.info, Node: VMS Dynamic Linking, Prev: Improvements To Make, Up: Improvements To Make
+ |
+VMS Dynamic Linking
+-------------------
George Carrette (gjc@mitech.com) outlines how to dynamically link on
VMS. There is already some code in `dynl.c' to do this, but someone
@@ -7447,97 +7567,9 @@ with a VMS system needs to finish and debug it.
modify and relink `LISPLIB.EXE' without having to relink programs
that have been linked against it.
-Windows NT
-..........
-
-George Carrette (gjc@mitech.com) outlines how to dynamically link on
-Windows NT:
-
- * The Software Developers Kit has a sample called SIMPLDLL. Here is
- the gist of it, following along the lines of the VMS description
- above (contents of a makefile for the SDK NMAKE)
-
- LISPLIB.exp:
- LISPLIB.lib: LISPLIB.def
- $(implib) -machine:$(CPU) -def:LISPLIB.def -out:LISPLIB.lib
-
- LISPLIB.DLL : $(LISPLIB_OBJS) LISPLIB.EXP
- $(link) $(linkdebug) \
- -dll \
- -out:LISPLIB.DLL \
- LISPLIB.EXP $(LISPLIB_OBJS) $(conlibsdll)
-
- * The `LISPDEF.DEF' file has this:
-
- LIBRARY lisplib
- EXPORT
- init_lisp
- init_repl
-
- * And `MAIN.EXE' using:
-
- CLINK = $(link) $(ldebug) $(conflags) -out:$*.exe $** $(conlibsdll)
-
- MAIN.EXE : MAIN.OBJ LISPLIB.LIB
- $(CLINK)
-
- * And `MYSUBRS.DLL' is produced using:
-
- mysubrs.exp:
- mysubrs.lib: mysubrs.def
- $(implib) -machine:$(CPU) -def:MYSUBRS.def -out:MYSUBRS.lib
-
- mysubrs.dll : mysubrs.obj mysubrs.exp mysubrs.lib
- $(link) $(linkdebug) \
- -dll \
- -out:mysubrs.dll \
- MYSUBRS.OBJ MYSUBRS.EXP LISPLIB.LIB $(conlibsdll)
-
- * Where `MYSUBRS.DEF' has
-
- LIBRARY mysubrs
- EXPORT
- INIT_MYSUBRS
-
- * And the dynamic loader looks something like this, calling the two
- procedures `LoadLibrary' and `GetProcAddress'.
-
- LISP share_image_load(LISP fname)
- {long iflag;
- LISP retval,(*fcn)(void);
- HANDLE hLib;
- DWORD err;
- char *libname,fcnname[64];
- iflag = nointerrupt(1);
- libname = c_string(fname);
- _snprintf(fcnname,sizeof(fcnname),"INIT_%s",libname);
- if (!(hLib = LoadLibrary(libname)))
- {err = GetLastError();
- retval = list2(fname,LSPNUM(err));
- serror1("library failed to load",retval);}
- if (!(fcn = (LISP (*)(void)) GetProcAddress(hLib,fcnname)))
- {err = GetLastError();
- retval = list2(fname,LSPNUM(err));
- serror1("could not find library init procedure",retval);}
- retval = (*fcn)();
- nointerrupt(iflag);
- return(retval);}
-
- * _Note:_ in VMS the linker and dynamic loader is case sensitive, but
- all the language compilers, including C, will by default upper-case
- external symbols for use by the linker, although the debugger gets
- its own symbols and case sensitivity is language mode dependant.
- In Windows NT things are case sensitive generally except for file
- and device names, which are case canonicalizing like in the
- Symbolics filesystem.
-
- * _Also:_ All this WINDOWS NT stuff will work in MS-DOS MS-Windows
- 3.1 too, by a method of compiling and linking under Windows NT,
- and then copying various files over to MS-DOS/WINDOWS.
-

File: scm.info, Node: Index, Prev: The Implementation, Up: Top
-
+ |
Procedure and Macro Index
*************************
@@ -7546,13 +7578,16 @@ This is an alphabetical list of all the procedures and macros in SCM.
* Menu:
* #!: Unix Scheme Scripts.
-* #': Syntax Extensions.
-* #+: Syntax Extensions.
-* #-: Syntax Extensions.
-* #.: Syntax Extensions.
-* #;text-till-end-of-line: Syntax Extensions.
-* #\token: Syntax Extensions.
-* #|: Syntax Extensions.
+* #': Common-Lisp Read Syntax.
+* #+: Common-Lisp Read Syntax.
+* #-: Common-Lisp Read Syntax.
+* #.: Common-Lisp Read Syntax.
+* #;text-till-end-of-line: Documentation and Comments.
+* #?column: Load Syntax. |
+* #?file: Load Syntax. |
+* #?line: Load Syntax. |
+* #\token: Common-Lisp Read Syntax.
+* #|: Common-Lisp Read Syntax.
* $abs: Numeric.
* $acos: Numeric.
* $acosh: Numeric.
@@ -7600,6 +7635,7 @@ This is an alphabetical list of all the procedures and macros in SCM.
* -e: SCM Options.
* -f: SCM Options.
* -F: Build Options.
+* -f: Build Options.
* -h <1>: SCM Options.
* -h: Build Options.
* -i <1>: SCM Options.
@@ -7621,19 +7657,19 @@ This is an alphabetical list of all the procedures and macros in SCM.
* -u: SCM Options.
* -v: SCM Options.
* -w: Build Options.
-* @apply: Low Level Syntactic Hooks.
-* @copy-tree: Miscellaneous Procedures. |
+* @apply: Environment Frames.
+* @copy-tree: Storage.
* @macroexpand1: Syntactic Hooks for Hygienic Macros.
-* _exclusive: Files and Ports. |
-* _ionbf: Files and Ports.
-* _tracked: Files and Ports.
+* _exclusive: Opening and Closing.
+* _ionbf: Opening and Closing.
+* _tracked: Opening and Closing.
* abort: Internal State.
* access: I/O-Extensions.
-* acct: Unix Extensions. |
-* acons: Miscellaneous Procedures.
+* acct: Unix Extensions.
+* acons: Storage.
* acosh: Numeric.
* add-alias: Configure Module Catalog.
-* add-finalizer: Interrupts. |
+* add-finalizer: Storage.
* add-link: Configure Module Catalog.
* add-source: Configure Module Catalog.
* alarm: Interrupts.
@@ -7644,73 +7680,64 @@ This is an alphabetical list of all the procedures and macros in SCM.
* arithmetic-error: Interrupts.
* array->list: Conventional Arrays.
* array-contents: Conventional Arrays.
-* array-copy!: Conventional Arrays.
-* array-dimensions: Conventional Arrays.
-* array-equal?: Conventional Arrays.
-* array-fill!: Conventional Arrays.
-* array-for-each: Array Mapping.
-* array-in-bounds?: Conventional Arrays.
-* array-index-map!: Array Mapping.
+* array-equal?: Array Mapping.
+* array-fill!: Array Mapping.
+* array-map: Array Mapping. |
* array-map!: Array Mapping.
* array-prototype: Uniform Array.
-* array-rank: Conventional Arrays.
-* array-ref: Conventional Arrays.
-* array-set!: Conventional Arrays.
-* array-shape: Conventional Arrays.
-* array? <1>: Uniform Array.
-* array?: Conventional Arrays.
+* array?: Uniform Array.
* asinh: Numeric.
+* ASRTER: C Macros.
* ASRTGO: C Macros.
-* ASSERT: C Macros.
* atanh: Numeric.
* bit-count: Bit Vectors.
* bit-count*: Bit Vectors.
* bit-invert!: Bit Vectors.
* bit-position: Bit Vectors.
* bit-set*!: Bit Vectors.
-* boot-tail <1>: Dump. |
-* boot-tail: SCM Session. |
+* boot-tail <1>: Dump.
+* boot-tail: SCM Session.
* box: Curses Miscellany.
-* broken-pipe: Posix Extensions. |
-* call-with-outputs: Files and Ports.
-* CAR: Cells. |
+* broken-pipe: Posix Extensions.
+* call-with-outputs: Port Redirection.
+* CAR: Cells.
* cbreak: Terminal Mode Setting.
* CCLO_LENGTH: Header Cells.
* CDR: Cells.
* char: Type Conversions.
-* char-ready: Files and Ports.
+* char-ready: Port Properties.
* char-ready? <1>: Socket.
-* char-ready?: Files and Ports.
+* char-ready?: Port Properties.
+* char:sharp: Modifying Read Syntax. |
* CHARS: Header Cells.
* chdir: I/O-Extensions.
* CHEAP_CONTINUATIONS: Continuations.
* chmod: I/O-Extensions.
* chown: Posix Extensions.
-* clearok: Output Options Setting. |
+* clearok: Output Options Setting.
* close-port <1>: Window Manipulation.
* close-port <2>: Posix Extensions.
-* close-port: Files and Ports.
+* close-port: Opening and Closing.
* closedir: I/O-Extensions.
* CLOSEDP: Ptob Cells.
* CLOSUREP: Cells.
* CODE: Cells.
-* comment: Syntax Extensions. |
+* comment: Documentation and Comments.
* CONSP: Cells.
-* copy-tree: Miscellaneous Procedures.
+* copy-tree: Storage.
* cosh: Numeric.
* could-not-open: Interrupts.
-* current-error-port: Files and Ports.
-* current-input-port: Files and Ports.
+* current-error-port: Port Redirection.
+* current-input-port: Port Properties.
* current-time: Time.
* default-input-port: Line Editing.
* default-output-port: Line Editing.
-* defconst: Syntax Extensions.
+* defconst: Define and Set.
* DEFER_INTS: Signals.
-* defined?: Syntax Extensions.
-* defmacro: Syntax Extensions.
-* defsyntax: Low Level Syntactic Hooks. |
-* defvar: Syntax Extensions.
-* dimensions->uniform-array: Uniform Array.
+* defined?: Define and Set.
+* defmacro: Defmacro.
+* defsyntax: Macro Primitives.
+* defvar: Define and Set.
* directory-for-each: I/O-Extensions.
* display: Output.
* dld_find_executable: Executable Pathname.
@@ -7725,13 +7752,13 @@ This is an alphabetical list of all the procedures and macros in SCM.
* enclose-array: Conventional Arrays.
* end-of-program: Interrupts.
* endwin: Curses.
-* ENV: Cells. |
+* ENV: Cells.
* errno: Errors.
* error: Errors.
* eval: Evaluation.
* EVAL: Evaluation.
-* eval: Miscellaneous Procedures.
-* eval-string: Miscellaneous Procedures.
+* eval: Eval and Load.
+* eval-string: Eval and Load.
* exec-self: Internal State.
* execl: I/O-Extensions.
* execlp: I/O-Extensions.
@@ -7749,13 +7776,13 @@ This is an alphabetical list of all the procedures and macros in SCM.
* fork: Posix Extensions.
* FPORTP: Ptob Cells.
* free_continuation: Continuations.
-* freshline: Files and Ports.
+* freshline: Port Properties.
* gc: Internal State.
-* gc-hook: Interrupts. |
+* gc-hook: Storage.
* gc_mark: Marking Cells.
* GCCDR: Marking Cells.
* GCTYP16: Marking Cells.
-* gentemp: Syntax Extensions.
+* gentemp: Defmacro.
* get-internal-real-time: Time.
* get-internal-run-time: Time.
* getcwd: I/O-Extensions.
@@ -7764,15 +7791,15 @@ This is an alphabetical list of all the procedures and macros in SCM.
* getgid: Posix Extensions.
* getgr: Posix Extensions.
* getgroups: Posix Extensions.
-* gethost: Host Data.
-* getlogin: Posix Extensions. |
-* getnet: Host Data.
+* gethost: Host and Other Inquiries.
+* getlogin: SCM Session.
+* getnet: Host and Other Inquiries.
* getpeername: Internet Addresses and Socket Names.
* getpid: I/O-Extensions.
* getppid: Posix Extensions.
-* getproto: Host Data.
+* getproto: Host and Other Inquiries.
* getpw: Posix Extensions.
-* getserv: Host Data.
+* getserv: Host and Other Inquiries.
* getsockname: Internet Addresses and Socket Names.
* getuid: Posix Extensions.
* getyx: Input.
@@ -7797,10 +7824,10 @@ This is an alphabetical list of all the procedures and macros in SCM.
* initscr: Curses.
* INPORTP: Ptob Cells.
* int_signal: Signals.
-* integer->line-number: Line Numbers. |
+* integer->line-number: Line Numbers.
* INUM: Immediates.
* INUMP: Immediates.
-* isatty?: Files and Ports.
+* isatty?: Port Properties.
* ISYMCHARS: Immediates.
* ISYMNUM: Immediates.
* ISYMP: Immediates.
@@ -7808,32 +7835,30 @@ This is an alphabetical list of all the procedures and macros in SCM.
* leaveok: Output Options Setting.
* LENGTH: Header Cells.
* line-editing: Line Editing.
-* line-number: Miscellaneous Procedures.
-* line-number->integer: Line Numbers. |
-* line-number?: Line Numbers. |
-* link: Posix Extensions. |
-* list->uniform-array: Uniform Array. |
-* list-file: Miscellaneous Procedures.
+* line-number: Eval and Load.
+* line-number->integer: Line Numbers.
+* line-number?: Line Numbers.
+* link: Posix Extensions.
+* list->uniform-array: Uniform Array.
* load: Dynamic Linking.
-* load-string: Miscellaneous Procedures.
+* load-string: Eval and Load.
+* load:sharp: Modifying Read Syntax. |
* logaref: Uniform Array.
* logaset!: Uniform Array.
* long: Type Conversions.
* long2num: Type Conversions.
-* lstat: Unix Extensions. |
-* macroexpand: Syntax Extensions.
-* macroexpand-1: Syntax Extensions.
+* lstat: Unix Extensions.
+* macroexpand: Defmacro.
+* macroexpand-1: Defmacro.
* main: Embedding SCM.
* makargvfrmstrs: Type Conversions.
* makcclo: Header Cells.
* make-arbiter: Process Synchronization.
-* make-array: Conventional Arrays.
* make-edited-line-port: Line Editing.
-* make-exchanger: Process Synchronization. |
-* make-shared-array: Conventional Arrays.
+* make-exchanger: Process Synchronization.
* make-soft-port: Soft Ports.
* make-stream-socket: Socket.
-* make-stream-socketpair: Socket. |
+* make-stream-socketpair: Socket.
* make_continuation: Continuations.
* make_gsubr: Defining Subrs.
* make_root_continuation: Continuations.
@@ -7848,7 +7873,7 @@ This is an alphabetical list of all the procedures and macros in SCM.
* mark_locations: Marking Cells.
* milli-alarm: Interrupts.
* mkdir: I/O-Extensions.
-* mknod: Unix Extensions. |
+* mknod: Unix Extensions.
* must_free: Allocating memory.
* must_free_argv: Type Conversions.
* must_malloc: Allocating memory.
@@ -7859,7 +7884,7 @@ This is an alphabetical list of all the procedures and macros in SCM.
* NCONSP: Cells.
* NEWCELL: Cells.
* newwin: Window Manipulation.
-* nice: Unix Extensions. |
+* nice: Unix Extensions.
* NIMP: Immediates.
* NINUMP: Immediates.
* nl: Terminal Mode Setting.
@@ -7869,13 +7894,15 @@ This is an alphabetical list of all the procedures and macros in SCM.
* nonl: Terminal Mode Setting.
* noraw: Terminal Mode Setting.
* NSTRINGP: Header Cells.
+* num2dbl: Type Conversions.
* num2long: Type Conversions.
+* num2short: Type Conversions.
* NVECTORP: Header Cells.
-* open-file: Files and Ports.
-* open-input-pipe: Posix Extensions. |
+* open-file: Opening and Closing.
+* open-input-pipe: Posix Extensions.
* open-output-pipe: Posix Extensions.
* open-pipe: Posix Extensions.
-* open-ports: Files and Ports. |
+* open-ports: Opening and Closing.
* opendir: I/O-Extensions.
* OPENP: Ptob Cells.
* OPFPORTP: Ptob Cells.
@@ -7892,35 +7919,34 @@ This is an alphabetical list of all the procedures and macros in SCM.
* pi*: Numeric.
* pi/: Numeric.
* pipe: Posix Extensions.
-* port-closed?: Files and Ports. |
-* port-column: Miscellaneous Procedures.
-* port-filename: Miscellaneous Procedures.
-* port-line: Miscellaneous Procedures.
-* port-type: Files and Ports. |
+* port-closed?: Port Properties.
+* port-column: Port Properties.
+* port-filename: Port Properties.
+* port-line: Port Properties.
+* port-type: Port Properties.
* PORTP: Ptob Cells.
-* print <1>: Miscellaneous Procedures.
* print: Debugging Scheme Code.
* print-args: Debugging Scheme Code.
-* procedure->identifier-macro: Low Level Syntactic Hooks.
-* procedure->macro: Low Level Syntactic Hooks.
-* procedure->memoizing-macro: Low Level Syntactic Hooks.
-* procedure->syntax: Low Level Syntactic Hooks.
-* procedure-documentation: Syntax Extensions.
+* procedure->identifier-macro: Macro Primitives.
+* procedure->macro: Macro Primitives.
+* procedure->memoizing-macro: Macro Primitives.
+* procedure->syntax: Macro Primitives.
+* procedure-documentation: Documentation and Comments.
* profile-alarm: Interrupts.
* profile-alarm-interrupt: Interrupts.
* program-arguments: SCM Session.
* putenv: I/O-Extensions.
-* qase: Syntax Extensions. |
+* qase: Define and Set.
* quit: SCM Session.
* raw: Terminal Mode Setting.
* read-char <1>: Input.
-* read-char: Files and Ports.
-* read-numbered: Line Numbers. |
-* read:sharp: Low Level Syntactic Hooks.
-* read:sharp-char: Low Level Syntactic Hooks.
+* read-char: Port Properties.
+* read-for-load: Line Numbers. |
+* read-numbered: Line Numbers.
+* read:sharp: Modifying Read Syntax. |
* readdir: I/O-Extensions.
-* readlink: Unix Extensions. |
-* record-printer-set!: Records. |
+* readlink: Unix Extensions.
+* record-printer-set!: Records.
* redirect-port!: I/O-Extensions.
* refresh: Window Manipulation.
* regcomp: Regular Expression Pattern Matching.
@@ -7948,28 +7974,30 @@ This is an alphabetical list of all the procedures and macros in SCM.
* scm_evstr: Callbacks.
* scm_find_execpath: Embedding SCM.
* scm_find_implpath: Embedding SCM.
+* scm_gc_protect: Changing Scm.
* scm_init_from_argv: Embedding SCM.
* scm_ldfile: Callbacks.
* scm_ldprog: Callbacks.
* scm_ldstr: Callbacks.
+* scm_protect_temp: Changing Scm.
* scm_top_level: Embedding SCM.
* script_count_argv: Script Support.
* script_find_executable: Script Support.
* script_process_argv: Script Support.
* scroll: Output.
* scrollok: Output Options Setting.
-* serial-array-copy!: Conventional Arrays.
+* serial-array-copy!: Array Mapping.
* serial-array-map!: Array Mapping.
-* set!: Syntax Extensions.
+* set!: Define and Set.
* setegid: Posix Extensions.
* seteuid: Posix Extensions.
* setgid: Posix Extensions.
* setgrent: Posix Extensions.
-* sethostent: Host Data.
-* setnetent: Host Data.
-* setprotoent: Host Data.
+* sethostent: Host and Other Inquiries.
+* setnetent: Host and Other Inquiries.
+* setprotoent: Host and Other Inquiries.
* setpwent: Posix Extensions.
-* setservent: Host Data.
+* setservent: Host and Other Inquiries.
* setuid: Posix Extensions.
* short: Type Conversions.
* SHORT_ALIGN: Continuations.
@@ -7994,12 +8022,11 @@ This is an alphabetical list of all the procedures and macros in SCM.
* STRINGP: Header Cells.
* subwin: Window Manipulation.
* SYMBOLP: Header Cells.
-* symlink: Unix Extensions. |
-* sync: Unix Extensions. |
+* symlink: Unix Extensions.
+* sync: Unix Extensions.
* syntax-quote: Syntactic Hooks for Hygienic Macros.
-* syntax-rules: Syntax Extensions.
+* syntax-rules: Syntax-Rules.
* tanh: Numeric.
-* terms: Miscellaneous Procedures.
* the-macro: Syntactic Hooks for Hygienic Macros.
* throw_to_continuation: Continuations.
* ticks: Interrupts.
@@ -8009,10 +8036,10 @@ This is an alphabetical list of all the procedures and macros in SCM.
* trace: Debugging Scheme Code.
* transpose-array: Conventional Arrays.
* try-arbiter: Process Synchronization.
-* try-create-file: I/O-Extensions. |
-* try-load <1>: Line Numbers. |
-* try-load: Miscellaneous Procedures.
-* try-open-file: Files and Ports.
+* try-create-file: I/O-Extensions.
+* try-load <1>: Line Numbers.
+* try-load: Eval and Load.
+* try-open-file: Opening and Closing.
* ttyname: Posix Extensions.
* TYP16: Cells.
* TYP3: Cells.
@@ -8024,12 +8051,11 @@ This is an alphabetical list of all the procedures and macros in SCM.
* unctrl: Curses Miscellany.
* uniform-array-read!: Uniform Array.
* uniform-array-write: Uniform Array.
-* uniform-vector-fill!: Uniform Array. |
* untrace: Debugging Scheme Code.
* user-interrupt: Interrupts.
* usr:lib: Dynamic Linking.
* utime: I/O-Extensions.
-* vector-set-length!: Miscellaneous Procedures.
+* vector-set-length!: Storage.
* VECTORP: Header Cells.
* VELTS: Header Cells.
* verbose: Internal State.
@@ -8038,7 +8064,7 @@ This is an alphabetical list of all the procedures and macros in SCM.
* vms-debug: SCM Session.
* void: Sweeping the Heap.
* wadd: Output.
-* wait-for-input: Files and Ports.
+* wait-for-input: Port Properties.
* waitpid: Posix Extensions.
* warn: Errors.
* wclear: Output.
@@ -8050,10 +8076,10 @@ This is an alphabetical list of all the procedures and macros in SCM.
* winch: Input.
* winsch: Output.
* winsertln: Output.
-* with-error-to-file: Files and Ports.
-* with-error-to-port: Files and Ports.
-* with-input-from-port: Files and Ports.
-* with-output-to-port: Files and Ports.
+* with-error-to-file: Port Redirection.
+* with-error-to-port: Port Redirection.
+* with-input-from-port: Port Redirection.
+* with-output-to-port: Port Redirection.
* wmove: Window Manipulation.
* wstandend: Curses Miscellany.
* wstandout: Curses Miscellany.
@@ -8071,13 +8097,13 @@ This is an alphabetical list of all the global variables in SCM.
* *execpath: Embedding SCM.
* *interactive* <1>: Internal State.
* *interactive*: SCM Variables.
-* *load-pathname*: Miscellaneous Procedures.
-* *load-reader*: Line Numbers. |
+* *load-pathname*: Eval and Load.
+* *load-reader*: Line Numbers.
* *scm-version*: Internal State.
-* *slib-load-reader*: Line Numbers. |
-* *syntax-rules*: SCM Variables. |
-* af_inet: Host Data.
-* af_unix: Host Data.
+* *slib-load-reader*: Line Numbers.
+* *syntax-rules*: SCM Variables.
+* af_inet: Host and Other Inquiries.
+* af_unix: Host and Other Inquiries.
* BOOL_F: Immediates.
* BOOL_T: Immediates.
* EDITOR: SCM Variables.
@@ -8092,9 +8118,9 @@ This is an alphabetical list of all the global variables in SCM.
* most-positive-fixnum: Numeric.
* NUM_ISPCSYM: Immediates.
* NUM_ISYMS: Immediates.
-* open_both: Files and Ports.
-* open_read: Files and Ports.
-* open_write: Files and Ports.
+* open_both: Opening and Closing.
+* open_read: Opening and Closing.
+* open_write: Opening and Closing.
* pi: Numeric.
* SCHEME_LIBRARY_PATH: SCM Variables.
* SCM_INIT_PATH: SCM Variables.
@@ -8179,7 +8205,7 @@ This is an alphabetical list of data types and feature names in SCM.
* tc7_subr_2: Subr Cells.
* tc7_subr_2o: Subr Cells.
* tc7_subr_3: Subr Cells.
-* tc7_svect: Header Cells. |
+* tc7_svect: Header Cells.
* tc7_uvect: Header Cells.
* tc7_vector: Header Cells.
* tc_dblc: Smob Cells.
@@ -8204,6 +8230,7 @@ Concept Index
* array-for-each: Build Options.
* arrays: Build Options.
* bignums: Build Options.
+* byte: Build Options. |
* callbacks: Callbacks.
* careful-interrupt-masking: Build Options.
* cautious: Build Options.
@@ -8212,32 +8239,34 @@ Concept Index
* continuations: Continuations.
* curses: Build Options.
* debug: Build Options.
-* documentation string: Syntax Extensions.
+* documentation string: Documentation and Comments.
* dump: Build Options.
* dynamic-linking: Build Options.
-* ecache: Memory Management for Environments. |
+* ecache: Memory Management for Environments.
* edit-line: Build Options.
* Embedding SCM: Embedding SCM.
* engineering-notation: Build Options.
-* environments: Memory Management for Environments. |
-* exchanger: Process Synchronization. |
+* environments: Memory Management for Environments.
+* exchanger: Process Synchronization.
* Exrename: Bibliography.
* Extending Scm: Compiling and Linking Custom Files.
* foo.c: Compiling and Linking Custom Files.
* generalized-c-arguments: Build Options.
* graphics: Packages.
-* hobbit: Packages. |
+* hobbit: Packages.
* i/o-extensions: Build Options.
* IEEE: Bibliography.
* inexact: Build Options.
* JACAL: Bibliography.
* lit: Build Options.
* macro: Build Options.
-* memory management: Memory Management for Environments. |
+* memory management: Memory Management for Environments.
* mysql: Build Options.
* no-heap-shrink: Build Options.
-* NO_ENV_CACHE: Memory Management for Environments. |
+* NO_ENV_CACHE: Memory Management for Environments.
* none: Build Options.
+* posix: Posix Extensions.
+* Posix: Posix Extensions.
* posix: Build Options.
* R4RS: Bibliography.
* R5RS: Bibliography.
@@ -8245,6 +8274,8 @@ Concept Index
* record: Build Options.
* regex: Build Options.
* rev2-procedures: Build Options.
+* rope <1>: Type Conversions.
+* rope: Callbacks.
* SchemePrimer: Bibliography.
* SICP: Build Options.
* sicp: Build Options.
@@ -8257,6 +8288,8 @@ Concept Index
* stack-limit: Build Options.
* tick-interrupts: Build Options.
* turtlegr: Build Options.
+* unix: Unix Extensions.
+* Unix: Unix Extensions.
* unix: Build Options.
* windows: Build Options.
* X: Packages.
@@ -8271,113 +8304,126 @@ Concept Index

Tag Table:
-Node: Top203
-Node: Overview1481
-Node: SCM Features1792
-Node: SCM Authors3804
-Node: Copying4742
-Node: Bibliography7831
-Node: Installing SCM9699
-Node: Making SCM10214
-Node: SLIB11131
-Node: Building SCM13149
-Node: Invoking Build13723
-Node: Build Options16516
-Node: Compiling and Linking Custom Files29598
-Node: Installing Dynamic Linking31577
-Node: Configure Module Catalog33361
-Node: Saving Images35358
-Node: Automatic C Preprocessor Definitions36033
-Node: Problems Compiling39541
-Node: Problems Linking41194
-Node: Problems Running41459
-Node: Testing43567
-Node: Reporting Problems46654
-Node: Operational Features47577
-Node: Invoking SCM47941
-Node: SCM Options49585
-Node: Invocation Examples54026
-Node: SCM Variables54978
-Node: SCM Session56487
-Node: Editing Scheme Code58010
-Node: Debugging Scheme Code60153
-Node: Errors63776
-Node: Memoized Expressions68075
-Node: Internal State70439
-Node: Scripting73727
-Node: Unix Scheme Scripts74021
-Node: MS-DOS Compatible Scripts77233
-Node: Unix Shell Scripts79045
-Node: The Language81235
-Node: Standards Compliance81890
-Node: Miscellaneous Procedures84304
-Node: Time87460
-Node: Interrupts88454
-Node: Process Synchronization94464
-Node: Files and Ports97244
-Node: Line Numbers104204
-Node: Soft Ports108304
-Node: Syntax Extensions110296
-Node: Low Level Syntactic Hooks119654
-Node: Syntactic Hooks for Hygienic Macros126507
-Node: Packages133588
-Node: Dynamic Linking134544
-Node: Dump139232
-Node: Numeric143350
-Node: Arrays145077
-Node: Conventional Arrays145366
-Node: Array Mapping152015
-Node: Uniform Array154278
-Node: Bit Vectors160302
-Node: Records161567
-Node: I/O-Extensions163253
-Node: Posix Extensions172179
-Node: Unix Extensions182353
-Node: Regular Expression Pattern Matching184358
-Node: Line Editing188387
-Node: Curses189733
-Node: Output Options Setting190656
-Node: Terminal Mode Setting193305
-Node: Window Manipulation196383
-Node: Output199843
-Node: Input203469
-Node: Curses Miscellany204496
-Node: Sockets205920
-Node: Host Data206244
-Node: Internet Addresses and Socket Names209392
-Node: Socket210926
-Node: The Implementation218163
-Node: Data Types218422
-Node: Immediates219243
-Node: Cells223579
-Node: Header Cells225671
-Node: Subr Cells228892
-Node: Ptob Cells231110
-Node: Smob Cells232649
-Node: Data Type Representations235845
-Node: Operations240503
-Node: Garbage Collection241089
-Node: Marking Cells241710
-Node: Sweeping the Heap243812
-Node: Memory Management for Environments244757
-Node: Signals249314
-Node: C Macros250858
-Node: Changing Scm251981
-Node: Defining Subrs256253
-Node: Defining Smobs258130
-Node: Defining Ptobs261265
-Node: Allocating memory262442
-Node: Embedding SCM264833
-Node: Callbacks272486
-Node: Type Conversions274289
-Node: Continuations277845
-Node: Evaluation282059
-Node: Program Self-Knowledge287222
-Node: File-System Habitat287468
-Node: Executable Pathname291068
-Node: Script Support292686
-Node: Improvements To Make294004
-Node: Finishing Dynamic Linking296036
-Node: Index303782
+Node: Top217
+Node: Overview1471
+Node: SCM Features1782
+Node: SCM Authors3794
+Node: Copying4687
+Node: Bibliography7776
+Node: Installing SCM9644
+Node: Making SCM10159
+Node: SLIB11076
+Node: Building SCM12984
+Node: Invoking Build13558
+Node: Build Options15882
+Node: Compiling and Linking Custom Files31338
+Node: Installing Dynamic Linking33321
+Node: Configure Module Catalog35099
+Node: Saving Images37096
+Node: Automatic C Preprocessor Definitions37771
+Node: Problems Compiling41545
+Node: Problems Linking43198
+Node: Problems Running43463
+Node: Testing45571
+Node: Reporting Problems48635
+Node: Operational Features49477
+Node: Invoking SCM49841
+Node: SCM Options51487
+Node: Invocation Examples55906
+Node: SCM Variables56858
+Node: SCM Session58315
+Node: Editing Scheme Code59830
+Node: Debugging Scheme Code61891
+Node: Errors65514
+Node: Memoized Expressions69813
+Node: Internal State72177
+Node: Scripting75309
+Node: Unix Scheme Scripts75603
+Node: MS-DOS Compatible Scripts78663
+Node: Unix Shell Scripts80641
+Node: The Language82786
+Node: Standards Compliance83404
+Node: Storage85801
+Node: Time88267
+Node: Interrupts89244
+Node: Process Synchronization92854
+Node: Files and Ports94391
+Node: Opening and Closing94724
+Node: Port Properties97193
+Node: Port Redirection99852
+Node: Soft Ports101326
+Node: Eval and Load103105
+Node: Line Numbers104507
+Node: Lexical Conventions107446
+Node: Common-Lisp Read Syntax107764
+Node: Load Syntax110587
+Node: Documentation and Comments112063
+Node: Modifying Read Syntax113388
+Node: Syntax115499
+Node: Define and Set116395
+Node: Defmacro119928
+Node: Syntax-Rules121006
+Node: Macro Primitives122815
+Node: Environment Frames124447
+Node: Syntactic Hooks for Hygienic Macros126853
+Node: Packages133814
+Node: Dynamic Linking134616
+Node: Dump139225
+Node: Numeric143234
+Node: Arrays144961
+Node: Conventional Arrays145171
+Node: Uniform Array148868
+Node: Bit Vectors153661
+Node: Array Mapping154948
+Node: Records157791
+Node: I/O-Extensions158654
+Node: Posix Extensions167248
+Node: Unix Extensions176757
+Node: Regular Expression Pattern Matching178659
+Node: Line Editing182609
+Node: Curses183955
+Node: Output Options Setting184878
+Node: Terminal Mode Setting187527
+Node: Window Manipulation190605
+Node: Output194065
+Node: Input197691
+Node: Curses Miscellany198718
+Node: Sockets200142
+Node: Host and Other Inquiries200481
+Node: Internet Addresses and Socket Names203590
+Node: Socket205139
+Node: The Implementation212376
+Node: Data Types212635
+Node: Immediates213456
+Node: Cells217792
+Node: Header Cells219884
+Node: Subr Cells222925
+Node: Ptob Cells225143
+Node: Smob Cells226682
+Node: Data Type Representations229869
+Node: Operations234567
+Node: Garbage Collection235153
+Node: Marking Cells235774
+Node: Sweeping the Heap237876
+Node: Memory Management for Environments238821
+Node: Signals243378
+Node: C Macros244922
+Node: Changing Scm246045
+Node: Defining Subrs250493
+Node: Defining Smobs252370
+Node: Defining Ptobs255416
+Node: Allocating memory256593
+Node: Embedding SCM258906
+Node: Callbacks266761
+Node: Type Conversions268564
+Node: Continuations272586
+Node: Evaluation276800
+Node: Program Self-Knowledge281963
+Node: File-System Habitat282209
+Node: Executable Pathname285809
+Node: Script Support287427
+Node: Improvements To Make288745
+Node: VMS Dynamic Linking290984
+Node: Index295773

End Tag Table