aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ANNOUNCE283
-rw-r--r--ChangeLog329
-rw-r--r--Idiffer.scm112
-rw-r--r--Init5e1.scm (renamed from Init5d9.scm)499
-rw-r--r--Link.scm31
-rw-r--r--Makefile152
-rw-r--r--README65
-rw-r--r--Transcen.scm136
-rw-r--r--Xlibscm.info681
-rw-r--r--Xlibscm.texi4
-rwxr-xr-xbuild4
-rwxr-xr-xbuild.bat2
-rw-r--r--build.scm385
-rw-r--r--byte.c4
-rwxr-xr-xcompile.scm4
-rw-r--r--differ.c594
-rw-r--r--eval.c47
-rw-r--r--features.txi11
-rw-r--r--hobbit.info306
-rw-r--r--hobbit.scm2
-rw-r--r--hobbit.texi9
-rwxr-xr-xinc2scm4
-rw-r--r--mkimpcat.scm20
-rw-r--r--patchlvl.h4
-rw-r--r--r4rstest.scm48
-rw-r--r--ramap.c27
-rw-r--r--repl.c76
-rw-r--r--scl.c86
-rw-r--r--scm.h970
-rw-r--r--scm.info3967
-rw-r--r--scm.spec80
-rw-r--r--scm.texi434
-rw-r--r--scmfig.h6
-rw-r--r--scmhob.scm5
-rw-r--r--script.c22
-rw-r--r--subr.c12
-rw-r--r--sys.c14
-rw-r--r--unif.c57
-rw-r--r--version.txi4
-rw-r--r--x11.scm106
-rwxr-xr-xxgen.scm4
41 files changed, 5853 insertions, 3753 deletions
diff --git a/ANNOUNCE b/ANNOUNCE
index fc0f9f9..1effd27 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,94 +1,157 @@
-This message announces the availability of Scheme release scm5d9.
-
-New in scm5d9:
-
- * ramap.c (array-map): Added.
- * byte.c: Added. Improves RANDOM speed by 32%.
- * subr.c (scm_logbitp, scm_ash): Prevent wraparound (1>>32==1).
- * ioext.c, posix.c (system->line): Defined.
- * scl.c (floequal): Fixed so 0/0==0/0.
- (eqv, eqp): Use floequal.
- * eval.c (init_eval): add_feature("primitive-hygiene").
- * scl.c (eqp): Fixed so (let ((nan 0/0)) (= nan nan)) ==> #t.
- (in2ex): Infinite loop on (inexact->exact 0/0) change to err.
- * scl.c (iflo2str): Use negated conditional to handle 0/0.
- (NaN2str): Removed "#i" prefix.
-
- * scm.texi (Embedding SCM): Updated libtest example for
- init_user_scm indirection (which Radey added 2003-01-24).
- * scm.texi (MS-DOS Compatible Scripts): Added sharpbang URL.
- * scm.texi (Build Options): Described *.opt option files.
- * scm.texi (Automatic C Preprocessor Definitions): Added IA64.
- * scm.texi (Line Numbers): Added read-for-load.
- (Load Syntax): Distinguished from Read syntax; documented #?line,
- #?column, and #?file.
- (Data Type Representations): Updated port formats.
-
- * Makefile (dfiles): Added version.txi platform.txi features.txi.
- * Makefile (CFLAGS): Removed "-g".
- * Makefile (pg.opt, gdb.opt, dlls.opt): Added. Cleanup options.
- * Makefile (continue.o): Was missing scmfig.h and scm.h
- dependencies.
- * Makefile (uninstallinfo): Created.
- (uninstall): Remove libscmdir files.
- * Makefile (release): Make pdf(s).
-
- * Init5d8.scm (slib:eval-load): Use *load-reader*.
- * repl.c (scm_read_for_load): Added.
- (p_read_numbered, p_read_for_load, p_read): Added locatives.
- (lreadr): Pass appropriate read routine to load:sharp; read:sharp.
- (flgs): Renamed from nump to reduce interference with INUMP, etc.
- * Init5d8.scm (load:sharp, read:sharp): Split read:sharp.
- (load:sharp, read:sharp, char:sharp, read:array): Added READ arg.
- (char:sharp): Renamed from read:sharp-char.
- (read:sharp): Integrated #; into.
- * repl.c (scm_read): Renamed from lread().
- (loc_charsharp): Renamed from loc_readsharpc.
- (loc_loadsharp): Added to separate LOAD-macros from READ-macros.
- (f_read_numbered): Removed unused variable.
- (repl, tryload, scm_load_string): Use scm_read_numbered().
- (lreadpr): Dispatch to loc_readsharp or loc_loadsharp depending on
- nump.
- * Init5d8.scm (make-array): Alias of create-array.
- (read:sharp): Feature evaluation now slib:provided?
-
- * mkimpcat.scm: Added rwb-isam feature.
- * mkimpcat.scm (primitive-hygiene): Use feature to conditionalize
- macro association.
-
- * scmfig.h (CDR_DOUBLES, SHORT_INT): Added __ia64 #defines.
-
- * build.scm (build): processor-family now symbol; i8086 <- 8086.
- * build.scm (manifest): Added "byte.c".
- * build.scm (compile-c-files): Removed "-O" and "-Wall" options;
- use --compiler-options= instead.
- * build.scm: Use open-table! and open-table.
- * build (print-manifest, make-features-txi): Use open-table.
- * build, build.scm: Moved requires to top.
- * compile.scm, hobbit.scm: Added REQUIRE-IFs.
- * hobbit.texi (SLIB Logical Procedures): Removed "logical:"
- aliases.
-
- * bench.scm (benchmark-prng): Limit to 1000 samples if no bignums.
-
- * r4rstest.scm (inexact->exact): Added tests.
- (exact->inexact): check for both exact and inexact argument.
- * r4rstest.scm (6 5 5): Added some kawa chokers: #i, #e.
- Added more kawa STRING->NUMBER bait.
- * r4rstest.scm (test-string->number): Implementations which don't
- allow division by 0 can have fragile string->number.
-
- From Sam Hocevar
- * r4rstest.scm (test-inexact): SECTION 6.2 checks that
- (not (eqv? 1 1.0)).
-
- From Andy Gaynor
- * Makefile (Xlibscm.info, hobbit.info): Fixed / separators.
- * unif.c (make_sh_array): Bracket with ifndef RECKLESS.
-
- From Radey Shouman
- * eval.c (m_case): Check on clauses for CASE was
- confused by line-number annotations.
+This message announces the availability of Scheme release scm5e1.
+
+New in scm5e1:
+
+ * r4rstest.scm: Removed tests for 0^0 in anticipation of SRFI-70.
+ * r4rstest.scm (test-numeric-predicates): Raised exponent so
+ intransitive 128-bit-float implementations are caught.
+ * r4rstest.scm (SECTION 6 5 5): Removed tests for (EXPT 0 -255)
+ so Common-Lisp compatible EXPT won't bomb.
+ Test EXPT inexactness contagion of zero cases.
+ * r4rstest.scm (SECTION 6 5 5): Added exact tests for EXPT.
+ Inexact EXPT corner cases should return inexacts.
+ * r4rstest.scm: Added URLs.
+
+ * Transcen.scm (limit): Check and report input errors.
+ * Transcen.scm (limit): Added srfi-70 procedure.
+ * Transcen.scm (expt, quotient, remainder, modulo): SRFI-70 extensions.
+ * Transcen.scm (expt): Changed so (expt 0 -5) signals error.
+ EXPT of zero returns zero or one matching input exactness.
+
+ * Link.scm (link:link): Converted to use with-load-pathname.
+
+ * Init5d9.scm (numerator, denominator): Check rational.
+ * Init5d9.scm (numerator, denominator): Added.
+ * Init5d9.scm (with-load-pathname): Moved from slib/require.scm.
+ * Init5d9.scm (any-bits-set?, first-set-bit, bitwise-merge): Added
+ remaining SRFI-33 aliases.
+ * Init5d9.scm (read-array-type): Handle A:char.
+ * Init5d9.scm (list->array, vector->array, array->vector): Added.
+ * Init5d9.scm: Updated per SRFI-60.
+ * Init5d9.scm (arithmetic-shift): Aliases ASH.
+ * Init5d9.scm (read:array, read:sharp): Accept whole boatload of
+ SRFI-58 sytnaxes.
+ * Init5d9.scm (inexact->exact, exact->inexact): Identity when
+ exacts-only.
+ * Init5d9.scm (slib:eval-load): Converted to use (SLIB)
+ with-load-pathname.
+ * Init5d9.scm (slib:eval-load): Define moved to "slib/require.scm"
+ * Init5d9.scm (read:array): Ignore third argument; line-numbers
+ were hosing array reading.
+
+ * build.scm (dlll gnu-win32): Changed flag to "-DSCM_WIN_DLL".
+ (dlll microsoft-c-nt): Changed flag to "-DSCM_WIN_DLL".
+ * build.scm (wb): Added for source in ../wb/.
+ (build:command): Assume c-files are relative to cd; don't prefix
+ c-files with scm-srcdir.
+ (compile-dll-c-files): Many were missing include-spec "-I" call.
+ * build.scm (compile-dll-c-files): For those platforms supporting
+ shared object files, generate just one combining all FILES.
+ * build.scm (compile-dll-c-files): Fixed -I for netbsd, openbsd.
+ (compile-dll-c-files): Added -I for svr4-gcc-sun-ld.
+ (file-categories): Renamed CORE from REQUIRED.
+
+ * mkimpcat.scm: Support WB compiled in implementation-vicinity.
+ * mkimpcat.scm: Added 'DIFF.
+
+ * xgen.scm, build.bat, inc2scm: Replaced %0 ... %9 with %~f0 %*
+
+ * scmhob.scm: Moved LOGICAL: aliases from logical.scm.
+
+ * Makefile (install): Added db.so.
+ (uninstall): Beefed up.
+ * Makfile (scm5): Added target for undumpable architectures (FC3).
+ * Makefile (SETARCH): Workaround for unexec on Fedora Linux i386.
+ * Makefile (mydlls): Call BUILD separately for each dll.
+ * Makefile (srcdir.mk): Include after target.
+ Separated shell assignments and exports.
+ * Makefile: (SHOBJS): Abstracted *.sl and *.so.
+ * Makefile (db.so, rwb-isam.scm, wbtab.scm): Added.
+ * Makefile (differ.so): Added target.
+
+ * scm.spec (differ.so, Idiffer.scm): Added to %files.
+
+ * scm.texi (MS-DOS Compatible Scripts): Replaced %0 ... %9 with %~f0 %*
+ * scm.texi (SCMDB): Added section with link.
+ (Hobbit): Moved notinfo stuff after Xlib so it appears same place
+ in all products.
+ * scm.texi (Sequence Comparison): Added.
+ * scm.texi (SIOD copyright): Put in subsection.
+ (The SCM License): Parallel Guile License text.
+ * scm.texi (Automatic C Preprocessor Definitions): Added "sun".
+
+ * scm.h (infi): Nonreal infinity added to sys_protects.
+ * scm.h (SCM_WIN_DLL): renamed from SCM_DLL and DLLSCM.
+
+ * scmfig.h (IS_INF): Removed.
+
+ * scl.c (scm_complex_p): 0/0 is not complex.
+ * scl.c (inf2str): Renamed from NaN2str().
+ (makdbl): Returns `infi' for unreal infinities.
+ (scm_rationalp): Added (infinities not).
+ * scl.c (scm_intexpt): EXPT of zero behaves like Common-Lisp.
+ * scl.c (scm_intexpt): Bombed given (integer-expt 0 25).
+
+ * subr.c (scm_copybitfield): Changed argument order (SRFI-60).
+
+ * unif.c (scm_prot2type): Was not defaulting correctly.
+ * unif.c (raprin1): Don't elide 1 from #1A.
+ * unif.c, sys.c: Sun cc doesn't like fwrite declaration.
+
+ * byte.c (scm_write_byte): Was hosed for even number of bytes.
+ * byte.c (scm_substring_read): Fixed off-by-one reading backwards.
+
+ * ramap.c (array:copy!): Renamed from array-copy!.
+ (array_copy): Arguments reversed.
+ * ramap.c (init_ramap): Its tc7_subr_2 not tc7_subr2!
+ * ramap.c (rafe): Removed unused variables inc and base.
+
+ * repl.c (err_head): Fixed "loaded from" messages and formatting.
+ * repl.c (iprin1): Slashify uppercase chars in symbols.
+ * repl.c (read_token, iprin1, lreadr): Handle slashified symbols.
+ * repl.c (handle_it): Added comments. Call scm_fill_freelist() if
+ interrupt lacks handler.
+ * repl.c (scm_top_level): Default value of toplvl_fun just once.
+
+ * differ.c, Idiffer.scm: Linear-space O(PN) sequence comparison.
+
+ * eval.c (definedp): Added third (dummy) argument.
+
+From Radey Shouman:
+
+ * Init5d9.scm (read:array): Make default rank one, not zero.
+ (as before).
+ * Init5d9.scm (read:array): (read:sharp): (load:sharp): Use read
+ argument passed to READ:SHARP only for eval, otherwise unexpected
+ line numbers cause trouble. eg #+(or) in load file.
+
+ * script.c (find_impl_file): Find executable path accurately
+ on MS windows.
+
+ * scm.texi (Debugging Continuations): Added documenting
+ frame-trace, frame->environment, scope-trace, frame-eval.
+
+ * eval.c (toplevel_define) (scm_arity_check) (ceval_1)
+ (scm_cvapply) (apply): Pass multiple arguments to captured
+ continuations, eg:
+ (call-with-values (lambda () (call/cc (lambda (k) 1 2))) list)
+ Better error checking for multiple-value returns in repl.
+
+ * sys.c (scm_dynthrow): Allow passing multiple arguments
+ to a continuation captured in the producer argument of
+ call-with-values.
+
+ * subr.c (scm_logbitp): Fixed bug in range check for fixnum
+ case. Eg (logbit? 10 #xffff) now correctly returns #t.
+
+ * eval.c (macroexp1): Catch more syntax errors: ('f . f)
+ * eval.c (m_case) (definedp): Avoid segfault in cases of syntax
+ error.
+
+From Wim Lewis:
+
+ * Makefile (scmflags): Use "cmp -s" instead of "diff".
+ (x.h): Use -x $CPROTO to test for cproto's existence.
-=-=-
@@ -104,24 +167,24 @@ include SCM in other programs. Documentation is online at:
http://swissnet.ai.mit.edu/~jaffer/SCM.html
SCM source is available from:
- http://swissnet.ai.mit.edu/ftpdir/scm/scm5d9.zip
- swissnet.ai.mit.edu:/pub/scm/scm5d9.zip
- http://swissnet.ai.mit.edu/ftpdir/scm/scm-5d9-1.src.rpm
- swissnet.ai.mit.edu:/pub/scm/scm-5d9-1.src.rpm
+ http://swissnet.ai.mit.edu/ftpdir/scm/scm5e1.zip
+ swissnet.ai.mit.edu:/pub/scm/scm5e1.zip
+ http://swissnet.ai.mit.edu/ftpdir/scm/scm-5e1-1.src.rpm
+ swissnet.ai.mit.edu:/pub/scm/scm-5e1-1.src.rpm
Also available as i386 binary RPM:
- http://swissnet.ai.mit.edu/ftpdir/scm/scm-5d9-1.i386.rpm
- swissnet.ai.mit.edu:/pub/scm/scm-5d9-1.i386.rpm
+ http://swissnet.ai.mit.edu/ftpdir/scm/scm-5e1-1.i386.rpm
+ swissnet.ai.mit.edu:/pub/scm/scm-5e1-1.i386.rpm
SLIB is a portable Scheme library which SCM uses:
- http://swissnet.ai.mit.edu/ftpdir/scm/slib3a1.zip
- swissnet.ai.mit.edu:/pub/scm/slib3a1.zip
+ http://swissnet.ai.mit.edu/ftpdir/scm/slib3a2.zip
+ swissnet.ai.mit.edu:/pub/scm/slib3a2.zip
Also available as RPM:
- http://swissnet.ai.mit.edu/ftpdir/scm/slib-3a1-1.noarch.rpm
- swissnet.ai.mit.edu:/pub/scm/slib-3a1-1.noarch.rpm
+ http://swissnet.ai.mit.edu/ftpdir/scm/slib-3a2-1.noarch.rpm
+ swissnet.ai.mit.edu:/pub/scm/slib-3a2-1.noarch.rpm
JACAL is a symbolic math system written in Scheme:
- http://swissnet.ai.mit.edu/ftpdir/scm/jacal1b4.zip
- swissnet.ai.mit.edu:/pub/scm/jacal1b4.zip
+ http://swissnet.ai.mit.edu/ftpdir/scm/jacal1b5.zip
+ swissnet.ai.mit.edu:/pub/scm/jacal1b5.zip
SLIB-PSD is a portable debugger for Scheme (requires emacs editor):
http://swissnet.ai.mit.edu/ftpdir/scm/slib-psd1-3.tar.gz
@@ -149,13 +212,13 @@ SCM (similar to XSCM).
WB is a disk based, sorted associative array (B-tree) library for SCM.
Using WB, large databases can be created and managed from SCM.
- http://swissnet.ai.mit.edu/ftpdir/scm/wb1b1.zip
- swissnet.ai.mit.edu:/pub/scm/wb1b1.zip
- http://swissnet.ai.mit.edu/ftpdir/scm/wb-1b1-1.src.rpm
- swissnet.ai.mit.edu:/pub/scm/wb-1b1-1.src.rpm
+ http://swissnet.ai.mit.edu/ftpdir/scm/wb1c1.zip
+ swissnet.ai.mit.edu:/pub/scm/wb1c1.zip
+ http://swissnet.ai.mit.edu/ftpdir/scm/wb-1c1-1.src.rpm
+ swissnet.ai.mit.edu:/pub/scm/wb-1c1-1.src.rpm
Also available as i386 binary RPM:
- http://swissnet.ai.mit.edu/ftpdir/scm/wb-1b1-1.i386.rpm
- swissnet.ai.mit.edu:/pub/scm/wb-1b1-1.i386.rpm
+ http://swissnet.ai.mit.edu/ftpdir/scm/wb-1c1-1.i386.rpm
+ swissnet.ai.mit.edu:/pub/scm/wb-1c1-1.i386.rpm
SIMSYNCH is a digital logic simulation system written in SCM.
http://swissnet.ai.mit.edu/ftpdir/scm/synch1b0.zip
@@ -168,7 +231,7 @@ systems.
ftp.gnu.org:pub/gnu/dld/dld-3.3.tar.gz
SCM.EXE (282k) is a SCM executable for DOS and MS-Windows.
-Note: SCM.EXE still requires slib3a1 and scm5d9 above.
+Note: SCM.EXE still requires slib3a2 and scm5e1 above.
http://swissnet.ai.mit.edu/ftpdir/scm/scm.exe
swissnet.ai.mit.edu:/pub/scm/scm.exe
diff --git a/ChangeLog b/ChangeLog
index 0e564f2..df2ebd4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,328 @@
+2005-06-25 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * scm.spec (slibpath, dumparch): Added.
+
+2005-06-24 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * Makefile (DOSCM): Abstracted DOS zip creation.
+
+ * Transcen.scm, Init5e1.scm (infinite?, finite?): Added.
+
+ * scl.c (makdbl, init_scl): Don't bother with scm_narn for MSC.
+ (scm_finitep): Removed to Transcen.scm and Init5e1.scm.
+
+ * scm.h (scm_narn): Renamed from infi.
+
+2005-06-21 Aubrey Jaffer <jaffer@aubrey>
+
+ * patchlvl.h (SCMVERSION): Bumped from 5d9 to 5e1.
+
+2005-06-13 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * Transcen.scm (limit): Check and report input errors.
+
+2005-06-12 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * Transcen.scm (limit): Added srfi-70 procedure.
+
+2005-05-20 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * r4rstest.scm: Removed tests for 0^0 in anticipation of SRFI-70.
+
+ * scl.c (scm_complex_p): 0/0 is not complex.
+
+2005-05-18 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * Makfile (scm5): Added target for undumpable architectures (FC3).
+ * Transcen.scm (expt, quotient, remainder, modulo): SRFI-70
+ extensions.
+
+2005-05-10 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * scl.c (inf2str): Renamed from NaN2str().
+ (makdbl): Returns `infi' for unreal infinities.
+ (scm_rationalp): Added (infinities not).
+
+ * scm.h (infi): Nonreal infinity added to sys_protects.
+
+ * scmfig.h (IS_INF): Removed.
+
+ * Init5d9.scm (numerator, denominator): Check rational.
+
+2005-04-15 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * Init5d9.scm (numerator, denominator): Added.
+
+2005-04-14 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * Init5d9.scm (with-load-pathname): Moved from slib/require.scm.
+
+2005-03-18 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * Makefile (install): Added db.so.
+ (uninstall): Beefed up.
+
+2005-01-30 Radey Shouman <shouman@comcast.net>
+
+ * Init5d9.scm (read:array): Make default rank one, not zero.
+ (as before).
+
+2005-01-27 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * Init5d9.scm (any-bits-set?, first-set-bit, bitwise-merge): Added
+ remaining SRFI-33 aliases.
+
+2005-01-26 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * Init5d9.scm (read-array-type): Handle A:char.
+
+2005-01-19 Radey Shouman <shouman@comcast.net>
+
+ * script.c (find_impl_file): Find executable path accurately
+ on MS windows.
+
+ * Init5d9.scm (read:array): (read:sharp): (load:sharp): Use read
+ argument passed to READ:SHARP only for eval, otherwise unexpected
+ line numbers cause trouble. eg #+(or) in load file.
+
+2005-01-18 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * scm.texi (MS-DOS Compatible Scripts): Replaced %0 ... %9 with
+ %~f0 %*
+
+ * xgen.scm, build.bat, inc2scm: Replaced %0 ... %9 with %~f0 %*
+
+2005-01-16 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * Init5d9.scm (list->array, vector->array, array->vector): Added.
+
+2005-01-09 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * Init5d9.scm: Updated per SRFI-60.
+
+ * subr.c (scm_copybitfield): Changed argument order (SRFI-60).
+
+2005-01-08 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * Init5d9.scm (arithmetic-shift): Aliases ASH.
+
+ * scmhob.scm: Moved LOGICAL: aliases from logical.scm.
+
+2005-01-06 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * Init5d9.scm (read:array, read:sharp): Accept whole boatload of
+ SRFI-58 sytnaxes.
+
+2005-01-01 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * unif.c (scm_prot2type): Was not defaulting correctly.
+
+2004-12-26 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * unif.c (raprin1): Don't elide 1 from #1A.
+
+2004-11-29 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * Makefile (SETARCH): Workaround for unexec on Fedora Linux i386.
+
+2004-11-14 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * r4rstest.scm (test-numeric-predicates): Raised exponent so
+ intransitive 128-bit-float implementations are caught.
+
+2004-10-13 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * byte.c (scm_write_byte): Was hosed for even number of bytes.
+
+ * scl.c (scm_intexpt): EXPT of zero behaves like Common-Lisp.
+
+ * r4rstest.scm (SECTION 6 5 5): Removed tests for (EXPT 0 -255)
+ so Common-Lisp compatible EXPT won't bomb.
+ Test EXPT inexactness contagion of zero cases.
+
+ * Transcen.scm (expt): Changed so (expt 0 -5) signals error.
+ EXPT of zero returns zero or one matching input exactness.
+
+2004-10-10 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * r4rstest.scm (SECTION 6 5 5): Added exact tests for EXPT.
+ Inexact EXPT corner cases should return inexacts.
+
+ * scl.c (scm_intexpt): Bombed given (integer-expt 0 25).
+
+2004-09-23 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * Init5d9.scm (inexact->exact, exact->inexact): Identity when
+ exacts-only.
+
+2004-09-15 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * ramap.c (array:copy!): Renamed from array-copy!.
+ (array_copy): Arguments reversed.
+
+2004-09-12 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * scm.texi (SCMDB): Added section with link.
+ (Hobbit): Moved notinfo stuff after Xlib so it appears same place
+ in all products.
+
+2004-09-09 Wim Lewis
+
+ * Makefile (scmflags): Use "cmp -s" instead of "diff".
+ (x.h): Use -x $CPROTO to test for cproto's existence.
+
+2004-09-04 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * build.scm (dlll gnu-win32): Changed flag to "-DSCM_WIN_DLL".
+ (dlll microsoft-c-nt): Changed flag to "-DSCM_WIN_DLL".
+
+ * scm.h (SCM_WIN_DLL): renamed from SCM_DLL and DLLSCM.
+ Unatabified.
+
+ * ramap.c (init_ramap): Its tc7_subr_2 not tc7_subr2!
+
+2004-08-11 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * byte.c (scm_substring_read): Fixed off-by-one reading backwards.
+
+2004-07-29 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * Makefile (db.so, rwb-isam.scm, wbtab.scm): Added.
+
+2004-07-28 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * build.scm (wb): Added for source in ../wb/.
+ (build:command): Assume c-files are relative to cd; don't prefix
+ c-files with scm-srcdir.
+ (compile-dll-c-files): Many were missing include-spec "-I" call.
+
+ * mkimpcat.scm: Support WB compiled in implementation-vicinity.
+
+2002-07-07 Radey Shouman <shouman@attbi.com>
+
+ * scm.texi (Debugging Continuations): Added documenting
+ frame-trace, frame->environment, scope-trace, frame-eval.
+
+2004-06-14 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * Init5d9.scm (slib:eval-load): Define moved to "slib/require.scm"
+
+2004-06-13 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * repl.c (err_head): Fixed "loaded from" messages and formatting.
+
+ * Init5d9.scm (slib:eval-load): Converted to use (SLIB)
+ with-load-pathname.
+
+ * Link.scm (link:link): Converted to use with-load-pathname.
+
+2004-05-28 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * Makefile: (SHOBJS): Abstracted *.sl and *.so.
+
+2004-05-27 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * repl.c (iprin1): Slashify uppercase chars in symbols.
+
+2004-04-17 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * differ.c, Idiffer.scm: Linear-space O(PN) sequence comparison.
+
+ * scm.spec (differ.so, Idiffer.scm): Added to %files.
+
+ * Makefile (differ.so): Added target.
+
+ * scm.texi (Sequence Comparison): Added.
+
+2004-03-27 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * ramap.c (rafe): Removed unused variables inc and base.
+
+2004-03-26 Radey Shouman <shouman@comcast.net>
+
+ * eval.c (toplevel_define) (scm_arity_check) (ceval_1)
+ (scm_cvapply) (apply): Pass multiple arguments to captured
+ continuations, eg:
+ (call-with-values (lambda () (call/cc (lambda (k) 1 2))) list)
+ Better error checking for multiple-value returns in repl.
+
+ * sys.c (scm_dynthrow): Allow passing multiple arguments
+ to a continuation captured in the producer argument of
+ call-with-values.
+
+2004-03-08 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * Makefile (mydlls): Call BUILD separately for each dll.
+
+2004-03-07 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * mkimpcat.scm: Added 'DIFF.
+
+ * build.scm (compile-dll-c-files): For those platforms supporting
+ shared object files, generate just one combining all FILES.
+
+2004-02-24 Radey Shouman <shouman@comcast.net>
+
+ * subr.c (scm_logbitp): Fixed bug in range check for fixnum
+ case. Eg (logbit? 10 #xffff) now correctly returns #t.
+
+2004-02-19 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * Init5d9.scm (read:array): Ignore third argument; line-numbers
+ were hosing array reading.
+
+2004-02-08 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * repl.c (handle_it): Added comments. Call scm_fill_freelist() if
+ interrupt lacks handler.
+
+2004-02-02 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * repl.c (scm_top_level): Default value of toplvl_fun just once.
+
+2004-01-30 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * build.scm (compile-dll-c-files): Fixed -I for netbsd, openbsd.
+ (compile-dll-c-files): Added -I for svr4-gcc-sun-ld.
+ (file-categories): Renamed CORE from REQUIRED.
+
+2004-01-20 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * repl.c (read_token, iprin1, lreadr): Handle slashified symbols.
+
+2004-01-19 Radey Shouman <shouman@comcast.net>
+
+ * eval.c (macroexp1): Catch more syntax errors: ('f . f)
+
+2004-01-17 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * scm.texi (SIOD copyright): Put in subsection.
+ (The SCM License): Parallel Guile License text.
+
+2004-01-16 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * scm.texi (Automatic C Preprocessor Definitions): Added "sun".
+
+ * unif.c, sys.c: Sun cc doesn't like fwrite declaration.
+
+2004-01-14 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * Makefile (srcdir.mk): Include after target.
+ Separated shell assignments and exports.
+
+2004-01-07 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * r4rstest.scm: Added URLs.
+
+2004-01-07 Radey Shouman <shouman@comcast.net>
+
+ * eval.c (m_case) (definedp): Avoid segfault in cases of syntax
+ error.
+
+2003-12-03 Aubrey Jaffer <agj@alum.mit.edu>
+
+ * eval.c (definedp): Added third (dummy) argument.
+
2003-11-30 Aubrey Jaffer <jaffer@scm.jaffer>
* patchlvl.h (SCMVERSION): Bumped from 5d8 to 5d9.
@@ -3431,8 +3756,8 @@ Fri Sep 11 17:25:14 EDT 1998 Aubrey Jaffer <jaffer@scm.colorage.net>
1998-08-10 Aubrey Jaffer <jaffer@colorage.com>
- * sys.c (scm_fill_freelist): added. Assures that at least
- MIN_GC_YIELD cells are in freelis. This is used before returning
+ * sys.c (scm_fill_freelist): Added; assures that at least
+ MIN_GC_YIELD cells are in freelist. This is used before returning
from interrupts.
* repl.c (handle_it): Discard 2 cells (because of CDR in NEWCELL).
diff --git a/Idiffer.scm b/Idiffer.scm
new file mode 100644
index 0000000..ee36485
--- /dev/null
+++ b/Idiffer.scm
@@ -0,0 +1,112 @@
+;; Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+;;
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+;;
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with this software; see the file COPYING. If not, write to
+;; the Free Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111, USA.
+;;
+;; As a special exception, the Free Software Foundation gives permission
+;; for additional uses of the text contained in its release of SCM.
+;;
+;; The exception is that, if you link the SCM library with other files
+;; to produce an executable, this does not by itself cause the
+;; resulting executable to be covered by the GNU General Public License.
+;; Your use of that executable is in no way restricted on account of
+;; linking the SCM library code into it.
+;;
+;; This exception does not however invalidate any other reasons why
+;; the executable file might be covered by the GNU General Public License.
+;;
+;; This exception applies only to the code released by the
+;; Free Software Foundation under the name SCM. If you copy
+;; code from other Free Software Foundation releases into a copy of
+;; SCM, as the General Public License permits, the exception does
+;; not apply to the code that you add in this way. To avoid misleading
+;; anyone as to the status of such modified files, you must delete
+;; this exception notice from them.
+;;
+;; If you write modifications of your own for SCM, it is your choice
+;; whether to permit this exception to apply to your modifications.
+;; If you do not wish that, delete this exception notice.
+
+;;;; Linear-space O(PN) sequence comparison.
+;;; "Idiffer.scm" Top-level sequence-comparison functions.
+;;; Author: Aubrey Jaffer
+
+(define (diff:invert-edits! edits)
+ (define cost (car (array-dimensions edits)))
+ (do ((idx (+ -1 cost) (+ -1 idx)))
+ ((negative? idx))
+ (array-set! edits (- (array-ref edits idx)) idx)))
+
+(define (edits2lcs! lcs edits A)
+ (define cost (car (array-dimensions edits)))
+ (define len-a (car (array-dimensions A)))
+ (let loop ((edx 0)
+ (sdx 0)
+ (adx 0))
+ (let ((edit (if (< edx cost) (array-ref edits edx) 0)))
+ (cond ((>= adx len-a))
+ ((positive? edit)
+ (loop (+ 1 edx) sdx adx))
+ ((zero? edit)
+ (array-set! lcs (array-ref A adx) sdx)
+ (loop edx (+ 1 sdx) (+ 1 adx)))
+ ((>= adx (- -1 edit))
+ (loop (+ 1 edx) sdx (+ 1 adx)))
+ (else
+ (array-set! lcs (array-ref A adx) sdx)
+ (loop edx (+ 1 sdx) (+ 1 adx)))))))
+
+(define (diff:longest-common-subsequence A B . p-lim)
+ (define M (car (array-dimensions A)))
+ (define N (car (array-dimensions B)))
+ (set! p-lim (if (null? p-lim) -1 (car p-lim)))
+ (let ((edits (if (< N M)
+ (diff:edits B A p-lim)
+ (diff:edits A B p-lim))))
+ (and edits
+ (let* ((cost (car (array-dimensions edits)))
+ (lcs (make-array A (/ (- (+ N M) cost) 2))))
+ (edits2lcs! lcs edits (if (< N M) B A))
+ lcs))))
+
+(define (diff:edits A B . p-lim)
+ (define M (car (array-dimensions A)))
+ (define N (car (array-dimensions B)))
+ (set! p-lim (if (null? p-lim) -1 (car p-lim)))
+ (let ((fp (make-array (A:fixZ32b) (if (negative? p-lim)
+ (+ 3 M N)
+ (+ 3 (abs (- N M)) p-lim p-lim)))))
+ (define est (if (< N M)
+ (diff2editlen fp B A p-lim)
+ (diff2editlen fp A B p-lim)))
+ (and est
+ (let ((edits (make-array (A:fixZ32b) est))
+ (CCRR (make-array (A:fixZ32b) (* 2 (+ (max M N) 1)))))
+ (cond ((< N M)
+ (diff2edits! edits fp CCRR B A)
+ (diff:invert-edits! edits))
+ (else
+ (diff2edits! edits fp CCRR A B)))
+ edits))))
+
+(define (diff:edit-length A B . p-lim)
+ (define M (car (array-dimensions A)))
+ (define N (car (array-dimensions B)))
+ (set! p-lim (if (null? p-lim) -1 (car p-lim)))
+ (let ((fp (make-array (A:fixZ32b) (if (negative? p-lim)
+ (+ 3 M N)
+ (+ 3 (abs (- N M)) p-lim p-lim)))))
+ (if (< N M)
+ (diff2editlen fp B A p-lim)
+ (diff2editlen fp A B p-lim))))
diff --git a/Init5d9.scm b/Init5e1.scm
index a95fada..ae2f591 100644
--- a/Init5d9.scm
+++ b/Init5e1.scm
@@ -1,4 +1,4 @@
-;; Copyright (C) 1991-2002 Free Software Foundation, Inc.
+;; Copyright (C) 1991-2005 Free Software Foundation, Inc.
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -42,18 +42,85 @@
;;; Author: Aubrey Jaffer.
(define (scheme-implementation-type) 'SCM)
-(define (scheme-implementation-version) "5d9")
+(define (scheme-implementation-version) "5e1")
(define (scheme-implementation-home-page)
- "http://swissnet.ai.mit.edu/~jaffer/SCM")
+ "http://swiss.csail.mit.edu/~jaffer/SCM")
+;@
(define in-vicinity string-append)
+;@
+(define (user-vicinity)
+ (case (software-type)
+ ((VMS) "[.]")
+ (else "")))
+;@
+(define vicinity:suffix?
+ (let ((suffi
+ (case (software-type)
+ ((AMIGA) '(#\: #\/))
+ ((MACOS THINKC) '(#\:))
+ ((MS-DOS WINDOWS ATARIST OS/2) '(#\\ #\/))
+ ((NOSVE) '(#\: #\.))
+ ((UNIX COHERENT PLAN9) '(#\/))
+ ((VMS) '(#\: #\]))
+ (else
+ (slib:warn "require.scm" 'unknown 'software-type (software-type))
+ "/"))))
+ (lambda (chr) (and (memv chr suffi) #t))))
+;@
+(define (pathname->vicinity pathname)
+ (let loop ((i (- (string-length pathname) 1)))
+ (cond ((negative? i) "")
+ ((vicinity:suffix? (string-ref pathname i))
+ (substring pathname 0 (+ i 1)))
+ (else (loop (- i 1))))))
+(define (program-vicinity)
+ (if *load-pathname*
+ (pathname->vicinity *load-pathname*)
+ (slib:error 'program-vicinity " called; use slib:load to load")))
+;@
+(define sub-vicinity
+ (case (software-type)
+ ((VMS) (lambda
+ (vic name)
+ (let ((l (string-length vic)))
+ (if (or (zero? (string-length vic))
+ (not (char=? #\] (string-ref vic (- l 1)))))
+ (string-append vic "[" name "]")
+ (string-append (substring vic 0 (- l 1))
+ "." name "]")))))
+ (else (let ((*vicinity-suffix*
+ (case (software-type)
+ ((NOSVE) ".")
+ ((MACOS THINKC) ":")
+ ((MS-DOS WINDOWS ATARIST OS/2) "\\")
+ ((UNIX COHERENT PLAN9 AMIGA) "/"))))
+ (lambda (vic name)
+ (string-append vic name *vicinity-suffix*))))))
+;@
+(define (make-vicinity <pathname>) <pathname>)
+;@
+(define with-load-pathname
+ (let ((exchange
+ (lambda (new)
+ (let ((old *load-pathname*))
+ (set! *load-pathname* new)
+ old))))
+ (lambda (path thunk)
+ (let ((old #f))
+ (dynamic-wind
+ (lambda () (set! old (exchange path)))
+ thunk
+ (lambda () (exchange old)))))))
(set! *features*
(append '(ed getenv tmpnam abort transcript with-file
ieee-p1178 rev4-report rev4-optional-procedures
hash object-hash delay dynamic-wind fluid-let
multiarg-apply multiarg/and- logical defmacro
- string-port source current-time sharp:semi)
+ string-port source current-time sharp:semi
+ vicinity srfi-59
+ srfi-60) ;logical
*features*))
(define eval
@@ -78,6 +145,7 @@
(define (terms)
(display-file (in-vicinity (implementation-vicinity) "COPYING")))
+;;; Read integer up to first non-digit
(define (read:try-number port . ic)
(define chr0 (char->integer #\0))
(let loop ((arg (and (not (null? ic)) (- (char->integer (car ic)) chr0))))
@@ -88,60 +156,116 @@
(- (char->integer (read-char port)) chr0))))
(else arg)))))
-(define (read:array rank port read)
+(define (read-array-type port)
(define (bomb pc wid)
- (error (string-append "array syntax? #"
- (number->string rank)
- "A" (string pc)
- (if wid (number->string wid) ""))))
- (list->uniform-array
- rank
- (case (char-downcase (peek-char port))
- ((#\\) (read-char port) #\a)
- ((#\t) (read-char port) #t)
- ((#\c #\r)
- (let* ((pc (read-char port))
- (wid (read:try-number port)))
- (case wid
- ((64 32) (case pc
- ((#\c) (* +i wid))
- (else (exact->inexact wid))))
- (else (bomb pc wid)))))
- ((#\s #\u)
- (let* ((pc (read-char port))
- (wid (read:try-number port)))
- (case (or wid (peek-char port))
- ((32 16 8) (case pc
- ((#\s) (- wid))
- (else wid)))
- ((#\s #\f #\d #\l) (read-char port) 32)
- ((#\() 32) ;legacy
- (else (bomb pc wid)))))
- ((#\e) ;legacy
- (read-char port)
- (case (char-downcase (peek-char port))
- ((#\s) (read-char port) -16)
- ((#\f #\d #\l) (read-char port) -32)
- (else -32)))
- ((#\i) ;legacy
- (read-char port)
- (case (char-downcase (peek-char port))
- ((#\c)
- (read-char port)
- (case (char-downcase (peek-char port))
- ((#\s #\f #\d #\l) (read-char port)))
- +64i)
- ((#\s #\f) (read-char port) 32.0)
- ((#\d #\l) (read-char port) 64.0)
- (else (bomb (read-char port) #f))))
- (else #f))
- (read port)))
+ (error 'array 'syntax? (symbol-append "#" rank "A" pc wid)))
+ (case (char-downcase (peek-char port))
+ ((#\:) (read-char port)
+ (let ((typ (let loop ((arg '()))
+ (if (= 4 (length arg))
+ (string->symbol (list->string (reverse arg)))
+ (let ((c (read-char port)))
+ (and (not (eof-object? c))
+ (loop (cons (char-downcase c) arg))))))))
+ (define wid (and typ (not (eq? 'bool typ)) (read:try-number port)))
+ (define (check-suffix chrs)
+ (define chr (read-char port))
+ (if (and (char? chr) (not (memv (char-downcase chr) chrs)))
+ (error 'array-type? (symbol-append ":" typ wid chr))))
+ (define prot (assq typ '((floc (128 . +64.0i)
+ (64 . +64.0i)
+ (32 . +32.0i)
+ (16 . +32.0i))
+ (flor (128 . 64.0)
+ (64 . 64.0)
+ (32 . 32.0)
+ (16 . 32.0))
+ (fixz (64 . -64)
+ (32 . -32)
+ (16 . -16)
+ (8 . -8))
+ (fixn (64 . 64)
+ (32 . 32)
+ (16 . 16)
+ (8 . 8))
+ (char . #\a)
+ (bool . #t))))
+ (if prot (set! prot (cdr prot)))
+ (cond ((pair? prot)
+ (set! prot (assv wid (cdr prot)))
+ (if (pair? prot) (set! prot (cdr prot)))
+ (if wid (check-suffix (if (and (inexact? prot) (real? prot))
+ '(#\b #\d)
+ '(#\b)))))
+ (prot)
+ (else (check-suffix '())))
+ prot))
+ ((#\\) (read-char port) #\a)
+ ((#\t) (read-char port) #t)
+ ((#\c #\r) (let* ((pc (read-char port)) (wid (read:try-number port)))
+ (case wid
+ ((64 32) (case pc
+ ((#\c) (* +i wid))
+ (else (exact->inexact wid))))
+ (else (bomb pc wid)))))
+ ((#\s #\u) (let* ((pc (read-char port)) (wid (read:try-number port)))
+ (case (or wid (peek-char port))
+ ((32 16 8) (case pc
+ ((#\s) (- wid))
+ (else wid)))
+ (else (bomb pc wid)))))
+ (else #f)))
+
+;;; We come into read:array with number or #f for RANK.
+(define (read:array rank dims port)
+ (define (make-it rank dims typ)
+ (list->uniform-array (cond (rank)
+ ((null? dims) 1)
+ (else (length dims)))
+ typ
+ (read port)))
+ (let loop ((dims dims))
+ (define dim (read:try-number port))
+ (if dim
+ (loop (cons dim dims))
+ (case (peek-char port)
+ ((#\*) (read-char port) (loop dims))
+ ((#\: #\\ #\t #\c #\r #\s #\u #\T #\C #\R #\S #\U)
+ (make-it rank dims (read-array-type port)))
+ (else
+ (make-it rank dims #f))))))
+
+;;; read-macros valid for LOAD and READ.
+(define (read:sharp c port reader) ; ignore reader
+ (case c
+ ;; Used in "implcat" and "slibcat"
+ ((#\+) (if (slib:provided? (read port))
+ (read port)
+ (begin (read port) (if #f #f))))
+ ;; Used in "implcat" and "slibcat"
+ ((#\-) (if (slib:provided? (read port))
+ (begin (read port) (if #f #f))
+ (read port)))
+ ((#\a #\A) (read:array #f '() port))
+ ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9)
+ (let* ((num (read:try-number port c))
+ (chr (peek-char port)))
+ (case chr
+ ((#\a #\A) (read-char port)
+ (read:array num '() port))
+ ((#\*) (read-char port)
+ (read:array #f (list num) port))
+ (else
+ (read:array 1 (list num) port))
+ ;;(else (error 'sharp 'syntax? (symbol-append "#" num chr)))
+ )))
+ (else (error "unknown # object" c))))
;;; read-macros valid only in LOAD.
-(define (load:sharp c port read)
+(define (load:sharp c port reader) ;reader used only for #.
(case c
((#\') (read port))
- ((#\.) (eval (read port)))
+ ((#\.) (eval (reader port)))
((#\!) (let skip ((metarg? #f))
(let ((c (read-char port)))
(case c
@@ -167,25 +291,6 @@
(else #f)))
(else (read:sharp c port read))))
-;;; read-macros valid for LOAD and READ.
-(define (read:sharp c port read)
- (case c
- ;; Used in "implcat" and "slibcat"
- ((#\+) (if (slib:provided? (read port))
- (read port)
- (begin (read port) (if #f #f))))
- ;; Used in "implcat" and "slibcat"
- ((#\-) (if (slib:provided? (read port))
- (begin (read port) (if #f #f))
- (read port)))
- ((#\a #\A) (read:array 1 port read))
- ((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9)
- (let* ((num (read:try-number port c))
- (c (peek-char port)))
- (cond ((memv c '(#\a #\A)) (read-char port) (read:array num port read))
- (else (error "syntax? #" num c)))))
- (else (error "unknown # object" c))))
-
;;; We can assume TOK has at least 2 characters.
(define char:sharp
(letrec ((numeric-1
@@ -233,8 +338,8 @@
(string-append (or comment "") "\n"))
(reverse *accumulated-comments*)))))
(set! *accumulated-comments* '())
- (if (equal? "" ans)
- "no-comment" ;#f
+ (if (equal? "" ans)
+ "no-comment" ;#f
(substring ans 0 (+ -1 (string-length ans))))))
(else (set! *accumulated-comments*
(append (reverse args) *accumulated-comments*)))))))
@@ -702,11 +807,12 @@
(apply string-append
(map
(lambda (obj)
- (cond ((string? obj) (s2cis obj))
+ (cond ((char? obj) (string obj))
+ ((string? obj) (s2cis obj))
((number? obj) (s2cis (number->string obj)))
((symbol? obj) (symbol->string obj))
((not obj) "")
- (else (slib:error 'wrong-type-to 'symbol-append obj))))
+ (else (error 'wrong-type-to 'symbol-append obj))))
args))))))
(define (StudlyCapsExpand nstr . delimitr)
(set! delimitr
@@ -734,28 +840,44 @@
;;;; Bit order and lamination
-(define (logical:ones deg)
- (if (zero? deg) 0 (+ (* 2 (+ -1 (integer-expt 2 (- deg 1)))) 1)))
-
-(define (rotate k count len)
- (set! count (modulo count len))
- (logior (logand (ash k count) (logical:ones len))
- (ash k (- count len))))
-(define logical:rotate rotate)
+;;(define (logical:ones deg) (lognot (ash -1 deg)))
+
+;;; New with SRFI-60
+(define (rotate-bit-field n count start end)
+ (define width (- end start))
+ (set! count (modulo count width))
+ (let ((mask (lognot (ash -1 width))))
+ (define azn (logand mask (arithmetic-shift n (- start))))
+ (logior (arithmetic-shift
+ (logior (logand mask (arithmetic-shift azn count))
+ (arithmetic-shift azn (- count width)))
+ start)
+ (logand (lognot (ash mask start)) n))))
+;;; Legacy
+;;(define (logical:rotate k count len) (rotate-bit-field k count 0 len))
+
+(define (log2-binary-factors n)
+ (+ -1 (integer-length (logand n (- n)))))
(define (bit-reverse k n)
- (do ((m (if (negative? n) (lognot n) n) (ash m -1))
+ (do ((m (if (negative? n) (lognot n) n) (arithmetic-shift m -1))
(k (+ -1 k) (+ -1 k))
- (rvs 0 (logior (ash rvs 1) (logand 1 m))))
+ (rvs 0 (logior (arithmetic-shift rvs 1) (logand 1 m))))
((negative? k) (if (negative? n) (lognot rvs) rvs))))
+(define (reverse-bit-field n start end)
+ (define width (- end start))
+ (let ((mask (lognot (ash -1 width))))
+ (define zn (logand mask (arithmetic-shift n (- start))))
+ (logior (arithmetic-shift (bit-reverse width zn) start)
+ (logand (lognot (ash mask start)) n))))
(define (integer->list k . len)
(if (null? len)
- (do ((k k (ash k -1))
+ (do ((k k (arithmetic-shift k -1))
(lst '() (cons (odd? k) lst)))
((<= k 0) lst))
(do ((idx (+ -1 (car len)) (+ -1 idx))
- (k k (ash k -1))
+ (k k (arithmetic-shift k -1))
(lst '() (cons (odd? k) lst)))
((negative? idx) lst))))
@@ -766,52 +888,17 @@
(define (booleans->integer . bools)
(list->integer bools))
-(define (bitwise:laminate . ks)
- (define nks (length ks))
- (define nbs (apply max (map integer-length ks)))
- (do ((kdx (+ -1 nbs) (+ -1 kdx))
- (ibs 0 (+ (list->integer (map (lambda (k) (logbit? kdx k)) ks))
- (ash ibs nks))))
- ((negative? kdx) ibs)))
-
-(define (bitwise:delaminate count k)
- (define nbs (* count (+ 1 (quotient (integer-length k) count))))
- (do ((kdx (- nbs count) (- kdx count))
- (lst (vector->list (make-vector count 0))
- (map (lambda (k bool) (+ (if bool 1 0) (ash k 1)))
- lst
- (integer->list (ash k (- kdx)) count))))
- ((negative? kdx) lst)))
-
-;;;; Gray-code
-
-(define (integer->gray-code k)
- (logxor k (ash k -1)))
-
-(define (gray-code->integer k)
- (if (negative? k)
- (error 'gray-code->integer 'negative? k)
- (let ((kln (integer-length k)))
- (do ((d 1 (* d 2))
- (ans (logxor k (ash k -1)) ; == (integer->gray-code k)
- (logxor ans (ash ans (* d -2)))))
- ((>= (* 2 d) kln) ans)))))
-
-(define (grayter k1 k2)
- (define kl1 (integer-length k1))
- (define kl2 (integer-length k2))
- (if (eqv? kl1 kl2)
- (> (gray-code->integer k1) (gray-code->integer k2))
- (> kl1 kl2)))
-
-(define (gray-code<? k1 k2)
- (not (or (eqv? k1 k2) (grayter k1 k2))))
-(define (gray-code<=? k1 k2)
- (or (eqv? k1 k2) (not (grayter k1 k2))))
-(define (gray-code>? k1 k2)
- (and (not (eqv? k1 k2)) (grayter k1 k2)))
-(define (gray-code>=? k1 k2)
- (or (eqv? k1 k2) (grayter k1 k2)))
+;;;; SRFI-60 aliases
+(define arithmetic-shift ash)
+(define bitwise-ior logior)
+(define bitwise-xor logxor)
+(define bitwise-and logand)
+(define bitwise-not lognot)
+;;(define bit-count logcount) ;Aliases bit-vector function
+(define bit-set? logbit?)
+(define any-bits-set? logtest)
+(define first-set-bit log2-binary-factors)
+(define bitwise-merge bitwise-if)
(define @case-aux
(let ((integer-jump-table 1)
@@ -920,18 +1007,7 @@
(define defmacro:eval slib:eval)
(define defmacro:load load)
-
-(define (slib:eval-load <filename> evl)
- (if (not (file-exists? <filename>))
- (set! <filename> (string-append <filename> (scheme-file-suffix))))
- (call-with-input-file <filename>
- (lambda (port)
- (let ((old-load-pathname *load-pathname*))
- (set! *load-pathname* <filename>)
- (do ((o (*load-reader* port) (*load-reader* port)))
- ((eof-object? o))
- (evl o))
- (set! *load-pathname* old-load-pathname)))))
+;; slib:eval-load definition moved to "slib/require.scm"
;;;; Autoloads for SLIB procedures.
@@ -964,8 +1040,8 @@
(else (cond ((not (slib:eval `(defined? ,name))))
((and (symbol? name) (equal? (slib:eval value)
(slib:eval name))))
- (else (slib:error 'trying-to-defconst name
- 'to-different-value value)))
+ (else (error 'trying-to-defconst name
+ 'to-different-value value)))
`(define ,name ,value))))
(defmacro qase (key . clauses)
`(case ,key
@@ -996,27 +1072,36 @@
(lambda () ,@body)
,swap))))
+(define (scm:print-binding sexp frame)
+ (cond ((not (null? (cdr sexp)))
+ (display "In")
+ (for-each (lambda (exp) (display #\ ) (display exp)) (cdr sexp))
+ (display ": ")))
+ (do ((vars (car frame) (cdr vars))
+ (vals (cdr frame) (cdr vals)))
+ ((not (pair? vars))
+ (cond ((not (null? vars)) (write vars)
+ (display " := ") (write (car vals))))
+ (newline))
+ (write (car vars)) (display " = ") (write (car vals)) (display "; ")))
+
(define print-args
- (procedure->syntax
+ (procedure->memoizing-macro
(lambda (sexp env)
- (set! env (environment->tree env))
- (let ((frame (and (not (null? env)) (car env))))
- (cond ((not (null? (cdr sexp)))
- (display "In")
- (for-each (lambda (exp) (display #\ ) (display exp)) (cdr sexp))
- (display ": ")))
- (do ((vars (car frame) (cdr vars))
- (vals (cdr frame) (cdr vals)))
- ((not (pair? vars))
- (cond ((not (null? vars))
- (write vars)
- (display " := ")
- (write vals)))
- (newline))
- (write (car vars))
- (display " = ")
- (write (car vals))
- (display "; "))))))
+ (define (fix-list frm)
+ (cond ((pair? frm) (cons (car frm) (fix-list (cdr frm))))
+ ((null? frm) '())
+ ((symbol? frm) (list frm))
+ (else '())))
+ (define frm (car env))
+ `(scm:print-binding
+ ',sexp
+ ,(cond ((symbol? frm) `(list ',frm ,frm))
+ ((list? frm) `(list ',frm ,@frm))
+ ((pair? frm)
+ (let ((jlp (fix-list frm)))
+ `(list ',(if (symbol? (cdr (last-pair frm))) frm jlp)
+ ,@jlp))))))))
(cond
((defined? stack-trace)
@@ -1046,7 +1131,7 @@
(require 'debug) (apply breakpoint args))
(lambda () (set! error nerror))))))
nerror))
-
+
(define (user-interrupt . args)
(define cep (current-error-port))
(newline cep)
@@ -1067,7 +1152,24 @@
(load (in-vicinity (implementation-vicinity) "Transcen")
(usr:lib "m")))
(load (in-vicinity (implementation-vicinity) "Transcen")))
- (set! abs magnitude)))
+ (set! abs magnitude))
+ (else
+ (define (infinite? z) #f)
+ (define finite? number?)
+ (define inexact->exact identity)
+ (define exact->inexact identity)
+ (define expt integer-expt)))
+
+(define (numerator q)
+ (if (not (rational? q)) (error 'numerator q))
+ (do ((num q (* 2 num)))
+ ((integer? num) num)))
+
+(define (denominator q)
+ (if (not (rational? q)) (error 'denominator q))
+ (do ((num q (* 2 num))
+ (den (- q q -1) (* 2 den)))
+ ((integer? num) den)))
(if (defined? array?)
(begin
@@ -1082,6 +1184,37 @@
(apply array-ref prot
(map car (array-shape prot))))))
(define make-array create-array)
+(define (list->array rank proto lst)
+ (list->uniform-array rank (array-prototype proto) lst))
+(define (vector->array vect prototype . dimensions)
+ (define vdx (vector-length vect))
+ (if (not (eqv? vdx (apply * dimensions)))
+ (slib:error 'vector->array vdx '<> (cons '* dimensions)))
+ (let ((ra (apply make-array prototype dimensions)))
+ (define (v2ra dims idxs)
+ (cond ((null? dims)
+ (set! vdx (+ -1 vdx))
+ (apply array-set! ra (vector-ref vect vdx) (reverse idxs)))
+ (else
+ (do ((idx (+ -1 (car dims)) (+ -1 idx)))
+ ((negative? idx) vect)
+ (v2ra (cdr dims) (cons idx idxs))))))
+ (v2ra dimensions '())
+ ra))
+(define (array->vector ra)
+ (define dims (array-dimensions ra))
+ (let* ((vdx (apply * dims))
+ (vect (make-vector vdx)))
+ (define (ra2v dims idxs)
+ (if (null? dims)
+ (let ((val (apply array-ref ra (reverse idxs))))
+ (set! vdx (+ -1 vdx))
+ (vector-set! vect vdx val)
+ vect)
+ (do ((idx (+ -1 (car dims)) (+ -1 idx)))
+ ((negative? idx) vect)
+ (ra2v (cdr dims) (cons idx idxs)))))
+ (ra2v dims '())))
(define (make-uniform-wrapper prot)
(if (string? prot) (set! prot (string->number prot)))
(if prot
@@ -1103,6 +1236,31 @@
(define Au8 (make-uniform-wrapper 8))
(define At1 (make-uniform-wrapper #t))
+;;; New SRFI-58 names
+;; flonums
+(define A:floC128b ac64)
+(define A:floC64b ac64)
+(define A:floC32b ac32)
+(define A:floC16b ac32)
+(define A:floR128b ar64)
+(define A:floR64b ar64)
+(define A:floR32b ar32)
+(define A:floR16b ar32)
+;; decimal flonums
+(define A:floQ128d ar64)
+(define A:floQ64d ar64)
+(define A:floQ32d ar32)
+;; fixnums
+(define A:fixZ64b as64)
+(define A:fixZ32b as32)
+(define A:fixZ16b as16)
+(define A:fixZ8b as8)
+(define A:fixN64b au64)
+(define A:fixN32b au32)
+(define A:fixN16b au16)
+(define A:fixN8b au8)
+(define A:bool at1)
+
(define (array-shape a)
(let ((dims (array-dimensions a)))
(if (pair? dims)
@@ -1110,6 +1268,9 @@
dims)
dims)))
(define array=? equal?)
+(provide 'srfi-47)
+(provide 'srfi-58)
+(provide 'srfi-63)
))
(define (alarm-interrupt) (alarm 0))
diff --git a/Link.scm b/Link.scm
index 8e01de9..e0ea89b 100644
--- a/Link.scm
+++ b/Link.scm
@@ -57,7 +57,6 @@
(map char-downcase (string->list name))))))
(define link:link
(lambda (file . libs)
- (define oloadpath *load-pathname*)
(let* ((sl (string-length file))
(lasl (string-length link:able-suffix))
(fname (let loop ((i (- sl 1)))
@@ -72,26 +71,23 @@
(substring fname 0 (- nsl lasl)))
(else fname)))
(linkobj #f))
- (set! *load-pathname* file)
(if (and (provided? 'sun-dl)
(< 3 sl)
(not (eqv? (string-ref file 0) '#\/)))
(set! file (string-append "./" file)))
- (set! linkobj (or (provided? 'sun-dl) (dyn:link file)))
- (and linkobj
- (for-each (lambda (lib)
- (or (dyn:link lib) (slib:error "couldn't link: " lib)))
- libs))
- (if (provided? 'sun-dl) (set! linkobj (dyn:link file)))
- (cond ((not linkobj)
- (set! *load-pathname* oloadpath) #f)
- ((dyn:call (file->init_name name) linkobj)
- (set! *load-pathname* oloadpath) #t)
- (else
- (dyn:unlink linkobj)
- (set! *load-pathname* oloadpath) #f)))))))
+ (with-load-pathname file
+ (lambda ()
+ (set! linkobj (or (provided? 'sun-dl) (dyn:link file)))
+ (and linkobj
+ (for-each (lambda (lib)
+ (or (dyn:link lib)
+ (slib:error "couldn't link: " lib)))
+ libs))
+ (if (provided? 'sun-dl) (set! linkobj (dyn:link file)))
+ (cond ((not linkobj) #f)
+ ((dyn:call (file->init_name name) linkobj) #t)
+ (else (dyn:unlink linkobj) #f))))))))
-(cond
((defined? vms:dynamic-link-call)
(define link:able-suffix #f)
(define (link:link file)
@@ -103,7 +99,8 @@
(set! dir (substring file 0 (+ i 1)))
(set! fil (substring file (+ i 1) (string-length file))))
(else (loop (- i 1)))))
- (vms:dynamic-link-call dir fil (file->init_name fil)))))
+ (with-load-pathname file
+ (lambda () (vms:dynamic-link-call dir fil (file->init_name fil)))))))
(cond
((provided? 'sun-dl)
diff --git a/Makefile b/Makefile
index 4f2a011..a59ddbc 100644
--- a/Makefile
+++ b/Makefile
@@ -49,10 +49,15 @@ SHELL = /bin/sh
LD = $(CC)
SCMLIT = ./scmlit
SCMEXE = ./scm
+#SHOBJS = *.sl
+SHOBJS = *.so
#BUILD = ./build -hsystem -p svr4-gcc-sun-ld
BUILD = ./build -hsystem
+# Workaround for unexec on Fedora Linux i386
+#SETARCH = setarch i386
+
#for RPMs
RELEASE = 1
@@ -60,16 +65,16 @@ intro:
@echo
@echo "This is the scm$(VERSION) distribution. Read \"scm.info\""
@echo "to learn how to build and install SCM. Or browse"
- @echo " http://swissnet.ai.mit.edu/~jaffer/SCM"
+ @echo " http://swiss.csail.mit.edu/~jaffer/SCM"
@echo
$(MAKE) scm
-#srcdir=$(HOME)/scm/
-#srcdir=/usr/local/src/scm/
-include srcdir.mk
srcdir.mk: Makefile
echo "CPROTO=`type cproto | sed 's%.* %%'`" > srcdir.mk
echo "srcdir=`pwd`/" >> srcdir.mk
+#srcdir=$(HOME)/scm/
+#srcdir=/usr/local/src/scm/
+include srcdir.mk
# directory where COPYING and InitXXX.scm reside.
#IMPLPATH = /usr/local/src/scm/
@@ -85,21 +90,22 @@ IMPLINIT = $(IMPLPATH)Init$(VERSION).scm
cfiles = scmmain.c scm.c time.c repl.c ioext.c scl.c sys.c eval.c \
subr.c sc2.c unif.c rgx.c crs.c dynl.c record.c posix.c socket.c\
- unix.c rope.c ramap.c gsubr.c edline.c Iedline.scm continue.c \
- findexec.c script.c debug.c byte.c
+ unix.c rope.c ramap.c gsubr.c edline.c continue.c \
+ findexec.c script.c debug.c byte.c differ.c
ofiles = scm.o time.o repl.o scl.o sys.o eval.o subr.o unif.o rope.o \
continue.o findexec.o script.o debug.o
# ramap.o
ifiles = Init$(VERSION).scm Transcen.scm Link.scm Macro.scm Macexp.scm \
- Tscript.scm compile.scm
+ Tscript.scm compile.scm Iedline.scm Idiffer.scm
hobfiles = hobbit.scm scmhob.scm scmhob.h
xafiles = xatoms.scm x11.scm xevent.scm keysymdef.scm
xfiles = x.c x.h xgen.scm xevent.h inc2scm $(xafiles)
all: require.scm
$(MAKE) mydlls
- $(MAKE) myscm5
+ $(MAKE) dscm5
$(MAKE) x.so
+ $(MAKE) db.so
require.scm:
cp -p requires.scm require.scm
@@ -113,7 +119,7 @@ scmflags:
echo "#define IMPLINIT \"$(IMPLINIT)\"" >> newflags.h
echo "#endif" >> newflags.h
echo "#define CAUTIOUS" >> newflags.h
- -if (diff newflags.h scmflags.h) then rm newflags.h; \
+ -if (cmp -s newflags.h scmflags.h) then rm newflags.h; \
else mv newflags.h scmflags.h; fi
.c.o:
$(CC) -c $(CFLAGS) $< -o $@
@@ -132,23 +138,34 @@ rope.o: rope.c scm.h scmfig.h scmflags.h
continue.o: continue.c continue.h setjump.h scm.h scmfig.h scmflags.h
# Simple build with bignums for running JACAL
-scm:
+scm: scmlit
$(BUILD) -s $(IMPLPATH) -F cautious bignums arrays # i/o-extensions
$(MAKE) check
-# R4RS interpreter
+# R5RS interpreter (not dumpable)
+scm5.opt:
+ echo "-F cautious bignums arrays inexact" >> scm5.opt
+ echo "-F engineering-notation dynamic-linking" >> scm5.opt
+ echo "-F macro" >> scm5.opt
+scm5: $(cfiles) $(hfiles) build.scm build scm5.opt
+ $(BUILD) -f scm5.opt -o scm -s $(IMPLPATH)
+ rm $(ofiles) scmmain.o
+ -$(MAKE) check
+ -$(MAKE) checkmacro
+
+# dumpable R4RS interpreter
udscm4.opt:
echo "-F cautious bignums arrays inexact" >> udscm4.opt
echo "-F engineering-notation dump dynamic-linking" >> udscm4.opt
udscm4: $(cfiles) $(hfiles) build.scm build udscm4.opt
$(BUILD) -f udscm4.opt -o udscm4 -s $(IMPLPATH)
rm $(ofiles) scmmain.o
-myscm4: udscm4 $(ifiles) require.scm
+dscm4: udscm4 $(ifiles) require.scm
-rm slibcat implcat
-mv scm scm~
- echo "(quit)" | ./udscm4 -no-init-file -o scm
+ echo "(quit)" | $(SETARCH) ./udscm4 -no-init-file -o scm
-# R5RS interpreter
+# dumpable R5RS interpreter
udscm5.opt: udscm4.opt
cat udscm4.opt >> udscm5.opt
echo "-F macro" >> udscm5.opt
@@ -156,10 +173,10 @@ udscm5.opt: udscm4.opt
udscm5: $(cfiles) $(hfiles) build.scm build Makefile udscm5.opt
$(BUILD) -f udscm5.opt -o udscm5 -s $(IMPLPATH)
rm $(ofiles) scmmain.o
-myscm5: udscm5 $(ifiles) require.scm
+dscm5: udscm5 $(ifiles) require.scm
-rm slibcat implcat
-mv scm scm~
- echo "(quit)" | ./udscm5 -no-init-file -r5 -o scm
+ echo "(quit)" | $(SETARCH) ./udscm5 -no-init-file -r5 -o scm
$(MAKE) check
$(MAKE) checkmacro
@@ -174,7 +191,7 @@ gdb.opt: udscm5.opt
udgdbscm: gdb.opt
$(BUILD) -f gdb.opt -o udgdbscm -s $(IMPLPATH)
gdbscm: udgdbscm
- echo "(quit)" | ./udgdbscm -no-init-file -r5 -o gdbscm
+ echo "(quit)" | $(SETARCH) ./udgdbscm -no-init-file -r5 -o gdbscm
# R4RS interpreter for profiling
pg.opt: udscm4.opt
@@ -185,7 +202,7 @@ pg.opt: udscm4.opt
udpgscm: pg.opt
$(BUILD) -f pg.opt -o udpgscm -s $(IMPLPATH)
pgscm: udpgscm
- echo "(quit)" | ./udpgscm -no-init-file -o pgscm
+ echo "(quit)" | $(SETARCH) ./udpgscm -no-init-file -o pgscm
# R4RS SCM library
libscm.opt:
@@ -207,9 +224,25 @@ mydlls: dlls.opt
if [ -f /usr/lib/libreadline.so ]; \
then $(BUILD) -t dll -f dlls.opt -F edit-line; fi
$(BUILD) -t dll -f dlls.opt -F curses
- $(BUILD) -t dll -f dlls.opt -c sc2.c rgx.c record.c gsubr.c \
- ioext.c posix.c unix.c socket.c ramap.c byte.c
-
+ $(BUILD) -t dll -f dlls.opt -c sc2.c
+ $(BUILD) -t dll -f dlls.opt -c rgx.c
+ $(BUILD) -t dll -f dlls.opt -c record.c
+ $(BUILD) -t dll -f dlls.opt -c gsubr.c
+ $(BUILD) -t dll -f dlls.opt -c ioext.c
+ $(BUILD) -t dll -f dlls.opt -c posix.c
+ $(BUILD) -t dll -f dlls.opt -c unix.c
+ $(BUILD) -t dll -f dlls.opt -c socket.c
+ $(BUILD) -t dll -f dlls.opt -c ramap.c
+ $(BUILD) -t dll -f dlls.opt -c byte.c
+
+rwb-isam.scm wbtab.scm: ../wb/rwb-isam.scm ../wb/wbtab.scm
+ cp ../wb/rwb-isam.scm ../wb/wbtab.scm ./
+db.so: dlls.opt rwb-isam.scm wbtab.scm
+ if [ -f ../wb/blink.c ]; then \
+ $(BUILD) -t dll -f dlls.opt -F wb; fi
+
+differ.so: differ.c
+ $(BUILD) -t dll -f dlls.opt -F differ
myturtle: dlls.opt
$(BUILD) -t dll -f dlls.opt -F turtlegr
@@ -228,7 +261,7 @@ keysymdef.scm: inc2scm
xevent.h xevent.scm xatoms.scm: xgen.scm Makefile
$(SCMLIT) -l xgen.scm $(incdir)X11/Xlib.h
x.h: x.c xevent.h
- if [ ! -z "$(CPROTO)" ]; then $(CPROTO) x.c > x.h; fi
+ if [ -x "$(CPROTO)" ]; then $(CPROTO) x.c > x.h; fi
# Check SCM; SCMLIT function.
checklit:
@@ -278,7 +311,7 @@ report:
$(SCMLIT) -e"(slib:report #t)"
$(SCMEXE) -e"(slib:report #t)"
-implcat: *.so mkimpcat.scm
+implcat: $(SHOBJS) mkimpcat.scm
$(SCMLIT) -lmkimpcat.scm
htmldir=../public_html/
@@ -286,23 +319,23 @@ dvidir=../dvi/
dvi: $(dvidir)scm.dvi $(dvidir)Xlibscm.dvi $(dvidir)hobbit.dvi
$(dvidir)scm.dvi: version.txi scm.texi platform.txi features.txi\
$(dvidir)scm.fn Makefile
-# cd $(dvidir);export TEXINPUTS=$(srcdir):;texi2dvi $(srcdir)scm.texi
- -(cd $(dvidir);export TEXINPUTS=$(srcdir):;texindex scm.??)
- cd $(dvidir);export TEXINPUTS=$(srcdir):;tex $(srcdir)scm.texi
+# cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;texi2dvi $(srcdir)scm.texi
+ -(cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;texindex scm.??)
+ cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;tex $(srcdir)scm.texi
$(dvidir)scm.fn:
- cd $(dvidir);export TEXINPUTS=$(srcdir):;tex $(srcdir)scm.texi
+ cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;tex $(srcdir)scm.texi
$(dvidir)Xlibscm.dvi: version.txi Xlibscm.texi $(dvidir)Xlibscm.fn Makefile
-# cd $(dvidir);export TEXINPUTS=$(srcdir):;texi2dvi $(srcdir)Xlibscm.texi
- -(cd $(dvidir);export TEXINPUTS=$(srcdir):;texindex Xlibscm.??)
- cd $(dvidir);export TEXINPUTS=$(srcdir):;tex $(srcdir)Xlibscm.texi
+# cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;texi2dvi $(srcdir)Xlibscm.texi
+ -(cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;texindex Xlibscm.??)
+ cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;tex $(srcdir)Xlibscm.texi
$(dvidir)Xlibscm.fn:
- cd $(dvidir);export TEXINPUTS=$(srcdir):;tex $(srcdir)Xlibscm.texi
+ cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;tex $(srcdir)Xlibscm.texi
$(dvidir)hobbit.dvi: version.txi hobbit.texi $(dvidir)hobbit.fn Makefile
-# cd $(dvidir);export TEXINPUTS=$(srcdir):;texi2dvi $(srcdir)hobbit.texi
- -(cd $(dvidir);export TEXINPUTS=$(srcdir):;texindex hobbit.??)
- cd $(dvidir);export TEXINPUTS=$(srcdir):;tex $(srcdir)hobbit.texi
+# cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;texi2dvi $(srcdir)hobbit.texi
+ -(cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;texindex hobbit.??)
+ cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;tex $(srcdir)hobbit.texi
$(dvidir)hobbit.fn:
- cd $(dvidir);export TEXINPUTS=$(srcdir):;tex $(srcdir)hobbit.texi
+ cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;tex $(srcdir)hobbit.texi
xdvi: $(dvidir)scm.dvi
xdvi -s 3 $(dvidir)scm.dvi
Xdvi: $(dvidir)Xlibscm.dvi
@@ -313,13 +346,13 @@ hobdvi: $(dvidir)hobbit.dvi
pdf: $(htmldir)scm.pdf $(htmldir)Xlibscm.pdf $(htmldir)hobbit.pdf
$(htmldir)scm.pdf: version.txi scm.texi platform.txi features.txi\
$(dvidir)scm.fn Makefile
- cd $(dvidir);export TEXINPUTS=$(srcdir):;pdftex $(srcdir)scm.texi
+ cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;pdftex $(srcdir)scm.texi
mv $(dvidir)scm.pdf $(htmldir)
$(htmldir)Xlibscm.pdf: version.txi Xlibscm.texi $(dvidir)Xlibscm.fn Makefile
- cd $(dvidir);export TEXINPUTS=$(srcdir):;pdftex $(srcdir)Xlibscm.texi
+ cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;pdftex $(srcdir)Xlibscm.texi
mv $(dvidir)Xlibscm.pdf $(htmldir)
$(htmldir)hobbit.pdf: version.txi hobbit.texi $(dvidir)hobbit.fn Makefile
- cd $(dvidir);export TEXINPUTS=$(srcdir):;pdftex $(srcdir)hobbit.texi
+ cd $(dvidir);TEXINPUTS=$(srcdir):;export TEXINPUTS;pdftex $(srcdir)hobbit.texi
mv $(dvidir)hobbit.pdf $(htmldir)
xpdf: $(htmldir)scm.pdf
xpdf -z 3 $(htmldir)scm.pdf
@@ -420,7 +453,7 @@ $(infodir)Xlibscm.info.gz: $(infodir)Xlibscm.info
$(infodir)hobbit.info.gz: $(infodir)hobbit.info
gzip -f $(infodir)hobbit.info
-install: scm.1
+install: scm.1 db.so wbtab.scm rwb-isam.scm
test -d $(bindir) || mkdir $(bindir)
test -d $(mandir) || mkdir $(mandir)
test -d $(man1dir) || mkdir $(man1dir)
@@ -432,8 +465,9 @@ install: scm.1
-cp $(ifiles) $(hobfiles) COPYING r4rstest.scm $(libscmdir)
test -f $(libscmdir)require.scm || \
cp requires.scm $(libscmdir)require.scm
- -cp build build.scm mkimpcat.scm Iedline.scm *.sl *.so patchlvl.h\
+ -cp build build.scm mkimpcat.scm Iedline.scm $(SHOBJS) patchlvl.h\
$(xafiles) $(libscmdir)
+ -cp db.so wbtab.scm rwb-isam.scm $(libscmdir)
installlib:
test -d $(includedir) || mkdir $(includedir)
@@ -446,18 +480,10 @@ uninstall:
-rm $(man1dir)scm.1
-rm $(includedir)scm.h $(includedir)scmfig.h $(includedir)scmflags.h
-rm $(libdir)libscm.a
- -rm $(libscmdir)Transcen.scm\
- $(libscmdir)Link.scm\
- $(libscmdir)Macro.scm\
- $(libscmdir)Macexp.scm\
- $(libscmdir)Tscript.scm\
- $(libscmdir)compile.scm\
- $(libscmdir)hobbit.scm\
- $(libscmdir)scmhob.scm\
- $(libscmdir)scmhob.h\
- $(libscmdir)COPYING\
- $(libscmdir)r4rstest.scm
- -rm $(libscmdir)Init$(VERSION).scm
+ -(cd $(libscmdir); rm $(ifiles) $(hobfiles) COPYING r4rstest.scm)
+ -(cd $(libscmdir); rm build build.scm mkimpcat.scm \
+ $(SHOBJS) patchlvl.h $(xafiles))
+ -(cd $(libscmdir); rm db.so wbtab.scm rwb-isam.scm require.scm)
uninstallinfo:
-rm $(infodir)scm.info.gz $(infodir)Xlibscm.info.gz\
@@ -499,9 +525,11 @@ afiles = $(dfiles) $(cfiles) $(hfiles) $(ifiles) $(tfiles) $(mfiles) \
makedev = make -f $(HOME)/makefile.dev
CHPAT=$(HOME)/bin/chpat
-RSYNC=rsync -avessh
+RSYNC=rsync --rsync-path=bin/rsync -bav
UPLOADEE=swissnet_upload
dest = $(HOME)/dist/
+DOSCM = /misc/usb1/scm/
+
temp/scm: $(afiles)
-$(RM_R) temp
mkdir temp
@@ -532,6 +560,8 @@ postnews:
upzip: $(HOME)/pub/scm.zip
$(RSYNC) $(HOME)/pub/scm.zip $(UPLOADEE):pub/
+ $(RSYNC) r4rstest.scm $(HOME)/dist/
+ $(RSYNC) r4rstest.scm $(UPLOADEE):dist/
dist: $(dest)scm$(VERSION).zip
$(dest)scm$(VERSION).zip: temp/scm
@@ -540,7 +570,7 @@ $(dest)scm$(VERSION).zip: temp/scm
rpm: pubzip
# $(dest)scm-$(VERSION)-$(RELEASE).i386.rpm: $(dest)scm$(VERSION).zip
cp -f $(HOME)/pub/scm.zip $(rpm_prefix)SOURCES/scm$(VERSION).zip
- rpm -ba scm.spec # --clean
+ rpmbuild -ba scm.spec # --clean
rm $(rpm_prefix)SOURCES/scm$(VERSION).zip
mv $(rpm_prefix)RPMS/i386/scm-$(VERSION)-$(RELEASE).i386.rpm \
$(rpm_prefix)SRPMS/scm-$(VERSION)-$(RELEASE).src.rpm $(dest)
@@ -555,12 +585,12 @@ scm.com: temp/scm
zip: scm.zip
scm.zip: temp/scm
$(makedev) PROD=scm zip
-doszip: /c/scm/dist/scm$(VERSION).zip
-/c/scm/dist/scm$(VERSION).zip: temp/scm turtle turtlegr.c grtest.scm
- $(makedev) DEST=/c/scm/dist/ PROD=scm ver=$(VERSION) zip
- cd ..; zip -9ur /c/scm/dist/scm$(VERSION).zip \
+doszip: $(DOSCM)dist/scm$(VERSION).zip
+$(DOSCM)dist/scm$(VERSION).zip: temp/scm turtle turtlegr.c grtest.scm
+ $(makedev) DEST=$(DOSCM)dist/ PROD=scm ver=$(VERSION) zip
+ cd ..; zip -9ur $(DOSCM)dist/scm$(VERSION).zip \
scm/turtle scm/turtlegr.c scm/grtest.scm
- zip -d /c/scm/dist/scm$(VERSION).zip scm/scm.info scm/Xlibscm.info scm/hobbit.info
+ zip -d $(DOSCM)dist/scm$(VERSION).zip scm/scm.info scm/Xlibscm.info scm/hobbit.info
pubzip: $(HOME)/pub/scm.zip
$(HOME)/pub/scm.zip: temp/scm
$(makedev) DEST=$(HOME)/pub/ PROD=scm zip
@@ -577,8 +607,8 @@ CITERS = ANNOUNCE ../jacal/ANNOUNCE \
$(htmldir)SLIB.html $(htmldir)JACAL.html \
$(htmldir)SCM.html $(htmldir)SIMSYNCH.html \
../jacal/jacal.texi ../wb/wb.texi \
- /c/scm/dist/install.bat /c/scm/dist/makefile \
- /c/scm/dist/mkdisk.bat hobbit.texi hobbit.scm
+ $(DOSCM)dist/install.bat $(DOSCM)dist/makefile \
+ $(DOSCM)dist/mkdisk.bat hobbit.texi hobbit.scm
updates: Init$(ver).scm
$(CHPAT) scm$(VERSION) scm$(ver) $(CITERS)
diff --git a/README b/README
index e672a56..6a1ba84 100644
--- a/README
+++ b/README
@@ -1,17 +1,18 @@
-This directory contains the distribution of scm5d9. Scm conforms to
+This directory contains the distribution of scm5e1. Scm conforms to
Revised^5 Report on the Algorithmic Language Scheme and the IEEE P1178
specification. SCM runs under Amiga, Atari-ST, MacOS, MS-DOS, OS/2,
NOS/VE, Unicos, VMS, Unix and similar systems.
- <http://swissnet.ai.mit.edu/~jaffer/SCM>
+ `http://swiss.csail.mit.edu/~jaffer/SCM'
-Manifest
-========
+0.1 Manifest
+============
`.gdbinit' provides commands for debugging SCM with GDB
`COPYING' details the LACK OF WARRANTY for SCM and the conditions
for distributing SCM.
`ChangeLog' changes to SCM.
+`Idiffer.scm' Linear-space O(PN) sequence comparison.
`Iedline.scm' Gnu readline input editing.
`Init.scm' Scheme initialization.
`Link.scm' Dynamic link/loading.
@@ -30,6 +31,7 @@ Manifest
`continue.h' continuations.
`crs.c' interactive terminal control.
`debug.c' debugging, printing code.
+`differ.c' Linear-space O(PN) sequence comparison.
`dynl.c' dynamically load object files.
`ecrt0.c' discover the start of initialized data space
dynamically at runtime.
@@ -93,8 +95,8 @@ Manifest
File: scm.info, Node: SLIB, Next: Building SCM, Prev: Making SCM, Up: Installing SCM
-SLIB
-====
+2.2 SLIB
+========
[SLIB] is a portable Scheme library meant to provide compatibility and
utility functions for all standard Scheme implementations. Although
@@ -102,18 +104,18 @@ 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/slib3a1.tar.gz
+ * swiss.csail.mit.edu:/pub/scm/slib3a2.tar.gz
- * ftp.gnu.org:/pub/gnu/jacal/slib3a1.tar.gz
+ * ftp.gnu.org:/pub/gnu/jacal/slib3a2.tar.gz
- * ftp.cs.indiana.edu:/pub/scheme-repository/imp/slib3a1.tar.gz
+ * ftp.cs.indiana.edu:/pub/scheme-repository/imp/slib3a2.tar.gz
-Unpack SLIB (`tar xzf slib3a1.tar.gz' or `unzip -ao slib3a1.zip') in an
+Unpack SLIB (`tar xzf slib3a2.tar.gz' or `unzip -ao slib3a2.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 `Init5d9.scm' is
+(this is the same directory as where the file `Init5e1.scm' is
installed). `require.scm' should have the contents:
(define (library-vicinity) "/usr/local/lib/slib/")
@@ -138,8 +140,8 @@ overrides `require.scm'. Again, absolute pathnames are recommended.
File: scm.info, Node: Making SCM, Next: SLIB, Prev: Installing SCM, Up: Installing SCM
-Making SCM
-==========
+2.1 Making SCM
+==============
The SCM distribution has "Makefile" which contains rules for making
"scmlit", a "bare-bones" version of SCM sufficient for running `build'.
@@ -150,7 +152,7 @@ Makefiles are not portable to the majority of platforms. If `Makefile'
works for you, good; If not, I don't want to hear about it. If you
need to compile SCM without build, there are several ways to proceed:
- * Use the build (http://swissnet.ai.mit.edu/~jaffer/buildscm.html)
+ * Use the build (http://swiss.csail.mit.edu/~jaffer/buildscm.html)
web page to create custom batch scripts for compiling SCM.
* Use SCM on a different platform to run `build' to create a script
@@ -165,14 +167,14 @@ need to compile SCM without build, there are several ways to proceed:
File: scm.info, Node: Editing Scheme Code, Next: Debugging Scheme Code, Prev: SCM Session, Up: Operational Features
-Editing Scheme Code
-===================
+3.7 Editing Scheme Code
+=======================
- - Function: ed arg1 ...
+ -- Function: ed arg1 ...
The value of the environment variable `EDITOR' (or just `ed' if it
isn't defined) is invoked as a command with arguments ARG1 ....
- - Function: ed filename
+ -- Function: ed filename
If SCM is compiled under VMS `ed' will invoke the editor with a
single the single argument FILENAME.
@@ -214,8 +216,8 @@ other systems:
File: scm.info, Node: Problems Compiling, Next: Problems Linking, Prev: Automatic C Preprocessor Definitions, Up: Installing SCM
-Problems Compiling
-==================
+2.8 Problems Compiling
+======================
FILE PROBLEM / MESSAGE HOW TO FIX
*.c include file not found. Correct the status of
@@ -248,8 +250,8 @@ scl.c syntax error. #define SYSTNAME to your system
File: scm.info, Node: Problems Linking, Next: Problems Running, Prev: Problems Compiling, Up: Installing SCM
-Problems Linking
-================
+2.9 Problems Linking
+====================
PROBLEM HOW TO FIX
_sin etc. missing. Uncomment LIBS in makefile.
@@ -258,8 +260,8 @@ _sin etc. missing. Uncomment LIBS in makefile.
File: scm.info, Node: Problems Running, Next: Testing, Prev: Problems Linking, Up: Installing SCM
-Problems Running
-================
+2.10 Problems Running
+=====================
PROBLEM HOW TO FIX
Opening message and then machine Change memory model option to C
@@ -278,17 +280,17 @@ remove <FLAG> in scmfig.h and Do so and recompile files.
recompile scm.
add <FLAG> in scmfig.h and
recompile scm.
-ERROR: Init5d9.scm not found. Assign correct IMPLINIT in makefile
+ERROR: Init5e1.scm not found. Assign correct IMPLINIT in makefile
or scmfig.h.
Define environment variable
SCM_INIT_PATH to be the full
- pathname of Init5d9.scm.
+ pathname of Init5e1.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
- Init5d9.scm to point to library or
+ Init5e1.scm to point to library or
remove.
Make sure the value of
(library-vicinity) has a trailing
@@ -298,8 +300,8 @@ WARNING: require.scm not found. Define environment variable
File: scm.info, Node: Testing, Next: Reporting Problems, Prev: Problems Running, Up: Installing SCM
-Testing
-=======
+2.11 Testing
+============
Loading `r4rstest.scm' in the distribution will run an [R4RS]
conformance test on `scm'.
@@ -349,7 +351,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. `Init5d9.scm').
+output files. `Init5e1.scm').
Spaces or control characters appear Check character defines in
in symbol names. `scmfig.h'.
Negative numbers turn positive. Check SRS in `scmfig.h'.
@@ -364,5 +366,6 @@ Sparc(SUN-4) heap is growing out of control
This causes lots of stuff which should be collected to not be.
This will be a problem with any _conservative_ GC until we find
what instruction will clear the register windows. This problem is
- exacerbated by using lots of call-with-current-continuations.
+ exacerbated by using lots of call-with-current-continuations. A
+ possible fix for dynthrow() is commented out in `continue.c'.
diff --git a/Transcen.scm b/Transcen.scm
index b0d1a2b..dd869a7 100644
--- a/Transcen.scm
+++ b/Transcen.scm
@@ -1,4 +1,4 @@
-;; Copyright (C) 1992, 1993, 1995, 1997 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1993, 1995, 1997, 2005 Free Software Foundation, Inc.
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -40,6 +40,8 @@
;;;; "Transcen.scm", Complex trancendental functions for SCM.
;;; Author: Jerry D. Hedden.
+;;;; 2005-05 SRFI-70 extensions.
+;;; Author: Aubrey Jaffer
(define compile-allnumbers #t) ;for HOBBIT compiler
@@ -63,17 +65,6 @@
($sqrt z))
(make-polar ($sqrt (magnitude z)) (/ (angle z) 2))))
-(define expt
- (let ((integer-expt integer-expt))
- (lambda (z1 z2)
- (cond ((zero? z1) (if (zero? z2) 1 0))
- ((exact? z2)
- (integer-expt z1 z2))
- ((and (real? z2) (real? z1) (>= z1 0))
- ($expt z1 z2))
- (else
- (exp (* z2 (log z1))))))))
-
(define (sinh z)
(if (real? z) ($sinh z)
(let ((x (real-part z)) (y (imag-part z)))
@@ -137,3 +128,124 @@
(if (real? z) ($atan z)
(/ (log (/ (- +i z) (+ +i z))) +2i))
($atan2 z (car y))))
+
+;;;; SRFI-70
+(define expt
+ (let ((integer-expt integer-expt))
+ (lambda (z1 z2)
+ (cond ((and (exact? z2) (not (and (zero? z1) (not (positive? z2)))))
+ (integer-expt z1 z2))
+ ((and (real? z2) (real? z1) (positive? z1))
+ ($expt z1 z2))
+ (else
+ (exp (* (if (zero? z1) (real-part z2) z2) (log z1))))))))
+
+(set! quotient
+ (let ((integer-quotient quotient))
+ (lambda (x1 x2)
+ (if (and (exact? x1) (exact? x2))
+ (integer-quotient x1 x2)
+ (truncate (/ x1 x2))))))
+
+(set! remainder
+ (let ((integer-remainder remainder))
+ (lambda (x1 x2)
+ (if (and (exact? x1) (exact? x2))
+ (integer-remainder x1 x2)
+ (- x1 (* x2 (quotient x1 x2)))))))
+
+(set! modulo
+ (let ((integer-modulo modulo))
+ (lambda (x1 x2)
+ (if (and (exact? x1) (exact? x2))
+ (integer-modulo x1 x2)
+ (- x1 (* x2 (floor (/ x1 x2))))))))
+
+(define (infinite? z) (and (= z (* 2 z)) (not (zero? z))))
+(define (finite? z) (not (infinite? z)))
+
+(define (invintp f1 f2 f3)
+ (define f1^2 (* f1 f1))
+ (define f2^2 (* f2 f2))
+ (define f3^2 (expt f3 2))
+ (let ((c (+ (* -3 f1^2 f2)
+ (* 3 f1 f2^2)
+ (* (- (* 2 f1^2) f2^2) f3)
+ (* (- f2 (* 2 f1)) f3^2)))
+ (b (+ (- f1^2 (* 2 f2^2)) f3^2))
+ (a (- (* 2 f2) f1 f3)))
+ (define disc (- (* b b) (* 4 a c)))
+ (if (negative? (real-part disc))
+ (/ b -2 a)
+ (let ((sqrt-disc (sqrt disc)))
+ (define root+ (/ (- sqrt-disc b) 2 a))
+ (define root- (/ (+ sqrt-disc b) -2 a))
+ (if (< (magnitude (- root+ f1)) (magnitude (- root- f1)))
+ root+
+ root-)))))
+
+(define (extrapolate-0 fs)
+ (define n (length fs))
+ (define (choose n k)
+ (do ((kdx 1 (+ 1 kdx))
+ (prd 1 (/ (* (- n kdx -1) prd) kdx)))
+ ((> kdx k) prd)))
+ (do ((k 1 (+ 1 k))
+ (lst fs (cdr lst))
+ (L 0 (+ (* -1 (expt -1 k) (choose n k) (car lst)) L)))
+ ((null? lst) L)))
+
+(define (sequence->limit proc sequence)
+ (define lval (proc (car sequence)))
+ (if (finite? lval)
+ (let ((val (proc (cadr sequence))))
+ (define h_n*nsamps (* (length sequence) (magnitude (- val lval))))
+ (if (finite? val)
+ (let loop ((sequence (cddr sequence))
+ (fxs (list val lval))
+ (trend #f)
+ (ldelta (- val lval))
+ (jdx (+ -1 (length sequence))))
+ (cond ((null? sequence)
+ (case trend
+ ((diverging) (and (real? val) (* ldelta 1/0)))
+ ((bounded) (invintp val lval (caddr fxs)))
+ (else (cond ((zero? ldelta) val)
+ ((not (real? val)) #f)
+ (else (extrapolate-0 fxs))))))
+ (else
+ (set! lval val)
+ (set! val (proc (car sequence)))
+ (if (finite? val)
+ (let ((delta (- val lval)))
+ (define h_j (/ h_n*nsamps jdx))
+ (cond ((case trend
+ ((converging) (<= (magnitude delta) h_j))
+ ((bounded) (<= (magnitude ldelta) (magnitude delta)))
+ ((diverging) (>= (magnitude delta) h_j))
+ (else #f))
+ (loop (cdr sequence) (cons val fxs) trend delta (+ -1 jdx)))
+ (trend #f)
+ (else
+ (loop (cdr sequence) (cons val fxs)
+ (cond ((> (magnitude delta) h_j) 'diverging)
+ ((< (magnitude ldelta) (magnitude delta)) 'bounded)
+ (else 'converging))
+ delta (+ -1 jdx)))))
+ (and (eq? trend 'diverging) val)))))
+ (and (real? val) val)))
+ (and (real? lval) lval)))
+
+(define (limit proc x1 x2 . k)
+ (set! k (if (null? k) 8 (car k)))
+ (cond ((not (finite? x2)) (slib:error 'limit 'infinite 'x2 x2))
+ ((not (finite? x1))
+ (or (positive? (* x1 x2)) (slib:error 'limit 'start 'mismatch x1 x2))
+ (limit (lambda (x) (proc (/ x))) 0.0 (/ x2) k))
+ ((= x1 (+ x1 x2)) (slib:error 'limit 'null 'range x1 (+ x1 x2)))
+ (else (let ((dec (/ x2 k)))
+ (do ((x (+ x1 x2 0.0) (- x dec))
+ (cnt (+ -1 k) (+ -1 cnt))
+ (lst '() (cons x lst)))
+ ((negative? cnt)
+ (sequence->limit proc (reverse lst))))))))
diff --git a/Xlibscm.info b/Xlibscm.info
index a9d7325..7223702 100644
--- a/Xlibscm.info
+++ b/Xlibscm.info
@@ -1,4 +1,4 @@
-This is Xlibscm.info, produced by makeinfo version 4.0 from
+This is Xlibscm.info, produced by makeinfo version 4.7 from
Xlibscm.texi.
INFO-DIR-SECTION The Algorithmic Language Scheme
@@ -12,7 +12,7 @@ File: Xlibscm.info, Node: Top, Next: Xlibscm, Prev: (dir), Up: (dir)
This manual documents the X - SCM Language X Interface. The most recent
information about SCM can be found on SCM's "WWW" home page:
- <http://swissnet.ai.mit.edu/~jaffer/SCM>
+ `http://swiss.csail.mit.edu/~jaffer/SCM'
Copyright (C) 1990-1999 Free Software Foundation
@@ -46,21 +46,19 @@ approved by the author.

File: Xlibscm.info, Node: Xlibscm, Next: Display and Screens, Prev: Top, Up: Top
-Xlibscm
-*******
+1 Xlibscm
+*********
"Xlibscm" is a SCM interface to "X". The X Window System is a
network-transparent window system that was designed at MIT. SCM is a
portable Scheme implementation written in C. The interface can be
compiled into SCM or, on those platforms supporting dynamic linking,
-compiled separately and loaded with `(require 'Xlib)'.
+compiled separately and loaded with `(require 'Xlib)'.
Much of this X documentation is dervied from:
Xlib - C Language X Interface
-
X Consortium Standard
-
X Version 11, Release 6.3
The X Window System is a trademark of X Consortium, Inc.
@@ -112,10 +110,10 @@ the suitability of this documentation for any purpose. It is provided

File: Xlibscm.info, Node: Display and Screens, Next: Drawables, Prev: Xlibscm, Up: Top
-Display and Screens
-*******************
+2 Display and Screens
+*********************
- - Function: x:open-display display-name
+ -- Function: x:open-display display-name
DISPLAY-NAME Specifies the hardware display name, which determines
the display and communications domain to be used. On a
POSIX-conformant system, if the display-name is #f, it defaults to
@@ -126,7 +124,7 @@ Display and Screens
DISPLAY-NAME or DISPLAY environment variable can be a string in
the format:
- - Special Form: hostname:number.screen-number
+ -- Special Form: hostname:number.screen-number
HOSTNAME specifies the name of the host machine on which the
display is physically attached. Follow the HOSTNAME with
either a single colon (:) or a double colon (::).
@@ -141,7 +139,7 @@ Display and Screens
SCREEN-NUMBER sets an internal variable that can be accessed
by using the x:default-screen procedure.
- - Function: x:close display
+ -- Function: x:close display
DISPLAY specifies the connection to the X server.
The `x:close' function closes the connection to the X server for
@@ -154,32 +152,32 @@ Display and Screens
generated. Before exiting, you should call X:CLOSE-DISPLAY or
X:FLUSH explicitly so that any pending errors are reported.
- - Function: x:protocol-version display
+ -- Function: x:protocol-version display
Returns cons of the major version number (11) of the X protocol
associated with the connected DISPLAY and the minor protocol
revision number of the X server.
- - Function: x:server-vendor display
+ -- Function: x:server-vendor display
Returns a string that provides some identification of the owner of
the X server implementation. The contents of the string are
implementation-dependent.
- - Function: x:vendor-release display
+ -- Function: x:vendor-release display
Returns a number related to a vendor's release of the X server.
A display consists of one or more "Screen"s. Each screen has a
"root-window", "default-graphics-context", and "colormap".
- - Function: x:screen-count display
+ -- Function: x:screen-count display
Returns the number of available screens.
- - Function: x:default-screen display
+ -- Function: x:default-screen display
Returns the default screen number specified by the `x:open-display'
function. Use this screen number in applications which will use
only a single screen.
- - Function: x:root-window display screen-number
- - Function: x:root-window display
+ -- Function: x:root-window display screen-number
+ -- Function: x:root-window display
SCREEN-NUMBER, if givien, specifies the appropriate screen number
on the host server. Otherwise the default-screen for DISPLAY is
used.
@@ -188,40 +186,40 @@ A display consists of one or more "Screen"s. Each screen has a
`x:root-window' for functions that need a drawable of a particular
screen or for creating top-level windows.
- - Function: x:root-window window
+ -- Function: x:root-window window
Returns the root window for the specified WINDOW's screen.
- - Function: x:default-colormap display screen-number
- - Function: x:default-colormap display
- - Function: x:default-colormap window
+ -- Function: x:default-colormap display screen-number
+ -- Function: x:default-colormap display
+ -- Function: x:default-colormap window
Returns the default colormap of the specified screen.
- - Function: x:default-ccc display screen-number
- - Function: x:default-ccc display
- - Function: x:default-ccc window
+ -- Function: x:default-ccc display screen-number
+ -- Function: x:default-ccc display
+ -- Function: x:default-ccc window
Returns the default Color-Conversion-Context (ccc) of the specified
screen.
- - Function: x:default-gc display screen-number
- - Function: x:default-gc display
- - Function: x:default-gc window
+ -- Function: x:default-gc display screen-number
+ -- Function: x:default-gc display
+ -- Function: x:default-gc window
Returns the default graphics-context of the specified screen.
- - Function: x:screen-depths display screen-number
- - Function: x:screen-depths display
- - Function: x:screen-depths window
+ -- Function: x:screen-depths display screen-number
+ -- Function: x:screen-depths display
+ -- Function: x:screen-depths window
Returns an array of depths supported by the specified screen.
The "Visual" type describes possible colormap depths and arrangements.
- - Function: x:default-visual display screen-number
- - Function: x:default-visual display
- - Function: x:default-visual window
+ -- Function: x:default-visual display screen-number
+ -- Function: x:default-visual display
+ -- Function: x:default-visual window
Returns the default Visual type for the specified screen.
- - Function: x:make-visual display depth class
- - Function: x:make-visual window depth class
+ -- Function: x:make-visual display depth class
+ -- Function: x:make-visual window depth class
The integer DEPTH specifies the number of bits per pixel. The
CLASS argument specifies one of the possible visual classes for a
screen:
@@ -240,14 +238,14 @@ The "Visual" type describes possible colormap depths and arrangements.
`X:make-visual' returns a visual type for the screen specified by
DISPLAY or WINDOW if successful; #f if not.
- - Function: x:visual-class visual
- - Function: x:visual-class screen
- - Function: x:visual-class display
+ -- Function: x:visual-class visual
+ -- Function: x:visual-class screen
+ -- Function: x:visual-class display
Returns the (integer) visual class of its argument.
- - Function: x:visual-geometry visual
- - Function: x:visual-geometry screen
- - Function: x:visual-geometry display
+ -- Function: x:visual-geometry visual
+ -- Function: x:visual-geometry screen
+ -- Function: x:visual-geometry display
Returns a list of the:
* red_mask
@@ -257,49 +255,49 @@ The "Visual" type describes possible colormap depths and arrangements.
* colormap_size
- - Function: x:screen-cells display screen-number
- - Function: x:screen-cells display
- - Function: x:screen-cells window
+ -- Function: x:screen-cells display screen-number
+ -- Function: x:screen-cells display
+ -- Function: x:screen-cells window
Returns the number of entries in the default colormap.
- - Function: x:screen-depth display screen-number
+ -- Function: x:screen-depth display screen-number
Returns the depth of the root window of the specified screen.
- - Function: x:screen-depth display
- - Function: x:screen-depth window
- - Function: x:screen-depth visual
+ -- Function: x:screen-depth display
+ -- Function: x:screen-depth window
+ -- Function: x:screen-depth visual
Returns the depth of argument.
The "depth" of a window or pixmap is the number of bits per pixel
it has. The "depth" of a graphics context is the depth of the
drawables it can be used in conjunction with graphics output.
- - Function: x:screen-size display screen-number
- - Function: x:screen-size display
- - Function: x:screen-size window
+ -- Function: x:screen-size display screen-number
+ -- Function: x:screen-size display
+ -- Function: x:screen-size window
Returns a list of integer height and width of the screen in pixels.
- - Function: x:screen-dimensions display screen-number
- - Function: x:screen-dimensions display
- - Function: x:screen-dimensions window
+ -- Function: x:screen-dimensions display screen-number
+ -- Function: x:screen-dimensions display
+ -- Function: x:screen-dimensions window
Returns a list of integer height and width of the screen in
millimeters.
- - Function: x:screen-white display screen-number
- - Function: x:screen-white display
- - Function: x:screen-white window
+ -- Function: x:screen-white display screen-number
+ -- Function: x:screen-white display
+ -- Function: x:screen-white window
Returns the white pixel value of the specified screen.
- - Function: x:screen-black display screen-number
- - Function: x:screen-black display
- - Function: x:screen-black window
+ -- Function: x:screen-black display screen-number
+ -- Function: x:screen-black display
+ -- Function: x:screen-black window
Returns the black pixel value of the specified screen.

File: Xlibscm.info, Node: Drawables, Next: Graphics Context, Prev: Display and Screens, Up: Top
-Drawables
-*********
+3 Drawables
+***********
A "Drawable" is either a window or pixmap.
@@ -312,10 +310,10 @@ A "Drawable" is either a window or pixmap.

File: Xlibscm.info, Node: Windows and Pixmaps, Next: Window Attributes, Prev: Drawables, Up: Drawables
-Windows and Pixmaps
-===================
+3.1 Windows and Pixmaps
+=======================
- - Function: x:create-window window position size border-width depth
+ -- Function: x:create-window window position size border-width depth
class visual field-name value ...
Creates and returns an unmapped Input-Output subwindow for a
specified parent WINDOW and causes the X server to generate a
@@ -341,14 +339,14 @@ Windows and Pixmaps
The returned window will have the attributes specified by
FIELD-NAMEs and VALUE.
- - Function: x:create-window window position size border-width border
+ -- Function: x:create-window window position size border-width border
background
The returned window inherits its depth, class, and visual from its
parent. All other window attributes, except BACKGROUND and
BORDER, have their default values.
- - Function: x:create-pixmap drawable size depth
- - Function: x:create-pixmap display size depth
+ -- Function: x:create-pixmap drawable size depth
+ -- Function: x:create-pixmap display size depth
SIZE is a list, vector, or pair of nonzero integers specifying the
width and height desired in the new pixmap.
@@ -357,7 +355,7 @@ Windows and Pixmaps
drawable argument. The DEPTH argument must be one of the depths
supported by the screen of the specified DRAWABLE.
- - Function: x:close window
+ -- Function: x:close window
Destroys the specified WINDOW as well as all of its subwindows and
causes the X server to generate a DestroyNotify event for each
window. The window should not be used again. If the window
@@ -371,11 +369,11 @@ Windows and Pixmaps
mapped WINDOW will generate x:Expose events on other windows that
were obscured by the window being destroyed.
- - Function: x:close pixmap
+ -- Function: x:close pixmap
Deletes the association between the PIXMAP and its storage. The X
server frees the pixmap storage when there are no references to it.
- - Function: x:window-geometry drawable
+ -- Function: x:window-geometry drawable
Returns a list of:
coordinates
@@ -396,7 +394,7 @@ Windows and Pixmaps
depth
The depth of the DRAWABLE (bits per pixel for the object).
- - Function: x:window-geometry-set! window field-name value ...
+ -- Function: x:window-geometry-set! window field-name value ...
Changes the "Configuration" components specified by FIELD-NAMEs
for the specified WINDOW.
@@ -405,10 +403,10 @@ these attributes are encoded by small integers - just like those of the
next section. Be warned therefore that confusion of attribute names
will likely not signal errors, just cause mysterious behavior.
- - Attribute: x:CWX
- - Attribute: x:CWY
- - Attribute: x:CW-Width
- - Attribute: x:CW-Height
+ -- Attribute: x:CWX
+ -- Attribute: x:CWY
+ -- Attribute: x:CW-Width
+ -- Attribute: x:CW-Height
The x:CWX and x:CYY members are used to set the window's x and y
coordinates, which are relative to the parent's origin and
indicate the position of the upper-left outer corner of the
@@ -420,18 +418,18 @@ will likely not signal errors, just cause mysterious behavior.
according to their window gravity. Depending on the window's bit
gravity, the contents of the window also may be moved
- - Attribute: x:CW-Border-Width
+ -- Attribute: x:CW-Border-Width
The integer x:CW-Border-Width is used to set the width of the
border in pixels. Note that setting just the border width leaves
the outer-left corner of the window in a fixed position but moves
the absolute position of the window's origin. It is an error to
set the border-width attribute of an InputOnly window nonzero.
- - Attribute: x:CW-Sibling
+ -- Attribute: x:CW-Sibling
The sibling member is used to set the sibling window for stacking
operations.
- - Attribute: x:CW-Stack-Mode
+ -- Attribute: x:CW-Stack-Mode
The x:CW-Stack-Mode member is used to set how the window is to be
restacked and can be set to x:Above, x:Below, x:Top-If,
x:Bottom-If, or x:Opposite.
@@ -483,10 +481,10 @@ restacked as follows:

File: Xlibscm.info, Node: Window Attributes, Next: Window Properties and Visibility, Prev: Windows and Pixmaps, Up: Drawables
-Window Attributes
-=================
+3.2 Window Attributes
+=====================
- - Function: x:window-set! window field-name value ...
+ -- Function: x:window-set! window field-name value ...
Changes the components specified by FIELD-NAMEs for the specified
WINDOW. The restrictions are the same as for `x:create-window'.
The order in which components are verified and altered is server
@@ -498,7 +496,7 @@ argument (respectively) followed by pairs of arguments, where the first
is one of the property-name symbols (or its top-level value) listed
below; and the second is the value to associate with that property.
- - Attribute: x:CW-Back-Pixmap
+ -- Attribute: x:CW-Back-Pixmap
Sets the background pixmap of the WINDOW to the specified pixmap.
The background pixmap can immediately be freed if no further
explicit references to it are to be made. If x:Parent-Relative is
@@ -508,25 +506,25 @@ below; and the second is the value to associate with that property.
the background is set to #f or None, the window has no defined
background.
- - Attribute: x:CW-Back-Pixel
+ -- Attribute: x:CW-Back-Pixel
Sets the background of the WINDOW to the specified pixel value.
Changing the background does not cause the WINDOW contents to be
changed. It is an error to perform this operation on an
x:Input-Only window.
- - Attribute: x:CW-Border-Pixmap
+ -- Attribute: x:CW-Border-Pixmap
Sets the border pixmap of the WINDOW to the pixmap you specify.
The border pixmap can be freed if no further explicit references
to it are to be made. If you specify x:Copy-From-Parent, a copy
of the parent window's border pixmap is used. It is an error to
perform this operation on an x:Input-Only WINDOW.
- - Attribute: x:CW-Border-Pixel
+ -- Attribute: x:CW-Border-Pixel
Sets the border of the WINDOW to the pixel VALUE. It is an error
to perform this operation on an x:Input-Only window.
- - Attribute: x:CW-Bit-Gravity
- - Attribute: x:CW-Win-Gravity
+ -- Attribute: x:CW-Bit-Gravity
+ -- Attribute: x:CW-Win-Gravity
The bit gravity of a window defines which region of the window
should be retained when an x:Input-Output window is resized. The
default value for the bit-gravity attribute is x:Forget-Gravity.
@@ -587,7 +585,7 @@ below; and the second is the value to associate with that property.
window is not moved), except the child is also unmapped when the
parent is resized, and an x:Unmap-Notify event is generated.
- - Attribute: x:CW-Backing-Store
+ -- Attribute: x:CW-Backing-Store
Some implementations of the X server may choose to maintain the
contents of x:Input-Output windows. If the X server maintains the
contents of a window, the off-screen saved pixels are known as
@@ -616,8 +614,8 @@ below; and the second is the value to associate with that property.
window is the source). However, regions obscured by inferior
windows are not included.
- - Attribute: x:CW-Backing-Planes
- - Attribute: x:CW-Backing-Pixel
+ -- Attribute: x:CW-Backing-Planes
+ -- Attribute: x:CW-Backing-Pixel
You can set backing planes to indicate (with bits set to 1) which
bit planes of an x:Input-Output window hold dynamic data that must
be preserved in backing store and during save unders. The default
@@ -633,7 +631,7 @@ below; and the second is the value to associate with that property.
you should use these members to minimize the amount of off-screen
memory required to store your window.
- - Attribute: x:CW-Override-Redirect
+ -- Attribute: x:CW-Override-Redirect
To control window placement or to add decoration, a window manager
often needs to intercept (redirect) any map or configure request.
Pop-up windows, however, often need to be mapped without a window
@@ -647,7 +645,7 @@ below; and the second is the value to associate with that property.
override-redirect flag to #t or #f (default). Window managers use
this information to avoid tampering with pop-up windows.
- - Attribute: x:CW-Save-Under
+ -- Attribute: x:CW-Save-Under
Some server implementations may preserve contents of
x:Input-Output windows under other x:Input-Output windows. This
is not the same as preserving the contents of a window for you.
@@ -661,7 +659,7 @@ below; and the second is the value to associate with that property.
is mapped, saving the contents of windows it obscures would be
beneficial.
- - Attribute: x:CW-Event-Mask
+ -- Attribute: x:CW-Event-Mask
The event mask defines which events the client is interested in
for this x:Input-Output or x:Input-Only window (or, for some event
types, inferiors of this window). The event mask is the bitwise
@@ -719,7 +717,7 @@ below; and the second is the value to associate with that property.
owner_events set to True
- - Attribute: x:CW-Dont-Propagate
+ -- Attribute: x:CW-Dont-Propagate
The do-not-propagate-mask attribute defines which events should
not be propagated to ancestor windows when no client has the event
type selected in this x:Input-Output or x:Input-Only window. The
@@ -730,7 +728,7 @@ below; and the second is the value to associate with that property.
x:Button5Motion, and x:Button-Motion. You can specify that all
events are propagated by setting x:No-Event-Mask (default).
- - Attribute: x:CW-Colormap
+ -- Attribute: x:CW-Colormap
The colormap attribute specifies which colormap best reflects the
true colors of the x:Input-Output window. The colormap must have
the same visual type as the window. X servers capable of
@@ -748,7 +746,7 @@ below; and the second is the value to associate with that property.
changes to the parent window's colormap attribute do not affect
the child window.
- - Attribute: x:CW-Cursor
+ -- Attribute: x:CW-Cursor
The cursor attribute specifies which cursor is to be used when the
pointer is in the x:Input-Output or x:Input-Only window. You can
set the cursor to a cursor or x:None (default).
@@ -759,7 +757,7 @@ below; and the second is the value to associate with that property.
in the displayed cursor. On the root window, the default cursor
is restored.
- - Function: x:window-ref window field-name ...
+ -- Function: x:window-ref window field-name ...
Returns a list of the components specified by FIELD-NAMEs for the
specified WINDOW. Allowable FIELD-NAMEs are a subset of those for
`x:window-set!':
@@ -789,18 +787,18 @@ below; and the second is the value to associate with that property.

File: Xlibscm.info, Node: Window Properties and Visibility, Prev: Window Attributes, Up: Drawables
-Window Properties and Visibility
-================================
+3.3 Window Properties and Visibility
+====================================
- - Function: x:get-window-property window property
+ -- Function: x:get-window-property window property
Returns the (string or list of numbers) value of PROPERTY of
WINDOW.
- - Function: x:get-window-property window property #t
+ -- Function: x:get-window-property window property #t
Removes and returns the (string or list of numbers) value of
PROPERTY of WINDOW.
- - Function: x:list-properties window
+ -- Function: x:list-properties window
Returns a list of the properties (strings) defined for WINDOW.
In X parlance, a window which is hidden even when not obscured by other
@@ -808,7 +806,7 @@ windows is "unmapped"; one which shows is "mapped". It is an
unfortunate name-collision with Scheme, and is ingrained in the
attribute names.
- - Function: x:map-window window
+ -- Function: x:map-window window
Maps the WINDOW and all of its subwindows that have had map
requests. Mapping a window that has an unmapped ancestor does not
display the window but marks it as eligible for display when the
@@ -845,7 +843,7 @@ attribute names.
be to repaint the window. This method usually leads to simpler
programs and to proper interaction with window managers.
- - Function: x:map-subwindows window
+ -- Function: x:map-subwindows window
Maps all subwindows of a specified WINDOW in top-to-bottom
stacking order. The X server generates x:Expose events on each
newly displayed window. This may be much more efficient than
@@ -853,7 +851,7 @@ attribute names.
perform much of the work only once, for all of the windows, rather
than for each window.
- - Function: x:unmap-window window
+ -- Function: x:unmap-window window
Unmaps the specified WINDOW and causes the X server to generate an
UnmapNotify event. If the specified WINDOW is already unmapped,
`x:unmap-window' has no effect. Normal exposure processing on
@@ -864,7 +862,7 @@ attribute names.
generate x:Expose events on windows that were formerly obscured by
it.
- - Function: x:unmap-subwindows window
+ -- Function: x:unmap-subwindows window
Unmaps all subwindows for the specified WINDOW in bottom-to-top
stacking order. It causes the X server to generate an UnmapNotify
event on each subwindow and x:Expose events on formerly obscured
@@ -876,8 +874,8 @@ attribute names.

File: Xlibscm.info, Node: Graphics Context, Next: Cursor, Prev: Drawables, Up: Top
-Graphics Context
-****************
+4 Graphics Context
+******************
Most attributes of graphics operations are stored in "GC"s. These
include line width, line style, plane mask, foreground, background,
@@ -885,24 +883,24 @@ tile, stipple, clipping region, end style, join style, and so on.
Graphics operations (for example, drawing lines) use these values to
determine the actual drawing operation.
- - Function: x:create-gc drawable field-name value ...
+ -- Function: x:create-gc drawable field-name value ...
Creates and returns graphics context. The graphics context can be
used with any destination drawable having the same root and depth
as the specified DRAWABLE.
- - Function: x:gc-set! graphics-context field-name value ...
+ -- Function: x:gc-set! graphics-context field-name value ...
Changes the components specified by FIELD-NAMEs for the specified
GRAPHICS-CONTEXT. The restrictions are the same as for
`x:create-gc'. The order in which components are verified and
altered is server dependent. If an error occurs, a subset of the
components may have been altered.
- - Function: x:copy-gc-fields! gcontext-src gcontext-dst field-name ...
+ -- Function: x:copy-gc-fields! gcontext-src gcontext-dst field-name ...
Copies the components specified by FIELD-NAMEs from GCONTEXT-SRC
to GCONTEXT-DST. GCONTEXT-SRC and GCONTEXT-DST must have the same
root and depth.
- - Function: x:gc-ref graphics-context field-name ...
+ -- Function: x:gc-ref graphics-context field-name ...
Returns a list of the components specified by FIELD-NAMEs ...
from the specified GRAPHICS-CONTEXT.
@@ -914,7 +912,7 @@ pairs of arguments, where the first is one of the property-name symbols
(or its top-level value) listed below; and the second is the value to
associate with that property.
- - Attribute: x:GC-Function
+ -- Attribute: x:GC-Function
The function attributes of a GC are used when you update a section
of a drawable (the destination) with bits from somewhere else (the
source). The function in a GC defines how the new destination
@@ -942,7 +940,7 @@ associate with that property.
x:G-Xnand (OR (NOT src) (NOT dst))
x:G-Xset 1
- - Attribute: x:GC-Plane-Mask
+ -- Attribute: x:GC-Plane-Mask
Many graphics operations depend on either pixel values or planes
in a GC. The planes attribute is an integer which specifies which
planes of the destination are to be modified, one bit per plane.
@@ -963,8 +961,8 @@ associate with that property.
Range checking is not performed on a plane-mask value. It is
simply truncated to the appropriate number of bits.
- - Attribute: x:GC-Foreground
- - Attribute: x:GC-Background
+ -- Attribute: x:GC-Foreground
+ -- Attribute: x:GC-Background
Range checking is not performed on the values for foreground or
background. They are simply truncated to the appropriate number of
bits.
@@ -972,7 +970,7 @@ associate with that property.
Note that foreground and background are not initialized to any
values likely to be useful in a window.
- - Attribute: x:GC-Line-Width
+ -- Attribute: x:GC-Line-Width
The line-width is measured in pixels and either can be greater
than or equal to one (wide line) or can be the special value zero
(thin line).
@@ -1009,7 +1007,7 @@ associate with that property.
across all displays, a client should always use a line-width of
one rather than a linewidth of zero.
- - Attribute: x:GC-Line-Style
+ -- Attribute: x:GC-Line-Style
The line-style defines which sections of a line are drawn:
x:Line-Solid
@@ -1025,7 +1023,7 @@ associate with that property.
internal ends of the individual dashes, except x:Cap-Not-Last
is treated as x:Cap-Butt.
- - Attribute: x:GC-Cap-Style
+ -- Attribute: x:GC-Cap-Style
The cap-style defines how the endpoints of a path are drawn:
x:Cap-Not-Last
@@ -1046,7 +1044,7 @@ associate with that property.
the endpoint for a distance equal to half the line-width.
(This is equivalent to x:Cap-Butt for line-width of zero).
- - Attribute: x:GC-Join-Style
+ -- Attribute: x:GC-Join-Style
The join-style defines how corners are drawn for wide lines:
x:Join-Miter
@@ -1062,7 +1060,7 @@ associate with that property.
The corner has x:Cap-Butt endpoint styles with the triangular
notch filled.
- - Attribute: x:GC-Fill-Style
+ -- Attribute: x:GC-Fill-Style
The fill-style defines the contents of the source for line, text,
and fill requests. For all text and fill requests (for example,
X:Draw-Text, X:Fill-Rectangle, X:Fill-Polygon, and X:Fill-Arc);
@@ -1100,7 +1098,7 @@ associate with that property.
x:Fill-Stippled
Background masked by stipple
- - Attribute: x:GC-Fill-Rule
+ -- Attribute: x:GC-Fill-Rule
The fill-rule defines what pixels are inside (drawn) for paths
given in X:Fill-Polygon requests and can be set to x:Even-Odd-Rule
or x:Winding-Rule.
@@ -1130,8 +1128,8 @@ associate with that property.
horizontal edge are a special case and are inside if and only if
the polygon interior is immediately below (y increasing direction).
- - Attribute: x:GC-Tile
- - Attribute: x:GC-Stipple
+ -- Attribute: x:GC-Tile
+ -- Attribute: x:GC-Stipple
The tile/stipple represents an infinite two-dimensional plane,
with the tile/stipple replicated in all dimensions.
@@ -1144,8 +1142,8 @@ associate with that property.
clip-mask. Although some sizes may be faster to use than others,
any size pixmap can be used for tiling or stippling.
- - Attribute: x:GC-Tile-Stip-X-Origin
- - Attribute: x:GC-Tile-Stip-Y-Origin
+ -- Attribute: x:GC-Tile-Stip-X-Origin
+ -- Attribute: x:GC-Tile-Stip-Y-Origin
When the tile/stipple plane is superimposed on a drawable for use
in a graphics operation, the upper-left corner of some instance of
the tile/stipple is at the coordinates within the drawable
@@ -1153,10 +1151,10 @@ associate with that property.
interpreted relative to the origin of whatever destination
drawable is specified in a graphics request.
- - Attribute: x:GC-Font
+ -- Attribute: x:GC-Font
The font to be used for drawing text.
- - Attribute: x:GC-Subwindow-Mode
+ -- Attribute: x:GC-Subwindow-Mode
You can set the subwindow-mode to x:Clip-By-Children or
x:Include-Inferiors.
x:Clip-By-Children
@@ -1171,30 +1169,30 @@ associate with that property.
one depth with mapped inferiors of differing depth is not
illegal, but the semantics are undefined by the core protocol.
- - Attribute: x:GC-Graphics-Exposures
+ -- Attribute: x:GC-Graphics-Exposures
The graphics-exposure flag controls x:Graphics-Expose event
generation for X:Copy-Area and X:Copy-Plane requests (and any
similar requests defined by extensions).
- - Attribute: x:GC-Clip-X-Origin
- - Attribute: x:GC-Clip-Y-Origin
+ -- Attribute: x:GC-Clip-X-Origin
+ -- Attribute: x:GC-Clip-Y-Origin
The clip-mask origin is interpreted relative to the origin of
whatever destination drawable is specified in a graphics request.
- - Attribute: x:GC-Clip-Mask
+ -- Attribute: x:GC-Clip-Mask
The clip-mask restricts writes to the destination drawable. If the
clip-mask is set to a pixmap, it must have depth one and have the
- same root as the GC, or an error results. If clip-mask is set to
- "x:None", the pixels are always drawn regardless of the clip
- origin. The clip-mask also can be set by calling `X:Set-Region'.
- Only pixels where the clip-mask has a bit set to 1 are drawn.
- Pixels are not drawn outside the area covered by the clip-mask or
- where the clip-mask has a bit set to 0. The clip-mask affects all
- graphics requests. The clip-mask does not clip sources. The
- clip-mask origin is interpreted relative to the origin of whatever
+ same root as the GC, or an error results. If clip-mask is set to "x:None",
+ the pixels are always drawn regardless of the clip origin. The
+ clip-mask also can be set by calling `X:Set-Region'. Only pixels
+ where the clip-mask has a bit set to 1 are drawn. Pixels are not
+ drawn outside the area covered by the clip-mask or where the
+ clip-mask has a bit set to 0. The clip-mask affects all graphics
+ requests. The clip-mask does not clip sources. The clip-mask
+ origin is interpreted relative to the origin of whatever
destination drawable is specified in a graphics request.
- - Attribute: x:GC-Dash-Offset
+ -- Attribute: x:GC-Dash-Offset
Defines the phase of the pattern, specifying how many pixels into
the dash-list the pattern should actually begin in any single
graphics request. Dashing is continuous through path elements
@@ -1211,7 +1209,7 @@ associate with that property.
between 135 and 225 degrees from the x axis. For all other lines,
the major axis is the y axis.
- - Attribute: x:GC-Dash-List
+ -- Attribute: x:GC-Dash-List
There must be at least one element in the specified DASH-LIST.
The initial and alternating elements (second, fourth, and so on)
of the DASH-LIST are the even dashes, and the others are the odd
@@ -1220,7 +1218,7 @@ associate with that property.
equivalent to specifying the same list concatenated with itself to
produce an even-length list.
- - Attribute: x:GC-Arc-Mode
+ -- Attribute: x:GC-Arc-Mode
The arc-mode controls filling in the X:Fill-Arcs function and can
be set to x:Arc-Pie-Slice or x:Arc-Chord.
x:Arc-Pie-Slice
@@ -1232,13 +1230,13 @@ associate with that property.

File: Xlibscm.info, Node: Cursor, Next: Colormap, Prev: Graphics Context, Up: Top
-Cursor
-******
+5 Cursor
+********
- - Function: x:create-cursor display shape
- X provides a set of standard cursor shapes in a special font named
- "cursor". Applications are encouraged to use this interface for
- their cursors because the font can be customized for the individual
+ -- Function: x:create-cursor display shape
+ X provides a set of standard cursor shapes in a special font named "cursor".
+ Applications are encouraged to use this interface for their
+ cursors because the font can be customized for the individual
display type. The SHAPE argument specifies which glyph of the
standard fonts to use.
@@ -1247,7 +1245,7 @@ Cursor
background (see X:Recolor-Cursor). The names of all cursor shapes
are defined with the prefix XC: in `x11.scm'.
- - Function: x:create-cursor source-font source-char mask-font
+ -- Function: x:create-cursor source-font source-char mask-font
mask-char fgc bgc
Creates a cursor from the source and mask bitmaps obtained from the
specified font glyphs. The integer SOURCE-CHAR must be a defined
@@ -1258,11 +1256,11 @@ Cursor
metrics, and there is no restriction on the placement of the
hotspot relative to the bounding boxes.
- - Function: x:create-cursor source-font source-char #f #f fgc bgc
+ -- Function: x:create-cursor source-font source-char #f #f fgc bgc
If MASK-FONT and MASK-CHAR are #f, all pixels of the source are
displayed.
- - Function: x:create-cursor source-pixmap mask-pixmap fgc bgc origin
+ -- Function: x:create-cursor source-pixmap mask-pixmap fgc bgc origin
MASK-PIXMAP must be the same size as the pixmap defined by the
SOURCE-PIXMAP argument. The foreground and background RGB values
must be specified using FOREGROUND-COLOR and BACKGROUND-COLOR,
@@ -1277,18 +1275,18 @@ Cursor
in MASK-PIXMAP define which source pixels are displayed, and the
pixels set to 0 define which pixels are ignored.
- - Function: x:create-cursor source-pixmap #f fgc bgc origin
+ -- Function: x:create-cursor source-pixmap #f fgc bgc origin
If MASK-PIXMAP is #f, all pixels of the source are displayed.

File: Xlibscm.info, Node: Colormap, Next: Rendering, Prev: Cursor, Up: Top
-Colormap
-********
+6 Colormap
+**********
A "colormap" maps pixel values to "RGB" color space values.
- - Function: x:create-colormap window visual alloc-policy
+ -- Function: x:create-colormap window visual alloc-policy
WINDOW specifies the window on whose screen you want to create a
colormap. VISUAL specifies a visual type supported on the screen.
ALLOC-POLICY Specifies the colormap entries to be allocated. You
@@ -1314,6 +1312,7 @@ A "colormap" maps pixel values to "RGB" color space values.
specific to VISUAL and are not defined by X. The
ALLOC-POLICY must be `X:Alloc-None'.
+
For the other visual classes, if ALLOC-POLICY is `X:Alloc-None',
the colormap initially has no allocated entries, and clients can
allocate them.
@@ -1339,7 +1338,7 @@ A "colormap" maps pixel values to "RGB" color space values.
To create a new colormap when the allocation out of a previously shared
colormap has failed because of resource exhaustion, use:
- - Function: x:copy-colormap-and-free colormap
+ -- Function: x:copy-colormap-and-free colormap
Creates and returns a colormap of the same visual type and for the
same screen as the specified COLORMAP. It also moves all of the
client's existing allocation from the specified COLORMAP to the
@@ -1361,8 +1360,9 @@ A "colormap" maps pixel values to elements of the "RGB" datatype. An
RGB is a list or vector of 3 integers, describing the red, green, and
blue intensities respectively. The integers are in the range 0 - 65535.
- - Function: x:alloc-colormap-cells colormap ncolors nplanes
- - Function: x:alloc-colormap-cells colormap ncolors nplanes contiguous?
+ -- Function: x:alloc-colormap-cells colormap ncolors nplanes
+ -- Function: x:alloc-colormap-cells colormap ncolors nplanes
+ contiguous?
The `X:Alloc-Color-Cells' function allocates read/write color
cells. The number of colors, NCOLORS must be positive and the
number of planes, NPLANES nonnegative. If NCOLORS and nplanes are
@@ -1391,8 +1391,8 @@ blue intensities respectively. The integers are in the range 0 - 65535.
succeeded or #f if it failed. The first array has the pixels
allocated and the second has the plane-masks.
- - Function: x:alloc-colormap-cells colormap ncolors rgb
- - Function: x:alloc-colormap-cells colormap ncolors rgb contiguous?
+ -- Function: x:alloc-colormap-cells colormap ncolors rgb
+ -- Function: x:alloc-colormap-cells colormap ncolors rgb contiguous?
The specified NCOLORS must be positive; and RGB a list or vector
of 3 nonnegative integers. If NCOLORS colors, NREDS reds, NGREENS
greens, and NBLUES blues are requested, NCOLORS pixels are
@@ -1415,8 +1415,8 @@ blue intensities respectively. The integers are in the range 0 - 65535.
allocated. The second, third, and fourth elements are the red,
green, and blue plane-masks.
- - Function: x:free-colormap-cells colormap pixels planes
- - Function: x:free-colormap-cells colormap pixels
+ -- Function: x:free-colormap-cells colormap pixels planes
+ -- Function: x:free-colormap-cells colormap pixels
Frees the cells represented by pixels whose values are in the
PIXELS unsigned-integer uniform-vector. The PLANES argument
should not have any bits set to 1 in common with any of the
@@ -1439,12 +1439,12 @@ blue intensities respectively. The integers are in the range 0 - 65535.
passing `x:Alloc-All' to `X:Create-Colormap'). If more than one
pixel is in error, the one that gets reported is arbitrary.
- - Function: x:colormap-find-color colormap rgb
+ -- Function: x:colormap-find-color colormap rgb
RGB is a list or vector of 3 integers, describing the red, green,
and blue intensities respectively; or an integer `#xrrggbb',
packing red, green and blue intensities in the range 0 - 255.
- - Function: x:colormap-find-color colormap color-name
+ -- Function: x:colormap-find-color colormap color-name
The case-insensitive string COLOR_NAME specifies the name of a
color (for example, `red')
@@ -1461,19 +1461,19 @@ blue intensities respectively. The integers are in the range 0 - 65535.
deallocated.
- - Function: x:color-ref colormap pixel
+ -- Function: x:color-ref colormap pixel
Returns a list of 3 integers, describing the red, green, and blue
intensities respectively of the COLORMAP entry of the cell indexed
by PIXEL.
The integer PIXEL must be a valid index into COLORMAP.
- - Function: X:Color-Set! colormap pixel rgb
+ -- Function: X:Color-Set! colormap pixel rgb
RGB is a list or vector of 3 integers, describing the red, green,
and blue intensities respectively; or an integer `#xrrggbb',
packing red, green and blue intensities in the range 0 - 255.
- - Function: X:Color-Set! colormap pixel color-name
+ -- Function: X:Color-Set! colormap pixel color-name
The case-insensitive string COLOR_NAME specifies the name of a
color (for example, `red')
@@ -1484,7 +1484,7 @@ blue intensities respectively. The integers are in the range 0 - 65535.
screen, the changes are visible immediately.
- - Function: x:install-colormap colormap
+ -- Function: x:install-colormap colormap
Installs the specified COLORMAP for its associated screen. All
windows associated with COLORMAP immediately display with true
colors. A colormap is associated with a window when the window is
@@ -1495,24 +1495,24 @@ blue intensities respectively. The integers are in the range 0 - 65535.
has that colormap.
- - Function: x:ccc colormap
+ -- Function: x:ccc colormap
Returns the Color-Conversion-Context of COLORMAP.

File: Xlibscm.info, Node: Rendering, Next: Images, Prev: Colormap, Up: Top
-Rendering
-*********
+7 Rendering
+***********
- - Function: x:flush display
- - Function: x:flush window
+ -- Function: x:flush display
+ -- Function: x:flush window
Flushes the output buffer. Some client applications need not use
this function because the output buffer is automatically flushed
as needed by calls to X:Pending, X:Next-Event, and X:Window-Event.
Events generated by the server may be enqueued into the library's
event queue.
- - Function: x:flush gc
+ -- Function: x:flush gc
Forces sending of GC component changes.
Xlib usually defers sending changes to the components of a GC to
@@ -1524,7 +1524,7 @@ Rendering
the GC indirectly, in such a way that the extension interface
cannot know what GC will be used.
- - Function: x:clear-area window (x-pos y-pos) (width height) expose?
+ -- Function: x:clear-area window (x-pos y-pos) (width height) expose?
Paints a rectangular area in the specified WINDOW according to the
specified dimensions with the WINDOW's background pixel or pixmap.
The subwindow-mode effectively is `x:Clip-By-Children'. If width
@@ -1538,19 +1538,19 @@ Rendering
are either visible or are being retained in a backing store. If
you specify a WINDOW whose class is x:Input-Only, an error results.
- - Function: x:fill-rectangle window gcontext position size
+ -- Function: x:fill-rectangle window gcontext position size
Draw Strings
============
- - Function: x:draw-string drawable gc position string
+ -- Function: x:draw-string drawable gc position string
POSITION specifies coordinates relative to the origin of DRAWABLE
of the origin of the first character to be drawn.
`x:draw-string' draws the characters of STRING, starting at
POSITION.
- - Function: x:image-string drawable gc position string
+ -- Function: x:image-string drawable gc position string
POSITION specifies coordinates relative to the origin of DRAWABLE
of the origin of the first character to be drawn.
@@ -1560,13 +1560,13 @@ Draw Strings
Draw Shapes
===========
- - Function: x:draw-points drawable gc position ...
+ -- Function: x:draw-points drawable gc position ...
POSITION ... specifies coordinates of the point to be drawn.
- - Function: x:draw-points drawable gc x y ...
+ -- Function: x:draw-points drawable gc x y ...
(X, Y) ... specifies coordinates of the point to be drawn.
- - Function: x:draw-points drawable gc point-array
+ -- Function: x:draw-points drawable gc point-array
POINT-ARRAY is a uniform short array of rank 2, whose rightmost
index spans a range of 2.
@@ -1578,14 +1578,14 @@ Draw Shapes
foreground, subwindow-mode, clip-x-origin, clip-y-origin, and
clip-mask.
- - Function: x:draw-segments drawable gc pos1 pos2 ...
+ -- Function: x:draw-segments drawable gc pos1 pos2 ...
POS1, POS2, ... specify coordinates to be connected by segments.
- - Function: x:draw-segments drawable gc x1 y1 x2 y2 ...
+ -- Function: x:draw-segments drawable gc x1 y1 x2 y2 ...
(X1, Y1), (X2, Y2) ... specify coordinates to be connected by
segments.
- - Function: x:draw-segments drawable gc point-array
+ -- Function: x:draw-segments drawable gc point-array
POINT-ARRAY is a uniform short array of rank 2, whose rightmost
index spans a range of 2.
@@ -1608,14 +1608,14 @@ Draw Shapes
tile, stipple, tilestipple-x-origin, tile-stipple-y-origin,
dash-offset, and dash-list.
- - Function: x:draw-lines drawable gc pos1 pos2 ...
+ -- Function: x:draw-lines drawable gc pos1 pos2 ...
POS1, POS2, ... specify coordinates to be connected by lines.
- - Function: x:draw-lines drawable gc x1 y1 x2 y2 ...
+ -- Function: x:draw-lines drawable gc x1 y1 x2 y2 ...
(X1, Y1), (X2, Y2) ... specify coordinates to be connected by
lines.
- - Function: x:draw-lines drawable gc point-array
+ -- Function: x:draw-lines drawable gc point-array
POINT-ARRAY is a uniform short array of rank 2, whose rightmost
index spans a range of 2.
@@ -1639,13 +1639,13 @@ Draw Shapes
tile, stipple, tilestipple-x-origin, tile-stipple-y-origin,
dash-offset, and dash-list.
- - Function: x:fill-polygon drawable gc pos1 pos2 ...
+ -- Function: x:fill-polygon drawable gc pos1 pos2 ...
POS1, POS2, ... specify coordinates of the border path.
- - Function: x:fill-polygon drawable gc x1 y1 x2 y2 ...
+ -- Function: x:fill-polygon drawable gc x1 y1 x2 y2 ...
(X1, Y1), (X2, Y2) ... specify coordinates of the border path.
- - Function: x:fill-polygon drawable gc point-array
+ -- Function: x:fill-polygon drawable gc point-array
POINT-ARRAY is a uniform short array of rank 2, whose rightmost
index spans a range of 2.
@@ -1667,30 +1667,30 @@ Draw Shapes

File: Xlibscm.info, Node: Images, Next: Event, Prev: Rendering, Up: Top
-Images
-******
+8 Images
+********
- - Function: x:read-bitmap-file drawable file
+ -- Function: x:read-bitmap-file drawable file

File: Xlibscm.info, Node: Event, Next: Index, Prev: Images, Up: Top
-Event
-*****
+9 Event
+*******
These three status routines always return immediately if there are
events already in the queue.
- - Function: x:q-length display
+ -- Function: x:q-length display
Returns the length of the event queue for the connected DISPLAY.
Note that there may be more events that have not been read into the
queue yet (see X:Events-Queued).
- - Function: x:pending display
+ -- Function: x:pending display
Returns the number of events that have been received from the X
server but have not been removed from the event queue.
- - Function: x:events-queued display
+ -- Function: x:events-queued display
Returns the number of events already in the queue if the number is
nonzero. If there are no events in the queue, `X:Events-Queued'
attempts to read more events out of the application's connection
@@ -1698,12 +1698,12 @@ events already in the queue.
Both of these routines return an object of type "event".
- - Function: x:next-event display
+ -- Function: x:next-event display
Removes and returns the first event from the event queue. If the
event queue is empty, `X:Next-Event' flushes the output buffer and
blocks until an event is received.
- - Function: x:peek-event display
+ -- Function: x:peek-event display
Returns the first event from the event queue, but it does not
remove the event from the queue. If the queue is empty,
`X:Peek-Event' flushes the output buffer and blocks until an event
@@ -1711,7 +1711,7 @@ Both of these routines return an object of type "event".
Each event object has fields dependent on its sub-type.
- - Function: x:event-ref event field-name
+ -- Function: x:event-ref event field-name
window The window on which EVENT was generated
and is referred to as the event window.
root is the event window's root window.
@@ -1921,168 +1921,181 @@ Procedure and Macro Index
This is an alphabetical list of all the procedures and macros in
Xlibscm.
+
* Menu:
-* hostname:number.screen-number: Display and Screens.
-* x:alloc-colormap-cells: Colormap.
-* x:ccc: Colormap.
-* x:clear-area: Rendering.
-* x:close <1>: Windows and Pixmaps.
-* x:close: Display and Screens.
-* x:color-ref: Colormap.
-* X:Color-Set!: Colormap.
-* x:colormap-find-color: Colormap.
-* x:copy-colormap-and-free: Colormap.
-* x:copy-gc-fields!: Graphics Context.
-* x:create-colormap: Colormap.
-* x:create-cursor: Cursor.
-* x:create-gc: Graphics Context.
-* x:create-pixmap: Windows and Pixmaps.
-* x:create-window: Windows and Pixmaps.
-* x:default-ccc: Display and Screens.
-* x:default-colormap: Display and Screens.
-* x:default-gc: Display and Screens.
-* x:default-screen: Display and Screens.
-* x:default-visual: Display and Screens.
-* x:draw-lines: Rendering.
-* x:draw-points: Rendering.
-* x:draw-segments: Rendering.
-* x:draw-string: Rendering.
-* x:event-ref: Event.
-* x:events-queued: Event.
-* x:fill-polygon: Rendering.
-* x:fill-rectangle: Rendering.
-* x:flush: Rendering.
-* x:free-colormap-cells: Colormap.
-* x:gc-ref: Graphics Context.
-* x:gc-set!: Graphics Context.
+* hostname:number.screen-number: Display and Screens. (line 18)
+* x:alloc-colormap-cells: Colormap. (line 83)
+* x:ccc: Colormap. (line 218)
+* x:clear-area: Rendering. (line 27)
+* x:close <1>: Windows and Pixmaps. (line 49)
+* x:close: Display and Screens. (line 33)
+* x:color-ref: Colormap. (line 184)
+* X:Color-Set!: Colormap. (line 191)
+* x:colormap-find-color: Colormap. (line 162)
+* x:copy-colormap-and-free: Colormap. (line 61)
+* x:copy-gc-fields!: Graphics Context. (line 25)
+* x:create-colormap: Colormap. (line 9)
+* x:create-cursor: Cursor. (line 7)
+* x:create-gc: Graphics Context. (line 13)
+* x:create-pixmap: Windows and Pixmaps. (line 39)
+* x:create-window: Windows and Pixmaps. (line 8)
+* x:default-ccc: Display and Screens. (line 88)
+* x:default-colormap: Display and Screens. (line 83)
+* x:default-gc: Display and Screens. (line 94)
+* x:default-screen: Display and Screens. (line 65)
+* x:default-visual: Display and Screens. (line 106)
+* x:draw-lines: Rendering. (line 111)
+* x:draw-points: Rendering. (line 63)
+* x:draw-segments: Rendering. (line 81)
+* x:draw-string: Rendering. (line 46)
+* x:event-ref: Event. (line 40)
+* x:events-queued: Event. (line 19)
+* x:fill-polygon: Rendering. (line 142)
+* x:fill-rectangle: Rendering. (line 41)
+* x:flush: Rendering. (line 7)
+* x:free-colormap-cells: Colormap. (line 138)
+* x:gc-ref: Graphics Context. (line 30)
+* x:gc-set!: Graphics Context. (line 18)
* x:get-window-property: Window Properties and Visibility.
-* x:image-string: Rendering.
-* x:install-colormap: Colormap.
+ (line 7)
+* x:image-string: Rendering. (line 53)
+* x:install-colormap: Colormap. (line 207)
* x:list-properties: Window Properties and Visibility.
-* x:make-visual: Display and Screens.
+ (line 15)
+* x:make-visual: Display and Screens. (line 112)
* x:map-subwindows: Window Properties and Visibility.
+ (line 60)
* x:map-window: Window Properties and Visibility.
-* x:next-event: Event.
-* x:open-display: Display and Screens.
-* x:peek-event: Event.
-* x:pending: Event.
-* x:protocol-version: Display and Screens.
-* x:q-length: Event.
-* x:read-bitmap-file: Images.
-* x:root-window: Display and Screens.
-* x:screen-black: Display and Screens.
-* x:screen-cells: Display and Screens.
-* x:screen-count: Display and Screens.
-* x:screen-depth: Display and Screens.
-* x:screen-depths: Display and Screens.
-* x:screen-dimensions: Display and Screens.
-* x:screen-size: Display and Screens.
-* x:screen-white: Display and Screens.
-* x:server-vendor: Display and Screens.
+ (line 23)
+* x:next-event: Event. (line 27)
+* x:open-display: Display and Screens. (line 7)
+* x:peek-event: Event. (line 32)
+* x:pending: Event. (line 15)
+* x:protocol-version: Display and Screens. (line 46)
+* x:q-length: Event. (line 10)
+* x:read-bitmap-file: Images. (line 7)
+* x:root-window: Display and Screens. (line 70)
+* x:screen-black: Display and Screens. (line 182)
+* x:screen-cells: Display and Screens. (line 149)
+* x:screen-count: Display and Screens. (line 62)
+* x:screen-depth: Display and Screens. (line 154)
+* x:screen-depths: Display and Screens. (line 99)
+* x:screen-dimensions: Display and Screens. (line 171)
+* x:screen-size: Display and Screens. (line 166)
+* x:screen-white: Display and Screens. (line 177)
+* x:server-vendor: Display and Screens. (line 51)
* x:unmap-subwindows: Window Properties and Visibility.
+ (line 79)
* x:unmap-window: Window Properties and Visibility.
-* x:vendor-release: Display and Screens.
-* x:visual-class: Display and Screens.
-* x:visual-geometry: Display and Screens.
-* x:window-geometry: Windows and Pixmaps.
-* x:window-geometry-set!: Windows and Pixmaps.
-* x:window-ref: Window Attributes.
-* x:window-set!: Window Attributes.
+ (line 68)
+* x:vendor-release: Display and Screens. (line 56)
+* x:visual-class: Display and Screens. (line 132)
+* x:visual-geometry: Display and Screens. (line 137)
+* x:window-geometry: Windows and Pixmaps. (line 67)
+* x:window-geometry-set!: Windows and Pixmaps. (line 88)
+* x:window-ref: Window Attributes. (line 280)
+* x:window-set!: Window Attributes. (line 7)
Variable Index
**************
This is an alphabetical list of all the global variables in Xlibscm.
+
* Menu:
-* x:CW-Back-Pixel: Window Attributes.
-* x:CW-Back-Pixmap: Window Attributes.
-* x:CW-Backing-Pixel: Window Attributes.
-* x:CW-Backing-Planes: Window Attributes.
-* x:CW-Backing-Store: Window Attributes.
-* x:CW-Bit-Gravity: Window Attributes.
-* x:CW-Border-Pixel: Window Attributes.
-* x:CW-Border-Pixmap: Window Attributes.
-* x:CW-Border-Width: Windows and Pixmaps.
-* x:CW-Colormap: Window Attributes.
-* x:CW-Cursor: Window Attributes.
-* x:CW-Dont-Propagate: Window Attributes.
-* x:CW-Event-Mask: Window Attributes.
-* x:CW-Height: Windows and Pixmaps.
-* x:CW-Override-Redirect: Window Attributes.
-* x:CW-Save-Under: Window Attributes.
-* x:CW-Sibling: Windows and Pixmaps.
-* x:CW-Stack-Mode: Windows and Pixmaps.
-* x:CW-Width: Windows and Pixmaps.
-* x:CW-Win-Gravity: Window Attributes.
-* x:CWX: Windows and Pixmaps.
-* x:CWY: Windows and Pixmaps.
-* x:GC-Arc-Mode: Graphics Context.
-* x:GC-Background: Graphics Context.
-* x:GC-Cap-Style: Graphics Context.
-* x:GC-Clip-Mask: Graphics Context.
-* x:GC-Clip-X-Origin: Graphics Context.
-* x:GC-Clip-Y-Origin: Graphics Context.
-* x:GC-Dash-List: Graphics Context.
-* x:GC-Dash-Offset: Graphics Context.
-* x:GC-Fill-Rule: Graphics Context.
-* x:GC-Fill-Style: Graphics Context.
-* x:GC-Font: Graphics Context.
-* x:GC-Foreground: Graphics Context.
-* x:GC-Function: Graphics Context.
-* x:GC-Graphics-Exposures: Graphics Context.
-* x:GC-Join-Style: Graphics Context.
-* x:GC-Line-Style: Graphics Context.
-* x:GC-Line-Width: Graphics Context.
-* x:GC-Plane-Mask: Graphics Context.
-* x:GC-Stipple: Graphics Context.
-* x:GC-Subwindow-Mode: Graphics Context.
-* x:GC-Tile: Graphics Context.
-* x:GC-Tile-Stip-X-Origin: Graphics Context.
-* x:GC-Tile-Stip-Y-Origin: Graphics Context.
+* x:CW-Back-Pixel: Window Attributes. (line 29)
+* x:CW-Back-Pixmap: Window Attributes. (line 19)
+* x:CW-Backing-Pixel: Window Attributes. (line 138)
+* x:CW-Backing-Planes: Window Attributes. (line 137)
+* x:CW-Backing-Store: Window Attributes. (line 108)
+* x:CW-Bit-Gravity: Window Attributes. (line 46)
+* x:CW-Border-Pixel: Window Attributes. (line 42)
+* x:CW-Border-Pixmap: Window Attributes. (line 35)
+* x:CW-Border-Width: Windows and Pixmaps. (line 112)
+* x:CW-Colormap: Window Attributes. (line 251)
+* x:CW-Cursor: Window Attributes. (line 269)
+* x:CW-Dont-Propagate: Window Attributes. (line 240)
+* x:CW-Event-Mask: Window Attributes. (line 182)
+* x:CW-Height: Windows and Pixmaps. (line 100)
+* x:CW-Override-Redirect: Window Attributes. (line 154)
+* x:CW-Save-Under: Window Attributes. (line 168)
+* x:CW-Sibling: Windows and Pixmaps. (line 119)
+* x:CW-Stack-Mode: Windows and Pixmaps. (line 123)
+* x:CW-Width: Windows and Pixmaps. (line 99)
+* x:CW-Win-Gravity: Window Attributes. (line 47)
+* x:CWX: Windows and Pixmaps. (line 97)
+* x:CWY: Windows and Pixmaps. (line 98)
+* x:GC-Arc-Mode: Graphics Context. (line 348)
+* x:GC-Background: Graphics Context. (line 92)
+* x:GC-Cap-Style: Graphics Context. (line 153)
+* x:GC-Clip-Mask: Graphics Context. (line 309)
+* x:GC-Clip-X-Origin: Graphics Context. (line 304)
+* x:GC-Clip-Y-Origin: Graphics Context. (line 305)
+* x:GC-Dash-List: Graphics Context. (line 339)
+* x:GC-Dash-Offset: Graphics Context. (line 322)
+* x:GC-Fill-Rule: Graphics Context. (line 228)
+* x:GC-Fill-Style: Graphics Context. (line 190)
+* x:GC-Font: Graphics Context. (line 281)
+* x:GC-Foreground: Graphics Context. (line 91)
+* x:GC-Function: Graphics Context. (line 42)
+* x:GC-Graphics-Exposures: Graphics Context. (line 299)
+* x:GC-Join-Style: Graphics Context. (line 174)
+* x:GC-Line-Style: Graphics Context. (line 137)
+* x:GC-Line-Width: Graphics Context. (line 100)
+* x:GC-Plane-Mask: Graphics Context. (line 70)
+* x:GC-Stipple: Graphics Context. (line 259)
+* x:GC-Subwindow-Mode: Graphics Context. (line 284)
+* x:GC-Tile: Graphics Context. (line 258)
+* x:GC-Tile-Stip-X-Origin: Graphics Context. (line 272)
+* x:GC-Tile-Stip-Y-Origin: Graphics Context. (line 273)
This is an alphabetical list of concepts introduced in this manual.
Concept Index
*************
+
* Menu:
-* colormap: Colormap.
-* cursor: Cursor.
-* depth: Display and Screens.
-* drawable: Drawables.
-* Drawable: Drawables.
+* colormap: Colormap. (line 6)
+* cursor: Cursor. (line 7)
+* depth: Display and Screens. (line 161)
+* drawable: Drawables. (line 6)
+* Drawable: Drawables. (line 6)
* map: Window Properties and Visibility.
+ (line 18)
* mapped: Window Properties and Visibility.
-* none: Graphics Context.
-* RGB: Colormap.
+ (line 18)
+* none: Graphics Context. (line 311)
+* RGB: Colormap. (line 6)
* unmap: Window Properties and Visibility.
+ (line 18)
* unmapped: Window Properties and Visibility.
-* Visual: Display and Screens.
-* visual: Display and Screens.
-* X: Xlibscm.
-* x:None: Graphics Context.
-* Xlib: Xlibscm.
+ (line 18)
+* Visual: Display and Screens. (line 110)
+* visual: Display and Screens. (line 110)
+* X: Xlibscm. (line 6)
+* x:None: Graphics Context. (line 311)
+* Xlib: Xlibscm. (line 10)

Tag Table:
Node: Top215
Node: Xlibscm1330
-Node: Display and Screens4120
-Node: Drawables11105
-Node: Windows and Pixmaps11366
-Node: Window Attributes18445
-Node: Window Properties and Visibility34425
-Node: Graphics Context38882
-Node: Cursor54589
-Node: Colormap57092
-Node: Rendering66958
-Node: Images74515
-Node: Event74656
-Node: Index89131
+Node: Display and Screens4124
+Node: Drawables11166
+Node: Windows and Pixmaps11431
+Node: Window Attributes18533
+Node: Window Properties and Visibility34538
+Node: Graphics Context39010
+Node: Cursor54750
+Node: Colormap57261
+Node: Rendering67157
+Node: Images74737
+Node: Event74883
+Node: Index89368

End Tag Table
diff --git a/Xlibscm.texi b/Xlibscm.texi
index 9ecaee1..356877c 100644
--- a/Xlibscm.texi
+++ b/Xlibscm.texi
@@ -54,7 +54,7 @@ by the author.
This manual documents the X - SCM Language X Interface. The most recent
information about SCM can be found on SCM's @dfn{WWW} home page:
-@center @url{http://swissnet.ai.mit.edu/~jaffer/SCM}
+@center @url{http://swiss.csail.mit.edu/~jaffer/SCM}
Copyright (C) 1990-1999 Free Software Foundation
@@ -126,7 +126,7 @@ dynamic linking, compiled separately and loaded with @code{(require
@noindent
The most recent information about SCM can be found on SCM's @dfn{WWW}
home page:
-@center @url{http://swissnet.ai.mit.edu/~jaffer/SCM}
+@center @url{http://swiss.csail.mit.edu/~jaffer/SCM}
@end iftex
Much of this X documentation is dervied from:
diff --git a/build b/build
index dd43759..450726d 100755
--- a/build
+++ b/build
@@ -1,5 +1,5 @@
#! /bin/sh
-:;exec ./scmlit -no-init-file -f $0 -e"(bi)" build $*
+:;exec ./scmlit -no-init-file -f $0 -e"(bi)" build "$@"
(require 'getopt)
(require 'getopt-parameters)
@@ -54,7 +54,7 @@ Revised^5 Report on the Algorithmic Language Scheme and the IEEE P1178
specification. SCM runs under Amiga, Atari-ST, MacOS, MS-DOS, OS/2,
NOS/VE, Unicos, VMS, Unix and similar systems.
-@center @url{http://swissnet.ai.mit.edu/~jaffer/SCM}
+@center @url{http://swiss.csail.mit.edu/~jaffer/SCM}
@section Manifest
"
diff --git a/build.bat b/build.bat
index d914f05..3478188 100755
--- a/build.bat
+++ b/build.bat
@@ -1,4 +1,4 @@
-scmlit -fbuild -e(bi) build %1 %2 %3 %4 %5 %6 %7 %8 %9
+scmlit -fbuild -e(bi) build %*
@IF NOT ERRORLEVEL 1 GOTO ok
@ECHO **** build.bat FAILED! ****
:ok
diff --git a/build.scm b/build.scm
index 0c66ccc..a467a52 100644
--- a/build.scm
+++ b/build.scm
@@ -1,5 +1,5 @@
;; "build.scm" Build database and program -*-scheme-*-
-;; Copyright (C) 1994-2003 Aubrey Jaffer.
+;; Copyright (C) 1994-2004 Aubrey Jaffer.
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -58,9 +58,9 @@
((documentation string))
((documentation "documentation")
(platform-specific "required for certain platforms")
- (required "required for building executable SCM")
+ (core "core for building executable SCM")
(optional "required for some feature")
- (linkable "required and can be dynamically linked")
+ (linkable "can be statically or dynamically linked for some feature")
(test "test SCM")
(none "no files")))
@@ -81,38 +81,38 @@
("pi.scm" Scheme test "computes digits of pi [type (pi 100 5)]. Test performance against pi.c.")
("pi.c" c-source test "computes digits of pi [cc -o pi pi.c;time pi 100 5].")
("bench.scm" Scheme test "computes and records performance statistics of pi.scm.")
- ("Makefile" Makefile required "builds SCMLIT using the `make' program.")
- ("build.scm" Scheme required "database for compiling and linking new SCM programs.")
+ ("Makefile" Makefile core "builds SCMLIT using the `make' program.")
+ ("build.scm" Scheme core "database for compiling and linking new SCM programs.")
("build.bat" MS-DOS-batch platform-specific "invokes build.scm for MS-DOS")
- ("mkimpcat.scm" Scheme required "build SCM-specific catalog for SLIB.")
+ ("mkimpcat.scm" Scheme core "build SCM-specific catalog for SLIB.")
(".gdbinit" gdb-init optional "provides commands for debugging SCM with GDB")
("setjump.mar" Vax-asm platform-specific "provides setjump and longjump which do not use $unwind utility on VMS.")
("ugsetjump.s" gnu-as platform-specific "provides setjump and longjump which work on Ultrix VAX.")
("setjump.s" Cray-asm platform-specific "provides setjump and longjump for the Cray YMP.")
- ("Init.scm" Scheme required "Scheme initialization.")
- ("Transcen.scm" Scheme required "inexact builtin procedures.")
- ("Link.scm" Scheme required "Dynamic link/loading.")
- ("compile.scm" Scheme required "Hobbit compilation to C.")
- ("Macro.scm" Scheme required "Supports Syntax-Rules Macros.")
- ("scmfig.h" c-header required "contains system dependent definitions.")
- ("patchlvl.h" c-header required "patchlevel of this release.")
- ("setjump.h" c-header required "continuations, stacks, and memory allocation.")
- ("continue.h" c-header required "continuations.")
- ("continue.c" c-source required "continuations.")
- ("scm.h" c-header required "data type and external definitions of SCM.")
- ("scm.c" c-source required "initialization, interrupts, and non-IEEE utility functions.")
- ("scmmain.c" c-source required "initialization, interrupts, and non-IEEE utility functions.")
- ("findexec.c" c-source required "find the executable file function.")
- ("script.c" c-source required "utilities for running as `#!' script.")
- ("time.c" c-source required "functions dealing with time.")
- ("repl.c" c-source required "error, read-eval-print loop, read, write and load.")
- ("scl.c" c-source required "inexact arithmetic")
- ("eval.c" c-source required "evaluator, apply, map, and foreach.")
- ("sys.c" c-source required "call-with-current-continuation, opening and closing files, storage allocation and garbage collection.")
- ("subr.c" c-source required "the rest of IEEE functions.")
- ("debug.c" c-source required "debugging, printing code.")
- ("unif.c" c-source required "uniform vectors.")
- ("rope.c" c-source required "C interface functions.")
+ ("Init.scm" Scheme core "Scheme initialization.")
+ ("Transcen.scm" Scheme core "inexact builtin procedures.")
+ ("Link.scm" Scheme core "Dynamic link/loading.")
+ ("compile.scm" Scheme core "Hobbit compilation to C.")
+ ("Macro.scm" Scheme core "Supports Syntax-Rules Macros.")
+ ("scmfig.h" c-header core "contains system dependent definitions.")
+ ("patchlvl.h" c-header core "patchlevel of this release.")
+ ("setjump.h" c-header core "continuations, stacks, and memory allocation.")
+ ("continue.h" c-header core "continuations.")
+ ("continue.c" c-source core "continuations.")
+ ("scm.h" c-header core "data type and external definitions of SCM.")
+ ("scm.c" c-source core "initialization, interrupts, and non-IEEE utility functions.")
+ ("scmmain.c" c-source core "initialization, interrupts, and non-IEEE utility functions.")
+ ("findexec.c" c-source core "find the executable file function.")
+ ("script.c" c-source core "utilities for running as `#!' script.")
+ ("time.c" c-source core "functions dealing with time.")
+ ("repl.c" c-source core "error, read-eval-print loop, read, write and load.")
+ ("scl.c" c-source core "inexact arithmetic")
+ ("eval.c" c-source core "evaluator, apply, map, and foreach.")
+ ("sys.c" c-source core "call-with-current-continuation, opening and closing files, storage allocation and garbage collection.")
+ ("subr.c" c-source core "the rest of IEEE functions.")
+ ("debug.c" c-source core "debugging, printing code.")
+ ("unif.c" c-source core "uniform vectors.")
+ ("rope.c" c-source core "C interface functions.")
("ramap.c" c-source optional "array mapping")
("dynl.c" c-source optional "dynamically load object files.")
("sc2.c" c-source linkable "procedures from R2RS and R3RS not in R4RS.")
@@ -122,6 +122,8 @@
("split.scm" Scheme test "example use of crs.c. Input, output, and diagnostic output directed to separate windows.")
("edline.c" c-source linkable "Gnu readline input editing (get ftp.sys.toronto.edu:/pub/rc/editline.shar).")
("Iedline.scm" Scheme optional "Gnu readline input editing.")
+ ("differ.c" c-source linkable "Linear-space O(PN) sequence comparison.")
+ ("Idiffer.scm" Scheme optional "Linear-space O(PN) sequence comparison.")
("record.c" c-source linkable "proposed `Record' user definable datatypes.")
("gsubr.c" c-source linkable "make_gsubr for arbitrary (< 11) arguments to C functions.")
("ioext.c" c-source linkable "system calls in common between PC compilers and unix.")
@@ -146,9 +148,9 @@
(o-proc symbol)
(spec expression)
(documentation string))
- ((exe required compile-c-files link-c-program #f
+ ((exe core compile-c-files link-c-program #f
"executable program")
- (lib required compile-c-files make-archive ((c-lib lib))
+ (lib core compile-c-files make-archive ((c-lib lib))
"library module")
(dlls linkable compile-dll-c-files make-dll-archive ((define "DLL"))
"archived dynamically linked library object files")
@@ -356,7 +358,8 @@
'regex
'((c-file "rgx.c") (c-lib regex) (compiled-init "init_rgx")))
-#;BSD @dfn{socket} interface.
+#;BSD @dfn{socket} interface. Socket addr functions require
+#;inexacts or bignums for 32-bit precision.
(define-build-feature
'socket
'((c-lib socket) (c-file "socket.c") (compiled-init "init_socket")))
@@ -374,6 +377,11 @@
'unix
'((c-file "unix.c") (compiled-init "init_unix")))
+#;Sequence comparison
+(define-build-feature
+ 'differ
+ '((c-file "differ.c") (compiled-init "init_differ")))
+
#;Microsoft Windows executable.
(define-build-feature
'windows
@@ -414,6 +422,14 @@
'cheap-continuations
'((define "CHEAP_CONTINUATIONS")))
+#;WB database with relational wrapper.
+(define-build-feature
+ 'wb
+ '((c-file "../wb/blink.c" "../wb/blkio.c" "../wb/del.c" "../wb/ent.c"
+ "../wb/handle.c" "../wb/prev.c" "../wb/scan.c" "../wb/stats.c"
+ "../wb/wbsys.c" "../wb/db.c")
+ (scm-srcdir "../scm/")
+ (compiled-init "init_db")))
;;;; The rest is about building on specific platforms.
@@ -519,7 +535,8 @@
(m gnu-win32 "" "" "" () ())
(c gnu-win32 "" "" "" () ())
- (dlll gnu-win32 "-DSCM_DLL" "" #f () ("posix.c" "unix.c" "socket.c"))
+ (dlll gnu-win32 "-DSCM_WIN_DLL" "" #f () ("posix.c" "unix.c" "socket.c"))
+
(m linux-aout "" "-lm" "/usr/lib/libm.sa" () ())
(c linux-aout "" "-lc" "/usr/lib/libc.sa" () ())
(dlll linux-aout "-DDLD -DDLD_DYNCM" "-ldld" #f () ("findexec.c"))
@@ -599,7 +616,7 @@
(m microsoft-c "" "" #f () ())
(c microsoft-c-nt "" "" #f () ("findexec.c"))
(m microsoft-c-nt "" "" #f () ())
- (dlll microsoft-c-nt "-DSCM_DLL -MD" "" #f () ("posix.c" "unix.c" "socket.c"))
+ (dlll microsoft-c-nt "-DSCM_WIN_DLL -MD" "" #f () ("posix.c" "unix.c" "socket.c"))
(debug microsoft-c-nt "-Zi" "/debug" #f () ())
(c microsoft-quick-c "" "" #f () ("findexec.c"))
(m microsoft-quick-c "" "" #f () ())
@@ -625,7 +642,7 @@
(c freebsd "" "-export-dynamic" #f () ())
(m freebsd "" "-lm" #f () ())
(curses freebsd "" "-lncurses" "/usr/lib/libncurses.a" () ())
- (regex freebsd "" "-lgnuregex" "" () ())
+ (regex freebsd "-I/usr/include/gnu" "-lgnuregex" "" () ())
(editline freebsd "" "-lreadline" "" () ())
(dlll freebsd "-DSUN_DL" "-export-dynamic" "" () ())
(nostart freebsd "" "-e start -dc -dp -Bstatic -lgnumalloc" #f ("pre-crt0.c") ())
@@ -635,7 +652,9 @@
(graphics netbsd "-I/usr/X11R6/include -DX11" "-lX11" "-Wl,-rpath -Wl,/usr/X11R6/lib -L/usr/X11R6/lib" () ())
(m netbsd "" "-lm" #f () ())
(m openbsd "" "-lm" #f () ())
+ (dlll openbsd "-DSUN_DL" "" "" () ())
(curses openbsd "" "-lcurses" "/usr/lib/libcurses.a" () ())
+ (regex openbsd "" "" #f () ())
))
'(compile-commands
@@ -754,20 +773,16 @@
(c-includes parms)
(c-flags parms)
c-files)
- (let ((results
- (map
- (lambda (fname)
- (and (batch:try-command
- parms "link" "/dll" "/nologo"
- (string-append "/out:" fname ".dll")
- (string-append "/implib:" fname ".lib")
- fname
- (map (lambda (l) (build:lib-ld-flag l platform))
- (parameter-list-ref parms 'c-lib))
- "scm.lib")
- (string-append fname ".dll")))
- (map c-> c-files))))
- (and (apply and? results) results))))))
+ (let ((fnames (map c-> c-files)))
+ (and (batch:try-command
+ parms "link" "/dll" "/nologo"
+ (string-append "/out:" (car fnames) ".dll")
+ (string-append "/implib:" (car fnames) ".lib")
+ fnames
+ (map (lambda (l) (build:lib-ld-flag l platform))
+ (parameter-list-ref parms 'c-lib))
+ "scm.lib")
+ (list (string-append (car fnames) ".dll"))))))))
(defcommand make-dll-archive microsoft-c-nt
(lambda (oname objects libs parms) objects))
(defcommand make-archive microsoft-c-nt
@@ -955,23 +970,18 @@
(lambda (files parms)
(and (batch:try-chopped-command
parms "cc" "+O1" "-Wl,-E" "+z" "-c"
+ (include-spec "-I" parms)
(c-includes parms)
(c-flags parms)
files)
- (let ((results
- (map
- (lambda (fname)
- (batch:rename-file
- parms
- (string-append fname ".sl")
- (string-append fname ".sl~"))
- (and (batch:try-command
- parms "ld" "-b" "-o"
- (string-append fname ".sl")
- (string-append fname ".o"))
- (string-append fname ".sl")))
- (truncate-up-to (map c-> files) #\/))))
- (and (apply and? results) results)))))
+ (let ((fnames (truncate-up-to (map c-> files) #\/)))
+ (define fname.sl (string-append (car fnames) ".sl"))
+ (batch:rename-file parms fname.sl (string-append fname.sl "~"))
+ (and (batch:try-command
+ parms "ld" "-b" "-o"
+ fname.sl
+ (map (lambda (fname) (string-append fname ".o")) fnames))
+ (list fname.sl))))))
; (make-dll-archive HP-UX
; (lambda (oname objects libs parms)
; (and (batch:try-command
@@ -994,6 +1004,7 @@
(and (batch:try-chopped-command
parms
"gcc" "-c"
+ (include-spec "-I" parms)
(c-includes parms)
(c-flags parms)
files)
@@ -1018,28 +1029,24 @@
(lambda (files parms)
(and
(batch:try-chopped-command
- parms
- "gcc" "-fpic" "-c" (c-includes parms)
- (c-flags parms)
- files)
+ parms "gcc" "-fpic" "-c"
+ (include-spec "-I" parms) (c-includes parms) (c-flags parms) files)
(let* ((platform (car (parameter-list-ref parms 'platform)))
- (ld-opts
- (map (lambda (l) (build:lib-ld-flag l platform))
- (parameter-list-ref parms 'c-lib)))
- (results
- (map
- (lambda (fname)
- (and (batch:try-command
- parms
- "gcc" "-shared" "-o"
- (string-append fname ".so")
- (string-append fname ".o")
- ld-opts)
- (batch:delete-file
- parms (string-append fname ".o"))
- (string-append fname ".so")))
- (truncate-up-to (map c-> files) #\/))))
- (and (apply and? results) results)))))
+ (fnames (truncate-up-to (map c-> files) #\/))
+ (fname.so (string-append (car fnames) ".so"))
+ (result
+ (and (batch:try-command
+ parms
+ "gcc" "-shared" "-o" fname.so
+ (map (lambda (fname) (string-append fname ".o")) fnames)
+ (map (lambda (l) (build:lib-ld-flag l platform))
+ (parameter-list-ref parms 'c-lib)))
+ (list fname.so))))
+ (for-each (lambda (fname)
+ (batch:delete-file
+ parms (string-append fname ".o")))
+ fnames)
+ result))))
(defcommand make-dll-archive linux
(lambda (oname objects libs parms)
(let ((platform (car (parameter-list-ref
@@ -1135,6 +1142,7 @@
(lambda (files parms)
(and (batch:try-chopped-command parms
"gcc" "-c"
+ (include-spec "-I" parms)
(c-includes parms)
(c-flags parms)
files)
@@ -1160,27 +1168,20 @@
(define c-files (remove-if (lambda (file) (member file suppressors))
files))
(and (batch:try-chopped-command
- parms
- "gcc" "-c"
- (include-spec "-I" parms)
- (c-includes parms)
- (c-flags parms)
- c-files)
- (let ((results
- (map
- (lambda (fname)
- (and (batch:try-command
- parms "dllwrap"
- "--output-lib" (string-append fname ".lib")
- "-dllname" (string-append fname ".dll")
- "--output-def" (string-append fname ".def")
- (string-append fname ".o")
- (map (lambda (l) (build:lib-ld-flag l platform))
- (parameter-list-ref parms 'c-lib))
- "scm.lib")
- (string-append fname ".dll")))
- (map c-> c-files))))
- (and (apply and? results) results))))))
+ parms "gcc" "-c" (include-spec "-I" parms)
+ (c-includes parms) (c-flags parms) c-files)
+ (let ((fnames (map c-> c-files)))
+ (and (batch:try-command
+ parms "dllwrap"
+ "--output-lib" (string-append (car fnames) ".lib")
+ "-dllname" (string-append (car fnames) ".dll")
+ "--output-def" (string-append (car fnames) ".def")
+ (map (lambda (fname) (string-append fname ".o"))
+ fnames)
+ (map (lambda (l) (build:lib-ld-flag l platform))
+ (parameter-list-ref parms 'c-lib))
+ "scm.lib")
+ (list (string-append (car fnames) ".dll"))))))))
(defcommand make-dll-archive gnu-win32
(lambda (oname objects libs parms) objects))
(defcommand make-archive gnu-win32
@@ -1231,25 +1232,19 @@
(lambda (files parms)
(and
(batch:try-chopped-command
- parms "cc" "-std1" "-c" (c-includes parms) (c-flags parms) files)
+ parms "cc" "-std1" "-c" (c-includes parms)
+ (include-spec "-I" parms) (c-flags parms) files)
(let* ((platform (car (parameter-list-ref parms 'platform)))
- (ld-opts
+ (fnames (truncate-up-to (map c-> files) #\/)))
+ (and (batch:try-command
+ parms "cc" "-shared" "-o" (string-append (car fnames) ".so")
+ (map (lambda (fname) (string-append fname ".o")) fnames)
(map (lambda (l) (build:lib-ld-flag l platform))
(parameter-list-ref parms 'c-lib)))
- (results
- (map
- (lambda (fname)
- (and (batch:try-command
- parms
- "cc" "-shared" "-o"
- (string-append fname ".so")
- (string-append fname ".o")
- ld-opts)
- (batch:delete-file
- parms (string-append fname ".o"))
- (string-append fname ".so")))
- (truncate-up-to (map c-> files) #\/))))
- (and (apply and? results) results)))))
+ (for-each (lambda (fname)
+ (batch:delete-file parms (string-append fname ".o")))
+ fnames)
+ (list (string-append (car fnames) ".so")))))))
(defcommand make-dll-archive osf1
(lambda (oname objects libs parms)
(let ((platform (car (parameter-list-ref
@@ -1292,30 +1287,20 @@
(defcommand compile-dll-c-files svr4-gcc-sun-ld
(lambda (files parms)
(and
- (batch:try-chopped-command
- parms
- "gcc"
- "-fpic" "-c" (c-includes parms)
- (c-flags parms)
- files)
+ (batch:try-chopped-command parms "gcc" "-fpic" "-c"
+ (include-spec "-I" parms)
+ (c-includes parms) (c-flags parms) files)
(let* ((platform (car (parameter-list-ref parms 'platform)))
- (ld-opts
+ (fnames (truncate-up-to (map c-> files) #\/)))
+ (and (batch:try-command
+ parms "ld" "-G" "-o" (string-append (car fnames) ".so")
+ (map (lambda (fname) (string-append fname ".o")) fnames)
(map (lambda (l) (build:lib-ld-flag l platform))
(parameter-list-ref parms 'c-lib)))
- (results
- (map
- (lambda (fname)
- (and (batch:try-command
- parms
- "ld" "-G" "-o"
- (string-append fname ".so")
- (string-append fname ".o")
- ld-opts)
- (batch:delete-file
- parms (string-append fname ".o"))
- (string-append fname ".so")))
- (truncate-up-to (map c-> files) #\/))))
- (and (apply and? results) results)))))
+ (for-each (lambda (fname)
+ (batch:delete-file parms (string-append fname ".o")))
+ fnames)
+ (list (string-append (car fnames) ".so")))))))
(defcommand compile-c-files svr4
(lambda (files parms)
@@ -1569,6 +1554,7 @@
(lambda (files parms)
(and (batch:try-chopped-command parms
"cc" "-c"
+ (include-spec "-I" parms)
(c-includes parms)
(c-flags parms)
files)
@@ -1588,6 +1574,8 @@
(lambda (files parms)
(and (batch:try-chopped-command
parms
+;;; gcc 3.4.2 for FreeBSD does not allow options other than default i.e. -O0 if NO -DGCC_SPARC_BUG - dai 2004-10-30
+ ;;"cc" "-O3 -pipe -DGCC_SPARC_BUG " "-c"
"cc" "-O3 -pipe " "-c"
(c-includes parms)
(c-flags parms)
@@ -1608,29 +1596,22 @@
(defcommand compile-dll-c-files freebsd
(lambda (files parms)
(and (batch:try-chopped-command
- parms
- "cc" "-O3 -pipe "
- "-fPIC" "-c" (c-includes parms)
- (c-flags parms)
- files)
- (let ((results
- (map
- (lambda (fname)
- (and (batch:try-command
- parms
- "cc" "-shared"
- (cond
- ((equal? fname "edline") "-lreadline")
- ((equal? fname "x") "-L/usr/X11R6/lib -lSM -lICE -lXext -lX11 -lxpg4")
- (else ""))
- "-o"
- (string-append fname ".so")
- (string-append fname ".o"))
- (batch:delete-file
- parms (string-append fname ".o"))
- (string-append fname ".so")))
- (truncate-up-to (map c-> files) #\/))))
- (and (apply and? results) results)))))
+ parms "cc" "-O3 -pipe " "-fPIC" "-c"
+ (c-includes parms) (c-flags parms) files)
+ (let ((fnames (truncate-up-to (map c-> files) #\/)))
+ (and (batch:try-command
+ parms "cc" "-shared"
+ (cond
+ ((equal? (car fnames) "edline") "-lreadline")
+ ((equal? (car fnames) "x") "-L/usr/X11R6/lib -lSM -lICE -lXext -lX11 -lxpg4")
+ (else ""))
+ "-o" (string-append (car fnames) ".so")
+ (map (lambda (fname) (string-append fname ".o")) fnames))
+ (for-each (lambda (fname)
+ (batch:delete-file
+ parms (string-append fname ".o")))
+ fnames)
+ (list (string-append (car fnames) ".so")))))))
(defcommand make-dll-archive freebsd
(lambda (oname objects libs parms)
(and (batch:try-command
@@ -1667,7 +1648,7 @@
(lambda (files parms)
(and (batch:try-chopped-command
parms
- "cc" "-c"
+ "cc" "-c" (include-spec "-I" parms)
(c-includes parms)
(c-flags parms)
files)
@@ -1687,23 +1668,12 @@
(defcommand compile-dll-c-files netbsd
(lambda (files parms)
(and (batch:try-chopped-command
- parms
- "cc" "-fPIC" "-c"
- (string-append
- "-I" (parameter-list-ref parms 'scm-srcdir))
- (c-includes parms)
- (c-flags parms)
- files)
+ parms "cc" "-fPIC" "-c" (include-spec "-I" parms)
+ (c-includes parms) (c-flags parms) files)
(let ((objs (map c->o files)))
- (every
- (lambda (f)
- (and (batch:try-command
- parms "gcc" "-shared" "-fPIC" f)
- (batch:try-command
- parms "mv" "a.out" f)))
- objs)
- objs))))
-
+ (and (batch:try-command parms "gcc" "-shared" "-fPIC" objs)
+ (batch:try-command parms "mv" "a.out" (car objs))
+ (list (car objs)))))))
(defcommand make-dll-archive netbsd
(lambda (oname objects libs parms)
(and (batch:try-command
@@ -1722,7 +1692,7 @@
(lambda (files parms)
(and (batch:try-chopped-command
parms
- "cc" "-c"
+ "cc" "-c" (include-spec "-I" parms)
(c-includes parms)
(c-flags parms)
files)
@@ -1737,27 +1707,17 @@
'("-nostartfiles"
"pre-crt0.o" "crt0.o"
"/usr/lib/crt0.o")
- (append libs objects)))
+ (append objects libs)))
oname)))
(defcommand compile-dll-c-files openbsd
(lambda (files parms)
(and (batch:try-chopped-command
- parms
- "cc" "-fPIC" "-c"
- (string-append
- "-I" (parameter-list-ref parms 'scm-srcdir))
- (c-includes parms)
- (c-flags parms)
- files)
+ parms "cc" "-fPIC" "-c" (include-spec "-I" parms)
+ (c-includes parms) (c-flags parms) files)
(let ((objs (map c->o files)))
- (every
- (lambda (f)
- (and (batch:try-command
- parms "gcc" "-shared" "-fPIC" f)
- (batch:try-command
- parms "mv" "a.out" f)))
- objs)
- objs))))
+ (and (batch:try-command parms "gcc" "-shared" "-fPIC" objs)
+ (batch:try-command parms "mv" "a.out" (car objs))
+ (list (car objs)))))))
(defcommand make-dll-archive openbsd
(lambda (oname objects libs parms)
@@ -1959,9 +1919,7 @@
parms (cons 'batch-dialect (list (os->batch-dialect os)))))))
(adjoin-parameters!
- parms
- (cons 'c-defines c-defines)
- (cons 'c-includes c-includes))
+ parms (cons 'c-defines c-defines) (cons 'c-includes c-includes))
(set! parms
(cons
(cons 'operating-system
@@ -1975,9 +1933,7 @@
name
(lambda (batch-port)
(define o-files #f)
- (adjoin-parameters!
- parms
- (list 'batch-port batch-port))
+ (adjoin-parameters! parms (list 'batch-port batch-port))
(let ((options-file (parameter-list-ref parms 'options-file)))
(and (not (null? options-file))
@@ -1996,17 +1952,14 @@
(let ((suppressors
(apply append
(map (lambda (l) (build:c-suppress l platform))
- (parameter-list-ref parms 'c-lib))))
- (ssdir (car (parameter-list-ref parms 'scm-srcdir))))
+ (parameter-list-ref parms 'c-lib)))))
(c-proc
- (map (lambda (file) (in-vicinity ssdir file))
- (apply
- append
- (remove-if (lambda (file) (member file suppressors))
- (parameter-list-ref parms 'c-file))
- (map
- (lambda (l) (build:c-lib-support l platform))
- (parameter-list-ref parms 'c-lib))))
+ (apply
+ append
+ (remove-if (lambda (file) (member file suppressors))
+ (parameter-list-ref parms 'c-file))
+ (map (lambda (l) (build:c-lib-support l platform))
+ (parameter-list-ref parms 'c-lib)))
parms)))
(cond
((not o-files)
diff --git a/byte.c b/byte.c
index 1ef014f..457d878 100644
--- a/byte.c
+++ b/byte.c
@@ -119,7 +119,7 @@ SCM scm_bytes_reverse(str)
ASRTER(NIMP(str) && STRINGP(str), str, ARG1, s_bt_reverse);
len = LENGTH(str);
dst = CHARS(str);
- for(k = len/2;k >= 0;k--) {
+ for(k = (len - 1)/2;k >= 0;k--) {
int tmp = dst[k];
dst[k] = dst[len - k - 1];
dst[len - k - 1] = tmp;
@@ -187,7 +187,7 @@ SCM scm_substring_read(sstr, start, args)
}
else {
long idx = start;
- while (end <= idx) {
+ while (end < idx) {
int chr = lgetc(port);
if (EOF==chr) return MAKINUM(start - idx);
CHARS(sstr)[--idx] = chr;
diff --git a/compile.scm b/compile.scm
index 1242231..2cd9170 100755
--- a/compile.scm
+++ b/compile.scm
@@ -1,5 +1,5 @@
#! /bin/sh
-:;exec scm -e"(set! *script* \"$0\")" -f$0 $*
+:;exec scm -e"(set! *script* \"$0\")" -f$0 "$@"
;; Copyright (C) 1992-2002 Free Software Foundation, Inc.
;;
@@ -64,7 +64,7 @@ Usage: compile.scm FILE1.scm FILE2.scm ...
for your computer (for instance, `.o'). FILE1.scm must be in the
current directory; FILE2.scm ... can be in other directories.
-http://swissnet.ai.mit.edu/~jaffer/SCM
+http://swiss.csail.mit.edu/~jaffer/SCM
"
(current-error-port))
#f)
diff --git a/differ.c b/differ.c
new file mode 100644
index 0000000..43b2c3f
--- /dev/null
+++ b/differ.c
@@ -0,0 +1,594 @@
+/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write to
+ * the Free Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111, USA.
+ *
+ * As a special exception, the Free Software Foundation gives permission
+ * for additional uses of the text contained in its release of SCM.
+ *
+ * The exception is that, if you link the SCM library with other files
+ * to produce an executable, this does not by itself cause the
+ * resulting executable to be covered by the GNU General Public License.
+ * Your use of that executable is in no way restricted on account of
+ * linking the SCM library code into it.
+ *
+ * This exception does not however invalidate any other reasons why
+ * the executable file might be covered by the GNU General Public License.
+ *
+ * This exception applies only to the code released by the
+ * Free Software Foundation under the name SCM. If you copy
+ * code from other Free Software Foundation releases into a copy of
+ * SCM, as the General Public License permits, the exception does
+ * not apply to the code that you add in this way. To avoid misleading
+ * anyone as to the status of such modified files, you must delete
+ * this exception notice from them.
+ *
+ * If you write modifications of your own for SCM, it is your choice
+ * whether to permit this exception to apply to your modifications.
+ * If you do not wish that, delete this exception notice.
+ */
+
+/* "differ.c" Linear-space O(NP) sequence comparison. */
+/* Author: Aubrey Jaffer */
+
+#include <stdlib.h>
+/* #include <stdio.h> */
+
+#include "scm.h"
+
+SCM_EXPORT SCM array_dims P((SCM ra));
+
+typedef int (*int_function) ();
+
+typedef struct {
+ void* (*subarray) ();
+ int_function array_refsEql_P;
+ int_function array_refs_revEql_P;
+} fp_procs;
+
+int fp_compare(int *fp,int fpoff,int *cc,void *a,int m,void *b,int n,int_function array_refsEql_P,int p_lim);
+
+int fp_run(int *fp,int fpoff,int k,void *a,int m,void *b,int n,int_function array_refsEql_P,int *cc,int p);
+
+int diff_mid_split(int m,int n,int *rr,int *cc,int cost);
+
+void fp_init(int *fp,int fpoff,int fill,int mindx,int maxdx);
+
+int diff_divide_and_conquer(int *fp,int fpoff,int *ccrr,void *a,int start_a,int end_a,void *b,int start_b,int end_b,int *edits,int edx,int epo,fp_procs *procs,int p_lim);
+
+int diff2et(int *fp,int fpoff,int *ccrr,void *a,int start_a,int end_a,void *b,int start_b,int end_b,int *edits,int edx,int epo,fp_procs *procs,int p_lim);
+
+int diff2ez(int *fp,int fpoff,int *ccrr,void *a,int start_a,int end_a,void *b,int start_b,int end_b,int *edits,int edx,int epo,fp_procs *procs,int p_lim);
+
+void check_cost(unsigned char *name,int est,int cost);
+
+SCM_EXPORT SCM diff2edits P((SCM Edits, SCM Fp, SCM Args));
+
+SCM_EXPORT SCM diff2editlen P((SCM Fp, SCM A, SCM Args));
+
+# define MAX(a,b) (a<b ? b : a)
+# define MIN(a,b) (a>b ? b : a)
+
+long *long_subarray(ra, start, end)
+ long *ra; int start, end;
+{
+ return &(ra[start]);
+}
+short *short_subarray(ra, start, end)
+ short *ra; int start, end;
+{
+ return &(ra[start]);
+}
+char *char_subarray(ra, start, end)
+ char *ra; int start, end;
+{
+ return &(ra[start]);
+}
+
+long long_array_refsEql_P(a, x, m, b, y, n)
+ long *a; int x, m; long *b; int y, n;
+{
+ return (a[x])==(b[y]);
+}
+long long_array_refs_revEql_P(a, x, m, b, y, n)
+ long *a; int x, m; long *b; int y, n;
+{
+/* if (x > m) printf("long x(%d) > m(%d)\n", x, m); */
+/* if (y > n) printf("long y(%d) > n(%d)\n", y, n); */
+ return a[(m)-(x)-1]==b[(n)-(y)-1];
+}
+short short_array_refsEql_P(a, x, m, b, y, n)
+ short *a; int x, m; short *b; int y, n;
+{
+ return (a[x])==(b[y]);
+}
+short short_array_refs_revEql_P(a, x, m, b, y, n)
+ short *a; int x, m; short *b; int y, n;
+{
+/* if (x > m) printf("short x(%d) > m(%d)\n", x, m); */
+/* if (y > n) printf("short y(%d) > n(%d)\n", y, n); */
+ return a[(m)-(x)-1]==b[(n)-(y)-1];
+}
+char char_array_refsEql_P(a, x, m, b, y, n)
+ char *a; int x, m; char *b; int y, n;
+{
+ return (a[x])==(b[y]);
+}
+char char_array_refs_revEql_P(a, x, m, b, y, n)
+ char *a; int x, m; char *b; int y, n;
+{
+/* if (x > m) printf("char x(%d) > m(%d)\n", x, m); */
+/* if (y > n) printf("char y(%d) > n(%d)\n", y, n); */
+ return a[(m)-(x)-1]==b[(n)-(y)-1];
+}
+
+fp_procs long_procs =
+ {long_subarray, long_array_refsEql_P, long_array_refs_revEql_P};
+fp_procs short_procs =
+ {short_subarray, short_array_refsEql_P, short_array_refs_revEql_P};
+fp_procs char_procs =
+ {char_subarray, char_array_refsEql_P, char_array_refs_revEql_P};
+
+int fp_compare(fp, fpoff, cc, a, m, b, n, array_refsEql_P, p_lim)
+ int *fp;
+ int fpoff;
+ int *cc;
+ void *a;
+ int m;
+ void *b;
+ int n;
+ int_function array_refsEql_P;
+ int p_lim;
+{
+ int delta = (n)-(m);
+ {
+ int p = 0;
+L_loop:
+ {
+ int k = -(p);
+ while (!((k)>=(delta))) {
+ fp_run(fp, fpoff, k, a, m, b, n, array_refsEql_P, cc, p);
+ {
+ k = 1+(k);
+ }
+ }
+ }
+ {
+ int k = (delta)+(p);
+ while (!((k)<=(delta))) {
+ fp_run(fp, fpoff, k, a, m, b, n, array_refsEql_P, cc, p);
+ {
+ k = -1+(k);
+ }
+ }
+ }
+ {
+ int fpval = fp_run(fp, fpoff, delta, a, m, b, n, array_refsEql_P, cc, p);
+ if ((!(cc))
+ && ((n)<=(fpval)))
+ return (delta)+(2*(p));
+ else if ((!(0 > (p_lim)))
+ && ((p)>=(p_lim)))
+ return -1;
+ else {
+ p = 1+(p);
+ goto L_loop;
+ }
+ }
+ }
+}
+
+/* Traces runs of matches until they end; then set fp[k]=y. */
+/* If CC is supplied, set each CC[y] = MIN(CC[y], cost) for run. */
+/* Returns furthest y reached. */
+
+int fp_run(fp, fpoff, k, a, m, b, n, array_refsEql_P, cc, p)
+ int *fp;
+ int fpoff;
+ int k;
+ void *a;
+ int m;
+ void *b;
+ int n;
+ int_function array_refsEql_P;
+ int *cc;
+ int p;
+{
+ int cost = (k)+(p)+(p);
+ {
+ int y = MAX((fp[ -1+(k)+(fpoff)])+1, fp[1+(k)+(fpoff)]);
+L_snloop:
+ {
+ int x = (y)-(k);
+ if ((cc)
+ && ((y)<=(n)))
+ {
+ int xcst = (m)-(x);
+ if (0 > (xcst))
+ ;
+ else cc[y] = MIN((xcst)+(cost), cc[y]);
+ }
+ if (((x)<(m))
+ && ((y)<(n))
+ && (array_refsEql_P(a, x, m, b, y, n)))
+ {
+ y = 1+(y);
+ goto L_snloop;
+ }
+ else {
+ fp[(fpoff)+(k)] = y;
+ return y;
+ }
+ }
+ }
+}
+
+int diff_mid_split(m, n, rr, cc, cost)
+ int m;
+ int n;
+ int *rr;
+ int *cc;
+ int cost;
+{
+ {
+ int cdx = 1+((n)/2);
+ int rdx = (n)/2;
+L_loop:
+ if ((cost)==((cc[rdx])+(rr[(n)-(rdx)])))
+ return rdx;
+ else if ((cost)==((cc[cdx])+(rr[(n)-(cdx)])))
+ return cdx;
+ else {
+ cdx = 1+(cdx);
+ rdx = -1+(rdx);
+ goto L_loop;
+ }
+ }
+}
+
+
+void fp_init(fp, fpoff, fill, mindx, maxdx)
+ int *fp;
+ int fpoff;
+ int fill;
+ int mindx;
+ int maxdx;
+{
+ int mlim = (fpoff)+(mindx);
+ {
+ int idx = (fpoff)+(maxdx);
+ while (!((idx)<(mlim))) {
+ fp[idx] = fill;
+ {
+ idx = -1+(idx);
+ }
+ }
+ }
+}
+
+/* Split A[start-a..end-a] (shorter array) into smaller and smaller chunks. */
+/* EDX is index into EDITS. */
+/* EPO is insert/delete polarity (+1 or -1) */
+
+int diff_divide_and_conquer(fp, fpoff, ccrr, a, start_a, end_a, b, start_b, end_b, edits, edx, epo, procs, p_lim)
+ int *fp;
+ int fpoff;
+ int *ccrr;
+ void *a;
+ int start_a;
+ int end_a;
+ void *b;
+ int start_b;
+ int end_b;
+ int *edits;
+ int edx;
+ int epo;
+ fp_procs *procs;
+ int p_lim;
+{
+ int mid_a = ((start_a)+(end_a))/2;
+ int len_b = (end_b)-(start_b);
+ int len_a = (end_a)-(start_a);
+ {
+ int tcst = (p_lim)+(p_lim)+((len_b)-(len_a));
+ int *cc = &(ccrr[0]);
+ int *rr = &(ccrr[(len_b)+1]);
+ int m2 = (end_a)-(mid_a);
+ int m1 = (mid_a)-(start_a);
+ fp_init(cc, 0, (len_a)+(len_b), 0, len_b);
+ fp_init(fp, fpoff, -1, -(1+(p_lim)), 1+(p_lim)+((len_b)-(m1)));
+ fp_compare(fp, fpoff, cc, procs->subarray(a, start_a, mid_a), m1, procs->subarray(b, start_b, end_b), len_b, procs->array_refsEql_P, MIN(p_lim, len_a));
+ fp_init(rr, 0, (len_a)+(len_b), 0, len_b);
+ fp_init(fp, fpoff, -1, -(1+(p_lim)), 1+(p_lim)+((len_b)-(m2)));
+ fp_compare(fp, fpoff, rr, procs->subarray(a, mid_a, end_a), m2, procs->subarray(b, start_b, end_b), len_b, procs->array_refs_revEql_P, MIN(p_lim, len_a));
+ {
+ int b_splt = diff_mid_split(len_a, len_b, rr, cc, tcst);
+ int est_c = cc[b_splt];
+ int est_r = rr[(len_b)-(b_splt)];
+ check_cost("cc", est_c, diff2et(fp, fpoff, ccrr, a, start_a, mid_a, b, start_b, (start_b)+(b_splt), edits, edx, epo, procs, ((est_c)-((b_splt)-((mid_a)-(start_a))))/2));
+ check_cost("rr", est_r, diff2et(fp, fpoff, ccrr, a, mid_a, end_a, b, (start_b)+(b_splt), end_b, edits, (est_c)+(edx), epo, procs, ((est_r)-(((len_b)-(b_splt))-((end_a)-(mid_a))))/2));
+ return (est_c)+(est_r);
+ }
+ }
+}
+
+/* Trim; then diff sub-arrays; either one longer. Returns edit-length */
+
+int diff2et(fp, fpoff, ccrr, a, start_a, end_a, b, start_b, end_b, edits, edx, epo, procs, p_lim)
+ int *fp;
+ int fpoff;
+ int *ccrr;
+ void *a;
+ int start_a;
+ int end_a;
+ void *b;
+ int start_b;
+ int end_b;
+ int *edits;
+ int edx;
+ int epo;
+ fp_procs *procs;
+ int p_lim;
+{
+ {
+ int bdx = -1+(end_b);
+ int adx = -1+(end_a);
+ while (((start_b)<=(bdx))
+ && ((start_a)<=(adx))
+ && (procs->array_refsEql_P(a, adx, 0, b, bdx, 0))) {
+ {
+ bdx = -1+(bdx);
+ adx = -1+(adx);
+ }
+ }
+ {
+ int bsx = start_b;
+ int asx = start_a;
+ while (((bsx)<(bdx))
+ && ((asx)<(adx))
+ && (procs->array_refsEql_P(a, asx, 0, b, bsx, 0))) {
+ {
+ bsx = 1+(bsx);
+ asx = 1+(asx);
+ }
+ }
+ {
+ int delta = ((bdx)-(bsx))-((adx)-(asx));
+ if (0 > (delta))
+ return diff2ez(fp, fpoff, ccrr, b, bsx, 1+(bdx), a, asx, 1+(adx), edits, edx, -(epo), procs, (delta)+(p_lim));
+ else return diff2ez(fp, fpoff, ccrr, a, asx, 1+(adx), b, bsx, 1+(bdx), edits, edx, epo, procs, p_lim);
+ }
+ }
+ }
+}
+
+/* Diff sub-arrays, A not longer than B. Returns edit-length */
+
+int diff2ez(fp, fpoff, ccrr, a, start_a, end_a, b, start_b, end_b, edits, edx, epo, procs, p_lim)
+ int *fp;
+ int fpoff;
+ int *ccrr;
+ void *a;
+ int start_a;
+ int end_a;
+ void *b;
+ int start_b;
+ int end_b;
+ int *edits;
+ int edx;
+ int epo;
+ fp_procs *procs;
+ int p_lim;
+{
+ int len_a = (end_a)-(start_a);
+ int len_b = (end_b)-(start_b);
+ if (!(p_lim))
+ if ((len_b)==(len_a))
+ return 0;
+ else {
+ int T_edx = edx;
+ int adx = start_a;
+ int bdx = start_b;
+ int edx = T_edx;
+L_loop:
+ if ((bdx)>=(end_b))
+ return (len_b)-(len_a);
+ else if ((adx)>=(end_a))
+ {
+ int T_edx = edx;
+ int idx = bdx;
+ int edx = T_edx;
+ while (!((idx)>=(end_b))) {
+ edits[edx] = (epo)*(1+(idx));
+ {
+ idx = 1+(idx);
+ edx = 1+(edx);
+ }
+ }
+ return (len_b)-(len_a);
+ }
+ else if (procs->array_refsEql_P(a, adx, 0, b, bdx, 0))
+ {
+ adx = 1+(adx);
+ bdx = 1+(bdx);
+ goto L_loop;
+ }
+ else {
+ edits[edx] = (epo)*(1+(bdx));
+ {
+ bdx = 1+(bdx);
+ edx = 1+(edx);
+ goto L_loop;
+ }
+ }
+ }
+ else if ((len_a)<=(p_lim))
+ {
+ int idx = start_a;
+ int jdx = start_b;
+ while (!(((idx)>=(end_a))
+ && ((jdx)>=(end_b)))) {
+ if ((jdx)<(end_b))
+ {
+ edits[edx] = (epo)*(1+(jdx));
+ edx = 1+(edx);
+ }
+ if ((idx)<(end_a))
+ {
+ edits[edx] = (epo)*( -1-(idx));
+ edx = 1+(edx);
+ }
+ {
+ idx = 1+(idx);
+ jdx = 1+(jdx);
+ }
+ }
+ return (len_a)+(len_b);
+ }
+ else return diff_divide_and_conquer(fp, fpoff, ccrr, a, start_a, end_a, b, start_b, end_b, edits, edx, epo, procs, p_lim);
+}
+
+void check_cost(name, est, cost)
+ unsigned char *name;
+ int est;
+ int cost;
+{
+ if ((est)!=(cost)) {
+/* fprintf(stderr, "%s: cost check failed %d != %d\\n", name, est, cost); */
+ wta(MAKINUM(cost), "cost check failed", name);
+ }
+}
+
+/* Routines interfacing API layer to algorithms. */
+
+/* Return the fp_procs appropriate for SCM array prototype */
+fp_procs *raprot2procs(prot, s_name)
+ SCM prot;
+ char *s_name;
+{
+ fp_procs *procs;
+ if (ICHRP(prot)) procs = &char_procs;
+ else if (MAKINUM(16L)==prot) procs = &short_procs;
+ else if (MAKINUM(-16L)==prot) procs = &short_procs;
+ else if (MAKINUM(32L)==prot) procs = &long_procs;
+ else if (MAKINUM(-32L)==prot) procs = &long_procs;
+ else if (EOL==prot) procs = &long_procs;
+ else wta(prot, (char *)ARG3, s_name);
+ return procs;
+}
+
+static SCM list_of_0;
+
+void* array2addr(RA, prot, pos, s_name)
+ SCM RA, prot;
+ char *pos;
+ char s_name[];
+{
+ ASRTER(BOOL_T==arrayp(RA, UNDEFINED) && array_prot(RA)==prot, RA,
+ pos, s_name);
+ return (void*)scm_addr(cons(RA, list_of_0), s_name);
+}
+
+/* A not longer than B (M <= N) */
+static char s_d2es[] = "diff2edits!";
+static char s_incomp[] = "incompatible array types";
+SCM diff2edits(Edits, Fp, Args)
+ SCM Edits, Fp, Args; /* Ccrr, A, B; */
+{
+ SCM aprot, bprot;
+ int *edits;
+ int est;
+ int *fp;
+ int *ccrr;
+ void *a, *b;
+ int m, n;
+ fp_procs *procs;
+ ASRTER(3==ilength(Args), Args, WNA, s_d2es);
+ edits = array2addr(Edits, MAKINUM(-32), ARG1, s_d2es);
+ fp = array2addr(Fp, MAKINUM(-32), ARG2, s_d2es);
+ ccrr = array2addr(CAR(Args), MAKINUM(-32), ARG3, s_d2es);
+ Args = CDR(Args);
+ aprot = array_prot(CAR(Args));
+ a = array2addr(CAR(Args), aprot, ARG4, s_d2es);
+ ASRTER(NFALSEP(aprot), aprot, ARG4, s_d2es);
+ m = INUM(CAR(array_dims(CAR(Args))));
+ Args = CDR(Args);
+ bprot = array_prot(CAR(Args));
+ b = array2addr(CAR(Args), bprot, ARG5, s_d2es);
+ ASRTER(NFALSEP(bprot), bprot, ARG5, s_d2es);
+ n = INUM(CAR(array_dims(CAR(Args))));
+ ASRTER(aprot==bprot, bprot, s_incomp, s_d2es);
+ procs = raprot2procs(aprot, s_d2es);
+ est = INUM(CAR(array_dims(Edits)));
+ {
+ int p_lim = ((est)-((n)-(m)))/2;
+ check_cost(s_d2es, est,
+ diff2et(fp, 1+(p_lim),
+ ccrr, a, 0, m, b, 0, n, edits, 0, 1, procs, p_lim));
+ return UNSPECIFIED;
+ }
+}
+
+/* A not longer than B (M <= N) */
+
+static char s_d2el[] = "diff2editlen";
+SCM diff2editlen(Fp, A, Args)
+ SCM Fp, A, Args; /* B, P_lim */
+{
+ SCM aprot, bprot;
+ fp_procs *procs;
+ int p_lim;
+ int m, n;
+ int *fp;
+ void *a, *b;
+ ASRTER(2==ilength(Args), Args, WNA, s_d2el);
+ fp = array2addr(Fp, MAKINUM(-32), ARG1, s_d2el);
+ aprot = array_prot(A);
+ a = array2addr(A, aprot, ARG2, s_d2el);
+ ASRTER(NFALSEP(aprot), aprot, ARG2, s_d2el);
+ m = INUM(CAR(array_dims(A)));
+ bprot = array_prot(CAR(Args));
+ b = array2addr(CAR(Args), bprot, ARG3, s_d2el);
+ ASRTER(NFALSEP(bprot), bprot, ARG3, s_d2el);
+ n = INUM(CAR(array_dims(CAR(Args))));
+ Args = CDR(Args);
+ ASRTER(INUMP(CAR(Args)), CAR(Args), ARG4, s_d2el);
+ p_lim = INUM(CAR(Args));
+ ASRTER(aprot==bprot, bprot, s_incomp, s_d2el);
+ procs = raprot2procs(aprot, s_d2el);
+ {
+ int maxdx = 0 > (p_lim)
+ ?1+(n)
+ :1+(p_lim)+((n)-(m));
+ int mindx = 0 > (p_lim)
+ ?-(1+(m))
+ :-(1+(p_lim));
+ int res;
+ fp_init(fp, -(mindx), -1, mindx, maxdx);
+ res = fp_compare(fp, -(mindx), 0, a, m, b, n,
+ procs->array_refsEql_P, p_lim);
+ return (-1==res) ? BOOL_F : MAKINUM(res);
+ }
+}
+
+static char s_Idiffer[] = "Idiffer.scm";
+void init_differ()
+{
+ list_of_0 = cons(INUM0, EOL);
+ scm_gc_protect(list_of_0);
+ make_subr(s_d2es, tc7_lsubr_2, diff2edits);
+ make_subr(s_d2el, tc7_lsubr_2, diff2editlen);
+ if (scm_ldprog(s_Idiffer))
+ wta(*loc_errobj, "couldn't init", s_Idiffer);
+}
diff --git a/eval.c b/eval.c
index d5bba5f..3e39bee 100644
--- a/eval.c
+++ b/eval.c
@@ -144,7 +144,7 @@ SCM m_define_syntax P((SCM xorig, SCM env, SCM ctxt));
SCM m_let_syntax P((SCM xorig, SCM env, SCM ctxt));
SCM m_letrec_syntax P((SCM xorig, SCM env, SCM ctxt));
SCM m_the_macro P((SCM xorig, SCM env, SCM ctxt));
-void scm_dynthrow P((SCM cont, SCM val));
+void scm_dynthrow P((SCM cont, SCM arg1, SCM arg2, SCM rest));
void scm_egc P((void));
void scm_estk_grow P((void));
void scm_estk_shrink P((void));
@@ -757,6 +757,7 @@ static SCM toplevel_define(xorig, env)
SCM name = CAR(x);
ASRTER(scm_nullenv_p(env), xorig, s_placement, s_define);
ENV_PUSH;
+ scm_env_tmp = EOL; /* Make sure multiple values -> error */
x = cons(m_binding(name, CAR(CDR(x)), env, EOL), EOL);
x = evalcar(x);
ENV_POP;
@@ -1056,10 +1057,12 @@ static int in_atcase_aux = 0;
SCM m_case(xorig, env, ctxt)
SCM xorig, env, ctxt;
{
- SCM clause, x = CDR(xorig), key_expr = CAR(x);
+ SCM clause, key_expr, x = CDR(xorig);
SCM s, keys = EOL, action, actions = EOL, else_action = list_unspecified;
int opt = !scm_nullenv_p(env);
+
ASSYNT(ilength(x) >= 2, xorig, s_clauses, s_case);
+ key_expr = CAR(x);
while(NIMP(x = CDR(x))) {
clause = CAR(x);
s = scm_check_linum(clause, 0L);
@@ -1773,6 +1776,12 @@ static SCM macroexp1(xorig, env, ctxt, mode)
goto retx;
}
}
+#ifndef RECKLESS
+ if (ilength(x) < 0) {
+ what = s_expr;
+ goto errout;
+ }
+#endif
x = cons2(IM_FUNCALL, proc, CDR(x));
goto retx;
}
@@ -1930,8 +1939,10 @@ int scm_arity_check(proc, argc, what)
if (what) wta(proc, (char *)WNA, what);
return 0;
case tc7_subr_0: ASRTGO(0==argc, wrongnumargs) return !0;
- case tc7_cxr:
case tc7_contin:
+ if (IM_VALUES_TOKEN == CONT(proc)->other.stkframe[1]) return !0;
+ /* else fall through */
+ case tc7_cxr:
case tc7_subr_1: ASRTGO(1==argc, wrongnumargs) return !0;
case tc7_subr_1o: ASRTGO(0==argc || 1==argc, wrongnumargs) return !0;
case tc7_subr_2: ASRTGO(2==argc, wrongnumargs) return !0;
@@ -2193,6 +2204,8 @@ static SCM ceval_1(x)
goto cdrxbegin;
}
*/
+ scm_env_tmp = EOL; /* needed so multiple values cause an error
+ to be signaled when this is a top-level form. */
do {
scm_env_tmp = EVALCAR(proc);
proc = CDR(proc);
@@ -2403,6 +2416,7 @@ static SCM ceval_1(x)
return scm_values(UNDEFINED, UNDEFINED, EOL, s_values);
}
case tc7_contin:
+ scm_dynthrow(proc, UNDEFINED, UNDEFINED, EOL);
case tc7_subr_1:
case tc7_subr_2:
case tc7_subr_2o:
@@ -2493,7 +2507,7 @@ evap1:
goto clo_checked;
}
case tc7_contin:
- scm_dynthrow(proc, arg1);
+ scm_dynthrow(proc, arg1, UNDEFINED, EOL);
case tc7_specfun:
switch TYP16(proc) {
case tc16_call_cc:
@@ -2625,6 +2639,7 @@ evap1:
case tc7_subr_1:
case tc7_subr_3:
case tc7_contin:
+ scm_dynthrow(proc, arg1, arg2, EOL);
goto wrongnumargs;
default:
goto badfun;
@@ -2721,13 +2736,14 @@ evap1:
case tc16_values:
return scm_values(arg1, arg2, cons(arg3, x), s_values);
}
+ case tc7_contin:
+ scm_dynthrow(proc, arg1, arg2, cons(arg3, x));
case tc7_subr_2:
case tc7_subr_1o:
case tc7_subr_2o:
case tc7_subr_0:
case tc7_cxr:
case tc7_subr_1:
- case tc7_contin:
goto wrongnumargs;
default:
goto badfun;
@@ -2922,8 +2938,8 @@ SCM apply(proc, arg1, args)
return arg1;
}
case tc7_contin:
- ASRTGO(NULLP(args), wrongnumargs);
- scm_dynthrow(proc, arg1);
+ if (NULLP(args)) scm_dynthrow(proc, arg1, UNDEFINED, EOL);
+ /* else fall through */
case tc7_specfun:
args = UNBNDP(arg1) ? EOL : cons(arg1, args);
arg1 = proc;
@@ -3023,7 +3039,8 @@ SCM scm_cvapply(proc, n, argv)
return res;
}
case tc7_contin:
- scm_dynthrow(proc, argv[0]);
+ if (1 == n) scm_dynthrow(proc, argv[0], UNDEFINED, EOL);
+ goto call_apply;
case tc7_specfun:
if (tc16_apply==TYP16(proc)) {
proc = argv[0];
@@ -3034,6 +3051,7 @@ SCM scm_cvapply(proc, n, argv)
#endif
goto tail;
}
+ call_apply:
res = cons(proc, 0==n ? EOL : scm_v2lst(n, argv, EOL));
#ifdef CCLO
proc = (TYP16(proc)==tc16_cclo ? CCLO_SUBR(proc) : f_apply_closure);
@@ -3375,10 +3393,15 @@ SCM eval(obj)
return EVAL(obj, EOL, EOL);
}
-SCM definedp(x, env)
- SCM x, env;
+static char s_definedp[] = "defined?";
+SCM definedp(xorig, env, ctxt)
+ SCM xorig, env, ctxt;
{
- SCM proc = CAR(x = CDR(x));
+ SCM x = CDR(xorig);
+ SCM proc;
+
+ ASSYNT(1 == ilength(x), xorig, s_body, s_definedp);
+ proc = CAR(x);
#ifdef MACRO
proc = id2sym(proc);
#endif
@@ -3661,7 +3684,7 @@ void init_eval()
loc_atcase_aux = &CDR(sysintern("@case-aux", UNDEFINED));
/* acros */
- make_synt("defined?", MAC_ACRO, definedp);
+ make_synt(s_definedp, MAC_ACRO, definedp);
/* end of acros */
make_synt(s_and, MAC_MMACRO, m_and);
diff --git a/features.txi b/features.txi
index 96987b8..c7e94fb 100644
--- a/features.txi
+++ b/features.txi
@@ -57,6 +57,10 @@ Turns on the features @samp{cautious},
@samp{careful-interrupt-masking}, and @samp{stack-limit}; uses
@code{-g} flags for debugging SCM source code.
+@item differ
+@cindex differ
+Sequence comparison
+
@item dump
@cindex dump
Convert a running scheme program into an executable file.
@@ -162,7 +166,8 @@ This does not affect complex numbers.
@item socket
@cindex socket
-BSD @dfn{socket} interface.
+BSD @dfn{socket} interface. Socket addr functions require
+inexacts or bignums for 32-bit precision.
@item stack-limit
@cindex stack-limit
@@ -186,6 +191,10 @@ sjm@@ee.tut.fi.
Those unix features which have not made it into the Posix specs:
nice, acct, lstat, readlink, symlink, mknod and sync.
+@item wb
+@cindex wb
+WB database with relational wrapper.
+
@item windows
@cindex windows
Microsoft Windows executable.
diff --git a/hobbit.info b/hobbit.info
index a9d8b9f..d775565 100644
--- a/hobbit.info
+++ b/hobbit.info
@@ -1,4 +1,4 @@
-This is hobbit.info, produced by makeinfo version 4.0 from hobbit.texi.
+This is hobbit.info, produced by makeinfo version 4.7 from hobbit.texi.
INFO-DIR-SECTION The Algorithmic Language Scheme
START-INFO-DIR-ENTRY
@@ -40,8 +40,8 @@ approved by the author.

File: hobbit.info, Node: Introduction, Next: Compiling with Hobbit, Prev: Top, Up: Top
-Introduction
-************
+1 Introduction
+**************
Hobbit is a small optimizing scheme-to-C compiler written in Report 4
scheme and intended for use together with the SCM scheme interpreter of
@@ -67,17 +67,17 @@ Hobbit (derived from hobbit5x) is now part of the SCM Scheme
implementation. The most recent information about SCM can be found on
SCM's "WWW" home page:
- <http://swissnet.ai.mit.edu/~jaffer/SCM>
+ `http://swiss.csail.mit.edu/~jaffer/SCM'
Hobbit4d has also been ported to the Guile Scheme implementation:
- <http://www.gnu.org/software/guile/anon-cvs.html>
+ `http://www.gnu.org/software/guile/anon-cvs.html'

File: hobbit.info, Node: Compiling with Hobbit, Next: The Language Compiled, Prev: Introduction, Up: Top
-Compiling with Hobbit
-*********************
+2 Compiling with Hobbit
+***********************
* Menu:
@@ -89,16 +89,16 @@ Compiling with Hobbit

File: hobbit.info, Node: Compiling And Linking, Next: Error Detection, Prev: Compiling with Hobbit, Up: Compiling with Hobbit
-Compiling And Linking
-=====================
+2.1 Compiling And Linking
+=========================
`(require 'compile)'
- - Function: hobbit name1.scm name2.scm ...
+ -- Function: hobbit name1.scm name2.scm ...
Invokes the HOBBIT compiler to translate Scheme files `NAME1.scm',
`NAME2.scm', ... to C files `NAME1.c' and `NAME1.h'.
- - Function: compile-file name1.scm name2.scm ...
+ -- Function: compile-file name1.scm name2.scm ...
Compiles the HOBBIT translation of NAME1.scm, NAME2.scm, ... to a
dynamically linkable object file NAME1<object-suffix>, where
<object-suffix> is the object file suffix for your computer (for
@@ -110,26 +110,26 @@ Compiling And Linking
cd ~/scm/
scm -rcompile -e'(compile-file "example.scm")'
-
+
Starting to read example.scm
-
+
Generic (slow) arithmetic assumed: 1.0e-3 found.
-
+
** Pass 1 completed **
** Pass 2 completed **
** Pass 3 completed **
** Pass 4 completed **
** Pass 5 completed **
** Pass 6 completed **
-
+
C source file example.c is built.
C header file example.h is built.
-
+
These top level higher order procedures are not clonable (slow):
(nonkeyword_make-promise map-streams generate-vector runge-kutta-4)
These top level procedures create non-liftable closures (slow):
(nonkeyword_make-promise damped-oscillator map-streams scale-vector elementwise runge-kutta-4 integrate-system)
-
+
; Scheme (linux) script created by SLIB/batch Sun Apr 7 22:49:49 2002
; ================ Write file with C defines
(delete-file "scmflags.h")
@@ -138,7 +138,7 @@ Compiling And Linking
(lambda (fp)
(for-each
(lambda (string) (write-line string fp))
- '("#define IMPLINIT \"Init5d9.scm\""
+ '("#define IMPLINIT \"Init5e1.scm\""
"#define BIGNUMS"
"#define FLOATS"
"#define ARRAYS"
@@ -149,10 +149,10 @@ Compiling And Linking
(delete-file "example.o")
; ================ Link C object files
(delete-file "slibcat")
-
+
Compilation finished at Sun Apr 7 22:49:50
- - Function: compile->executable exename name1.scm name2.scm ...
+ -- Function: compile->executable exename name1.scm name2.scm ...
Compiles and links the HOBBIT translation of NAME1.scm, NAME2.scm,
... to a SCM executable named EXENAME. NAME1.scm must be in the
current directory; NAME2.scm, ... may be in other directories.
@@ -162,26 +162,26 @@ Compiling And Linking
cd ~/scm/
scm -rcompile -e'(compile->executable "exscm" "example.scm")'
-
+
Starting to read example.scm
-
+
Generic (slow) arithmetic assumed: 1.0e-3 found.
-
+
** Pass 1 completed **
** Pass 2 completed **
** Pass 3 completed **
** Pass 4 completed **
** Pass 5 completed **
** Pass 6 completed **
-
+
C source file example.c is built.
C header file example.h is built.
-
+
These top level higher order procedures are not clonable (slow):
(nonkeyword_make-promise map-streams generate-vector runge-kutta-4)
These top level procedures create non-liftable closures (slow):
(nonkeyword_make-promise damped-oscillator map-streams scale-vector elementwise runge-kutta-4 integrate-system)
-
+
; Scheme (linux) script created by SLIB/batch Sun Apr 7 22:46:31 2002
; ================ Write file with C defines
(delete-file "scmflags.h")
@@ -190,7 +190,7 @@ Compiling And Linking
(lambda (fp)
(for-each
(lambda (string) (write-line string fp))
- '("#define IMPLINIT \"Init5d9.scm\""
+ '("#define IMPLINIT \"Init5e1.scm\""
"#define COMPILED_INITS init_example();"
"#define CCLO"
"#define FLOATS"))))
@@ -198,7 +198,7 @@ Compiling And Linking
(system "gcc -O2 -c continue.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 example.c scm.c")
; ================ Link C object files
(system "gcc -rdynamic -o exscm continue.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 example.o scm.o -L/usr/local/lib/scm/ -lm -lc")
-
+
Compilation finished at Sun Apr 7 22:46:44
_Note Bene:_ `#define CCLO' must be present in `scmfig.h'.
@@ -212,8 +212,8 @@ before calling these functions.

File: hobbit.info, Node: Error Detection, Next: Hobbit Options, Prev: Compiling And Linking, Up: Compiling with Hobbit
-Error Detection
-===============
+2.2 Error Detection
+===================
Error detection during compilation is minimal. In case your scheme code
is syntactically incorrect, hobbit may crash with no sensible error
@@ -252,8 +252,8 @@ and hobbit will immediately halt compilation.

File: hobbit.info, Node: Hobbit Options, Next: CC Optimizations, Prev: Error Detection, Up: Compiling with Hobbit
-Hobbit Options
-==============
+2.3 Hobbit Options
+==================
1. Selecting the type of arithmetics.
@@ -440,8 +440,8 @@ Hobbit Options

File: hobbit.info, Node: CC Optimizations, Prev: Hobbit Options, Up: Compiling with Hobbit
-CC Optimizations
-================
+2.4 CC Optimizations
+====================
When using the C compiler to compile the C code output by hobbit, always
use strong optimizations (eg. `cc -xO3' for cc on Sun, `gcc -O2' or
@@ -461,8 +461,8 @@ checking into the code it produces.

File: hobbit.info, Node: The Language Compiled, Next: Performance of Compiled Code, Prev: Compiling with Hobbit, Up: Top
-The Language Compiled
-*********************
+3 The Language Compiled
+***********************
Calls to `load' or `require' occurring at the top level of a file being
compiled are ignored. Calls to `load' or `require' within a procedure
@@ -483,8 +483,8 @@ hobbit as Scheme primitives.

File: hobbit.info, Node: Macros, Next: SCM Primitive Procedures, Prev: The Language Compiled, Up: The Language Compiled
-Macros
-======
+3.1 Macros
+==========
The Common-lisp style defmacro implemented in SCM is recognized and
procedures defined by defmacro are expanded during compilation.
@@ -500,8 +500,8 @@ file.

File: hobbit.info, Node: SCM Primitive Procedures, Next: SLIB Logical Procedures, Prev: Macros, Up: The Language Compiled
-SCM Primitive Procedures
-========================
+3.2 SCM Primitive Procedures
+============================
Real-only versions of transcedental procedures (warning: these
procedures are not compiled directly into the corresponding C library
@@ -522,8 +522,8 @@ delete-file, rename-file.

File: hobbit.info, Node: SLIB Logical Procedures, Next: Fast Integer Calculations, Prev: SCM Primitive Procedures, Up: The Language Compiled
-SLIB Logical Procedures
-=======================
+3.3 SLIB Logical Procedures
+===========================
The following bitwise procedures in the scheme library file
`logical.scm' are compiled directly to fast C operations on immediate
@@ -534,8 +534,8 @@ C ops below):
& | ^ ~ << >>
The following alternative names logical:logand, logical:logior,
-logical:logxor, logical:lognot, ash, logical:ash are compiled for the
-generic case, not immediate-integers-only and are thus much slower.
+logical:logxor, logical:lognot, and ash are compiled for the generic
+case, not immediate-integers-only and are thus much slower.
Notice that the procedures logsleft, logsright are NOT in the the
library file `logical.scm:' the universal procedure ash is instead.
@@ -549,8 +549,8 @@ logsleft and logsright are defined for non-compiled use in the file

File: hobbit.info, Node: Fast Integer Calculations, Next: Force and Delay, Prev: SLIB Logical Procedures, Up: The Language Compiled
-Fast Integer Calculations
-=========================
+3.4 Fast Integer Calculations
+=============================
The following primitives are for immediate (30-bit) integer-only
arithmetics. The are compiled directly into the corresponding C
@@ -573,8 +573,8 @@ in the SCM distribution.

File: hobbit.info, Node: Force and Delay, Next: Suggestions for writing fast code, Prev: Fast Integer Calculations, Up: The Language Compiled
-Force and Delay
-===============
+3.5 Force and Delay
+===================
The nonessential procedure `force' and syntax `delay' are implemented
exactly as suggested in the report 4. This implementation deviates
@@ -586,8 +586,8 @@ for the promises created by the interpreter.

File: hobbit.info, Node: Suggestions for writing fast code, Prev: Force and Delay, Up: The Language Compiled
-Suggestions for writing fast code
-=================================
+3.6 Suggestions for writing fast code
+=====================================
The following suggestions may help you to write well-optimizable and
fast code for the hobbit-scm combination. Roughly speaking, the main
@@ -844,8 +844,8 @@ Here come the details.

File: hobbit.info, Node: Performance of Compiled Code, Next: Principles of Compilation, Prev: The Language Compiled, Up: Top
-Performance of Compiled Code
-****************************
+4 Performance of Compiled Code
+******************************
* Menu:
@@ -856,8 +856,8 @@ Performance of Compiled Code

File: hobbit.info, Node: Gain in Speed, Next: Benchmarks, Prev: Performance of Compiled Code, Up: Performance of Compiled Code
-Gain in Speed
-=============
+4.1 Gain in Speed
+=================
The author has so far compiled and tested a number of large programs
(theorem provers for various logics and hobbit itself).
@@ -895,8 +895,8 @@ benchmark CPSTAK in the following table.

File: hobbit.info, Node: Benchmarks, Next: Benchmark Sources, Prev: Gain in Speed, Up: Performance of Compiled Code
-Benchmarks
-==========
+4.2 Benchmarks
+==============
We will present a table with the performance of three scheme systems on
a number of benchmarks: interpreted SCM, byte-compiled VSCM and
@@ -956,8 +956,8 @@ before each test.

File: hobbit.info, Node: Benchmark Sources, Prev: Benchmarks, Up: Performance of Compiled Code
-Benchmark Sources
-=================
+4.3 Benchmark Sources
+=====================
A selection of (smaller) benchmark sources
------------------------------------------
@@ -977,8 +977,8 @@ A selection of (smaller) benchmark sources

File: hobbit.info, Node: Destruct, Next: Recfib, Prev: Benchmark Sources, Up: Benchmark Sources
-Destruct
---------
+4.3.1 Destruct
+--------------
;;;; Destructive operation benchmark
(define (destructive n m)
@@ -1014,8 +1014,8 @@ Destruct

File: hobbit.info, Node: Recfib, Next: div-iter and div-rec, Prev: Destruct, Up: Benchmark Sources
-Recfib
-------
+4.3.2 Recfib
+------------
(define (recfib x)
(if (< x 2)
@@ -1026,8 +1026,8 @@ Recfib

File: hobbit.info, Node: div-iter and div-rec, Next: Hanoi, Prev: Recfib, Up: Benchmark Sources
-div-iter and div-rec
---------------------
+4.3.3 div-iter and div-rec
+--------------------------
;;;; Recursive and iterative benchmark divides by 2 using lists of ()'s.
(define (create-n n)
@@ -1060,8 +1060,8 @@ div-iter and div-rec

File: hobbit.info, Node: Hanoi, Next: Tak, Prev: div-iter and div-rec, Up: Benchmark Sources
-Hanoi
------
+4.3.4 Hanoi
+-----------
;;; C optimiser should be able to remove the first recursive call to
;;; move-them. But Solaris 2.4 cc, gcc 2.5.8, and hobbit don't.
@@ -1077,8 +1077,8 @@ Hanoi

File: hobbit.info, Node: Tak, Next: Ctak, Prev: Hanoi, Up: Benchmark Sources
-Tak
----
+4.3.5 Tak
+---------
;;;; A vanilla version of the TAKeuchi function
(define (tak x y z)
@@ -1092,15 +1092,15 @@ Tak

File: hobbit.info, Node: Ctak, Next: Takl, Prev: Tak, Up: Benchmark Sources
-Ctak
-----
+4.3.6 Ctak
+----------
;;;; A version of the TAK function that uses continuations
(define (ctak x y z)
(call-with-current-continuation
(lambda (k)
(ctak-aux k x y z))))
-
+
(define (ctak-aux k x y z)
(cond ((not (< y x)) (k z))
(else (call-with-current-continuation
@@ -1112,9 +1112,9 @@ Ctak
(lambda (k) (ctak-aux k (- y 1) z x)))
(call-with-current-continuation
(lambda (k) (ctak-aux k (- z 1) x y))))))))
-
+
(define (id x) x)
-
+
(define (mb-test r x y z)
(if (zero? r)
(ctak x y z)
@@ -1124,26 +1124,26 @@ Ctak

File: hobbit.info, Node: Takl, Next: Cpstak, Prev: Ctak, Up: Benchmark Sources
-Takl
-----
+4.3.7 Takl
+----------
;;;; The TAKeuchi function using lists as counters.
(define (listn n)
(if (not (= 0 n))
(cons n (listn (- n 1)))
'()))
-
+
(define l18 (listn 18))
(define l12 (listn 12))
(define l6 (listn 6))
-
+
(define (mas x y z)
(if (not (shorterp y x))
z
(mas (mas (cdr x) y z)
(mas (cdr y) z x)
(mas (cdr z) x y))))
-
+
(define (shorterp x y)
(and (pair? y) (or (null? x) (shorterp (cdr x) (cdr y)))))
;; call: (mas l18 l12 l6)
@@ -1151,8 +1151,8 @@ Takl

File: hobbit.info, Node: Cpstak, Next: Pi, Prev: Takl, Up: Benchmark Sources
-Cpstak
-------
+4.3.8 Cpstak
+------------
;;;; A continuation-passing version of the TAK benchmark.
(define (cpstak x y z)
@@ -1178,8 +1178,8 @@ Cpstak

File: hobbit.info, Node: Pi, Prev: Cpstak, Up: Benchmark Sources
-Pi
---
+4.3.9 Pi
+--------
(define (pi n . args)
(let* ((d (car args))
@@ -1210,8 +1210,8 @@ Pi

File: hobbit.info, Node: Principles of Compilation, Next: About Hobbit, Prev: Performance of Compiled Code, Up: Top
-Principles of Compilation
-*************************
+5 Principles of Compilation
+***************************
* Menu:
@@ -1225,8 +1225,8 @@ Principles of Compilation

File: hobbit.info, Node: Macro-Expansion and Analysis, Next: Building Closures, Prev: Principles of Compilation, Up: Principles of Compilation
-Expansion and Analysis
-======================
+5.1 Expansion and Analysis
+==========================
1. Macros defined by defmacro and all the quasiquotes are expanded
and compiled into equivalent form without macros and quasiquotes.
@@ -1320,8 +1320,8 @@ Expansion and Analysis

File: hobbit.info, Node: Building Closures, Next: Lambda-lifting, Prev: Macro-Expansion and Analysis, Up: Principles of Compilation
-Building Closures
-=================
+5.2 Building Closures
+=====================
Here Hobbit produces code for creating real closures for all the
lambda-terms which are not marked as being liftable by the previous
@@ -1388,8 +1388,8 @@ called using an internal apply.

File: hobbit.info, Node: Lambda-lifting, Next: Statement-lifting, Prev: Building Closures, Up: Principles of Compilation
-Lambda-lifting
-==============
+5.3 Lambda-lifting
+==================
When this pass starts, all the real (nonliftable) closures have been
translated to closure-creating code. The remaining lambda-terms are
@@ -1415,7 +1415,7 @@ is converted to
(define foo
(lambda (x y)
(foo-fn1 x y) ))
-
+
(define foo-fn1
(lambda (x u)
(+ u x) ))
@@ -1435,10 +1435,10 @@ of these variables:
(define (foo x y z i)
(foo-fn2 x z i) )
-
+
(define foo-fn1
(lambda (x z u) (if x (+ (foo-fn2 x z u) 1))) )
-
+
(define foo-fn2
(lambda (x z v) (if (zero? v) 1 (foo-fn1 x z z))) )
@@ -1462,7 +1462,7 @@ is converted to incorrect scheme:
(lambda (x y z)
(foo-fn1 x (**c-adr** z) y)
z))
-
+
(define foo-fn1
(lambda (x (**c-adr** z) u)
(set! (**c-fetch** z) (+ u x (**c-fetch** z))) ))
@@ -1475,7 +1475,7 @@ The last two will finally be compiled into correct C as:
foo_fn1(x, &z, y);
return z;
}
-
+
SCM foo_fn1(x, z, u)
SCM x, u;
SCM *z;
@@ -1486,8 +1486,8 @@ The last two will finally be compiled into correct C as:

File: hobbit.info, Node: Statement-lifting, Next: Higher-order Arglists, Prev: Lambda-lifting, Up: Principles of Compilation
-Statement-lifting
-=================
+5.4 Statement-lifting
+=====================
As the scheme do-construction is compiled into C for, but for cannot
occur in all places in C (it is a statement), then if the do in a
@@ -1517,8 +1517,8 @@ the beginning of the procedure body.

File: hobbit.info, Node: Higher-order Arglists, Next: Typing and Constants, Prev: Statement-lifting, Up: Principles of Compilation
-Higher-order Arglists
-=====================
+5.5 Higher-order Arglists
+=========================
All procedures taking a list argument are converted into ordinary
non-list taking procedures and they are called with the list-making
@@ -1583,8 +1583,8 @@ FUN is the name of the original procedure.

File: hobbit.info, Node: Typing and Constants, Prev: Higher-order Arglists, Up: Principles of Compilation
-Typing and Constants
-====================
+5.6 Typing and Constants
+========================
All C<->Scheme conversions for immediate objects like numbers, booleans
and characters are introduced. Internal apply is used for undefined
@@ -1623,8 +1623,8 @@ instead of the default:

File: hobbit.info, Node: About Hobbit, Next: Index, Prev: Principles of Compilation, Up: Top
-About Hobbit
-************
+6 About Hobbit
+**************
* Menu:
@@ -1637,8 +1637,8 @@ About Hobbit

File: hobbit.info, Node: The Aims of Developing Hobbit, Next: Manifest, Prev: About Hobbit, Up: About Hobbit
-The Aims of Developing Hobbit
-=============================
+6.1 The Aims of Developing Hobbit
+=================================
1. Producing maximally fast C code from simple scheme code.
@@ -1657,8 +1657,8 @@ The Aims of Developing Hobbit

File: hobbit.info, Node: Manifest, Next: Author and Contributors, Prev: The Aims of Developing Hobbit, Up: About Hobbit
-Manifest
-========
+6.2 Manifest
+============
`hobbit.scm' the hobbit compiler.
`scmhob.scm' the file defining some additional procedures recognized
@@ -1670,8 +1670,8 @@ Manifest

File: hobbit.info, Node: Author and Contributors, Next: Future Improvements, Prev: Manifest, Up: About Hobbit
-Author and Contributors
-=======================
+6.3 Author and Contributors
+===========================
Tanel Tammet
Department of Computing Science
@@ -1696,8 +1696,8 @@ NMICHAEL@us.oracle.com, Lee Iverson (leei@ai.sri.com), Burt Leavenworth

File: hobbit.info, Node: Future Improvements, Next: Release History, Prev: Author and Contributors, Up: About Hobbit
-Future Improvements
-===================
+6.4 Future Improvements
+=======================
1. Optimisations:
@@ -1727,8 +1727,8 @@ Future Improvements

File: hobbit.info, Node: Release History, Prev: Future Improvements, Up: About Hobbit
-Release History
-===============
+6.5 Release History
+===================
[In February 2002, hobbit5x was integrated into the SCM
distribution. Changes since then are recorded in `scm/ChangeLog'.]
@@ -1916,55 +1916,59 @@ File: hobbit.info, Node: Index, Prev: About Hobbit, Up: Top
Index
*****
+
* Menu:
* compile->executable: Compiling And Linking.
+ (line 67)
* compile-file: Compiling And Linking.
+ (line 13)
* hobbit: Compiling And Linking.
+ (line 9)

Tag Table:
Node: Top199
Node: Introduction1227
-Node: Compiling with Hobbit2540
-Node: Compiling And Linking2793
-Node: Error Detection7538
-Node: Hobbit Options8836
-Node: CC Optimizations15557
-Node: The Language Compiled16505
-Node: Macros17160
-Node: SCM Primitive Procedures17756
-Node: SLIB Logical Procedures18607
-Node: Fast Integer Calculations19763
+Node: Compiling with Hobbit2543
+Node: Compiling And Linking2801
+Node: Error Detection7487
+Node: Hobbit Options8793
+Node: CC Optimizations15522
+Node: The Language Compiled16478
+Node: Macros17137
+Node: SCM Primitive Procedures17741
+Node: SLIB Logical Procedures18600
+Node: Fast Integer Calculations19755
Node: Force and Delay20889
-Node: Suggestions for writing fast code21466
-Node: Performance of Compiled Code31657
-Node: Gain in Speed31913
-Node: Benchmarks33490
-Node: Benchmark Sources36582
-Node: Destruct36920
-Node: Recfib38495
-Node: div-iter and div-rec38738
-Node: Hanoi39812
-Node: Tak40381
-Node: Ctak40724
-Node: Takl41707
-Node: Cpstak42366
-Node: Pi43133
-Node: Principles of Compilation44250
-Node: Macro-Expansion and Analysis44672
-Node: Building Closures48469
-Node: Lambda-lifting51352
-Node: Statement-lifting54100
-Node: Higher-order Arglists55200
-Node: Typing and Constants56998
-Node: About Hobbit58254
-Node: The Aims of Developing Hobbit58510
-Node: Manifest59393
-Node: Author and Contributors59844
-Node: Future Improvements60891
-Node: Release History61648
-Node: Index68429
+Node: Suggestions for writing fast code21474
+Node: Performance of Compiled Code31673
+Node: Gain in Speed31933
+Node: Benchmarks33518
+Node: Benchmark Sources36618
+Node: Destruct36964
+Node: Recfib38551
+Node: div-iter and div-rec38806
+Node: Hanoi39892
+Node: Tak40473
+Node: Ctak40828
+Node: Takl41808
+Node: Cpstak42464
+Node: Pi43243
+Node: Principles of Compilation44372
+Node: Macro-Expansion and Analysis44798
+Node: Building Closures48603
+Node: Lambda-lifting51494
+Node: Statement-lifting54225
+Node: Higher-order Arglists55333
+Node: Typing and Constants57139
+Node: About Hobbit58403
+Node: The Aims of Developing Hobbit58663
+Node: Manifest59554
+Node: Author and Contributors60013
+Node: Future Improvements61068
+Node: Release History61833
+Node: Index68622

End Tag Table
diff --git a/hobbit.scm b/hobbit.scm
index 8f1d896..65dfff1 100644
--- a/hobbit.scm
+++ b/hobbit.scm
@@ -2,7 +2,7 @@
;
; HOBBIT: an optimizing scheme -> C compiler for SCM
;
-; scm5d9
+; scm5e1
; 2002-04-11
;
; Copyright (C) 1992-1997: Tanel Tammet
diff --git a/hobbit.texi b/hobbit.texi
index f87c1b0..1afa9c4 100644
--- a/hobbit.texi
+++ b/hobbit.texi
@@ -123,7 +123,7 @@ Hobbit (derived from hobbit5x) is now part of the SCM Scheme
implementation. The most recent information about SCM can be found on
SCM's @dfn{WWW} home page:
-@center @url{http://swissnet.ai.mit.edu/~jaffer/SCM}
+@center @url{http://swiss.csail.mit.edu/~jaffer/SCM}
Hobbit4d has also been ported to the Guile Scheme implementation:
@@ -665,9 +665,10 @@ upper row, C ops below):
@end group
@end example
-The following alternative names @t{logical:logand}, @t{logical:logior},
-@t{logical:logxor}, @t{logical:lognot}, @t{ash}, @t{logical:ash} are compiled for the
-generic case, not immediate-integers-only and are thus much slower.
+The following alternative names @t{logical:logand},
+@t{logical:logior}, @t{logical:logxor}, @t{logical:lognot}, and
+@t{ash} are compiled for the generic case, not immediate-integers-only
+and are thus much slower.
Notice that the procedures @t{logsleft}, @t{logsright} are @b{NOT} in
the the library file @file{logical.scm:} the universal procedure
diff --git a/inc2scm b/inc2scm
index 951104b..9e00ed7 100755
--- a/inc2scm
+++ b/inc2scm
@@ -1,4 +1,4 @@
-#! /usr/local/bin/scm \ %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
+#! /usr/local/bin/scm \ %0 %*
- !#
;; Copyright (C) 1991-1999 Free Software Foundation, Inc.
;;
@@ -60,7 +60,7 @@ Usage: inc2scm defines.scm [pre:] [/usr/include/] file1.h file2.h ...
/USR/INCLUDE/ defaults to /usr/include/.
-http://swissnet.ai.mit.edu/~jaffer/SCM
+http://swiss.csail.mit.edu/~jaffer/SCM
"
(current-error-port))
#f)
diff --git a/mkimpcat.scm b/mkimpcat.scm
index 8f5929a..c745cfc 100644
--- a/mkimpcat.scm
+++ b/mkimpcat.scm
@@ -93,6 +93,20 @@
link:able-suffix))))
(cond ((or
(add-link 'db
+ (in-implementation-vicinity "db.so"))
+ (add-link 'db
+ (in-implementation-vicinity "db" link:able-suffix)
+ (in-implementation-vicinity "handle" link:able-suffix)
+ (in-implementation-vicinity "blink" link:able-suffix)
+ (in-implementation-vicinity "prev" link:able-suffix)
+ (in-implementation-vicinity "ent" link:able-suffix)
+ (in-implementation-vicinity "sys" link:able-suffix)
+ (in-implementation-vicinity "del" link:able-suffix)
+ (in-implementation-vicinity "stats" link:able-suffix)
+ (in-implementation-vicinity "blkio" link:able-suffix)
+ (in-implementation-vicinity "scan" link:able-suffix)
+ (usr:lib "c"))
+ (add-link 'db
(in-wb-vicinity "db.so"))
(add-link 'db
(in-wb-vicinity "db" link:able-suffix)
@@ -107,8 +121,12 @@
(in-wb-vicinity "scan" link:able-suffix)
(usr:lib "c")))
(add-source 'wb-table
+ (in-implementation-vicinity "wbtab"))
+ (add-source 'wb-table
(in-wb-vicinity "wbtab"))
(add-source 'rwb-isam
+ (in-implementation-vicinity "rwb-isam"))
+ (add-source 'rwb-isam
(in-wb-vicinity "rwb-isam"))
(add-alias 'wb 'db)))
(cond ((add-link 'mysql
@@ -159,6 +177,8 @@
(add-link 'socket
(in-implementation-vicinity "socket" link:able-suffix)
(usr:lib "c"))
+ (add-link 'diff
+ (in-implementation-vicinity "differ" link:able-suffix))
(add-link 'record
(in-implementation-vicinity "record" link:able-suffix))
(add-link 'generalized-c-arguments
diff --git a/patchlvl.h b/patchlvl.h
index cd637d3..779b7d8 100644
--- a/patchlvl.h
+++ b/patchlvl.h
@@ -4,11 +4,11 @@
# for alpha release, "b" for beta release, "c", and so on), and the
# trailing number is the patchlevel. */
# /* This next line sets VERSION when included from the Makefile */
-VERSION=5d9
+VERSION=5e1
#endif
#ifndef SCMVERSION
-# define SCMVERSION "5d9"
+# define SCMVERSION "5e1"
#endif
#ifdef nosve
# define INIT_FILE_NAME "Init"SCMVERSION"_scm";
diff --git a/r4rstest.scm b/r4rstest.scm
index f6f3ae0..7768f03 100644
--- a/r4rstest.scm
+++ b/r4rstest.scm
@@ -1,4 +1,4 @@
-;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 2000, 2003 Free Software Foundation, Inc.
+;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 2000, 2003, 2004 Free Software Foundation, Inc.
;;
;; This program is free software; you can redistribute it and/or modify it
;; under the terms of the GNU General Public License as published by the
@@ -13,10 +13,14 @@
;; To receive a copy of the GNU General Public License, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA; or view
-;; http://swissnet.ai.mit.edu/~jaffer/GPL.html
+;; http://swiss.csail.mit.edu/~jaffer/GPL.html
-;;;; "r4rstest.scm" Test correctness of scheme implementations.
-;;; Author: Aubrey Jaffer
+;;;;"r4rstest.scm": Test R4RS correctness of scheme implementations.
+;;; Author: Aubrey Jaffer
+;;; Home-page: http://swiss.csail.mit.edu/~jaffer/Scheme
+;;; Current version: http://swiss.csail.mit.edu/ftpdir/scm/r4rstest.scm
+;;; CVS Head:
+;;; http://savannah.gnu.org/cgi-bin/viewcvs/scm/scm/r4rstest.scm?rev=HEAD&only_with_tag=HEAD&content-type=text/vnd.viewcvs-markup
;;; This includes examples from
;;; William Clinger and Jonathan Rees, editors.
@@ -478,6 +482,23 @@
(test #t exact? 3)
(test #f inexact? 3)
+;;(test 1 expt 0 0)
+(test 0 expt 0 1)
+(test 0 expt 0 256)
+;;(test 0 expt 0 -255)
+(test 1 expt -1 256)
+(test -1 expt -1 255)
+(test 1 expt -1 -256)
+(test -1 expt -1 -255)
+(test 1 expt 256 0)
+(test 1 expt -256 0)
+(test 256 expt 256 1)
+(test -256 expt -256 1)
+(test 8 expt 2 3)
+(test -8 expt -2 3)
+(test 9 expt 3 2)
+(test 9 expt -3 2)
+
(test #t = 22 22 22)
(test #t = 22 22)
(test #f = 34 34 35)
@@ -608,8 +629,18 @@
(test f1.0 round f0.8)
(test f4.0 round f3.5)
(test f4.0 round f4.5)
- (test 1 expt 0 0)
- (test 0 expt 0 1)
+
+ ;;(test f1.0 expt f0.0 f0.0)
+ ;;(test f1.0 expt f0.0 0)
+ ;;(test f1.0 expt 0 f0.0)
+ (test f0.0 expt f0.0 f1.0)
+ (test f0.0 expt f0.0 1)
+ (test f0.0 expt 0 f1.0)
+ (test f1.0 expt -25 f0.0)
+ (test f1.0 expt f-3.25 f0.0)
+ (test f1.0 expt f-3.25 0)
+ ;;(test f0.0 expt f0.0 f-3.25)
+
(test (atan 1) atan 1 1)
(set! write-test-obj (list f.25 f-3.25));.25 inexact errors less likely.
(set! load-test-obj (list 'define 'foo (list 'quote write-test-obj)))
@@ -757,7 +788,7 @@
(report-errs))
(define (test-numeric-predicates)
- (let* ((big-ex (expt 2 90))
+ (let* ((big-ex (expt 2 150))
(big-inex (exact->inexact big-ex)))
(newline)
(display ";testing bignum-inexact comparisons;")
@@ -1215,7 +1246,8 @@
(let ((have-inexacts?
(and (string->number "0.0") (inexact? (string->number "0.0"))))
(have-bignums?
- (let ((n (string->number "281474976710655325431")))
+ (let ((n (string->number
+ "1427247692705959881058285969449495136382746625")))
(and n (exact? n)))))
(cond (have-inexacts?
(test-inexact)
diff --git a/ramap.c b/ramap.c
index 42181ee..1ebafce 100644
--- a/ramap.c
+++ b/ramap.c
@@ -287,8 +287,8 @@ SCM array_fill(ra, fill)
return UNSPECIFIED;
}
-static char s_sarray_copy[] = "serial-array-copy!";
-# define s_array_copy (s_sarray_copy + 7)
+static char s_sarray_copy[] = "serial-array:copy!";
+static char s_array_copy[] = "array:copy!";
static int racp(src, dst)
SCM dst, src;
{
@@ -439,9 +439,9 @@ static int racp(src, dst)
}
return 1;
}
-SCM array_copy(src, dst)
- SCM src;
+SCM array_copy(dst, src)
SCM dst;
+ SCM src;
{
#ifndef RECKLESS
if (INUM0==array_rank(dst))
@@ -480,7 +480,7 @@ SCM ra2contig(ra, copy)
}
CAR(ret) |= ARRAY_CONTIGUOUS;
ARRAY_V(ret) = make_uve(inc+0L, array_prot(ra));
- if (copy) array_copy(ra, ret);
+ if (copy) array_copy(ret, ra);
return ret;
}
@@ -492,7 +492,7 @@ SCM ura_read(ra, port)
if (NIMP(ra) && ARRAYP(ra)) {
cra = ra2contig(ra, 0);
ret = uve_read(cra, port);
- if (cra != ra) array_copy(cra, ra);
+ if (cra != ra) array_copy(ra, cra);
return ret;
}
else return uve_read(ra, port);
@@ -1377,7 +1377,7 @@ static int rafe(ra0, proc, ras)
SCM heap_ve, auto_rav[5], auto_argv[5];
SCM *rav = &auto_rav[0], *argv = &auto_argv[0];
long argc = ilength(ras) + 1;
- long i, k, inc, n, base;
+ long i, k, n;
scm_protect_temp(&heap_ve);
if (argc >= 5) {
heap_ve = make_vector(MAKINUM(2*argc), BOOL_F);
@@ -1642,11 +1642,15 @@ static iproc subr2os[] = {
{s_ura_wr, ura_write},
{0, 0}};
+/* MinGW complains during a dll build that the string members are not
+ constants, since they are defined in another dll. These functions
+ individually initialized below.
static iproc subr2s[] = {
{s_array_fill, array_fill},
{s_array_copy, array_copy},
{s_sarray_copy, array_copy},
{0, 0}};
+*/
static iproc lsubr2s[] = {
{s_sc2array, sc2array},
@@ -1670,18 +1674,21 @@ void init_ramap()
init_raprocs(ra_rpsubrs);
init_raprocs(ra_asubrs);
init_iprocs(subr2os, tc7_subr_2o);
- init_iprocs(subr2s, tc7_subr_2);
+ /* init_iprocs(subr2s, tc7_subr_2); */
init_iprocs(lsubr2s, tc7_lsubr_2);
+ make_subr(s_array_fill, tc7_subr_2, array_fill);
+ make_subr(s_array_copy, tc7_subr_2, array_copy);
+ make_subr(s_sarray_copy, tc7_subr_2, array_copy);
make_subr(s_array_equalp, tc7_rpsubr, array_equal);
smobs[0x0ff & (tc16_array>>8)].equalp = raequal;
add_feature(s_array_for_each);
scm_ldstr("\n\
(define (array-indexes ra)\n\
- (let ((ra0 (apply create-array '#() (array-shape ra))))\n\
+ (let ((ra0 (apply make-array '#() (array-shape ra))))\n\
(array-index-map! ra0 list)\n\
ra0))\n\
(define (array-map prototype proc ra1 . ras)\n\
- (define nra (apply create-array prototype (array-shape ra1)))\n\
+ (define nra (apply make-array prototype (array-shape ra1)))\n\
(apply array-map! nra proc ra1 ras)\n\
nra)\n\
");
diff --git a/repl.c b/repl.c
index 07b357c..a3204dc 100644
--- a/repl.c
+++ b/repl.c
@@ -316,7 +316,22 @@ taloop:
break;
}
case tcs_symbols:
- lfwrite(CHARS(exp), (sizet)sizeof(char), (sizet)LENGTH(exp), port);
+ if (writing) { /* slashified symbol */
+ for(i = 0;i<LENGTH(exp);++i) switch (CHARS(exp)[i]) {
+ case '\\': case '\"': case '\'': case '(': case ')': case '#':
+ case 'A': case 'B': case 'C': case 'D': case 'E':
+ case 'F': case 'G': case 'H': case 'I': case 'J':
+ case 'K': case 'L': case 'M': case 'N': case 'O':
+ case 'P': case 'Q': case 'R': case 'S': case 'T':
+ case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z':
+ lputc('\\', port);
+ default:
+ lputc(CHARS(exp)[i], port);
+ }
+ break;
+ }
+ else
+ lfwrite(CHARS(exp), (sizet)sizeof(char), (sizet)LENGTH(exp), port);
break;
case tc7_vector:
lputs("#(", port);
@@ -945,7 +960,10 @@ static SCM lreadpr(tok_buf, port, flgs)
else goto unkshrp;
case '\\':
c = lgetc(port);
- j = read_token(c, tok_buf, port);
+ if ('\\'==c) {
+ CHARS(tok_buf)[0] = c;
+ j = 1;
+ } else j = read_token(c, tok_buf, port);
if (j==1) return MAKICHR(c);
for (c = 0;c<sizeof charnames/sizeof(char *);c++)
if (charnames[c]
@@ -1087,7 +1105,7 @@ static sizet read_token(ic, tok_buf, port)
register sizet j = 1;
register int c = ic;
register char *p = CHARS(tok_buf);
- p[0] = downcase[c];
+ p[0] = '\\'==c ? lgetc(port) : downcase[c];
while(1) {
if (j+1 >= LENGTH(tok_buf)) p = grow_tok_buf(tok_buf);
switch (c = lgetc(port)) {
@@ -1103,6 +1121,9 @@ static sizet read_token(ic, tok_buf, port)
case EOF:
p[j] = 0;
return j;
+ case '\\': /* slashified symbol */
+ p[j++] = lgetc(port);
+ break;
default:
p[j++] = downcase[c];
}
@@ -1260,20 +1281,25 @@ int handle_it(i)
char *name = errmsgs[i-WNA].s_response;
if (errjmp_bad || errjmp_recursive)
wta(UNDEFINED, (char *)i, ""); /* sends it to def_err_response */
+ /* NEWCELL does not defer interrupts; so be careful to maintain the
+ freelist integrity. */
if (name) {
- SCM n[2];
int j;
+ SCM n[2]; /* GC-protect discarded cells (possibly being used
+ by interrupted code). */
DEFER_INTS;
- for (j=0; j<2; j++) {
- NEWCELL(n[j]); /* discard 2 possibly-used cells */
- }
- CDR(n[1]) = EOL;
+ /* Two cells are discarded because NEWCELL may have been
+ interrupted between computing the right-hand-side of
+ freelist = CDR(freelist)
+ and assigning it to freelist. */
+ for (j=0; j<2; j++) NEWCELL(n[j]); /* discard 2 possibly-used cells */
+ CDR(n[1]) = EOL; /* lose pointer to freelist */
ALLOW_INTS;
+ /* discarding was necessary here because intern() may do NEWCELL */
proc = CDR(intern(name, (sizet)strlen(name)));
- if NIMP(proc) { /* Save environment stack, in case it
- moves when applying proc. Do an ecache gc
- to protect contents of stack. */
-
+ if NIMP(proc) { /* Save environment stack, in case it moves
+ when applying proc. Do an ecache gc to
+ protect contents of stack. */
SCM estk, *estk_ptr, env, env_tmp;
DEFER_INTS;
#ifndef NO_ENV_CACHE
@@ -1299,6 +1325,10 @@ int handle_it(i)
return i;
}
}
+ /* Ensure that freelist is not empty when returning from interrupt */
+ DEFER_INTS;
+ scm_fill_freelist();
+ ALLOW_INTS;
return errmsgs[i-WNA].parent_err;
}
@@ -1314,13 +1344,12 @@ SCM scm_top_level(initpath, toplvl_fun)
#else
long i;
#endif
+ if (!toplvl_fun) toplvl_fun = repl;
CONT(rootcont)->stkbse = (STACKITEM *)&i;
i = setjump(CONT(rootcont)->jmpbuf);
#ifndef SHORT_INT
if (i) i = UNCOOK(i);
#endif
- if (!toplvl_fun) toplvl_fun = repl;
- /* printf("scm_top_level got %d\n", i); */
drloop:
switch ((int)i) {
default:
@@ -1914,16 +1943,17 @@ static void err_head(str)
int oerrno = errno;
exitval = MAKINUM(EXIT_FAILURE);
if (NIMP(cur_outp) && OPOUTPORTP(cur_outp)) lfflush(cur_outp);
- for (lps = loadports; NIMP(lps); lps = CDR(lps)) {
- lputs(lps==loadports ? "\n;While loading " : "\n ;loaded from ",
- cur_errp);
- iprin1(scm_port_filename(CAR(lps)), cur_errp, 1);
- lputs(", line ", cur_errp);
- iprin1(scm_port_line(CAR(lps)), cur_errp, 1);
- lputs(": ", cur_errp);
+ lps = IMP(loadports) ? loadports : CDR(loadports);
+ if (NIMP(lps)) {
+ lputs("\n;In file loaded from ", cur_errp);
+ for (; NIMP(lps); lps = CDR(lps)) {
+ iprin1(scm_port_filename(CAR(lps)), cur_errp, 0);
+ lputs(":", cur_errp);
+ iprin1(scm_port_line(CAR(lps)), cur_errp, 1);
+ lputs(IMP(CDR(lps)) ? ":" : ",\n; loaded from ", cur_errp);
+ }
}
- if (NIMP(loadports) && NIMP(CDR(loadports)))
- lputs("\n;", cur_errp);
+ lputs("\n;", cur_errp);
lfflush(cur_errp);
errno = oerrno;
/* if (NIMP(cur_errp) && stderr==STREAM(cur_errp)) { ... } */
diff --git a/scl.c b/scl.c
index 13f6023..2858989 100644
--- a/scl.c
+++ b/scl.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1997, 2005 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -140,13 +140,13 @@ static double lpow10(x, n)
return x/p10[-n];
}
-int NaN2str(f, a)
+int inf2str(f, a)
double f;
char *a;
{
sizet ch = 0;
if (f < 0.0) a[ch++] = '-';
- a[ch++] = IS_INF(f)?'1':'0';
+ a[ch++] = (f != f) ? '0' : '1';
a[ch++] = '/'; a[ch++] = '0';
return ch;
}
@@ -164,10 +164,10 @@ static sizet idbl2str(f, a)
sizet ch = 0;
if (f==0.0) {exp = 0; goto zero;} /*{a[0]='0'; a[1]='.'; a[2]='0'; return 3;}*/
- if IS_INF(f) return NaN2str(f, a);
+ if (f==2*f) return inf2str(f, a);
if (f < 0.0) {f = -f;a[ch++]='-';}
else if (f > 0.0) ;
- else return NaN2str(f, a);
+ else return inf2str(f, a);
exp = apx_log10(f);
f = lpow10(f, -exp);
fprec = lpow10(fprec, -exp);
@@ -177,12 +177,12 @@ static sizet idbl2str(f, a)
while (f < 1.0) {
f *= 10.0;
fprec *= 10.0;
- if (exp-- < DBL_MIN_10_EXP - DBL_DIG - 1) return NaN2str(f, a);
+ if (exp-- < DBL_MIN_10_EXP - DBL_DIG - 1) return inf2str(f, a);
}
while (f > 10.0) {
f /= 10.0;
fprec /= 10.0;
- if (exp++ > DBL_MAX_10_EXP) return NaN2str(f, a);
+ if (exp++ > DBL_MAX_10_EXP) return inf2str(f, a);
}
# else
while (f < 1.0) {f *= 10.0; fprec *= 10.0; exp--;}
@@ -264,6 +264,7 @@ static sizet iflo2str(flt, str)
else
# endif
i = idbl2str(REAL(flt), str);
+ if (scm_narn==flt) return i;
if CPLXP(flt) {
if (!(0 > IMAG(flt))) str[i++] = '+';
i += idbl2str(IMAG(flt), &str[i]);
@@ -685,9 +686,9 @@ SCM istr2flo(str, len, radix)
switch (c = str[i]) {
case DIGITS:
expon = expon*10 + c-'0';
-/* if (expon > MAXEXP) */
-/* if (1==expsgn || expon > (MAXEXP + dblprec + 1)) */
-/* return BOOL_F; /\* exponent too large *\/ */
+/* if (expon > MAXEXP) */
+/* if (1==expsgn || expon > (MAXEXP + dblprec + 1)) */
+/* return BOOL_F; /\* exponent too large *\/ */
break;
default:
goto out4;
@@ -804,6 +805,12 @@ SCM makdbl (x, y)
{
SCM z;
if ((y==0.0) && (x==0.0)) return flo0;
+# ifndef _MSC_VER
+# ifndef SINGLESONLY
+ if ((y != y) || (x != x) || (y==(2 * y) && y != 0.0)) return scm_narn;
+ if ((x==(2 * x)) && (x != 0.0) && (y != 0.0)) return scm_narn;
+# endif
+# endif
DEFER_INTS;
if (y==0.0) {
# ifdef SINGLES
@@ -962,13 +969,12 @@ SCM bigequal(x, y)
}
#endif
#ifdef FLOATS
-# define REALLY_UNEQUAL(x,y) ((x) != (y) && !((x)!=(x) && (y)!=(y)))
SCM floequal(x, y)
SCM x, y;
{
- if (REALLY_UNEQUAL(REALPART(x), REALPART(y))) return BOOL_F;
+ if ((REALPART(x) != REALPART(y))) return BOOL_F;
if (CPLXP(x))
- return (CPLXP(y) && !REALLY_UNEQUAL(IMAG(x), IMAG(y))) ? BOOL_T : BOOL_F;
+ return (CPLXP(y) && (IMAG(x)==IMAG(y))) ? BOOL_T : BOOL_F;
return CPLXP(y) ? BOOL_F : BOOL_T;
}
#endif
@@ -1008,20 +1014,27 @@ SCM equal(x, y)
}
}
-SCM numberp(x)
- SCM x;
+SCM numberp(obj)
+ SCM obj;
{
- if INUMP(x) return BOOL_T;
+ if INUMP(obj) return BOOL_T;
#ifdef FLOATS
- if (NIMP(x) && NUMP(x)) return BOOL_T;
+ if (NIMP(obj) && NUMP(obj)) return BOOL_T;
#else
# ifdef BIGDIG
- if (NIMP(x) && NUMP(x)) return BOOL_T;
+ if (NIMP(obj) && NUMP(obj)) return BOOL_T;
# endif
#endif
return BOOL_F;
}
#ifdef FLOATS
+SCM scm_complex_p(obj)
+ SCM obj;
+{
+ if (obj==scm_narn) return BOOL_F;
+ return numberp(obj);
+}
+
# ifdef BIGDIG
int scm_bigdblcomp(b, d)
SCM b;
@@ -1056,6 +1069,21 @@ SCM realp(x)
# endif
return BOOL_F;
}
+SCM scm_rationalp(x)
+ SCM x;
+{
+ if INUMP(x) return BOOL_T;
+ if IMP(x) return BOOL_F;
+ if REALP(x) {
+ float y = REALPART(x);
+ if (y==2*y && y != 0.0) return BOOL_F;
+ return BOOL_T;
+ }
+# ifdef BIGDIG
+ if BIGP(x) return BOOL_T;
+# endif
+ return BOOL_F;
+}
SCM intp(x)
SCM x;
{
@@ -1068,8 +1096,9 @@ SCM intp(x)
if (!INEXP(x)) return BOOL_F;
if CPLXP(x) return BOOL_F;
r = REALPART(x);
- if (r==floor(r)) return BOOL_T;
- return BOOL_F;
+ if (r != floor(r)) return BOOL_F;
+ if (r==2*r && r != 0.0) return BOOL_F;
+ return BOOL_T;
}
#endif /* FLOATS */
@@ -2079,6 +2108,9 @@ SCM scm_intexpt(z1, z2)
acc = long2num(iacc);
break;
}
+ if (0==iz1)
+ if (0==recip) return z1;
+ else goto overflow;
if (1==z2) {
tmp = iacc*iz1;
if (tmp/iacc != iz1) {
@@ -2356,7 +2388,7 @@ SCM in2ex(z)
SCM ans = MAKINUM((long)u);
if (INUM(ans)==(long)u) return ans;
}
- ASRTGO(!(IS_INF(u) || (u)!=(u)), badz); /* problem? */
+ ASRTGO(!((u==2*u) || (u)!=(u)), badz); /* problem? */
return dbl2big(u);
}
# else
@@ -2647,11 +2679,11 @@ SCM hashq(obj, n)
static iproc subr1s[] = {
{"number?", numberp},
- {"complex?", numberp},
{s_inexactp, inexactp},
#ifdef FLOATS
+ {"complex?", scm_complex_p},
{"real?", realp},
- {"rational?", realp},
+ {"rational?", scm_rationalp},
{"integer?", intp},
{s_real_part, real_part},
{s_imag_part, imag_part},
@@ -2663,6 +2695,7 @@ static iproc subr1s[] = {
{s_dfloat_parts, scm_dfloat_parts},
# endif
#else
+ {"complex?", numberp},
{"real?", numberp},
{"rational?", numberp},
{"integer?", exactp},
@@ -2791,6 +2824,13 @@ void init_scl()
REAL(flo0) = 0.0;
ALLOW_INTS;
# endif
+# ifndef _MSC_VER
+ DEFER_INTS;
+ scm_narn = must_malloc_cell(2L*sizeof(double), (SCM)tc_dblc, "complex");
+ REAL(scm_narn) = 0.0/0.0;
+ IMAG(scm_narn) = 0.0/0.0;
+ ALLOW_INTS;
+# endif
# ifdef DBL_DIG
dblprec = (DBL_DIG > 20) ? 20 : DBL_DIG;
# else
diff --git a/scm.h b/scm.h
index 504f849..4fb3afe 100644
--- a/scm.h
+++ b/scm.h
@@ -80,22 +80,15 @@ typedef struct {const char *name;} subr_info;
#include "scmfig.h"
#ifdef _WIN32
-# ifdef DLLSCM
+# ifdef SCM_WIN_DLL
# define SCM_DLL_EXPORT __declspec(dllexport)
-# define SCM_DLL_IMPORT __declspec(dllimport)
-# ifdef SCM_DLL
-# define SCM_EXPORT SCM_DLL_EXPORT
-# else
-# define SCM_EXPORT SCM_DLL_IMPORT
-# endif
+# define SCM_EXPORT SCM_DLL_EXPORT
# else
# define SCM_DLL_EXPORT /**/
-# define SCM_DLL_IMPORT extern
# define SCM_EXPORT extern
-# endif
+# endif
#else
# define SCM_DLL_EXPORT /**/
-# define SCM_DLL_IMPORT extern
# define SCM_EXPORT extern
#endif
@@ -115,31 +108,31 @@ typedef struct {
#endif
#ifndef STDC_HEADERS
- int isatty P((int));
+ int isatty P((int));
#endif
typedef struct {
- SCM (*mark)P((SCM));
- sizet (*free)P((CELLPTR));
- int (*print)P((SCM exp, SCM port, int writing));
- SCM (*equalp)P((SCM, SCM));
+ SCM (*mark)P((SCM));
+ sizet (*free)P((CELLPTR));
+ int (*print)P((SCM exp, SCM port, int writing));
+ SCM (*equalp)P((SCM, SCM));
} smobfuns;
typedef struct {
- char *name;
- SCM (*mark)P((SCM ptr));
- int (*free)P((FILE *p));
- int (*print)P((SCM exp, SCM port, int writing));
- SCM (*equalp)P((SCM, SCM));
- int (*fputc)P((int c, FILE *p));
-/* int (*fputs)P((char *s, FILE *p)); */
-/* sizet (*fwrite)P((char *s, sizet siz, sizet num, FILE *p)); */
- int (*fputs)P((const char *s, FILE *p));
+ char *name;
+ SCM (*mark)P((SCM ptr));
+ int (*free)P((FILE *p));
+ int (*print)P((SCM exp, SCM port, int writing));
+ SCM (*equalp)P((SCM, SCM));
+ int (*fputc)P((int c, FILE *p));
+/* int (*fputs)P((char *s, FILE *p)); */
+/* sizet (*fwrite)P((char *s, sizet siz, sizet num, FILE *p)); */
+ int (*fputs)P((const char *s, FILE *p));
sizet (*fwrite)P((const void *s, sizet siz, sizet num, FILE *p));
- int (*fflush)P((FILE *stream));
- int (*fgetc)P((FILE *p));
- int (*fclose)P((FILE *p));
- int (*ungetc)P((int c, SCM p));
+ int (*fflush)P((FILE *stream));
+ int (*fgetc)P((FILE *p));
+ int (*fclose)P((FILE *p));
+ int (*ungetc)P((int c, SCM p));
} ptobfuns;
typedef struct {
@@ -184,7 +177,7 @@ typedef struct {SCM type;double *real;} dbl;
#define ICHR(x) ((unsigned char)((x)>>8))
#define MAKICHR(x) (((x)<<8)+0xf4L)
-#define ILOC00 (0x000000fcL)
+#define ILOC00 (0x000000fcL)
#define ILOCP(n) ((0xff & (int)(n))==(int)ILOC00)
#define MAKILOC(if, id) (ILOC00 + (((long)id)<<8) + (((long)if)<<16))
#define IDIST(n) (((int)(n)>>8) & 0x7f)
@@ -484,45 +477,45 @@ SCM_EXPORT long tc16_array;
#define SCM_SET_PTOBNUM(x, typ) (CAR(x)=(typ)|(CAR(x) & ~0x0ffffL))
#define DIGITS '0':case '1':case '2':case '3':case '4':\
- case '5':case '6':case '7':case '8':case '9'
+ case '5':case '6':case '7':case '8':case '9'
/* Aggregated types for dispatch in switch statements. */
#define tcs_cons_inum 2: case 6:case 10:case 14:\
- case 18:case 22:case 26:case 30:\
- case 34:case 38:case 42:case 46:\
- case 50:case 54:case 58:case 62:\
- case 66:case 70:case 74:case 78:\
- case 82:case 86:case 90:case 94:\
- case 98:case 102:case 106:case 110:\
- case 114:case 118:case 122:case 126
+ case 18:case 22:case 26:case 30:\
+ case 34:case 38:case 42:case 46:\
+ case 50:case 54:case 58:case 62:\
+ case 66:case 70:case 74:case 78:\
+ case 82:case 86:case 90:case 94:\
+ case 98:case 102:case 106:case 110:\
+ case 114:case 118:case 122:case 126
#define tcs_cons_iloc 124
#define tcs_cons_ispcsym 4:case 12:case 20:case 28:\
- case 36:case 44:case 52:case 60:\
- case 68:case 76:case 84:case 92:\
- case 100:case 108
-#define tcs_cons_chflag 116 /* char *or* flag */
+ case 36:case 44:case 52:case 60:\
+ case 68:case 76:case 84:case 92:\
+ case 100:case 108
+#define tcs_cons_chflag 116 /* char *or* flag */
#define tcs_cons_imcar tcs_cons_inum:\
- case tcs_cons_iloc:\
- case tcs_cons_ispcsym:\
- case tcs_cons_chflag
+ case tcs_cons_iloc:\
+ case tcs_cons_ispcsym:\
+ case tcs_cons_chflag
#define tcs_cons_nimcar 0:case 8:case 16:case 24:\
- case 32:case 40:case 48:case 56:\
- case 64:case 72:case 80:case 88:\
- case 96:case 104:case 112:case 120
+ case 32:case 40:case 48:case 56:\
+ case 64:case 72:case 80:case 88:\
+ case 96:case 104:case 112:case 120
#define tcs_cons_gloc 1:case 9:case 17:case 25:\
- case 33:case 41:case 49:case 57:\
- case 65:case 73:case 81:case 89:\
- case 97:case 105:case 113:case 121
+ case 33:case 41:case 49:case 57:\
+ case 65:case 73:case 81:case 89:\
+ case 97:case 105:case 113:case 121
#define tcs_closures 3:case 11:case 19:case 27:\
- case 35:case 43:case 51:case 59:\
- case 67:case 75:case 83:case 91:\
- case 99:case 107:case 115:case 123
+ case 35:case 43:case 51:case 59:\
+ case 67:case 75:case 83:case 91:\
+ case 99:case 107:case 115:case 123
#define tcs_subrs tc7_asubr:case tc7_subr_0:case tc7_subr_1:case tc7_cxr:\
- case tc7_subr_3:case tc7_subr_2:case tc7_rpsubr:case tc7_subr_1o:\
- case tc7_subr_2o:case tc7_lsubr_2:case tc7_lsubr
+ case tc7_subr_3:case tc7_subr_2:case tc7_rpsubr:case tc7_subr_1o:\
+ case tc7_subr_2o:case tc7_lsubr_2:case tc7_lsubr
#define tcs_symbols tc7_ssymbol:case tc7_msymbol
#define tcs_bignums tc16_bigpos:case tc16_bigneg
#define tcs_uves tc7_string:case tc7_bvect:\
@@ -531,74 +524,74 @@ SCM_EXPORT long tc16_array;
#define tc3_cons_nimcar 0
#define tc3_cons_imcar 2:case 4:case 6
-#define tc3_cons_gloc 1
-#define tc3_closure 3
-#define tc3_tc7_types 5:case 7
-
-#define tc7_ssymbol 5
-#define tc7_msymbol 7
-#define tc7_string 13
-#define tc7_vector 15
-#define tc7_bvect 21
+#define tc3_cons_gloc 1
+#define tc3_closure 3
+#define tc3_tc7_types 5:case 7
+
+#define tc7_ssymbol 5
+#define tc7_msymbol 7
+#define tc7_string 13
+#define tc7_vector 15
+#define tc7_bvect 21
/* spare 23 */
-#define tc7_ivect 29
-#define tc7_uvect 31
-#define tc7_svect 37
+#define tc7_ivect 29
+#define tc7_uvect 31
+#define tc7_svect 37
/* spare 39 */
-#define tc7_fvect 45
-#define tc7_dvect 47
-#define tc7_cvect 53
-#define tc7_port 55
-#define tc7_contin 61
-#define tc7_specfun 63
+#define tc7_fvect 45
+#define tc7_dvect 47
+#define tc7_cvect 53
+#define tc7_port 55
+#define tc7_contin 61
+#define tc7_specfun 63
/* spare 69 71 77 79 */
-#define tc7_subr_0 85
-#define tc7_subr_1 87
-#define tc7_cxr 93
-#define tc7_subr_3 95
-#define tc7_subr_2 101
-#define tc7_asubr 103
-#define tc7_subr_1o 109
-#define tc7_subr_2o 111
-#define tc7_lsubr_2 117
-#define tc7_lsubr 119
-#define tc7_rpsubr 125
-
-#define tc7_smob 127
-#define tc_free_cell 127
+#define tc7_subr_0 85
+#define tc7_subr_1 87
+#define tc7_cxr 93
+#define tc7_subr_3 95
+#define tc7_subr_2 101
+#define tc7_asubr 103
+#define tc7_subr_1o 109
+#define tc7_subr_2o 111
+#define tc7_lsubr_2 117
+#define tc7_lsubr 119
+#define tc7_rpsubr 125
+
+#define tc7_smob 127
+#define tc_free_cell 127
#define tc_broken_heart (tc_free_cell+0x10000)
-#define tc16_apply (tc7_specfun | (0L<<8))
-#define tc16_call_cc (tc7_specfun | (1L<<8))
-#define tc16_cclo (tc7_specfun | (2L<<8))
-#define tc16_eval (tc7_specfun | (3L<<8))
-#define tc16_values (tc7_specfun | (4L<<8))
-#define tc16_call_wv (tc7_specfun | (5L<<8))
+#define tc16_apply (tc7_specfun | (0L<<8))
+#define tc16_call_cc (tc7_specfun | (1L<<8))
+#define tc16_cclo (tc7_specfun | (2L<<8))
+#define tc16_eval (tc7_specfun | (3L<<8))
+#define tc16_values (tc7_specfun | (4L<<8))
+#define tc16_call_wv (tc7_specfun | (5L<<8))
-#define tc16_flo 0x017f
-#define tc_flo 0x017fL
+#define tc16_flo 0x017f
+#define tc_flo 0x017fL
-#define REAL_PART (1L<<16)
-#define IMAG_PART (2L<<16)
-#define tc_dblr (tc16_flo|REAL_PART)
-#define tc_dblc (tc16_flo|REAL_PART|IMAG_PART)
+#define REAL_PART (1L<<16)
+#define IMAG_PART (2L<<16)
+#define tc_dblr (tc16_flo|REAL_PART)
+#define tc_dblc (tc16_flo|REAL_PART|IMAG_PART)
-#define tc16_bigpos 0x027f
-#define tc16_bigneg 0x037f
+#define tc16_bigpos 0x027f
+#define tc16_bigneg 0x037f
/* The first four flags fit in the car of a port cell, remaining
flags only in the port table */
-#define OPN (1L<<16)
-#define RDNG (2L<<16)
-#define WRTNG (4L<<16)
-#define CRDY (8L<<16)
+#define OPN (1L<<16)
+#define RDNG (2L<<16)
+#define WRTNG (4L<<16)
+#define CRDY (8L<<16)
-#define TRACKED (16L<<16)
-#define BINARY (32L<<16)
-#define BUF0 (64L<<16)
-#define EXCLUSIVE (128L<<16)
- /* LSB is used for gc mark */
+#define TRACKED (16L<<16)
+#define BINARY (32L<<16)
+#define BUF0 (64L<<16)
+#define EXCLUSIVE (128L<<16)
+ /* LSB is used for gc mark */
SCM_EXPORT scm_gra subrs_gra;
#define subrs ((subr_info *)(subrs_gra.elts))
@@ -622,29 +615,30 @@ SCM_EXPORT long tc16_dir;
SCM_EXPORT long tc16_clport;
SCM_EXPORT SCM sys_protects[];
-#define cur_inp sys_protects[0]
-#define cur_outp sys_protects[1]
-#define cur_errp sys_protects[2]
+#define cur_inp sys_protects[0]
+#define cur_outp sys_protects[1]
+#define cur_errp sys_protects[2]
#define def_inp sys_protects[3]
-#define def_outp sys_protects[4]
-#define def_errp sys_protects[5]
-#define sys_errp sys_protects[6]
-#define sys_safep sys_protects[7]
-#define listofnull sys_protects[8]
-#define undefineds sys_protects[9]
-#define nullvect sys_protects[10]
-#define nullstr sys_protects[11]
-#define progargs sys_protects[12]
-#define loadports sys_protects[13]
-#define rootcont sys_protects[14]
-#define dynwinds sys_protects[15]
+#define def_outp sys_protects[4]
+#define def_errp sys_protects[5]
+#define sys_errp sys_protects[6]
+#define sys_safep sys_protects[7]
+#define listofnull sys_protects[8]
+#define undefineds sys_protects[9]
+#define nullvect sys_protects[10]
+#define nullstr sys_protects[11]
+#define progargs sys_protects[12]
+#define loadports sys_protects[13]
+#define rootcont sys_protects[14]
+#define dynwinds sys_protects[15]
#define list_unspecified sys_protects[16]
-#define f_evapply sys_protects[17]
-#define eval_env sys_protects[18]
+#define f_evapply sys_protects[17]
+#define eval_env sys_protects[18]
#define f_apply_closure sys_protects[19]
-#define flo0 sys_protects[20]
-#define scm_uprotects sys_protects[21]
-#define NUM_PROTECTS 22
+#define flo0 sys_protects[20]
+#define scm_uprotects sys_protects[21]
+#define scm_narn sys_protects[22]
+#define NUM_PROTECTS 23
/* now for connects between source files */
@@ -684,7 +678,7 @@ SCM_EXPORT const char dirsep[];
/* strings used in several source files */
-SCM_EXPORT char s_read[], s_write[], s_newline[], s_system[];
+SCM_EXPORT char s_write[], s_newline[], s_system[];
SCM_EXPORT char s_make_string[], s_make_vector[], s_list[], s_op_pipe[];
#define s_string (s_make_string+5)
#define s_vector (s_make_vector+5)
@@ -706,315 +700,315 @@ SCM_EXPORT void (*init_user_scm) P((void));
/* function prototypes */
SCM_EXPORT void (* deferred_proc) P((void));
-SCM_EXPORT void process_signals P((void));
-SCM_EXPORT int handle_it P((int i));
-SCM_EXPORT SCM must_malloc_cell P((long len, SCM c, char *what));
-SCM_EXPORT void must_realloc_cell P((SCM z, long olen, long len, char *what));
-SCM_EXPORT char *must_malloc P((long len, char *what));
-SCM_EXPORT char *must_realloc P((char *where, long olen, long len, char *what));
-SCM_EXPORT void must_free P((char *obj, sizet len));
-SCM_EXPORT void scm_protect_temp P((SCM *ptr));
-SCM_EXPORT long ilength P((SCM sx));
-SCM_EXPORT SCM hash P((SCM obj, SCM n));
-SCM_EXPORT SCM hashv P((SCM obj, SCM n));
-SCM_EXPORT SCM hashq P((SCM obj, SCM n));
-SCM_EXPORT SCM obhash P((SCM obj));
-SCM_EXPORT SCM obunhash P((SCM obj));
+SCM_EXPORT void process_signals P((void));
+SCM_EXPORT int handle_it P((int i));
+SCM_EXPORT SCM must_malloc_cell P((long len, SCM c, char *what));
+SCM_EXPORT void must_realloc_cell P((SCM z, long olen, long len, char *what));
+SCM_EXPORT char *must_malloc P((long len, char *what));
+SCM_EXPORT char *must_realloc P((char *where, long olen, long len, char *what));
+SCM_EXPORT void must_free P((char *obj, sizet len));
+SCM_EXPORT void scm_protect_temp P((SCM *ptr));
+SCM_EXPORT long ilength P((SCM sx));
+SCM_EXPORT SCM hash P((SCM obj, SCM n));
+SCM_EXPORT SCM hashv P((SCM obj, SCM n));
+SCM_EXPORT SCM hashq P((SCM obj, SCM n));
+SCM_EXPORT SCM obhash P((SCM obj));
+SCM_EXPORT SCM obunhash P((SCM obj));
SCM_EXPORT unsigned long strhash P((unsigned char *str, sizet len, unsigned long n));
SCM_EXPORT unsigned long hasher P((SCM obj, unsigned long n, sizet d));
-SCM_EXPORT SCM lroom P((SCM args));
-SCM_EXPORT SCM lflush P((SCM port));
-SCM_EXPORT void scm_init_gra P((scm_gra *gra, sizet eltsize, sizet len,
- sizet maxlen, char *what));
-SCM_EXPORT int scm_grow_gra P((scm_gra *gra, char *elt));
-SCM_EXPORT void scm_trim_gra P((scm_gra *gra));
-SCM_EXPORT void scm_free_gra P((scm_gra *gra));
-SCM_EXPORT long newsmob P((smobfuns *smob));
-SCM_EXPORT long newptob P((ptobfuns *ptob));
-SCM_EXPORT SCM scm_port_entry P((FILE *stream, long ptype, long flags));
-SCM_EXPORT SCM scm_open_ports P((void));
-SCM_EXPORT void prinport P((SCM exp, SCM port, char *type));
-SCM_EXPORT SCM repl P((void));
-SCM_EXPORT void repl_report P((void));
-SCM_EXPORT void growth_mon P((char *obj, long size, char *units, int grewp));
-SCM_EXPORT void gc_start P((char *what));
-SCM_EXPORT void gc_end P((void));
-SCM_EXPORT void gc_mark P((SCM p));
-SCM_EXPORT void scm_gc_hook P((void));
+SCM_EXPORT SCM lroom P((SCM args));
+SCM_EXPORT SCM lflush P((SCM port));
+SCM_EXPORT void scm_init_gra P((scm_gra *gra, sizet eltsize, sizet len,
+ sizet maxlen, char *what));
+SCM_EXPORT int scm_grow_gra P((scm_gra *gra, char *elt));
+SCM_EXPORT void scm_trim_gra P((scm_gra *gra));
+SCM_EXPORT void scm_free_gra P((scm_gra *gra));
+SCM_EXPORT long newsmob P((smobfuns *smob));
+SCM_EXPORT long newptob P((ptobfuns *ptob));
+SCM_EXPORT SCM scm_port_entry P((FILE *stream, long ptype, long flags));
+SCM_EXPORT SCM scm_open_ports P((void));
+SCM_EXPORT void prinport P((SCM exp, SCM port, char *type));
+SCM_EXPORT SCM repl P((void));
+SCM_EXPORT void repl_report P((void));
+SCM_EXPORT void growth_mon P((char *obj, long size, char *units, int grewp));
+SCM_EXPORT void gc_start P((char *what));
+SCM_EXPORT void gc_end P((void));
+SCM_EXPORT void gc_mark P((SCM p));
+SCM_EXPORT void scm_gc_hook P((void));
SCM_EXPORT SCM scm_gc_protect P((SCM obj));
-SCM_EXPORT SCM scm_add_finalizer P((SCM value, SCM finalizer));
-SCM_EXPORT void scm_run_finalizers P((int exiting));
+SCM_EXPORT SCM scm_add_finalizer P((SCM value, SCM finalizer));
+SCM_EXPORT void scm_run_finalizers P((int exiting));
SCM_EXPORT void scm_egc_start P((void));
SCM_EXPORT void scm_egc_end P((void));
-SCM_EXPORT void heap_report P((void));
-SCM_EXPORT void gra_report P((void));
-SCM_EXPORT void exit_report P((void));
-SCM_EXPORT void stack_report P((void));
-SCM_EXPORT SCM scm_stack_trace P((SCM contin));
-SCM_EXPORT SCM scm_scope_trace P((SCM env));
-SCM_EXPORT SCM scm_frame_trace P((SCM contin, SCM nf));
-SCM_EXPORT SCM scm_frame2env P((SCM contin, SCM nf));
-SCM_EXPORT SCM scm_frame_eval P((SCM contin, SCM nf, SCM expr));
-SCM_EXPORT void iprin1 P((SCM exp, SCM port, int writing));
-SCM_EXPORT void intprint P((long n, int radix, SCM port));
-SCM_EXPORT void iprlist P((char *hdr, SCM exp, int tlr, SCM port, int writing));
-SCM_EXPORT SCM scm_env_lookup P((SCM var, SCM stenv));
-SCM_EXPORT SCM scm_env_rlookup P((SCM addr, SCM stenv, char *what));
-SCM_EXPORT SCM scm_env_getprop P((SCM prop, SCM env));
-SCM_EXPORT SCM scm_env_addprop P((SCM prop, SCM val, SCM env));
-SCM_EXPORT long num_frames P((SCM estk, int i));
-SCM_EXPORT SCM *estk_frame P((SCM estk, int i, int nf));
-SCM_EXPORT SCM *cont_frame P((SCM contin, int nf));
-SCM_EXPORT SCM stacktrace1 P((SCM estk, int i));
-SCM_EXPORT void scm_princode P((SCM code, SCM env, SCM port, int writing));
-SCM_EXPORT void scm_princlosure P((SCM proc, SCM port, int writing));
-SCM_EXPORT void lputc P((int c, SCM port));
-SCM_EXPORT void lputs P((char *s, SCM port));
-SCM_EXPORT sizet lfwrite P((char *ptr, sizet size, sizet nitems, SCM port));
-SCM_EXPORT int lgetc P((SCM port));
-SCM_EXPORT void lungetc P((int c, SCM port));
-SCM_EXPORT char *grow_tok_buf P((SCM tok_buf));
-SCM_EXPORT long mode_bits P((char *modes, char *cmodes));
-SCM_EXPORT long time_in_msec P((long x));
-SCM_EXPORT SCM my_time P((void));
-SCM_EXPORT SCM your_time P((void));
-SCM_EXPORT void init_iprocs P((iproc *subra, int type));
-
-SCM_EXPORT void final_scm P((int));
-SCM_EXPORT void init_sbrk P((void));
-SCM_EXPORT int init_buf0 P((FILE *inport));
-SCM_EXPORT void scm_init_from_argv P((int argc, char **argv, char *script_arg,
- int iverbose, int buf0stdin));
-SCM_EXPORT void init_signals P((void));
-SCM_EXPORT SCM scm_top_level P((char *initpath, SCM (*toplvl_fun)()));
-SCM_EXPORT void restore_signals P((void));
-SCM_EXPORT void free_storage P((void));
-SCM_EXPORT char *dld_find_executable P((const char* command));
-SCM_EXPORT char *scm_find_execpath P((int argc, char **argv, char *script_arg));
-SCM_EXPORT void init_scm P((int iverbose, int buf0stdin, long init_heap_size));
+SCM_EXPORT void heap_report P((void));
+SCM_EXPORT void gra_report P((void));
+SCM_EXPORT void exit_report P((void));
+SCM_EXPORT void stack_report P((void));
+SCM_EXPORT SCM scm_stack_trace P((SCM contin));
+SCM_EXPORT SCM scm_scope_trace P((SCM env));
+SCM_EXPORT SCM scm_frame_trace P((SCM contin, SCM nf));
+SCM_EXPORT SCM scm_frame2env P((SCM contin, SCM nf));
+SCM_EXPORT SCM scm_frame_eval P((SCM contin, SCM nf, SCM expr));
+SCM_EXPORT void iprin1 P((SCM exp, SCM port, int writing));
+SCM_EXPORT void intprint P((long n, int radix, SCM port));
+SCM_EXPORT void iprlist P((char *hdr, SCM exp, int tlr, SCM port, int writing));
+SCM_EXPORT SCM scm_env_lookup P((SCM var, SCM stenv));
+SCM_EXPORT SCM scm_env_rlookup P((SCM addr, SCM stenv, char *what));
+SCM_EXPORT SCM scm_env_getprop P((SCM prop, SCM env));
+SCM_EXPORT SCM scm_env_addprop P((SCM prop, SCM val, SCM env));
+SCM_EXPORT long num_frames P((SCM estk, int i));
+SCM_EXPORT SCM *estk_frame P((SCM estk, int i, int nf));
+SCM_EXPORT SCM *cont_frame P((SCM contin, int nf));
+SCM_EXPORT SCM stacktrace1 P((SCM estk, int i));
+SCM_EXPORT void scm_princode P((SCM code, SCM env, SCM port, int writing));
+SCM_EXPORT void scm_princlosure P((SCM proc, SCM port, int writing));
+SCM_EXPORT void lputc P((int c, SCM port));
+SCM_EXPORT void lputs P((char *s, SCM port));
+SCM_EXPORT sizet lfwrite P((char *ptr, sizet size, sizet nitems, SCM port));
+SCM_EXPORT int lgetc P((SCM port));
+SCM_EXPORT void lungetc P((int c, SCM port));
+SCM_EXPORT char *grow_tok_buf P((SCM tok_buf));
+SCM_EXPORT long mode_bits P((char *modes, char *cmodes));
+SCM_EXPORT long time_in_msec P((long x));
+SCM_EXPORT SCM my_time P((void));
+SCM_EXPORT SCM your_time P((void));
+SCM_EXPORT void init_iprocs P((iproc *subra, int type));
+
+SCM_EXPORT void final_scm P((int));
+SCM_EXPORT void init_sbrk P((void));
+SCM_EXPORT int init_buf0 P((FILE *inport));
+SCM_EXPORT void scm_init_from_argv P((int argc, char **argv, char *script_arg,
+ int iverbose, int buf0stdin));
+SCM_EXPORT void init_signals P((void));
+SCM_EXPORT SCM scm_top_level P((char *initpath, SCM (*toplvl_fun)()));
+SCM_EXPORT void restore_signals P((void));
+SCM_EXPORT void free_storage P((void));
+SCM_EXPORT char *dld_find_executable P((const char* command));
+SCM_EXPORT char *scm_find_execpath P((int argc, char **argv, char *script_arg));
+SCM_EXPORT void init_scm P((int iverbose, int buf0stdin, long init_heap_size));
SCM_EXPORT void scm_init_INITS P((void));
-SCM_EXPORT SCM scm_init_extensions P((void));
-SCM_EXPORT void ignore_signals P((void));
-SCM_EXPORT void unignore_signals P((void));
+SCM_EXPORT SCM scm_init_extensions P((void));
+SCM_EXPORT void ignore_signals P((void));
+SCM_EXPORT void unignore_signals P((void));
-SCM_EXPORT void add_feature P((char *str));
-SCM_EXPORT int raprin1 P((SCM exp, SCM port, int writing));
-SCM_EXPORT SCM markcdr P((SCM ptr));
+SCM_EXPORT void add_feature P((char *str));
+SCM_EXPORT int raprin1 P((SCM exp, SCM port, int writing));
+SCM_EXPORT SCM markcdr P((SCM ptr));
#define mark0 (0) /*SCM mark0 P((SCM ptr)); */
-SCM_EXPORT SCM equal0 P((SCM ptr1, SCM ptr2));
-SCM_EXPORT sizet free0 P((CELLPTR ptr));
-SCM_EXPORT void scm_warn P((char *str1, char *str2, SCM obj));
-SCM_EXPORT void everr P((SCM exp, SCM env, SCM arg, char *pos, char *s_subr, int codep));
-SCM_EXPORT void wta P((SCM arg, char *pos, char *s_subr));
-SCM_EXPORT void scm_experr P((SCM arg, char *pos, char *s_subr));
-SCM_EXPORT SCM intern P((char *name, sizet len));
-SCM_EXPORT SCM sysintern P((const char *name, SCM val));
-SCM_EXPORT SCM sym2vcell P((SCM sym));
-SCM_EXPORT SCM makstr P((long len));
-SCM_EXPORT SCM scm_maksubr P((const char *name, int type, SCM (*fcn)()));
-SCM_EXPORT SCM make_subr P((const char *name, int type, SCM (*fcn)()));
-SCM_EXPORT SCM make_synt P((const char *name, long flags, SCM (*fcn)()));
-SCM_EXPORT SCM make_gsubr P((const char *name, int req, int opt, int rst,
- SCM (*fcn)()));
-SCM_EXPORT SCM closure P((SCM code, int nargs));
-SCM_EXPORT SCM makprom P((SCM code));
-SCM_EXPORT SCM force P((SCM x));
-SCM_EXPORT SCM makarb P((SCM name));
-SCM_EXPORT SCM tryarb P((SCM arb));
-SCM_EXPORT SCM relarb P((SCM arb));
-SCM_EXPORT SCM ceval P((SCM x, SCM static_env, SCM env));
-SCM_EXPORT SCM scm_wrapcode P((SCM code, SCM env));
-SCM_EXPORT SCM scm_current_env P((void));
-SCM_EXPORT SCM prolixity P((SCM arg));
-SCM_EXPORT SCM gc_for_newcell P((void));
-SCM_EXPORT void gc_for_open_files P((void));
-SCM_EXPORT SCM gc P((SCM arg));
-SCM_EXPORT SCM tryload P((SCM filename, SCM reader));
-SCM_EXPORT SCM acons P((SCM w, SCM x, SCM y));
-SCM_EXPORT SCM cons2 P((SCM w, SCM x, SCM y));
-SCM_EXPORT SCM resizuve P((SCM vect, SCM len));
-SCM_EXPORT SCM lnot P((SCM x));
-SCM_EXPORT SCM booleanp P((SCM obj));
-SCM_EXPORT SCM eq P((SCM x, SCM y));
-SCM_EXPORT SCM equal P((SCM x, SCM y));
-SCM_EXPORT SCM consp P((SCM x));
-SCM_EXPORT SCM cons P((SCM x, SCM y));
-SCM_EXPORT SCM nullp P((SCM x));
-SCM_EXPORT SCM setcar P((SCM pair, SCM value));
-SCM_EXPORT SCM setcdr P((SCM pair, SCM value));
-SCM_EXPORT SCM listp P((SCM x));
-SCM_EXPORT SCM list P((SCM objs));
-SCM_EXPORT SCM length P((SCM x));
-SCM_EXPORT SCM append P((SCM args));
-SCM_EXPORT SCM reverse P((SCM lst));
-SCM_EXPORT SCM list_ref P((SCM lst, SCM k));
-SCM_EXPORT SCM memq P((SCM x, SCM lst));
-SCM_EXPORT SCM member P((SCM x, SCM lst));
-SCM_EXPORT SCM memv P((SCM x, SCM lst));
-SCM_EXPORT SCM assq P((SCM x, SCM alist));
-SCM_EXPORT SCM assoc P((SCM x, SCM alist));
-SCM_EXPORT SCM symbolp P((SCM x));
-SCM_EXPORT SCM symbol2string P((SCM s));
-SCM_EXPORT SCM string2symbol P((SCM s));
-SCM_EXPORT SCM numberp P((SCM x));
-SCM_EXPORT SCM exactp P((SCM x));
-SCM_EXPORT SCM inexactp P((SCM x));
-SCM_EXPORT SCM eqp P((SCM x, SCM y));
-SCM_EXPORT SCM lessp P((SCM x, SCM y));
-SCM_EXPORT SCM greaterp P((SCM x, SCM y));
-SCM_EXPORT SCM leqp P((SCM x, SCM y));
-SCM_EXPORT SCM greqp P((SCM x, SCM y));
-SCM_EXPORT SCM zerop P((SCM z));
-SCM_EXPORT SCM positivep P((SCM x));
-SCM_EXPORT SCM negativep P((SCM x));
-SCM_EXPORT SCM oddp P((SCM n));
-SCM_EXPORT SCM evenp P((SCM n));
-SCM_EXPORT SCM lmax P((SCM x, SCM y));
-SCM_EXPORT SCM lmin P((SCM x, SCM y));
-SCM_EXPORT SCM sum P((SCM x, SCM y));
-SCM_EXPORT SCM difference P((SCM x, SCM y));
-SCM_EXPORT SCM product P((SCM x, SCM y));
-SCM_EXPORT SCM divide P((SCM x, SCM y));
-SCM_EXPORT SCM lquotient P((SCM x, SCM y));
-SCM_EXPORT SCM absval P((SCM x));
-SCM_EXPORT SCM lremainder P((SCM x, SCM y));
-SCM_EXPORT SCM modulo P((SCM x, SCM y));
-SCM_EXPORT SCM lgcd P((SCM x, SCM y));
-SCM_EXPORT SCM llcm P((SCM n1, SCM n2));
-SCM_EXPORT SCM number2string P((SCM x, SCM radix));
-SCM_EXPORT SCM istring2number P((char *str, long len, long radix));
-SCM_EXPORT SCM string2number P((SCM str, SCM radix));
-SCM_EXPORT SCM istr2flo P((char *str, long len, long radix));
-SCM_EXPORT SCM mkbig P((sizet nlen, int sign));
-SCM_EXPORT SCM mkstrport P((SCM pos, SCM str, long modes, char *caller));
-SCM_EXPORT SCM mksafeport P((int maxlen, SCM port));
-SCM_EXPORT int reset_safeport P((SCM sfp, int maxlen, SCM port));
-SCM_EXPORT SCM long2big P((long n));
-SCM_EXPORT SCM ulong2big P((unsigned long n));
-SCM_EXPORT SCM big2inum P((SCM b, sizet l));
+SCM_EXPORT SCM equal0 P((SCM ptr1, SCM ptr2));
+SCM_EXPORT sizet free0 P((CELLPTR ptr));
+SCM_EXPORT void scm_warn P((char *str1, char *str2, SCM obj));
+SCM_EXPORT void everr P((SCM exp, SCM env, SCM arg, char *pos, char *s_subr, int codep));
+SCM_EXPORT void wta P((SCM arg, char *pos, char *s_subr));
+SCM_EXPORT void scm_experr P((SCM arg, char *pos, char *s_subr));
+SCM_EXPORT SCM intern P((char *name, sizet len));
+SCM_EXPORT SCM sysintern P((const char *name, SCM val));
+SCM_EXPORT SCM sym2vcell P((SCM sym));
+SCM_EXPORT SCM makstr P((long len));
+SCM_EXPORT SCM scm_maksubr P((const char *name, int type, SCM (*fcn)()));
+SCM_EXPORT SCM make_subr P((const char *name, int type, SCM (*fcn)()));
+SCM_EXPORT SCM make_synt P((const char *name, long flags, SCM (*fcn)()));
+SCM_EXPORT SCM make_gsubr P((const char *name, int req, int opt, int rst,
+ SCM (*fcn)()));
+SCM_EXPORT SCM closure P((SCM code, int nargs));
+SCM_EXPORT SCM makprom P((SCM code));
+SCM_EXPORT SCM force P((SCM x));
+SCM_EXPORT SCM makarb P((SCM name));
+SCM_EXPORT SCM tryarb P((SCM arb));
+SCM_EXPORT SCM relarb P((SCM arb));
+SCM_EXPORT SCM ceval P((SCM x, SCM static_env, SCM env));
+SCM_EXPORT SCM scm_wrapcode P((SCM code, SCM env));
+SCM_EXPORT SCM scm_current_env P((void));
+SCM_EXPORT SCM prolixity P((SCM arg));
+SCM_EXPORT SCM gc_for_newcell P((void));
+SCM_EXPORT void gc_for_open_files P((void));
+SCM_EXPORT SCM gc P((SCM arg));
+SCM_EXPORT SCM tryload P((SCM filename, SCM reader));
+SCM_EXPORT SCM acons P((SCM w, SCM x, SCM y));
+SCM_EXPORT SCM cons2 P((SCM w, SCM x, SCM y));
+SCM_EXPORT SCM resizuve P((SCM vect, SCM len));
+SCM_EXPORT SCM lnot P((SCM x));
+SCM_EXPORT SCM booleanp P((SCM obj));
+SCM_EXPORT SCM eq P((SCM x, SCM y));
+SCM_EXPORT SCM equal P((SCM x, SCM y));
+SCM_EXPORT SCM consp P((SCM x));
+SCM_EXPORT SCM cons P((SCM x, SCM y));
+SCM_EXPORT SCM nullp P((SCM x));
+SCM_EXPORT SCM setcar P((SCM pair, SCM value));
+SCM_EXPORT SCM setcdr P((SCM pair, SCM value));
+SCM_EXPORT SCM listp P((SCM x));
+SCM_EXPORT SCM list P((SCM objs));
+SCM_EXPORT SCM length P((SCM x));
+SCM_EXPORT SCM append P((SCM args));
+SCM_EXPORT SCM reverse P((SCM lst));
+SCM_EXPORT SCM list_ref P((SCM lst, SCM k));
+SCM_EXPORT SCM memq P((SCM x, SCM lst));
+SCM_EXPORT SCM member P((SCM x, SCM lst));
+SCM_EXPORT SCM memv P((SCM x, SCM lst));
+SCM_EXPORT SCM assq P((SCM x, SCM alist));
+SCM_EXPORT SCM assoc P((SCM x, SCM alist));
+SCM_EXPORT SCM symbolp P((SCM x));
+SCM_EXPORT SCM symbol2string P((SCM s));
+SCM_EXPORT SCM string2symbol P((SCM s));
+SCM_EXPORT SCM numberp P((SCM x));
+SCM_EXPORT SCM exactp P((SCM x));
+SCM_EXPORT SCM inexactp P((SCM x));
+SCM_EXPORT SCM eqp P((SCM x, SCM y));
+SCM_EXPORT SCM lessp P((SCM x, SCM y));
+SCM_EXPORT SCM greaterp P((SCM x, SCM y));
+SCM_EXPORT SCM leqp P((SCM x, SCM y));
+SCM_EXPORT SCM greqp P((SCM x, SCM y));
+SCM_EXPORT SCM zerop P((SCM z));
+SCM_EXPORT SCM positivep P((SCM x));
+SCM_EXPORT SCM negativep P((SCM x));
+SCM_EXPORT SCM oddp P((SCM n));
+SCM_EXPORT SCM evenp P((SCM n));
+SCM_EXPORT SCM lmax P((SCM x, SCM y));
+SCM_EXPORT SCM lmin P((SCM x, SCM y));
+SCM_EXPORT SCM sum P((SCM x, SCM y));
+SCM_EXPORT SCM difference P((SCM x, SCM y));
+SCM_EXPORT SCM product P((SCM x, SCM y));
+SCM_EXPORT SCM divide P((SCM x, SCM y));
+SCM_EXPORT SCM lquotient P((SCM x, SCM y));
+SCM_EXPORT SCM absval P((SCM x));
+SCM_EXPORT SCM lremainder P((SCM x, SCM y));
+SCM_EXPORT SCM modulo P((SCM x, SCM y));
+SCM_EXPORT SCM lgcd P((SCM x, SCM y));
+SCM_EXPORT SCM llcm P((SCM n1, SCM n2));
+SCM_EXPORT SCM number2string P((SCM x, SCM radix));
+SCM_EXPORT SCM istring2number P((char *str, long len, long radix));
+SCM_EXPORT SCM string2number P((SCM str, SCM radix));
+SCM_EXPORT SCM istr2flo P((char *str, long len, long radix));
+SCM_EXPORT SCM mkbig P((sizet nlen, int sign));
+SCM_EXPORT SCM mkstrport P((SCM pos, SCM str, long modes, char *caller));
+SCM_EXPORT SCM mksafeport P((int maxlen, SCM port));
+SCM_EXPORT int reset_safeport P((SCM sfp, int maxlen, SCM port));
+SCM_EXPORT SCM long2big P((long n));
+SCM_EXPORT SCM ulong2big P((unsigned long n));
+SCM_EXPORT SCM big2inum P((SCM b, sizet l));
SCM_EXPORT sizet iint2str P((long num, int rad, char *p));
-SCM_EXPORT SCM floequal P((SCM x, SCM y));
-SCM_EXPORT SCM uve_equal P((SCM u, SCM v));
+SCM_EXPORT SCM floequal P((SCM x, SCM y));
+SCM_EXPORT SCM uve_equal P((SCM u, SCM v));
SCM_EXPORT SCM uve_read P((SCM v, SCM port));
SCM_EXPORT SCM uve_write P((SCM v, SCM port));
-SCM_EXPORT SCM raequal P((SCM ra0, SCM ra1));
-SCM_EXPORT SCM array_equal P((SCM u, SCM v));
-SCM_EXPORT SCM array_rank P((SCM ra));
+SCM_EXPORT SCM raequal P((SCM ra0, SCM ra1));
+SCM_EXPORT SCM array_equal P((SCM u, SCM v));
+SCM_EXPORT SCM array_rank P((SCM ra));
SCM_EXPORT int rafill P((SCM ra, SCM fill, SCM ignore));
-SCM_EXPORT SCM uve_fill P((SCM uve, SCM fill));
-SCM_EXPORT SCM array_fill P((SCM ra, SCM fill));
-SCM_EXPORT SCM array_prot P((SCM ra));
+SCM_EXPORT SCM uve_fill P((SCM uve, SCM fill));
+SCM_EXPORT SCM array_fill P((SCM ra, SCM fill));
+SCM_EXPORT SCM array_prot P((SCM ra));
SCM_EXPORT SCM array_rank P((SCM ra));
SCM_EXPORT SCM array_contents P((SCM ra, SCM strict));
-SCM_EXPORT int bigprint P((SCM exp, SCM port, int writing));
-SCM_EXPORT int floprint P((SCM sexp, SCM port, int writing));
-SCM_EXPORT SCM istr2int P((char *str, long len, long radix));
-SCM_EXPORT SCM istr2bve P((char *str, long len));
-SCM_EXPORT void ipruk P((char *hdr, SCM ptr, SCM port));
-SCM_EXPORT SCM charp P((SCM x));
-SCM_EXPORT SCM char_lessp P((SCM x, SCM y));
-SCM_EXPORT SCM chci_eq P((SCM x, SCM y));
-SCM_EXPORT SCM chci_lessp P((SCM x, SCM y));
-SCM_EXPORT SCM char_alphap P((SCM chr));
-SCM_EXPORT SCM char_nump P((SCM chr));
-SCM_EXPORT SCM char_whitep P((SCM chr));
-SCM_EXPORT SCM char_upperp P((SCM chr));
-SCM_EXPORT SCM char_lowerp P((SCM chr));
-SCM_EXPORT SCM char2int P((SCM chr));
-SCM_EXPORT SCM int2char P((SCM n));
-SCM_EXPORT SCM char_upcase P((SCM chr));
-SCM_EXPORT SCM char_downcase P((SCM chr));
-SCM_EXPORT SCM stringp P((SCM x));
-SCM_EXPORT SCM string P((SCM chrs));
-SCM_EXPORT SCM make_string P((SCM k, SCM chr));
-SCM_EXPORT SCM string2list P((SCM str));
-SCM_EXPORT SCM st_length P((SCM str));
-SCM_EXPORT SCM st_ref P((SCM str, SCM k));
-SCM_EXPORT SCM st_set P((SCM str, SCM k, SCM chr));
-SCM_EXPORT SCM st_equal P((SCM s1, SCM s2));
-SCM_EXPORT SCM stci_equal P((SCM s1, SCM s2));
-SCM_EXPORT SCM st_lessp P((SCM s1, SCM s2));
-SCM_EXPORT SCM stci_lessp P((SCM s1, SCM s2));
-SCM_EXPORT SCM substring P((SCM str, SCM start, SCM end));
-SCM_EXPORT SCM st_append P((SCM args));
-SCM_EXPORT SCM vectorp P((SCM x));
-SCM_EXPORT SCM vector_length P((SCM v));
-SCM_EXPORT SCM vector P((SCM l));
-SCM_EXPORT SCM vector_ref P((SCM v, SCM k));
-SCM_EXPORT SCM vector_set P((SCM v, SCM k, SCM obj));
-SCM_EXPORT SCM make_vector P((SCM k, SCM fill));
-SCM_EXPORT SCM vector2list P((SCM v));
-SCM_EXPORT SCM for_each P((SCM proc, SCM arg1, SCM args));
-SCM_EXPORT SCM procedurep P((SCM obj));
-SCM_EXPORT SCM apply P((SCM proc, SCM arg1, SCM args));
-SCM_EXPORT SCM scm_cvapply P((SCM proc, long n, SCM *argv));
-SCM_EXPORT int scm_arity_check P((SCM proc, long argc, char *what));
-SCM_EXPORT SCM map P((SCM proc, SCM arg1, SCM args));
-SCM_EXPORT SCM scm_make_cont P((void));
-SCM_EXPORT SCM copytree P((SCM obj));
-SCM_EXPORT SCM eval P((SCM obj));
-SCM_EXPORT SCM scm_values P((SCM arg1, SCM arg2, SCM rest, char *what));
-SCM_EXPORT SCM scm_eval_values P((SCM x, SCM static_env, SCM env));
-SCM_EXPORT SCM identp P((SCM obj));
-SCM_EXPORT SCM ident2sym P((SCM id));
-SCM_EXPORT SCM ident_eqp P((SCM id1, SCM id2, SCM env));
-SCM_EXPORT int scm_nullenv_p P((SCM env));
-SCM_EXPORT SCM env2tree P((SCM env));
-SCM_EXPORT SCM renamed_ident P((SCM id, SCM env));
-SCM_EXPORT SCM scm_check_linum P((SCM x, SCM *linum));
-SCM_EXPORT SCM scm_add_linum P((SCM linum, SCM x));
-SCM_EXPORT SCM input_portp P((SCM x));
-SCM_EXPORT SCM output_portp P((SCM x));
-SCM_EXPORT SCM cur_input_port P((void));
-SCM_EXPORT SCM cur_output_port P((void));
-SCM_EXPORT SCM i_setbuf0 P((SCM port));
-SCM_EXPORT SCM try_open_file P((SCM filename, SCM modes));
-SCM_EXPORT SCM open_file P((SCM filename, SCM modes));
-SCM_EXPORT SCM open_pipe P((SCM pipestr, SCM modes));
-SCM_EXPORT SCM close_port P((SCM port));
-SCM_EXPORT SCM scm_read P((SCM port));
-SCM_EXPORT SCM scm_read_char P((SCM port));
-SCM_EXPORT SCM peek_char P((SCM port));
-SCM_EXPORT SCM eof_objectp P((SCM x));
-SCM_EXPORT int scm_io_error P((SCM port, char *what));
-SCM_EXPORT SCM lwrite P((SCM obj, SCM port));
-SCM_EXPORT SCM display P((SCM obj, SCM port));
-SCM_EXPORT SCM newline P((SCM port));
-SCM_EXPORT SCM write_char P((SCM chr, SCM port));
-SCM_EXPORT SCM scm_port_line P((SCM port));
-SCM_EXPORT SCM scm_port_col P((SCM port));
-SCM_EXPORT void scm_line_msg P((SCM file, SCM linum, SCM port));
-SCM_EXPORT void scm_err_line P((char *what, SCM file, SCM linum, SCM port));
-SCM_EXPORT SCM lgetenv P((SCM nam));
-SCM_EXPORT SCM prog_args P((void));
-SCM_EXPORT SCM makacro P((SCM code));
-SCM_EXPORT SCM makmacro P((SCM code));
-SCM_EXPORT SCM makmmacro P((SCM code));
-SCM_EXPORT SCM makidmacro P((SCM code));
-SCM_EXPORT void poll_routine P((void));
-SCM_EXPORT void tick_signal P((void));
-SCM_EXPORT void stack_check P((void));
-SCM_EXPORT SCM list2ura P((SCM ndim, SCM prot, SCM lst));
-SCM_EXPORT SCM make_ra P((int ndim));
-SCM_EXPORT SCM makflo P((float x));
-SCM_EXPORT SCM arrayp P((SCM v, SCM prot));
-SCM_EXPORT SCM aset P((SCM v, SCM obj, SCM args));
-SCM_EXPORT SCM aref P((SCM v, SCM args));
+SCM_EXPORT int bigprint P((SCM exp, SCM port, int writing));
+SCM_EXPORT int floprint P((SCM sexp, SCM port, int writing));
+SCM_EXPORT SCM istr2int P((char *str, long len, long radix));
+SCM_EXPORT SCM istr2bve P((char *str, long len));
+SCM_EXPORT void ipruk P((char *hdr, SCM ptr, SCM port));
+SCM_EXPORT SCM charp P((SCM x));
+SCM_EXPORT SCM char_lessp P((SCM x, SCM y));
+SCM_EXPORT SCM chci_eq P((SCM x, SCM y));
+SCM_EXPORT SCM chci_lessp P((SCM x, SCM y));
+SCM_EXPORT SCM char_alphap P((SCM chr));
+SCM_EXPORT SCM char_nump P((SCM chr));
+SCM_EXPORT SCM char_whitep P((SCM chr));
+SCM_EXPORT SCM char_upperp P((SCM chr));
+SCM_EXPORT SCM char_lowerp P((SCM chr));
+SCM_EXPORT SCM char2int P((SCM chr));
+SCM_EXPORT SCM int2char P((SCM n));
+SCM_EXPORT SCM char_upcase P((SCM chr));
+SCM_EXPORT SCM char_downcase P((SCM chr));
+SCM_EXPORT SCM stringp P((SCM x));
+SCM_EXPORT SCM string P((SCM chrs));
+SCM_EXPORT SCM make_string P((SCM k, SCM chr));
+SCM_EXPORT SCM string2list P((SCM str));
+SCM_EXPORT SCM st_length P((SCM str));
+SCM_EXPORT SCM st_ref P((SCM str, SCM k));
+SCM_EXPORT SCM st_set P((SCM str, SCM k, SCM chr));
+SCM_EXPORT SCM st_equal P((SCM s1, SCM s2));
+SCM_EXPORT SCM stci_equal P((SCM s1, SCM s2));
+SCM_EXPORT SCM st_lessp P((SCM s1, SCM s2));
+SCM_EXPORT SCM stci_lessp P((SCM s1, SCM s2));
+SCM_EXPORT SCM substring P((SCM str, SCM start, SCM end));
+SCM_EXPORT SCM st_append P((SCM args));
+SCM_EXPORT SCM vectorp P((SCM x));
+SCM_EXPORT SCM vector_length P((SCM v));
+SCM_EXPORT SCM vector P((SCM l));
+SCM_EXPORT SCM vector_ref P((SCM v, SCM k));
+SCM_EXPORT SCM vector_set P((SCM v, SCM k, SCM obj));
+SCM_EXPORT SCM make_vector P((SCM k, SCM fill));
+SCM_EXPORT SCM vector2list P((SCM v));
+SCM_EXPORT SCM for_each P((SCM proc, SCM arg1, SCM args));
+SCM_EXPORT SCM procedurep P((SCM obj));
+SCM_EXPORT SCM apply P((SCM proc, SCM arg1, SCM args));
+SCM_EXPORT SCM scm_cvapply P((SCM proc, long n, SCM *argv));
+SCM_EXPORT int scm_arity_check P((SCM proc, long argc, char *what));
+SCM_EXPORT SCM map P((SCM proc, SCM arg1, SCM args));
+SCM_EXPORT SCM scm_make_cont P((void));
+SCM_EXPORT SCM copytree P((SCM obj));
+SCM_EXPORT SCM eval P((SCM obj));
+SCM_EXPORT SCM scm_values P((SCM arg1, SCM arg2, SCM rest, char *what));
+SCM_EXPORT SCM scm_eval_values P((SCM x, SCM static_env, SCM env));
+SCM_EXPORT SCM identp P((SCM obj));
+SCM_EXPORT SCM ident2sym P((SCM id));
+SCM_EXPORT SCM ident_eqp P((SCM id1, SCM id2, SCM env));
+SCM_EXPORT int scm_nullenv_p P((SCM env));
+SCM_EXPORT SCM env2tree P((SCM env));
+SCM_EXPORT SCM renamed_ident P((SCM id, SCM env));
+SCM_EXPORT SCM scm_check_linum P((SCM x, SCM *linum));
+SCM_EXPORT SCM scm_add_linum P((SCM linum, SCM x));
+SCM_EXPORT SCM input_portp P((SCM x));
+SCM_EXPORT SCM output_portp P((SCM x));
+SCM_EXPORT SCM cur_input_port P((void));
+SCM_EXPORT SCM cur_output_port P((void));
+SCM_EXPORT SCM i_setbuf0 P((SCM port));
+SCM_EXPORT SCM try_open_file P((SCM filename, SCM modes));
+SCM_EXPORT SCM open_file P((SCM filename, SCM modes));
+SCM_EXPORT SCM open_pipe P((SCM pipestr, SCM modes));
+SCM_EXPORT SCM close_port P((SCM port));
+SCM_EXPORT SCM scm_read P((SCM port));
+SCM_EXPORT SCM scm_read_char P((SCM port));
+SCM_EXPORT SCM peek_char P((SCM port));
+SCM_EXPORT SCM eof_objectp P((SCM x));
+SCM_EXPORT int scm_io_error P((SCM port, char *what));
+SCM_EXPORT SCM lwrite P((SCM obj, SCM port));
+SCM_EXPORT SCM display P((SCM obj, SCM port));
+SCM_EXPORT SCM newline P((SCM port));
+SCM_EXPORT SCM write_char P((SCM chr, SCM port));
+SCM_EXPORT SCM scm_port_line P((SCM port));
+SCM_EXPORT SCM scm_port_col P((SCM port));
+SCM_EXPORT void scm_line_msg P((SCM file, SCM linum, SCM port));
+SCM_EXPORT void scm_err_line P((char *what, SCM file, SCM linum, SCM port));
+SCM_EXPORT SCM lgetenv P((SCM nam));
+SCM_EXPORT SCM prog_args P((void));
+SCM_EXPORT SCM makacro P((SCM code));
+SCM_EXPORT SCM makmacro P((SCM code));
+SCM_EXPORT SCM makmmacro P((SCM code));
+SCM_EXPORT SCM makidmacro P((SCM code));
+SCM_EXPORT void poll_routine P((void));
+SCM_EXPORT void tick_signal P((void));
+SCM_EXPORT void stack_check P((void));
+SCM_EXPORT SCM list2ura P((SCM ndim, SCM prot, SCM lst));
+SCM_EXPORT SCM make_ra P((int ndim));
+SCM_EXPORT SCM makflo P((float x));
+SCM_EXPORT SCM arrayp P((SCM v, SCM prot));
+SCM_EXPORT SCM aset P((SCM v, SCM obj, SCM args));
+SCM_EXPORT SCM aref P((SCM v, SCM args));
SCM_EXPORT SCM scm_array_ref P((SCM args));
-SCM_EXPORT SCM cvref P((SCM v, sizet pos, SCM last));
-SCM_EXPORT SCM quit P((SCM n));
+SCM_EXPORT SCM cvref P((SCM v, sizet pos, SCM last));
+SCM_EXPORT SCM quit P((SCM n));
#ifdef CAREFUL_INTS
-SCM_EXPORT void ints_viol P((ints_infot *info, int sense));
+SCM_EXPORT void ints_viol P((ints_infot *info, int sense));
SCM_EXPORT void ints_warn P((char *s1, char* s2, char *fname, int linum));
#endif
-SCM_EXPORT void add_final P((void (*final)(void)));
-SCM_EXPORT SCM makcclo P((SCM proc, long len));
-SCM_EXPORT SCM make_uve P((long k, SCM prot));
-SCM_EXPORT long scm_prot2type P((SCM prot));
-SCM_EXPORT long aind P((SCM ra, SCM args, char *what));
-SCM_EXPORT SCM scm_eval_string P((SCM str));
-SCM_EXPORT SCM scm_load_string P((SCM str));
-SCM_EXPORT SCM scm_unexec P((const SCM pathname));
+SCM_EXPORT void add_final P((void (*final)(void)));
+SCM_EXPORT SCM makcclo P((SCM proc, long len));
+SCM_EXPORT SCM make_uve P((long k, SCM prot));
+SCM_EXPORT long scm_prot2type P((SCM prot));
+SCM_EXPORT long aind P((SCM ra, SCM args, char *what));
+SCM_EXPORT SCM scm_eval_string P((SCM str));
+SCM_EXPORT SCM scm_load_string P((SCM str));
+SCM_EXPORT SCM scm_unexec P((const SCM pathname));
SCM_EXPORT SCM scm_logbitp P((SCM index, SCM j1));
SCM_EXPORT SCM scm_logtest P((SCM x, SCM y));
SCM_EXPORT SCM scm_logxor P((SCM x, SCM y));
@@ -1027,68 +1021,68 @@ SCM_EXPORT SCM scm_bitfield P((SCM n, SCM start, SCM end));
SCM_EXPORT SCM scm_logcount P((SCM n));
SCM_EXPORT SCM scm_intlength P((SCM n));
SCM_EXPORT SCM scm_copybit P((SCM index, SCM j1, SCM bit));
-SCM_EXPORT SCM scm_bitif P((SCM mask, SCM n0, SCM n1));
-SCM_EXPORT SCM scm_copybitfield P((SCM to, SCM start, SCM rest));
+SCM_EXPORT SCM scm_bitif P((SCM mask, SCM n0, SCM n1));
+SCM_EXPORT SCM scm_copybitfield P((SCM to, SCM start, SCM rest));
- /* Defined in "rope.c" */
-SCM_EXPORT SCM long2num P((long n));
-SCM_EXPORT SCM ulong2num P((unsigned long n));
+ /* Defined in "rope.c" */
+SCM_EXPORT SCM long2num P((long n));
+SCM_EXPORT SCM ulong2num P((unsigned long n));
SCM_EXPORT unsigned char num2uchar P((SCM num, char *pos, char *s_caller));
SCM_EXPORT unsigned short num2ushort P((SCM num, char *pos, char *s_caller));
SCM_EXPORT unsigned long num2ulong P((SCM num, char *pos, char *s_caller));
-SCM_EXPORT long num2long P((SCM num, char *pos, char *s_caller));
-SCM_EXPORT short num2short P((SCM num, char *pos, char *s_caller));
+SCM_EXPORT long num2long P((SCM num, char *pos, char *s_caller));
+SCM_EXPORT short num2short P((SCM num, char *pos, char *s_caller));
SCM_EXPORT double num2dbl P((SCM num, char *pos, char *s_caller));
-SCM_EXPORT SCM makfromstr P((char *src, sizet len));
-SCM_EXPORT SCM makfromstrs P((int argc, char **argv));
-SCM_EXPORT SCM makfrom0str P((char *scr));
+SCM_EXPORT SCM makfromstr P((char *src, sizet len));
+SCM_EXPORT SCM makfromstrs P((int argc, char **argv));
+SCM_EXPORT SCM makfrom0str P((char *scr));
SCM_EXPORT char **makargvfrmstrs P((SCM args, char *s_v));
-SCM_EXPORT void must_free_argv P((char **argv));
-SCM_EXPORT SCM scm_evstr P((char *str));
-SCM_EXPORT void scm_ldstr P((char *str));
-SCM_EXPORT int scm_ldfile P((char *path));
-SCM_EXPORT int scm_ldprog P((char *path));
+SCM_EXPORT void must_free_argv P((char **argv));
+SCM_EXPORT SCM scm_evstr P((char *str));
+SCM_EXPORT void scm_ldstr P((char *str));
+SCM_EXPORT int scm_ldfile P((char *path));
+SCM_EXPORT int scm_ldprog P((char *path));
SCM_EXPORT unsigned long scm_addr P((SCM args, char *name));
SCM_EXPORT unsigned long scm_base_addr P((SCM v, char *name));
-SCM_EXPORT int scm_cell_p P((SCM x));
+SCM_EXPORT int scm_cell_p P((SCM x));
#ifdef FLOATS
-SCM_EXPORT SCM makdbl P((double x, double y));
-SCM_EXPORT SCM dbl2big P((double d));
-SCM_EXPORT double big2dbl P((SCM b));
-SCM_EXPORT double lasinh P((double x));
-SCM_EXPORT double lacosh P((double x));
-SCM_EXPORT double latanh P((double x));
-SCM_EXPORT double ltrunc P((double x));
-SCM_EXPORT double scm_round P((double x));
-SCM_EXPORT double floident P((double x));
+SCM_EXPORT SCM makdbl P((double x, double y));
+SCM_EXPORT SCM dbl2big P((double d));
+SCM_EXPORT double big2dbl P((SCM b));
+SCM_EXPORT double lasinh P((double x));
+SCM_EXPORT double lacosh P((double x));
+SCM_EXPORT double latanh P((double x));
+SCM_EXPORT double ltrunc P((double x));
+SCM_EXPORT double scm_round P((double x));
+SCM_EXPORT double floident P((double x));
#endif
#ifdef BIGDIG
-SCM_EXPORT void longdigs P((long x, BIGDIG digs[DIGSPERLONG]));
-SCM_EXPORT SCM adjbig P((SCM b, sizet nlen));
-SCM_EXPORT SCM normbig P((SCM b));
-SCM_EXPORT SCM copybig P((SCM b, int sign));
-SCM_EXPORT SCM addbig P((BIGDIG *x, sizet nx, int xsgn, SCM bigy, int sgny));
-SCM_EXPORT SCM mulbig P((BIGDIG *x, sizet nx, BIGDIG *y, sizet ny, int sgn));
+SCM_EXPORT void longdigs P((long x, BIGDIG digs[DIGSPERLONG]));
+SCM_EXPORT SCM adjbig P((SCM b, sizet nlen));
+SCM_EXPORT SCM normbig P((SCM b));
+SCM_EXPORT SCM copybig P((SCM b, int sign));
+SCM_EXPORT SCM addbig P((BIGDIG *x, sizet nx, int xsgn, SCM bigy, int sgny));
+SCM_EXPORT SCM mulbig P((BIGDIG *x, sizet nx, BIGDIG *y, sizet ny, int sgn));
SCM_EXPORT unsigned int divbigdig P((BIGDIG *ds, sizet h, BIGDIG div));
-SCM_EXPORT SCM divbigint P((SCM x, long z, int sgn, int mode));
-SCM_EXPORT SCM divbigbig P((BIGDIG *x, sizet nx, BIGDIG *y, sizet ny, int sgn,
- int modes));
-SCM_EXPORT long pseudolong P((long x));
+SCM_EXPORT SCM divbigint P((SCM x, long z, int sgn, int mode));
+SCM_EXPORT SCM divbigbig P((BIGDIG *x, sizet nx, BIGDIG *y, sizet ny, int sgn,
+ int modes));
+SCM_EXPORT long pseudolong P((long x));
#endif
-SCM_EXPORT int bigcomp P((SCM x, SCM y));
-SCM_EXPORT SCM bigequal P((SCM x, SCM y));
-SCM_EXPORT int scm_bigdblcomp P((SCM b, double d));
+SCM_EXPORT int bigcomp P((SCM x, SCM y));
+SCM_EXPORT SCM bigequal P((SCM x, SCM y));
+SCM_EXPORT int scm_bigdblcomp P((SCM b, double d));
/* "script.c" functions */
-SCM_EXPORT char * scm_cat_path P((char *str1, const char *str2, long n));
-SCM_EXPORT char * scm_try_path P((char *path));
-SCM_EXPORT char * script_find_executable P((const char *command));
-SCM_EXPORT char ** script_process_argv P((int argc, char **argv));
-SCM_EXPORT int script_count_argv P((char **argv));
-SCM_EXPORT char * find_impl_file P((char *exec_path, const char *generic_name,
- const char *initname, const char *sep));
+SCM_EXPORT char * scm_cat_path P((char *str1, const char *str2, long n));
+SCM_EXPORT char * scm_try_path P((char *path));
+SCM_EXPORT char * script_find_executable P((const char *command));
+SCM_EXPORT char ** script_process_argv P((int argc, char **argv));
+SCM_EXPORT int script_count_argv P((char **argv));
+SCM_EXPORT char * find_impl_file P((char *exec_path, const char *generic_name,
+ const char *initname, const char *sep));
/* environment cache functions */
SCM_EXPORT void scm_ecache_report P((void));
@@ -1121,36 +1115,36 @@ SCM_EXPORT SCM scm_trace, scm_trace_env;
# define ASRTGO(_cond, _label) if(!(_cond)) goto _label;
#endif
-#define ARGn 1
-#define ARG1 2
-#define ARG2 3
-#define ARG3 4
-#define ARG4 5
-#define ARG5 6
+#define ARGn 1
+#define ARG1 2
+#define ARG2 3
+#define ARG3 4
+#define ARG4 5
+#define ARG5 6
/* following must match entry indexes in errmsgs[] */
-#define WNA 7
-#define OVFLOW 8
-#define OUTOFRANGE 9
-#define NALLOC 10
-#define THRASH 11
-#define EXIT 12
-#define HUP_SIGNAL 13
-#define INT_SIGNAL 14
-#define FPE_SIGNAL 15
-#define BUS_SIGNAL 16
-#define SEGV_SIGNAL 17
-#define ALRM_SIGNAL 18
+#define WNA 7
+#define OVFLOW 8
+#define OUTOFRANGE 9
+#define NALLOC 10
+#define THRASH 11
+#define EXIT 12
+#define HUP_SIGNAL 13
+#define INT_SIGNAL 14
+#define FPE_SIGNAL 15
+#define BUS_SIGNAL 16
+#define SEGV_SIGNAL 17
+#define ALRM_SIGNAL 18
#define VTALRM_SIGNAL 19
-#define PROF_SIGNAL 20
+#define PROF_SIGNAL 20
#define EVAL(x, env, venv) (IMP(x)?(x):ceval((x), (SCM)(env), (SCM)(venv)))
#define SIDEVAL(x, env, venv) if NIMP(x) ceval((x), (SCM)(env), (SCM)(venv))
#define NEWCELL(_into) {if IMP(freelist) _into = gc_for_newcell();\
- else {_into = freelist;freelist = CDR(freelist);++cells_allocated;}}
+ else {_into = freelist;freelist = CDR(freelist);++cells_allocated;}}
/*
#define NEWCELL(_into) {DEFER_INTS;if IMP(freelist) _into = gc_for_newcell();\
- else {_into = freelist;freelist = CDR(freelist);++cells_allocated;}\
+ else {_into = freelist;freelist = CDR(freelist);++cells_allocated;}\
ALLOW_INTS;}
*/
diff --git a/scm.info b/scm.info
index c7f80bd..f554663 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.7 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
-5d9 was released November 2003. The most recent information about SCM |
-can be found on SCM's "WWW" home page:
+5e1 was released June 2005. The most recent information about SCM can |
+be found on SCM's "WWW" home page: |
- <http://swissnet.ai.mit.edu/~jaffer/SCM>
+ `http://swiss.csail.mit.edu/~jaffer/SCM' |
Copyright (C) 1990-1999 Free Software Foundation
@@ -43,8 +43,8 @@ approved by the author.

File: scm.info, Node: Overview, Next: Installing SCM, Prev: Top, Up: Top
-Overview
-********
+1 Overview |
+********** |
Scm is a portable Scheme implementation written in C. Scm provides a
machine independent platform for [JACAL], a symbolic algebra system.
@@ -59,8 +59,8 @@ machine independent platform for [JACAL], a symbolic algebra system.

File: scm.info, Node: SCM Features, Next: SCM Authors, Prev: Overview, Up: Overview
-Features
-========
+1.1 Features |
+============ |
* Conforms to Revised^5 Report on the Algorithmic Language Scheme
[R5RS] and the [IEEE] P1178 specification.
@@ -109,8 +109,8 @@ Features

File: scm.info, Node: SCM Authors, Next: Copying, Prev: SCM Features, Up: Overview
-Authors
-=======
+1.2 Authors |
+=========== |
Aubrey Jaffer (agj @ alum.mit.edu)
Most of SCM.
@@ -138,16 +138,70 @@ file `ChangeLog', a log of changes that have been made to scm.

File: scm.info, Node: Copying, Next: Bibliography, Prev: SCM Authors, Up: Overview
-Copyright
-=========
+1.3 Copyright |
+============= |
Authors have assigned their SCM copyrights to:
-
Free Software Foundation, Inc.
-
59 Temple Place, Suite 330, Boston, MA 02111, USA
+* Menu: |
+ |
+* The SCM License:: |
+* SIOD copyright:: |
+ |
+
+File: scm.info, Node: The SCM License, Next: SIOD copyright, Prev: Copying, Up: Copying
+ |
+1.3.1 The SCM License |
+--------------------- |
+ |
+The license of SCM consists of the GNU GPL plus a special statement |
+giving blanket permission to link with non-free software. This is the |
+license statement as found in any individual file that it applies to: |
+ |
+ This program is free software; you can redistribute it and/or |
+ modify it under the terms of the GNU General Public License as |
+ published by the Free Software Foundation; either version 2, or |
+ (at your option) any later version. |
+ |
+ This program is distributed in the hope that it will be useful, but |
+ WITHOUT ANY WARRANTY; without even the implied warranty of |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+ General Public License for more details. |
+ |
+ You should have received a copy of the GNU General Public License |
+ along with this software; see the file COPYING. If not, write to |
+ the Free Software Foundation, Inc., 59 Temple Place, Suite 330, |
+ Boston, MA 02111-1307 USA |
+ |
+ As a special exception, the Free Software Foundation gives |
+ permission for additional uses of the text contained in its |
+ release of SCM. |
+ |
+ The exception is that, if you link the SCM library with other |
+ files to produce an executable, this does not by itself cause the |
+ resulting executable to be covered by the GNU General Public |
+ License. Your use of that executable is in no way restricted on |
+ account of linking the SCM library code into it. |
+ |
+ This exception does not however invalidate any other reasons why |
+ the executable file might be covered by the GNU General Public |
+ License. |
+ |
+ This exception applies only to the code released by the Free |
+ Software Foundation under the name SCM. If you copy code from |
+ other Free Software Foundation releases into a copy of SCM, as the |
+ General Public License permits, the exception does not apply to |
+ the code that you add in this way. To avoid misleading anyone as |
+ to the status of such modified files, you must delete this |
+ exception notice from them. |
+ |
+ If you write modifications of your own for SCM, it is your choice |
+ whether to permit this exception to apply to your modifications. |
+ If you do not wish that, delete this exception notice. |
+ |
Permission to use, copy, modify, distribute, and sell this software and
its documentation for any purpose is hereby granted without fee,
provided that the above copyright notice appear in all copies and that
@@ -176,14 +230,15 @@ INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF
THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR
OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-SIOD copyright
-==============
+
+File: scm.info, Node: SIOD copyright, Prev: The SCM License, Up: Copying
+ |
+1.3.2 SIOD copyright |
+-------------------- |
COPYRIGHT (c) 1989 BY
-
PARADIGM ASSOCIATES INCORPORATED, CAMBRIDGE, MASSACHUSETTS.
-
ALL RIGHTS RESERVED
Permission to use, copy, modify, distribute and sell this software and
@@ -212,8 +267,8 @@ Cambridge, MA 02138

File: scm.info, Node: Bibliography, Prev: Copying, Up: Overview
-Bibliography
-============
+1.4 Bibliography |
+================ |
[IEEE]
`IEEE Standard 1178-1990. IEEE Standard for the Scheme
@@ -276,8 +331,8 @@ Bibliography

File: scm.info, Node: Installing SCM, Next: Operational Features, Prev: Overview, Up: Top
-Installing SCM
-**************
+2 Installing SCM |
+**************** |
* Menu:
@@ -297,8 +352,8 @@ Installing SCM

File: scm.info, Node: Making SCM, Next: SLIB, Prev: Installing SCM, Up: Installing SCM
-Making SCM
-==========
+2.1 Making SCM |
+============== |
The SCM distribution has "Makefile" which contains rules for making
"scmlit", a "bare-bones" version of SCM sufficient for running `build'.
@@ -309,7 +364,7 @@ Makefiles are not portable to the majority of platforms. If `Makefile'
works for you, good; If not, I don't want to hear about it. If you
need to compile SCM without build, there are several ways to proceed:
- * Use the build (http://swissnet.ai.mit.edu/~jaffer/buildscm.html)
+ * Use the build (http://swiss.csail.mit.edu/~jaffer/buildscm.html) |
web page to create custom batch scripts for compiling SCM.
* Use SCM on a different platform to run `build' to create a script
@@ -323,8 +378,8 @@ need to compile SCM without build, there are several ways to proceed:

File: scm.info, Node: SLIB, Next: Building SCM, Prev: Making SCM, Up: Installing SCM
-SLIB
-====
+2.2 SLIB |
+======== |
[SLIB] is a portable Scheme library meant to provide compatibility and
utility functions for all standard Scheme implementations. Although
@@ -332,18 +387,18 @@ 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/slib3a1.tar.gz |
+ * swiss.csail.mit.edu:/pub/scm/slib3a2.tar.gz |
- * ftp.gnu.org:/pub/gnu/jacal/slib3a1.tar.gz |
+ * ftp.gnu.org:/pub/gnu/jacal/slib3a2.tar.gz |
- * ftp.cs.indiana.edu:/pub/scheme-repository/imp/slib3a1.tar.gz |
+ * ftp.cs.indiana.edu:/pub/scheme-repository/imp/slib3a2.tar.gz |
-Unpack SLIB (`tar xzf slib3a1.tar.gz' or `unzip -ao slib3a1.zip') in an |
+Unpack SLIB (`tar xzf slib3a2.tar.gz' or `unzip -ao slib3a2.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 `Init5d9.scm' is |
+(this is the same directory as where the file `Init5e1.scm' is |
installed). `require.scm' should have the contents:
(define (library-vicinity) "/usr/local/lib/slib/")
@@ -367,8 +422,8 @@ overrides `require.scm'. Again, absolute pathnames are recommended.

File: scm.info, Node: Building SCM, Next: Installing Dynamic Linking, Prev: SLIB, Up: Installing SCM
-Building SCM
-============
+2.3 Building SCM |
+================ |
The file "build" loads the file "build.scm", which constructs a
relational database of how to compile and link SCM executables.
@@ -386,8 +441,8 @@ ai.mit.edu.

File: scm.info, Node: Invoking Build, Next: Build Options, Prev: Building SCM, Up: Building SCM
-Invoking Build
---------------
+2.3.1 Invoking Build |
+-------------------- |
The _all_ method will also work for MS-DOS and unix. Use the _all_
method if you encounter problems with `build'.
@@ -405,6 +460,7 @@ _all_
`(load "build")'. Alternatively, start `scm' or `scmlit' with the
command line argument `-ilbuild'.
+
Invoking build without the `-F' option will build or create a shell
script with the `arrays', `inexact', and `bignums' options as defaults.
@@ -414,7 +470,7 @@ script with the `arrays', `inexact', and `bignums' options as defaults.
# unix (linux) script created by SLIB/batch
# ================ Write file with C defines
rm -f scmflags.h
- echo '#define IMPLINIT "Init5d9.scm"'>>scmflags.h |
+ echo '#define IMPLINIT "Init5e1.scm"'>>scmflags.h |
echo '#define BIGNUMS'>>scmflags.h
echo '#define FLOATS'>>scmflags.h
echo '#define ARRAYS'>>scmflags.h
@@ -433,7 +489,7 @@ in the `-p' or `--platform=' option.
# unix (darwin) script created by SLIB/batch
# ================ Write file with C defines
rm -f scmflags.h
- echo '#define IMPLINIT "Init5d9.scm"'>>scmflags.h |
+ echo '#define IMPLINIT "Init5e1.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
@@ -443,18 +499,18 @@ in the `-p' or `--platform=' option.

File: scm.info, Node: Build Options, Next: Compiling and Linking Custom Files, Prev: Invoking Build, Up: Building SCM
-Build Options
--------------
+2.3.2 Build Options |
+------------------- |
The options to "build" specify what, where, and how to build a SCM
program or dynamically linked module. These options are unrelated to
the SCM command line options.
- - Build Option: -p PLATFORM-NAME
- - Build Option: --platform=PLATFORM-NAME
+ -- Build Option: -p PLATFORM-NAME |
+ -- Build Option: --platform=PLATFORM-NAME |
specifies that the compilation should be for a
computer/operating-system combination called PLATFORM-NAME.
- _Note:_ The case of PLATFORM-NAME is distinguised. The current
+ _Note_ The case of PLATFORM-NAME is distinguised. The current |
PLATFORM-NAMEs are all lower-case.
The platforms defined by table "platform" in `build.scm' are:
@@ -507,11 +563,11 @@ the SCM command line options.
vms-gcc vax vms gcc |
watcom-9.0 i386 ms-dos wcc386p |
- - Build Option: -f PATHNAME
+ -- 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' |
@@ -527,65 +583,65 @@ the SCM command line options.
Options for pgscm, which instruments C functions. |
|
`udscm4.opt' |
- Options for targets udscm4 and myscm4 (scm). |
+ Options for targets udscm4 and dscm4 (scm). |
|
`udscm5.opt' |
- Options for targets udscm5 and myscm5 (scm). |
+ Options for targets udscm5 and dscm5 (scm). |
|
The Makefile creates options files it depends on only if they do |
not already exist. |
-
- - Build Option: -o FILENAME
- - Build Option: --outname=FILENAME
+ |
+ -- Build Option: -o FILENAME |
+ -- Build Option: --outname=FILENAME |
specifies that the compilation should produce an executable or
object name of FILENAME. The default is `scm'. Executable
suffixes will be added if neccessary, e.g. `scm' => `scm.exe'.
- - Build Option: -l LIBNAME ...
- - Build Option: --libraries=LIBNAME
+ -- Build Option: -l LIBNAME ... |
+ -- Build Option: --libraries=LIBNAME |
specifies that the LIBNAME should be linked with the executable
produced. If compile flags or include directories (`-I') are
needed, they are automatically supplied for compilations. The `c'
library is always included. SCM "features" specify any libraries
they need; so you shouldn't need this option often.
- - Build Option: -D DEFINITION ...
- - Build Option: --defines=DEFINITION
+ -- Build Option: -D DEFINITION ... |
+ -- Build Option: --defines=DEFINITION |
specifies that the DEFINITION should be made in any C source
compilations. If compile flags or include directories (`-I') are
needed, they are automatically supplied for compilations. SCM
"features" specify any flags they need; so you shouldn't need this
option often.
- - Build Option: --compiler-options=FLAG
+ -- Build Option: --compiler-options=FLAG |
specifies that that FLAG will be put on compiler command-lines.
- - Build Option: --linker-options=FLAG
+ -- Build Option: --linker-options=FLAG |
specifies that that FLAG will be put on linker command-lines.
- - Build Option: -s PATHNAME
- - Build Option: --scheme-initial=PATHNAME
+ -- Build Option: -s PATHNAME |
+ -- Build Option: --scheme-initial=PATHNAME |
specifies that PATHNAME should be the default location of the SCM
- initialization file `Init5d9.scm'. SCM tries several likely |
+ initialization file `Init5e1.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.
- - Build Option: -c PATHNAME ...
- - Build Option: --c-source-files=PATHNAME
+ -- Build Option: -c PATHNAME ... |
+ -- Build Option: --c-source-files=PATHNAME |
specifies that the C source files PATHNAME ... are to be compiled.
- - Build Option: -j PATHNAME ...
- - Build Option: --object-files=PATHNAME
+ -- Build Option: -j PATHNAME ... |
+ -- Build Option: --object-files=PATHNAME |
specifies that the object files PATHNAME ... are to be linked.
- - Build Option: -i CALL ...
- - Build Option: --initialization=CALL
+ -- Build Option: -i CALL ... |
+ -- Build Option: --initialization=CALL |
specifies that the C functions CALL ... are to be invoked during
initialization.
- - Build Option: -t BUILD-WHAT
- - Build Option: --type=BUILD-WHAT
+ -- Build Option: -t BUILD-WHAT |
+ -- Build Option: --type=BUILD-WHAT |
specifies in general terms what sort of thing to build. The
choices are:
`exe'
@@ -602,8 +658,8 @@ the SCM command line options.
The default is to build an executable.
- - Build Option: -h BATCH-SYNTAX
- - Build Option: -batch-dialect=BATCH-SYNTAX
+ -- Build Option: -h BATCH-SYNTAX |
+ -- Build Option: -batch-dialect=BATCH-SYNTAX |
specifies how to build. The default is to create a batch file for
the host system. The SLIB file `batch.scm' knows how to create
batch files for:
@@ -624,13 +680,13 @@ the SCM command line options.
This option outputs Scheme code.
- - Build Option: -w BATCH-FILENAME
- - Build Option: -script-name=BATCH-FILENAME
+ -- Build Option: -w BATCH-FILENAME |
+ -- Build Option: -script-name=BATCH-FILENAME |
specifies where to write the build script. The default is to
display it on `(current-output-port)'.
- - Build Option: -F FEATURE ...
- - Build Option: --features=FEATURE
+ -- Build Option: -F FEATURE ... |
+ -- Build Option: --features=FEATURE |
specifies to build the given features into the executable. The
defined features are:
@@ -684,6 +740,9 @@ the SCM command line options.
`careful-interrupt-masking', and `stack-limit'; uses `-g'
flags for debugging SCM source code.
+ "differ" |
+ Sequence comparison |
+ |
"dump"
Convert a running scheme program into an executable file.
@@ -768,7 +827,8 @@ the SCM command line options.
numbers.
"socket"
- BSD "socket" interface.
+ BSD "socket" interface. Socket addr functions require |
+ inexacts or bignums for 32-bit precision. |
"stack-limit"
Use to enable checking for stack overflow. Define value of
@@ -788,6 +848,9 @@ the SCM command line options.
Those unix features which have not made it into the Posix
specs: nice, acct, lstat, readlink, symlink, mknod and sync.
+ "wb" |
+ WB database with relational wrapper. |
+ |
"windows"
Microsoft Windows executable.
@@ -801,8 +864,8 @@ the SCM command line options.

File: scm.info, Node: Compiling and Linking Custom Files, Prev: Build Options, Up: Building SCM
-Compiling and Linking Custom Files
-----------------------------------
+2.3.3 Compiling and Linking Custom Files |
+---------------------------------------- |
A correspondent asks:
@@ -811,16 +874,15 @@ A correspondent asks:
functions we want access to). Would this involve changing
build.scm or the Makefile or both?
-(*note Changing Scm:: has instructions describing the C code format).
-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:
+(*note Changing Scm:: has instructions describing the C code format). 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
-|
#! /bin/sh
rm -f scmflags.h
- echo '#define IMPLINIT "/home/jaffer/scm/Init5d9.scm"'>>scmflags.h |
+ echo '#define IMPLINIT "/home/jaffer/scm/Init5e1.scm"'>>scmflags.h |
echo '#define COMPILED_INITS init_foo();'>>scmflags.h
echo '#define BIGNUMS'>>scmflags.h
echo '#define FLOATS'>>scmflags.h
@@ -836,7 +898,7 @@ To make a dynamically loadable object file use the `-t dll' option:
-|
#! /bin/sh
rm -f scmflags.h
- echo '#define IMPLINIT "/home/jaffer/scm/Init5d9.scm"'>>scmflags.h |
+ echo '#define IMPLINIT "/home/jaffer/scm/Init5e1.scm"'>>scmflags.h |
echo '#define BIGNUMS'>>scmflags.h
echo '#define FLOATS'>>scmflags.h
echo '#define ARRAYS'>>scmflags.h
@@ -852,8 +914,8 @@ add a compiled dll file to SLIB's catalog.

File: scm.info, Node: Installing Dynamic Linking, Next: Configure Module Catalog, Prev: Building SCM, Up: Installing SCM
-Installing Dynamic Linking
-==========================
+2.4 Installing Dynamic Linking |
+============================== |
Dynamic linking has not been ported to all platforms. Operating systems
in the BSD family (a.out binary format) can usually be ported to "DLD".
@@ -892,15 +954,15 @@ These notes about using libdl on SunOS are from `gcc.info':

File: scm.info, Node: Configure Module Catalog, Next: Saving Images, Prev: Installing Dynamic Linking, Up: Installing SCM
-Configure Module Catalog
-========================
+2.5 Configure Module Catalog |
+============================ |
The SLIB module "catalog" can be extended to define other
`require'-able packages by adding calls to the Scheme source file
`mkimpcat.scm'. Within `mkimpcat.scm', the following procedures are
defined.
- - Function: add-link feature object-file lib1 ...
+ -- Function: add-link feature object-file lib1 ... |
FEATURE should be a symbol. OBJECT-FILE should be a string naming
a file containing compiled "object-code". Each LIBn argument
should be either a string naming a library file or `#f'.
@@ -921,7 +983,7 @@ defined.
link:able-suffix))
- - Function: add-alias alias feature
+ -- Function: add-alias alias feature |
ALIAS and FEATURE are symbols. The procedure `add-alias'
registers ALIAS as an alias for FEATURE. An unspecified value is
returned.
@@ -929,7 +991,7 @@ defined.
`add-alias' causes `(require 'ALIAS)' to behave like `(require
'FEATURE)'.
- - Function: add-source feature filename
+ -- Function: add-source feature filename |
FEATURE is a symbol. FILENAME is a string naming a file
containing Scheme source code. The procedure `add-source'
registers FEATURE so that the first time `require' is called with
@@ -942,8 +1004,8 @@ Remember to delete the file `slibcat' after modifying the file

File: scm.info, Node: Saving Images, Next: Automatic C Preprocessor Definitions, Prev: Configure Module Catalog, Up: Installing SCM
-Saving Images
-=============
+2.6 Saving Images |
+================= |
In SCM, the ability to save running program images is called "dump"
(*note Dump::). In order to make `dump' available to SCM, build with
@@ -959,8 +1021,8 @@ file from emacs.

File: scm.info, Node: Automatic C Preprocessor Definitions, Next: Problems Compiling, Prev: Saving Images, Up: Installing SCM
-Automatic C Preprocessor Definitions
-====================================
+2.7 Automatic C Preprocessor Definitions |
+======================================== |
These `#defines' are automatically provided by preprocessors of various
C compilers. SCM uses the presence or absence of these definitions to
@@ -990,7 +1052,7 @@ lines or add a `#define FLAG' line to `scmfig.h' or the beginning of
__USE_POSIX ??
__WATCOMC__ Watcom C on MS-DOS
__ZTC__ Zortech C
-
+
_AIX AIX operating system
__APPLE__ Apple Darwin
AMIGA SAS/C 5.10 or Dice C on AMIGA
@@ -1010,6 +1072,7 @@ lines or add a `#define FLAG' line to `scmfig.h' or the beginning of
__NetBSD__ NetBSD
nosve Control Data NOS/VE
SVR2 System V Revision 2.
+ sun SunOS |
__SVR4 SunOS
THINK_C developement environment for the Macintosh
ultrix VAX with ULTRIX operating system.
@@ -1024,7 +1087,7 @@ lines or add a `#define FLAG' line to `scmfig.h' or the beginning of
_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
@@ -1048,8 +1111,8 @@ lines or add a `#define FLAG' line to `scmfig.h' or the beginning of

File: scm.info, Node: Problems Compiling, Next: Problems Linking, Prev: Automatic C Preprocessor Definitions, Up: Installing SCM
-Problems Compiling
-==================
+2.8 Problems Compiling |
+====================== |
FILE PROBLEM / MESSAGE HOW TO FIX
*.c include file not found. Correct the status of
@@ -1081,8 +1144,8 @@ scl.c syntax error. #define SYSTNAME to your system

File: scm.info, Node: Problems Linking, Next: Problems Running, Prev: Problems Compiling, Up: Installing SCM
-Problems Linking
-================
+2.9 Problems Linking |
+==================== |
PROBLEM HOW TO FIX
_sin etc. missing. Uncomment LIBS in makefile.
@@ -1090,8 +1153,8 @@ _sin etc. missing. Uncomment LIBS in makefile.

File: scm.info, Node: Problems Running, Next: Testing, Prev: Problems Linking, Up: Installing SCM
-Problems Running
-================
+2.10 Problems Running |
+===================== |
PROBLEM HOW TO FIX
Opening message and then machine Change memory model option to C
@@ -1110,17 +1173,17 @@ remove <FLAG> in scmfig.h and Do so and recompile files.
recompile scm.
add <FLAG> in scmfig.h and
recompile scm.
-ERROR: Init5d9.scm not found. Assign correct IMPLINIT in makefile |
+ERROR: Init5e1.scm not found. Assign correct IMPLINIT in makefile |
or scmfig.h.
Define environment variable
SCM_INIT_PATH to be the full
- pathname of Init5d9.scm. |
+ pathname of Init5e1.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
- Init5d9.scm to point to library or |
+ Init5e1.scm to point to library or |
remove.
Make sure the value of
(library-vicinity) has a trailing
@@ -1129,8 +1192,8 @@ WARNING: require.scm not found. Define environment variable

File: scm.info, Node: Testing, Next: Reporting Problems, Prev: Problems Running, Up: Installing SCM
-Testing
-=======
+2.11 Testing |
+============ |
Loading `r4rstest.scm' in the distribution will run an [R4RS]
conformance test on `scm'.
@@ -1180,7 +1243,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. `Init5d9.scm'). |
+output files. `Init5e1.scm'). |
Spaces or control characters appear Check character defines in
in symbol names. `scmfig.h'.
Negative numbers turn positive. Check SRS in `scmfig.h'.
@@ -1195,13 +1258,14 @@ Sparc(SUN-4) heap is growing out of control
This causes lots of stuff which should be collected to not be.
This will be a problem with any _conservative_ GC until we find
what instruction will clear the register windows. This problem is
- exacerbated by using lots of call-with-current-continuations.
+ exacerbated by using lots of call-with-current-continuations. A |
+ possible fix for dynthrow() is commented out in `continue.c'. |

File: scm.info, Node: Reporting Problems, Prev: Testing, Up: Installing SCM
-Reporting Problems
-==================
+2.12 Reporting Problems |
+======================= |
Reported problems and solutions are grouped under Compiling, Linking,
Running, and Testing. If you don't find your problem listed there, you
@@ -1226,8 +1290,8 @@ include:

File: scm.info, Node: Operational Features, Next: The Language, Prev: Installing SCM, Up: Top
-Operational Features
-********************
+3 Operational Features |
+********************** |
* Menu:
@@ -1238,6 +1302,7 @@ Operational Features
* SCM Session::
* Editing Scheme Code::
* Debugging Scheme Code::
+* Debugging Continuations:: |
* Errors::
* Memoized Expressions::
* Internal State::
@@ -1246,8 +1311,8 @@ Operational Features

File: scm.info, Node: Invoking SCM, Next: SCM Options, Prev: Operational Features, Up: Operational Features
-Invoking SCM
-============
+3.1 Invoking SCM |
+================ |
scm [-a kbytes] [-muvbiq] [-version] [-help]
[[-]-no-init-file] [-p int] [-r feature] [-h feature]
@@ -1261,7 +1326,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 `Init5d9.scm') in platform-dependent directories relative |
+file (usually `Init5e1.scm') in platform-dependent directories relative |
to this directory. See *Note File-System Habitat:: for a blow-by-blow
description.
@@ -1270,12 +1335,12 @@ 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, `Init5d9.scm' checks to see if there is file |
+command line, `Init5e1.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.
-`Init5d9.scm' then looks for command input from one of three sources: |
+`Init5e1.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.
@@ -1287,55 +1352,55 @@ Lexical Conventions.

File: scm.info, Node: SCM Options, Next: Invocation Examples, Prev: Invoking SCM, Up: Operational Features
-Options
-=======
+3.2 Options |
+=========== |
The options are processed in the order specified on the command line.
- - Command Option: -a 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
`25000*sizeof(cell)'.
- - Command Option: -no-init-file
- - Command Option: --no-init-file
+ -- Command Option: -no-init-file |
+ -- Command Option: --no-init-file |
Inhibits the loading of `ScmInit.scm' as described above.
- - Command Option: --help
+ -- Command Option: --help |
prints usage information and URI; then exit.
- - Command Option: --version
+ -- Command Option: --version |
prints version information and exit.
- - Command Option: -r feature
+ -- 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, 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
+ -- Command Option: -h feature |
provides FEATURE.
- - Command Option: -l filename
- - Command Option: -f filename
+ -- 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
preceeds it.
- - Command Option: -d filename
+ -- Command Option: -d filename |
Loads SLIB `databases' feature and opens FILENAME as a database.
- - Command Option: -e expression
- - Command Option: -c expression
+ -- Command Option: -e expression |
+ -- Command Option: -c expression |
specifies that the scheme expression EXPRESSION is to be
evaluated. These options are inspired by `perl' and `sh'
respectively. On Amiga systems the entire option and argument
need to be enclosed in quotes. For instance `"-e(newline)"'.
- - Command Option: -o dumpname
+ -- Command Option: -o dumpname |
saves the current SCM session as the executable program `dumpname'.
This option works only in SCM builds supporting `dump' (*note
Dump::).
@@ -1345,33 +1410,33 @@ The options are processed in the order specified on the command line.
it is invoked. Otherwise the (new) command line is processed as
usual when the saved image is invoked.
- - Command Option: -p level
+ -- Command Option: -p level |
sets the prolixity (verboseness) to LEVEL. This is the same as
the `scm' command (verobse LEVEL).
- - Command Option: -v
+ -- Command Option: -v |
(verbose mode) specifies that `scm' will print prompts, evaluation
times, notice of loading files, and garbage collection statistics.
This is the same as `-p3'.
- - Command Option: -q
+ -- Command Option: -q |
(quiet mode) specifies that `scm' will print no extra information.
This is the same as `-p0'.
- - Command Option: -m
+ -- Command Option: -m |
specifies that subsequent loads, evaluations, and user
interactions will be with syntax-rules macro capability. To use a
specific syntax-rules macro implementation from [SLIB] (instead of
[SLIB]'s default) put `-r' MACROPACKAGE before `-m' on the command
line.
- - Command Option: -u
+ -- Command Option: -u |
specifies that subsequent loads, evaluations, and user
interactions will be without syntax-rules macro capability.
Syntax-rules macro capability can be restored by a subsequent `-m'
on the command line or from Scheme code.
- - Command Option: -i
+ -- Command Option: -i |
specifies that `scm' should run interactively. That means that
`scm' will not terminate until the `(quit)' or `(exit)' command is
given, even if there are errors. It also sets the prolixity level
@@ -1381,26 +1446,26 @@ The options are processed in the order specified on the command line.
will assume that it should be interactive unless given a
subsequent `-b' option.
- - Command Option: -b
+ -- Command Option: -b |
specifies that `scm' should run non-interactively. That means that
`scm' will terminate after processing the command line or if there
are errors.
- - Command Option: -s
+ -- Command Option: -s |
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: --
+ -- Command Option: - |
+ -- Command Option: -- |
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
-Invocation Examples
-===================
+3.3 Invocation Examples |
+======================= |
`% scm foo.scm'
Loads and executes the contents of `foo.scm' and then enters
@@ -1431,39 +1496,39 @@ Invocation Examples

File: scm.info, Node: SCM Variables, Next: SCM Session, Prev: Invocation Examples, Up: Operational Features
-Environment Variables
-=====================
+3.4 Environment Variables |
+========================= |
- - Environment Variable: SCM_INIT_PATH
+ -- Environment Variable: SCM_INIT_PATH |
is the pathname where `scm' will look for its initialization code.
- The default is the file `Init5d9.scm' in the source directory. |
+ The default is the file `Init5e1.scm' in the source directory. |
- - Environment Variable: SCHEME_LIBRARY_PATH
+ -- Environment Variable: SCHEME_LIBRARY_PATH |
is the [SLIB] Scheme library directory.
- - Environment Variable: HOME
- is the directory where `Init5d9.scm' will look for the user |
+ -- Environment Variable: HOME |
+ is the directory where `Init5e1.scm' will look for the user |
initialization file `ScmInit.scm'.
- - Environment Variable: EDITOR
+ -- Environment Variable: EDITOR |
is the name of the program which `ed' will call. If EDITOR is not
defined, the default is `ed'.
-Scheme Variables
-================
+3.5 Scheme Variables |
+==================== |
- - Variable: *argv*
+ -- Variable: *argv* |
contains the list of arguments to the program. `*argv*' can change
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'
options.
- - Variable: *interactive*
+ -- Variable: *interactive* |
controls interactivity as explained for the `-i' and `-b' options.
Define this in `ScmInit.scm' or files specified on the command
line. This can be overridden by subsequent `-i' and `-b' options.
@@ -1471,8 +1536,8 @@ Scheme Variables

File: scm.info, Node: SCM Session, Next: Editing Scheme Code, Prev: SCM Variables, Up: Operational Features
-SCM Session
-===========
+3.6 SCM Session |
+=============== |
* Options, file loading and features can be specified from the
command line. *Note System interface: (scm)System interface.
@@ -1484,23 +1549,23 @@ SCM Session
* Typing the interrupt character aborts evaluation of the current
form and resumes the top level read-eval-print loop.
- - Function: quit
- - Function: quit n
- - Function: exit
- - Function: exit n
+ -- Function: quit |
+ -- Function: quit n |
+ -- Function: exit |
+ -- Function: exit n |
Aliases for `exit' (*note exit: (slib)System.). On many systems,
SCM can also tail-call another program. *Note execp:
I/O-Extensions.
- - Callback procedure: boot-tail dumped?
+ -- 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
+ -- Function: program-arguments |
Returns a list of strings of the arguments scm was called with.
- - Function: getlogin
+ -- 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.
@@ -1508,21 +1573,21 @@ SCM Session
For documentation of the procedures `getenv' and `system' *Note System
Interface: (slib)System Interface.
- - Function: vms-debug
+ -- Function: vms-debug |
If SCM is compiled under VMS this `vms-debug' will invoke the VMS
debugger.

File: scm.info, Node: Editing Scheme Code, Next: Debugging Scheme Code, Prev: SCM Session, Up: Operational Features
-Editing Scheme Code
-===================
+3.7 Editing Scheme Code |
+======================= |
- - Function: ed arg1 ...
+ -- Function: ed arg1 ... |
The value of the environment variable `EDITOR' (or just `ed' if it
isn't defined) is invoked as a command with arguments ARG1 ....
- - Function: ed filename
+ -- Function: ed filename |
If SCM is compiled under VMS `ed' will invoke the editor with a
single the single argument FILENAME.
@@ -1561,10 +1626,10 @@ other systems:
After editing, the modified file will be loaded.

-File: scm.info, Node: Debugging Scheme Code, Next: Errors, Prev: Editing Scheme Code, Up: Operational Features
-
-Debugging Scheme Code
-=====================
+File: scm.info, Node: Debugging Scheme Code, Next: Debugging Continuations, Prev: Editing Scheme Code, Up: Operational Features
+ |
+3.8 Debugging Scheme Code |
+========================= |
The `cautious' and `stack-limit' options of `build' (*note Build
Options::) support debugging in Scheme.
@@ -1600,34 +1665,53 @@ Options::) support debugging in Scheme.
There are several SLIB macros which so useful that SCM automatically
loads the appropriate module from SLIB if they are invoked.
- - Macro: trace proc1 ...
+ -- Macro: trace proc1 ... |
Traces the top-level named procedures given as arguments.
- - Macro: trace
+ -- Macro: trace |
With no arguments, makes sure that all the currently traced
identifiers are traced (even if those identifiers have been
redefined) and returns a list of the traced identifiers.
- - Macro: untrace proc1 ...
+ -- Macro: untrace proc1 ... |
Turns tracing off for its arguments.
- - Macro: untrace
+ -- Macro: untrace |
With no arguments, untraces all currently traced identifiers and
returns a list of these formerly traced identifiers.
The routines I use most frequently for debugging are:
- - Procedure: print arg1 ...
+ -- Function: 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.
- One can just insert `(print '<proc-name>' and `)' around an
- expression in order to see its value as a program operates.
+ One can just insert `(print '<label>' and `)' around an expression |
+ in order to see its values as a program operates. |
- - Syntax: print-args name1 ...
- Writes NAME1 ... (separated by spaces) and then writes the values
- of the closest lexical bindings enclosing the call to `Print-args'.
+ -- Function: pprint arg1 ... |
+ `Pprint' pretty-prints (*note Pretty-Print: (slib)Pretty-Print.) |
+ all its arguments, separated by newlines. `Pprint' returns the |
+ value of the last argument. |
+ |
+ One can just insert `(pprint '<label>' and `)' around an |
+ expression in order to see its values as a program operates. |
+ _Note_ `pretty-print' does _not_ format procedures. |
+ |
+When typing at top level, `pprint' is not a good way to see nested |
+structure because it will return the last object pretty-printed, which |
+could be large. `pp' is a better choice. |
+ |
+ -- Procedure: pp arg1 ... |
+ `Pprint' pretty-prints (*note Pretty-Print: (slib)Pretty-Print.) |
+ all its arguments, separated by newlines. `pp' returns |
+ `#<unspecified>'. |
+ |
+ -- Syntax: print-args name |
+ -- Syntax: print-args |
+ Writes NAME if supplied; then writes the names and values of the |
+ closest lexical bindings enclosing the call to `Print-args'. |
(define (foo a b) (print-args foo) (+ a b))
(foo 3 6)
@@ -1643,16 +1727,104 @@ When `trace' is not sufficient to find program flow problems, SLIB-PSD,
the Portable Scheme Debugger offers source code debugging from GNU
Emacs. PSD runs slowly, so start by instrumenting only a few functions
at a time.
- http://swissnet.ai.mit.edu/ftpdir/scm/slib-psd1-3.tar.gz
- swissnet.ai.mit.edu:/pub/scm/slib-psd1-3.tar.gz
+ http://swiss.csail.mit.edu/ftpdir/scm/slib-psd1-3.tar.gz |
+ swiss.csail.mit.edu:/pub/scm/slib-psd1-3.tar.gz |
ftp.maths.tcd.ie:pub/bosullvn/jacal/slib-psd1-3.tar.gz
ftp.cs.indiana.edu:/pub/scheme-repository/utl/slib-psd1-3.tar.gz

-File: scm.info, Node: Errors, Next: Memoized Expressions, Prev: Debugging Scheme Code, Up: Operational Features
-
-Errors
-======
+File: scm.info, Node: Debugging Continuations, Next: Errors, Prev: Debugging Scheme Code, Up: Operational Features
+ |
+3.9 Debugging Continuations |
+=========================== |
+ |
+These functions are defined in `debug.c', all operate on captured |
+continuations: |
+ |
+ -- Procedure: frame-trace cont n |
+ Prints information about the code being executed and the |
+ environment scopes active for continuation frame N of continuation |
+ CONT. A "continuation frame" is an entry in the environment |
+ stack; a new frame is pushed when the environment is replaced or |
+ extended in a non-tail call context. Frame 0 is the top of the |
+ stack. |
+ |
+ -- Procedure: frame->environment cont n |
+ Prints the environment for continuation frame N of continuation |
+ CONT. This contains just the names, not the values, of the |
+ environment. |
+ |
+ -- Procedure: scope-trace env |
+ will print information about active lexical scopes for environment |
+ ENV. |
+ |
+ -- Procedure: frame-eval cont n expr |
+ Evaluates EXPR in the environment defined by continuation frame N |
+ of continuation CONT and returns the result. Values in the |
+ environment may be returned or SET!. |
+ |
+*Note stack-trace: Errors. also now accepts an optional continuation |
+argument. `stack-trace' differs from `frame-trace' in that it |
+truncates long output using safeports and prints code from all |
+available frames. |
+ |
+ (define k #f) |
+ (define (foo x y) |
+ (set! k (call-with-current-continuation identity)) |
+ #f) |
+ (let ((a 3) (b 4)) |
+ (foo a b) |
+ #f) |
+ (stack-trace k) |
+ -| |
+ ;STACK TRACE |
+ 1; ((#@set! #@k (#@call-with-current-continuation #@identity)) #f ... |
+ 2; (#@let ((a 3) (b 4)) (#@foo #@a #@b) #f) |
+ ... |
+ #t |
+ |
+ (frame-trace k 0) |
+ -| |
+ (#@call-with-current-continuation #@identity) |
+ ; in scope: |
+ ; (x y) procedure foo#<unspecified> |
+ |
+ (frame-trace k 1) |
+ -| |
+ ((#@set! #@k (#@call-with-current-continuation #@identity)) #f) |
+ ; in scope: |
+ ; (x y) procedure foo#<unspecified> |
+ |
+ (frame-trace k 2) |
+ -| |
+ (#@let ((a 3) (b 4)) (#@foo #@a #@b) #f) |
+ ; in scope: |
+ ; (a b . #@let)#<unspecified> |
+ |
+ (frame-trace k 3) |
+ -| |
+ (#@let ((a 3) (b 4)) (#@foo #@a #@b) #f) |
+ ; in top level environment. |
+ |
+ (frame->environment k 0) |
+ -| |
+ ((x y) 2 foo) |
+ |
+ (scope-trace (frame->environment k 0)) |
+ -| |
+ ; in scope: |
+ ; (x y) procedure foo#<unspecified> |
+ |
+ (frame-eval k 0 'x) => 3 |
+ |
+ (frame-eval k 0 '(set! x 8)) |
+ (frame-eval k 0 'x) => 8 |
+ |
+
+File: scm.info, Node: Errors, Next: Memoized Expressions, Prev: Debugging Continuations, Up: Operational Features
+ |
+3.10 Errors |
+=========== |
A computer-language implementation designer faces choices of how
reflexive to make the implementation in handling exceptions and errors;
@@ -1729,7 +1901,7 @@ other error messages which are not treated specially.
"PROF_SIGNAL"
`(profile-alarm-interrupt)'
- - Variable: errobj
+ -- Variable: errobj |
When SCM encounters a non-fatal error, it aborts evaluation of the
current form, prints a message explaining the error, and resumes
the top level read-eval-print loop. The value of ERROBJ is the
@@ -1739,8 +1911,8 @@ other error messages which are not treated specially.
`errno' and `perror' report ANSI C errors encountered during a call to
a system or library function.
- - Function: errno
- - Function: errno n
+ -- Function: errno |
+ -- Function: errno n |
With no argument returns the current value of the system variable
`errno'. When given an argument, `errno' sets the system variable
`errno' to N and returns the previous value of `errno'. `(errno
@@ -1748,7 +1920,7 @@ a system or library function.
`try-load' returns `#f' since this occurs when the file could not
be opened.
- - Function: perror string
+ -- Function: perror string |
Prints on standard error output the argument STRING, a colon,
followed by a space, the error message corresponding to the current
value of `errno' and a newline. The value returned is unspecified.
@@ -1756,15 +1928,15 @@ a system or library function.
`warn' and `error' provide a uniform way for Scheme code to signal
warnings and errors.
- - Function: warn arg1 arg2 arg3 ...
+ -- Function: warn arg1 arg2 arg3 ... |
Alias for *Note slib:warn: (slib)System. Outputs an error message
- containing the arguments. `warn' is defined in `Init5d9.scm'. |
+ containing the arguments. `warn' is defined in `Init5e1.scm'. |
- - Function: error arg1 arg2 arg3 ...
+ -- 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 `Init5d9.scm'. |
+ defined in `Init5e1.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
@@ -1779,17 +1951,17 @@ and conclude by calling `breakpoint' (*note Breakpoints:
(slib)Breakpoints.). This allows the user to interract with SCM as
with Lisp systems.
- - Function: stack-trace
+ -- 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 `Init5d9.scm' for an example of the use |
+ and `#f' otherwise. See `Init5e1.scm' for an example of the use |
of `stack-trace'.

File: scm.info, Node: Memoized Expressions, Next: Internal State, Prev: Errors, Up: Operational Features
-Memoized Expressions
-====================
+3.11 Memoized Expressions |
+========================= |
SCM memoizes the address of each occurence of an identifier's value when
first encountering it in a source expression. Subsequent executions of
@@ -1807,7 +1979,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 `Init5d9.scm': |
+For instance, `open-input-file' is defined as follows in `Init5e1.scm': |
(define (open-input-file str)
(or (open-file str OPEN_READ)
@@ -1835,10 +2007,10 @@ If we cause `open-input-file' to execute other sections of code, they
too become memoized:
(open-input-file "foo.scm") =>
-
+
ERROR: No such file or directory
ERROR: OPEN-INPUT-FILE couldn't open file "foo.scm"
-
+
open-input-file =>
#<CLOSURE (str) (#@or (#@open-file #@0+0 #@open_read)
(#@and (#@procedure? #@could-not-open) (could-not-open) #f)
@@ -1847,36 +2019,36 @@ too become memoized:

File: scm.info, Node: Internal State, Next: Scripting, Prev: Memoized Expressions, Up: Operational Features
-Internal State
-==============
+3.12 Internal State |
+=================== |
- - Variable: *interactive*
+ -- Variable: *interactive* |
The variable *INTERACTIVE* determines whether the SCM session is
interactive, or should quit after the command line is processed.
*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 `Init5d9.scm' for details. |
+ more complicated; see `Init5e1.scm' for details. |
- - Function: abort
+ -- Function: abort |
Resumes the top level Read-Eval-Print loop.
- - Function: restart
+ -- Function: restart |
Restarts the SCM program with the same arguments as it was
originally invoked. All `-l' loaded files are loaded again; If
those files have changed, those changes will be reflected in the
new session.
- _Note:_ When running a saved executable (*note Dump::), `restart'
+ _Note_ When running a saved executable (*note Dump::), `restart' |
is redefined to be `exec-self'.
- - Function: exec-self
+ -- Function: exec-self |
Exits and immediately re-invokes the same executable with the same
arguments. If the executable file has been changed or replaced
since the beginning of the current session, the _new_ executable
will be invoked. This differentiates `exec-self' from `restart'.
- - Function: verbose n
+ -- Function: verbose n |
Controls how much monitoring information is printed. If N is:
0
@@ -1900,20 +2072,20 @@ Internal State
a message for each GC (*note Garbage Collection::) is printed;
warnings issued for top-level symbols redefined.
- - Function: gc
+ -- Function: gc |
Scans all of SCM objects and reclaims for further use those that
are no longer accessible.
- - Function: room
- - Function: room #t
+ -- Function: room |
+ -- Function: room #t |
Prints out statistics about SCM's current use of storage. `(room
#t)' also gives the hexadecimal heap segment and stack bounds.
- - Constant: *scm-version*
- Contains the version string (e.g. `5d9') of SCM. |
+ -- Constant: *scm-version* |
+ Contains the version string (e.g. `5e1') of SCM. |
-Executable path
----------------
+3.12.1 Executable path |
+---------------------- |
In order to dump a saved executable or to dynamically-link using DLD,
SCM must know where its executable file is. Sometimes SCM (*note
@@ -1921,13 +2093,13 @@ Executable Pathname::) guesses incorrectly the location of the
currently running executable. In that case, the correct path can be set
by calling `execpath' with the pathname.
- - Function: execpath
+ -- Function: execpath |
Returns the path (string) which SCM uses to find the executable
file whose invocation the currently running session is, or #f if
the path is not set.
- - Function: execpath #f
- - Function: execpath newpath
+ -- Function: execpath #f |
+ -- Function: execpath newpath |
Sets the path to `#f' or NEWPATH, respectively. The old path is
returned.
@@ -1937,8 +2109,8 @@ For other configuration constants and procedures *Note Configuration:

File: scm.info, Node: Scripting, Prev: Internal State, Up: Operational Features
-Scripting
-=========
+3.13 Scripting |
+============== |
* Menu:
@@ -1949,14 +2121,14 @@ Scripting

File: scm.info, Node: Unix Scheme Scripts, Next: MS-DOS Compatible Scripts, Prev: Scripting, Up: Scripting
-Unix Scheme Scripts
--------------------
+3.13.1 Unix Scheme Scripts |
+-------------------------- |
In reading this section, keep in mind that the first line of a script
file has (different) meanings to SCM and the operating system
(`execve').
- - file: #! interpreter \ ...
+ -- file: #! interpreter \ ... |
On unix systems, a "Shell-Script" is a file (with execute
permissions) whose first two characters are `#!'. The INTERPRETER
argument must be the pathname of the program to process the rest
@@ -1985,7 +2157,7 @@ file has (different) meanings to SCM and the operating system
`\' substitution; this will only take place if INTERPRETER is a
SCM or SCSH interpreter.
- - Read syntax: #! ignored !#
+ -- Read syntax: #! ignored !# |
When the first two characters of the file being loaded are `#!' and
a `\' is present before a newline in the file, all characters up
to `!#' will be ignored by SCM `read'.
@@ -1997,15 +2169,15 @@ POSIX shell-scripts if the first line is:
The following Scheme-Script prints factorial of its argument:
- #! /usr/local/bin/scm \ %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
+ #! /usr/local/bin/scm \ %0 %* |
- !#
-
+
(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 "\
@@ -2014,9 +2186,9 @@ The following Scheme-Script prints factorial of its argument:
"
(current-error-port))
#f)
-
+
(define (fact n) (if (< n 2) 1 (* n (fact (+ -1 n)))))
-
+
(if *script* (exit (fact.script (list-tail *argv* *optind*))))
./fact 32
@@ -2035,23 +2207,23 @@ usage information.

File: scm.info, Node: MS-DOS Compatible Scripts, Next: Unix Shell Scripts, Prev: Unix Scheme Scripts, Up: Scripting
-MS-DOS Compatible Scripts
--------------------------
+3.13.2 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', which are available from: |
-<http://swissnet.ai.mit.edu/ftpdir/scm/sharpbang.zip> |
+`http://swiss.csail.mit.edu/ftpdir/scm/sharpbang.zip' |
With these two programs installed in a `PATH' directory, we have the
following syntax for <PROGRAM>.BAT files.
- - file: #! interpreter \ %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
+ -- file: #! interpreter \ %0 %* |
The first two characters of the Scheme-Script are `#!'. The
INTERPRETER can be either a unix style program path (using `/'
between filename components) or a DOS program name or path. The
rest of the first line of the Scheme-Script should be literally
- `\ %0 %1 %2 %3 %4 %5 %6 %7 %8 %9', as shown.
+ `\ %0 %*', as shown. |
If INTERPRETER has `/' in it, INTERPRETER is converted to a DOS
style filename (`/' => `\').
@@ -2076,8 +2248,8 @@ systems.

File: scm.info, Node: Unix Shell Scripts, Prev: MS-DOS Compatible Scripts, Up: Scripting
-Unix Shell Scripts
-------------------
+3.13.3 Unix Shell Scripts |
+------------------------- |
Scheme-scripts suffer from two drawbacks:
* Some Unixes limit the length of the `#!' interpreter line to the
@@ -2109,14 +2281,14 @@ argument, making it compatible with the scheme code of the previous
example.
#! /bin/sh
- :;exec scm -e"(set! *script* \"$0\")" -l$0 $*
-
+ :;exec scm -e"(set! *script* \"$0\")" -l$0 "$@" |
+
(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 "\
@@ -2125,9 +2297,9 @@ example.
"
(current-error-port))
#f)
-
+
(define (fact n) (if (< n 2) 1 (* n (fact (+ -1 n)))))
-
+
(if *script* (exit (fact.script (list-tail *argv* *optind*))))
./fact 6
@@ -2136,8 +2308,8 @@ example.

File: scm.info, Node: The Language, Next: Packages, Prev: Operational Features, Up: Top
-The Language
-************
+4 The Language |
+************** |
* Menu:
@@ -2154,8 +2326,8 @@ The Language

File: scm.info, Node: Standards Compliance, Next: Storage, Prev: The Language, Up: The Language
-Standards Compliance
-====================
+4.1 Standards Compliance |
+======================== |
Scm conforms to the `IEEE Standard 1178-1990. IEEE Standard for the
Scheme Programming Language.' (*note Bibliography::), and `Revised(5)
@@ -2216,7 +2388,7 @@ Optionals of [R5RS] not Supported by SCM
See SLIB file `Template.scm'.
`current-time'
- *Note Time: (slib)Time.
+ *Note Time and Date: (slib)Time and Date. |
`defmacro'
*Note Defmacro: (slib)Defmacro.
@@ -2274,10 +2446,10 @@ Optionals of [R5RS] not Supported by SCM

File: scm.info, Node: Storage, Next: Time, Prev: Standards Compliance, Up: The Language
-Storage
-=======
+4.2 Storage |
+=========== |
- - Function: vector-set-length! object length
+ -- Function: vector-set-length! object length |
Change the length of string, vector, bit-vector, or uniform-array
OBJECT to LENGTH. If this shortens OBJECT then the remaining
contents are lost. If it enlarges OBJECT then the contents of the
@@ -2285,20 +2457,20 @@ Storage
It is an error to change the length of literal datums. The new
object is returned.
- - Function: copy-tree obj
- - Function: @copy-tree obj
+ -- Function: copy-tree obj |
+ -- Function: @copy-tree obj |
*Note copy-tree: (slib)Tree Operations. This extends the SLIB
version by also copying vectors. Use `@copy-tree' if you depend
on this feature; `copy-tree' could get redefined.
- - Function: acons obj1 obj2 obj3
+ -- Function: acons obj1 obj2 obj3 |
Returns (cons (cons obj1 obj2) obj3).
(set! a-list (acons key datum a-list))
Adds a new association to a-list.
- - Callback procedure: gc-hook ...
+ -- 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
@@ -2306,7 +2478,7 @@ Storage
To remove the gc-hook, `(set! gc-hook #f)'.
- - Function: add-finalizer object finalizer
+ -- 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
@@ -2332,38 +2504,38 @@ Storage

File: scm.info, Node: Time, Next: Interrupts, Prev: Storage, Up: The Language
-Time
-====
+4.3 Time |
+======== |
- - Constant: internal-time-units-per-second
+ -- Constant: internal-time-units-per-second |
Is the integer number of internal time units in a second.
- - Function: get-internal-run-time
+ -- Function: get-internal-run-time |
Returns the integer run time in internal time units from an
unspecified starting time. The difference of two calls to
`get-internal-run-time' divided by
`internal-time-units-per-second' will give elapsed run time in
seconds.
- - Function: get-internal-real-time
+ -- Function: get-internal-real-time |
Returns the integer time in internal time units from an unspecified
starting time. The difference of two calls to
`get-internal-real-time' divided by
`interal-time-units-per-second' will give elapsed real time in
seconds.
- - Function: current-time
+ -- Function: current-time |
Returns the time since 00:00:00 GMT, January 1, 1970, measured in
- seconds. *Note current-time: (slib)Time. `current-time' is used
- in *Note Time: (slib)Time.
+ seconds. *Note current-time: (slib)Time and Date. `current-time' |
+ is used in *Note Time and Date: (slib)Time and Date. |

File: scm.info, Node: Interrupts, Next: Process Synchronization, Prev: Time, Up: The Language
-Interrupts
-==========
+4.4 Interrupts |
+============== |
- - Function: ticks n
+ -- Function: ticks n |
Returns the number of ticks remaining till the next tick interrupt.
Ticks are an arbitrary unit of evaluation. Ticks can vary greatly
in the amount of time they represent.
@@ -2373,22 +2545,22 @@ Interrupts
`ticks' is supported if SCM is compiled with the `ticks' flag
defined.
- - Callback procedure: ticks-interrupt ...
+ -- Callback procedure: ticks-interrupt ... |
Establishes a response for tick interrupts. Another tick
interrupt will not occur unless `ticks' is called again. Program
execution will resume if the handler returns. This procedure
should (abort) or some other action which does not return if it
does not want processing to continue.
- - Function: alarm secs
+ -- Function: alarm secs |
Returns the number of seconds remaining till the next alarm
interrupt. If SECS is 0, any alarm request is canceled.
Otherwise an `alarm-interrupt' will be signaled SECS from the
current time. ALARM is not supported on all systems.
- - Function: milli-alarm millisecs interval
- - Function: virtual-alarm millisecs interval
- - Function: profile-alarm millisecs interval
+ -- Function: milli-alarm millisecs interval |
+ -- Function: virtual-alarm millisecs interval |
+ -- Function: profile-alarm millisecs interval |
`milli-alarm' is similar to `alarm', except that the first
argument MILLISECS, and the return value are measured in
milliseconds rather than seconds. If the optional argument
@@ -2405,10 +2577,10 @@ Interrupts
`milli-alarm', `virtual-alarm', and `profile-alarm' are supported
only on systems providing the `setitimer' system call.
- - Callback procedure: user-interrupt ...
- - Callback procedure: alarm-interrupt ...
- - Callback procedure: virtual-alarm-interrupt ...
- - Callback procedure: profile-alarm-interrupt ...
+ -- Callback procedure: user-interrupt ... |
+ -- Callback procedure: alarm-interrupt ... |
+ -- Callback procedure: virtual-alarm-interrupt ... |
+ -- Callback procedure: profile-alarm-interrupt ... |
Establishes a response for `SIGINT' (control-C interrupt) and
`SIGALRM', `SIGVTALRM', and `SIGPROF' interrupts. Program
execution will resume if the handler returns. This procedure
@@ -2421,11 +2593,11 @@ Interrupts
To unestablish a response for an interrupt set the handler symbol
to `#f'. For instance, `(set! user-interrupt #f)'.
- - Callback procedure: out-of-storage ...
- - Callback procedure: could-not-open ...
- - Callback procedure: end-of-program ...
- - Callback procedure: hang-up ...
- - Callback procedure: arithmetic-error ...
+ -- Callback procedure: out-of-storage ... |
+ -- Callback procedure: could-not-open ... |
+ -- Callback procedure: end-of-program ... |
+ -- Callback procedure: hang-up ... |
+ -- Callback procedure: arithmetic-error ... |
Establishes a response for storage allocation error, file opening
error, end of program, SIGHUP (hang up interrupt) and arithmetic
errors respectively. This procedure should (abort) or some other
@@ -2439,15 +2611,15 @@ Interrupts

File: scm.info, Node: Process Synchronization, Next: Files and Ports, Prev: Interrupts, Up: The Language
-Process Synchronization
-=======================
+4.5 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
+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
+ -- Function: make-exchanger obj |
Returns a new exchanger with the argument OBJ as its initial
content.
@@ -2465,28 +2637,28 @@ operation.
(set! lst (cdr lst))
ret)))
(lambda () (and lst (queue lst))))))
-
+
(pop queue) => a
-
+
(pop queue) => #f
- - Function: make-arbiter name
+ -- Function: make-arbiter name |
Returns an object of type arbiter and name NAME. Its state is
initially unlocked.
- - Function: try-arbiter arbiter
+ -- Function: try-arbiter arbiter |
Returns `#t' and locks ARBITER if ARBITER was unlocked.
Otherwise, returns `#f'.
- - Function: release-arbiter arbiter
+ -- Function: release-arbiter arbiter |
Returns `#t' and unlocks ARBITER if ARBITER was locked.
Otherwise, returns `#f'.

File: scm.info, Node: Files and Ports, Next: Eval and Load, Prev: Process Synchronization, Up: The Language
-Files and Ports
-===============
+4.6 Files and Ports |
+=================== |
These procedures generalize and extend the standard capabilities in
*Note Ports: (r5rs)Ports.
@@ -2501,11 +2673,11 @@ These procedures generalize and extend the standard capabilities in

File: scm.info, Node: Opening and Closing, Next: Port Properties, Prev: Files and Ports, Up: Files and Ports
-Opening and Closing
--------------------
+4.6.1 Opening and Closing |
+------------------------- |
- - Function: open-file string modes
- - Function: try-open-file string modes
+ -- Function: open-file string modes |
+ -- Function: try-open-file string modes |
Returns a port capable of receiving or delivering characters as
specified by the MODES string. If a file cannot be opened `#f' is
returned.
@@ -2515,9 +2687,9 @@ Opening and Closing
`try-open-file' is the primitive procedure; Do not redefine
`try-open-file'!
- - Constant: open_read
- - Constant: open_write
- - Constant: open_both
+ -- Constant: open_read |
+ -- Constant: open_write |
+ -- Constant: open_both |
Contain modes strings specifying that a file is to be opened for
reading, writing, and both reading and writing respectively.
@@ -2525,108 +2697,108 @@ Opening and Closing
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
+ -- 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
`(current-input-port)' is unbuffered if the platform supports it.
- - Function: _tracked modestr
+ -- Function: _tracked modestr |
Returns a version of MODESTR which when `open-file' is called with
it as the second argument will return a tracked port. A tracked
port maintains current line and column numbers, which may be
queried with `port-line' and `port-column'.
- - Function: _exclusive modestr
+ -- 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
+ -- 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
+ -- Function: close-port port |
Closes PORT. The same as close-input-port and close-output-port.

File: scm.info, Node: Port Properties, Next: Port Redirection, Prev: Opening and Closing, Up: Files and Ports
-Port Properties
----------------
+4.6.2 Port Properties |
+--------------------- |
- - Function: port-closed? port
+ -- Function: port-closed? port |
Returns #t if PORT is closed.
- - Function: port-type obj
+ -- 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
+ -- 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
+ -- 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
+ -- 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
+ -- Function: isatty? port |
Returns `#t' if PORT is input or output to a serial non-file
device.
- - procedure: char-ready?
- - procedure: char-ready? port
+ -- procedure: char-ready? |
+ -- procedure: char-ready? port |
Returns `#t' if a character is ready on the input PORT and returns
`#f' otherwise. If `char-ready?' returns `#t' then the next
`read-char' operation on the given PORT is guaranteed not to hang.
- If the PORT is at end of file then `char-ready?' returns `#t'.
- PORT may be omitted, in which case it defaults to the value
- returned by `current-input-port'.
-
- _Rationale:_ `Char-ready?' exists to make it possible for a
- program to accept characters from interactive ports without
- getting stuck waiting for input. Any input editors associated
- with such ports must ensure that characters whose existence has
- been asserted by `char-ready?' cannot be rubbed out. If
- `char-ready?' were to return `#f' at end of file, a port at end of
- file would be indistinguishable from an interactive port that has
- no ready characters.
-
- - procedure: wait-for-input x
- - procedure: wait-for-input x port1 ...
+ If the PORT is at end of file then `char-ready?' returns `#t'. PORT |
+ may be omitted, in which case it defaults to the value returned by |
+ `current-input-port'. |
+
+ _Rationale_ `Char-ready?' exists to make it possible for a program |
+ to accept characters from interactive ports without getting stuck |
+ waiting for input. Any input editors associated with such ports |
+ must ensure that characters whose existence has been asserted by |
+ `char-ready?' cannot be rubbed out. If `char-ready?' were to |
+ return `#f' at end of file, a port at end of file would be |
+ indistinguishable from an interactive port that has no ready |
+ characters. |
+
+ -- procedure: wait-for-input x |
+ -- procedure: wait-for-input x port1 ... |
Returns a list those ports PORT1 ... which are `char-ready?'. If
none of PORT1 ... become `char-ready?' within the time interval of
X seconds, then #f is returned. The PORT1 ... arguments may be
omitted, in which case they default to the list of the value
- returned by `current-input-port'.
+ returned by `current-input-port'.

File: scm.info, Node: Port Redirection, Next: Soft Ports, Prev: Port Properties, Up: Files and Ports
-Port Redirection
-----------------
+4.6.3 Port Redirection |
+---------------------- |
- - Function: current-error-port
+ -- Function: current-error-port |
Returns the current port to which diagnostic output is directed.
- - Function: with-error-to-file string thunk
+ -- 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
@@ -2635,14 +2807,14 @@ Port Redirection
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
+ -- 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
+ -- 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
@@ -2653,16 +2825,16 @@ Port Redirection

File: scm.info, Node: Soft Ports, Prev: Port Redirection, Up: Files and Ports
-Soft Ports
-----------
+4.6.4 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.
- - Function: make-soft-port vector modes
+ -- Function: make-soft-port vector modes |
Returns a port capable of receiving or delivering characters as
specified by the MODES string (*note open-file: Files and Ports.).
- VECTOR must be a vector of length 6. Its components are as
+ VECTOR must be a vector of length 5. Its components are as |
follows:
0. procedure accepting one character for output
@@ -2696,16 +2868,16 @@ accepting or delivering characters. It allows emulation of I/O ports.
(lambda () (char-upcase (read-char)))
(lambda () (display "@" stdout)))
"rw"))
-
+
(write p p) => #<input-output-soft#\space45d10#\>

File: scm.info, Node: Eval and Load, Next: Lexical Conventions, Prev: Files and Ports, Up: The Language
-Eval and Load
-=============
+4.7 Eval and Load |
+================= |
- - Function: try-load filename
+ -- 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'.
@@ -2713,26 +2885,26 @@ Eval and Load
affect the values returned by `current-input-port' and
`current-output-port'.
- - Variable: *load-pathname*
+ -- 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
+ -- Function: eval obj |
Alias for *Note eval: (slib)System.
- - Function: eval-string str
+ -- 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
+ -- 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
+ -- Function: line-number |
Returns the current line number of the file currently being loaded.
* Menu:
@@ -2742,15 +2914,15 @@ Eval and Load

File: scm.info, Node: Line Numbers, Prev: Eval and Load, Up: Eval and Load
-Line Numbers
-------------
+4.7.1 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
+ -- 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
@@ -2764,9 +2936,9 @@ 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
+ -- 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 |
@@ -2774,22 +2946,22 @@ line-numbers in other positions is undefined.
replacement is done only if PORT is a tracked port See *Note |
Files and Ports::. |
|
-
- - Function: integer->line-number int
+ |
+ -- 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
+ -- Function: line-number->integer linum |
Returns the value of line-number object LINUM as an integer.
- - Function: line-number? obj
+ -- Function: line-number? obj |
Returns true if and only if OBJ is a line-number object.
- - Function: read-for-load port |
+ -- Function: read-for-load port |
Behaves like `read', except that load syntaxes are enabled. |
|
- - Variable: *load-reader*
- - Variable: *slib-load-reader*
+ -- 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
@@ -2802,8 +2974,8 @@ line-numbers in other positions is undefined.

File: scm.info, Node: Lexical Conventions, Next: Syntax, Prev: Eval and Load, Up: The Language
-Lexical Conventions
-===================
+4.8 Lexical Conventions |
+======================= |
* Menu:
@@ -2815,10 +2987,10 @@ Lexical Conventions

File: scm.info, Node: Common-Lisp Read Syntax, Next: Load Syntax, Prev: Lexical Conventions, Up: Lexical Conventions
|
-Common-Lisp Read Syntax
------------------------
+4.8.1 Common-Lisp Read Syntax |
+----------------------------- |
- - Read syntax: #\token |
+ -- 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))'. |
@@ -2827,7 +2999,7 @@ Common-Lisp Read Syntax
followed by a character, then a meta character is read. `c-' and |
`m-' prefixes may be combined. |
- - Read syntax: #+ feature form
+ -- 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.
@@ -2837,10 +3009,10 @@ Common-Lisp Read Syntax
For more information on `provided?' and `*features*', *Note
Require: (slib)Require.
- - Read syntax: #- feature form
+ -- Read syntax: #- feature form |
is equivalent to `#+(not feature) expression'.
- |
- - Read syntax: #| any thing |#
+
+ -- Read syntax: #| any thing |# |
Is a balanced comment. Everything up to the matching `|#' is
ignored by the `read'. Nested `#|...|#' can occur inside ANY
THING.
@@ -2850,7 +3022,7 @@ 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 |
+ -- Load syntax: #. expression |
Is read as the object resulting from the evaluation of EXPRESSION. |
This substitution occurs even inside quoted structure. |
@@ -2861,42 +3033,42 @@ using `#.'. |
#.(define foo 9) => #<unspecified> |
'(#.foo #.(+ foo foo)) => (9 18) |
|
- - Load syntax: #' form |
+ -- 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 |
------------ |
- |
+4.8.2 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 |
+ -- Load syntax: #?line |
+ -- Load syntax: #?column |
Return integers for the current line and column being read during a |
load. |
|
- - Load syntax: #?file |
+ -- 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
+4.8.3 Documentation and Comments |
+-------------------------------- |
+ |
+ -- procedure: procedure-documentation proc |
Returns the documentation string of PROC if it exists, or `#f' if
not.
If the body of a `lambda' (or the definition of a procedure) has
more than one expression, and the first expression (preceeding any
internal definitions) is a string, then that string is the
- "documentation string" of that procedure.
+ "documentation string" of that procedure.
(procedure-documentation (lambda (x) "Identity" x)) => "Identity"
(define (square x)
@@ -2905,24 +3077,24 @@ Documentation and Comments
=> #<unspecified>
(procedure-documentation square) => "Return the square of X."
- - Function: comment string1 ...
+ -- Function: comment string1 ... |
Appends STRING1 ... to the strings given as arguments to previous
calls `comment'.
- - Function: comment
+ -- Function: comment |
Returns the (appended) strings given as arguments to previous calls
`comment' and empties the current string collection.
- - Load syntax: #;text-till-end-of-line |
+ -- Load syntax: #;text-till-end-of-line |
Behaves as `(comment "TEXT-TILL-END-OF-LINE")'.

File: scm.info, Node: Modifying Read Syntax, Prev: Documentation and Comments, Up: Lexical Conventions
-Modifying Read Syntax
----------------------
+4.8.4 Modifying Read Syntax |
+--------------------------- |
- - Callback procedure: read:sharp c port
+ -- 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
@@ -2932,13 +3104,13 @@ Modifying Read Syntax
whitespace. `#<unspecified>' is the value returned by the
expression `(if #f #f)'.
- - Callback procedure: load:sharp c port |
+ -- 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 |
+ -- 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 |
@@ -2946,7 +3118,7 @@ Modifying Read Syntax
the value of `read' for this expression, otherwise an error will |
be signaled. |
-_Note:_ When adding new <#> syntaxes, have your code save the previous
+_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 |
@@ -2955,8 +3127,8 @@ supported (as they dispatch from `read:sharp'). |

File: scm.info, Node: Syntax, Prev: Lexical Conventions, Up: The Language
-Syntax
-======
+4.9 Syntax |
+========== |
SCM provides a native implementation of "defmacro". *Note Defmacro:
(slib)Defmacro.
@@ -2988,16 +3160,16 @@ use the correct macro loader when `require'd.

File: scm.info, Node: Define and Set, Next: Defmacro, Prev: Syntax, Up: Syntax
-Define and Set
---------------
+4.9.1 Define and Set |
+-------------------- |
- - Special Form: defined? symbol
+ -- Special Form: defined? symbol |
Equivalent to `#t' if SYMBOL is a syntactic keyword (such as `if')
or a symbol with a value in the top level environment (*note
Variables and regions: (r5rs)Variables and regions.). Otherwise
equivalent to `#f'.
- - Special Form: defvar identifier initial-value
+ -- Special Form: defvar identifier initial-value |
If IDENTIFIER is unbound in the top level environment, then
IDENTIFIER is `define'd to the result of evaluating the form
INITIAL-VALUE as if the `defvar' form were instead the form
@@ -3006,7 +3178,7 @@ Define and Set
value is not changed. `defvar' is valid only when used at |
top-level.
- - Special Form: defconst identifier value
+ -- Special Form: defconst identifier value |
If IDENTIFIER is unbound in the top level environment, then
IDENTIFIER is `define'd to the result of evaluating the form VALUE
as if the `defconst' form were instead the form `(define
@@ -3015,7 +3187,7 @@ Define and Set
an error is signaled. `defconst' is valid only when used at
top-level.
- - Special Form: set! (variable1 variable2 ...) <expression>
+ -- Special Form: set! (variable1 variable2 ...) <expression> |
The identifiers VARIABLE1, VARIABLE2, ... must be bound either in
some region enclosing the `set!' expression or at top level.
@@ -3029,7 +3201,7 @@ Define and Set
(set! (x y) (list 4 5)) => _unspecified_
(+ x y) => 9
- - Special Form: qase key clause1 clause2 ...
+ -- 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:
@@ -3070,8 +3242,8 @@ Define and Set

File: scm.info, Node: Defmacro, Next: Syntax-Rules, Prev: Define and Set, Up: Syntax
-Defmacro
---------
+4.9.2 Defmacro |
+-------------- |
SCM supports the following constructs from Common Lisp: `defmacro',
`macroexpand', `macroexpand-1', and `gentemp'. *Note Defmacro:
@@ -3096,16 +3268,16 @@ For example:
(defmacro (let1 ((name value)) . body)
`((lambda (,name) ,@body) ,value))
-
+
(let1 ((x (foo))) (print x) x) == ((lambda (x) (print x) x) (foo))
-
+
(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
-------------
+4.9.3 Syntax-Rules |
+------------------ |
SCM supports [R5RS] `syntax-rules' macros *Note Macros: (r5rs)Macros.
@@ -3130,9 +3302,9 @@ For example:
(check-tree ?first (car obj))
(check-tree ?rest (cdr obj)))))
((_ ?atom ?obj) #t)))
-
+
(check-tree ((a b) ...) '((1 2) (3 4) (5 6))) => #t
-
+
(check-tree ((a b) ...) '((1 2) (3 4) not-a-2list) => #f
Note that although the ellipsis is matched as a literal token in the
@@ -3150,7 +3322,7 @@ For example:
(define-syntax eight
(syntax-rules ()
(_ 8)))
-
+
(+ 3 eight) => 11
(eight) => ERROR
(set! eight 9) => ERROR
@@ -3158,17 +3330,17 @@ For example:

File: scm.info, Node: Macro Primitives, Next: Environment Frames, Prev: Syntax-Rules, Up: Syntax
-Macro Primitives
-----------------
+4.9.4 Macro Primitives |
+---------------------- |
- - Function: procedure->syntax proc
+ -- Function: procedure->syntax proc |
Returns a "macro" which, when a symbol defined to this value
appears as the first symbol in an expression, returns the result
of applying PROC to the expression and the environment.
- - Function: procedure->macro proc
- - Function: procedure->memoizing-macro proc
- - Function: procedure->identifier-macro
+ -- Function: procedure->macro proc |
+ -- Function: procedure->memoizing-macro proc |
+ -- Function: procedure->identifier-macro |
Returns a "macro" which, when a symbol defined to this value
appears as the first symbol in an expression, evaluates the result
of applying PROC to the expression and the environment. The value
@@ -3179,7 +3351,7 @@ Macro Primitives
(defsyntax trace
(procedure->macro
(lambda (x env) `(set! ,(cadr x) (tracef ,(cadr x) ',(cadr x))))))
-
+
(trace foo) == (set! foo (tracef foo 'foo)).
`PROCEDURE->IDENTIFIER-MACRO' is similar to
@@ -3190,7 +3362,7 @@ Macro Primitives
identifier.
- - Special Form: defsyntax name expr
+ -- 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.
@@ -3198,8 +3370,8 @@ Macro Primitives

File: scm.info, Node: Environment Frames, Next: Syntactic Hooks for Hygienic Macros, Prev: Macro Primitives, Up: Syntax
-Environment Frames
-------------------
+4.9.5 Environment Frames |
+------------------------ |
An "environment" is a list of frames representing lexical bindings.
Only the names and scope of the bindings are included in environments
@@ -3247,7 +3419,8 @@ There are several types of environment frames:
Currently <env-filename-marker> is the integer 1 and
<env-procedure-name-marker> the integer 2.
- - Special Form: @apply procedure argument-list
+
+ -- Special Form: @apply procedure argument-list |
Returns the result of applying PROCEDURE to ARGUMENT-LIST.
`@apply' differs from `apply' when the identifiers bound by the
closure being applied are `set!'; setting affects ARGUMENT-LIST.
@@ -3262,8 +3435,8 @@ There are several types of environment frames:

File: scm.info, Node: Syntactic Hooks for Hygienic Macros, Prev: Environment Frames, Up: Syntax
-Syntactic Hooks for Hygienic Macros
------------------------------------
+4.9.6 Syntactic Hooks for Hygienic Macros |
+----------------------------------------- |
SCM provides a synthetic identifier type for efficient implementation of
hygienic macros (for example, `syntax-rules' *note Macros:
@@ -3271,7 +3444,7 @@ hygienic macros (for example, `syntax-rules' *note Macros:
a macro expander in any context where a symbol would normally be used.
Collectively, symbols and synthetic identifiers are _identifiers_.
- - Function: identifier? obj
+ -- Function: identifier? obj |
Returns `#t' if OBJ is a symbol or a synthetic identifier, and
`#f' otherwise.
@@ -3284,7 +3457,7 @@ environment which has been passed to a "macro expander" (a procedure
passed as an argument to `procedure->macro',
`procedure->memoizing-macro', or `procedure->syntax').
- - Function: renamed-identifier parent env
+ -- Function: renamed-identifier parent env |
Returns a synthetic identifier. PARENT must be an identifier, and
ENV must either be `#f' or a lexical environment passed to a macro
expander. `renamed-identifier' returns a distinct object for each
@@ -3295,12 +3468,12 @@ identifier, those data are used during variable lookup. If a synthetic
identifier is inserted as quoted data then during macro expansion it
will be repeatedly replaced by its parent, until a symbol is obtained.
- - Function: identifier->symbol id
+ -- Function: identifier->symbol id |
Returns the symbol obtained by recursively extracting the parent of
ID, which must be an identifier.
-Use of Synthetic Identifiers
-----------------------------
+4.9.7 Use of Synthetic Identifiers |
+---------------------------------- |
`renamed-identifier' may be used as a replacement for `gentemp':
(define gentemp
@@ -3347,7 +3520,7 @@ determine whether two identifiers have the same denotation. With
synthetic identifiers it is not necessary that two identifiers be `eq?'
in order to denote the same binding.
- - Function: identifier-equal? id1 id2 env
+ -- Function: identifier-equal? id1 id2 env |
Returns `#t' if identifiers ID1 and ID2 denote the same binding in
lexical environment ENV, and `#f' otherwise. ENV must either be a
lexical environment passed to a macro transformer during macro
@@ -3359,19 +3532,19 @@ in order to denote the same binding.
(let ((foo-name (renamed-identifier 'foo #f)))
(lambda (exp env)
(identifier-equal? (cadr exp) foo-name env)))))
-
+
(top-level-foo? foo) => #t
-
+
(let ((foo 'local))
(top-level-foo? foo)) => #f
- - Function: @macroexpand1 expr env
+ -- Function: @macroexpand1 expr env |
If the `car' of EXPR denotes a macro in ENV, then if that macro is
a primitive, EXPR will be returned, if the macro was defined in
Scheme, then a macro expansion will be returned. If the `car' of
EXPR does not denote a macro, the `#f' is returned.
- - Function: extended-environment names values env
+ -- Function: extended-environment names values env |
Returns a new environment object, equivalent to ENV, which must
either be an environment object or null, extended by one frame.
NAMES must be an identifier, or an improper list of identifiers,
@@ -3381,13 +3554,13 @@ in order to denote the same binding.
list then VALS may be, respectively, any object or an improper
list of objects.
- - Special Form: syntax-quote obj
+ -- Special Form: syntax-quote obj |
Synthetic identifiers are converted to their parent symbols by
`quote' and `quasiquote' so that literal data in macro definitions
will be properly transcribed. `syntax-quote' behaves like
`quote', but preserves synthetic identifier intact.
- - Special Form: the-macro mac
+ -- Special Form: the-macro mac |
`the-macro' is the simplest of all possible macro transformers:
MAC may be a syntactic keyword (macro name) or an expression
evaluating to a macro, otherwise an error is signaled. MAC is
@@ -3400,7 +3573,7 @@ in order to denote the same binding.
;; code that will continue to work even if LET is redefined.
...)
- - Special Form: renaming-transformer proc
+ -- Special Form: renaming-transformer proc |
A low-level "explicit renaming" macro facility very similar to that
proposed by W. Clinger [Exrename] is supported. Syntax may be
defined in `define-syntax', `let-syntax', and `letrec-syntax'
@@ -3416,8 +3589,8 @@ in order to denote the same binding.

File: scm.info, Node: Packages, Next: The Implementation, Prev: The Language, Up: Top
-Packages
-********
+5 Packages |
+********** |
* Menu:
@@ -3429,44 +3602,46 @@ Packages
* I/O-Extensions:: i/o-extensions
* Posix Extensions:: posix
* Unix Extensions:: non-posix unix
+* Sequence Comparison:: |
* Regular Expression Pattern Matching:: regex
* Line Editing:: edit-line
* Curses:: Screen Control
* Sockets:: Cruise the Net
+* SCMDB:: interface to MySQL |
* 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
-===============
+5.1 Dynamic Linking |
+=================== |
If SCM has been compiled with `dynl.c' then the additional properties
of load and ([SLIB]) require specified here are supported. The
`require' form is preferred.
- - Function: require feature
+ -- Function: require feature |
If the symbol FEATURE has not already been given as an argument to
`require', then the object and library files associated with
FEATURE will be dynamically-linked, and an unspecified value
returned. If FEATURE is not found in `*catalog*', then an error
is signaled.
- - Function: usr:lib lib
+ -- Function: usr:lib lib |
Returns the pathname of the C library named LIB. For example:
`(usr:lib "m")' returns `"/usr/lib/libm.a"', the path of the C
math library.
- - Function: x:lib lib
+ -- Function: x:lib lib |
Returns the pathname of the X library named LIB. For example:
`(x:lib "X11")' returns `"/usr/X11/lib/libX11.sa"', the path of
the X11 library.
- - Function: load filename lib1 ...
+ -- Function: load filename lib1 ... |
In addition to the [R5RS] requirement of loading Scheme
expressions if FILENAME is a Scheme source file, `load' will also
dynamically load/link object files (produced by `compile-file', for
@@ -3477,6 +3652,7 @@ of load and ([SLIB]) require specified here are supported. The
or (load (in-vicinity (implementation-vicinity) "sc2.o"))
or (require 'rev2-procedures)
or (require 'rev3-procedures)
+
will load/link `sc2.o' if it exists.
@@ -3487,12 +3663,14 @@ of load and ([SLIB]) require specified here are supported. The
(load (in-vicinity (implementation-vicinity) "crs.o")
(usr:lib "ncurses") (usr:lib "c"))
or (require 'curses)
+
Turtlegr graphics library is linked by:
(load (in-vicinity (implementation-vicinity) "turtlegr")
(usr:lib "X11") (usr:lib "c") (usr:lib "m"))
or (require 'turtle-graphics)
+
And the string regular expression (*note Regular Expression
Pattern Matching::) package is linked by:
@@ -3500,12 +3678,13 @@ of load and ([SLIB]) require specified here are supported. The
(load (in-vicinity (implementation-vicinity) "rgx") (usr:lib "c"))
or
(require 'regex)
+
The following functions comprise the low-level Scheme interface to
dynamic linking. See the file `Link.scm' in the SCM distribution for
an example of their use.
- - Function: dyn:link filename
+ -- Function: dyn:link filename |
FILENAME should be a string naming an "object" or "archive" file,
the result of C-compiling. The `dyn:link' procedure links and
loads FILENAME into the current SCM session. If successfull,
@@ -3513,7 +3692,7 @@ an example of their use.
second argument to `dyn:call'. If not successful, `#f' is
returned.
- - Function: dyn:call name link-token
+ -- Function: dyn:call name link-token |
LINK-TOKEN should be the value returned by a call to `dyn:link'.
NAME should be the name of C function of no arguments defined in
the file named FILENAME which was succesfully `dyn:link'ed in the
@@ -3525,7 +3704,7 @@ an example of their use.
SCM object files. The init_... function then makes the
identifiers defined in the file accessible as Scheme procedures.
- - Function: dyn:main-call name link-token arg1 ...
+ -- Function: dyn:main-call name link-token arg1 ... |
LINK-TOKEN should be the value returned by a call to `dyn:link'.
NAME should be the name of C function of 2 arguments, `(int argc,
char **argv)', defined in the file named FILENAME which was
@@ -3540,7 +3719,7 @@ an example of their use.
low level routines of which callback (*note Callbacks::) into SCM
(which emulates PCI hardware).
- - Function: dyn:unlink link-token
+ -- Function: dyn:unlink link-token |
LINK-TOKEN should be the value returned by a call to `dyn:link'.
The `dyn:unlink' procedure removes the previously loaded file from
the current SCM session. If successful, `dyn:unlink' returns
@@ -3549,8 +3728,8 @@ an example of their use.

File: scm.info, Node: Dump, Next: Numeric, Prev: Dynamic Linking, Up: Packages
-Dump
-====
+5.2 Dump |
+======== |
"Dump", (also known as "unexec"), saves the continuation of an entire
SCM session to an executable file, which can then be invoked as a
@@ -3578,10 +3757,10 @@ There are constraints on which sessions are savable using `dump'
* `Dump' can be called from the command line.
- - Function: dump newpath
- - Function: dump newpath #f
- - Function: dump newpath #t
- - Function: dump newpath thunk
+ -- Function: dump newpath |
+ -- Function: dump newpath #f |
+ -- Function: dump newpath #t |
+ -- Function: dump newpath thunk |
* Calls `gc'.
* Creates an executable program named NEWPATH which continues
@@ -3647,66 +3826,66 @@ This task can also be accomplished using the `-o' command line option

File: scm.info, Node: Numeric, Next: Arrays, Prev: Dump, Up: Packages
-Numeric
-=======
+5.3 Numeric |
+=========== |
- - Constant: most-positive-fixnum
+ -- Constant: most-positive-fixnum |
The immediate integer closest to positive infinity. *Note
Configuration: (slib)Configuration.
- - Constant: most-negative-fixnum
+ -- Constant: most-negative-fixnum |
The immediate integer closest to negative infinity.
- - Constant: $pi
- - Constant: pi
+ -- Constant: $pi |
+ -- Constant: pi |
The ratio of the circumference to the diameter of a circle.
These procedures augment the standard capabilities in *Note Numerical
operations: (r5rs)Numerical operations.
- - Function: pi* z
+ -- Function: pi* z |
`(* pi Z)'
- - Function: pi/ z
+ -- Function: pi/ z |
`(/ pi Z)'
- - Function: sinh z
- - Function: cosh z
- - Function: tanh z
+ -- Function: sinh z |
+ -- Function: cosh z |
+ -- Function: tanh z |
Return the hyperbolic sine, cosine, and tangent of Z
- - Function: asinh z
- - Function: acosh z
- - Function: atanh z
+ -- Function: asinh z |
+ -- Function: acosh z |
+ -- Function: atanh z |
Return the inverse hyperbolic sine, cosine, and tangent of Z
- - Function: $sqrt x
- - Function: $abs x
- - Function: $exp x
- - Function: $log x
- - Function: $sin x
- - Function: $cos x
- - Function: $tan x
- - Function: $asin x
- - Function: $acos x
- - Function: $atan x
- - Function: $sinh x
- - Function: $cosh x
- - Function: $tanh x
- - Function: $asinh x
- - Function: $acosh x
- - Function: $atanh x
+ -- Function: $sqrt x |
+ -- Function: $abs x |
+ -- Function: $exp x |
+ -- Function: $log x |
+ -- Function: $sin x |
+ -- Function: $cos x |
+ -- Function: $tan x |
+ -- Function: $asin x |
+ -- Function: $acos x |
+ -- Function: $atan x |
+ -- Function: $sinh x |
+ -- Function: $cosh x |
+ -- Function: $tanh x |
+ -- Function: $asinh x |
+ -- Function: $acosh x |
+ -- Function: $atanh x |
Real-only versions of these popular functions. The argument X
must be a real number. It is an error if the value which should be
returned by a call to these procedures is _not_ real.
- - Function: $log10 x
+ -- Function: $log10 x |
Real-only base 10 logarithm.
- - Function: $atan2 y x
+ -- Function: $atan2 y x |
Computes `(angle (make-rectangular x y))' for real numbers Y and X.
- - Function: $expt x1 x2
+ -- Function: $expt x1 x2 |
Returns real number X1 raised to the real power X2. It is an
error if the value which should be returned by a call to `$expt'
is not real.
@@ -3714,8 +3893,8 @@ operations: (r5rs)Numerical operations.

File: scm.info, Node: Arrays, Next: Records, Prev: Numeric, Up: Packages
-Arrays
-======
+5.4 Arrays |
+========== |
* Menu:
@@ -3727,8 +3906,8 @@ Arrays

File: scm.info, Node: Conventional Arrays, Next: Uniform Array, Prev: Arrays, Up: Arrays
-Conventional Arrays
--------------------
+5.4.1 Conventional Arrays |
+------------------------- |
The following syntax and procedures are SCM extensions to feature
`array' in *Note Arrays: (slib)Arrays.
@@ -3737,17 +3916,14 @@ The following syntax and procedures are SCM extensions to feature
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.
- (create-array '#(ho) 4 3) => |
+ (make-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 are
equivalent to (and can't be distinguished from) scheme vectors.
- (create-array '#(ho) 3) => #(ho ho ho)
+ (make-array '#(ho) 3) => #(ho ho ho) |
- - Function: transpose-array array dim0 dim1 ...
+ -- Function: transpose-array array dim0 dim1 ... |
Returns an array sharing contents with ARRAY, but with dimensions
arranged in a different order. There must be one DIM argument for
each dimension of ARRAY. DIM0, DIM1, ... should be integers
@@ -3765,7 +3941,7 @@ equivalent to (and can't be distinguished from) scheme vectors.
(transpose-array '#3A(((a b c) (d e f)) ((1 2 3) (4 5 6))) 1 1 0) =>
#2A((a 4) (b 5) (c 6))
- - Function: enclose-array array dim0 dim1 ...
+ -- Function: enclose-array array dim0 dim1 ... |
DIM0, DIM1 ... should be nonnegative integers less than the rank
of ARRAY. ENCLOSE-ARRAY returns an array resembling an array of
shared arrays. The dimensions of each shared array are the same
@@ -3782,21 +3958,21 @@ equivalent to (and can't be distinguished from) scheme vectors.
examples:
(enclose-array '#3A(((a b c) (d e f)) ((1 2 3) (4 5 6))) 1) =>
#<enclosed-array (#1A(a d) #1A(b e) #1A(c f)) (#1A(1 4) #1A(2 5) #1A(3 6))>
-
+
(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->list array
+ -- 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-contents array
- - Function: array-contents array strict
+ -- 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 CREATE-ARRAY may be unrolled,
- some arrays made by MAKE-SHARED-ARRAY may not be.
+ returns `#f'. All arrays made by MAKE-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
@@ -3805,8 +3981,8 @@ equivalent to (and can't be distinguished from) scheme vectors.

File: scm.info, Node: Uniform Array, Next: Bit Vectors, Prev: Conventional Arrays, Up: Arrays
-Uniform Array
--------------
+5.4.2 Uniform Array |
+------------------- |
"Uniform Arrays" and vectors are arrays whose elements are all of the
same type. Uniform vectors occupy less storage than conventional
@@ -3814,18 +3990,16 @@ 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.
+is `make-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"
+ (make-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
- ==
- #At(#f #f #f) => #*000
+ (make-array '#1at() 3) => #*000 |
==
#1At(#f #f #f) => #*000
@@ -3833,31 +4007,31 @@ PROTOTYPE arguments in the following procedures are interpreted
according to the table:
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
+
+ () conventional vector #A |
+ +64i complex (double precision) #A:floC64b |
+ 64.0 double (double precision) #A:floR64b |
+ 32.0 float (single precision) #A:floR32b |
+ 32 unsigned integer (32-bit) #A:fixN32b |
+ -32 signed integer (32-bit) #A:fixZ32b |
+ -16 signed integer (16-bit) #A:fixZ16b |
+ #\a char (string) #A:char |
+ #t boolean (bit-vector) #A:bool |
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)'
+#\A character and the contents list. For example, `'#1A:fixZ32b(3 5 9)' |
returns a uniform vector of signed integers.
- - Function: array? obj prototype
+ -- 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
+ -- 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'.
- - 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.
@@ -3870,8 +4044,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-array-read! ura
- - Function: uniform-array-read! ura port
+ -- Function: uniform-array-read! ura |
+ -- 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
@@ -3882,14 +4056,14 @@ returns a uniform vector of signed integers.
may be omitted, in which case it defaults to the value returned by
`(current-input-port)'.
- - Function: uniform-array-write ura
- - Function: uniform-array-write ura port
+ -- Function: uniform-array-write ura |
+ -- 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
`(current-output-port)'.
- - Function: logaref array index1 index2 ...
+ -- Function: logaref array index1 index2 ... |
If an INDEX is provided for each dimension of ARRAY returns the
INDEX1, INDEX2, ...'th element of ARRAY. If one more INDEX is
provided, then the last index specifies bit position of the
@@ -3901,7 +4075,7 @@ returns a uniform vector of signed integers.
(logaref '#(#b1101 #b0010) 0 1) => #f
(logaref '#2((#b1101 #b0010)) 0 0) => #b1101
- - Function: logaset! array val index1 index2 ...
+ -- Function: logaset! array val index1 index2 ... |
If an INDEX is provided for each dimension of ARRAY sets the
INDEX1, INDEX2, ...'th element of ARRAY to VAL. If one more INDEX
is provided, then the last index specifies bit position of the
@@ -3913,29 +4087,29 @@ returns a uniform vector of signed integers.

File: scm.info, Node: Bit Vectors, Next: Array Mapping, Prev: Uniform Array, Up: Arrays
-Bit Vectors
------------
+5.4.3 Bit Vectors |
+----------------- |
Bit vectors can be written and read as a sequence of `0's and `1's
prefixed by `#*'.
- #At(#f #f #f #t #f #t #f) => #*0001010
+ #1At(#f #f #f #t #f #t #f) => #*0001010 |
Some of these operations will eventually be generalized to other
uniform-arrays.
- - Function: bit-count bool bv
- Returns the number occurrences of BOOL in BV.
+ -- Function: bit-count bool bv |
+ Returns the number of occurrences of BOOL in BV. |
- - Function: bit-position bool bv k
+ -- Function: bit-position bool bv k |
Returns the minimum index of an occurrence of BOOL in BV which is
at least K. If no BOOL occurs within the specified range `#f' is
returned.
- - Function: bit-invert! bv
+ -- Function: bit-invert! bv |
Modifies BV by replacing each element with its negation.
- - Function: bit-set*! bv uve bool
+ -- Function: bit-set*! bv uve bool |
If uve is a bit-vector BV and uve must be of the same length. If
BOOL is `#t', uve is OR'ed into BV; If BOOL is `#f', the inversion
of uve is AND'ed into BV.
@@ -3946,7 +4120,7 @@ uniform-arrays.
The return value is unspecified.
- - Function: bit-count* bv uve bool
+ -- Function: bit-count* bv uve bool |
Returns
(bit-count (bit-set*! (if bool bv (bit-invert! bv)) uve #t) #t).
BV is not modified.
@@ -3954,28 +4128,28 @@ uniform-arrays.

File: scm.info, Node: Array Mapping, Prev: Bit Vectors, Up: Arrays
-Array Mapping
--------------
+5.4.4 Array Mapping |
+------------------- |
-`(require 'array-for-each)'
+`(require 'array-for-each)'
SCM has some extra functions in feature `array-for-each':
- - Function: array-fill! array fill
+ -- 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: serial-array:copy! destination source |
+ Same as `array:copy!' but guaranteed to copy in row-major order. |
- - Function: array-equal? array0 array1 ...
+ -- 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 ...
+ -- 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
@@ -3987,13 +4161,13 @@ SCM has some extra functions in feature `array-for-each':
unspecified.
Handling non-array arguments is a SCM extension of *Note
- array-map!: (slib)Array Mapping
+ array-map!: (slib)Array Mapping. |
- - Function: serial-array-map! array0 proc array1 ...
+ -- 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 ... |
+ -- 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 |
@@ -4001,8 +4175,8 @@ SCM has some extra functions in feature `array-for-each':
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
+ -- 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
@@ -4014,13 +4188,13 @@ SCM has some extra functions in feature `array-for-each':

File: scm.info, Node: Records, Next: I/O-Extensions, Prev: Arrays, Up: Packages
-Records
-=======
+5.5 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
+ -- 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:
@@ -4036,13 +4210,13 @@ see *Note Records: (slib)Records, with the following extension.

File: scm.info, Node: I/O-Extensions, Next: Posix Extensions, Prev: Records, Up: Packages
-I/O-Extensions
-==============
+5.6 I/O-Extensions |
+================== |
If `'i/o-extensions' is provided (by linking in `ioext.o'), *Note Line
I/O: (slib)Line I/O, and the following functions are defined:
- - Function: stat <port-or-string>
+ -- Function: stat <port-or-string> |
Returns a vector of integers describing the argument. The argument
can be either a string or an open input port. If the argument is
an open port then the returned vector describes the file to which
@@ -4085,70 +4259,70 @@ I/O: (slib)Line I/O, and the following functions are defined:
10 st_ctime
Last file status change time
- - Function: getpid
+ -- Function: getpid |
Returns the process ID of the current process.
- - Function: file-position port
+ -- Function: file-position port |
Returns the current position of the character in PORT which will
next be read or written. If PORT is not open to a file the result
is unspecified.
- - Function: file-set-position port integer
+ -- Function: file-set-position port integer |
Sets the current position in PORT which will next be read or
written. If PORT is not open to a file the action of
`file-set-position' is unspecified. The result of
`file-set-position' is unspecified.
- - Function: try-create-file name modes perms
+ -- 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).
- - Function: reopen-file filename modes port
+ -- 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.
- - Function: duplicate-port port modes
+ -- Function: duplicate-port port modes |
Creates and returns a "duplicate" port from PORT. Duplicate
_unbuffered_ ports share one file position. MODES are as for
*Note open-file: Files and Ports.
- - Function: redirect-port! from-port to-port
+ -- Function: redirect-port! from-port to-port |
Closes TO-PORT and makes TO-PORT be a duplicate of FROM-PORT.
`redirect-port!' returns TO-PORT if successful, `#f' if not. If
unsuccessful, TO-PORT is not closed.
- - Function: opendir dirname
+ -- Function: opendir dirname |
Returns a "directory" object corresponding to the file system
directory named DIRNAME. If unsuccessful, returns `#f'.
- - Function: readdir dir
+ -- Function: readdir dir |
Returns the string name of the next entry from the directory DIR.
If there are no more entries in the directory, `readdir' returns a
`#f'.
- - Function: rewinddir dir
+ -- Function: rewinddir dir |
Reinitializes DIR so that the next call to `readdir' with DIR will
return the first entry in the directory again.
- - Function: closedir dir
+ -- Function: closedir dir |
Closes DIR and returns `#t'. If DIR is already closed,,
`closedir' returns a `#f'.
- - Function: directory-for-each proc directory
+ -- Function: directory-for-each proc directory |
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
+ -- Function: directory-for-each proc directory pred |
Applies PROC only to those filenames for which the procedure PRED
returns a non-false value.
- - Function: directory-for-each proc directory match
+ -- Function: directory-for-each proc directory match |
Applies PROC only to those filenames for which `(filename:match??
MATCH)' would return a non-false value (*note Filenames:
(slib)Filenames.).
@@ -4161,9 +4335,9 @@ I/O: (slib)Line I/O, and the following functions are defined:
"Link.scm"
"Macro.scm"
"Transcen.scm"
- "Init5d9.scm" |
+ "Init5e1.scm" |
- - Function: mkdir path mode
+ -- Function: mkdir path mode |
The `mkdir' function creates a new, empty directory whose name is
PATH. The integer argument MODE specifies the file permissions
for the new directory. *Note The Mode Bits for Access Permission:
@@ -4172,48 +4346,48 @@ I/O: (slib)Line I/O, and the following functions are defined:
`mkdir' returns if successful, `#f' if not.
- - Function: rmdir path
+ -- Function: rmdir path |
The `rmdir' function deletes the directory PATH. The directory
must be empty before it can be removed. `rmdir' returns if
successful, `#f' if not.
- - Function: chdir filename
+ -- Function: chdir filename |
Changes the current directory to FILENAME. If FILENAME does not
exist or is not a directory, `#f' is returned. Otherwise, `#t' is
returned.
- - Function: getcwd
+ -- Function: getcwd |
The function `getcwd' returns a string containing the absolute file
name representing the current working directory. If this string
cannot be obtained, `#f' is returned.
- - Function: rename-file oldfilename newfilename
+ -- Function: rename-file oldfilename newfilename |
Renames the file specified by OLDFILENAME to NEWFILENAME. If the
renaming is successful, `#t' is returned. Otherwise, `#f' is
returned.
- - Function: chmod file mode
+ -- Function: chmod file mode |
The function `chmod' sets the access permission bits for the file
named by FILE to MODE. The FILE argument may be a string
containing the filename or a port open to the file.
`chmod' returns if successful, `#f' if not.
- - Function: utime pathname acctime modtime
+ -- Function: utime pathname acctime modtime |
Sets the file times associated with the file named PATHNAME to
have access time ACCTIME and modification time MODTIME. `utime'
returns if successful, `#f' if not.
- - Function: umask mode
+ -- Function: umask mode |
The function `umask' sets the file creation mask of the current
process to MASK, and returns the previous value of the file
creation mask.
- - Function: fileno port
+ -- Function: fileno port |
Returns the integer file descriptor associated with the port PORT.
If an error is detected, `#f' is returned.
- - Function: access pathname how
+ -- Function: access pathname how |
Returns `#t' if the file named by PATHNAME can be accessed in the
way specified by the HOW argument. The HOW argument can be the
`logior' of the flags:
@@ -4239,8 +4413,8 @@ I/O: (slib)Line I/O, and the following functions are defined:
<r>
File-is-readable?
- - Function: execl command arg0 ...
- - Function: execlp command arg0 ...
+ -- Function: execl command arg0 ... |
+ -- Function: execlp command arg0 ... |
Transfers control to program COMMAND called with arguments ARG0
.... For `execl', COMMAND must be an exact pathname of an
executable file. `execlp' searches for COMMAND in the list of
@@ -4250,12 +4424,12 @@ I/O: (slib)Line I/O, and the following functions are defined:
If successful, this procedure does not return. Otherwise an error
message is printed and the integer `errno' is returned.
- - Function: execv command arglist
- - Function: execvp command arglist
+ -- Function: execv command arglist |
+ -- Function: execvp command arglist |
Like `execl' and `execlp' except that the set of arguments to
COMMAND is ARGLIST.
- - Function: putenv string
+ -- Function: putenv string |
adds or removes definitions from the "environment". If the STRING
is of the form `NAME=VALUE', the definition is added to the
environment. Otherwise, the STRING is interpreted as the name of
@@ -4276,30 +4450,30 @@ 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
-================
+5.7 Posix Extensions |
+==================== |
If `'posix' is provided (by linking in `posix.o'), the following
functions are defined:
- - Function: open-pipe string modes
+ -- Function: open-pipe string modes |
If the string MODES contains an <r>, returns an input port capable
of delivering characters from the standard output of the system
command STRING. Otherwise, returns an output port capable of
receiving characters which become the standard input of the system
command STRING. If a pipe cannot be created `#f' is returned.
- - Function: open-input-pipe string
+ -- Function: open-input-pipe string |
Returns an input port capable of delivering characters from the
standard output of the system command STRING. If a pipe cannot be
created `#f' is returned.
- - Function: open-output-pipe string
+ -- Function: open-output-pipe string |
Returns an output port capable of receiving characters which become
the standard input of the system command STRING. If a pipe cannot
be created `#f' is returned.
- - Function: broken-pipe port
+ -- 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
@@ -4307,16 +4481,16 @@ functions are defined:
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
+ -- 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
been closed. The value returned is unspecified.
- - Function: pipe
+ -- Function: pipe |
Returns `(cons RD WD)' where RD and WD are the read and write
(port) ends of a "pipe" respectively.
- - Function: fork
+ -- Function: fork |
Creates a copy of the process calling `fork'. Both processes
return from `fork', but the calling ("parent") process's `fork'
returns the "child" process's ID whereas the child process's
@@ -4325,39 +4499,39 @@ functions are defined:
For a discussion of "ID"s *Note Process Persona: (GNU C Library)Process
Persona.
- - Function: getppid
+ -- Function: getppid |
Returns the process ID of the parent of the current process. For
a process's own ID *Note getpid: I/O-Extensions.
- - Function: getuid
+ -- Function: getuid |
Returns the real user ID of this process.
- - Function: getgid
+ -- Function: getgid |
Returns the real group ID of this process.
- - Function: getegid
+ -- Function: getegid |
Returns the effective group ID of this process.
- - Function: geteuid
+ -- Function: geteuid |
Returns the effective user ID of this process.
- - Function: setuid id
+ -- Function: setuid id |
Sets the real user ID of this process to ID. Returns `#t' if
successful, `#f' if not.
- - Function: setgid id
+ -- Function: setgid id |
Sets the real group ID of this process to ID. Returns `#t' if
successful, `#f' if not.
- - Function: setegid id
+ -- Function: setegid id |
Sets the effective group ID of this process to ID. Returns `#t'
if successful, `#f' if not.
- - Function: seteuid id
+ -- Function: seteuid id |
Sets the effective user ID of this process to ID. Returns `#t' if
successful, `#f' if not.
- - Function: kill pid sig
+ -- Function: kill pid sig |
The `kill' function sends the signal SIGNUM to the process or
process group specified by PID. Besides the signals listed in
*Note Standard Signals: (libc)Standard Signals, SIGNUM can also
@@ -4396,7 +4570,7 @@ Persona.
There's no way you can tell which of the processes got the signal
or whether all of them did.
- - Function: waitpid pid options
+ -- Function: waitpid pid options |
The `waitpid' function suspends execution of the current process
until a child as specified by the PID argument has exited, or
until a signal is delivered whose action is to terminate the
@@ -4444,7 +4618,7 @@ Persona.
information about the `errno' codes *Note Process Completion: (GNU
C Library)Process Completion.
- - Function: uname
+ -- Function: uname |
You can use the `uname' procedure to find out some information
about the type of computer your program is running on.
@@ -4465,9 +4639,9 @@ Persona.
Some examples are `"i386-ANYTHING"', `"m68k-hp"',
`"sparc-sun"', `"m68k-sun"', `"m68k-sony"' and `"mips-dec"'.
- - Function: getpw name
- - Function: getpw uid
- - Function: getpw
+ -- Function: getpw name |
+ -- Function: getpw uid |
+ -- Function: getpw |
Returns a vector of information for the entry for `NAME', `UID',
or the next entry if no argument is given. The information is:
@@ -4489,16 +4663,16 @@ Persona.
user logs in, or `#f', indicating that the system default
should be used.
- - Function: setpwent #t
+ -- Function: setpwent #t |
Rewinds the pw entry table back to the begining.
- - Function: setpwent #f
- - Function: setpwent
+ -- Function: setpwent #f |
+ -- Function: setpwent |
Closes the pw table.
- - Function: getgr name
- - Function: getgr uid
- - Function: getgr
+ -- Function: getgr name |
+ -- Function: getgr uid |
+ -- Function: getgr |
Returns a vector of information for the entry for `NAME', `UID',
or the next entry if no argument is given. The information is:
@@ -4510,69 +4684,69 @@ Persona.
3. A list of (string) names of users in the group.
- - Function: setgrent #t
+ -- Function: setgrent #t |
Rewinds the group entry table back to the begining.
- - Function: setgrent #f
- - Function: setgrent
+ -- Function: setgrent #f |
+ -- Function: setgrent |
Closes the group table.
- - Function: getgroups
+ -- Function: getgroups |
Returns a vector of all the supplementary group IDs of the process.
- - Function: link oldname newname
+ -- Function: link oldname newname |
The `link' function makes a new link to the existing file named by
OLDNAME, under the new name NEWNAME.
`link' returns a value of `#t' if it is successful and `#f' on
failure.
- - Function: chown filename owner group
+ -- Function: chown filename owner group |
The `chown' function changes the owner of the file FILENAME to
OWNER, and its group owner to GROUP.
`chown' returns a value of `#t' if it is successful and `#f' on
failure.
- - Function: ttyname port
+ -- Function: ttyname port |
If port PORT is associated with a terminal device, returns a
string containing the file name of termainal device; otherwise
`#f'.

-File: scm.info, Node: Unix Extensions, Next: Regular Expression Pattern Matching, Prev: Posix Extensions, Up: Packages
-
-Unix Extensions
-===============
+File: scm.info, Node: Unix Extensions, Next: Sequence Comparison, Prev: Posix Extensions, Up: Packages
+ |
+5.8 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:
- - Function: symlink oldname newname
+ -- Function: symlink oldname newname |
The `symlink' function makes a symbolic link to OLDNAME named
NEWNAME.
`symlink' returns a value of `#t' if it is successful and `#f' on
failure.
- - Function: readlink filename
+ -- Function: readlink filename |
Returns the value of the symbolic link FILENAME or `#f' for
failure.
- - Function: lstat filename
+ -- Function: lstat filename |
The `lstat' function is like `stat', except that it does not
follow symbolic links. If FILENAME is the name of a symbolic
link, `lstat' returns information about the link itself; otherwise,
`lstat' works like `stat'. *Note I/O-Extensions::.
- - Function: nice increment
+ -- Function: nice increment |
Increment the priority of the current process by INCREMENT.
`chown' returns a value of `#t' if it is successful and `#f' on
failure.
- - Function: acct filename
+ -- Function: acct filename |
When called with the name of an exisitng file as argument,
accounting is turned on, records for each terminating process are
appended to FILENAME as it terminates. An argument of `#f' causes
@@ -4581,30 +4755,41 @@ These "privileged" and symbolic link functions are not in Posix:
`acct' returns a value of `#t' if it is successful and `#f' on
failure.
- - Function: mknod filename mode dev
+ -- Function: mknod filename mode dev |
The `mknod' function makes a special file with name FILENAME and
modes MODE for device number DEV.
`mknod' returns a value of `#t' if it is successful and `#f' on
failure.
- - Function: sync
+ -- Function: sync |
`sync' first commits inodes to buffers, and then buffers to disk.
sync() only schedules the writes, so it may return before the
actual writing is done. The value returned is unspecified.

-File: scm.info, Node: Regular Expression Pattern Matching, Next: Line Editing, Prev: Unix Extensions, Up: Packages
-
-Regular Expression Pattern Matching
-===================================
+File: scm.info, Node: Sequence Comparison, Next: Regular Expression Pattern Matching, Prev: Unix Extensions, Up: Packages
+ |
+5.9 Sequence Comparison |
+======================= |
+ |
+`(require 'diff)' |
+ |
+A blazing fast implementation of the sequence-comparison module in |
+SLIB, see *Note Sequence Comparison: (slib)Sequence Comparison. |
+ |
+
+File: scm.info, Node: Regular Expression Pattern Matching, Next: Line Editing, Prev: Sequence Comparison, Up: Packages
+ |
+5.10 Regular Expression Pattern Matching |
+======================================== |
These functions are defined in `rgx.c' using a POSIX or GNU "regex"
library. If your computer does not support regex, a package is
available via ftp from `ftp.gnu.org:/pub/gnu/regex-0.12.tar.gz'. For a
description of regular expressions, *Note syntax: (regex)syntax.
- - Function: regcomp PATTERN [FLAGS]
+ -- Function: regcomp PATTERN [FLAGS] |
Compile a "regular expression". Return a compiled regular
expression, or an integer error code suitable as an argument to
`regerror'.
@@ -4618,17 +4803,19 @@ description of regular expressions, *Note syntax: (regex)syntax.
`i'
ignore case.only when compiled with _GNU_SOURCE:
+
+
`0'
allows dot to match a null character.
`f'
enable GNU fastmaps.
- - Function: regerror ERRNO
+ -- Function: regerror ERRNO |
Returns a string describing the integer ERRNO returned when
`regcomp' fails.
- - Function: regexec RE STRING
+ -- Function: regexec RE STRING |
Returns `#f' or a vector of integers. These integers are in
doublets. The first of each doublet is the index of STRING of the
start of the matching expression or sub-expression (delimited by
@@ -4636,15 +4823,15 @@ description of regular expressions, *Note syntax: (regex)syntax.
STRING of the end of that expression. `#f' is returned if the
string does not match.
- - Function: regmatch? RE STRING
+ -- Function: regmatch? RE STRING |
Returns `#t' if the PATTERN such that REGEXP = (regcomp PATTERN)
matches STRING as a POSIX extended regular expressions. Returns
`#f' otherwise.
- - Function: regsearch RE STRING [START [LEN]]
- - Function: regsearchv RE STRING [START [LEN]]
- - Function: regmatch RE STRING [START [LEN]]
- - Function: regmatchv RE STRING [START [LEN]]
+ -- Function: regsearch RE STRING [START [LEN]] |
+ -- Function: regsearchv RE STRING [START [LEN]] |
+ -- Function: regmatch RE STRING [START [LEN]] |
+ -- Function: regmatchv RE STRING [START [LEN]] |
`Regsearch' searches for the pattern within the string.
`Regmatch' anchors the pattern and begins matching it against
@@ -4674,7 +4861,9 @@ description of regular expressions, *Note syntax: (regex)syntax.
The character position at which to begin the search or match.
If absent, the default is zero.
- _Compiled _GNU_SOURCE and using GNU libregex only:_
+ _Compiled _GNU_SOURCE and using GNU libregex only_ |
+
+
When searching, if START is negative, the absolute value of
START will be used as the start location and reverse searching
will be performed.
@@ -4684,15 +4873,15 @@ description of regular expressions, *Note syntax: (regex)syntax.
characters of STRING. If absent, the entire string may be
examined.
- - Function: string-split RE STRING
- - Function: string-splitv RE STRING
+ -- Function: string-split RE STRING |
+ -- Function: string-splitv RE STRING |
`String-split' splits a string into substrings that are separated
by RE, returning a vector of substrings.
`String-splitv' returns a vector of string positions that indicate
where the substrings are located.
- - Function: string-edit RE EDIT-SPEC STRING [COUNT]
+ -- Function: string-edit RE EDIT-SPEC STRING [COUNT] |
Returns the edited string.
EDIT-SPEC
@@ -4708,8 +4897,8 @@ description of regular expressions, *Note syntax: (regex)syntax.

File: scm.info, Node: Line Editing, Next: Curses, Prev: Regular Expression Pattern Matching, Up: Packages
-Line Editing
-============
+5.11 Line Editing |
+================= |
These procedures provide input line editing and recall.
@@ -4725,22 +4914,22 @@ When `Iedline.scm' is loaded, if the current input port is the default
input port and the environment variable EMACS is not defined,
line-editing mode will be entered.
- - Function: default-input-port
+ -- Function: default-input-port |
Returns the initial `current-input-port' SCM was invoked with
(stdin).
- - Function: default-output-port
+ -- Function: default-output-port |
Returns the initial `current-output-port' SCM was invoked with
(stdout).
- - Function: make-edited-line-port
+ -- Function: make-edited-line-port |
Returns an input/output port that allows command line editing and
retrieval of history.
- - Function: line-editing
+ -- Function: line-editing |
Returns the current edited line port or `#f'.
- - Function: line-editing bool
+ -- Function: line-editing bool |
If BOOL is false, exits line-editing mode and returns the previous
value of `(line-editing)'. If BOOL is true, sets the current
input and output ports to an edited line port and returns the
@@ -4749,18 +4938,18 @@ line-editing mode will be entered.

File: scm.info, Node: Curses, Next: Sockets, Prev: Line Editing, Up: Packages
-Curses
-======
+5.12 Curses |
+=========== |
These functions are defined in `crs.c' using the "curses" library.
Unless otherwise noted these routines return `#t' for successful
completion and `#f' for failure.
- - Function: initscr
+ -- Function: initscr |
Returns a port for a full screen window. This routine must be
called to initialize curses.
- - Function: endwin
+ -- Function: endwin |
A program should call `endwin' before exiting or escaping from
curses mode temporarily, to do a system call, for example. This
routine will restore termio modes, move the cursor to the lower
@@ -4780,21 +4969,21 @@ completion and `#f' for failure.

File: scm.info, Node: Output Options Setting, Next: Terminal Mode Setting, Prev: Curses, Up: Curses
-Output Options Setting
-----------------------
+5.12.1 Output Options Setting |
+----------------------------- |
These routines set options within curses that deal with output. All
options are initially `#f', unless otherwise stated. It is not
necessary to turn these options off before calling `endwin'.
- - Function: clearok win bf
+ -- Function: clearok win bf |
If enabled (BF is `#t'), the next call to `force-output' or
`refresh' with WIN will clear the screen completely and redraw the
entire screen from scratch. This is useful when the contents of
the screen are uncertain, or in some cases for a more pleasing
visual effect.
- - Function: idlok win bf
+ -- Function: idlok win bf |
If enabled (BF is `#t'), curses will consider using the hardware
"insert/delete-line" feature of terminals so equipped. If
disabled (BF is `#f'), curses will very seldom use this feature.
@@ -4808,7 +4997,7 @@ necessary to turn these options off before calling `endwin'.
"insert/delete-line" cannot be used, curses will redraw the
changed portions of all lines.
- - Function: leaveok win bf
+ -- Function: leaveok win bf |
Normally, the hardware cursor is left at the location of the window
cursor being refreshed. This option allows the cursor to be left
wherever the update happens to leave it. It is useful for
@@ -4816,7 +5005,7 @@ necessary to turn these options off before calling `endwin'.
need for cursor motions. If possible, the cursor is made
invisible when this option is enabled.
- - Function: scrollok win bf
+ -- Function: scrollok win bf |
This option controls what happens when the cursor of window WIN is
moved off the edge of the window or scrolling region, either from a
newline on the bottom line, or typing the last character of the
@@ -4826,10 +5015,10 @@ necessary to turn these options off before calling `endwin'.
window WIN, and then the physical terminal and window WIN are
scrolled up one line.
- _Note:_ in order to get the physical scrolling effect on the
+ _Note_ in order to get the physical scrolling effect on the |
terminal, it is also necessary to call `idlok'.
- - Function: nodelay win bf
+ -- Function: nodelay win bf |
This option causes wgetch to be a non-blocking call. If no input
is ready, wgetch will return an eof-object. If disabled, wgetch
will hang until a key is pressed.
@@ -4837,16 +5026,16 @@ necessary to turn these options off before calling `endwin'.

File: scm.info, Node: Terminal Mode Setting, Next: Window Manipulation, Prev: Output Options Setting, Up: Curses
-Terminal Mode Setting
----------------------
+5.12.2 Terminal Mode Setting |
+---------------------------- |
These routines set options within curses that deal with input. The
options involve using ioctl(2) and therefore interact with curses
routines. It is not necessary to turn these options off before calling
`endwin'. The routines in this section all return an unspecified value.
- - Function: cbreak
- - Function: nocbreak
+ -- Function: cbreak |
+ -- Function: nocbreak |
These two routines put the terminal into and out of `CBREAK' mode,
respectively. In `CBREAK' mode, characters typed by the user are
immediately available to the program and erase/kill character
@@ -4858,11 +5047,11 @@ routines. It is not necessary to turn these options off before calling
`cbreak' or `nocbreak' explicitly. Most interactive programs
using curses will set `CBREAK' mode.
- _Note:_ `cbreak' overrides `raw'. For a discussion of how these
+ _Note_ `cbreak' overrides `raw'. For a discussion of how these |
routines interact with `echo' and `noecho' *Note read-char: Input.
- - Function: raw
- - Function: noraw
+ -- Function: raw |
+ -- Function: noraw |
The terminal is placed into or out of `RAW' mode. `RAW' mode is
similar to `CBREAK' mode, in that characters typed are immediately
passed through to the user program. The differences are that in
@@ -4872,8 +5061,8 @@ routines. It is not necessary to turn these options off before calling
behavior of the `BREAK' key depends on other bits in the terminal
driver that are not set by curses.
- - Function: echo
- - Function: noecho
+ -- Function: echo |
+ -- Function: noecho |
These routines control whether characters typed by the user are
echoed by `read-char' as they are typed. Echoing by the tty
driver is always disabled, but initially `read-char' is in `ECHO'
@@ -4883,16 +5072,16 @@ routines. It is not necessary to turn these options off before calling
calling `noecho'. For a discussion of how these routines interact
with `echo' and `noecho' *Note read-char: Input.
- - Function: nl
- - Function: nonl
+ -- Function: nl |
+ -- Function: nonl |
These routines control whether <LFD> is translated into <RET> and
`LFD' on output, and whether <RET> is translated into <LFD> on
input. Initially, the translations do occur. By disabling these
translations using `nonl', curses is able to make better use of
the linefeed capability, resulting in faster cursor motion.
- - Function: resetty
- - Function: savetty
+ -- Function: resetty |
+ -- Function: savetty |
These routines save and restore the state of the terminal modes.
`savetty' saves the current state of the terminal in a buffer and
`resetty' restores the state to what it was at the last call to
@@ -4901,17 +5090,17 @@ routines. It is not necessary to turn these options off before calling

File: scm.info, Node: Window Manipulation, Next: Output, Prev: Terminal Mode Setting, Up: Curses
-Window Manipulation
--------------------
+5.12.3 Window Manipulation |
+-------------------------- |
- - Function: newwin nlines ncols begy begx
+ -- Function: newwin nlines ncols begy begx |
Create and return a new window with the given number of lines (or
rows), NLINES, and columns, NCOLS. The upper left corner of the
window is at line BEGY, column BEGX. If either NLINES or NCOLS is
0, they will be set to the value of `LINES'-BEGY and `COLS'-BEGX.
A new full-screen window is created by calling `newwin(0,0,0,0)'.
- - Function: subwin orig nlines ncols begy begx
+ -- Function: subwin orig nlines ncols begy begx |
Create and return a pointer to a new window with the given number
of lines (or rows), NLINES, and columns, NCOLS. The window is at
position (BEGY, BEGX) on the screen. This position is relative to
@@ -4921,13 +5110,13 @@ Window Manipulation
necessary to call `touchwin' or `touchline' on ORIG before calling
`force-output'.
- - Function: close-port win
+ -- Function: close-port win |
Deletes the window WIN, freeing up all memory associated with it.
In the case of sub-windows, they should be deleted before the main
window WIN.
- - Function: refresh
- - Function: force-output win
+ -- Function: refresh |
+ -- Function: force-output win |
These routines are called to write output to the terminal, as most
other routines merely manipulate data structures. `force-output'
copies the window WIN to the physical terminal screen, taking into
@@ -4938,21 +5127,21 @@ Window Manipulation
`refresh', the number of characters output to the terminal is
returned.
- - Function: mvwin win y x
+ -- Function: mvwin win y x |
Move the window WIN so that the upper left corner will be at
position (Y, X). If the move would cause the window WIN to be off
the screen, it is an error and the window WIN is not moved.
- - Function: overlay srcwin dstwin
- - Function: overwrite srcwin dstwin
+ -- Function: overlay srcwin dstwin |
+ -- Function: overwrite srcwin dstwin |
These routines overlay SRCWIN on top of DSTWIN; that is, all text
in SRCWIN is copied into DSTWIN. SRCWIN and DSTWIN need not be
the same size; only text where the two windows overlap is copied.
The difference is that `overlay' is non-destructive (blanks are
not copied), while `overwrite' is destructive.
- - Function: touchwin win
- - Function: touchline win start count
+ -- Function: touchwin win |
+ -- Function: touchline win start count |
Throw away all optimization information about which parts of the
window WIN have been touched, by pretending that the entire window
WIN has been drawn on. This is sometimes necessary when using
@@ -4962,7 +5151,7 @@ Window Manipulation
pretends that COUNT lines have been changed, beginning with line
START.
- - Function: wmove win y x
+ -- Function: wmove win y x |
The cursor associated with the window WIN is moved to line (row) Y,
column X. This does not move the physical cursor of the terminal
until `refresh' (or `force-output') is called. The position
@@ -4972,15 +5161,15 @@ Window Manipulation

File: scm.info, Node: Output, Next: Input, Prev: Window Manipulation, Up: Curses
-Output
-------
+5.12.4 Output |
+------------- |
These routines are used to "draw" text on windows
- - Function: display ch win
- - Function: display str win
- - Function: wadd win ch
- - Function: wadd win str
+ -- Function: display ch win |
+ -- Function: display str win |
+ -- Function: wadd win ch |
+ -- Function: wadd win str |
The character CH or characters in STR are put into the window WIN
at the current cursor position of the window and the position of
WIN's cursor is advanced. At the right margin, an automatic
@@ -5003,51 +5192,51 @@ These routines are used to "draw" text on windows
can be copied from one place to another using inch and display.
See `standout', below.
- _Note:_ For `wadd' CH can be an integer and will insert the
+ _Note_ For `wadd' CH can be an integer and will insert the |
character of the corresponding value.
- - Function: werase win
+ -- Function: werase win |
This routine copies blanks to every position in the window WIN.
- - Function: wclear win
+ -- Function: wclear win |
This routine is like `werase', but it also calls *Note clearok:
Output Options Setting, arranging that the screen will be cleared
completely on the next call to `refresh' or `force-output' for
window WIN, and repainted from scratch.
- - Function: wclrtobot win
+ -- Function: wclrtobot win |
All lines below the cursor in window WIN are erased. Also, the
current line to the right of the cursor, inclusive, is erased.
- - Function: wclrtoeol win
+ -- Function: wclrtoeol win |
The current line to the right of the cursor, inclusive, is erased.
- - Function: wdelch win
+ -- Function: wdelch win |
The character under the cursor in the window WIN is deleted. All
characters to the right on the same line are moved to the left one
position and the last character on the line is filled with a
blank. The cursor position does not change. This does not imply
use of the hardware "delete-character" feature.
- - Function: wdeleteln win
+ -- Function: wdeleteln win |
The line under the cursor in the window WIN is deleted. All lines
below the current line are moved up one line. The bottom line WIN
is cleared. The cursor position does not change. This does not
imply use of the hardware "deleteline" feature.
- - Function: winsch win ch
+ -- Function: winsch win ch |
The character CH is inserted before the character under the
cursor. All characters to the right are moved one <SPC> to the
right, possibly losing the rightmost character of the line. The
cursor position does not change . This does not imply use of the
hardware "insertcharacter" feature.
- - Function: winsertln win
+ -- Function: winsertln win |
A blank line is inserted above the current line and the bottom
line is lost. This does not imply use of the hardware
"insert-line" feature.
- - Function: scroll win
+ -- Function: scroll win |
The window WIN is scrolled up one line. This involves moving the
lines in WIN's data structure. As an optimization, if WIN is
stdscr and the scrolling region is the entire window, the physical
@@ -5056,10 +5245,10 @@ These routines are used to "draw" text on windows

File: scm.info, Node: Input, Next: Curses Miscellany, Prev: Output, Up: Curses
-Input
------
+5.12.5 Input |
+------------ |
- - Function: read-char win
+ -- Function: read-char win |
A character is read from the terminal associated with the window
WIN. Depending on the setting of `cbreak', this will be after one
character (`CBREAK' mode), or after the first newline (`NOCBREAK'
@@ -5071,23 +5260,23 @@ Input
on the state of the terminal driver when each character is typed,
the program may produce undesirable results.
- - Function: winch win
+ -- Function: winch win |
The character, of type chtype, at the current position in window
WIN is returned. If any attributes are set for that position,
their values will be OR'ed into the value returned.
- - Function: getyx win
+ -- Function: getyx win |
A list of the y and x coordinates of the cursor position of the
window WIN is returned

File: scm.info, Node: Curses Miscellany, Prev: Input, Up: Curses
-Curses Miscellany
------------------
+5.12.6 Curses Miscellany |
+------------------------ |
- - Function: wstandout win
- - Function: wstandend win
+ -- Function: wstandout win |
+ -- Function: wstandend win |
These functions set the current attributes of the window WIN. The
current attributes of WIN are applied to all characters that are
written into it. Attributes are a property of the character, and
@@ -5100,26 +5289,26 @@ Curses Miscellany
visibly different from other text. `wstandend' turns off the
attributes.
- - Function: box win vertch horch
+ -- Function: box win vertch horch |
A box is drawn around the edge of the window WIN. VERTCH and
HORCH are the characters the box is to be drawn with. If VERTCH
and HORCH are 0, then appropriate default characters, `ACS_VLINE'
and `ACS_HLINE', will be used.
- _Note:_ VERTCH and HORCH can be an integers and will insert the
+ _Note_ VERTCH and HORCH can be an integers and will insert the |
character (with attributes) of the corresponding values.
- - Function: unctrl c
+ -- Function: unctrl c |
This macro expands to a character string which is a printable
representation of the character C. Control characters are
displayed in the `C-x' notation. Printing characters are displayed
as is.

-File: scm.info, Node: Sockets, Prev: Curses, Up: Packages
-
-Sockets
-=======
+File: scm.info, Node: Sockets, Next: SCMDB, Prev: Curses, Up: Packages
+ |
+5.13 Sockets |
+============ |
These procedures (defined in `socket.c') provide a Scheme interface to
most of the C "socket" library. For more information on sockets, *Note
@@ -5134,15 +5323,15 @@ Sockets: (libc)Sockets.

File: scm.info, Node: Host and Other Inquiries, Next: Internet Addresses and Socket Names, Prev: Sockets, Up: Sockets
-Host and Other Inquiries
-------------------------
+5.13.1 Host and Other Inquiries |
+------------------------------- |
- - Constant: af_inet
- - Constant: af_unix
+ -- Constant: af_inet |
+ -- Constant: af_unix |
Integer family codes for Internet and Unix sockets, respectively.
- - Function: gethost host-spec
- - Function: gethost
+ -- Function: gethost host-spec |
+ -- Function: gethost |
Returns a vector of information for the entry for `HOST-SPEC' or
the next entry if `HOST-SPEC' isn't given. The information is:
@@ -5156,16 +5345,16 @@ Host and Other Inquiries
4. list of integer addresses
- - Function: sethostent stay-open
- - Function: sethostent
+ -- Function: sethostent stay-open |
+ -- Function: sethostent |
Rewinds the host entry table back to the begining if given an
argument. If the argument STAY-OPEN is `#f' queries will be be
done using `UDP' datagrams. Otherwise, a connected `TCP' socket
will be used. When called without an argument, the host table is
closed.
- - Function: getnet name-or-number
- - Function: getnet
+ -- Function: getnet name-or-number |
+ -- Function: getnet |
Returns a vector of information for the entry for NAME-OR-NUMBER or
the next entry if an argument isn't given. The information is:
@@ -5177,15 +5366,15 @@ Host and Other Inquiries
3. integer network number
- - Function: setnetent stay-open
- - Function: setnetent
+ -- Function: setnetent stay-open |
+ -- Function: setnetent |
Rewinds the network entry table back to the begining if given an
argument. If the argument STAY-OPEN is `#f' the table will be
closed between calls to getnet. Otherwise, the table stays open.
When called without an argument, the network table is closed.
- - Function: getproto name-or-number
- - Function: getproto
+ -- Function: getproto name-or-number |
+ -- Function: getproto |
Returns a vector of information for the entry for NAME-OR-NUMBER or
the next entry if an argument isn't given. The information is:
@@ -5195,16 +5384,16 @@ Host and Other Inquiries
3. integer protocol number
- - Function: setprotoent stay-open
- - Function: setprotoent
+ -- Function: setprotoent stay-open |
+ -- Function: setprotoent |
Rewinds the protocol entry table back to the begining if given an
argument. If the argument STAY-OPEN is `#f' the table will be
closed between calls to getproto. Otherwise, the table stays
open. When called without an argument, the protocol table is
closed.
- - Function: getserv name-or-port-number protocol
- - Function: getserv
+ -- Function: getserv name-or-port-number protocol |
+ -- Function: getserv |
Returns a vector of information for the entry for
NAME-OR-PORT-NUMBER and PROTOCOL or the next entry if arguments
aren't given. The information is:
@@ -5217,8 +5406,8 @@ Host and Other Inquiries
3. protocol
- - Function: setservent stay-open
- - Function: setservent
+ -- Function: setservent stay-open |
+ -- Function: setservent |
Rewinds the service entry table back to the begining if given an
argument. If the argument STAY-OPEN is `#f' the table will be
closed between calls to getserv. Otherwise, the table stays open.
@@ -5227,53 +5416,53 @@ Host and Other Inquiries

File: scm.info, Node: Internet Addresses and Socket Names, Next: Socket, Prev: Host and Other Inquiries, Up: Sockets
-Internet Addresses and Socket Names
------------------------------------
+5.13.2 Internet Addresses and Socket Names |
+------------------------------------------ |
- - Function: inet:string->address string
+ -- Function: inet:string->address string |
Returns the host address number (integer) for host STRING or `#f'
if not found.
- - Function: inet:address->string address
+ -- Function: inet:address->string address |
Converts an internet (integer) address to a string in numbers and
dots notation.
- - Function: inet:network address
+ -- Function: inet:network address |
Returns the network number (integer) specified from ADDRESS or
`#f' if not found.
- - Function: inet:local-network-address address
+ -- Function: inet:local-network-address address |
Returns the integer for the address of ADDRESS within its local
network or `#f' if not found.
- - Function: inet:make-address network local-address
+ -- Function: inet:make-address network local-address |
Returns the Internet address of LOCAL-ADDRESS in NETWORK.
The type "socket-name" is used for inquiries about open sockets in the
following procedures:
- - Function: getsockname socket
+ -- Function: getsockname socket |
Returns the socket-name of SOCKET. Returns `#f' if unsuccessful
or SOCKET is closed.
- - Function: getpeername socket
+ -- Function: getpeername socket |
Returns the socket-name of the socket connected to SOCKET.
Returns `#f' if unsuccessful or SOCKET is closed.
- - Function: socket-name:family socket-name
+ -- Function: socket-name:family socket-name |
Returns the integer code for the family of SOCKET-NAME.
- - Function: socket-name:port-number socket-name
+ -- Function: socket-name:port-number socket-name |
Returns the integer port number of SOCKET-NAME.
- - Function: socket-name:address socket-name
+ -- Function: socket-name:address socket-name |
Returns the integer Internet address for SOCKET-NAME.

File: scm.info, Node: Socket, Prev: Internet Addresses and Socket Names, Up: Sockets
-Socket
-------
+5.13.3 Socket |
+------------- |
When a port is returned from one of these calls it is unbuffered. This
allows both reading and writing to the same port to work. If you want
@@ -5282,8 +5471,8 @@ buffered ports you can (assuming sock-port is a socket i/o port):
(define i-port (duplicate-port sock-port "r"))
(define o-port (duplicate-port sock-port "w"))
- - Function: make-stream-socket family
- - Function: make-stream-socket family protocol
+ -- Function: make-stream-socket family |
+ -- Function: make-stream-socket family protocol |
Returns a `SOCK_STREAM' socket of type FAMILY using PROTOCOL. If
FAMILY has the value `AF_INET', `SO_REUSEADDR' will be set. The
integer argument PROTOCOL corresponds to the integer protocol
@@ -5292,8 +5481,8 @@ buffered ports you can (assuming sock-port is a socket i/o port):
specified FAMILY is used. SCM sockets look like ports opened for
neither reading nor writing.
- - Function: make-stream-socketpair family
- - Function: make-stream-socketpair family protocol
+ -- Function: make-stream-socketpair family |
+ -- Function: make-stream-socketpair family protocol |
Returns a pair (cons) of connected `SOCK_STREAM' (socket) ports of
type FAMILY using PROTOCOL. Many systems support only socketpairs
of the `af-unix' FAMILY. The integer argument PROTOCOL
@@ -5301,7 +5490,7 @@ buffered ports you can (assuming sock-port is a socket i/o port):
elements) from (getproto). If the PROTOCOL argument is not
supplied, the default (0) for the specified FAMILY is used.
- - Function: socket:shutdown socket how
+ -- Function: socket:shutdown socket how |
Makes SOCKET no longer respond to some or all operations depending
on the integer argument HOW:
@@ -5313,34 +5502,34 @@ buffered ports you can (assuming sock-port is a socket i/o port):
`Socket:shutdown' returns SOCKET if successful, `#f' if not.
- - Function: socket:connect inet-socket host-number port-number
- - Function: socket:connect unix-socket pathname
+ -- Function: socket:connect inet-socket host-number port-number |
+ -- Function: socket:connect unix-socket pathname |
Returns SOCKET (changed to a read/write port) connected to the
Internet socket on host HOST-NUMBER, port PORT-NUMBER or the Unix
socket specified by PATHNAME. Returns `#f' if not successful.
- - Function: socket:bind inet-socket port-number
- - Function: socket:bind unix-socket pathname
+ -- Function: socket:bind inet-socket port-number |
+ -- Function: socket:bind unix-socket pathname |
Returns INET-SOCKET bound to the integer PORT-NUMBER or the
UNIX-SOCKET bound to new socket in the file system at location
PATHNAME. Returns `#f' if not successful. Binding a UNIX-SOCKET
creates a socket in the file system that must be deleted by the
caller when it is no longer needed (using `delete-file').
- - Function: socket:listen socket backlog
+ -- Function: socket:listen socket backlog |
The bound (*note bind: Socket.) SOCKET is readied to accept
connections. The positive integer BACKLOG specifies how many
pending connections will be allowed before further connection
requests are refused. Returns SOCKET (changed to a read-only
port) if successful, `#f' if not.
- - Function: char-ready? listen-socket
+ -- Function: char-ready? listen-socket |
The input port returned by a successful call to `socket:listen' can
be polled for connections by `char-ready?' (*note char-ready?:
Files and Ports.). This avoids blocking on connections by
`socket:accept'.
- - Function: socket:accept socket
+ -- Function: socket:accept socket |
Accepts a connection on a bound, listening SOCKET. Returns an
input/output port for the connection.
@@ -5348,13 +5537,13 @@ The following example is not too complicated, yet shows the use of
sockets for multiple connections without input blocking.
;;;; Scheme chat server
-
+
;;; This program implements a simple `chat' server which accepts
;;; connections from multiple clients, and sends to all clients any
;;; characters received from any client.
-
+
;;; To connect to chat `telnet localhost 8001'
-
+
(require 'socket)
(require 'i/o-extensions)
@@ -5400,17 +5589,17 @@ You can use `telnet localhost 8001' to connect to the chat server, or
you can use a client written in scheme:
;;;; Scheme chat client
-
+
;;; this program connects to socket 8001. It then sends all
;;; characters from current-input-port to the socket and sends all
;;; characters from the socket to current-output-port.
-
+
(require 'socket)
(require 'i/o-extensions)
(define con (make-stream-socket af_inet))
(set! con (socket:connect con (inet:string->address "localhost") 8001))
-
+
(define (go)
(define actives (wait-for-input (* 30 60) con (current-input-port)))
(let ((cs (and actives (memq con actives) (read-char con)))
@@ -5429,10 +5618,22 @@ you can use a client written in scheme:
(newline)))

+File: scm.info, Node: SCMDB, Prev: Sockets, Up: Packages
+ |
+5.14 SCMDB |
+========== |
+ |
+`(require 'mysql)' |
+ |
+"SCMDB" is an add-on for SCM that ports the MySQL C-library to SCM. |
+ |
+It is available from: `http://www.dedecker.net/jessie/scmdb/' |
+ |
+
File: scm.info, Node: The Implementation, Next: Index, Prev: Packages, Up: Top
-
-The Implementation
-******************
+ |
+6 The Implementation |
+******************** |
* Menu:
@@ -5444,8 +5645,8 @@ The Implementation

File: scm.info, Node: Data Types, Next: Operations, Prev: The Implementation, Up: The Implementation
-Data Types
-==========
+6.1 Data Types |
+============== |
In the descriptions below it is assumed that `long int's are 32 bits in
length. Acutally, SCM is written to work with any `long int' size
@@ -5468,35 +5669,35 @@ basic flavors, Immediates and Cells:

File: scm.info, Node: Immediates, Next: Cells, Prev: Data Types, Up: Data Types
-Immediates
-----------
+6.1.1 Immediates |
+---------------- |
An "immediate" is a data type contained in type `SCM' (`long int').
The type codes distinguishing immediate types from each other vary in
length, but reside in the low order bits.
- - Macro: IMP x
- - Macro: NIMP x
+ -- Macro: IMP x |
+ -- Macro: NIMP x |
Return non-zero if the `SCM' object X is an immediate or
non-immediate type, respectively.
- - Immediate: inum
+ -- Immediate: inum |
immediate 30 bit signed integer. An INUM is flagged by a `1' in
the second to low order bit position. The high order 30 bits are
used for the integer's value.
- - Macro: INUMP x
- - Macro: NINUMP x
+ -- Macro: INUMP x |
+ -- Macro: NINUMP x |
Return non-zero if the `SCM' X is an immediate integer or not
an immediate integer, respectively.
- - Macro: INUM x
+ -- Macro: INUM x |
Returns the C `long integer' corresponding to `SCM' X.
- - Macro: MAKINUM x
+ -- Macro: MAKINUM x |
Returns the `SCM' inum corresponding to C `long integer' x.
- - Immediate Constant: INUM0
+ -- Immediate Constant: INUM0 |
is equivalent to `MAKINUM(0)'.
Computations on INUMs are performed by converting the arguments to
@@ -5509,91 +5710,91 @@ length, but reside in the low order bits.
detected in a #if statement in `scmfig.h' and a signed right shift,
`SRS', is constructed in terms of unsigned right shift.
- - Immediate: ichr
+ -- Immediate: ichr |
characters.
- - Macro: ICHRP x
+ -- Macro: ICHRP x |
Return non-zero if the `SCM' object X is a character.
- - Macro: ICHR x
+ -- Macro: ICHR x |
Returns corresponding `unsigned char'.
- - Macro: MAKICHR x
+ -- Macro: MAKICHR x |
Given `char' X, returns `SCM' character.
- - Immediate: iflags
+ -- Immediate: iflags |
These are frequently used immediate constants.
- - Immediate Constant: SCM BOOL_T
+ -- Immediate Constant: SCM BOOL_T |
`#t'
- - Immediate Constant: SCM BOOL_F
+ -- Immediate Constant: SCM BOOL_F |
`#f'
- - Immediate Constant: SCM EOL
+ -- Immediate Constant: SCM EOL |
`()'. If `SICP' is `#define'd, `EOL' is `#define'd to be
identical with `BOOL_F'. In this case, both print as `#f'.
- - Immediate Constant: SCM EOF_VAL
+ -- Immediate Constant: SCM EOF_VAL |
end of file token, `#<eof>'.
- - Immediate Constant: SCM UNDEFINED
+ -- Immediate Constant: SCM UNDEFINED |
`#<undefined>' used for variables which have not been defined
and absent optional arguments.
- - Immediate Constant: SCM UNSPECIFIED
+ -- Immediate Constant: SCM UNSPECIFIED |
`#<unspecified>' is returned for those procedures whose return
values are not specified.
- - Macro: IFLAGP n
+ -- Macro: IFLAGP n |
Returns non-zero if N is an ispcsym, isym or iflag.
- - Macro: ISYMP n
+ -- Macro: ISYMP n |
Returns non-zero if N is an ispcsym or isym.
- - Macro: ISYMNUM n
+ -- Macro: ISYMNUM n |
Given ispcsym, isym, or iflag N, returns its index in the C array
`isymnames[]'.
- - Macro: ISYMCHARS n
+ -- Macro: ISYMCHARS n |
Given ispcsym, isym, or iflag N, returns its `char *'
representation (from `isymnames[]').
- - Macro: MAKSPCSYM n
+ -- Macro: MAKSPCSYM n |
Returns `SCM' ispcsym N.
- - Macro: MAKISYM n
+ -- Macro: MAKISYM n |
Returns `SCM' iisym N.
- - Macro: MAKIFLAG n
+ -- Macro: MAKIFLAG n |
Returns `SCM' iflag N.
- - Variable: isymnames
+ -- Variable: isymnames |
An array of strings containing the external representations of all
the ispcsym, isym, and iflag immediates. Defined in `repl.c'.
- - Constant: NUM_ISPCSYM
- - Constant: NUM_ISYMS
+ -- Constant: NUM_ISPCSYM |
+ -- Constant: NUM_ISYMS |
The number of ispcsyms and ispcsyms+isyms, respectively. Defined
in `scm.h'.
- - Immediate: isym
+ -- Immediate: isym |
`and', `begin', `case', `cond', `define', `do', `if', `lambda',
`let', `let*', `letrec', `or', `quote', `set!', `#f', `#t',
`#<undefined>', `#<eof>', `()', and `#<unspecified>'.
- - CAR Immediate: ispcsym
+ -- CAR Immediate: ispcsym |
special symbols: syntax-checked versions of first 14 isyms
- - CAR Immediate: iloc
+ -- CAR Immediate: iloc |
indexes to a variable's location in environment
- - CAR Immediate: gloc
+ -- CAR Immediate: gloc |
pointer to a symbol's value cell
- - Immediate: CELLPTR
+ -- Immediate: CELLPTR |
pointer to a cell (not really an immediate type, but here for
completeness). Since cells are always 8 byte aligned, a pointer
to a cell has the low order 3 bits `0'.
@@ -5607,8 +5808,8 @@ A "CAR Immediate" is an Immediate point which can only occur in the

File: scm.info, Node: Cells, Next: Header Cells, Prev: Immediates, Up: Data Types
-Cells
------
+6.1.2 Cells |
+----------- |
"Cell"s represent all SCM objects other than immediates. A cell has a
`CAR' and a `CDR'. Low-order bits in `CAR' identify the type of
@@ -5616,7 +5817,7 @@ object. The rest of `CAR' and `CDR' hold object data. The number
after `tc' specifies how many bits are in the type code. For instance,
`tc7' indicates that the type code is 7 bits.
- - Macro: NEWCELL x
+ -- Macro: NEWCELL x |
Allocates a new cell and stores a pointer to it in `SCM' local
variable X.
@@ -5626,23 +5827,23 @@ after `tc' specifies how many bits are in the type code. For instance,
All of the C macros decribed in this section assume that their argument
is of type `SCM' and points to a cell (`CELLPTR').
- - Macro: CAR x
- - Macro: CDR x
+ -- Macro: CAR x |
+ -- Macro: CDR x |
Returns the `car' and `cdr' of cell X, respectively.
- - Macro: TYP3 x
- - Macro: TYP7 x
- - Macro: TYP16 x
+ -- Macro: TYP3 x |
+ -- Macro: TYP7 x |
+ -- Macro: TYP16 x |
Returns the 3, 7, and 16 bit type code of a cell.
- - Cell: tc3_cons
+ -- Cell: tc3_cons |
scheme cons-cell returned by (cons arg1 arg2).
- - Macro: CONSP x
- - Macro: NCONSP x
+ -- Macro: CONSP x |
+ -- Macro: NCONSP x |
Returns non-zero if X is a `tc3_cons' or isn't, respectively.
- - Cell: tc3_closure
+ -- Cell: tc3_closure |
applicable object returned by (lambda (args) ...). `tc3_closure's
have a pointer to the body of the procedure in the `CAR' and a
pointer to the environment in the `CDR'. Bits 1 and 2
@@ -5652,15 +5853,15 @@ is of type `SCM' and points to a cell (`CELLPTR').
encoding precludes an immediate value for the `CDR': In the case
of an empty environment all bits above 2 in the `CDR' are zero.
- - Macro: CLOSUREP x
+ -- Macro: CLOSUREP x |
Returns non-zero if X is a `tc3_closure'.
- - Macro: CODE x
- - Macro: ENV x
+ -- Macro: CODE x |
+ -- Macro: ENV x |
Returns the code body or environment of closure X,
respectively.
- - Macro: ARGC x
+ -- Macro: ARGC x |
Returns the a lower bound on the number of required arguments
to closure X, it cannot exceed 3.
@@ -5668,82 +5869,82 @@ is of type `SCM' and points to a cell (`CELLPTR').

File: scm.info, Node: Header Cells, Next: Subr Cells, Prev: Cells, Up: Data Types
-Header Cells
-------------
+6.1.3 Header Cells |
+------------------ |
"Header"s are Cells whose `CDR's point elsewhere in memory, such as to
memory allocated by `malloc'.
- - Header: spare
+ -- Header: spare |
spare `tc7' type code
- - Header: tc7_vector
+ -- Header: tc7_vector |
scheme vector.
- - Macro: VECTORP x
- - Macro: NVECTORP x
+ -- Macro: VECTORP x |
+ -- Macro: NVECTORP x |
Returns non-zero if X is a `tc7_vector' or if not,
respectively.
- - Macro: VELTS x
- - Macro: LENGTH x
+ -- Macro: VELTS x |
+ -- Macro: LENGTH x |
Returns the C array of `SCM's holding the elements of vector
X or its length, respectively.
- - Header: tc7_ssymbol
+ -- Header: tc7_ssymbol |
static scheme symbol (part of initial system)
- - Header: tc7_msymbol
+ -- Header: tc7_msymbol |
`malloc'ed scheme symbol (can be GCed)
- - Macro: SYMBOLP x
+ -- Macro: SYMBOLP x |
Returns non-zero if X is a `tc7_ssymbol' or `tc7_msymbol'.
- - Macro: CHARS x
- - Macro: UCHARS x
- - Macro: LENGTH x
+ -- Macro: CHARS x |
+ -- Macro: UCHARS x |
+ -- Macro: LENGTH x |
Returns the C array of `char's or as `unsigned char's holding
the elements of symbol X or its length, respectively.
- - Header: tc7_string
+ -- Header: tc7_string |
scheme string
- - Macro: STRINGP x
- - Macro: NSTRINGP x
+ -- Macro: STRINGP x |
+ -- Macro: NSTRINGP x |
Returns non-zero if X is a `tc7_string' or isn't,
respectively.
- - Macro: CHARS x
- - Macro: UCHARS x
- - Macro: LENGTH x
+ -- Macro: CHARS x |
+ -- Macro: UCHARS x |
+ -- Macro: LENGTH x |
Returns the C array of `char's or as `unsigned char's holding
the elements of string X or its length, respectively.
- - Header: tc7_bvect
+ -- Header: tc7_bvect |
uniform vector of booleans (bit-vector)
- - Header: tc7_ivect
+ -- Header: tc7_ivect |
uniform vector of integers
- - Header: tc7_uvect
+ -- Header: tc7_uvect |
uniform vector of non-negative integers
- - Header: tc7_svect
+ -- Header: tc7_svect |
uniform vector of short integers
- - Header: tc7_fvect
+ -- Header: tc7_fvect |
uniform vector of short inexact real numbers
- - Header: tc7_dvect
+ -- Header: tc7_dvect |
uniform vector of double precision inexact real numbers
- - Header: tc7_cvect
+ -- Header: tc7_cvect |
uniform vector of double precision inexact complex numbers
- - Header: tc7_contin
+ -- Header: tc7_contin |
applicable object produced by call-with-current-continuation
- - Header: tc7_specfun
+ -- Header: tc7_specfun |
subr that is treated specially within the evaluator
`apply' and `call-with-current-continuation' are denoted by these
@@ -5760,36 +5961,36 @@ memory allocated by `malloc'.
invocation is currently not tail recursive when given 2 or
more arguments.
- - Function: makcclo proc len
+ -- Function: makcclo proc len |
makes a closure from the _subr_ PROC with LEN-1 extra
locations for `SCM' data. Elements of a CCLO are referenced
using `VELTS(cclo)[n]' just as for vectors.
- - Macro: CCLO_LENGTH cclo
+ -- Macro: CCLO_LENGTH cclo |
Expands to the length of CCLO.

File: scm.info, Node: Subr Cells, Next: Ptob Cells, Prev: Header Cells, Up: Data Types
-Subr Cells
-----------
+6.1.4 Subr Cells |
+---------------- |
A "Subr" is a header whose `CDR' points to a C code procedure. Scheme
primitive procedures are subrs. Except for the arithmetic `tc7_cxr's,
the C code procedures will be passed arguments (and return results) of
type `SCM'.
- - Subr: tc7_asubr
+ -- Subr: tc7_asubr |
associative C function of 2 arguments. Examples are `+', `-',
`*', `/', `max', and `min'.
- - Subr: tc7_subr_0
+ -- Subr: tc7_subr_0 |
C function of no arguments.
- - Subr: tc7_subr_1
+ -- Subr: tc7_subr_1 |
C function of one argument.
- - Subr: tc7_cxr
+ -- Subr: tc7_cxr |
These subrs are handled specially. If inexact numbers are
enabled, the `CDR' should be a function which takes and returns
type `double'. Conversions are handled in the interpreter.
@@ -5808,107 +6009,107 @@ type `SCM'.
`cadddr', `cdaaar', `cdaadr', `cdadar', `cdaddr', `cddaar',
`cddadr', `cdddar', and `cddddr' are defined this way.
- - Subr: tc7_subr_3
+ -- Subr: tc7_subr_3 |
C function of 3 arguments.
- - Subr: tc7_subr_2
+ -- Subr: tc7_subr_2 |
C function of 2 arguments.
- - Subr: tc7_rpsubr
+ -- Subr: tc7_rpsubr |
transitive relational predicate C function of 2 arguments. The C
function should return either `BOOL_T' or `BOOL_F'.
- - Subr: tc7_subr_1o
+ -- Subr: tc7_subr_1o |
C function of one optional argument. If the optional argument is
not present, `UNDEFINED' is passed in its place.
- - Subr: tc7_subr_2o
+ -- Subr: tc7_subr_2o |
C function of 1 required and 1 optional argument. If the optional
argument is not present, `UNDEFINED' is passed in its place.
- - Subr: tc7_lsubr_2
+ -- Subr: tc7_lsubr_2 |
C function of 2 arguments and a list of (rest of) `SCM' arguments.
- - Subr: tc7_lsubr
+ -- Subr: tc7_lsubr |
C function of list of `SCM' arguments.

File: scm.info, Node: Ptob Cells, Next: Smob Cells, Prev: Subr Cells, Up: Data Types
-Ptob Cells
-----------
+6.1.5 Ptob Cells |
+---------------- |
-A "ptob" is a port object, capable of delivering or accepting
-characters. *Note Ports: (r5rs)Ports. Unlike the types described so
-far, new varieties of ptobs can be defined dynamically (*note Defining
-Ptobs::). These are the initial ptobs:
+A "ptob" is a port object, capable of delivering or accepting characters. |
+*Note Ports: (r5rs)Ports. Unlike the types described so far, new |
+varieties of ptobs can be defined dynamically (*note Defining Ptobs::). |
+These are the initial ptobs: |
- - ptob: tc16_inport
+ -- ptob: tc16_inport |
input port.
- - ptob: tc16_outport
+ -- ptob: tc16_outport |
output port.
- - ptob: tc16_ioport
+ -- ptob: tc16_ioport |
input-output port.
- - ptob: tc16_inpipe
+ -- ptob: tc16_inpipe |
input pipe created by `popen()'.
- - ptob: tc16_outpipe
+ -- ptob: tc16_outpipe |
output pipe created by `popen()'.
- - ptob: tc16_strport
+ -- ptob: tc16_strport |
String port created by `cwos()' or `cwis()'.
- - ptob: tc16_sfport
+ -- ptob: tc16_sfport |
Software (virtual) port created by `mksfpt()' (*note Soft Ports::).
- - Macro: PORTP x
- - Macro: OPPORTP x
- - Macro: OPINPORTP x
- - Macro: OPOUTPORTP x
- - Macro: INPORTP x
- - Macro: OUTPORTP x
+ -- Macro: PORTP x |
+ -- Macro: OPPORTP x |
+ -- Macro: OPINPORTP x |
+ -- Macro: OPOUTPORTP x |
+ -- Macro: INPORTP x |
+ -- Macro: OUTPORTP x |
Returns non-zero if X is a port, open port, open input-port, open
output-port, input-port, or output-port, respectively.
- - Macro: OPENP x
- - Macro: CLOSEDP x
+ -- Macro: OPENP x |
+ -- Macro: CLOSEDP x |
Returns non-zero if port X is open or closed, respectively.
- - Macro: STREAM x
+ -- Macro: STREAM x |
Returns the `FILE *' stream for port X.
Ports which are particularly well behaved are called "fport"s.
Advanced operations like `file-position' and `reopen-file' only work
for fports.
- - Macro: FPORTP x
- - Macro: OPFPORTP x
- - Macro: OPINFPORTP x
- - Macro: OPOUTFPORTP x
+ -- Macro: FPORTP x |
+ -- Macro: OPFPORTP x |
+ -- Macro: OPINFPORTP x |
+ -- Macro: OPOUTFPORTP x |
Returns non-zero if X is a port, open port, open input-port, or
open output-port, respectively.

File: scm.info, Node: Smob Cells, Next: Data Type Representations, Prev: Ptob Cells, Up: Data Types
-Smob Cells
-----------
+6.1.6 Smob Cells |
+---------------- |
-A "smob" is a miscellaneous datatype. The type code and GCMARK bit
-occupy the lower order 16 bits of the `CAR' half of the cell. The rest
-of the `CAR' can be used for sub-type or other information. The `CDR'
+A "smob" is a miscellaneous datatype. The type code and GCMARK bit occupy |
+the lower order 16 bits of the `CAR' half of the cell. The rest of the |
+`CAR' can be used for sub-type or other information. The `CDR' |
contains data of size long and is often a pointer to allocated memory.
Like ptobs, new varieties of smobs can be defined dynamically (*note
Defining Smobs::). These are the initial smobs:
- - smob: tc_free_cell
+ -- smob: tc_free_cell |
unused cell on the freelist.
- - smob: tc16_flo
+ -- smob: tc16_flo |
single-precision float.
Inexact number data types are subtypes of type `tc16_flo'. If the
@@ -5920,14 +6121,14 @@ Defining Smobs::). These are the initial smobs:
3. `CDR' is a pointer to a `malloc'ed pair of doubles.
- - smob: tc_dblr
+ -- smob: tc_dblr |
double-precision float.
- - smob: tc_dblc
+ -- smob: tc_dblc |
double-precision complex.
- - smob: tc16_bigpos
- - smob: tc16_bigneg
+ -- smob: tc16_bigpos |
+ -- smob: tc16_bigneg |
positive and negative bignums, respectively.
Scm has large precision integers called bignums. They are stored
@@ -5957,19 +6158,18 @@ Defining Smobs::). These are the initial smobs:
should obtain a package which specializes in number-theoretical
calculations:
- <ftp://megrez.math.u-bordeaux.fr/pub/pari/>
+ `ftp://megrez.math.u-bordeaux.fr/pub/pari/' |
-
- - smob: tc16_promise
+ -- smob: tc16_promise |
made by DELAY. *Note Control features: (r5rs)Control features.
- - smob: tc16_arbiter
+ -- smob: tc16_arbiter |
synchronization object. *Note Process Synchronization::.
- - smob: tc16_macro
+ -- smob: tc16_macro |
macro expanding function. *Note Macro Primitives::.
- - smob: tc16_array
+ -- smob: tc16_array |
multi-dimensional array. *Note Arrays::.
This type implements both conventional arrays (those with
@@ -5984,8 +6184,8 @@ Defining Smobs::). These are the initial smobs:

File: scm.info, Node: Data Type Representations, Prev: Smob Cells, Up: Data Types
-Data Type Representations
--------------------------
+6.1.7 Data Type Representations |
+------------------------------- |
IMMEDIATE: B,D,E,F=data bit, C=flag code, P=pointer address bit
................................
@@ -6001,7 +6201,7 @@ gloc PPPPPPPPPPPPPPPPPPPPPPPPPPPPP001
HEAP CELL: G=gc_mark; 1 during mark, 0 other times.
1s and 0s here indicate type. G missing means sys (not GC'd)
- SIMPLE:
+ SIMPLE |
cons ..........SCM car..............0 ...........SCM cdr.............G
closure ..........SCM code...........011 ...........SCM env...........CCG
HEADERs:
@@ -6022,7 +6222,7 @@ cvect .........long length....G0110101 ........double *words...........
contin .........long length....G0111101 .............*regs..............
specfun ................xxxxxxxxG1111111 ...........SCM name.............
cclo ..short length..xxxxxx10G1111111 ...........SCM **elts...........
- PTOBs:
+ PTOBs |
port int portnum.CwroxxxxxxxxG0110111 ..........FILE *stream.......... |
socket int portnum.C001xxxxxxxxG0110111 ..........FILE *stream.......... |
inport int portnum.C011xxxxxxxxG0110111 ..........FILE *stream.......... |
@@ -6032,7 +6232,7 @@ 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:
+ SUBRs |
spare 010001x1
spare 010011x1
subr_0 ..........int hpoff.....01010101 ...........SCM (*f)()...........
@@ -6046,7 +6246,7 @@ subr_2o ..........int hpoff.....01101111 ...........SCM (*f)()...........
lsubr_2 ..........int hpoff.....01110101 ...........SCM (*f)()...........
lsubr ..........int hpoff.....01110111 ...........SCM (*f)()...........
rpsubr ..........int hpoff.....01111101 ...........SCM (*f)()...........
- SMOBs:
+ SMOBs |
free_cell
000000000000000000000000G1111111 ...........*free_cell........000
flo 000000000000000000000001G1111111 ...........float num............
@@ -6064,8 +6264,8 @@ array ...short rank..cxxxxxxxxG1111111 ............*array..............

File: scm.info, Node: Operations, Next: Program Self-Knowledge, Prev: Data Types, Up: The Implementation
-Operations
-==========
+6.2 Operations |
+============== |
* Menu:
@@ -6087,8 +6287,8 @@ Operations

File: scm.info, Node: Garbage Collection, Next: Memory Management for Environments, Prev: Operations, Up: Operations
-Garbage Collection
-------------------
+6.2.1 Garbage Collection |
+------------------------ |
The garbage collector is in the latter half of `sys.c'. The primary
goal of "garbage collection" (or "GC") is to recycle those cells no
@@ -6107,8 +6307,8 @@ heap.

File: scm.info, Node: Marking Cells, Next: Sweeping the Heap, Prev: Garbage Collection, Up: Garbage Collection
-Marking Cells
-.............
+6.2.1.1 Marking Cells |
+..................... |
The first step in garbage collection is to "mark" all heap objects in
use. Each heap cell has a bit reserved for this purpose. For pairs
@@ -6118,11 +6318,11 @@ during garbage collection. Special C macros are defined in `scm.h' to
allow easy manipulation when GC bits are possibly set. `CAR', `TYP3',
and `TYP7' can be used on GC marked cells as they are.
- - Macro: GCCDR x
+ -- Macro: GCCDR x |
Returns the CDR of a cons cell, even if that cell has been GC
marked.
- - Macro: GCTYP16 x
+ -- Macro: GCTYP16 x |
Returns the 16 bit type code of a cell.
We need to (recursively) mark only a few objects in order to assure that
@@ -6130,13 +6330,13 @@ all accessible objects are marked. Those objects are `sys_protects[]'
(for example, `dynwinds'), the current C-stack and the hash table for
symbols, "symhash".
- - Function: void gc_mark (SCM OBJ)
+ -- Function: void gc_mark (SCM OBJ) |
The function `gc_mark()' is used for marking SCM cells. If OBJ is
marked, `gc_mark()' returns. If OBJ is unmarked, gc_mark sets the
mark bit in OBJ, then calls `gc_mark()' on any SCM components of
OBJ. The last call to `gc_mark()' is tail-called (looped).
- - Function: void mark_locations (STACKITEM X[], sizet LEN))
+ -- Function: void mark_locations (STACKITEM X[], sizet LEN)) |
The function `mark_locations' is used for marking segments of
C-stack or saved segments of C-stack (marked continuations). The
argument LEN is the size of the stack in units of size
@@ -6153,8 +6353,8 @@ symbols, "symhash".

File: scm.info, Node: Sweeping the Heap, Prev: Marking Cells, Up: Garbage Collection
-Sweeping the Heap
-.................
+6.2.1.2 Sweeping the Heap |
+......................... |
After all found objects have been marked, the heap is swept.
@@ -6164,7 +6364,7 @@ object from its type-header cell in the heap. This allows malloc
objects to be freed when the associated heap object is garbage
collected.
- - Function: static void gc_sweep ()
+ -- Function: static void gc_sweep () |
The function `gc_sweep' scans through all heap segments. The mark
bit is cleared from marked cells. Unmarked cells are spliced into
FREELIST, where they can again be returned by invocations of
@@ -6177,8 +6377,8 @@ collected.

File: scm.info, Node: Memory Management for Environments, Next: Signals, Prev: Garbage Collection, Up: Operations
-Memory Management for Environments
-----------------------------------
+6.2.2 Memory Management for Environments |
+---------------------------------------- |
* "Ecache" was designed and implemented by Radey Shouman.
@@ -6277,17 +6477,17 @@ literature is available.

File: scm.info, Node: Signals, Next: C Macros, Prev: Memory Management for Environments, Up: Operations
-Signals
--------
+6.2.3 Signals |
+------------- |
- - Function: init_signals
+ -- Function: init_signals |
(in `scm.c') initializes handlers for `SIGINT' and `SIGALRM' if
they are supported by the C implementation. All of the signal
handlers immediately reestablish themselves by a call to
`signal()'.
- - Function: int_signal sig
- - Function: alrm_signal sig
+ -- Function: int_signal sig |
+ -- Function: alrm_signal sig |
The low level handlers for `SIGINT' and `SIGALRM'.
If an interrupt handler is defined when the interrupt is received, the
@@ -6299,14 +6499,14 @@ SCM does not use any signal masking system calls. These are not a
portable feature. However, code can run uninterrupted by use of the C
macros `DEFER_INTS' and `ALLOW_INTS'.
- - Macro: DEFER_INTS
+ -- Macro: DEFER_INTS |
sets the global variable `ints_disabled' to 1. If an interrupt
occurs during a time when `ints_disabled' is 1, then
`deferred_proc' is set to non-zero, one of the global variables
`SIGINT_deferred' or `SIGALRM_deferred' is set to 1, and the
handler returns.
- - Macro: ALLOW_INTS
+ -- Macro: ALLOW_INTS |
Checks the deferred variables and if set the appropriate handler is
called.
@@ -6318,10 +6518,10 @@ macros `DEFER_INTS' and `ALLOW_INTS'.

File: scm.info, Node: C Macros, Next: Changing Scm, Prev: Signals, Up: Operations
-C Macros
---------
+6.2.4 C Macros |
+-------------- |
- - Macro: ASRTER 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
@@ -6366,15 +6566,15 @@ C Macros
defined. An error condition can still be signaled in this case
with a call to `wta(arg, pos, subr)'.
- - Macro: ASRTGO cond label
+ -- Macro: ASRTGO cond label |
`goto' LABEL if the expression (COND) is 0. Like `ASRTER',
`ASRTGO' does is not active if the flag `RECKLESS' is defined.

File: scm.info, Node: Changing Scm, Next: Defining Subrs, Prev: C Macros, Up: Operations
-Changing Scm
-------------
+6.2.5 Changing Scm |
+------------------ |
When writing C-code for SCM, a precaution is recommended. If your
routine allocates a non-cons cell which will _not_ be incorporated into
@@ -6395,7 +6595,7 @@ 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)
+ -- 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.
@@ -6404,7 +6604,7 @@ object, you must either make your pointer be the value cell of a symbol
(see `errobj' for an example) or (permanently) add your pointer to
`sys_protects' using:
- - Function: SCM scm_gc_protect (SCM OBJ)
+ -- Function: SCM scm_gc_protect (SCM OBJ) |
Permanently adds OBJ to a table of objects protected from garbage
collection. `scm_gc_protect' returns OBJ.
@@ -6466,7 +6666,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 `Init5d9.scm' which loads `Ifoo.scm' if your |
+ 8. put an `if' into `Init5e1.scm' which loads `Ifoo.scm' if your |
package is included:
(if (defined? twiddle-bits!)
@@ -6494,7 +6694,7 @@ Special forms (new syntax) can be added to scm.
2. add a string with the new name in the corresponding place in
`isymnames' in `repl.c'.
- 3. add `case:' clause to `ceval()' near `i_quasiquote' (in `eval.c').
+ 3. add `case' clause to `ceval()' near `i_quasiquote' (in `eval.c'). |
New syntax can now be added without recompiling SCM by the use of the
`procedure->syntax', `procedure->macro', `procedure->memoizing-macro',
@@ -6503,8 +6703,8 @@ and `defmacro'. For details, *Note Syntax::.

File: scm.info, Node: Defining Subrs, Next: Defining Smobs, Prev: Changing Scm, Up: Operations
-Defining Subrs
---------------
+6.2.6 Defining Subrs |
+-------------------- |
If "CCLO" is `#define'd when compiling, the compiled closure feature
will be enabled. It is automatically enabled if dynamic linking is
@@ -6514,7 +6714,7 @@ The SCM interpreter directly recognizes subrs taking small numbers of
arguments. In order to create subrs taking larger numbers of arguments
use:
- - Function: make_gsubr name req opt rest fcn
+ -- Function: make_gsubr name req opt rest fcn |
returns a cclo (compiled closure) object of name `char *' NAME
which takes `int' REQ required arguments, `int' OPT optional
arguments, and a list of rest arguments if `int' REST is 1 (0 for
@@ -6531,9 +6731,9 @@ use:
/* A silly example, taking 2 required args,
1 optional, and a list of rest args */
-
+
#include <scm.h>
-
+
SCM gsubr_21l(req1,req2,opt,rst)
SCM req1,req2,opt,rst;
{
@@ -6548,7 +6748,7 @@ use:
newline(cur_outp);
return UNSPECIFIED;
}
-
+
void init_gsubr211()
{
make_gsubr("gsubr-2-1-l", 2, 1, 1, gsubr_21l);
@@ -6557,8 +6757,8 @@ use:

File: scm.info, Node: Defining Smobs, Next: Defining Ptobs, Prev: Defining Subrs, Up: Operations
-Defining Smobs
---------------
+6.2.7 Defining Smobs |
+-------------------- |
Here is an example of how to add a new type named `foo' to SCM. The
following lines need to be added to your code:
@@ -6581,9 +6781,9 @@ following lines need to be added to your code:
mark) and returns type `SCM' which will then be marked. If
no further objects need to be marked then return an immediate
object such as `BOOL_F'. The smob cell itself will already
- have been marked. _Note:_ This is different from SCM
- versions prior to 5c5. Only additional data specific to a
- smob type need be marked by `smob.mark'.
+ have been marked. _Note_ This is different from SCM versions |
+ prior to 5c5. Only additional data specific to a smob type |
+ need be marked by `smob.mark'. |
2 functions are provided:
@@ -6631,8 +6831,8 @@ than `malloc' *Note Allocating memory::.

File: scm.info, Node: Defining Ptobs, Next: Allocating memory, Prev: Defining Smobs, Up: Operations
-Defining Ptobs
---------------
+6.2.8 Defining Ptobs |
+-------------------- |
"ptob"s are similar to smobs but define new types of port to which SCM
procedures can read or write. The following functions are defined in
@@ -6662,8 +6862,8 @@ memory::.

File: scm.info, Node: Allocating memory, Next: Embedding SCM, Prev: Defining Ptobs, Up: Operations
-Allocating memory
------------------
+6.2.9 Allocating memory |
+----------------------- |
SCM maintains a count of bytes allocated using malloc, and calls the
garbage collector when that number exceeds a dynamically managed limit.
@@ -6671,17 +6871,17 @@ In order for this to work properly, `malloc' and `free' should not be
called directly to manage memory freeable by garbage collection. The
following functions are provided for that purpose:
- - Function: SCM must_malloc_cell (long LEN, SCM C, char *WHAT)
- - Function: char * must_malloc (long LEN, char *WHAT)
+ -- Function: SCM must_malloc_cell (long LEN, SCM C, char *WHAT) |
+ -- Function: char * must_malloc (long LEN, char *WHAT) |
LEN is the number of bytes that should be allocated, WHAT is a
string to be used in error or gc messages. `must_malloc' returns
a pointer to newly allocated memory. `must_malloc_cell' returns a
newly allocated cell whose `car' is C and whose `cdr' is a pointer
to newly allocated memory.
- - Function: void must_realloc_cell (SCM Z, long OLEN, long LEN, char
+ -- Function: void must_realloc_cell (SCM Z, long OLEN, long LEN, char |
*WHAT)
- - Function: char * must_realloc (char *WHERE, long OLEN, long LEN,
+ -- Function: char * must_realloc (char *WHERE, long OLEN, long LEN, |
char *WHAT)
`must_realloc_cell' takes as argument Z a cell whose `cdr' should
be a pointer to a block of memory of length OLEN allocated with
@@ -6701,7 +6901,7 @@ 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)
+ -- Function: void must_free (char *PTR, sizet LEN) |
`must_free' is used to free a block of memory allocated by the
above functions and pointed to by PTR. LEN is the length of the
block in bytes, but this value is used only for debugging purposes.
@@ -6711,22 +6911,22 @@ must be large enough.

File: scm.info, Node: Embedding SCM, Next: Callbacks, Prev: Allocating memory, Up: Operations
-Embedding SCM
--------------
+6.2.10 Embedding SCM |
+-------------------- |
The file `scmmain.c' contains the definition of main(). When SCM is
compiled as a library `scmmain.c' is not included in the library; a
copy of `scmmain.c' can be modified to use SCM as an embedded library
module.
- - Function: int main (int ARGC, char **ARGV)
+ -- Function: int main (int ARGC, char **ARGV) |
This is the top level C routine. The value of the ARGC argument
is the number of command line arguments. The ARGV argument is a
vector of C strings; its elements are the individual command line
argument strings. A null pointer always follows the last element:
`ARGV[ARGC]' is this null pointer.
- - Variable: char *execpath
+ -- Variable: char *execpath |
This string is the pathname of the executable file being run. This
variable can be examined and set from Scheme (*note Internal
State::). EXECPATH must be set to executable's path in order to
@@ -6738,11 +6938,11 @@ up SCM as you want it.
If you need more control than is possible through ARGV, here are
descriptions of the functions which main() calls.
- - Function: void init_sbrk (void)
+ -- Function: void init_sbrk (void) |
Call this before SCM calls malloc(). Value returned from sbrk()
is used to gauge how much storage SCM uses.
- - Function: char * scm_find_execpath (int ARGC, char **ARGV, char
+ -- Function: char * scm_find_execpath (int ARGC, char **ARGV, char |
*SCRIPT_ARG)
ARGC and ARGV are as described in main(). SCRIPT_ARG is the
pathname of the SCSH-style script (*note Scripting::) being
@@ -6757,7 +6957,7 @@ and DIRSEP control scm_find_implpath()'s operation.
If your application has an easier way to locate initialization code for
SCM, then you can replace `scm_find_implpath'.
- - Function: char * scm_find_implpath (char *EXECPATH)
+ -- Function: char * scm_find_implpath (char *EXECPATH) |
Returns the full pathname of the Scheme initialization file or 0
if it cannot find it.
@@ -6766,11 +6966,11 @@ 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 "Init5d9_scm"), and the directory separator string |
+ (default "Init5e1_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.
- - Function: int init_buf0 (FILE *INPORT)
+ -- Function: int init_buf0 (FILE *INPORT) |
Tries to determine whether INPORT (usually stdin) is an
interactive input port which should be used in an unbuffered mode.
If so, INPORT is set to unbuffered and non-zero is returned.
@@ -6780,7 +6980,7 @@ SCM, then you can replace `scm_find_implpath'.
Its value can be used as the last argument to
scm_init_from_argv().
- - Function: void scm_init_from_argv (int ARGC, char **ARGV, char
+ -- Function: void scm_init_from_argv (int ARGC, char **ARGV, char |
*SCRIPT_ARG, int IVERBOSE, int BUF0STDIN)
Initializes SCM storage and creates a list of the argument strings
PROGRAM-ARGUMENTS from ARGV. ARGC and ARGV must already be
@@ -6792,15 +6992,15 @@ SCM, then you can replace `scm_find_implpath'.
Call `init_signals' and `restore_signals' only if you want SCM to
handle interrupts and signals.
- - Function: void init_signals (void)
+ -- Function: void init_signals (void) |
Initializes handlers for `SIGINT' and `SIGALRM' if they are
supported by the C implementation. All of the signal handlers
immediately reestablish themselves by a call to `signal()'.
- - Function: void restore_signals (void)
+ -- Function: void restore_signals (void) |
Restores the handlers in effect when `init_signals' was called.
- - Function: SCM scm_top_level (char *INITPATH, SCM (*toplvl_fun)())
+ -- Function: SCM scm_top_level (char *INITPATH, SCM (*toplvl_fun)()) |
This is SCM's top-level. Errors longjmp here. TOPLVL_FUN is a
callback function of zero arguments that is called by
`scm_top_level' to do useful work - if zero, then `repl', which
@@ -6824,7 +7024,7 @@ handle interrupts and signals.
resignalled. If `toplvl_fun' can not recover from an error
situation it may simply return.
- - Function: void final_scm (int FREEALL)
+ -- Function: void final_scm (int FREEALL) |
Calls all finalization routines registered with add_final(). If
FREEALL is non-zero, then all memory which SCM allocated with
malloc() will be freed.
@@ -6839,7 +7039,7 @@ Use `apply' to call Scheme procedures from your C code. For example:
apply(CDR(intern("srv:startup",sizeof("srv:startup")-1)),
mksproc(srvproc),
listofnull);
-
+
func = CDR(intern(rpcname,strlen(rpcname)));
retval = apply(func, cons(mksproc(srvproc), args), EOL);
@@ -6852,13 +7052,13 @@ Here is a minimal embedding program `libtest.c':
#include "scm.h"
/* include patchlvl.h for SCM's INIT_FILE_NAME. */
#include "patchlvl.h"
-
+
void libtest_init_user_scm() |
{
fputs("This is libtest_init_user_scm\n", stderr); fflush(stderr); |
sysintern("*the-string*", makfrom0str("hello world\n"));
}
-
+
SCM user_main()
{
static int done = 0;
@@ -6866,48 +7066,48 @@ Here is a minimal embedding program `libtest.c':
scm_ldstr("(display *the-string*)");
return MAKINUM(EXIT_SUCCESS);
}
-
+
int main(argc, argv)
int argc;
char **argv;
{
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);
fprintf(stderr, "implpath: %s\n", implpath);
scm_init_from_argv(argc, argv, 0L, 0, 0);
-
+
retval = scm_top_level(implpath, user_main);
-
+
final_scm(!0);
return (int)INUM(retval);
}
-
+
-|
dld_find_executable(./libtest): /home/jaffer/scm/libtest
- implpath: /home/jaffer/scm/Init5d9.scm |
+ implpath: /home/jaffer/scm/Init5e1.scm |
This is libtest_init_user_scm |
hello world

File: scm.info, Node: Callbacks, Next: Type Conversions, Prev: Embedding SCM, Up: Operations
-Callbacks
----------
+6.2.11 Callbacks |
+---------------- |
SCM now has routines to make calling back to Scheme procedures easier.
The source code for these routines are found in `rope.c'.
- - Function: int scm_ldfile (char *FILE)
+ -- 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
- `Init5d9.scm'. |
+ `Init5e1.scm'. |
- - Function: int scm_ldprog (char *FILE)
+ -- Function: int scm_ldprog (char *FILE) |
Loads the Scheme source file `(in-vicinity (program-vicinity)
FILE)'. Returns 0 if successful, non-0 if not.
@@ -6916,11 +7116,11 @@ The source code for these routines are found in `rope.c'.
directory from which the calling code was loaded (*note Vicinity:
(slib)Vicinity.).
- - Function: SCM scm_evstr (char *STR)
+ -- Function: SCM scm_evstr (char *STR) |
Returns the result of reading an expression from STR and
evaluating it.
- - Function: void scm_ldstr (char *STR)
+ -- Function: void scm_ldstr (char *STR) |
Reads and evaluates all the expressions from STR.
If you wish to catch errors during execution of Scheme code, then you
@@ -6944,14 +7144,14 @@ Calls to procedures so wrapped will return even if an error occurs.

File: scm.info, Node: Type Conversions, Next: Continuations, Prev: Callbacks, Up: Operations
-Type Conversions
-----------------
+6.2.12 Type Conversions |
+----------------------- |
These type conversion functions are very useful for connecting SCM and C
code. Most are defined in `rope.c'.
- - Function: SCM long2num (long N)
- - Function: SCM ulong2num (unsigned long N)
+ -- Function: SCM long2num (long N) |
+ -- Function: SCM ulong2num (unsigned long N) |
Return an object of type `SCM' corresponding to the `long' or
`unsigned long' argument N. If N cannot be converted, `BOOL_F' is
returned. Which numbers can be converted depends on whether SCM
@@ -6960,15 +7160,15 @@ code. Most are defined in `rope.c'.
To convert integer numbers of smaller types (`short' or `char'),
use the macro `MAKINUM(n)'.
- - Function: long num2long (SCM NUM, char *POS, char *S_CALLER)
- - Function: unsigned long num2ulong (SCM NUM, char *POS, char
+ -- 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
+ -- 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
+ -- Function: unsigned char num2uchar (SCM NUM, char *POS, char |
*S_CALLER)
- - Function: double num2dbl (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
@@ -6976,12 +7176,12 @@ code. Most are defined in `rope.c'.
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 `num2dbl',
- `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)
+ -- Function: unsigned long scm_addr (SCM ARGS, char *S_NAME) |
Returns a pointer (cast to an `unsigned long') to the storage
corresponding to the location accessed by
`aref(CAR(args),CDR(args))'. The string S_NAME is used in any
@@ -6990,24 +7190,24 @@ code. Most are defined in `rope.c'.
`scm_addr' is useful for performing C operations on strings or
other uniform arrays (*note Uniform Array::).
- - Function: unsigned long scm_base_addr(SCM RA, char *S_NAME)
+ -- 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
+ _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)
+ -- Function: SCM makfrom0str (char *SRC) |
+ -- Function: SCM makfromstr (char *SRC, sizet LEN) |
Return a newly allocated string `SCM' object copy of the
null-terminated string SRC or the string SRC of length LEN,
respectively.
- - Function: SCM makfromstrs (int ARGC, char **ARGV)
+ -- Function: SCM makfromstrs (int ARGC, char **ARGV) |
Returns a newly allocated `SCM' list of strings corresponding to
the ARGC length array of null-terminated strings ARGV. If ARGV is
less than `0', ARGV is assumed to be `NULL' terminated.
@@ -7016,7 +7216,7 @@ code. Most are defined in `rope.c'.
of SCM procedure calls to `program-arguments' (*note
program-arguments: SCM Session.).
- - Function: char ** makargvfrmstrs (SCM ARGS, char *S_NAME)
+ -- Function: char ** makargvfrmstrs (SCM ARGS, char *S_NAME) |
Returns a `NULL' terminated list of null-terminated strings copied
from the `SCM' list of strings ARGS. The string S_NAME is used in
messages from error calls by `makargvfrmstrs'.
@@ -7024,15 +7224,15 @@ code. Most are defined in `rope.c'.
`makargvfrmstrs' is useful for constructing argument lists suitable
for passing to `main' functions.
- - Function: void must_free_argv (char **ARGV)
+ -- Function: void must_free_argv (char **ARGV) |
Frees the storage allocated to create ARGV by a call to
`makargvfrmstrs'.

File: scm.info, Node: Continuations, Next: Evaluation, Prev: Type Conversions, Up: Operations
-Continuations
--------------
+6.2.13 Continuations |
+-------------------- |
The source files `continue.h' and `continue.c' are designed to function
as an independent resource for programs wishing to use continuations,
@@ -7049,45 +7249,45 @@ SCM uses the names `jump_buf', `setjump', and `longjump' in lieu of
`jmp_buf', `setjmp', and `longjmp' to prevent name and declaration
conflicts.
- - Data type: CONTINUATION jmpbuf length stkbse other parent
+ -- Data type: CONTINUATION jmpbuf length stkbse other parent |
is a `typedef'ed structure holding all the information needed to
represent a continuation. The OTHER slot can be used to hold any
data the user wishes to put there by defining the macro
`CONTINUATION_OTHER'.
- - Macro: SHORT_ALIGN
+ -- Macro: SHORT_ALIGN |
If `SHORT_ALIGN' is `#define'd (in `scmfig.h'), then the it is
assumed that pointers in the stack can be aligned on `short int'
boundaries.
- - Data type: STACKITEM
+ -- Data type: STACKITEM |
is a pointer to objects of the size specified by `SHORT_ALIGN'
being `#define'd or not.
- - Macro: CHEAP_CONTINUATIONS
+ -- Macro: CHEAP_CONTINUATIONS |
If `CHEAP_CONTINUATIONS' is `#define'd (in `scmfig.h') each
`CONTINUATION' has size `sizeof CONTINUATION'. Otherwise, all but
"root" `CONTINUATION's have additional storage (immediately
following) to contain a copy of part of the stack.
- _Note:_ On systems with nonlinear stack disciplines (multiple
+ _Note_ On systems with nonlinear stack disciplines (multiple |
stacks or non-contiguous stack frames) copying the stack will not
work properly. These systems need to #define
`CHEAP_CONTINUATIONS' in `scmfig.h'.
- - Macro: STACK_GROWS_UP
+ -- Macro: STACK_GROWS_UP |
Expresses which way the stack grows by its being `#define'd or not.
- - Variable: long thrown_value
+ -- Variable: long thrown_value |
Gets set to the VALUE passed to `throw_to_continuation'.
- - Function: long stack_size (STACKITEM *START)
+ -- Function: long stack_size (STACKITEM *START) |
Returns the number of units of size `STACKITEM' which fit between
START and the current top of stack. No check is done in this
routine to ensure that START is actually in the current stack
segment.
- - Function: CONTINUATION * make_root_continuation (STACKITEM
+ -- Function: CONTINUATION * make_root_continuation (STACKITEM |
*STACK_BASE)
Allocates (`malloc') storage for a `CONTINUATION' of the current
extent of stack. This newly allocated `CONTINUATION' is returned
@@ -7096,7 +7296,7 @@ conflicts.
`setjump(NEW_CONTINUATION->jmpbuf)' in order to complete the
capture of this continuation.
- - Function: CONTINUATION * make_continuation (CONTINUATION
+ -- Function: CONTINUATION * make_continuation (CONTINUATION |
*PARENT_CONT)
Allocates storage for the current `CONTINUATION', copying (or
encapsulating) the stack state from `PARENT_CONT->stkbse' to the
@@ -7106,11 +7306,11 @@ conflicts.
`setjump(NEW_CONTINUATION->jmpbuf)' in order to complete the
capture of this continuation.
- - Function: void free_continuation (CONTINUATION *CONT)
+ -- Function: void free_continuation (CONTINUATION *CONT) |
Frees the storage pointed to by CONT. Remember to free storage
pointed to by `CONT->other'.
- - Function: void throw_to_continuation (CONTINUATION *CONT, long
+ -- Function: void throw_to_continuation (CONTINUATION *CONT, long |
VALUE, CONTINUATION *ROOT_CONT)
Sets `thrown_value' to VALUE and returns from the continuation
CONT.
@@ -7131,8 +7331,8 @@ conflicts.

File: scm.info, Node: Evaluation, Prev: Continuations, Up: Operations
-Evaluation
-----------
+6.2.14 Evaluation |
+----------------- |
SCM uses its type representations to speed evaluation. All of the
`subr' types (*note Subr Cells::) are `tc7' types. Since the `tc7'
@@ -7178,12 +7378,12 @@ with its cache footprint. In order to keep the size down, certain
or because they are part of expensive operations) are instead calls to
the C function `evalcar'.
- - Variable: symhash
+ -- Variable: symhash |
Top level symbol values are stored in the `symhash' table.
`symhash' is an array of lists of `ISYM's and pairs of symbols and
values.
- - Immediate: ILOC
+ -- Immediate: ILOC |
Whenever a symbol's value is found in the local environment the
pointer to the symbol in the code is replaced with an immediate
object (`ILOC') which specifies how many environment frames down
@@ -7201,7 +7401,7 @@ Adding `#define TEST_FARLOC' to `eval.c' causes `FARLOC's to be
generated for all local identifiers; this is useful only for testing
memoization.
- - Immediate: GLOC
+ -- Immediate: GLOC |
Pointers to symbols not defined in local environments are changed
to one plus the value cell address in symhash. This incremented
pointer is called a `GLOC'. The low order bit is normally
@@ -7218,8 +7418,8 @@ argument checks for closures are made only when the function position
will be checked only the first time it is evaluated because it will
then be replaced with an `ILOC' or `GLOC'.
- - Macro: EVAL expression env
- - Macro: SIDEVAL expression env
+ -- Macro: EVAL expression env |
+ -- Macro: SIDEVAL expression env |
`EVAL' Returns the result of evaluating EXPRESSION in ENV.
`SIDEVAL' evaluates EXPRESSION in ENV when the value of the
expression is not used.
@@ -7229,7 +7429,7 @@ then be replaced with an `ILOC' or `GLOC'.
EXPRESSION will not be referenced again. The C function `eval' is
safe from this problem.
- - Function: SCM eval (SCM EXPRESSION)
+ -- Function: SCM eval (SCM EXPRESSION) |
Returns the result of evaluating EXPRESSION in the top-level
environment. `eval' copies `expression' so that memoization does
not modify `expression'.
@@ -7237,8 +7437,8 @@ then be replaced with an `ILOC' or `GLOC'.

File: scm.info, Node: Program Self-Knowledge, Next: Improvements To Make, Prev: Operations, Up: The Implementation
-Program Self-Knowledge
-======================
+6.3 Program Self-Knowledge |
+========================== |
* Menu:
@@ -7249,8 +7449,8 @@ Program Self-Knowledge

File: scm.info, Node: File-System Habitat, Next: Executable Pathname, Prev: Program Self-Knowledge, Up: Program Self-Knowledge
-File-System Habitat
--------------------
+6.3.1 File-System Habitat |
+------------------------- |
Where should software reside? Although individually a minor annoyance,
cumulatively this question represents many thousands of frustrated user
@@ -7279,7 +7479,7 @@ for which this information is either not available or unrelated to the
locations of support files, then a higher level interface will be
needed.
- - Function: char * find_impl_file (char *EXEC_PATH, char
+ -- Function: char * find_impl_file (char *EXEC_PATH, char |
*GENERIC_NAME, char *INITNAME, char *SEP)
Given the pathname of this executable (EXEC_PATH), test for the
existence of INITNAME in the implementation-vicinity of this
@@ -7322,10 +7522,10 @@ needed.

File: scm.info, Node: Executable Pathname, Next: Script Support, Prev: File-System Habitat, Up: Program Self-Knowledge
-Executable Pathname
--------------------
+6.3.2 Executable Pathname |
+------------------------- |
-For purposes of finding `Init5d9.scm', dumping an executable, and |
+For purposes of finding `Init5e1.scm', dumping an executable, and |
dynamic linking, a SCM session needs the pathname of its executable
image.
@@ -7336,7 +7536,7 @@ directly to `find_impl_file' (*note File-System Habitat::).
In order to find the habitat for a unix program, we first need to know
the full pathname for the associated executable file.
- - Function: char * dld_find_executable (const char *COMMAND)
+ -- Function: char * dld_find_executable (const char *COMMAND) |
`dld_find_executable' returns the absolute path name of the file
that would be executed if COMMAND were given as a command. It
looks up the environment variable PATH, searches in each of the
@@ -7353,10 +7553,10 @@ the full pathname for the associated executable file.
...
}
- *Note:* If the current process is executed using the `execve'
- call without passing the correct path name as argument 0,
- `dld_find_executable (argv[0]) ' will also fail to locate the
- executable file.
+ *Note@:* If the current process is executed using the |
+ `execve' call without passing the correct path name as |
+ argument 0, `dld_find_executable (argv[0]) ' will also fail |
+ to locate the executable file. |
`dld_find_executable' returns zero if `command' is not found in
any of the directories listed in `PATH'.
@@ -7364,25 +7564,25 @@ the full pathname for the associated executable file.

File: scm.info, Node: Script Support, Prev: Executable Pathname, Up: Program Self-Knowledge
-Script Support
---------------
+6.3.3 Script Support |
+-------------------- |
Source code for these C functions is in the file `script.c'. *Note
Scripting:: for a description of script argument processing.
`script_find_executable' is only defined on unix systems.
- - Function: char * script_find_executable (const char *NAME)
+ -- Function: char * script_find_executable (const char *NAME) |
`script_find_executable' returns the path name of the executable
which is invoked by the script file NAME; NAME if it is a binary
executable (not a script); or 0 if NAME does not exist or is not
executable.
- - Function: char ** script_process_argv (int ARGC; char **ARGV)
+ -- Function: char ** script_process_argv (int ARGC; char **ARGV) |
Given an "main" style argument vector ARGV and the number of
arguments, ARGC, `script_process_argv' returns a newly allocated
argument vector in which the second line of the script being
- invoked is substituted for the corresponding meta-argument.
+ invoked is substituted for the corresponding meta-argument.
If the script does not have a meta-argument, or if the file named
by the argument following a meta-argument cannot be opened for
@@ -7391,14 +7591,14 @@ Scripting:: for a description of script argument processing.
`script_process_argv' correctly processes argument vectors of
nested script invocations.
- - Function: int script_count_argv (char **ARGV)
+ -- Function: int script_count_argv (char **ARGV) |
Returns the number of argument strings in ARGV.

File: scm.info, Node: Improvements To Make, Prev: Program Self-Knowledge, Up: The Implementation
-Improvements To Make
-====================
+6.4 Improvements To Make |
+======================== |
* Allow users to set limits for `malloc()' storage.
@@ -7450,8 +7650,8 @@ Improvements To Make

File: scm.info, Node: VMS Dynamic Linking, Prev: Improvements To Make, Up: Improvements To Make
|
-VMS Dynamic Linking
--------------------
+6.4.1 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
@@ -7479,7 +7679,7 @@ with a VMS system needs to finish and debug it.
PSECT_ATTR=the_heap,NOSHR,LCL
PSECT_ATTR=the_environment,NOSHR,LCL
- _Notice:_ The "psect" (Program Section) attributes.
+ _Notice_ The "psect" (Program Section) attributes. |
`LCL'
means to keep the name local to the shared library. You
almost always want to do that for a good clean library.
@@ -7502,18 +7702,18 @@ with a VMS system needs to finish and debug it.
made read-only. I have a DCL command procedure to do this if you
want it.
- 4. Now MAIN.EXE would be linked thusly:
+ 4. Now MAIN.EXE would be linked thusly:
$ DEFINE LISPRTL USER$DISK:[JAFFER]LISPRTL.EXE
-
+
$LINK MAIN.OBJ,SYS$INPUT:/OPT
SYS$LIBRARY:VAXCRTL/SHARE
LISPRTL/SHARE
Note the definition of the `LISPRTL' logical name. Without such a
- definition you will need to copy `LISPRTL.EXE' over to
- `SYS$SHARE:' (aka `SYS$LIBRARY:') in order to invoke the main
- program once it is linked.
+ definition you will need to copy `LISPRTL.EXE' over to `SYS$SHARE' |
+ (aka `SYS$LIBRARY') in order to invoke the main program once it is |
+ linked. |
5. Now say you have a file of optional subrs, `MYSUBRS.C'. And there
is a routine `INIT_MYSUBRS' that must be called before using it.
@@ -7575,855 +7775,972 @@ Procedure and Macro Index
This is an alphabetical list of all the procedures and macros in SCM.
+
* Menu:
-* #!: Unix Scheme Scripts.
+* #!: Unix Scheme Scripts. (line 40) |
* #': Common-Lisp Read Syntax.
+ (line 50) |
* #+: Common-Lisp Read Syntax.
+ (line 16) |
* #-: Common-Lisp Read Syntax.
+ (line 26) |
* #.: Common-Lisp Read Syntax.
+ (line 39) |
* #;text-till-end-of-line: Documentation and Comments.
-* #?column: Load Syntax. |
-* #?file: Load Syntax. |
-* #?line: Load Syntax. |
+ (line 31) |
+* #?column: Load Syntax. (line 12) |
+* #?file: Load Syntax. (line 16) |
+* #?line: Load Syntax. (line 11) |
* #\token: Common-Lisp Read Syntax.
+ (line 7) |
* #|: Common-Lisp Read Syntax.
-* $abs: Numeric.
-* $acos: Numeric.
-* $acosh: Numeric.
-* $asin: Numeric.
-* $asinh: Numeric.
-* $atan: Numeric.
-* $atan2: Numeric.
-* $atanh: Numeric.
-* $cos: Numeric.
-* $cosh: Numeric.
-* $exp: Numeric.
-* $expt: Numeric.
-* $log: Numeric.
-* $log10: Numeric.
-* $sin: Numeric.
-* $sinh: Numeric.
-* $sqrt: Numeric.
-* $tan: Numeric.
-* $tanh: Numeric.
-* -: SCM Options.
-* ---: SCM Options.
-* ---c-source-files=: Build Options.
-* ---compiler-options=: Build Options.
-* ---defines=: Build Options.
-* ---features=: Build Options.
-* ---help: SCM Options.
-* ---initialization=: Build Options.
-* ---libraries=: Build Options.
-* ---linker-options=: Build Options.
-* ---no-init-file: SCM Options.
-* ---object-files=: Build Options.
-* ---outname=: Build Options.
-* ---platform=: Build Options.
-* ---scheme-initial=: Build Options.
-* ---type=: Build Options.
-* ---version: SCM Options.
-* --batch-dialect=: Build Options.
-* --script-name=: Build Options.
-* -a: SCM Options.
-* -b: SCM Options.
-* -c <1>: SCM Options.
-* -c: Build Options.
-* -d: SCM Options.
-* -D: Build Options.
-* -e: SCM Options.
-* -f: SCM Options.
-* -F: Build Options.
-* -f: Build Options.
-* -h <1>: SCM Options.
-* -h: Build Options.
-* -i <1>: SCM Options.
-* -i: Build Options.
-* -j: Build Options.
-* -l <1>: SCM Options.
-* -l: Build Options.
-* -m: SCM Options.
-* -no-init-file: SCM Options.
-* -o <1>: SCM Options.
-* -o: Build Options.
-* -p <1>: SCM Options.
-* -p: Build Options.
-* -q: SCM Options.
-* -r: SCM Options.
-* -s <1>: SCM Options.
-* -s: Build Options.
-* -t: Build Options.
-* -u: SCM Options.
-* -v: SCM Options.
-* -w: Build Options.
-* @apply: Environment Frames.
-* @copy-tree: Storage.
+ (line 29) |
+* $abs: Numeric. (line 38) |
+* $acos: Numeric. (line 45) |
+* $acosh: Numeric. (line 51) |
+* $asin: Numeric. (line 44) |
+* $asinh: Numeric. (line 50) |
+* $atan: Numeric. (line 46) |
+* $atan2: Numeric. (line 60) |
+* $atanh: Numeric. (line 52) |
+* $cos: Numeric. (line 42) |
+* $cosh: Numeric. (line 48) |
+* $exp: Numeric. (line 39) |
+* $expt: Numeric. (line 63) |
+* $log: Numeric. (line 40) |
+* $log10: Numeric. (line 57) |
+* $sin: Numeric. (line 41) |
+* $sinh: Numeric. (line 47) |
+* $sqrt: Numeric. (line 37) |
+* $tan: Numeric. (line 43) |
+* $tanh: Numeric. (line 49) |
+* -: SCM Options. (line 108) |
+* ---: SCM Options. (line 109) |
+* ---c-source-files=: Build Options. (line 133) |
+* ---compiler-options=: Build Options. (line 118) |
+* ---defines=: Build Options. (line 111) |
+* ---features=: Build Options. (line 191) |
+* ---help: SCM Options. (line 20) |
+* ---initialization=: Build Options. (line 141) |
+* ---libraries=: Build Options. (line 103) |
+* ---linker-options=: Build Options. (line 121) |
+* ---no-init-file: SCM Options. (line 17) |
+* ---object-files=: Build Options. (line 137) |
+* ---outname=: Build Options. (line 97) |
+* ---platform=: Build Options. (line 12) |
+* ---scheme-initial=: Build Options. (line 125) |
+* ---type=: Build Options. (line 146) |
+* ---version: SCM Options. (line 23) |
+* --batch-dialect=: Build Options. (line 164) |
+* --script-name=: Build Options. (line 186) |
+* -a: SCM Options. (line 9) |
+* -b: SCM Options. (line 98) |
+* -c <1>: SCM Options. (line 46) |
+* -c: Build Options. (line 132) |
+* -d: SCM Options. (line 42) |
+* -D: Build Options. (line 110) |
+* -e: SCM Options. (line 45) |
+* -f: SCM Options. (line 37) |
+* -F: Build Options. (line 190) |
+* -f: Build Options. (line 68) |
+* -h <1>: SCM Options. (line 33) |
+* -h: Build Options. (line 163) |
+* -i <1>: SCM Options. (line 88) |
+* -i: Build Options. (line 140) |
+* -j: Build Options. (line 136) |
+* -l <1>: SCM Options. (line 36) |
+* -l: Build Options. (line 102) |
+* -m: SCM Options. (line 75) |
+* -no-init-file: SCM Options. (line 16) |
+* -o <1>: SCM Options. (line 52) |
+* -o: Build Options. (line 96) |
+* -p <1>: SCM Options. (line 62) |
+* -p: Build Options. (line 11) |
+* -q: SCM Options. (line 71) |
+* -r: SCM Options. (line 26) |
+* -s <1>: SCM Options. (line 103) |
+* -s: Build Options. (line 124) |
+* -t: Build Options. (line 145) |
+* -u: SCM Options. (line 82) |
+* -v: SCM Options. (line 66) |
+* -w: Build Options. (line 185) |
+* @apply: Environment Frames. (line 54) |
+* @copy-tree: Storage. (line 16) |
* @macroexpand1: Syntactic Hooks for Hygienic Macros.
-* _exclusive: Opening and Closing.
-* _ionbf: Opening and Closing.
-* _tracked: Opening and Closing.
-* abort: Internal State.
-* access: I/O-Extensions.
-* acct: Unix Extensions.
-* acons: Storage.
-* acosh: Numeric.
+ (line 107) |
+* _exclusive: Opening and Closing. (line 41) |
+* _ionbf: Opening and Closing. (line 28) |
+* _tracked: Opening and Closing. (line 35) |
+* abort: Internal State. (line 15) |
+* access: I/O-Extensions. (line 181) |
+* acct: Unix Extensions. (line 34) |
+* acons: Storage. (line 21) |
+* acosh: Numeric. (line 33) |
* add-alias: Configure Module Catalog.
-* add-finalizer: Storage.
+ (line 33) |
+* add-finalizer: Storage. (line 36) |
* add-link: Configure Module Catalog.
+ (line 12) |
* add-source: Configure Module Catalog.
-* alarm: Interrupts.
-* alarm-interrupt: Interrupts.
-* ALLOW_INTS: Signals.
-* alrm_signal: Signals.
-* ARGC: Cells.
-* arithmetic-error: Interrupts.
-* array->list: Conventional Arrays.
-* array-contents: Conventional Arrays.
-* array-equal?: Array Mapping.
-* array-fill!: Array Mapping.
-* array-map: Array Mapping. |
-* array-map!: Array Mapping.
-* array-prototype: Uniform Array.
-* array?: Uniform Array.
-* asinh: Numeric.
-* ASRTER: C Macros.
-* ASRTGO: 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.
-* box: Curses Miscellany.
-* broken-pipe: Posix Extensions.
-* call-with-outputs: Port Redirection.
-* CAR: Cells.
+ (line 41) |
+* alarm: Interrupts. (line 24) |
+* alarm-interrupt: Interrupts. (line 50) |
+* ALLOW_INTS: Signals. (line 33) |
+* alrm_signal: Signals. (line 14) |
+* ARGC: Cells. (line 57) |
+* arithmetic-error: Interrupts. (line 69) |
+* array->list: Conventional Arrays. (line 60) |
+* array-contents: Conventional Arrays. (line 64) |
+* array-equal?: Array Mapping. (line 18) |
+* array-fill!: Array Mapping. (line 11) |
+* array-map: Array Mapping. (line 43) |
+* array-map!: Array Mapping. (line 25) |
+* array-prototype: Uniform Array. (line 50) |
+* array?: Uniform Array. (line 46) |
+* asinh: Numeric. (line 32) |
+* ASRTER: C Macros. (line 7) |
+* ASRTGO: C Macros. (line 52) |
+* atanh: Numeric. (line 34) |
+* bit-count: Bit Vectors. (line 15) |
+* bit-count*: Bit Vectors. (line 37) |
+* bit-invert!: Bit Vectors. (line 23) |
+* bit-position: Bit Vectors. (line 18) |
+* bit-set*!: Bit Vectors. (line 26) |
+* boot-tail <1>: Dump. (line 38) |
+* boot-tail: SCM Session. (line 25) |
+* box: Curses Miscellany. (line 21) |
+* broken-pipe: Posix Extensions. (line 27) |
+* call-with-outputs: Port Redirection. (line 26) |
+* CAR: Cells. (line 23) |
* cbreak: Terminal Mode Setting.
-* CCLO_LENGTH: Header Cells.
-* CDR: Cells.
-* char: Type Conversions.
-* char-ready: Port Properties.
-* char-ready? <1>: Socket.
-* char-ready?: Port Properties.
+ (line 12) |
+* CCLO_LENGTH: Header Cells. (line 101) |
+* CDR: Cells. (line 24) |
+* char: Type Conversions. (line 27) |
+* char-ready: Port Properties. (line 39) |
+* char-ready? <1>: Socket. (line 66) |
+* char-ready?: Port Properties. (line 37) |
* char:sharp: Modifying Read Syntax. |
-* CHARS: Header Cells.
-* chdir: I/O-Extensions.
-* CHEAP_CONTINUATIONS: Continuations.
-* chmod: I/O-Extensions.
-* chown: Posix Extensions.
+ (line 23) |
+* CHARS: Header Cells. (line 35) |
+* chdir: I/O-Extensions. (line 145) |
+* CHEAP_CONTINUATIONS: Continuations. (line 37) |
+* chmod: I/O-Extensions. (line 160) |
+* chown: Posix Extensions. (line 255) |
* clearok: Output Options Setting.
-* close-port <1>: Window Manipulation.
-* close-port <2>: Posix Extensions.
-* close-port: Opening and Closing.
-* closedir: I/O-Extensions.
-* CLOSEDP: Ptob Cells.
-* CLOSUREP: Cells.
-* CODE: Cells.
+ (line 11) |
+* close-port <1>: Window Manipulation. (line 24) |
+* close-port <2>: Posix Extensions. (line 35) |
+* close-port: Opening and Closing. (line 55) |
+* closedir: I/O-Extensions. (line 101) |
+* CLOSEDP: Ptob Cells. (line 43) |
+* CLOSUREP: Cells. (line 49) |
+* CODE: Cells. (line 52) |
* comment: Documentation and Comments.
-* CONSP: Cells.
-* copy-tree: Storage.
-* cosh: Numeric.
-* could-not-open: Interrupts.
-* current-error-port: Port Redirection.
-* current-input-port: Port Properties.
-* current-time: Time.
-* default-input-port: Line Editing.
-* default-output-port: Line Editing.
-* defconst: Define and Set.
-* DEFER_INTS: Signals.
-* 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.
-* dump: Dump.
-* duplicate-port: I/O-Extensions.
-* dyn:call: Dynamic Linking.
-* dyn:link: Dynamic Linking.
-* dyn:main-call: Dynamic Linking.
-* dyn:unlink: Dynamic Linking.
+ (line 23) |
+* CONSP: Cells. (line 35) |
+* copy-tree: Storage. (line 15) |
+* cosh: Numeric. (line 28) |
+* could-not-open: Interrupts. (line 66) |
+* current-error-port: Port Redirection. (line 7) |
+* current-input-port: Port Properties. (line 43) |
+* current-time: Time. (line 24) |
+* default-input-port: Line Editing. (line 21) |
+* default-output-port: Line Editing. (line 25) |
+* defconst: Define and Set. (line 22) |
+* DEFER_INTS: Signals. (line 26) |
+* defined?: Define and Set. (line 7) |
+* defmacro: Defmacro. (line 6) |
+* defsyntax: Macro Primitives. (line 36) |
+* defvar: Define and Set. (line 13) |
+* directory-for-each: I/O-Extensions. (line 105) |
+* display: Output. (line 9) |
+* dld_find_executable: Executable Pathname. (line 18) |
+* dump: Dump. (line 33) |
+* duplicate-port: I/O-Extensions. (line 78) |
+* dyn:call: Dynamic Linking. (line 79) |
+* dyn:link: Dynamic Linking. (line 71) |
+* dyn:main-call: Dynamic Linking. (line 91) |
+* dyn:unlink: Dynamic Linking. (line 106) |
* echo: Terminal Mode Setting.
-* ed: Editing Scheme Code.
-* enclose-array: Conventional Arrays.
-* end-of-program: Interrupts.
-* endwin: Curses.
-* ENV: Cells.
-* errno: Errors.
-* error: Errors.
-* eval: Evaluation.
-* EVAL: Evaluation.
-* eval: Eval and Load.
-* eval-string: Eval and Load.
-* exec-self: Internal State.
-* execl: I/O-Extensions.
-* execlp: I/O-Extensions.
-* execpath: Internal State.
-* execv: I/O-Extensions.
-* execvp: I/O-Extensions.
-* exit: SCM Session.
+ (line 39) |
+* ed: Editing Scheme Code. (line 7) |
+* enclose-array: Conventional Arrays. (line 39) |
+* end-of-program: Interrupts. (line 67) |
+* endwin: Curses. (line 15) |
+* ENV: Cells. (line 53) |
+* errno: Errors. (line 92) |
+* error: Errors. (line 113) |
+* eval: Evaluation. (line 102) |
+* EVAL: Evaluation. (line 91) |
+* eval: Eval and Load. (line 21) |
+* eval-string: Eval and Load. (line 24) |
+* exec-self: Internal State. (line 27) |
+* execl: I/O-Extensions. (line 207) |
+* execlp: I/O-Extensions. (line 208) |
+* execpath: Internal State. (line 78) |
+* execv: I/O-Extensions. (line 218) |
+* execvp: I/O-Extensions. (line 219) |
+* exit: SCM Session. (line 19) |
* extended-environment: Syntactic Hooks for Hygienic Macros.
-* file-position: I/O-Extensions.
-* file-set-position: I/O-Extensions.
-* fileno: I/O-Extensions.
-* final_scm: Embedding SCM.
-* find_impl_file: File-System Habitat.
-* force-output: Window Manipulation.
-* fork: Posix Extensions.
-* FPORTP: Ptob Cells.
-* free_continuation: Continuations.
-* freshline: Port Properties.
-* gc: Internal State.
-* gc-hook: Storage.
-* gc_mark: Marking Cells.
-* GCCDR: Marking Cells.
-* GCTYP16: Marking Cells.
-* gentemp: Defmacro.
-* get-internal-real-time: Time.
-* get-internal-run-time: Time.
-* getcwd: I/O-Extensions.
-* getegid: Posix Extensions.
-* geteuid: Posix Extensions.
-* getgid: Posix Extensions.
-* getgr: Posix Extensions.
-* getgroups: Posix Extensions.
+ (line 113) |
+* file-position: I/O-Extensions. (line 56) |
+* file-set-position: I/O-Extensions. (line 61) |
+* fileno: I/O-Extensions. (line 177) |
+* final_scm: Embedding SCM. (line 117) |
+* find_impl_file: File-System Habitat. (line 35) |
+* force-output: Window Manipulation. (line 30) |
+* fork: Posix Extensions. (line 44) |
+* FPORTP: Ptob Cells. (line 53) |
+* frame->environment: Debugging Continuations. |
+ (line 18) |
+* frame-eval: Debugging Continuations. |
+ (line 27) |
+* frame-trace: Debugging Continuations. |
+ (line 10) |
+* free_continuation: Continuations. (line 79) |
+* freshline: Port Properties. (line 26) |
+* gc: Internal State. (line 57) |
+* gc-hook: Storage. (line 28) |
+* gc_mark: Marking Cells. (line 27) |
+* GCCDR: Marking Cells. (line 15) |
+* GCTYP16: Marking Cells. (line 19) |
+* gentemp: Defmacro. (line 6) |
+* get-internal-real-time: Time. (line 17) |
+* get-internal-run-time: Time. (line 10) |
+* getcwd: I/O-Extensions. (line 150) |
+* getegid: Posix Extensions. (line 63) |
+* geteuid: Posix Extensions. (line 66) |
+* getgid: Posix Extensions. (line 60) |
+* getgr: Posix Extensions. (line 224) |
+* getgroups: Posix Extensions. (line 245) |
* gethost: Host and Other Inquiries.
-* getlogin: SCM Session.
+ (line 11) |
+* getlogin: SCM Session. (line 33) |
* getnet: Host and Other Inquiries.
+ (line 34) |
* getpeername: Internet Addresses and Socket Names.
-* getpid: I/O-Extensions.
-* getppid: Posix Extensions.
+ (line 33) |
+* getpid: I/O-Extensions. (line 53) |
+* getppid: Posix Extensions. (line 53) |
* getproto: Host and Other Inquiries.
-* getpw: Posix Extensions.
+ (line 54) |
+* getpw: Posix Extensions. (line 193) |
* getserv: Host and Other Inquiries.
+ (line 73) |
* getsockname: Internet Addresses and Socket Names.
-* getuid: Posix Extensions.
-* getyx: Input.
-* hang-up: Interrupts.
-* ICHR: Immediates.
-* ICHRP: Immediates.
+ (line 29) |
+* getuid: Posix Extensions. (line 57) |
+* getyx: Input. (line 24) |
+* hang-up: Interrupts. (line 68) |
+* ICHR: Immediates. (line 51) |
+* ICHRP: Immediates. (line 48) |
* identifier->symbol: Syntactic Hooks for Hygienic Macros.
+ (line 37) |
* identifier-equal?: Syntactic Hooks for Hygienic Macros.
+ (line 89) |
* identifier?: Syntactic Hooks for Hygienic Macros.
+ (line 13) |
* idlok: Output Options Setting.
-* IFLAGP: Immediates.
-* IMP: Immediates.
+ (line 18) |
+* IFLAGP: Immediates. (line 83) |
+* IMP: Immediates. (line 11) |
* inet:address->string: Internet Addresses and Socket Names.
+ (line 11) |
* inet:local-network-address: Internet Addresses and Socket Names.
+ (line 19) |
* inet:make-address: Internet Addresses and Socket Names.
+ (line 23) |
* inet:network: Internet Addresses and Socket Names.
+ (line 15) |
* inet:string->address: Internet Addresses and Socket Names.
-* init_buf0: Embedding SCM.
-* init_sbrk: Embedding SCM.
-* init_signals <1>: Embedding SCM.
-* init_signals: Signals.
-* initscr: Curses.
-* INPORTP: Ptob Cells.
-* int_signal: Signals.
-* integer->line-number: Line Numbers.
-* INUM: Immediates.
-* INUMP: Immediates.
-* isatty?: Port Properties.
-* ISYMCHARS: Immediates.
-* ISYMNUM: Immediates.
-* ISYMP: Immediates.
-* kill: Posix Extensions.
+ (line 7) |
+* init_buf0: Embedding SCM. (line 63) |
+* init_sbrk: Embedding SCM. (line 31) |
+* init_signals <1>: Embedding SCM. (line 85) |
+* init_signals: Signals. (line 7) |
+* initscr: Curses. (line 11) |
+* INPORTP: Ptob Cells. (line 37) |
+* int_signal: Signals. (line 13) |
+* integer->line-number: Line Numbers. (line 37) |
+* INUM: Immediates. (line 26) |
+* INUMP: Immediates. (line 21) |
+* isatty?: Port Properties. (line 33) |
+* ISYMCHARS: Immediates. (line 93) |
+* ISYMNUM: Immediates. (line 89) |
+* ISYMP: Immediates. (line 86) |
+* kill: Posix Extensions. (line 85) |
* leaveok: Output Options Setting.
-* LENGTH: Header Cells.
-* line-editing: Line Editing.
-* 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: Eval and Load.
+ (line 32) |
+* LENGTH: Header Cells. (line 22) |
+* line-editing: Line Editing. (line 33) |
+* line-number: Eval and Load. (line 34) |
+* line-number->integer: Line Numbers. (line 41) |
+* line-number?: Line Numbers. (line 44) |
+* link: Posix Extensions. (line 248) |
+* list->uniform-array: Uniform Array. (line 54) |
+* load: Dynamic Linking. (line 28) |
+* load-string: Eval and Load. (line 29) |
* load:sharp: Modifying Read Syntax. |
-* logaref: Uniform Array.
-* logaset!: Uniform Array.
-* long: Type Conversions.
-* long2num: Type Conversions.
-* lstat: Unix Extensions.
-* macroexpand: Defmacro.
-* macroexpand-1: Defmacro.
-* main: Embedding SCM.
-* makargvfrmstrs: Type Conversions.
-* makcclo: Header Cells.
+ (line 17) |
+* logaref: Uniform Array. (line 86) |
+* logaset!: Uniform Array. (line 98) |
+* long: Type Conversions. (line 22) |
+* long2num: Type Conversions. (line 10) |
+* lstat: Unix Extensions. (line 23) |
+* macroexpand: Defmacro. (line 6) |
+* macroexpand-1: Defmacro. (line 6) |
+* main: Embedding SCM. (line 12) |
+* makargvfrmstrs: Type Conversions. (line 76) |
+* makcclo: Header Cells. (line 96) |
* make-arbiter: Process Synchronization.
-* make-edited-line-port: Line Editing.
+ (line 35) |
+* make-edited-line-port: Line Editing. (line 29) |
* make-exchanger: Process Synchronization.
-* make-soft-port: Soft Ports.
-* make-stream-socket: Socket.
-* make-stream-socketpair: Socket.
-* make_continuation: Continuations.
-* make_gsubr: Defining Subrs.
-* make_root_continuation: Continuations.
-* makfrom0str: Type Conversions.
-* makfromstr: Type Conversions.
-* makfromstrs: Type Conversions.
-* MAKICHR: Immediates.
-* MAKIFLAG: Immediates.
-* MAKINUM: Immediates.
-* MAKISYM: Immediates.
-* MAKSPCSYM: Immediates.
-* mark_locations: Marking Cells.
-* milli-alarm: Interrupts.
-* mkdir: I/O-Extensions.
-* mknod: Unix Extensions.
-* must_free: Allocating memory.
-* must_free_argv: Type Conversions.
-* must_malloc: Allocating memory.
-* must_malloc_cell: Allocating memory.
-* must_realloc: Allocating memory.
-* must_realloc_cell: Allocating memory.
-* mvwin: Window Manipulation.
-* NCONSP: Cells.
-* NEWCELL: Cells.
-* newwin: Window Manipulation.
-* nice: Unix Extensions.
-* NIMP: Immediates.
-* NINUMP: Immediates.
+ (line 12) |
+* make-soft-port: Soft Ports. (line 10) |
+* make-stream-socket: Socket. (line 14) |
+* make-stream-socketpair: Socket. (line 24) |
+* make_continuation: Continuations. (line 70) |
+* make_gsubr: Defining Subrs. (line 15) |
+* make_root_continuation: Continuations. (line 61) |
+* makfrom0str: Type Conversions. (line 61) |
+* makfromstr: Type Conversions. (line 62) |
+* makfromstrs: Type Conversions. (line 67) |
+* MAKICHR: Immediates. (line 54) |
+* MAKIFLAG: Immediates. (line 103) |
+* MAKINUM: Immediates. (line 29) |
+* MAKISYM: Immediates. (line 100) |
+* MAKSPCSYM: Immediates. (line 97) |
+* mark_locations: Marking Cells. (line 33) |
+* milli-alarm: Interrupts. (line 30) |
+* mkdir: I/O-Extensions. (line 131) |
+* mknod: Unix Extensions. (line 43) |
+* must_free: Allocating memory. (line 43) |
+* must_free_argv: Type Conversions. (line 84) |
+* must_malloc: Allocating memory. (line 14) |
+* must_malloc_cell: Allocating memory. (line 13) |
+* must_realloc: Allocating memory. (line 24) |
+* must_realloc_cell: Allocating memory. (line 22) |
+* mvwin: Window Manipulation. (line 41) |
+* NCONSP: Cells. (line 36) |
+* NEWCELL: Cells. (line 13) |
+* newwin: Window Manipulation. (line 7) |
+* nice: Unix Extensions. (line 29) |
+* NIMP: Immediates. (line 12) |
+* NINUMP: Immediates. (line 22) |
* nl: Terminal Mode Setting.
+ (line 50) |
* nocbreak: Terminal Mode Setting.
+ (line 13) |
* nodelay: Output Options Setting.
+ (line 53) |
* noecho: Terminal Mode Setting.
+ (line 40) |
* nonl: Terminal Mode Setting.
+ (line 51) |
* noraw: Terminal Mode Setting.
-* NSTRINGP: Header Cells.
-* num2dbl: Type Conversions.
-* num2long: Type Conversions.
-* num2short: Type Conversions.
-* NVECTORP: Header Cells.
-* open-file: Opening and Closing.
-* open-input-pipe: Posix Extensions.
-* open-output-pipe: Posix Extensions.
-* open-pipe: Posix Extensions.
-* open-ports: Opening and Closing.
-* opendir: I/O-Extensions.
-* OPENP: Ptob Cells.
-* OPFPORTP: Ptob Cells.
-* OPINFPORTP: Ptob Cells.
-* OPINPORTP: Ptob Cells.
-* OPOUTFPORTP: Ptob Cells.
-* OPOUTPORTP: Ptob Cells.
-* OPPORTP: Ptob Cells.
-* out-of-storage: Interrupts.
-* OUTPORTP: Ptob Cells.
-* overlay: Window Manipulation.
-* overwrite: Window Manipulation.
-* perror: Errors.
-* pi*: Numeric.
-* pi/: Numeric.
-* pipe: Posix Extensions.
-* port-closed?: Port Properties.
-* port-column: Port Properties.
-* port-filename: Port Properties.
-* port-line: Port Properties.
-* port-type: Port Properties.
-* PORTP: Ptob Cells.
+ (line 29) |
+* NSTRINGP: Header Cells. (line 45) |
+* num2dbl: Type Conversions. (line 28) |
+* num2long: Type Conversions. (line 20) |
+* num2short: Type Conversions. (line 23) |
+* NVECTORP: Header Cells. (line 17) |
+* open-file: Opening and Closing. (line 7) |
+* open-input-pipe: Posix Extensions. (line 17) |
+* open-output-pipe: Posix Extensions. (line 22) |
+* open-pipe: Posix Extensions. (line 10) |
+* open-ports: Opening and Closing. (line 48) |
+* opendir: I/O-Extensions. (line 88) |
+* OPENP: Ptob Cells. (line 42) |
+* OPFPORTP: Ptob Cells. (line 54) |
+* OPINFPORTP: Ptob Cells. (line 55) |
+* OPINPORTP: Ptob Cells. (line 35) |
+* OPOUTFPORTP: Ptob Cells. (line 56) |
+* OPOUTPORTP: Ptob Cells. (line 36) |
+* OPPORTP: Ptob Cells. (line 34) |
+* out-of-storage: Interrupts. (line 65) |
+* OUTPORTP: Ptob Cells. (line 38) |
+* overlay: Window Manipulation. (line 46) |
+* overwrite: Window Manipulation. (line 47) |
+* perror: Errors. (line 101) |
+* pi*: Numeric. (line 21) |
+* pi/: Numeric. (line 24) |
+* pipe: Posix Extensions. (line 40) |
+* port-closed?: Port Properties. (line 7) |
+* port-column: Port Properties. (line 19) |
+* port-filename: Port Properties. (line 14) |
+* port-line: Port Properties. (line 18) |
+* port-type: Port Properties. (line 10) |
+* PORTP: Ptob Cells. (line 33) |
+* pp: Debugging Scheme Code. |
+ (line 79) |
+* pprint: Debugging Scheme Code. |
+ (line 66) |
* print: Debugging Scheme Code.
+ (line 58) |
* print-args: Debugging Scheme Code.
-* procedure->identifier-macro: Macro Primitives.
-* procedure->macro: Macro Primitives.
-* procedure->memoizing-macro: Macro Primitives.
-* procedure->syntax: Macro Primitives.
+ (line 84) |
+* procedure->identifier-macro: Macro Primitives. (line 14) |
+* procedure->macro: Macro Primitives. (line 12) |
+* procedure->memoizing-macro: Macro Primitives. (line 13) |
+* procedure->syntax: Macro Primitives. (line 7) |
* procedure-documentation: Documentation and Comments.
-* profile-alarm: Interrupts.
-* profile-alarm-interrupt: Interrupts.
-* program-arguments: SCM Session.
-* putenv: I/O-Extensions.
-* qase: Define and Set.
-* quit: SCM Session.
+ (line 7) |
+* profile-alarm: Interrupts. (line 32) |
+* profile-alarm-interrupt: Interrupts. (line 52) |
+* program-arguments: SCM Session. (line 30) |
+* putenv: I/O-Extensions. (line 223) |
+* qase: Define and Set. (line 45) |
+* quit: SCM Session. (line 17) |
* raw: Terminal Mode Setting.
-* read-char <1>: Input.
-* 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.
-* redirect-port!: I/O-Extensions.
-* refresh: Window Manipulation.
+ (line 28) |
+* read-char <1>: Input. (line 7) |
+* read-char: Port Properties. (line 40) |
+* read-for-load: Line Numbers. (line 47) |
+* read-numbered: Line Numbers. (line 26) |
+* read:sharp: Modifying Read Syntax.
+ (line 7) |
+* readdir: I/O-Extensions. (line 92) |
+* readlink: Unix Extensions. (line 19) |
+* record-printer-set!: Records. (line 10) |
+* redirect-port!: I/O-Extensions. (line 83) |
+* refresh: Window Manipulation. (line 29) |
* regcomp: Regular Expression Pattern Matching.
+ (line 12) |
* regerror: Regular Expression Pattern Matching.
+ (line 34) |
* regexec: Regular Expression Pattern Matching.
+ (line 38) |
* regmatch: Regular Expression Pattern Matching.
+ (line 53) |
* regmatch?: Regular Expression Pattern Matching.
+ (line 46) |
* regmatchv: Regular Expression Pattern Matching.
+ (line 54) |
* regsearch: Regular Expression Pattern Matching.
+ (line 51) |
* regsearchv: Regular Expression Pattern Matching.
+ (line 52) |
* release-arbiter: Process Synchronization.
-* rename-file: I/O-Extensions.
+ (line 43) |
+* rename-file: I/O-Extensions. (line 155) |
* renamed-identifier: Syntactic Hooks for Hygienic Macros.
+ (line 26) |
* renaming-transformer: Syntactic Hooks for Hygienic Macros.
-* reopen-file: I/O-Extensions.
-* require: Dynamic Linking.
+ (line 142) |
+* reopen-file: I/O-Extensions. (line 74) |
+* require: Dynamic Linking. (line 11) |
* resetty: Terminal Mode Setting.
-* restart: Internal State.
-* restore_signals: Embedding SCM.
-* rewinddir: I/O-Extensions.
-* rmdir: I/O-Extensions.
-* room: Internal State.
+ (line 58) |
+* restart: Internal State. (line 18) |
+* restore_signals: Embedding SCM. (line 90) |
+* rewinddir: I/O-Extensions. (line 97) |
+* rmdir: I/O-Extensions. (line 140) |
+* room: Internal State. (line 61) |
* savetty: Terminal Mode Setting.
-* scalar->array: Array Mapping.
-* 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.
+ (line 59) |
+* scalar->array: Array Mapping. (line 51) |
+* scm_evstr: Callbacks. (line 24) |
+* scm_find_execpath: Embedding SCM. (line 36) |
+* scm_find_implpath: Embedding SCM. (line 50) |
+* scm_gc_protect: Changing Scm. (line 35) |
+* scm_init_from_argv: Embedding SCM. (line 74) |
+* scm_ldfile: Callbacks. (line 10) |
+* scm_ldprog: Callbacks. (line 15) |
+* scm_ldstr: Callbacks. (line 28) |
+* scm_protect_temp: Changing Scm. (line 26) |
+* scm_top_level: Embedding SCM. (line 93) |
+* scope-trace: Debugging Continuations. |
+ (line 23) |
+* script_count_argv: Script Support. (line 31) |
+* script_find_executable: Script Support. (line 12) |
+* script_process_argv: Script Support. (line 18) |
+* scroll: Output. (line 79) |
* scrollok: Output Options Setting.
-* serial-array-copy!: Array Mapping.
-* serial-array-map!: Array Mapping.
-* set!: Define and Set.
-* setegid: Posix Extensions.
-* seteuid: Posix Extensions.
-* setgid: Posix Extensions.
-* setgrent: Posix Extensions.
+ (line 40) |
+* serial-array-map!: Array Mapping. (line 39) |
+* serial-array:copy!: Array Mapping. (line 15) |
+* set!: Define and Set. (line 31) |
+* setegid: Posix Extensions. (line 77) |
+* seteuid: Posix Extensions. (line 81) |
+* setgid: Posix Extensions. (line 73) |
+* setgrent: Posix Extensions. (line 238) |
* sethostent: Host and Other Inquiries.
+ (line 26) |
* setnetent: Host and Other Inquiries.
+ (line 47) |
* setprotoent: Host and Other Inquiries.
-* setpwent: Posix Extensions.
+ (line 65) |
+* setpwent: Posix Extensions. (line 217) |
* setservent: Host and Other Inquiries.
-* setuid: Posix Extensions.
-* short: Type Conversions.
-* SHORT_ALIGN: Continuations.
-* SIDEVAL: Evaluation.
-* sinh: Numeric.
+ (line 87) |
+* setuid: Posix Extensions. (line 69) |
+* short: Type Conversions. (line 25) |
+* SHORT_ALIGN: Continuations. (line 28) |
+* SIDEVAL: Evaluation. (line 92) |
+* sinh: Numeric. (line 27) |
* socket-name:address: Internet Addresses and Socket Names.
+ (line 43) |
* socket-name:family: Internet Addresses and Socket Names.
+ (line 37) |
* socket-name:port-number: Internet Addresses and Socket Names.
-* socket:accept: Socket.
-* socket:bind: Socket.
-* socket:connect: Socket.
-* socket:listen: Socket.
-* socket:shutdown: Socket.
-* stack-trace: Errors.
-* STACK_GROWS_UP: Continuations.
-* stack_size: Continuations.
-* stat: I/O-Extensions.
-* STREAM: Ptob Cells.
+ (line 40) |
+* socket:accept: Socket. (line 72) |
+* socket:bind: Socket. (line 51) |
+* socket:connect: Socket. (line 45) |
+* socket:listen: Socket. (line 59) |
+* socket:shutdown: Socket. (line 33) |
+* stack-trace: Errors. (line 132) |
+* STACK_GROWS_UP: Continuations. (line 48) |
+* stack_size: Continuations. (line 54) |
+* stat: I/O-Extensions. (line 10) |
+* STREAM: Ptob Cells. (line 46) |
* string-edit: Regular Expression Pattern Matching.
+ (line 104) |
* string-split: Regular Expression Pattern Matching.
+ (line 96) |
* string-splitv: Regular Expression Pattern Matching.
-* STRINGP: Header Cells.
-* subwin: Window Manipulation.
-* SYMBOLP: Header Cells.
-* symlink: Unix Extensions.
-* sync: Unix Extensions.
+ (line 97) |
+* STRINGP: Header Cells. (line 44) |
+* subwin: Window Manipulation. (line 14) |
+* SYMBOLP: Header Cells. (line 32) |
+* symlink: Unix Extensions. (line 12) |
+* sync: Unix Extensions. (line 50) |
* syntax-quote: Syntactic Hooks for Hygienic Macros.
-* syntax-rules: Syntax-Rules.
-* tanh: Numeric.
+ (line 123) |
+* syntax-rules: Syntax-Rules. (line 6) |
+* tanh: Numeric. (line 29) |
* the-macro: Syntactic Hooks for Hygienic Macros.
-* throw_to_continuation: Continuations.
-* ticks: Interrupts.
-* ticks-interrupt: Interrupts.
-* touchline: Window Manipulation.
-* touchwin: Window Manipulation.
+ (line 129) |
+* throw_to_continuation: Continuations. (line 84) |
+* ticks: Interrupts. (line 7) |
+* ticks-interrupt: Interrupts. (line 17) |
+* touchline: Window Manipulation. (line 55) |
+* touchwin: Window Manipulation. (line 54) |
* trace: Debugging Scheme Code.
-* transpose-array: Conventional Arrays.
+ (line 41) |
+* transpose-array: Conventional Arrays. (line 21) |
* try-arbiter: Process Synchronization.
-* 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.
-* TYP7: Cells.
-* UCHARS: Header Cells.
-* ulong2num: Type Conversions.
-* umask: I/O-Extensions.
-* uname: Posix Extensions.
-* unctrl: Curses Miscellany.
-* uniform-array-read!: Uniform Array.
-* uniform-array-write: Uniform Array.
+ (line 39) |
+* try-create-file: I/O-Extensions. (line 67) |
+* try-load <1>: Line Numbers. (line 12) |
+* try-load: Eval and Load. (line 7) |
+* try-open-file: Opening and Closing. (line 8) |
+* ttyname: Posix Extensions. (line 262) |
+* TYP16: Cells. (line 29) |
+* TYP3: Cells. (line 27) |
+* TYP7: Cells. (line 28) |
+* UCHARS: Header Cells. (line 36) |
+* ulong2num: Type Conversions. (line 11) |
+* umask: I/O-Extensions. (line 172) |
+* uname: Posix Extensions. (line 172) |
+* unctrl: Curses Miscellany. (line 30) |
+* uniform-array-read!: Uniform Array. (line 67) |
+* uniform-array-write: Uniform Array. (line 79) |
* untrace: Debugging Scheme Code.
-* user-interrupt: Interrupts.
-* usr:lib: Dynamic Linking.
-* utime: I/O-Extensions.
-* vector-set-length!: Storage.
-* VECTORP: Header Cells.
-* VELTS: Header Cells.
-* verbose: Internal State.
-* virtual-alarm: Interrupts.
-* virtual-alarm-interrupt: Interrupts.
-* vms-debug: SCM Session.
-* void: Sweeping the Heap.
-* wadd: Output.
-* wait-for-input: Port Properties.
-* waitpid: Posix Extensions.
-* warn: Errors.
-* wclear: Output.
-* wclrtobot: Output.
-* wclrtoeol: Output.
-* wdelch: Output.
-* wdeleteln: Output.
-* werase: Output.
-* winch: Input.
-* winsch: Output.
-* winsertln: Output.
-* 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.
-* x:lib: Dynamic Linking.
+ (line 49) |
+* user-interrupt: Interrupts. (line 49) |
+* usr:lib: Dynamic Linking. (line 18) |
+* utime: I/O-Extensions. (line 167) |
+* vector-set-length!: Storage. (line 7) |
+* VECTORP: Header Cells. (line 16) |
+* VELTS: Header Cells. (line 21) |
+* verbose: Internal State. (line 33) |
+* virtual-alarm: Interrupts. (line 31) |
+* virtual-alarm-interrupt: Interrupts. (line 51) |
+* vms-debug: SCM Session. (line 41) |
+* void: Sweeping the Heap. (line 15) |
+* wadd: Output. (line 11) |
+* wait-for-input: Port Properties. (line 55) |
+* waitpid: Posix Extensions. (line 124) |
+* warn: Errors. (line 109) |
+* wclear: Output. (line 41) |
+* wclrtobot: Output. (line 47) |
+* wclrtoeol: Output. (line 51) |
+* wdelch: Output. (line 54) |
+* wdeleteln: Output. (line 61) |
+* werase: Output. (line 38) |
+* winch: Input. (line 19) |
+* winsch: Output. (line 67) |
+* winsertln: Output. (line 74) |
+* with-error-to-file: Port Redirection. (line 10) |
+* with-error-to-port: Port Redirection. (line 21) |
+* with-input-from-port: Port Redirection. (line 19) |
+* with-output-to-port: Port Redirection. (line 20) |
+* wmove: Window Manipulation. (line 65) |
+* wstandend: Curses Miscellany. (line 8) |
+* wstandout: Curses Miscellany. (line 7) |
+* x:lib: Dynamic Linking. (line 23) |
Variable Index
**************
This is an alphabetical list of all the global variables in SCM.
+
* Menu:
-* $pi: Numeric.
-* *argv*: SCM Variables.
-* *execpath: Embedding SCM.
-* *interactive* <1>: Internal State.
-* *interactive*: SCM Variables.
-* *load-pathname*: Eval and Load.
-* *load-reader*: Line Numbers.
-* *scm-version*: Internal State.
-* *slib-load-reader*: Line Numbers.
-* *syntax-rules*: SCM Variables.
+* $pi: Numeric. (line 14) |
+* *argv*: SCM Variables. (line 25) |
+* *execpath: Embedding SCM. (line 19) |
+* *interactive* <1>: Internal State. (line 7) |
+* *interactive*: SCM Variables. (line 36) |
+* *load-pathname*: Eval and Load. (line 15) |
+* *load-reader*: Line Numbers. (line 50) |
+* *scm-version*: Internal State. (line 66) |
+* *slib-load-reader*: Line Numbers. (line 51) |
+* *syntax-rules*: SCM Variables. (line 30) |
* af_inet: Host and Other Inquiries.
+ (line 7) |
* af_unix: Host and Other Inquiries.
-* BOOL_F: Immediates.
-* BOOL_T: Immediates.
-* EDITOR: SCM Variables.
-* EOF_VAL: Immediates.
-* EOL: Immediates.
-* errobj: Errors.
-* HOME: SCM Variables.
-* internal-time-units-per-second: Time.
-* INUM0: Immediates.
-* isymnames: Immediates.
-* most-negative-fixnum: Numeric.
-* most-positive-fixnum: Numeric.
-* NUM_ISPCSYM: Immediates.
-* NUM_ISYMS: Immediates.
-* 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.
-* symhash: Evaluation.
-* thrown_value: Continuations.
-* UNDEFINED: Immediates.
-* UNSPECIFIED: Immediates.
+ (line 8) |
+* BOOL_F: Immediates. (line 64) |
+* BOOL_T: Immediates. (line 61) |
+* EDITOR: SCM Variables. (line 18) |
+* EOF_VAL: Immediates. (line 71) |
+* EOL: Immediates. (line 67) |
+* errobj: Errors. (line 82) |
+* HOME: SCM Variables. (line 14) |
+* internal-time-units-per-second: Time. (line 7) |
+* INUM0: Immediates. (line 32) |
+* isymnames: Immediates. (line 106) |
+* most-negative-fixnum: Numeric. (line 11) |
+* most-positive-fixnum: Numeric. (line 7) |
+* NUM_ISPCSYM: Immediates. (line 110) |
+* NUM_ISYMS: Immediates. (line 111) |
+* open_both: Opening and Closing. (line 20) |
+* open_read: Opening and Closing. (line 18) |
+* open_write: Opening and Closing. (line 19) |
+* pi: Numeric. (line 15) |
+* SCHEME_LIBRARY_PATH: SCM Variables. (line 11) |
+* SCM_INIT_PATH: SCM Variables. (line 7) |
+* symhash: Evaluation. (line 51) |
+* thrown_value: Continuations. (line 51) |
+* UNDEFINED: Immediates. (line 74) |
+* UNSPECIFIED: Immediates. (line 78) |
Type Index
**********
This is an alphabetical list of data types and feature names in SCM.
+
* Menu:
* #! <1>: MS-DOS Compatible Scripts.
-* #!: Unix Scheme Scripts.
-* array-for-each: Array Mapping.
-* CELLPTR: Immediates.
-* CONTINUATION: Continuations.
-* curses: Dynamic Linking.
-* dump: Dump.
-* FARLOC: Evaluation.
-* GLOC: Evaluation.
-* gloc: Immediates.
-* i/o-extensions: Socket.
-* ichr: Immediates.
-* iflags: Immediates.
-* ILOC: Evaluation.
-* iloc: Immediates.
-* inum: Immediates.
-* ispcsym: Immediates.
-* isym: Immediates.
-* meta-argument <1>: Script Support.
-* meta-argument: Unix Scheme Scripts.
-* ptob: Ptob Cells.
-* regex: Dynamic Linking.
-* rev2-procedures: Dynamic Linking.
-* rev3-procedures: Dynamic Linking.
+ (line 15) |
+* #!: Unix Scheme Scripts. (line 11) |
+* array-for-each: Array Mapping. (line 6) |
+* CELLPTR: Immediates. (line 129) |
+* CONTINUATION: Continuations. (line 22) |
+* curses: Dynamic Linking. (line 49) |
+* dump: Dump. (line 6) |
+* FARLOC: Evaluation. (line 63) |
+* GLOC: Evaluation. (line 74) |
+* gloc: Immediates. (line 126) |
+* i/o-extensions: Socket. (line 10) |
+* ichr: Immediates. (line 45) |
+* iflags: Immediates. (line 58) |
+* ILOC: Evaluation. (line 56) |
+* iloc: Immediates. (line 123) |
+* inum: Immediates. (line 16) |
+* ispcsym: Immediates. (line 120) |
+* isym: Immediates. (line 115) |
+* meta-argument <1>: Script Support. (line 21) |
+* meta-argument: Unix Scheme Scripts. (line 11) |
+* ptob: Ptob Cells. (line 6) |
+* regex <1>: Sequence Comparison. (line 6) |
+* regex: Dynamic Linking. (line 64) |
+* rev2-procedures: Dynamic Linking. (line 37) |
+* rev3-procedures: Dynamic Linking. (line 38) |
* Scheme Script <1>: MS-DOS Compatible Scripts.
-* Scheme Script: Unix Scheme Scripts.
+ (line 15) |
+* Scheme Script: Unix Scheme Scripts. (line 11) |
* Scheme-Script <1>: MS-DOS Compatible Scripts.
-* Scheme-Script: Unix Scheme Scripts.
-* smob: Smob Cells.
-* socket: Socket.
-* spare: Header Cells.
-* STACKITEM: Continuations.
-* tc16_arbiter: Smob Cells.
-* tc16_array: Smob Cells.
-* tc16_bigneg: Smob Cells.
-* tc16_bigpos: Smob Cells.
-* tc16_flo: Smob Cells.
-* tc16_inpipe: Ptob Cells.
-* tc16_inport: Ptob Cells.
-* tc16_ioport: Ptob Cells.
-* tc16_macro: Smob Cells.
-* tc16_outpipe: Ptob Cells.
-* tc16_outport: Ptob Cells.
-* tc16_promise: Smob Cells.
-* tc16_sfport: Ptob Cells.
-* tc16_strport: Ptob Cells.
-* tc3_closure: Cells.
-* tc3_cons: Cells.
-* tc7_asubr: Subr Cells.
-* tc7_bvect: Header Cells.
-* tc7_contin: Header Cells.
-* tc7_cvect: Header Cells.
-* tc7_cxr: Subr Cells.
-* tc7_dvect: Header Cells.
-* tc7_fvect: Header Cells.
-* tc7_ivect: Header Cells.
-* tc7_lsubr: Subr Cells.
-* tc7_lsubr_2: Subr Cells.
-* tc7_msymbol: Header Cells.
-* tc7_rpsubr: Subr Cells.
-* tc7_specfun: Header Cells.
-* tc7_ssymbol: Header Cells.
-* tc7_string: Header Cells.
-* tc7_subr_0: Subr Cells.
-* tc7_subr_1: Subr Cells.
-* tc7_subr_1o: Subr Cells.
-* tc7_subr_2: Subr Cells.
-* tc7_subr_2o: Subr Cells.
-* tc7_subr_3: Subr Cells.
-* tc7_svect: Header Cells.
-* tc7_uvect: Header Cells.
-* tc7_vector: Header Cells.
-* tc_dblc: Smob Cells.
-* tc_dblr: Smob Cells.
-* tc_free_cell: Smob Cells.
-* turtle-graphics: Dynamic Linking.
-* unexec: Dump.
+ (line 15) |
+* Scheme-Script: Unix Scheme Scripts. (line 11) |
+* smob: Smob Cells. (line 6) |
+* socket: Socket. (line 87) |
+* spare: Header Cells. (line 10) |
+* STACKITEM: Continuations. (line 33) |
+* tc16_arbiter: Smob Cells. (line 72) |
+* tc16_array: Smob Cells. (line 78) |
+* tc16_bigneg: Smob Cells. (line 37) |
+* tc16_bigpos: Smob Cells. (line 36) |
+* tc16_flo: Smob Cells. (line 18) |
+* tc16_inpipe: Ptob Cells. (line 21) |
+* tc16_inport: Ptob Cells. (line 12) |
+* tc16_ioport: Ptob Cells. (line 18) |
+* tc16_macro: Smob Cells. (line 75) |
+* tc16_outpipe: Ptob Cells. (line 24) |
+* tc16_outport: Ptob Cells. (line 15) |
+* tc16_promise: Smob Cells. (line 69) |
+* tc16_sfport: Ptob Cells. (line 30) |
+* tc16_strport: Ptob Cells. (line 27) |
+* tc3_closure: Cells. (line 39) |
+* tc3_cons: Cells. (line 32) |
+* tc7_asubr: Subr Cells. (line 12) |
+* tc7_bvect: Header Cells. (line 55) |
+* tc7_contin: Header Cells. (line 76) |
+* tc7_cvect: Header Cells. (line 73) |
+* tc7_cxr: Subr Cells. (line 22) |
+* tc7_dvect: Header Cells. (line 70) |
+* tc7_fvect: Header Cells. (line 67) |
+* tc7_ivect: Header Cells. (line 58) |
+* tc7_lsubr: Subr Cells. (line 62) |
+* tc7_lsubr_2: Subr Cells. (line 59) |
+* tc7_msymbol: Header Cells. (line 29) |
+* tc7_rpsubr: Subr Cells. (line 47) |
+* tc7_specfun: Header Cells. (line 79) |
+* tc7_ssymbol: Header Cells. (line 26) |
+* tc7_string: Header Cells. (line 41) |
+* tc7_subr_0: Subr Cells. (line 16) |
+* tc7_subr_1: Subr Cells. (line 19) |
+* tc7_subr_1o: Subr Cells. (line 51) |
+* tc7_subr_2: Subr Cells. (line 44) |
+* tc7_subr_2o: Subr Cells. (line 55) |
+* tc7_subr_3: Subr Cells. (line 41) |
+* tc7_svect: Header Cells. (line 64) |
+* tc7_uvect: Header Cells. (line 61) |
+* tc7_vector: Header Cells. (line 13) |
+* tc_dblc: Smob Cells. (line 33) |
+* tc_dblr: Smob Cells. (line 30) |
+* tc_free_cell: Smob Cells. (line 15) |
+* turtle-graphics: Dynamic Linking. (line 56) |
+* unexec: Dump. (line 6) |
This is an alphabetical list of concepts introduced in this manual.
Concept Index
*************
+
* Menu:
* !#: MS-DOS Compatible Scripts.
+ (line 8) |
* !#.exe: MS-DOS Compatible Scripts.
+ (line 8) |
* #!: MS-DOS Compatible Scripts.
+ (line 8) |
* #!.bat: MS-DOS Compatible Scripts.
-* array <1>: Conventional Arrays.
-* array: Build Options.
-* array-for-each: Build Options.
-* arrays: Build Options.
-* bignums: Build Options.
-* byte: Build Options. |
-* callbacks: Callbacks.
-* careful-interrupt-masking: Build Options.
-* cautious: Build Options.
-* cheap-continuations: Build Options.
-* compiled-closure: Build Options.
-* continuations: Continuations.
-* curses: Build Options.
-* debug: Build Options.
+ (line 8) |
+* array <1>: Conventional Arrays. (line 9) |
+* array: Build Options. (line 195) |
+* array-for-each: Build Options. (line 198) |
+* arrays: Build Options. (line 201) |
+* bignums: Build Options. (line 204) |
+* byte: Build Options. (line 207) |
+* callbacks: Callbacks. (line 6) |
+* careful-interrupt-masking: Build Options. (line 210) |
+* cautious: Build Options. (line 216) |
+* cheap-continuations: Build Options. (line 225) |
+* compiled-closure: Build Options. (line 234) |
+* continuations: Continuations. (line 6) |
+* curses: Build Options. (line 237) |
+* debug: Build Options. (line 240) |
+* differ: Build Options. (line 245) |
* documentation string: Documentation and Comments.
-* dump: Build Options.
-* dynamic-linking: Build Options.
+ (line 13) |
+* dump: Build Options. (line 248) |
+* dynamic-linking: Build Options. (line 251) |
* ecache: Memory Management for Environments.
-* edit-line: Build Options.
-* Embedding SCM: Embedding SCM.
-* engineering-notation: Build Options.
+ (line 6) |
+* edit-line: Build Options. (line 254) |
+* Embedding SCM: Embedding SCM. (line 6) |
+* engineering-notation: Build Options. (line 257) |
* environments: Memory Management for Environments.
+ (line 6) |
* exchanger: Process Synchronization.
-* Exrename: Bibliography.
+ (line 6) |
+* Exrename: Bibliography. (line 26) |
* Extending Scm: Compiling and Linking Custom Files.
+ (line 13) |
* foo.c: Compiling and Linking Custom Files.
-* generalized-c-arguments: Build Options.
-* graphics: Packages.
-* hobbit: Packages.
-* i/o-extensions: Build Options.
-* IEEE: Bibliography.
-* inexact: Build Options.
-* JACAL: Bibliography.
-* lit: Build Options.
-* macro: Build Options.
+ (line 13) |
+* generalized-c-arguments: Build Options. (line 262) |
+* graphics: Packages. (line 23) |
+* hobbit: Packages. (line 23) |
+* i/o-extensions: Build Options. (line 265) |
+* IEEE: Bibliography. (line 7) |
+* inexact: Build Options. (line 269) |
+* JACAL: Bibliography. (line 49) |
+* lit: Build Options. (line 272) |
+* macro: Build Options. (line 275) |
* memory management: Memory Management for Environments.
-* mysql: Build Options.
-* no-heap-shrink: Build Options.
+ (line 6) |
+* mysql: Build Options. (line 279) |
+* no-heap-shrink: Build Options. (line 282) |
* NO_ENV_CACHE: Memory Management for Environments.
-* none: Build Options.
-* posix: Posix Extensions.
-* Posix: Posix Extensions.
-* posix: Build Options.
-* R4RS: Bibliography.
-* R5RS: Bibliography.
-* reckless: Build Options.
-* record: Build Options.
-* regex: Build Options.
-* rev2-procedures: Build Options.
-* rope <1>: Type Conversions.
-* rope: Callbacks.
-* SchemePrimer: Bibliography.
-* SICP: Build Options.
-* sicp: Build Options.
-* SICP: Bibliography.
-* signals: Signals.
-* Simply: Bibliography.
-* single-precision-only: Build Options.
-* SLIB: Bibliography.
-* socket: Build Options.
-* 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.
-* x <1>: Packages.
-* x: Build Options.
-* xlib: Packages.
-* Xlib: Packages.
-* xlib: Build Options.
-* xlibscm: Packages.
-* Xlibscm: Packages.
+ (line 89) |
+* none: Build Options. (line 287) |
+* posix: Posix Extensions. (line 6) |
+* Posix: Posix Extensions. (line 6) |
+* posix: Build Options. (line 290) |
+* R4RS: Bibliography. (line 11) |
+* R5RS: Bibliography. (line 18) |
+* reckless: Build Options. (line 295) |
+* record: Build Options. (line 300) |
+* regex: Build Options. (line 304) |
+* rev2-procedures: Build Options. (line 307) |
+* rope <1>: Type Conversions. (line 6) |
+* rope: Callbacks. (line 6) |
+* SchemePrimer: Bibliography. (line 39) |
+* SICP: Build Options. (line 313) |
+* sicp: Build Options. (line 311) |
+* SICP: Bibliography. (line 30) |
+* signals: Signals. (line 6) |
+* Simply: Bibliography. (line 35) |
+* single-precision-only: Build Options. (line 325) |
+* SLIB: Bibliography. (line 43) |
+* socket: Build Options. (line 331) |
+* stack-limit: Build Options. (line 335) |
+* tick-interrupts: Build Options. (line 342) |
+* turtlegr: Build Options. (line 345) |
+* unix: Unix Extensions. (line 6) |
+* Unix: Unix Extensions. (line 6) |
+* unix: Build Options. (line 349) |
+* wb: Build Options. (line 353) |
+* windows: Build Options. (line 356) |
+* X: Packages. (line 23) |
+* x <1>: Packages. (line 23) |
+* x: Build Options. (line 359) |
+* xlib: Packages. (line 23) |
+* Xlib: Packages. (line 23) |
+* xlib: Build Options. (line 362) |
+* xlibscm: Packages. (line 23) |
+* Xlibscm: Packages. (line 23) |

Tag Table:
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
+Node: Overview1536
+Node: SCM Features1989
+Node: SCM Authors4143
+Node: Copying5180
+Node: The SCM License5992
+Node: SIOD copyright11557
+Node: Bibliography13107
+Node: Installing SCM15109
+Node: Making SCM15754
+Node: SLIB16819
+Node: Building SCM18877
+Node: Invoking Build19585
+Node: Build Options22040
+Node: Compiling and Linking Custom Files39431
+Node: Installing Dynamic Linking41522
+Node: Configure Module Catalog43406
+Node: Saving Images45624
+Node: Automatic C Preprocessor Definitions46431
+Node: Problems Compiling50361
+Node: Problems Linking52136
+Node: Problems Running52527
+Node: Testing54761
+Node: Reporting Problems58062
+Node: Operational Features59026
+Node: Invoking SCM59588
+Node: SCM Options61368
+Node: Invocation Examples67150
+Node: SCM Variables68222
+Node: SCM Session70260
+Node: Editing Scheme Code72358
+Node: Debugging Scheme Code74649
+Node: Debugging Continuations80426
+Node: Errors87427
+Node: Memoized Expressions92326
+Node: Internal State94798
+Node: Scripting98885
+Node: Unix Scheme Scripts99319
+Node: MS-DOS Compatible Scripts102600
+Node: Unix Shell Scripts104740
+Node: The Language107016
+Node: Standards Compliance107768
+Node: Storage110334
+Node: Time113210
+Node: Interrupts114573
+Node: Process Synchronization118905
+Node: Files and Ports120751
+Node: Opening and Closing121212
+Node: Port Properties124312
+Node: Port Redirection127860
+Node: Soft Ports129689
+Node: Eval and Load131650
+Node: Line Numbers133499
+Node: Lexical Conventions136895
+Node: Common-Lisp Read Syntax137333
+Node: Load Syntax140333
+Node: Documentation and Comments141730
+Node: Modifying Read Syntax143385
+Node: Syntax145660
+Node: Define and Set146702
+Node: Defmacro150533
+Node: Syntax-Rules151743
+Node: Macro Primitives153671
+Node: Environment Frames155625
+Node: Syntactic Hooks for Hygienic Macros158186
+Node: Packages165692
+Node: Dynamic Linking166822
+Node: Dump171974
+Node: Numeric176337
+Node: Arrays180022
+Node: Conventional Arrays180378
+Node: Uniform Array184368
+Node: Bit Vectors189849
+Node: Array Mapping191571
+Node: Records194838
+Node: I/O-Extensions195880
+Node: Posix Extensions205962
+Node: Unix Extensions217519
+Node: Sequence Comparison219966
+Node: Regular Expression Pattern Matching220814
+Node: Line Editing225399
+Node: Curses227122
+Node: Output Options Setting228310
+Node: Terminal Mode Setting231348
+Node: Window Manipulation235160
+Node: Output239259
+Node: Input243747
+Node: Curses Miscellany245089
+Node: Sockets246858
+Node: Host and Other Inquiries247434
+Node: Internet Addresses and Socket Names251582
+Node: Socket253599
+Node: SCMDB261367
+Node: The Implementation262229
+Node: Data Types262689
+Node: Immediates263648
+Node: Cells269986
+Node: Header Cells273065
+Node: Subr Cells277878
+Node: Ptob Cells280896
+Node: Smob Cells283832
+Node: Data Type Representations287795
+Node: Operations292828
+Node: Garbage Collection293552
+Node: Marking Cells294295
+Node: Sweeping the Heap296714
+Node: Memory Management for Environments297826
+Node: Signals302473
+Node: C Macros304436
+Node: Changing Scm305798
+Node: Defining Subrs310460
+Node: Defining Smobs312471
+Node: Defining Ptobs315703
+Node: Allocating memory317010
+Node: Embedding SCM319539
+Node: Callbacks327837
+Node: Type Conversions329939
+Node: Continuations334522
+Node: Evaluation339275
+Node: Program Self-Knowledge344895
+Node: File-System Habitat345255
+Node: Executable Pathname348997
+Node: Script Support350834
+Node: Improvements To Make352348
+Node: VMS Dynamic Linking354705
+Node: Index359712

End Tag Table
diff --git a/scm.spec b/scm.spec
index 5205315..c22bcd8 100644
--- a/scm.spec
+++ b/scm.spec
@@ -1,7 +1,9 @@
%define name scm
-%define version 5d9
+%define version 5e1
%define release 1
%define implpath %{prefix}/lib/scm
+%define slibpath %{prefix}/lib/slib
+%define dumparch setarch i386
# rpm seems to require all on one line, bleah.
%define features cautious bignums arrays inexact dump dynamic-linking macro engineering-notation
@@ -17,8 +19,8 @@ Provides: scm
Requires: slib
Summary: SCM Scheme implementation.
-Source: ftp://swissnet.ai.mit.edu/pub/scm/scm%{version}.zip
-URL: http://swissnet.ai.mit.edu/~jaffer/SCM
+Source: ftp://swiss.csail.mit.edu/pub/scm/scm%{version}.zip
+URL: http://swiss.csail.mit.edu/~jaffer/SCM
BuildRoot: %{_tmppath}/%{name}%{version}
Prefix: /usr
@@ -43,10 +45,10 @@ unzip $RPM_SOURCE_DIR/scm%{version}.zip
# SLIB is required to build SCM.
if [ -n "$SCHEME_LIBRARY_PATH" ]; then
echo using SLIB $SCHEME_LIBRARY_PATH
-elif [ -d /usr/share/slib ]; then
- export SCHEME_LIBRARY_PATH=/usr/share/slib/
-elif [ -d /usr/lib/slib ]; then
- export SCHEME_LIBRARY_PATH=/usr/lib/slib/
+elif [ -d %{slibpath} ]; then
+ export SCHEME_LIBRARY_PATH=%{slibpath}/
+elif [ -d %{prefix}/share/slib ]; then
+ export SCHEME_LIBRARY_PATH=%{prefix}/share/slib/
fi
make scmlit
make clean
@@ -59,11 +61,20 @@ make check
# Build dlls
make x.so
-./build -h system -F curses -t dll --compiler-options="-O3"
-./build -h system -t dll -c sc2.c rgx.c record.c gsubr.c ioext.c posix.c \
- unix.c socket.c ramap.c --compiler-options="-O3"
-./build -h system -F edit-line -t dll --compiler-options="-O3"
-./build -h system -F x -t dll --compiler-options="-O3"
+./build -h system -t dll -F curses --compiler-options="-O3"
+./build -h system -t dll -c differ.c --compiler-options="-O3"
+./build -h system -t dll -c sc2.c --compiler-options="-O3"
+./build -h system -t dll -c rgx.c --compiler-options="-O3"
+./build -h system -t dll -c record.c --compiler-options="-O3"
+./build -h system -t dll -c gsubr.c --compiler-options="-O3"
+./build -h system -t dll -c ioext.c --compiler-options="-O3"
+./build -h system -t dll -c posix.c --compiler-options="-O3"
+./build -h system -t dll -c unix.c --compiler-options="-O3"
+./build -h system -t dll -c socket.c --compiler-options="-O3"
+./build -h system -t dll -c ramap.c --compiler-options="-O3"
+./build -h system -t dll -c byte.c --compiler-options="-O3"
+./build -h system -t dll -F edit-line --compiler-options="-O3"
+./build -h system -t dll -F x --compiler-options="-O3"
# Build libscm.a static library
./build -h system -F cautious bignums arrays inexact dynamic-linking -t lib \
@@ -78,9 +89,9 @@ make prefix=${RPM_BUILD_ROOT}%{prefix}/ installlib
rm -f ${RPM_BUILD_ROOT}%{prefix}/bin/scm
cp udscm5 ${RPM_BUILD_ROOT}%{prefix}/bin/
-# Assume SLIB is in /usr/share/slib, as installed by the slib rpm.
+# Assume SLIB is in %{slibpath}, as installed by the slib rpm.
cat > ${RPM_BUILD_ROOT}%{prefix}/lib/scm/require.scm <<EOF
-(set! library-vicinity (lambda () "%{prefix}/share/slib/"))
+(set! library-vicinity (lambda () "%{slibpath}/"))
EOF
mkdir -p ${RPM_BUILD_ROOT}%{prefix}/info/
@@ -91,13 +102,13 @@ cp *.info.gz ${RPM_BUILD_ROOT}%{prefix}/info/
rm -rf $RPM_BUILD_ROOT
%post
-/sbin/install-info /usr/info/scm.info.gz /usr/info/dir
-/sbin/install-info /usr/info/hobbit.info.gz /usr/info/dir
-/sbin/install-info /usr/info/Xlibscm.info.gz /usr/info/dir
-echo "(quit)" | %{prefix}/bin/udscm5 -no-init-file -r5 -o %{prefix}/bin/scm
-ln -s %{prefix}/bin/scm /usr/local/bin/scm
-ln -s %{prefix}/lib/scm /usr/local/lib/
-/usr/bin/scm -c "(require 'new-catalog)"
+/sbin/install-info %{prefix}/info/scm.info.gz %{prefix}/info/dir
+/sbin/install-info %{prefix}/info/hobbit.info.gz %{prefix}/info/dir
+/sbin/install-info %{prefix}/info/Xlibscm.info.gz %{prefix}/info/dir
+echo "(quit)" | %{dumparch} %{prefix}/bin/udscm5 -no-init-file -r5 -o %{prefix}/bin/scm
+ln -s %{prefix}/bin/scm %{prefix}/local/bin/scm
+ln -s %{prefix}/lib/scm %{prefix}/local/lib/
+%{prefix}/bin/scm -c "(require 'new-catalog)"
%verifyscript
cp -f %{prefix}/lib/scm/r4rstest.scm /tmp/
@@ -106,13 +117,13 @@ cp -f %{prefix}/lib/scm/r4rstest.scm /tmp/
%preun
rm -f %{prefix}/lib/scm/slibcat %{prefix}/lib/scm/implcat
-if [ -L /usr/local/bin/scm ] && \
- ls -l /usr/local/bin/scm | grep -q "> %{prefix}/bin/scm"; then
- rm -f /usr/local/bin/scm
+if [ -L %{prefix}/local/bin/scm ] && \
+ ls -l %{prefix}/local/bin/scm | grep -q "> %{prefix}/bin/scm"; then
+ rm -f %{prefix}/local/bin/scm
fi
-if [ -L /usr/local/lib/scm ] && \
- ls -l /usr/local/lib/scm | grep -q "> %{prefix}/lib/scm"; then
- rm -f /usr/local/lib/scm
+if [ -L %{prefix}/local/lib/scm ] && \
+ ls -l %{prefix}/local/lib/scm | grep -q "> %{prefix}/lib/scm"; then
+ rm -f %{prefix}/local/lib/scm
fi
rm -f %{prefix}/bin/scm
@@ -149,16 +160,23 @@ rm -f %{prefix}/bin/scm
%{prefix}/lib/scm/build
%{prefix}/lib/scm/Iedline.scm
%{prefix}/lib/scm/edline.so
+%{prefix}/lib/scm/Idiffer.scm
+%{prefix}/lib/scm/differ.so
%{prefix}/lib/scm/x.so
%{prefix}/lib/scm/xevent.scm
%{prefix}/lib/scm/xatoms.scm
%{prefix}/lib/scm/x11.scm
%{prefix}/lib/scm/keysymdef.scm
%{prefix}/lib/scm/r4rstest.scm
-/usr/info/Xlibscm.info.gz
-/usr/info/hobbit.info.gz
-/usr/info/scm.info.gz
-/usr/man/man1/scm.1.gz
+%{prefix}/lib/scm/byte.so
+%{prefix}/lib/scm/db.so
+%{prefix}/lib/scm/wbtab.scm
+%{prefix}/lib/scm/rwb-isam.scm
+%{prefix}/lib/scm/COPYING
+%{prefix}/info/Xlibscm.info.gz
+%{prefix}/info/hobbit.info.gz
+%{prefix}/info/scm.info.gz
+%{prefix}/man/man1/scm.1.gz
%{prefix}/lib/libscm.a
%{prefix}/include/scm.h
diff --git a/scm.texi b/scm.texi
index 2f87364..698bb6b 100644
--- a/scm.texi
+++ b/scm.texi
@@ -55,7 +55,7 @@ This manual documents the SCM Scheme implementation. SCM version
@value{SCMVERSION} was released @value{SCMDATE}. The most recent
information about SCM can be found on SCM's @dfn{WWW} home page:
-@center @url{http://swissnet.ai.mit.edu/~jaffer/SCM}
+@center @url{http://swiss.csail.mit.edu/~jaffer/SCM}
Copyright (C) 1990-1999 Free Software Foundation
@@ -105,9 +105,9 @@ The most recent information about SCM can be found on SCM's @dfn{WWW}
home page:
@ifset html
-<A HREF="http://swissnet.ai.mit.edu/~jaffer/SCM">
+<A HREF="http://swiss.csail.mit.edu/~jaffer/SCM">
@end ifset
-@center @url{http://swissnet.ai.mit.edu/~jaffer/SCM}
+@center @url{http://swiss.csail.mit.edu/~jaffer/SCM}
@ifset html
</A>
@end ifset
@@ -205,6 +205,58 @@ Authors have assigned their SCM copyrights to:
@center Free Software Foundation, Inc.
@center 59 Temple Place, Suite 330, Boston, MA 02111, USA
+@menu
+* The SCM License::
+* SIOD copyright::
+@end menu
+
+@node The SCM License, SIOD copyright, Copying, Copying
+@subsection The SCM License
+
+The license of SCM consists of the GNU GPL plus a special statement
+giving blanket permission to link with non-free software. This is the
+license statement as found in any individual file that it applies to:
+
+@quotation
+This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with this software; see the file COPYING. If not, write to the Free
+Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA
+
+As a special exception, the Free Software Foundation gives permission
+for additional uses of the text contained in its release of SCM.
+
+The exception is that, if you link the SCM library with other files to
+produce an executable, this does not by itself cause the resulting
+executable to be covered by the GNU General Public License. Your use of
+that executable is in no way restricted on account of linking the SCM
+library code into it.
+
+This exception does not however invalidate any other reasons why the
+executable file might be covered by the GNU General Public License.
+
+This exception applies only to the code released by the Free Software
+Foundation under the name SCM. If you copy code from other Free
+Software Foundation releases into a copy of SCM, as the General Public
+License permits, the exception does not apply to the code that you add
+in this way. To avoid misleading anyone as to the status of such
+modified files, you must delete this exception notice from them.
+
+If you write modifications of your own for SCM, it is your choice
+whether to permit this exception to apply to your modifications. If you
+do not wish that, delete this exception notice.
+@end quotation
+
@noindent
Permission to use, copy, modify, distribute, and sell this software and
its documentation for any purpose is hereby granted without fee,
@@ -237,7 +289,8 @@ THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR
OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-@heading SIOD copyright
+@node SIOD copyright, , The SCM License, Copying
+@subsection SIOD copyright
@sp 1
@center COPYRIGHT (c) 1989 BY
@@ -451,7 +504,7 @@ proceed:
@itemize @bullet
@item
-Use the @uref{http://swissnet.ai.mit.edu/~jaffer/buildscm.html, build}
+Use the @uref{http://swiss.csail.mit.edu/~jaffer/buildscm.html, build}
web page to create custom batch scripts for compiling SCM.
@item
@@ -480,34 +533,34 @@ low priority. SLIB is available from the same sites as SCM:
@ifclear html
@itemize @bullet
@item
-swissnet.ai.mit.edu:/pub/scm/slib3a1.tar.gz
+swiss.csail.mit.edu:/pub/scm/slib3a2.tar.gz
@item
-ftp.gnu.org:/pub/gnu/jacal/slib3a1.tar.gz
+ftp.gnu.org:/pub/gnu/jacal/slib3a2.tar.gz
@item
-ftp.cs.indiana.edu:/pub/scheme-repository/imp/slib3a1.tar.gz
+ftp.cs.indiana.edu:/pub/scheme-repository/imp/slib3a2.tar.gz
@end itemize
@end ifclear
@ifset html
@itemize @bullet
@item
-<A HREF="http://swissnet.ai.mit.edu/ftpdir/scm/slib3a1.zip">
-http://swissnet.ai.mit.edu/ftpdir/scm/slib3a1.zip
+<A HREF="http://swiss.csail.mit.edu/ftpdir/scm/slib3a2.zip">
+http://swiss.csail.mit.edu/ftpdir/scm/slib3a2.zip
</A>
@item
-<A HREF="ftp://ftp.gnu.org/pub/gnu/jacal/slib3a1.tar.gz">
-ftp.gnu.org:/pub/gnu/jacal/slib3a1.tar.gz
+<A HREF="ftp://ftp.gnu.org/pub/gnu/jacal/slib3a2.tar.gz">
+ftp.gnu.org:/pub/gnu/jacal/slib3a2.tar.gz
</A>
@item
-<A HREF="ftp://ftp.cs.indiana.edu/pub/scheme-repository/code/lib/slib3a1.tar.gz">
-ftp.cs.indiana.edu:/pub/scheme-repository/code/lib/slib3a1.tar.gz
+<A HREF="ftp://ftp.cs.indiana.edu/pub/scheme-repository/code/lib/slib3a2.tar.gz">
+ftp.cs.indiana.edu:/pub/scheme-repository/code/lib/slib3a2.tar.gz
</A>
@end itemize
@end ifset
@noindent
-Unpack SLIB (@samp{tar xzf slib3a1.tar.gz} or @samp{unzip -ao
-slib3a1.zip}) in an appropriate directory for your system; both
+Unpack SLIB (@samp{tar xzf slib3a2.tar.gz} or @samp{unzip -ao
+slib3a2.zip}) in an appropriate directory for your system; both
@code{tar} and @code{unzip} will create the directory @file{slib}.
@noindent
@@ -635,7 +688,7 @@ the SCM command line options.
@deffn {Build Option} -p @var{platform-name}
@deffnx {Build Option} ---platform=@var{platform-name}
specifies that the compilation should be for a computer/operating-system
-combination called @var{platform-name}. @emph{Note:} The case of
+combination called @var{platform-name}. @emph{Note@:} The case of
@var{platform-name} is distinguised. The current @var{platform-name}s
are all lower-case.
@@ -663,9 +716,9 @@ Options for libscm.a.
@item pg.opt
Options for pgscm, which instruments C functions.
@item udscm4.opt
-Options for targets udscm4 and myscm4 (scm).
+Options for targets udscm4 and dscm4 (scm).
@item udscm5.opt
-Options for targets udscm5 and myscm5 (scm).
+Options for targets udscm5 and dscm5 (scm).
@end table
The Makefile creates options files it depends on only if they do not
@@ -1036,6 +1089,7 @@ __MSDOS__ Turbo C, Borland C, and DJGPP
__NetBSD__ NetBSD
nosve Control Data NOS/VE
SVR2 System V Revision 2.
+sun SunOS
__SVR4 SunOS
THINK_C developement environment for the Macintosh
ultrix VAX with ULTRIX operating system.
@@ -1248,13 +1302,14 @@ tracking effects of changes to SCM on performance.
@table @asis
@item Sparc(SUN-4) heap is growing out of control
-You are experiencing a GC problem peculiar to the Sparc. The problem is
-that SCM doesn't know how to clear register windows. Every location
-which is not reused still gets marked at GC time. This causes lots of
-stuff which should be collected to not be. This will be a problem with
-any @emph{conservative} GC until we find what instruction will clear the
-register windows. This problem is exacerbated by using lots of
-call-with-current-continuations.
+You are experiencing a GC problem peculiar to the Sparc. The problem
+is that SCM doesn't know how to clear register windows. Every
+location which is not reused still gets marked at GC time. This
+causes lots of stuff which should be collected to not be. This will
+be a problem with any @emph{conservative} GC until we find what
+instruction will clear the register windows. This problem is
+exacerbated by using lots of call-with-current-continuations.
+A possible fix for dynthrow() is commented out in @file{continue.c}.
@end table
@node Reporting Problems, , Testing, Installing SCM
@@ -1295,6 +1350,7 @@ vendor is recommended.
* SCM Session::
* Editing Scheme Code::
* Debugging Scheme Code::
+* Debugging Continuations::
* Errors::
* Memoized Expressions::
* Internal State::
@@ -1658,7 +1714,7 @@ After editing, the modified file will be loaded.
@end table
-@node Debugging Scheme Code, Errors, Editing Scheme Code, Operational Features
+@node Debugging Scheme Code, Debugging Continuations, Editing Scheme Code, Operational Features
@section Debugging Scheme Code
@noindent
@@ -1716,19 +1772,40 @@ a list of these formerly traced identifiers.
The routines I use most frequently for debugging are:
-@deffn Procedure print arg1 @dots{}
+@defun print arg1 @dots{}
@code{Print} writes all its arguments, separated by spaces.
@code{Print} outputs a @code{newline} at the end and returns the value
of the last argument.
-One can just insert @samp{(print '<proc-name>} and @samp{)} around an
-expression in order to see its value as a program operates.
+One can just insert @samp{(print '<label>} and @samp{)} around an
+expression in order to see its values as a program operates.
+@end defun
+
+@defun pprint arg1 @dots{}
+@code{Pprint} pretty-prints (@pxref{Pretty-Print, , , slib, SLIB}) all
+its arguments, separated by newlines. @code{Pprint} returns the value
+of the last argument.
+
+One can just insert @samp{(pprint '<label>} and @samp{)} around an
+expression in order to see its values as a program operates.
+@emph{Note@:} @code{pretty-print} does @emph{not} format procedures.
+@end defun
+
+@noindent
+When typing at top level, @code{pprint} is not a good way to see
+nested structure because it will return the last object
+pretty-printed, which could be large. @code{pp} is a better choice.
+
+@deffn Procedure pp arg1 @dots{}
+@code{Pprint} pretty-prints (@pxref{Pretty-Print, , , slib, SLIB}) all
+its arguments, separated by newlines. @code{pp} returns
+@code{#<unspecified>}.
@end deffn
-@deffn Syntax print-args name1 @dots{}
-Writes @var{name1} @dots{} (separated by spaces) and then writes the
-values of the closest lexical bindings enclosing the call to
-@code{Print-args}.
+@deffn Syntax print-args name
+@deffnx Syntax print-args
+Writes @var{name} if supplied; then writes the names and values of the
+closest lexical bindings enclosing the call to @code{Print-args}.
@example
(define (foo a b) (print-args foo) (+ a b))
@@ -1756,14 +1833,111 @@ offers source code debugging from
GNU Emacs. PSD runs slowly, so start by instrumenting only a few
functions at a time.
@lisp
-http://swissnet.ai.mit.edu/ftpdir/scm/slib-psd1-3.tar.gz
-swissnet.ai.mit.edu:/pub/scm/slib-psd1-3.tar.gz
+http://swiss.csail.mit.edu/ftpdir/scm/slib-psd1-3.tar.gz
+swiss.csail.mit.edu:/pub/scm/slib-psd1-3.tar.gz
ftp.maths.tcd.ie:pub/bosullvn/jacal/slib-psd1-3.tar.gz
ftp.cs.indiana.edu:/pub/scheme-repository/utl/slib-psd1-3.tar.gz
@end lisp
+@node Debugging Continuations, Errors, Debugging Scheme Code, Operational Features
+@section Debugging Continuations
+
+These functions are defined in @file{debug.c}, all operate on captured
+continuations:
+
+@deffn Procedure frame-trace cont n
+Prints information about the code being executed and the environment
+scopes active for continuation frame @var{n} of continuation CONT. A
+"continuation frame" is an entry in the environment stack; a new frame
+is pushed when the environment is replaced or extended in a non-tail
+call context. Frame 0 is the top of the stack.
+@end deffn
+
+@deffn Procedure frame->environment cont n
+Prints the environment for continuation frame @var{n} of continuation
+@var{cont}. This contains just the names, not the values, of the
+environment.
+@end deffn
+
+@deffn Procedure scope-trace env
+will print information about active lexical scopes for environment
+@var{env}.
+@end deffn
+
+@deffn Procedure frame-eval cont n expr
+Evaluates @var{expr} in the environment defined by continuation frame
+@var{n} of continuation CONT and returns the result. Values in the
+environment may be returned or SET!.
+@end deffn
-@node Errors, Memoized Expressions, Debugging Scheme Code, Operational Features
+@ref{Errors, stack-trace} also now accepts an optional continuation
+argument. @code{stack-trace} differs from @code{frame-trace} in that
+it truncates long output using safeports and prints code from all
+available frames.
+
+@example
+(define k #f)
+(define (foo x y)
+ (set! k (call-with-current-continuation identity))
+ #f)
+(let ((a 3) (b 4))
+ (foo a b)
+ #f)
+(stack-trace k)
+@print{}
+;STACK TRACE
+1; ((#@@set! #@@k (#@@call-with-current-continuation #@@identity)) #f ...
+2; (#@@let ((a 3) (b 4)) (#@@foo #@@a #@@b) #f)
+@dots{}
+#t
+@end example
+@example
+(frame-trace k 0)
+@print{}
+(#@@call-with-current-continuation #@@identity)
+; in scope:
+; (x y) procedure foo#<unspecified>
+@end example
+@example
+(frame-trace k 1)
+@print{}
+((#@@set! #@@k (#@@call-with-current-continuation #@@identity)) #f)
+; in scope:
+; (x y) procedure foo#<unspecified>
+@end example
+@example
+(frame-trace k 2)
+@print{}
+(#@@let ((a 3) (b 4)) (#@@foo #@@a #@@b) #f)
+; in scope:
+; (a b . #@@let)#<unspecified>
+@end example
+@example
+(frame-trace k 3)
+@print{}
+(#@@let ((a 3) (b 4)) (#@@foo #@@a #@@b) #f)
+; in top level environment.
+@end example
+@example
+(frame->environment k 0)
+@print{}
+((x y) 2 foo)
+@end example
+@example
+(scope-trace (frame->environment k 0))
+@print{}
+; in scope:
+; (x y) procedure foo#<unspecified>
+@end example
+@example
+(frame-eval k 0 'x) @result{} 3
+
+(frame-eval k 0 '(set! x 8))
+(frame-eval k 0 'x) @result{} 8
+@end example
+
+
+@node Errors, Memoized Expressions, Debugging Continuations, Operational Features
@section Errors
@noindent
@@ -1990,7 +2164,7 @@ Restarts the SCM program with the same arguments as it was originally
invoked. All @samp{-l} loaded files are loaded again; If those files
have changed, those changes will be reflected in the new session.
-@emph{Note:} When running a saved executable (@pxref{Dump}),
+@emph{Note@:} When running a saved executable (@pxref{Dump}),
@code{restart} is redefined to be @code{exec-self}.
@end defun
@@ -2137,7 +2311,7 @@ POSIX shell-scripts if the first line is:
The following Scheme-Script prints factorial of its argument:
@example
-#! /usr/local/bin/scm \ %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
+#! /usr/local/bin/scm \ %0 %*
- !#
(define (fact.script args)
@@ -2191,13 +2365,13 @@ and MS-DOS. To implement this, I have written the MS-DOS programs:
@cindex #!
@cindex #!.bat
which are available from:
-@url{http://swissnet.ai.mit.edu/ftpdir/scm/sharpbang.zip}
+@url{http://swiss.csail.mit.edu/ftpdir/scm/sharpbang.zip}
@noindent
With these two programs installed in a @code{PATH} directory, we have
the following syntax for @var{<program>.BAT} files.
-@deftp file #! interpreter \ %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
+@deftp file #! interpreter \ %0 %*
@tindex Scheme Script
@tindex Scheme-Script
@@ -2205,7 +2379,7 @@ The first two characters of the Scheme-Script are @samp{#!}. The
@var{interpreter} can be either a unix style program path (using
@samp{/} between filename components) or a DOS program name or path.
The rest of the first line of the Scheme-Script should be literally
-@w{@samp{\ %0 %1 %2 %3 %4 %5 %6 %7 %8 %9}}, as shown.
+@w{@samp{\ %0 %*}}, as shown.
If @var{interpreter} has @samp{/} in it, @var{interpreter} is converted
to a DOS style filename (@samp{/} @result{} @samp{\}).
@@ -2274,7 +2448,7 @@ example.
@example
#! /bin/sh
-:;exec scm -e"(set! *script* \"$0\")" -l$0 $*
+:;exec scm -e"(set! *script* \"$0\")" -l$0 "$@@"
(define (fact.script args)
(cond ((and (= 1 (length args))
@@ -2397,7 +2571,7 @@ Many of the optional features are supported as well.
@itemx source
See SLIB file @file{Template.scm}.
@item current-time
-@xref{Time, , , slib, SLIB}.
+@xref{Time and Date, , , slib, SLIB}.
@item defmacro
@xref{Defmacro, , , slib, SLIB}.
@item getenv
@@ -2530,8 +2704,8 @@ seconds.
@defun current-time
Returns the time since 00:00:00 GMT, January 1, 1970, measured in
-seconds. @xref{Time, current-time, , slib, SLIB}. @code{current-time} is
-used in @ref{Time, , , slib, SLIB}.
+seconds. @xref{Time and Date, current-time, , slib, SLIB}. @code{current-time} is
+used in @ref{Time and Date, , , slib, SLIB}.
@end defun
@node Interrupts, Process Synchronization, Time, The Language
@@ -2810,7 +2984,7 @@ not to hang. If the @var{port} is at end of file then
the value returned by @code{current-input-port}.
@findex current-input-port
-@emph{Rationale:} @code{Char-ready?} exists to make it possible for a
+@emph{Rationale@:} @code{Char-ready?} exists to make it possible for a
program to
@findex char-ready?
accept characters from interactive ports without getting stuck waiting
@@ -2878,9 +3052,9 @@ accepting or delivering characters. It allows emulation of I/O ports.
@defun make-soft-port vector modes
Returns a port capable of receiving or delivering characters as
-specified by the @var{modes} string (@pxref{Files and Ports,
-open-file}). @var{vector} must be a vector of length 6. Its components
-are as follows:
+specified by the @var{modes} string (@pxref{Files and Ports, open-file}).
+@var{vector} must be a vector of length 5. Its components are as
+follows:
@enumerate 0
@item
@@ -3198,7 +3372,7 @@ will be the value of @code{read} for this expression, otherwise an error
will be signaled.
@end deffn
-@emph{Note:} When adding new @key{#} syntaxes, have your code save the
+@emph{Note@:} When adding new @key{#} syntaxes, have your code save the
previous value of @code{load:sharp}, @code{read:sharp}, or
@code{char:sharp} when defining it. Call this saved value if an
invocation's syntax is not recognized. This will allow @code{#+},
@@ -3748,10 +3922,12 @@ both denote the same binding in the usage environment of the new syntax.
* I/O-Extensions:: i/o-extensions
* Posix Extensions:: posix
* Unix Extensions:: non-posix unix
+* Sequence Comparison::
* Regular Expression Pattern Matching:: regex
* Line Editing:: edit-line
* Curses:: Screen Control
* Sockets:: Cruise the Net
+* SCMDB:: interface to MySQL
@end menu
@cindex Xlib
@@ -3764,22 +3940,9 @@ both denote the same binding in the usage environment of the new syntax.
@cindex hobbit
@menu
* Xlib: (Xlibscm). X Window Graphics.
-* Hobbit: (hobbit). Scheme-to-C Compiler.
+* Hobbit: (hobbit). Scheme-to-C Compiler
@end menu
-@iftex
-@section hobbit
-
-@ifset html
-<A HREF="hobbit_toc.html">
-@code{(require 'compile)}
-
-@dfn{hobbit}
-</A>
-is a SCM->C compiler.
-@end ifset
-@end iftex
-
@node Dynamic Linking, Dump, Packages, Packages
@section Dynamic Linking
@@ -4123,19 +4286,14 @@ The following syntax and procedures are SCM extensions to feature
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.
@example
-(create-array '#(ho) 4 3) @result{}
+(make-array '#(ho) 4 3) @result{}
#2A((ho ho ho) (ho ho ho) (ho ho ho) (ho ho ho))
@end example
-The rank may be elided, in which case it is read as one.
-@example
-'#A(a b c) @equiv{} '#(a b c)
-@end example
-
Unshared, conventional (not uniform) 0-based arrays of rank 1 are
equivalent to (and can't be distinguished from) scheme vectors.
@example
-(create-array '#(ho) 3) @result{} #(ho ho ho)
+(make-array '#(ho) 3) @result{} #(ho ho ho)
@end example
@defun transpose-array array dim0 dim1 @dots{}
@@ -4194,7 +4352,7 @@ In the case of a rank-0 array, returns the single element.
If @var{array} may be @dfn{unrolled} into a one dimensional shared
array without changing their order (last subscript changing fastest),
then @code{array-contents} returns that shared array, otherwise it
-returns @code{#f}. All arrays made by @var{create-array} may be
+returns @code{#f}. All arrays made by @var{make-array} may be
unrolled, some arrays made by @var{make-shared-array} may not be.
If the optional argument @var{strict} is provided, a shared array will
@@ -4213,13 +4371,13 @@ 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 @code{create-array}, detailed in @xref{Arrays, , , slib, SLIB}.
+is @code{make-array}, detailed in @xref{Arrays, , , slib, SLIB}.
@noindent
Unshared uniform character 0-based arrays of rank 1 (dimension)
are equivalent to (and can't be distinguished from) strings.
@example
-(create-array "" 3) @result{} "$q2"
+(make-array "" 3) @result{} "$q2"
@end example
@noindent
@@ -4227,9 +4385,7 @@ Unshared uniform boolean 0-based arrays of rank 1 (dimension) are
equivalent to (and can't be distinguished from) @ref{Bit Vectors,
bit-vectors}.
@example
-(create-array '#at() 3) @result{} #*000
-@equiv{}
-#At(#f #f #f) @result{} #*000
+(make-array '#1at() 3) @result{} #*000
@equiv{}
#1At(#f #f #f) @result{} #*000
@end example
@@ -4241,21 +4397,21 @@ according to the table:
@example
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
+() conventional vector #A
++64i complex (double precision) #A:floC64b
+64.0 double (double precision) #A:floR64b
+32.0 float (single precision) #A:floR32b
+32 unsigned integer (32-bit) #A:fixN32b
+-32 signed integer (32-bit) #A:fixZ32b
+-16 signed integer (16-bit) #A:fixZ16b
+#\a char (string) #A:char
+#t boolean (bit-vector) #A:bool
@end example
@noindent
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, @code{'#As32(3 5 9)}
+#\A character and the contents list. For example, @code{'#1A:fixZ32b(3 5 9)}
returns a uniform vector of signed integers.
@defun array? obj prototype
@@ -4339,7 +4495,7 @@ Bit vectors can be written and read as a sequence of @code{0}s and
@code{1}s prefixed by @code{#*}.
@example
-#At(#f #f #f #t #f #t #f) @result{} #*0001010
+#1At(#f #f #f #t #f #t #f) @result{} #*0001010
@end example
@noindent
@@ -4347,7 +4503,7 @@ Some of these operations will eventually be generalized to other
uniform-arrays.
@defun bit-count bool bv
-Returns the number occurrences of @var{bool} in @var{bv}.
+Returns the number of occurrences of @var{bool} in @var{bv}.
@end defun
@defun bit-position bool bv k
@@ -4394,8 +4550,8 @@ Stores @var{fill} in every element of @var{array}. The value returned
is unspecified.
@end defun
-@defun serial-array-copy! source destination
-Same as @code{array-copy!} but guaranteed to copy in row-major order.
+@defun serial-array:copy! destination source
+Same as @code{array:copy!} but guaranteed to copy in row-major order.
@end defun
@defun array-equal? array0 array1 @dots{}
@@ -5045,7 +5201,7 @@ string containing the file name of termainal device; otherwise
@code{#f}.
@end defun
-@node Unix Extensions, Regular Expression Pattern Matching, Posix Extensions, Packages
+@node Unix Extensions, Sequence Comparison, Posix Extensions, Packages
@section Unix Extensions
@cindex Unix
@@ -5108,7 +5264,18 @@ writing is done. The value returned is unspecified.
@end defun
-@node Regular Expression Pattern Matching, Line Editing, Unix Extensions, Packages
+
+@node Sequence Comparison, Regular Expression Pattern Matching, Unix Extensions, Packages
+@section Sequence Comparison
+
+@code{(require 'diff)}
+@ftindex regex
+
+A blazing fast implementation of the sequence-comparison module in
+SLIB, see @xref{Sequence Comparison, , , slib, SLIB}.
+
+
+@node Regular Expression Pattern Matching, Line Editing, Sequence Comparison, Packages
@section Regular Expression Pattern Matching
These functions are defined in @file{rgx.c} using a POSIX or GNU
@@ -5195,7 +5362,7 @@ The string to be operated upon.
The character position at which to begin the search or match. If absent,
the default is zero.
-@exdent @emph{Compiled _GNU_SOURCE and using GNU libregex only:}
+@exdent @emph{Compiled _GNU_SOURCE and using GNU libregex only@:}
When searching, if @var{start} is negative, the absolute value of
@var{start} will be used as the start location and reverse searching
@@ -5371,7 +5538,7 @@ If enabled (@var{bf} is @code{#t}), @code{force-output} is called on the
window @var{win}, and then the physical terminal and window @var{win}
are scrolled up one line.
-@emph{Note:} in order to get the physical scrolling effect on the
+@emph{Note@:} in order to get the physical scrolling effect on the
terminal, it is also necessary to call @code{idlok}.
@end defun
@@ -5404,7 +5571,7 @@ inherited, therefore, a program should call @code{cbreak} or @code{nocbreak}
explicitly. Most interactive programs using curses will set @code{CBREAK}
mode.
-@emph{Note:} @code{cbreak} overrides @code{raw}. For a discussion of
+@emph{Note@:} @code{cbreak} overrides @code{raw}. For a discussion of
how these routines interact with @code{echo} and @code{noecho}
@xref{Input, read-char}.
@end defun
@@ -5558,7 +5725,7 @@ The intent here is that text, including attributes, can be copied from
one place to another using inch and display. See @code{standout},
below.
-@emph{Note:} For @code{wadd} @var{ch} can be an integer and will insert
+@emph{Note@:} For @code{wadd} @var{ch} can be an integer and will insert
the character of the corresponding value.
@end defun
@@ -5669,7 +5836,7 @@ and @var{horch} are the characters the box is to be drawn with. If
@var{vertch} and @var{horch} are 0, then appropriate default characters,
@code{ACS_VLINE} and @code{ACS_HLINE}, will be used.
-@emph{Note:} @var{vertch} and @var{horch} can be an integers and will
+@emph{Note@:} @var{vertch} and @var{horch} can be an integers and will
insert the character (with attributes) of the corresponding values.
@end defun
@@ -5680,7 +5847,7 @@ displayed in the @kbd{C-x} notation. Printing characters are displayed
as is.
@end defun
-@node Sockets, , Curses, Packages
+@node Sockets, SCMDB, Curses, Packages
@section Sockets
@noindent
@@ -6044,13 +6211,31 @@ or you can use a client written in scheme:
(newline)))
@end example
+@node SCMDB, , Sockets, Packages
+@section SCMDB
+
+@code{(require 'mysql)}
+
+@ifset html
+<A HREF="http://www.dedecker.net/jessie/scmdb/">
+@end ifset
+@dfn{SCMDB}
+@ifset html
+</A>
+@end ifset
+is an add-on for SCM that ports the MySQL C-library to SCM.
+@ifclear html
+
+It is available from:
+@url{http://www.dedecker.net/jessie/scmdb/}
+@end ifclear
+
@iftex
@section Xlibscm
+@code{(require 'Xlib)}
@ifset html
<A HREF="Xlibscm_toc.html">
-@code{(require 'Xlib)}
-
@dfn{Xlibscm}
</A>
is a SCM interface to the
@@ -6058,9 +6243,28 @@ is a SCM interface to the
@end ifset
@ifclear html
-@xref{Top, ,SCM Language X Interface , Xlibscm, Xlibscm}, for the SCM
+@xref{Top, ,SCM Language X Interface , Xlibscm, Xlibscm} for the SCM
interface to the @dfn{X Window System}.
@end ifclear
+
+@section Hobbit
+
+@code{(require 'hobbit)}
+
+@code{(require 'compile)}
+@ifset html
+<A HREF="hobbit_toc.html">
+@dfn{Hobbit}
+</A>
+is a small optimizing scheme-to-C compiler
+generating C modules for use with the SCM interpreter.
+@end ifset
+
+@ifclear html
+@xref{Top, , SCM Compiler, hobbit, hobbit} for a small optimizing
+scheme-to-C compiler for use with the SCM interpreter.
+
+@end ifclear
@end iftex
@@ -6730,7 +6934,7 @@ gloc PPPPPPPPPPPPPPPPPPPPPPPPPPPPP001}
@r{ HEAP CELL: G=gc_mark; 1 during mark, 0 other times.
1s and 0s here indicate type. G missing means sys (not GC'd)
- SIMPLE:}
+ SIMPLE@:}
@t{cons ..........SCM car..............0 ...........SCM cdr.............G
closure ..........SCM code...........011 ...........SCM env...........CCG
HEADERs:
@@ -6751,7 +6955,7 @@ cvect .........long length....G0110101 ........double *words...........
contin .........long length....G0111101 .............*regs..............
specfun ................xxxxxxxxG1111111 ...........SCM name.............
cclo ..short length..xxxxxx10G1111111 ...........SCM **elts...........}
-@r{ PTOBs:}
+@r{ PTOBs@:}
@t{ port int portnum.CwroxxxxxxxxG0110111 ..........FILE *stream..........
socket int portnum.C001xxxxxxxxG0110111 ..........FILE *stream..........
inport int portnum.C011xxxxxxxxG0110111 ..........FILE *stream..........
@@ -6761,7 +6965,7 @@ 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..........}
-@r{ SUBRs:}
+@r{ SUBRs@:}
@t{ spare 010001x1
spare 010011x1
subr_0 ..........int hpoff.....01010101 ...........SCM (*f)()...........
@@ -6775,7 +6979,7 @@ subr_2o ..........int hpoff.....01101111 ...........SCM (*f)()...........
lsubr_2 ..........int hpoff.....01110101 ...........SCM (*f)()...........
lsubr ..........int hpoff.....01110111 ...........SCM (*f)()...........
rpsubr ..........int hpoff.....01111101 ...........SCM (*f)()...........}
-@r{ SMOBs:}
+@r{ SMOBs@:}
@t{free_cell
000000000000000000000000G1111111 ...........*free_cell........000
flo 000000000000000000000001G1111111 ...........float num............
@@ -7257,7 +7461,7 @@ define a new @code{MAKISYM} in @file{scm.h} and increment
add a string with the new name in the corresponding place in
@code{isymnames} in @file{repl.c}.
@item
-add @code{case:} clause to @code{ceval()} near @code{i_quasiquote} (in
+add @code{case@:} clause to @code{ceval()} near @code{i_quasiquote} (in
@file{eval.c}).
@end enumerate
@@ -7351,7 +7555,7 @@ is a function of one argument of type @code{SCM} (the cell to mark) and
returns type @code{SCM} which will then be marked. If no further
objects need to be marked then return an immediate object such as
@code{BOOL_F}. The smob cell itself will already have been marked.
-@emph{Note:} This is different from SCM versions prior to 5c5. Only
+@emph{Note@:} This is different from SCM versions prior to 5c5. Only
additional data specific to a smob type need be marked by @code{smob.mark}.
2 functions are provided:
@@ -7776,7 +7980,7 @@ number is returned. If not, the @code{ASRTER} macro calls @code{wta}
with @var{num} and strings @var{pos} and @var{s_caller}. For a listing
of useful predefined @var{pos} macros, @xref{C Macros}.
-@emph{Note:} Inexact numbers are accepted only by @code{num2dbl},
+@emph{Note@:} Inexact numbers are accepted only by @code{num2dbl},
@code{num2long}, and @code{num2ulong} (for when @code{SCM} is compiled
without bignums). To convert inexact numbers to exact numbers,
@xref{Numerical operations, inexact->exact, , r5rs, Revised(5) Scheme}.
@@ -7797,7 +8001,7 @@ of storage of array @var{ra}. Note that if @var{ra} is a
shared-array, the strorage accessed this way may be much larger than
@var{ra}.
-@emph{Note:} While you use a pointer returned from @code{scm_addr} or
+@emph{Note@:} While you use a pointer returned from @code{scm_addr} or
@code{scm_base_addr} you must keep a pointer to the associated
@code{SCM} object in a stack allocated variable or GC-protected
location in order to assure that SCM does not reuse that storage
@@ -7882,7 +8086,7 @@ each @code{CONTINUATION} has size @code{sizeof CONTINUATION}.
Otherwise, all but @dfn{root} @code{CONTINUATION}s have additional
storage (immediately following) to contain a copy of part of the stack.
-@emph{Note:} On systems with nonlinear stack disciplines (multiple
+@emph{Note@:} On systems with nonlinear stack disciplines (multiple
stacks or non-contiguous stack frames) copying the stack will not work
properly. These systems need to #define @code{CHEAP_CONTINUATIONS} in
@file{scmfig.h}.
@@ -8189,7 +8393,7 @@ main (int argc, char **argv)
@end example
@quotation
-@strong{Note:} If the current process is executed using the
+@strong{Note@@:} If the current process is executed using the
@code{execve} call without passing the correct path name as argument 0,
@code{dld_find_executable (argv[0]) } will also fail to locate the
executable file.
@@ -8330,7 +8534,7 @@ PSECT_ATTR=the_heap,NOSHR,LCL
PSECT_ATTR=the_environment,NOSHR,LCL}
@end format
-@emph{Notice:} The @dfn{psect} (Program Section) attributes.
+@emph{Notice@:} The @dfn{psect} (Program Section) attributes.
@table @code
@item LCL
means to keep the name local to the shared library. You almost always
@@ -8368,7 +8572,7 @@ $LINK MAIN.OBJ,SYS$INPUT:/OPT
Note the definition of the @code{LISPRTL} logical name. Without such a
definition you will need to copy @file{LISPRTL.EXE} over to
-@file{SYS$SHARE:} (aka @file{SYS$LIBRARY:}) in order to invoke the main
+@file{SYS$SHARE@:} (aka @file{SYS$LIBRARY@:}) in order to invoke the main
program once it is linked.
@item
diff --git a/scmfig.h b/scmfig.h
index 3e4b531..e43ab79 100644
--- a/scmfig.h
+++ b/scmfig.h
@@ -681,12 +681,6 @@ extern ints_infot *ints_info;
# define HAVE_PIPE
#endif
-/* IS_INF tests its floating point number for infiniteness */
-
-#ifndef IS_INF
-# define IS_INF(x) ((x)==(x)/2)
-#endif
-
#ifndef macintosh
# ifndef _M_ARM
# ifndef _M_ARMT
diff --git a/scmhob.scm b/scmhob.scm
index bdef580..c1912c5 100644
--- a/scmhob.scm
+++ b/scmhob.scm
@@ -32,6 +32,11 @@
(define (logsleft x y) (ash x y))
(define (logsright x y) (ash x (- 0 y)))
+(define logical:logand logand)
+(define logical:logior logior)
+(define logical:logxor logxor)
+(define logical:lognot lognot)
+
; immediate-integer (30-bit signed int) versions of arithmetic primitives:
(define %eqv? eqv?)
diff --git a/script.c b/script.c
index e186eb9..260e8b2 100644
--- a/script.c
+++ b/script.c
@@ -60,6 +60,11 @@
# endif /* def __sgi__ */
#endif /* def __SVR4 */
+#ifdef _WIN32
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h> /* GetModuleFileName */
+#endif
+
/* Concatentate str2 onto str1 at position n and return concatenated
string if file exists; 0 otherwise. */
@@ -167,7 +172,22 @@ char *find_impl_file(exec_path, generic_name, initname, sep)
char *sepptr = strrchr(exec_path, sep[0]);
char *extptr = exec_path + strlen(exec_path);
char *path = 0;
- /* fprintf(stderr, "dld_find_e %s\n", exec_path); fflush(stderr); */
+
+#ifdef _WIN32
+ char exec_buf[MAX_PATH];
+ HMODULE mod = GetModuleHandle(0); /* Returns module handle to current executable. */
+
+ if (mod) {
+ GetModuleFileName(mod, exec_buf, sizeof(exec_buf));
+ exec_path = exec_buf;
+ }
+#endif
+
+ /*fprintf(stderr, "dld_find_e %s\n", exec_path); fflush(stderr);*/
+
+ sepptr = strrchr(exec_path, sep[0]);
+ extptr = exec_path + strlen(exec_path);
+
if (sepptr) {
long sepind = sepptr - exec_path + 1L;
diff --git a/subr.c b/subr.c
index f486932..6c6bde9 100644
--- a/subr.c
+++ b/subr.c
@@ -1164,7 +1164,7 @@ SCM scm_logbitp(index, j1)
#else
ASRTER(INUMP(j1), j1, ARG2, s_logbitp);
#endif
- if (index >= LONG_BIT) return j1 < 0 ? BOOL_T : BOOL_F;
+ if (INUM(index) >= LONG_BIT) return j1 < 0 ? BOOL_T : BOOL_F;
return ((1L << INUM(index)) & INUM(j1)) ? BOOL_T : BOOL_F;
}
@@ -1297,19 +1297,19 @@ SCM scm_bitif(mask, n0, n1)
return MAKINUM((INUM(mask) & INUM(n0)) | (~(INUM(mask)) & INUM(n1)));
}
-SCM scm_copybitfield(to, start, rest)
- SCM to, start, rest;
+SCM scm_copybitfield(to, from, rest)
+ SCM to, from, rest;
{
long len;
- SCM end, from;
+ SCM start, end;
#ifndef RECKLESS
if (!(NIMP(rest) && CONSP(rest)))
wna: wta(UNDEFINED, (char *)WNA, s_copybitfield);
#endif
- end = CAR(rest);
+ start = CAR(rest);
rest = CDR(rest);
ASRTGO(NIMP(rest) && CONSP(rest), wna);
- from = CAR(rest);
+ end = CAR(rest);
ASRTGO(NULLP(CDR(rest)), wna);
ASRTER(INUMP(start) && INUM(start)>=0, start, ARG2, s_copybitfield);
len = INUM(end) - INUM(start);
diff --git a/sys.c b/sys.c
index 0ace3a5..8308fba 100644
--- a/sys.c
+++ b/sys.c
@@ -61,13 +61,14 @@ SCM *loc_try_create_file;
#ifndef STDC_HEADERS
char *ttyname P((int fd));
char *tmpnam P((char *s));
- sizet fwrite ();
# ifdef sun
# ifndef __SVR4
int fputs P((char *s, FILE* stream));
int fputc P((char c, FILE* stream));
int fflush P((FILE* stream));
# endif
+# else
+ sizet fwrite ();
# endif
int fgetc P((FILE* stream));
int fclose P((FILE* stream));
@@ -1679,9 +1680,9 @@ SCM scm_make_cont()
return cont;
}
static char s_sstale[] = "strangely stale";
-void scm_dynthrow(tocont, val)
+void scm_dynthrow(tocont, arg1, arg2, rest)
SCM tocont;
- SCM val;
+ SCM arg1, arg2, rest;
{
CONTINUATION *cont = CONT(tocont);
if (cont->stkbse != CONT(rootcont)->stkbse)
@@ -1708,9 +1709,14 @@ void scm_dynthrow(tocont, val)
scm_trace_env = cont->other.stkframe[2];
scm_trace = cont->other.stkframe[3];
#endif
+ if (!UNBNDP(arg2) && IM_VALUES_TOKEN == scm_env_tmp) {
+ scm_env_cons(arg2, rest);
+ arg2 = UNDEFINED;
+ }
ALLOW_INTS;
}
- throw_to_continuation(cont, val, CONT(rootcont));
+ if (!UNBNDP(arg2)) return; /* eval will signal wrong number of args */
+ throw_to_continuation(cont, arg1, CONT(rootcont));
wta(tocont, s_sstale, s_cont);
}
diff --git a/unif.c b/unif.c
index 86ae50a..200b9b3 100644
--- a/unif.c
+++ b/unif.c
@@ -57,7 +57,9 @@ complex double cvect
#ifndef STDC_HEADERS
int ungetc P((int c, FILE *stream));
+# ifndef sun
sizet fwrite ();
+# endif
#endif
long tc16_array = 0;
@@ -146,12 +148,17 @@ SCM makflo (x)
long scm_prot2type(prot)
SCM prot;
{
- if (BOOL_T==prot) return tc7_bvect;
if ICHRP(prot) return tc7_string;
- if (MAKINUM(32L)==prot) return tc7_uvect;
- if (MAKINUM(-32L)==prot) return tc7_ivect;
- if (MAKINUM(-16L)==prot) return tc7_svect;
- if INUMP(prot) return INUM(prot) > 0 ? tc7_uvect : tc7_ivect;
+ switch (prot) {
+ case BOOL_T: return tc7_bvect;
+ case MAKINUM(8L):
+ case MAKINUM(16L):
+ case MAKINUM(32L): return tc7_uvect;
+ case MAKINUM(-32L): return tc7_ivect;
+ case MAKINUM(-16L): return tc7_svect;
+ case MAKINUM(-8L): return tc7_svect;
+ }
+ /* if INUMP(prot) return INUM(prot) > 0 ? tc7_uvect : tc7_ivect; */
if IMP(prot) return tc7_vector;
# ifdef FLOATS
if INEXP(prot) {
@@ -1846,26 +1853,30 @@ int raprin1(exp, port, writing)
}
return 1;
}
- else
- lputs("At", port); break;
- case tc7_vector:
- lputc('A', port); break;
- case tc7_string:
- lputs("A\\", port); break;
- case tc7_uvect:
- lputs("Au32", port); break;
- case tc7_ivect:
- lputs("As32", port); break;
- case tc7_svect:
- lputs("As16", port); break;
+ default:
+ if (exp==v) lputc('1', port);
+ switch TYP7(v) {
+ case tc7_bvect:
+ lputs("A:bool", port); break;
+ case tc7_vector:
+ lputc('A', port); break;
+ case tc7_string:
+ lputs("A:char", port); break;
+ case tc7_uvect:
+ lputs("A:fixN32b", port); break;
+ case tc7_ivect:
+ lputs("A:fixZ32b", port); break;
+ case tc7_svect:
+ lputs("A:fixZ16b", port); break;
# ifdef FLOATS
- case tc7_fvect:
- lputs("Ar32", port); break;
- case tc7_dvect:
- lputs("Ar64", port); break;
- case tc7_cvect:
- lputs("Ac64", port); break;
+ case tc7_fvect:
+ lputs("A:floR32b", port); break;
+ case tc7_dvect:
+ lputs("A:floR64b", port); break;
+ case tc7_cvect:
+ lputs("A:floC64b", port); break;
# endif /*FLOATS*/
+ }
}
if ((v != exp) && 0==ARRAY_NDIM(exp)) {
lputc(' ', port);
diff --git a/version.txi b/version.txi
index e2502a5..5d3bd3e 100644
--- a/version.txi
+++ b/version.txi
@@ -1,2 +1,2 @@
-@set SCMVERSION 5d9
-@set SCMDATE November 2003
+@set SCMVERSION 5e1
+@set SCMDATE June 2005
diff --git a/x11.scm b/x11.scm
index 0ea4210..c4ffe28 100644
--- a/x11.scm
+++ b/x11.scm
@@ -121,6 +121,8 @@
(define x:Family-Internet 0)
(define x:Family-DE-Cnet 1)
(define x:Family-Chaos 2)
+(define x:Family-Internet6 6)
+(define x:Family-Server-Interpreted 5)
(define x:Property-New-Value 0)
(define x:Property-Delete 1)
(define x:Colormap-Uninstalled 0)
@@ -432,16 +434,16 @@
(define x:Queued-After-Reading 1)
(define x:Queued-After-Flush 2)
(define x:All-Planes -1)
-(define x:XN-Required-Char-Set 134531850)
-(define x:XN-Query-Orientation 134531889)
-(define x:XN-Base-Font-Name 134531929)
-(define x:XNOM-Automatic 134531962)
-(define x:XN-Missing-Char-Set 134531991)
-(define x:XN-Default-String 134532028)
-(define x:XN-Orientation 134532062)
-(define x:XN-Directional-Dependent-Drawing 134532091)
-(define x:XN-Contextual-Drawing 134532163)
-(define x:XN-Font-Info 134532205)
+(define x:XN-Required-Char-Set 134531802)
+(define x:XN-Query-Orientation 134531841)
+(define x:XN-Base-Font-Name 134531881)
+(define x:XNOM-Automatic 134531914)
+(define x:XN-Missing-Char-Set 134531943)
+(define x:XN-Default-String 134531980)
+(define x:XN-Orientation 134532014)
+(define x:XN-Directional-Dependent-Drawing 134532043)
+(define x:XN-Contextual-Drawing 134532107)
+(define x:XN-Font-Info 134532149)
(define x:XIM-Preedit-Area 1)
(define x:XIM-Preedit-Callbacks 2)
(define x:XIM-Preedit-Position 4)
@@ -451,48 +453,48 @@
(define x:XIM-Status-Callbacks 512)
(define x:XIM-Status-Nothing 1024)
(define x:XIM-Status-None 2048)
-(define x:XN-Va-Nested-List 134532416)
-(define x:XN-Query-Input-Style 134532451)
-(define x:XN-Client-Window 134532490)
-(define x:XN-Input-Style 134532522)
-(define x:XN-Focus-Window 134532550)
-(define x:XN-Resource-Name 134532580)
-(define x:XN-Resource-Class 134532612)
-(define x:XN-Geometry-Callback 134532646)
-(define x:XN-Destroy-Callback 134532686)
-(define x:XN-Filter-Events 134532724)
-(define x:XN-Preedit-Start-Callback 134532756)
-(define x:XN-Preedit-Done-Callback 134532805)
-(define x:XN-Preedit-Draw-Callback 134532852)
-(define x:XN-Preedit-Caret-Callback 134532899)
-(define x:XN-Preedit-State-Notify-Callback 134532948)
-(define x:XN-Preedit-Attributes 134533027)
-(define x:XN-Status-Start-Callback 134533069)
-(define x:XN-Status-Done-Callback 134533116)
-(define x:XN-Status-Draw-Callback 134533161)
-(define x:XN-Status-Attributes 134533206)
-(define x:XN-Area 134533246)
-(define x:XN-Area-Needed 134533261)
-(define x:XN-Spot-Location 134533289)
-(define x:XN-Colormap 134533321)
-(define x:XN-Std-Colormap 134533344)
-(define x:XN-Foreground 134533374)
-(define x:XN-Background 134533401)
-(define x:XN-Background-Pixmap 134533428)
-(define x:XN-Font-Set 134533468)
-(define x:XN-Line-Space 134533490)
-(define x:XN-Cursor 134533516)
-(define x:XN-Query-IM-Values-List 134533535)
-(define x:XN-Query-IC-Values-List 134533579)
-(define x:XN-Visible-Position 134533623)
-(define x:XNR6-Preedit-Callback 134533661)
-(define x:XN-String-Conversion-Callback 134533703)
-(define x:XN-String-Conversion 134533760)
-(define x:XN-Reset-State 134533800)
-(define x:XN-Hot-Key 134533828)
-(define x:XN-Hot-Key-State 134533848)
-(define x:XN-Preedit-State 134533879)
-(define x:XN-Separatorof-Nested-List 134533911)
+(define x:XN-Va-Nested-List 134532360)
+(define x:XN-Query-Input-Style 134532395)
+(define x:XN-Client-Window 134532434)
+(define x:XN-Input-Style 134532466)
+(define x:XN-Focus-Window 134532494)
+(define x:XN-Resource-Name 134532524)
+(define x:XN-Resource-Class 134532556)
+(define x:XN-Geometry-Callback 134532590)
+(define x:XN-Destroy-Callback 134532630)
+(define x:XN-Filter-Events 134532668)
+(define x:XN-Preedit-Start-Callback 134532700)
+(define x:XN-Preedit-Done-Callback 134532749)
+(define x:XN-Preedit-Draw-Callback 134532796)
+(define x:XN-Preedit-Caret-Callback 134532843)
+(define x:XN-Preedit-State-Notify-Callback 134532892)
+(define x:XN-Preedit-Attributes 134532955)
+(define x:XN-Status-Start-Callback 134532997)
+(define x:XN-Status-Done-Callback 134533044)
+(define x:XN-Status-Draw-Callback 134533089)
+(define x:XN-Status-Attributes 134533134)
+(define x:XN-Area 134533174)
+(define x:XN-Area-Needed 134533189)
+(define x:XN-Spot-Location 134533217)
+(define x:XN-Colormap 134533249)
+(define x:XN-Std-Colormap 134533272)
+(define x:XN-Foreground 134533302)
+(define x:XN-Background 134533329)
+(define x:XN-Background-Pixmap 134533356)
+(define x:XN-Font-Set 134533396)
+(define x:XN-Line-Space 134533418)
+(define x:XN-Cursor 134533444)
+(define x:XN-Query-IM-Values-List 134533463)
+(define x:XN-Query-IC-Values-List 134533507)
+(define x:XN-Visible-Position 134533551)
+(define x:XNR6-Preedit-Callback 134533589)
+(define x:XN-String-Conversion-Callback 134533631)
+(define x:XN-String-Conversion 134533688)
+(define x:XN-Reset-State 134533728)
+(define x:XN-Hot-Key 134533756)
+(define x:XN-Hot-Key-State 134533776)
+(define x:XN-Preedit-State 134533807)
+(define x:XN-Separatorof-Nested-List 134533839)
(define x:X-Buffer-Overflow -1)
(define x:X-Lookup-None 1)
(define x:X-Lookup-Chars 2)
diff --git a/xgen.scm b/xgen.scm
index b4dfdc6..11071a4 100755
--- a/xgen.scm
+++ b/xgen.scm
@@ -1,4 +1,4 @@
-#! /usr/local/bin/scm \ %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
+#! /usr/local/bin/scm \ %0 %*
- !#
;; Copyright (C) 1991-2000 Free Software Foundation, Inc.
;;
@@ -58,7 +58,7 @@ Usage: xgen.scm /usr/include/X11/Xlib.h
Creates xevent.h and xevent.scm, from the `typedef struct's
in /usr/include/X11/xlib.h.
-http://swissnet.ai.mit.edu/~jaffer/SCM
+http://swiss.csail.mit.edu/~jaffer/SCM
"
(current-error-port))
#f)